This commit is contained in:
8
node_modules/slate-react/Readme.md
generated
vendored
Normal file
8
node_modules/slate-react/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
This package contains the React-specific logic for Slate. It's separated further into a series of directories:
|
||||
|
||||
- [**Components**](./src/components) — containing the React components for rendering Slate editors.
|
||||
- [**Hooks**](./src/hooks) — containing a few React hooks for Slate editors.
|
||||
- [**Plugins**](./src/plugin) — containing the React-specific plugins for Slate editors.
|
||||
- [**Utils**](./src/utils) — containing a few private convenience modules.
|
||||
|
||||
Feel free to poke around in each of them to learn more!
|
||||
80
node_modules/slate-react/dist/components/editable.d.ts
generated
vendored
Normal file
80
node_modules/slate-react/dist/components/editable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import React from 'react';
|
||||
import { Element, NodeEntry, Range, Text } from 'slate';
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
import { DOMRange } from '../utils/dom';
|
||||
/**
|
||||
* `RenderElementProps` are passed to the `renderElement` handler.
|
||||
*/
|
||||
export interface RenderElementProps {
|
||||
children: any;
|
||||
element: Element;
|
||||
attributes: {
|
||||
'data-slate-node': 'element';
|
||||
'data-slate-inline'?: true;
|
||||
'data-slate-void'?: true;
|
||||
dir?: 'rtl';
|
||||
ref: any;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* `RenderLeafProps` are passed to the `renderLeaf` handler.
|
||||
*/
|
||||
export interface RenderLeafProps {
|
||||
children: any;
|
||||
leaf: Text;
|
||||
text: Text;
|
||||
attributes: {
|
||||
'data-slate-leaf': true;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* `EditableProps` are passed to the `<Editable>` component.
|
||||
*/
|
||||
export declare type EditableProps = {
|
||||
decorate?: (entry: NodeEntry) => Range[];
|
||||
onDOMBeforeInput?: (event: InputEvent) => void;
|
||||
placeholder?: string;
|
||||
readOnly?: boolean;
|
||||
role?: string;
|
||||
style?: React.CSSProperties;
|
||||
renderElement?: (props: RenderElementProps) => JSX.Element;
|
||||
renderLeaf?: (props: RenderLeafProps) => JSX.Element;
|
||||
renderPlaceholder?: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
scrollSelectionIntoView?: (editor: ReactEditor, domRange: DOMRange) => void;
|
||||
as?: React.ElementType;
|
||||
disableDefaultStyles?: boolean;
|
||||
} & React.TextareaHTMLAttributes<HTMLDivElement>;
|
||||
/**
|
||||
* Editable.
|
||||
*/
|
||||
export declare const Editable: (props: EditableProps) => JSX.Element;
|
||||
/**
|
||||
* The props that get passed to renderPlaceholder
|
||||
*/
|
||||
export declare type RenderPlaceholderProps = {
|
||||
children: any;
|
||||
attributes: {
|
||||
'data-slate-placeholder': boolean;
|
||||
dir?: 'rtl';
|
||||
contentEditable: boolean;
|
||||
ref: React.RefObject<any>;
|
||||
style: React.CSSProperties;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* The default placeholder element
|
||||
*/
|
||||
export declare const DefaultPlaceholder: ({ attributes, children, }: RenderPlaceholderProps) => JSX.Element;
|
||||
/**
|
||||
* A default memoized decorate function.
|
||||
*/
|
||||
export declare const defaultDecorate: (entry: NodeEntry) => Range[];
|
||||
/**
|
||||
* Check if an event is overrided by a handler.
|
||||
*/
|
||||
export declare const isEventHandled: <EventType extends React.SyntheticEvent<unknown, unknown>>(event: EventType, handler?: ((event: EventType) => void | boolean) | undefined) => boolean;
|
||||
/**
|
||||
* Check if a DOM event is overrided by a handler.
|
||||
*/
|
||||
export declare const isDOMEventHandled: <E extends Event>(event: E, handler?: ((event: E) => void | boolean) | undefined) => boolean;
|
||||
//# sourceMappingURL=editable.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/editable.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/editable.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/editable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAON,MAAM,OAAO,CAAA;AAEd,OAAO,EAEL,OAAO,EAEP,SAAS,EAET,KAAK,EACL,IAAI,EAEL,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOpD,OAAO,EAGL,QAAQ,EAMT,MAAM,cAAc,CAAA;AAwCrB;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,GAAG,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE;QACV,iBAAiB,EAAE,SAAS,CAAA;QAC5B,mBAAmB,CAAC,EAAE,IAAI,CAAA;QAC1B,iBAAiB,CAAC,EAAE,IAAI,CAAA;QACxB,GAAG,CAAC,EAAE,KAAK,CAAA;QACX,GAAG,EAAE,GAAG,CAAA;KACT,CAAA;CACF;AAED;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,GAAG,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV,UAAU,EAAE;QACV,iBAAiB,EAAE,IAAI,CAAA;KACxB,CAAA;CACF;AAED;;GAEG;AAEH,oBAAY,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,EAAE,CAAA;IACxC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,GAAG,CAAC,OAAO,CAAA;IAC1D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,GAAG,CAAC,OAAO,CAAA;IACpD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,GAAG,CAAC,OAAO,CAAA;IAClE,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAA;IAC3E,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,KAAK,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAA;AAEhD;;GAEG;AAEH,eAAO,MAAM,QAAQ,UAAW,aAAa,gBAg/C5C,CAAA;AAED;;GAEG;AACH,oBAAY,sBAAsB,GAAG;IACnC,QAAQ,EAAE,GAAG,CAAA;IACb,UAAU,EAAE;QACV,wBAAwB,EAAE,OAAO,CAAA;QACjC,GAAG,CAAC,EAAE,KAAK,CAAA;QACX,eAAe,EAAE,OAAO,CAAA;QACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QACzB,KAAK,EAAE,KAAK,CAAC,aAAa,CAAA;KAC3B,CAAA;CACF,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,kBAAkB,8BAG5B,sBAAsB,gBAOxB,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,EAAa,CAAA;AA4BtE;;GAEG;AAEH,eAAO,MAAM,cAAc,gHAIO,IAAI,GAAG,OAAO,yBAc/C,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,iBAAiB,uDAEJ,IAAI,GAAG,OAAO,yBAevC,CAAA"}
|
||||
28
node_modules/slate-react/dist/components/element.d.ts
generated
vendored
Normal file
28
node_modules/slate-react/dist/components/element.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { Range, Element as SlateElement } from 'slate';
|
||||
import { RenderElementProps, RenderLeafProps, RenderPlaceholderProps } from './editable';
|
||||
/**
|
||||
* Element.
|
||||
*/
|
||||
declare const Element: (props: {
|
||||
decorations: Range[];
|
||||
element: SlateElement;
|
||||
renderElement?: ((props: RenderElementProps) => JSX.Element) | undefined;
|
||||
renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
renderLeaf?: ((props: RenderLeafProps) => JSX.Element) | undefined;
|
||||
selection: Range | null;
|
||||
}) => JSX.Element;
|
||||
declare const MemoizedElement: React.MemoExoticComponent<(props: {
|
||||
decorations: Range[];
|
||||
element: SlateElement;
|
||||
renderElement?: ((props: RenderElementProps) => JSX.Element) | undefined;
|
||||
renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
renderLeaf?: ((props: RenderLeafProps) => JSX.Element) | undefined;
|
||||
selection: Range | null;
|
||||
}) => JSX.Element>;
|
||||
/**
|
||||
* The default element renderer.
|
||||
*/
|
||||
export declare const DefaultElement: (props: RenderElementProps) => JSX.Element;
|
||||
export default MemoizedElement;
|
||||
//# sourceMappingURL=element.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/element.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/element.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/element.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,EAAgB,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAA;AAapE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACvB,MAAM,YAAY,CAAA;AAEnB;;GAEG;AAEH,QAAA,MAAM,OAAO;iBACE,KAAK,EAAE;aACX,YAAY;6BACG,kBAAkB,KAAK,WAAW;+BAC/B,sBAAsB,KAAK,WAAW;0BAC5C,eAAe,KAAK,WAAW;eACzC,KAAK,GAAG,IAAI;iBAuGxB,CAAA;AAED,QAAA,MAAM,eAAe;iBA9GN,KAAK,EAAE;aACX,YAAY;6BACG,kBAAkB,KAAK,WAAW;+BAC/B,sBAAsB,KAAK,WAAW;0BAC5C,eAAe,KAAK,WAAW;eACzC,KAAK,GAAG,IAAI;kBAqHvB,CAAA;AAEF;;GAEG;AAEH,eAAO,MAAM,cAAc,UAAW,kBAAkB,gBASvD,CAAA;AAED,eAAe,eAAe,CAAA"}
|
||||
14
node_modules/slate-react/dist/components/leaf.d.ts
generated
vendored
Normal file
14
node_modules/slate-react/dist/components/leaf.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { Element, Text } from 'slate';
|
||||
import { RenderLeafProps, RenderPlaceholderProps } from './editable';
|
||||
declare const MemoizedLeaf: React.MemoExoticComponent<(props: {
|
||||
isLast: boolean;
|
||||
leaf: Text;
|
||||
parent: Element;
|
||||
renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
renderLeaf?: ((props: RenderLeafProps) => JSX.Element) | undefined;
|
||||
text: Text;
|
||||
}) => JSX.Element>;
|
||||
export declare const DefaultLeaf: (props: RenderLeafProps) => JSX.Element;
|
||||
export default MemoizedLeaf;
|
||||
//# sourceMappingURL=leaf.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/leaf.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/leaf.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"leaf.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/leaf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAQrC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AA0HpE,QAAA,MAAM,YAAY;YAlHR,OAAO;UACT,IAAI;YACF,OAAO;+BACY,sBAAsB,KAAK,WAAW;0BAC5C,eAAe,KAAK,WAAW;UAC9C,IAAI;kBAuHV,CAAA;AAEF,eAAO,MAAM,WAAW,UAAW,eAAe,gBAGjD,CAAA;AAED,eAAe,YAAY,CAAA"}
|
||||
9
node_modules/slate-react/dist/components/restore-dom/restore-dom-manager.d.ts
generated
vendored
Normal file
9
node_modules/slate-react/dist/components/restore-dom/restore-dom-manager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { RefObject } from 'react';
|
||||
import { ReactEditor } from '../../plugin/react-editor';
|
||||
export declare type RestoreDOMManager = {
|
||||
registerMutations: (mutations: MutationRecord[]) => void;
|
||||
restoreDOM: () => void;
|
||||
clear: () => void;
|
||||
};
|
||||
export declare const createRestoreDomManager: (editor: ReactEditor, receivedUserInput: RefObject<boolean>) => RestoreDOMManager;
|
||||
//# sourceMappingURL=restore-dom-manager.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/restore-dom/restore-dom-manager.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/restore-dom/restore-dom-manager.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"restore-dom-manager.d.ts","sourceRoot":"","sources":["../../packages/slate-react/src/components/restore-dom/restore-dom-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAGvD,oBAAY,iBAAiB,GAAG;IAC9B,iBAAiB,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;IACxD,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,uBAAuB,WAC1B,WAAW,qBACA,UAAU,OAAO,CAAC,KACpC,iBA+CF,CAAA"}
|
||||
8
node_modules/slate-react/dist/components/restore-dom/restore-dom.d.ts
generated
vendored
Normal file
8
node_modules/slate-react/dist/components/restore-dom/restore-dom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ComponentType, RefObject } from 'react';
|
||||
declare type RestoreDOMProps = {
|
||||
receivedUserInput: RefObject<boolean>;
|
||||
node: RefObject<HTMLDivElement>;
|
||||
};
|
||||
export declare const RestoreDOM: ComponentType<RestoreDOMProps>;
|
||||
export {};
|
||||
//# sourceMappingURL=restore-dom.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/restore-dom/restore-dom.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/restore-dom/restore-dom.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"restore-dom.d.ts","sourceRoot":"","sources":["../../packages/slate-react/src/components/restore-dom/restore-dom.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAa,aAAa,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AAe/E,aAAK,eAAe,GAAG;IACrB,iBAAiB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACrC,IAAI,EAAE,SAAS,CAAC,cAAc,CAAC,CAAA;CAChC,CAAA;AAwDD,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,eAAe,CAEjB,CAAA"}
|
||||
14
node_modules/slate-react/dist/components/slate.d.ts
generated
vendored
Normal file
14
node_modules/slate-react/dist/components/slate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { Descendant } from 'slate';
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
/**
|
||||
* A wrapper around the provider to handle `onChange` events, because the editor
|
||||
* is a mutable singleton so it won't ever register as "changed" otherwise.
|
||||
*/
|
||||
export declare const Slate: (props: {
|
||||
editor: ReactEditor;
|
||||
value: Descendant[];
|
||||
children: React.ReactNode;
|
||||
onChange?: ((value: Descendant[]) => void) | undefined;
|
||||
}) => JSX.Element;
|
||||
//# sourceMappingURL=slate.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/slate.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/slate.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AACvE,OAAO,EAAgB,UAAU,EAAY,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAYpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;YACR,WAAW;WACZ,UAAU,EAAE;cACT,MAAM,SAAS;wBACN,UAAU,EAAE,KAAK,IAAI;iBAwFzC,CAAA"}
|
||||
21
node_modules/slate-react/dist/components/string.d.ts
generated
vendored
Normal file
21
node_modules/slate-react/dist/components/string.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference types="react" />
|
||||
import { Text, Element } from 'slate';
|
||||
/**
|
||||
* Leaf content strings.
|
||||
*/
|
||||
declare const String: (props: {
|
||||
isLast: boolean;
|
||||
leaf: Text;
|
||||
parent: Element;
|
||||
text: Text;
|
||||
}) => JSX.Element;
|
||||
/**
|
||||
* Leaf strings without text, render as zero-width strings.
|
||||
*/
|
||||
export declare const ZeroWidthString: (props: {
|
||||
length?: number;
|
||||
isLineBreak?: boolean;
|
||||
isMarkPlaceholder?: boolean;
|
||||
}) => JSX.Element;
|
||||
export default String;
|
||||
//# sourceMappingURL=string.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/string.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/string.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/string.tsx"],"names":[],"mappings":";AACA,OAAO,EAAU,IAAI,EAAQ,OAAO,EAAQ,MAAM,OAAO,CAAA;AAOzD;;GAEG;AAEH,QAAA,MAAM,MAAM,UAAW;IACrB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,OAAO,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;CACX,gBAuCA,CAAA;AAiDD;;GAEG;AAEH,eAAO,MAAM,eAAe,UAAW;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,gBAkBA,CAAA;AAED,eAAe,MAAM,CAAA"}
|
||||
13
node_modules/slate-react/dist/components/text.d.ts
generated
vendored
Normal file
13
node_modules/slate-react/dist/components/text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { Element, Range, Text as SlateText } from 'slate';
|
||||
import { RenderLeafProps, RenderPlaceholderProps } from './editable';
|
||||
declare const MemoizedText: React.MemoExoticComponent<(props: {
|
||||
decorations: Range[];
|
||||
isLast: boolean;
|
||||
parent: Element;
|
||||
renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
renderLeaf?: ((props: RenderLeafProps) => JSX.Element) | undefined;
|
||||
text: SlateText;
|
||||
}) => JSX.Element>;
|
||||
export default MemoizedText;
|
||||
//# sourceMappingURL=text.d.ts.map
|
||||
1
node_modules/slate-react/dist/components/text.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/components/text.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,OAAO,CAAA;AASzD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAuEpE,QAAA,MAAM,YAAY;iBA/DH,KAAK,EAAE;YACZ,OAAO;YACP,OAAO;+BACY,sBAAsB,KAAK,WAAW;0BAC5C,eAAe,KAAK,WAAW;UAC9C,SAAS;kBAmEf,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
||||
14
node_modules/slate-react/dist/custom-types.d.ts
generated
vendored
Normal file
14
node_modules/slate-react/dist/custom-types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { BaseRange, BaseText } from 'slate';
|
||||
import { ReactEditor } from './plugin/react-editor';
|
||||
declare module 'slate' {
|
||||
interface CustomTypes {
|
||||
Editor: ReactEditor;
|
||||
Text: BaseText & {
|
||||
placeholder?: string;
|
||||
};
|
||||
Range: BaseRange & {
|
||||
placeholder?: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=custom-types.d.ts.map
|
||||
1
node_modules/slate-react/dist/custom-types.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/custom-types.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["packages/slate-react/src/custom-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,MAAM,EAAE,WAAW,CAAA;QACnB,IAAI,EAAE,QAAQ,GAAG;YACf,WAAW,CAAC,EAAE,MAAM,CAAA;SACrB,CAAA;QACD,KAAK,EAAE,SAAS,GAAG;YACjB,WAAW,CAAC,EAAE,MAAM,CAAA;SACrB,CAAA;KACF;CACF"}
|
||||
30
node_modules/slate-react/dist/hooks/android-input-manager/android-input-manager.d.ts
generated
vendored
Normal file
30
node_modules/slate-react/dist/hooks/android-input-manager/android-input-manager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="react" />
|
||||
import { DebouncedFunc } from 'lodash';
|
||||
import { Point, Range } from 'slate';
|
||||
import { ReactEditor } from '../../plugin/react-editor';
|
||||
export declare type Action = {
|
||||
at?: Point | Range;
|
||||
run: () => void;
|
||||
};
|
||||
export declare type CreateAndroidInputManagerOptions = {
|
||||
editor: ReactEditor;
|
||||
scheduleOnDOMSelectionChange: DebouncedFunc<() => void>;
|
||||
onDOMSelectionChange: DebouncedFunc<() => void>;
|
||||
};
|
||||
export declare type AndroidInputManager = {
|
||||
flush: () => void;
|
||||
scheduleFlush: () => void;
|
||||
hasPendingDiffs: () => boolean;
|
||||
hasPendingAction: () => boolean;
|
||||
hasPendingChanges: () => boolean;
|
||||
isFlushing: () => boolean | 'action';
|
||||
handleUserSelect: (range: Range | null) => void;
|
||||
handleCompositionEnd: (event: React.CompositionEvent<HTMLDivElement>) => void;
|
||||
handleCompositionStart: (event: React.CompositionEvent<HTMLDivElement>) => void;
|
||||
handleDOMBeforeInput: (event: InputEvent) => void;
|
||||
handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
||||
handleDomMutations: (mutations: MutationRecord[]) => void;
|
||||
handleInput: () => void;
|
||||
};
|
||||
export declare function createAndroidInputManager({ editor, scheduleOnDOMSelectionChange, onDOMSelectionChange, }: CreateAndroidInputManagerOptions): AndroidInputManager;
|
||||
//# sourceMappingURL=android-input-manager.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/android-input-manager/android-input-manager.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/android-input-manager/android-input-manager.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"android-input-manager.d.ts","sourceRoot":"","sources":["../../packages/slate-react/src/hooks/android-input-manager/android-input-manager.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAsB,KAAK,EAAE,KAAK,EAAoB,MAAM,OAAO,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAwBvD,oBAAY,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,IAAI,CAAA;CAAE,CAAA;AAgB5D,oBAAY,gCAAgC,GAAG;IAC7C,MAAM,EAAE,WAAW,CAAA;IAEnB,4BAA4B,EAAE,aAAa,CAAC,MAAM,IAAI,CAAC,CAAA;IACvD,oBAAoB,EAAE,aAAa,CAAC,MAAM,IAAI,CAAC,CAAA;CAChD,CAAA;AAED,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,aAAa,EAAE,MAAM,IAAI,CAAA;IAEzB,eAAe,EAAE,MAAM,OAAO,CAAA;IAC9B,gBAAgB,EAAE,MAAM,OAAO,CAAA;IAC/B,iBAAiB,EAAE,MAAM,OAAO,CAAA;IAChC,UAAU,EAAE,MAAM,OAAO,GAAG,QAAQ,CAAA;IAEpC,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAC7E,sBAAsB,EAAE,CACtB,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,KAC1C,IAAI,CAAA;IACT,oBAAoB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACjD,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAEnE,kBAAkB,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;IACzD,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,4BAA4B,EAC5B,oBAAoB,GACrB,EAAE,gCAAgC,GAAG,mBAAmB,CAktBxD"}
|
||||
8
node_modules/slate-react/dist/hooks/android-input-manager/use-android-input-manager.d.ts
generated
vendored
Normal file
8
node_modules/slate-react/dist/hooks/android-input-manager/use-android-input-manager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { RefObject } from 'react';
|
||||
import { CreateAndroidInputManagerOptions } from './android-input-manager';
|
||||
declare type UseAndroidInputManagerOptions = {
|
||||
node: RefObject<HTMLElement>;
|
||||
} & Omit<CreateAndroidInputManagerOptions, 'editor' | 'onUserInput' | 'receivedUserInput'>;
|
||||
export declare function useAndroidInputManager({ node, ...options }: UseAndroidInputManagerOptions): import("./android-input-manager").AndroidInputManager | null;
|
||||
export {};
|
||||
//# sourceMappingURL=use-android-input-manager.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/android-input-manager/use-android-input-manager.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/android-input-manager/use-android-input-manager.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-android-input-manager.d.ts","sourceRoot":"","sources":["../../packages/slate-react/src/hooks/android-input-manager/use-android-input-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAI3C,OAAO,EAEL,gCAAgC,EACjC,MAAM,yBAAyB,CAAA;AAIhC,aAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;CAC7B,GAAG,IAAI,CACN,gCAAgC,EAChC,QAAQ,GAAG,aAAa,GAAG,mBAAmB,CAC/C,CAAA;AAQD,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,GAAG,OAAO,EACX,EAAE,6BAA6B,gEA2B/B"}
|
||||
16
node_modules/slate-react/dist/hooks/use-children.d.ts
generated
vendored
Normal file
16
node_modules/slate-react/dist/hooks/use-children.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference types="react" />
|
||||
import { Range, Element, Ancestor } from 'slate';
|
||||
import { RenderElementProps, RenderLeafProps, RenderPlaceholderProps } from '../components/editable';
|
||||
/**
|
||||
* Children.
|
||||
*/
|
||||
declare const useChildren: (props: {
|
||||
decorations: Range[];
|
||||
node: Ancestor;
|
||||
renderElement?: ((props: RenderElementProps) => JSX.Element) | undefined;
|
||||
renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
|
||||
renderLeaf?: ((props: RenderLeafProps) => JSX.Element) | undefined;
|
||||
selection: Range | null;
|
||||
}) => JSX.Element[];
|
||||
export default useChildren;
|
||||
//# sourceMappingURL=use-children.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-children.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-children.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-children.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-children.tsx"],"names":[],"mappings":";AACA,OAAO,EAAU,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAc,MAAM,OAAO,CAAA;AAQpE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACvB,MAAM,wBAAwB,CAAA;AAG/B;;GAEG;AAEH,QAAA,MAAM,WAAW;iBACF,KAAK,EAAE;UACd,QAAQ;6BACU,kBAAkB,KAAK,WAAW;+BAC/B,sBAAsB,KAAK,WAAW;0BAC5C,eAAe,KAAK,WAAW;eACzC,KAAK,GAAG,IAAI;mBAoExB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
||||
11
node_modules/slate-react/dist/hooks/use-decorate.d.ts
generated
vendored
Normal file
11
node_modules/slate-react/dist/hooks/use-decorate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference types="react" />
|
||||
import { Range, NodeEntry } from 'slate';
|
||||
/**
|
||||
* A React context for sharing the `decorate` prop of the editable.
|
||||
*/
|
||||
export declare const DecorateContext: import("react").Context<(entry: NodeEntry<import("slate").Node>) => Range[]>;
|
||||
/**
|
||||
* Get the current `decorate` prop of the editable.
|
||||
*/
|
||||
export declare const useDecorate: () => (entry: NodeEntry<import("slate").Node>) => Range[];
|
||||
//# sourceMappingURL=use-decorate.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-decorate.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-decorate.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-decorate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-decorate.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC;;GAEG;AAEH,eAAO,MAAM,eAAe,sEAAuC,KAAK,EAAE,CAEzE,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,WAAW,oDAA8B,KAAK,EAE1D,CAAA"}
|
||||
6
node_modules/slate-react/dist/hooks/use-editor.d.ts
generated
vendored
Normal file
6
node_modules/slate-react/dist/hooks/use-editor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Get the current editor object from the React context.
|
||||
* @deprecated Use useSlateStatic instead.
|
||||
*/
|
||||
export declare const useEditor: () => import("..").ReactEditor;
|
||||
//# sourceMappingURL=use-editor.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-editor.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-editor.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-editor.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,eAAO,MAAM,SAAS,gCAUrB,CAAA"}
|
||||
10
node_modules/slate-react/dist/hooks/use-focused.d.ts
generated
vendored
Normal file
10
node_modules/slate-react/dist/hooks/use-focused.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
/**
|
||||
* A React context for sharing the `focused` state of the editor.
|
||||
*/
|
||||
export declare const FocusedContext: import("react").Context<boolean>;
|
||||
/**
|
||||
* Get the current `focused` state of the editor.
|
||||
*/
|
||||
export declare const useFocused: () => boolean;
|
||||
//# sourceMappingURL=use-focused.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-focused.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-focused.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-focused.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-focused.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,eAAO,MAAM,cAAc,kCAAuB,CAAA;AAElD;;GAEG;AAEH,eAAO,MAAM,UAAU,QAAO,OAE7B,CAAA"}
|
||||
2
node_modules/slate-react/dist/hooks/use-is-mounted.d.ts
generated
vendored
Normal file
2
node_modules/slate-react/dist/hooks/use-is-mounted.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function useIsMounted(): boolean;
|
||||
//# sourceMappingURL=use-is-mounted.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-is-mounted.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-is-mounted.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-is-mounted.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-is-mounted.tsx"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,YAW3B"}
|
||||
6
node_modules/slate-react/dist/hooks/use-isomorphic-layout-effect.d.ts
generated
vendored
Normal file
6
node_modules/slate-react/dist/hooks/use-isomorphic-layout-effect.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useLayoutEffect } from 'react';
|
||||
/**
|
||||
* Prevent warning on SSR by falling back to useEffect when DOM isn't available
|
||||
*/
|
||||
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
||||
//# sourceMappingURL=use-isomorphic-layout-effect.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-isomorphic-layout-effect.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-isomorphic-layout-effect.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-isomorphic-layout-effect.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-isomorphic-layout-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAa,MAAM,OAAO,CAAA;AAGlD;;GAEG;AAEH,eAAO,MAAM,yBAAyB,wBAEzB,CAAA"}
|
||||
3
node_modules/slate-react/dist/hooks/use-mutation-observer.d.ts
generated
vendored
Normal file
3
node_modules/slate-react/dist/hooks/use-mutation-observer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { RefObject } from 'react';
|
||||
export declare function useMutationObserver(node: RefObject<HTMLElement>, callback: MutationCallback, options: MutationObserverInit): void;
|
||||
//# sourceMappingURL=use-mutation-observer.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-mutation-observer.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-mutation-observer.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-mutation-observer.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-mutation-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAA;AAKtD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,oBAAoB,QAkB9B"}
|
||||
10
node_modules/slate-react/dist/hooks/use-read-only.d.ts
generated
vendored
Normal file
10
node_modules/slate-react/dist/hooks/use-read-only.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
/**
|
||||
* A React context for sharing the `readOnly` state of the editor.
|
||||
*/
|
||||
export declare const ReadOnlyContext: import("react").Context<boolean>;
|
||||
/**
|
||||
* Get the current `readOnly` state of the editor.
|
||||
*/
|
||||
export declare const useReadOnly: () => boolean;
|
||||
//# sourceMappingURL=use-read-only.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-read-only.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-read-only.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-read-only.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-read-only.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,eAAO,MAAM,eAAe,kCAAuB,CAAA;AAEnD;;GAEG;AAEH,eAAO,MAAM,WAAW,QAAO,OAE9B,CAAA"}
|
||||
10
node_modules/slate-react/dist/hooks/use-selected.d.ts
generated
vendored
Normal file
10
node_modules/slate-react/dist/hooks/use-selected.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
/**
|
||||
* A React context for sharing the `selected` state of an element.
|
||||
*/
|
||||
export declare const SelectedContext: import("react").Context<boolean>;
|
||||
/**
|
||||
* Get the current `selected` state of an element.
|
||||
*/
|
||||
export declare const useSelected: () => boolean;
|
||||
//# sourceMappingURL=use-selected.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-selected.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-selected.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-selected.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-selected.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,eAAO,MAAM,eAAe,kCAAuB,CAAA;AAEnD;;GAEG;AAEH,eAAO,MAAM,WAAW,QAAO,OAE9B,CAAA"}
|
||||
7
node_modules/slate-react/dist/hooks/use-slate-selection.d.ts
generated
vendored
Normal file
7
node_modules/slate-react/dist/hooks/use-slate-selection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { BaseSelection } from 'slate';
|
||||
/**
|
||||
* Get the current slate selection.
|
||||
* Only triggers a rerender when the selection actually changes
|
||||
*/
|
||||
export declare const useSlateSelection: () => BaseSelection;
|
||||
//# sourceMappingURL=use-slate-selection.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-slate-selection.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-slate-selection.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-slate-selection.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate-selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,MAAM,OAAO,CAAA;AAI5C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,qBAE7B,CAAA"}
|
||||
32
node_modules/slate-react/dist/hooks/use-slate-selector.d.ts
generated
vendored
Normal file
32
node_modules/slate-react/dist/hooks/use-slate-selector.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/// <reference types="react" />
|
||||
import { Editor } from 'slate';
|
||||
declare type EditorChangeHandler = (editor: Editor) => void;
|
||||
/**
|
||||
* A React context for sharing the editor selector context in a way to control rerenders
|
||||
*/
|
||||
export declare const SlateSelectorContext: import("react").Context<{
|
||||
getSlate: () => Editor;
|
||||
addEventListener: (callback: EditorChangeHandler) => () => void;
|
||||
}>;
|
||||
/**
|
||||
* use redux style selectors to prevent rerendering on every keystroke.
|
||||
* Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function.
|
||||
*
|
||||
* Example:
|
||||
* ```
|
||||
* const isSelectionActive = useSlateSelector(editor => Boolean(editor.selection));
|
||||
* ```
|
||||
*/
|
||||
export declare function useSlateSelector<T>(selector: (editor: Editor) => T, equalityFn?: (a: T, b: T) => boolean): T;
|
||||
/**
|
||||
* Create selector context with editor updating on every editor change
|
||||
*/
|
||||
export declare function getSelectorContext(editor: Editor): {
|
||||
selectorContext: {
|
||||
getSlate: () => import("..").ReactEditor;
|
||||
addEventListener: (callback: EditorChangeHandler) => () => void;
|
||||
};
|
||||
onChange: (editor: Editor) => void;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=use-slate-selector.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-slate-selector.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-slate-selector.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-slate-selector.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate-selector.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAO9B,aAAK,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;AACnD;;GAEG;AAEH,eAAO,MAAM,oBAAoB;cACrB,MAAM,MAAM;iCACO,mBAAmB,KAAK,MAAM,IAAI;EACpD,CAAA;AAIb;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,EAC/B,UAAU,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAqB,KAuElD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;;;qCAed,mBAAmB;;uBARd,MAAM;EAiB7C"}
|
||||
12
node_modules/slate-react/dist/hooks/use-slate-static.d.ts
generated
vendored
Normal file
12
node_modules/slate-react/dist/hooks/use-slate-static.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference types="react" />
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
import { Editor } from 'slate';
|
||||
/**
|
||||
* A React context for sharing the editor object.
|
||||
*/
|
||||
export declare const EditorContext: import("react").Context<ReactEditor | null>;
|
||||
/**
|
||||
* Get the current editor object from the React context.
|
||||
*/
|
||||
export declare const useSlateStatic: () => Editor;
|
||||
//# sourceMappingURL=use-slate-static.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-slate-static.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-slate-static.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-slate-static.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate-static.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B;;GAEG;AAEH,eAAO,MAAM,aAAa,6CAA0C,CAAA;AAEpE;;GAEG;AAEH,eAAO,MAAM,cAAc,QAAO,MAUjC,CAAA"}
|
||||
24
node_modules/slate-react/dist/hooks/use-slate.d.ts
generated
vendored
Normal file
24
node_modules/slate-react/dist/hooks/use-slate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/// <reference types="react" />
|
||||
import { Editor } from 'slate';
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
/**
|
||||
* A React context for sharing the editor object, in a way that re-renders the
|
||||
* context whenever changes occur.
|
||||
*/
|
||||
export interface SlateContextValue {
|
||||
v: number;
|
||||
editor: ReactEditor;
|
||||
}
|
||||
export declare const SlateContext: import("react").Context<{
|
||||
v: number;
|
||||
editor: ReactEditor;
|
||||
} | null>;
|
||||
/**
|
||||
* Get the current editor object from the React context.
|
||||
*/
|
||||
export declare const useSlate: () => Editor;
|
||||
export declare const useSlateWithV: () => {
|
||||
v: number;
|
||||
editor: ReactEditor;
|
||||
};
|
||||
//# sourceMappingURL=use-slate.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-slate.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-slate.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;GAGG;AAEH,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,WAAW,CAAA;CACpB;AAED,eAAO,MAAM,YAAY;OACpB,MAAM;YACD,WAAW;SACN,CAAA;AAEf;;GAEG;AAEH,eAAO,MAAM,QAAQ,QAAO,MAW3B,CAAA;AAED,eAAO,MAAM,aAAa;OArBrB,MAAM;YACD,WAAW;CA8BpB,CAAA"}
|
||||
6
node_modules/slate-react/dist/hooks/use-track-user-input.d.ts
generated
vendored
Normal file
6
node_modules/slate-react/dist/hooks/use-track-user-input.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference types="react" />
|
||||
export declare function useTrackUserInput(): {
|
||||
receivedUserInput: import("react").MutableRefObject<boolean>;
|
||||
onUserInput: () => void;
|
||||
};
|
||||
//# sourceMappingURL=use-track-user-input.d.ts.map
|
||||
1
node_modules/slate-react/dist/hooks/use-track-user-input.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/hooks/use-track-user-input.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"use-track-user-input.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-track-user-input.ts"],"names":[],"mappings":";AAIA,wBAAgB,iBAAiB;;;EA2BhC"}
|
||||
15
node_modules/slate-react/dist/index.d.ts
generated
vendored
Normal file
15
node_modules/slate-react/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export { Editable, RenderElementProps, RenderLeafProps, RenderPlaceholderProps, DefaultPlaceholder, } from './components/editable';
|
||||
export { DefaultElement } from './components/element';
|
||||
export { DefaultLeaf } from './components/leaf';
|
||||
export { Slate } from './components/slate';
|
||||
export { useEditor } from './hooks/use-editor';
|
||||
export { useSlateStatic } from './hooks/use-slate-static';
|
||||
export { useFocused } from './hooks/use-focused';
|
||||
export { useReadOnly } from './hooks/use-read-only';
|
||||
export { useSelected } from './hooks/use-selected';
|
||||
export { useSlate, useSlateWithV } from './hooks/use-slate';
|
||||
export { useSlateSelector } from './hooks/use-slate-selector';
|
||||
export { useSlateSelection } from './hooks/use-slate-selection';
|
||||
export { ReactEditor } from './plugin/react-editor';
|
||||
export { withReact } from './plugin/with-react';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/slate-react/dist/index.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["packages/slate-react/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA"}
|
||||
5275
node_modules/slate-react/dist/index.es.js
generated
vendored
Normal file
5275
node_modules/slate-react/dist/index.es.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/slate-react/dist/index.es.js.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/index.es.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5852
node_modules/slate-react/dist/index.js
generated
vendored
Normal file
5852
node_modules/slate-react/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/slate-react/dist/index.js.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
148
node_modules/slate-react/dist/plugin/react-editor.d.ts
generated
vendored
Normal file
148
node_modules/slate-react/dist/plugin/react-editor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
import { BaseEditor, Editor, Node, Path, Point, Range } from 'slate';
|
||||
import { Key } from '../utils/key';
|
||||
import { DOMNode, DOMPoint, DOMRange, DOMSelection, DOMStaticRange } from '../utils/dom';
|
||||
/**
|
||||
* A React and DOM-specific version of the `Editor` interface.
|
||||
*/
|
||||
export interface ReactEditor extends BaseEditor {
|
||||
insertData: (data: DataTransfer) => void;
|
||||
insertFragmentData: (data: DataTransfer) => boolean;
|
||||
insertTextData: (data: DataTransfer) => boolean;
|
||||
setFragmentData: (data: DataTransfer, originEvent?: 'drag' | 'copy' | 'cut') => void;
|
||||
hasRange: (editor: ReactEditor, range: Range) => boolean;
|
||||
hasTarget: (editor: ReactEditor, target: EventTarget | null) => target is DOMNode;
|
||||
hasEditableTarget: (editor: ReactEditor, target: EventTarget | null) => target is DOMNode;
|
||||
hasSelectableTarget: (editor: ReactEditor, target: EventTarget | null) => boolean;
|
||||
isTargetInsideNonReadonlyVoid: (editor: ReactEditor, target: EventTarget | null) => boolean;
|
||||
}
|
||||
export declare const ReactEditor: {
|
||||
/**
|
||||
* Check if the user is currently composing inside the editor.
|
||||
*/
|
||||
isComposing(editor: ReactEditor): boolean;
|
||||
/**
|
||||
* Return the host window of the current editor.
|
||||
*/
|
||||
getWindow(editor: ReactEditor): Window;
|
||||
/**
|
||||
* Find a key for a Slate node.
|
||||
*/
|
||||
findKey(editor: ReactEditor, node: Node): Key;
|
||||
/**
|
||||
* Find the path of Slate node.
|
||||
*/
|
||||
findPath(editor: ReactEditor, node: Node): Path;
|
||||
/**
|
||||
* Find the DOM node that implements DocumentOrShadowRoot for the editor.
|
||||
*/
|
||||
findDocumentOrShadowRoot(editor: ReactEditor): Document | ShadowRoot;
|
||||
/**
|
||||
* Check if the editor is focused.
|
||||
*/
|
||||
isFocused(editor: ReactEditor): boolean;
|
||||
/**
|
||||
* Check if the editor is in read-only mode.
|
||||
*/
|
||||
isReadOnly(editor: ReactEditor): boolean;
|
||||
/**
|
||||
* Blur the editor.
|
||||
*/
|
||||
blur(editor: ReactEditor): void;
|
||||
/**
|
||||
* Focus the editor.
|
||||
*/
|
||||
focus(editor: ReactEditor): void;
|
||||
/**
|
||||
* Deselect the editor.
|
||||
*/
|
||||
deselect(editor: ReactEditor): void;
|
||||
/**
|
||||
* Check if a DOM node is within the editor.
|
||||
*/
|
||||
hasDOMNode(editor: ReactEditor, target: DOMNode, options?: {
|
||||
editable?: boolean;
|
||||
}): boolean;
|
||||
/**
|
||||
* Insert data from a `DataTransfer` into the editor.
|
||||
*/
|
||||
insertData(editor: ReactEditor, data: DataTransfer): void;
|
||||
/**
|
||||
* Insert fragment data from a `DataTransfer` into the editor.
|
||||
*/
|
||||
insertFragmentData(editor: ReactEditor, data: DataTransfer): boolean;
|
||||
/**
|
||||
* Insert text data from a `DataTransfer` into the editor.
|
||||
*/
|
||||
insertTextData(editor: ReactEditor, data: DataTransfer): boolean;
|
||||
/**
|
||||
* Sets data from the currently selected fragment on a `DataTransfer`.
|
||||
*/
|
||||
setFragmentData(editor: ReactEditor, data: DataTransfer, originEvent?: "drag" | "copy" | "cut" | undefined): void;
|
||||
/**
|
||||
* Find the native DOM element from a Slate node.
|
||||
*/
|
||||
toDOMNode(editor: ReactEditor, node: Node): HTMLElement;
|
||||
/**
|
||||
* Find a native DOM selection point from a Slate point.
|
||||
*/
|
||||
toDOMPoint(editor: ReactEditor, point: Point): DOMPoint;
|
||||
/**
|
||||
* Find a native DOM range from a Slate `range`.
|
||||
*
|
||||
* Notice: the returned range will always be ordinal regardless of the direction of Slate `range` due to DOM API limit.
|
||||
*
|
||||
* there is no way to create a reverse DOM Range using Range.setStart/setEnd
|
||||
* according to https://dom.spec.whatwg.org/#concept-range-bp-set.
|
||||
*/
|
||||
toDOMRange(editor: ReactEditor, range: Range): DOMRange;
|
||||
/**
|
||||
* Find a Slate node from a native DOM `element`.
|
||||
*/
|
||||
toSlateNode(editor: ReactEditor, domNode: DOMNode): Node;
|
||||
/**
|
||||
* Get the target range from a DOM `event`.
|
||||
*/
|
||||
findEventRange(editor: ReactEditor, event: any): Range;
|
||||
/**
|
||||
* Find a Slate point from a DOM selection's `domNode` and `domOffset`.
|
||||
*/
|
||||
toSlatePoint<T extends boolean>(editor: ReactEditor, domPoint: DOMPoint, options: {
|
||||
exactMatch: boolean;
|
||||
suppressThrow: T;
|
||||
}): T extends true ? import("slate").BasePoint | null : import("slate").BasePoint;
|
||||
/**
|
||||
* Find a Slate range from a DOM range or selection.
|
||||
*/
|
||||
toSlateRange<T_1 extends boolean>(editor: ReactEditor, domRange: DOMRange | DOMStaticRange | DOMSelection, options: {
|
||||
exactMatch: boolean;
|
||||
suppressThrow: T_1;
|
||||
}): T_1 extends true ? import("slate").BaseSelection : import("slate").BaseRange & {
|
||||
placeholder?: string | undefined;
|
||||
};
|
||||
hasRange(editor: ReactEditor, range: Range): boolean;
|
||||
/**
|
||||
* Check if the target is in the editor.
|
||||
*/
|
||||
hasTarget(editor: ReactEditor, target: EventTarget | null): target is DOMNode;
|
||||
/**
|
||||
* Check if the target is editable and in the editor.
|
||||
*/
|
||||
hasEditableTarget(editor: ReactEditor, target: EventTarget | null): target is DOMNode;
|
||||
/**
|
||||
* Check if the target can be selectable
|
||||
*/
|
||||
hasSelectableTarget(editor: ReactEditor, target: EventTarget | null): boolean;
|
||||
/**
|
||||
* Check if the target is inside void and in an non-readonly editor.
|
||||
*/
|
||||
isTargetInsideNonReadonlyVoid(editor: ReactEditor, target: EventTarget | null): boolean;
|
||||
/**
|
||||
* Experimental and android specific: Flush all pending diffs and cancel composition at the next possible time.
|
||||
*/
|
||||
androidScheduleFlush(editor: Editor): void;
|
||||
/**
|
||||
* Experimental and android specific: Get pending diffs
|
||||
*/
|
||||
androidPendingDiffs(editor: Editor): import("../utils/diff-text").TextDiff[] | undefined;
|
||||
};
|
||||
//# sourceMappingURL=react-editor.d.ts.map
|
||||
1
node_modules/slate-react/dist/plugin/react-editor.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/plugin/react-editor.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/react-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EAIN,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAelC,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EAOf,MAAM,cAAc,CAAA;AAGrB;;GAEG;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACxC,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAA;IACnD,cAAc,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAA;IAC/C,eAAe,EAAE,CACf,IAAI,EAAE,YAAY,EAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,KAClC,IAAI,CAAA;IACT,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IACxD,SAAS,EAAE,CACT,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,WAAW,GAAG,IAAI,KACvB,MAAM,IAAI,OAAO,CAAA;IACtB,iBAAiB,EAAE,CACjB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,WAAW,GAAG,IAAI,KACvB,MAAM,IAAI,OAAO,CAAA;IACtB,mBAAmB,EAAE,CACnB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,WAAW,GAAG,IAAI,KACvB,OAAO,CAAA;IACZ,6BAA6B,EAAE,CAC7B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,WAAW,GAAG,IAAI,KACvB,OAAO,CAAA;CACb;AAGD,eAAO,MAAM,WAAW;IACtB;;OAEG;wBAEiB,WAAW,GAAG,OAAO;IAIzC;;OAEG;sBAEe,WAAW,GAAG,MAAM;IAQtC;;OAEG;oBAEa,WAAW,QAAQ,IAAI,GAAG,GAAG;IAW7C;;OAEG;qBAEc,WAAW,QAAQ,IAAI;IA8BxC;;OAEG;qCAE8B,WAAW,GAAG,QAAQ,GAAG,UAAU;IAcpE;;OAEG;sBAEe,WAAW,GAAG,OAAO;IAIvC;;OAEG;uBAEgB,WAAW,GAAG,OAAO;IAIxC;;OAEG;iBAEU,WAAW,GAAG,IAAI;IAU/B;;OAEG;kBAEW,WAAW,GAAG,IAAI;IAUhC;;OAEG;qBAEc,WAAW,GAAG,IAAI;IAcnC;;OAEG;uBAGO,WAAW,UACX,OAAO,YACN;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO;IAoCV;;OAEG;uBAEgB,WAAW,QAAQ,YAAY,GAAG,IAAI;IAIzD;;OAEG;+BAEwB,WAAW,QAAQ,YAAY,GAAG,OAAO;IAIpE;;OAEG;2BAEoB,WAAW,QAAQ,YAAY,GAAG,OAAO;IAIhE;;OAEG;4BAGO,WAAW,QACb,YAAY,sDAEjB,IAAI;IAIP;;OAEG;sBAEe,WAAW,QAAQ,IAAI,GAAG,WAAW;IAevD;;OAEG;uBAEgB,WAAW,SAAS,KAAK;IAwE5C;;;;;;;OAOG;uBAEgB,WAAW,SAAS,KAAK,GAAG,QAAQ;IA8BvD;;OAEG;wBAEiB,WAAW,WAAW,OAAO,GAAG,IAAI;IAgBxD;;OAEG;2BAEoB,WAAW,SAAS,GAAG,GAAG,KAAK;IAiEtD;;OAEG;4CAGO,WAAW;oBAGL,OAAO;;;IAiKvB;;OAEG;8CAGO,WAAW,YACT,QAAQ,GAAG,cAAc,GAAG,YAAY;oBAEpC,OAAO;;;;;qBAyIN,WAAW,SAAS,KAAK,GAAG,OAAO;IAOpD;;OAEG;sBAEO,WAAW,UACX,WAAW,GAAG,IAAI;IAK5B;;OAEG;8BAEO,WAAW,UACX,WAAW,GAAG,IAAI;IAQ5B;;OAEG;gCAEO,WAAW,UACX,WAAW,GAAG,IAAI,GACzB,OAAO;IAOV;;OAEG;0CAEO,WAAW,UACX,WAAW,GAAG,IAAI,GACzB,OAAO;IASV;;OAEG;iCAC0B,MAAM;IAInC;;OAEG;gCACyB,MAAM;CAGnC,CAAA"}
|
||||
12
node_modules/slate-react/dist/plugin/with-react.d.ts
generated
vendored
Normal file
12
node_modules/slate-react/dist/plugin/with-react.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { BaseEditor } from 'slate';
|
||||
import { ReactEditor } from './react-editor';
|
||||
/**
|
||||
* `withReact` adds React and DOM specific behaviors to the editor.
|
||||
*
|
||||
* If you are using TypeScript, you must extend Slate's CustomTypes to use
|
||||
* this plugin.
|
||||
*
|
||||
* See https://docs.slatejs.org/concepts/11-typescript to learn how.
|
||||
*/
|
||||
export declare const withReact: <T extends BaseEditor>(editor: T, clipboardFormatKey?: string) => T & ReactEditor;
|
||||
//# sourceMappingURL=with-react.d.ts.map
|
||||
1
node_modules/slate-react/dist/plugin/with-react.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/plugin/with-react.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"with-react.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/with-react.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EASX,MAAM,OAAO,CAAA;AA0Bd,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS,mFAsSrB,CAAA"}
|
||||
34687
node_modules/slate-react/dist/slate-react.js
generated
vendored
Normal file
34687
node_modules/slate-react/dist/slate-react.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/slate-react/dist/slate-react.min.js
generated
vendored
Normal file
1
node_modules/slate-react/dist/slate-react.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/slate-react/dist/utils/constants.d.ts
generated
vendored
Normal file
2
node_modules/slate-react/dist/utils/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare const TRIPLE_CLICK = 3;
|
||||
//# sourceMappingURL=constants.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/constants.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/constants.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,IAAI,CAAA"}
|
||||
45
node_modules/slate-react/dist/utils/diff-text.d.ts
generated
vendored
Normal file
45
node_modules/slate-react/dist/utils/diff-text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { Editor, Operation, Path, Point, Range } from 'slate';
|
||||
export declare type StringDiff = {
|
||||
start: number;
|
||||
end: number;
|
||||
text: string;
|
||||
};
|
||||
export declare type TextDiff = {
|
||||
id: number;
|
||||
path: Path;
|
||||
diff: StringDiff;
|
||||
};
|
||||
/**
|
||||
* Check whether a text diff was applied in a way we can perform the pending action on /
|
||||
* recover the pending selection.
|
||||
*/
|
||||
export declare function verifyDiffState(editor: Editor, textDiff: TextDiff): boolean;
|
||||
export declare function applyStringDiff(text: string, ...diffs: StringDiff[]): string;
|
||||
/**
|
||||
* Remove redundant changes from the diff so that it spans the minimal possible range
|
||||
*/
|
||||
export declare function normalizeStringDiff(targetText: string, diff: StringDiff): StringDiff | null;
|
||||
/**
|
||||
* Return a string diff that is equivalent to applying b after a spanning the range of
|
||||
* both changes
|
||||
*/
|
||||
export declare function mergeStringDiffs(targetText: string, a: StringDiff, b: StringDiff): StringDiff | null;
|
||||
/**
|
||||
* Get the slate range the text diff spans.
|
||||
*/
|
||||
export declare function targetRange(textDiff: TextDiff): Range;
|
||||
/**
|
||||
* Normalize a 'pending point' a.k.a a point based on the dom state before applying
|
||||
* the pending diffs. Since the pending diffs might have been inserted with different
|
||||
* marks we have to 'walk' the offset from the starting position to ensure we still
|
||||
* have a valid point inside the document
|
||||
*/
|
||||
export declare function normalizePoint(editor: Editor, point: Point): Point | null;
|
||||
/**
|
||||
* Normalize a 'pending selection' to ensure it's valid in the current document state.
|
||||
*/
|
||||
export declare function normalizeRange(editor: Editor, range: Range): Range | null;
|
||||
export declare function transformPendingPoint(editor: Editor, point: Point, op: Operation): Point | null;
|
||||
export declare function transformPendingRange(editor: Editor, range: Range, op: Operation): Range | null;
|
||||
export declare function transformTextDiff(textDiff: TextDiff, op: Operation): TextDiff | null;
|
||||
//# sourceMappingURL=diff-text.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/diff-text.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/diff-text.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"diff-text.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/diff-text.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAEN,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EAGN,MAAM,OAAO,CAAA;AAGd,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,oBAAY,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAwB3E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,UAMnE;AAgCD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,qBAsBvE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,GACZ,UAAU,GAAG,IAAI,CAmBnB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAMrD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAgCzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAgBzE;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,SAAS,GACZ,KAAK,GAAG,IAAI,CAsDd;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,SAAS,GACZ,KAAK,GAAG,IAAI,CAgBd;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,SAAS,GACZ,QAAQ,GAAG,IAAI,CAwHjB"}
|
||||
84
node_modules/slate-react/dist/utils/dom.d.ts
generated
vendored
Normal file
84
node_modules/slate-react/dist/utils/dom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Types.
|
||||
*/
|
||||
import DOMNode = globalThis.Node;
|
||||
import DOMComment = globalThis.Comment;
|
||||
import DOMElement = globalThis.Element;
|
||||
import DOMText = globalThis.Text;
|
||||
import DOMRange = globalThis.Range;
|
||||
import DOMSelection = globalThis.Selection;
|
||||
import DOMStaticRange = globalThis.StaticRange;
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
export { DOMNode, DOMComment, DOMElement, DOMText, DOMRange, DOMSelection, DOMStaticRange, };
|
||||
declare global {
|
||||
interface Window {
|
||||
Selection: typeof Selection['constructor'];
|
||||
DataTransfer: typeof DataTransfer['constructor'];
|
||||
Node: typeof Node['constructor'];
|
||||
}
|
||||
}
|
||||
export declare type DOMPoint = [Node, number];
|
||||
/**
|
||||
* Returns the host window of a DOM node
|
||||
*/
|
||||
export declare const getDefaultView: (value: any) => Window | null;
|
||||
/**
|
||||
* Check if a DOM node is a comment node.
|
||||
*/
|
||||
export declare const isDOMComment: (value: any) => value is DOMComment;
|
||||
/**
|
||||
* Check if a DOM node is an element node.
|
||||
*/
|
||||
export declare const isDOMElement: (value: any) => value is DOMElement;
|
||||
/**
|
||||
* Check if a value is a DOM node.
|
||||
*/
|
||||
export declare const isDOMNode: (value: any) => value is DOMNode;
|
||||
/**
|
||||
* Check if a value is a DOM selection.
|
||||
*/
|
||||
export declare const isDOMSelection: (value: any) => value is DOMSelection;
|
||||
/**
|
||||
* Check if a DOM node is an element node.
|
||||
*/
|
||||
export declare const isDOMText: (value: any) => value is DOMText;
|
||||
/**
|
||||
* Checks whether a paste event is a plaintext-only event.
|
||||
*/
|
||||
export declare const isPlainTextOnlyPaste: (event: ClipboardEvent) => boolean | null;
|
||||
/**
|
||||
* Normalize a DOM point so that it always refers to a text node.
|
||||
*/
|
||||
export declare const normalizeDOMPoint: (domPoint: DOMPoint) => DOMPoint;
|
||||
/**
|
||||
* Determines wether the active element is nested within a shadowRoot
|
||||
*/
|
||||
export declare const hasShadowRoot: (node: Node | null) => boolean;
|
||||
/**
|
||||
* Get the nearest editable child and index at `index` in a `parent`, preferring
|
||||
* `direction`.
|
||||
*/
|
||||
export declare const getEditableChildAndIndex: (parent: DOMElement, index: number, direction: 'forward' | 'backward') => [DOMNode, number];
|
||||
/**
|
||||
* Get the nearest editable child at `index` in a `parent`, preferring
|
||||
* `direction`.
|
||||
*/
|
||||
export declare const getEditableChild: (parent: DOMElement, index: number, direction: 'forward' | 'backward') => DOMNode;
|
||||
/**
|
||||
* Get a plaintext representation of the content of a node, accounting for block
|
||||
* elements which get a newline appended.
|
||||
*
|
||||
* The domNode must be attached to the DOM.
|
||||
*/
|
||||
export declare const getPlainText: (domNode: DOMNode) => string;
|
||||
export declare const getSlateFragmentAttribute: (dataTransfer: DataTransfer) => string | void;
|
||||
/**
|
||||
* Get the x-slate-fragment attribute that exist in text/html data
|
||||
* and append it to the DataTransfer object
|
||||
*/
|
||||
export declare const getClipboardData: (dataTransfer: DataTransfer, clipboardFormatKey?: string) => DataTransfer;
|
||||
/**
|
||||
* Check whether a mutation originates from a editable element inside the editor.
|
||||
*/
|
||||
export declare const isTrackedMutation: (editor: ReactEditor, mutation: MutationRecord, batch: MutationRecord[]) => boolean;
|
||||
//# sourceMappingURL=dom.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/dom.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/dom.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/dom.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,OAAO,GAAG,UAAU,CAAC,IAAI,CAAA;AAChC,OAAO,UAAU,GAAG,UAAU,CAAC,OAAO,CAAA;AACtC,OAAO,UAAU,GAAG,UAAU,CAAC,OAAO,CAAA;AACtC,OAAO,OAAO,GAAG,UAAU,CAAC,IAAI,CAAA;AAChC,OAAO,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAA;AAClC,OAAO,YAAY,GAAG,UAAU,CAAC,SAAS,CAAA;AAC1C,OAAO,cAAc,GAAG,UAAU,CAAC,WAAW,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,EACL,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,CAAA;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,OAAO,SAAS,CAAC,aAAa,CAAC,CAAA;QAC1C,YAAY,EAAE,OAAO,YAAY,CAAC,aAAa,CAAC,CAAA;QAChD,IAAI,EAAE,OAAO,IAAI,CAAC,aAAa,CAAC,CAAA;KACjC;CACF;AAED,oBAAY,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAErC;;GAEG;AAEH,eAAO,MAAM,cAAc,UAAW,GAAG,KAAG,MAAM,GAAG,IAIpD,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,YAAY,UAAW,GAAG,wBAEtC,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,YAAY,UAAW,GAAG,wBAEtC,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,SAAS,UAAW,GAAG,qBAGnC,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,cAAc,UAAW,GAAG,0BAGxC,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,SAAS,UAAW,GAAG,qBAEnC,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,oBAAoB,UAAW,cAAc,mBAMzD,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,iBAAiB,kCA6B7B,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,aAAa,SAAU,IAAI,GAAG,IAAI,YAS9C,CAAA;AAED;;;GAGG;AAEH,eAAO,MAAM,wBAAwB,WAC3B,UAAU,SACX,MAAM,aACF,SAAS,GAAG,UAAU,KAChC,CAAC,OAAO,EAAE,MAAM,CAsClB,CAAA;AAED;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,WACnB,UAAU,SACX,MAAM,aACF,SAAS,GAAG,UAAU,KAChC,OAGF,CAAA;AAED;;;;;GAKG;AAEH,eAAO,MAAM,YAAY,YAAa,OAAO,WAoB5C,CAAA;AAMD,eAAO,MAAM,yBAAyB,iBACtB,YAAY,KACzB,MAAM,GAAG,IAIX,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,iBACb,YAAY,kCAEzB,YAaF,CAAA;AAED;;GAEG;AAEH,eAAO,MAAM,iBAAiB,WACpB,WAAW,YACT,cAAc,SACjB,cAAc,EAAE,KACtB,OA+BF,CAAA"}
|
||||
16
node_modules/slate-react/dist/utils/environment.d.ts
generated
vendored
Normal file
16
node_modules/slate-react/dist/utils/environment.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export declare const IS_REACT_VERSION_17_OR_ABOVE: boolean;
|
||||
export declare const IS_IOS: false;
|
||||
export declare const IS_APPLE: boolean;
|
||||
export declare const IS_ANDROID: boolean;
|
||||
export declare const IS_FIREFOX: boolean;
|
||||
export declare const IS_SAFARI: boolean;
|
||||
export declare const IS_EDGE_LEGACY: boolean;
|
||||
export declare const IS_CHROME: boolean;
|
||||
export declare const IS_CHROME_LEGACY: boolean;
|
||||
export declare const IS_ANDROID_CHROME_LEGACY: boolean;
|
||||
export declare const IS_FIREFOX_LEGACY: boolean;
|
||||
export declare const IS_UC_MOBILE: boolean;
|
||||
export declare const IS_WECHATBROWSER: boolean;
|
||||
export declare const CAN_USE_DOM: boolean;
|
||||
export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
|
||||
//# sourceMappingURL=environment.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/environment.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/environment.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/environment.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,SACQ,CAAA;AAEjD,eAAO,MAAM,MAAM,OAID,CAAA;AAElB,eAAO,MAAM,QAAQ,SACqD,CAAA;AAE1E,eAAO,MAAM,UAAU,SACkD,CAAA;AAEzE,eAAO,MAAM,UAAU,SAEuC,CAAA;AAE9D,eAAO,MAAM,SAAS,SAEgC,CAAA;AAGtD,eAAO,MAAM,cAAc,SAE0C,CAAA;AAErE,eAAO,MAAM,SAAS,SACmD,CAAA;AAIzE,eAAO,MAAM,gBAAgB,SAE0C,CAAA;AAEvE,eAAO,MAAM,wBAAwB,SAGqB,CAAA;AAG1D,eAAO,MAAM,iBAAiB,SAI3B,CAAA;AAGH,eAAO,MAAM,YAAY,SACoD,CAAA;AAG7E,eAAO,MAAM,gBAAgB,SAC6C,CAAA;AAI1E,eAAO,MAAM,WAAW,SAIvB,CAAA;AAID,eAAO,MAAM,wBAAwB,SAOkC,CAAA"}
|
||||
31
node_modules/slate-react/dist/utils/hotkeys.d.ts
generated
vendored
Normal file
31
node_modules/slate-react/dist/utils/hotkeys.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
declare const _default: {
|
||||
isBold: (event: KeyboardEvent) => boolean;
|
||||
isCompose: (event: KeyboardEvent) => boolean;
|
||||
isMoveBackward: (event: KeyboardEvent) => boolean;
|
||||
isMoveForward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteBackward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteForward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteLineBackward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteLineForward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteWordBackward: (event: KeyboardEvent) => boolean;
|
||||
isDeleteWordForward: (event: KeyboardEvent) => boolean;
|
||||
isExtendBackward: (event: KeyboardEvent) => boolean;
|
||||
isExtendForward: (event: KeyboardEvent) => boolean;
|
||||
isExtendLineBackward: (event: KeyboardEvent) => boolean;
|
||||
isExtendLineForward: (event: KeyboardEvent) => boolean;
|
||||
isItalic: (event: KeyboardEvent) => boolean;
|
||||
isMoveLineBackward: (event: KeyboardEvent) => boolean;
|
||||
isMoveLineForward: (event: KeyboardEvent) => boolean;
|
||||
isMoveWordBackward: (event: KeyboardEvent) => boolean;
|
||||
isMoveWordForward: (event: KeyboardEvent) => boolean;
|
||||
isRedo: (event: KeyboardEvent) => boolean;
|
||||
isSoftBreak: (event: KeyboardEvent) => boolean;
|
||||
isSplitBlock: (event: KeyboardEvent) => boolean;
|
||||
isTransposeCharacter: (event: KeyboardEvent) => boolean;
|
||||
isUndo: (event: KeyboardEvent) => boolean;
|
||||
};
|
||||
/**
|
||||
* Hotkeys.
|
||||
*/
|
||||
export default _default;
|
||||
//# sourceMappingURL=hotkeys.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/hotkeys.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/hotkeys.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/hotkeys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA;;GAEG;AAEH,wBAyBC"}
|
||||
12
node_modules/slate-react/dist/utils/key.d.ts
generated
vendored
Normal file
12
node_modules/slate-react/dist/utils/key.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* An auto-incrementing identifier for keys.
|
||||
*/
|
||||
/**
|
||||
* A class that keeps track of a key string. We use a full class here because we
|
||||
* want to be able to use them as keys in `WeakMap` objects.
|
||||
*/
|
||||
export declare class Key {
|
||||
id: string;
|
||||
constructor();
|
||||
}
|
||||
//# sourceMappingURL=key.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/key.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/key.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/key.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;GAGG;AAEH,qBAAa,GAAG;IACd,EAAE,EAAE,MAAM,CAAA;;CAKX"}
|
||||
15
node_modules/slate-react/dist/utils/lines.d.ts
generated
vendored
Normal file
15
node_modules/slate-react/dist/utils/lines.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Utilities for single-line deletion
|
||||
*/
|
||||
import { Range } from 'slate';
|
||||
import { ReactEditor } from '../plugin/react-editor';
|
||||
/**
|
||||
* A helper utility that returns the end portion of a `Range`
|
||||
* which is located on a single line.
|
||||
*
|
||||
* @param {Editor} editor The editor object to compare against
|
||||
* @param {Range} parentRange The parent range to compare against
|
||||
* @returns {Range} A valid portion of the parentRange which is one a single line
|
||||
*/
|
||||
export declare const findCurrentLineRange: (editor: ReactEditor, parentRange: Range) => Range;
|
||||
//# sourceMappingURL=lines.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/lines.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/lines.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/lines.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAU,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAmBpD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,WACvB,WAAW,eACN,KAAK,KACjB,KA2CF,CAAA"}
|
||||
19
node_modules/slate-react/dist/utils/range-list.d.ts
generated
vendored
Normal file
19
node_modules/slate-react/dist/utils/range-list.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Range } from 'slate';
|
||||
export declare const shallowCompare: (obj1: {}, obj2: {}) => boolean;
|
||||
/**
|
||||
* Check if a list of decorator ranges are equal to another.
|
||||
*
|
||||
* PERF: this requires the two lists to also have the ranges inside them in the
|
||||
* same order, but this is an okay constraint for us since decorations are
|
||||
* kept in order, and the odd case where they aren't is okay to re-render for.
|
||||
*/
|
||||
export declare const isElementDecorationsEqual: (list: Range[], another: Range[]) => boolean;
|
||||
/**
|
||||
* Check if a list of decorator ranges are equal to another.
|
||||
*
|
||||
* PERF: this requires the two lists to also have the ranges inside them in the
|
||||
* same order, but this is an okay constraint for us since decorations are
|
||||
* kept in order, and the odd case where they aren't is okay to re-render for.
|
||||
*/
|
||||
export declare const isTextDecorationsEqual: (list: Range[], another: Range[]) => boolean;
|
||||
//# sourceMappingURL=range-list.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/range-list.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/range-list.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"range-list.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/range-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAG7B,eAAO,MAAM,cAAc,SAAU,EAAE,QAAQ,EAAE,YAI9C,CAAA;AAYH;;;;;;GAMG;AAEH,eAAO,MAAM,yBAAyB,SAC9B,KAAK,EAAE,WACJ,KAAK,EAAE,KACf,OAeF,CAAA;AAED;;;;;;GAMG;AAEH,eAAO,MAAM,sBAAsB,SAC3B,KAAK,EAAE,WACJ,KAAK,EAAE,KACf,OAoBF,CAAA"}
|
||||
52
node_modules/slate-react/dist/utils/weak-maps.d.ts
generated
vendored
Normal file
52
node_modules/slate-react/dist/utils/weak-maps.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { Ancestor, Editor, Node, Range, RangeRef, Text } from 'slate';
|
||||
import { Action } from '../hooks/android-input-manager/android-input-manager';
|
||||
import { TextDiff } from './diff-text';
|
||||
import { Key } from './key';
|
||||
/**
|
||||
* Two weak maps that allow us rebuild a path given a node. They are populated
|
||||
* at render time such that after a render occurs we can always backtrack.
|
||||
*/
|
||||
export declare const NODE_TO_INDEX: WeakMap<Node, number>;
|
||||
export declare const NODE_TO_PARENT: WeakMap<Node, Ancestor>;
|
||||
/**
|
||||
* Weak maps that allow us to go between Slate nodes and DOM nodes. These
|
||||
* are used to resolve DOM event-related logic into Slate actions.
|
||||
*/
|
||||
export declare const EDITOR_TO_WINDOW: WeakMap<Editor, Window>;
|
||||
export declare const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement>;
|
||||
export declare const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string>;
|
||||
export declare const EDITOR_TO_PLACEHOLDER_ELEMENT: WeakMap<Editor, HTMLElement>;
|
||||
export declare const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node>;
|
||||
export declare const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement>;
|
||||
export declare const NODE_TO_KEY: WeakMap<Node, Key>;
|
||||
export declare const EDITOR_TO_KEY_TO_ELEMENT: WeakMap<Editor, WeakMap<Key, HTMLElement>>;
|
||||
/**
|
||||
* Weak maps for storing editor-related state.
|
||||
*/
|
||||
export declare const IS_READ_ONLY: WeakMap<Editor, boolean>;
|
||||
export declare const IS_FOCUSED: WeakMap<Editor, boolean>;
|
||||
export declare const IS_COMPOSING: WeakMap<Editor, boolean>;
|
||||
export declare const EDITOR_TO_USER_SELECTION: WeakMap<Editor, RangeRef | null>;
|
||||
/**
|
||||
* Weak map for associating the context `onChange` context with the plugin.
|
||||
*/
|
||||
export declare const EDITOR_TO_ON_CHANGE: WeakMap<import("..").ReactEditor, () => void>;
|
||||
/**
|
||||
* Weak maps for saving pending state on composition stage.
|
||||
*/
|
||||
export declare const EDITOR_TO_SCHEDULE_FLUSH: WeakMap<Editor, () => void>;
|
||||
export declare const EDITOR_TO_PENDING_INSERTION_MARKS: WeakMap<Editor, Partial<Text> | null>;
|
||||
export declare const EDITOR_TO_USER_MARKS: WeakMap<Editor, Partial<Text> | null>;
|
||||
/**
|
||||
* Android input handling specific weak-maps
|
||||
*/
|
||||
export declare const EDITOR_TO_PENDING_DIFFS: WeakMap<Editor, TextDiff[]>;
|
||||
export declare const EDITOR_TO_PENDING_ACTION: WeakMap<Editor, Action | null>;
|
||||
export declare const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null>;
|
||||
export declare const EDITOR_TO_FORCE_RENDER: WeakMap<Editor, () => void>;
|
||||
/**
|
||||
* Symbols.
|
||||
*/
|
||||
export declare const PLACEHOLDER_SYMBOL: string;
|
||||
export declare const MARK_PLACEHOLDER_SYMBOL: string;
|
||||
//# sourceMappingURL=weak-maps.d.ts.map
|
||||
1
node_modules/slate-react/dist/utils/weak-maps.d.ts.map
generated
vendored
Normal file
1
node_modules/slate-react/dist/utils/weak-maps.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"weak-maps.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/utils/weak-maps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,sDAAsD,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3B;;;GAGG;AAEH,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAiB,CAAA;AACjE,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAiB,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAiB,CAAA;AACtE,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,CAAiB,CAAA;AAC5E,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAiB,CAAA;AAC3E,eAAO,MAAM,6BAA6B,EAAE,OAAO,CACjD,MAAM,EACN,WAAW,CACI,CAAA;AACjB,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAiB,CAAA;AACxE,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAiB,CAAA;AACxE,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAiB,CAAA;AAC5D,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAC5C,MAAM,EACN,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CACV,CAAA;AAEjB;;GAEG;AAEH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAiB,CAAA;AACnE,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAiB,CAAA;AACjE,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAiB,CAAA;AAEnE,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAC5C,MAAM,EACN,QAAQ,GAAG,IAAI,CACA,CAAA;AAEjB;;GAEG;AAEH,eAAO,MAAM,mBAAmB,0CAA6B,IAAI,CAAG,CAAA;AAEpE;;GAEG;AAEH,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAC5C,MAAM,EACN,MAAM,IAAI,CACK,CAAA;AAEjB,eAAO,MAAM,iCAAiC,EAAE,OAAO,CACrD,MAAM,EACN,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CACL,CAAA;AAEjB,eAAO,MAAM,oBAAoB,EAAE,OAAO,CACxC,MAAM,EACN,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CACL,CAAA;AAEjB;;GAEG;AAEH,eAAO,MAAM,uBAAuB,EAAE,OAAO,CAC3C,MAAM,EACN,QAAQ,EAAE,CACK,CAAA;AAEjB,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAC5C,MAAM,EACN,MAAM,GAAG,IAAI,CACE,CAAA;AAEjB,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAC/C,MAAM,EACN,KAAK,GAAG,IAAI,CACG,CAAA;AAEjB,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,CAAiB,CAAA;AAEhF;;GAEG;AAEH,eAAO,MAAM,kBAAkB,QAA+C,CAAA;AAC9E,eAAO,MAAM,uBAAuB,QAEb,CAAA"}
|
||||
3
node_modules/slate-react/node_modules/is-hotkey/.babelrc
generated
vendored
Normal file
3
node_modules/slate-react/node_modules/is-hotkey/.babelrc
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["env"]
|
||||
}
|
||||
6
node_modules/slate-react/node_modules/is-hotkey/.travis.yml
generated
vendored
Normal file
6
node_modules/slate-react/node_modules/is-hotkey/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
language: node_js
|
||||
node_js:
|
||||
- stable
|
||||
cache:
|
||||
yarn: true
|
||||
9
node_modules/slate-react/node_modules/is-hotkey/License.md
generated
vendored
Normal file
9
node_modules/slate-react/node_modules/is-hotkey/License.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
The MIT License
|
||||
|
||||
Copyright © 2017, [Ian Storm Taylor](https://ianstormtaylor.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
122
node_modules/slate-react/node_modules/is-hotkey/Readme.md
generated
vendored
Normal file
122
node_modules/slate-react/node_modules/is-hotkey/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
### `is-hotkey`
|
||||
|
||||
A simple way to check whether a browser event matches a hotkey.
|
||||
|
||||
<br/>
|
||||
|
||||
### Features
|
||||
|
||||
- Uses a simple, natural syntax for expressing hotkeys—`mod+s`, `cmd+alt+space`, etc.
|
||||
- Accepts `mod` for the classic "`cmd` on Mac, `ctrl` on Windows" use case.
|
||||
- Can use either `event.which` (default) or `event.key` to work regardless of keyboard layout.
|
||||
- Can be curried to reduce parsing and increase performance when needed.
|
||||
- Is very lightweight, weighing in at `< 1kb` minified and gzipped.
|
||||
|
||||
<br/>
|
||||
|
||||
### Example
|
||||
|
||||
The most basic usage...
|
||||
|
||||
```js
|
||||
import isHotkey from 'is-hotkey'
|
||||
|
||||
function onKeyDown(e) {
|
||||
if (isHotkey('mod+s', e)) {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Or, you can curry the hotkey string for better performance, since it is only parsed once...
|
||||
|
||||
```js
|
||||
import isHotkey from 'is-hotkey'
|
||||
|
||||
const isSaveHotkey = isHotkey('mod+s')
|
||||
|
||||
function onKeyDown(e) {
|
||||
if (isSaveHotkey(e)) {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
That's it!
|
||||
|
||||
<br/>
|
||||
|
||||
### Why?
|
||||
|
||||
There are tons of hotkey libraries, but they're often coupled to the view layer, or they bind events globally, or all kinds of weird things. You don't really want them to bind the events for you, you can do that yourself.
|
||||
|
||||
Instead, you want to just check whether a single event matches a hotkey. And you want to define your hotkeys in the standard-but-non-trivial-to-parse syntax that everyone knows.
|
||||
|
||||
But most libraries don't expose their parsing logic. And even for the ones that do expose their hotkey parsing logic, pulling in an entire library just to check a hotkey string is overkill.
|
||||
|
||||
So... this is a simple and lightweight hotkey checker!
|
||||
|
||||
<br/>
|
||||
|
||||
### API
|
||||
|
||||
```js
|
||||
import isHotkey from 'is-hotkey'
|
||||
|
||||
isHotkey('mod+s')(event)
|
||||
isHotkey('mod+s', { byKey: true })(event)
|
||||
|
||||
isHotkey('mod+s', event)
|
||||
isHotkey('mod+s', { byKey: true }, event)
|
||||
```
|
||||
|
||||
You can either pass `hotkey, [options], event` in which case the hotkey will be parsed and compared immediately. Or you can passed just `hotkey, [options]` to receive a curried checking function that you can re-use for multiple events.
|
||||
|
||||
```js
|
||||
isHotkey('mod+a')
|
||||
isHotkey('Control+S')
|
||||
isHotkey('cmd+opt+d')
|
||||
itHotkey('Meta+DownArrow')
|
||||
itHotkey('cmd+down')
|
||||
```
|
||||
|
||||
The API is case-insentive, and has all of the conveniences you'd expect—`cmd` vs. `Meta`, `opt` vs. `Alt`, `down` vs. `DownArrow`, etc.
|
||||
|
||||
It also accepts `mod` for the classic "`cmd` on Mac, `ctrl` on Windows" use case.
|
||||
|
||||
```js
|
||||
import isHotkey from 'is-hotkey'
|
||||
import { isCodeHotkey, isKeyHotkey } from 'is-hotkey'
|
||||
|
||||
isHotkey('mod+s')(event)
|
||||
isHotkey('mod+s', { byKey: true })(event)
|
||||
|
||||
isCodeHotkey('mod+s', event)
|
||||
isKeyHotkey('mod+s', event)
|
||||
```
|
||||
|
||||
By default the hotkey string is checked using `event.which`. But you can also pass in `byKey: true` to compare using the [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) API, which stays the same regardless of keyboard layout.
|
||||
|
||||
Or to reduce the noise if you are defining lots of hotkeys, you can use the `isCodeHotkey` and `isKeyHotkey` helpers that are exported.
|
||||
|
||||
```js
|
||||
import { toKeyName, toKeyCode } from 'is-hotkey'
|
||||
|
||||
toKeyName('cmd') // "meta"
|
||||
toKeyName('a') // "a"
|
||||
|
||||
toKeyCode('shift') // 16
|
||||
toKeyCode('a') // 65
|
||||
```
|
||||
|
||||
You can also use the exposed `toKeyName` and `toKeyCode` helpers, in case you want to add the same level of convenience to your own APIs.
|
||||
|
||||
```js
|
||||
import { parseHotkey, compareHotkey } from 'is-hotkey'
|
||||
|
||||
const hotkey = parseHotkey('mod+s', { byKey: true })
|
||||
const passes = compareHotkey(hotkey, event)
|
||||
```
|
||||
|
||||
You can also go even more low-level with the exposed `parseHotkey` and `compareHotkey` functions, which are what the default `isHotkey` export uses under the covers, in case you have more advanced needs.
|
||||
245
node_modules/slate-react/node_modules/is-hotkey/lib/index.js
generated
vendored
Normal file
245
node_modules/slate-react/node_modules/is-hotkey/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Constants.
|
||||
*/
|
||||
|
||||
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
||||
|
||||
var MODIFIERS = {
|
||||
alt: 'altKey',
|
||||
control: 'ctrlKey',
|
||||
meta: 'metaKey',
|
||||
shift: 'shiftKey'
|
||||
};
|
||||
|
||||
var ALIASES = {
|
||||
add: '+',
|
||||
break: 'pause',
|
||||
cmd: 'meta',
|
||||
command: 'meta',
|
||||
ctl: 'control',
|
||||
ctrl: 'control',
|
||||
del: 'delete',
|
||||
down: 'arrowdown',
|
||||
esc: 'escape',
|
||||
ins: 'insert',
|
||||
left: 'arrowleft',
|
||||
mod: IS_MAC ? 'meta' : 'control',
|
||||
opt: 'alt',
|
||||
option: 'alt',
|
||||
return: 'enter',
|
||||
right: 'arrowright',
|
||||
space: ' ',
|
||||
spacebar: ' ',
|
||||
up: 'arrowup',
|
||||
win: 'meta',
|
||||
windows: 'meta'
|
||||
};
|
||||
|
||||
var CODES = {
|
||||
backspace: 8,
|
||||
tab: 9,
|
||||
enter: 13,
|
||||
shift: 16,
|
||||
control: 17,
|
||||
alt: 18,
|
||||
pause: 19,
|
||||
capslock: 20,
|
||||
escape: 27,
|
||||
' ': 32,
|
||||
pageup: 33,
|
||||
pagedown: 34,
|
||||
end: 35,
|
||||
home: 36,
|
||||
arrowleft: 37,
|
||||
arrowup: 38,
|
||||
arrowright: 39,
|
||||
arrowdown: 40,
|
||||
insert: 45,
|
||||
delete: 46,
|
||||
meta: 91,
|
||||
numlock: 144,
|
||||
scrolllock: 145,
|
||||
';': 186,
|
||||
'=': 187,
|
||||
',': 188,
|
||||
'-': 189,
|
||||
'.': 190,
|
||||
'/': 191,
|
||||
'`': 192,
|
||||
'[': 219,
|
||||
'\\': 220,
|
||||
']': 221,
|
||||
'\'': 222
|
||||
};
|
||||
|
||||
for (var f = 1; f < 20; f++) {
|
||||
CODES['f' + f] = 111 + f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is hotkey?
|
||||
*/
|
||||
|
||||
function isHotkey(hotkey, options, event) {
|
||||
if (options && !('byKey' in options)) {
|
||||
event = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
if (!Array.isArray(hotkey)) {
|
||||
hotkey = [hotkey];
|
||||
}
|
||||
|
||||
var array = hotkey.map(function (string) {
|
||||
return parseHotkey(string, options);
|
||||
});
|
||||
var check = function check(e) {
|
||||
return array.some(function (object) {
|
||||
return compareHotkey(object, e);
|
||||
});
|
||||
};
|
||||
var ret = event == null ? check : check(event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
function isCodeHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, event);
|
||||
}
|
||||
|
||||
function isKeyHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, { byKey: true }, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse.
|
||||
*/
|
||||
|
||||
function parseHotkey(hotkey, options) {
|
||||
var byKey = options && options.byKey;
|
||||
var ret = {};
|
||||
|
||||
// Special case to handle the `+` key since we use it as a separator.
|
||||
hotkey = hotkey.replace('++', '+add');
|
||||
var values = hotkey.split('+');
|
||||
var length = values.length;
|
||||
|
||||
// Ensure that all the modifiers are set to false unless the hotkey has them.
|
||||
|
||||
for (var k in MODIFIERS) {
|
||||
ret[MODIFIERS[k]] = false;
|
||||
}
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var value = _step.value;
|
||||
|
||||
var optional = value.endsWith('?') && value.length > 1;
|
||||
|
||||
if (optional) {
|
||||
value = value.slice(0, -1);
|
||||
}
|
||||
|
||||
var name = toKeyName(value);
|
||||
var modifier = MODIFIERS[name];
|
||||
|
||||
if (length === 1 || !modifier) {
|
||||
if (byKey) {
|
||||
ret.key = name;
|
||||
} else {
|
||||
ret.which = toKeyCode(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (modifier) {
|
||||
ret[modifier] = optional ? null : true;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare.
|
||||
*/
|
||||
|
||||
function compareHotkey(object, event) {
|
||||
for (var key in object) {
|
||||
var expected = object[key];
|
||||
var actual = void 0;
|
||||
|
||||
if (expected == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key === 'key' && event.key != null) {
|
||||
actual = event.key.toLowerCase();
|
||||
} else if (key === 'which') {
|
||||
actual = expected === 91 && event.which === 93 ? 91 : event.which;
|
||||
} else {
|
||||
actual = event[key];
|
||||
}
|
||||
|
||||
if (actual == null && expected === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (actual !== expected) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utils.
|
||||
*/
|
||||
|
||||
function toKeyCode(name) {
|
||||
name = toKeyName(name);
|
||||
var code = CODES[name] || name.toUpperCase().charCodeAt(0);
|
||||
return code;
|
||||
}
|
||||
|
||||
function toKeyName(name) {
|
||||
name = name.toLowerCase();
|
||||
name = ALIASES[name] || name;
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export.
|
||||
*/
|
||||
|
||||
exports.default = isHotkey;
|
||||
exports.isHotkey = isHotkey;
|
||||
exports.isCodeHotkey = isCodeHotkey;
|
||||
exports.isKeyHotkey = isKeyHotkey;
|
||||
exports.parseHotkey = parseHotkey;
|
||||
exports.compareHotkey = compareHotkey;
|
||||
exports.toKeyCode = toKeyCode;
|
||||
exports.toKeyName = toKeyName;
|
||||
263
node_modules/slate-react/node_modules/is-hotkey/lib/is-hotkey.umd.js
generated
vendored
Normal file
263
node_modules/slate-react/node_modules/is-hotkey/lib/is-hotkey.umd.js
generated
vendored
Normal file
@@ -0,0 +1,263 @@
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(['exports'], factory);
|
||||
} else if (typeof exports !== "undefined") {
|
||||
factory(exports);
|
||||
} else {
|
||||
var mod = {
|
||||
exports: {}
|
||||
};
|
||||
factory(mod.exports);
|
||||
global.index = mod.exports;
|
||||
}
|
||||
})(this, function (exports) {
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Constants.
|
||||
*/
|
||||
|
||||
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
||||
|
||||
var MODIFIERS = {
|
||||
alt: 'altKey',
|
||||
control: 'ctrlKey',
|
||||
meta: 'metaKey',
|
||||
shift: 'shiftKey'
|
||||
};
|
||||
|
||||
var ALIASES = {
|
||||
add: '+',
|
||||
break: 'pause',
|
||||
cmd: 'meta',
|
||||
command: 'meta',
|
||||
ctl: 'control',
|
||||
ctrl: 'control',
|
||||
del: 'delete',
|
||||
down: 'arrowdown',
|
||||
esc: 'escape',
|
||||
ins: 'insert',
|
||||
left: 'arrowleft',
|
||||
mod: IS_MAC ? 'meta' : 'control',
|
||||
opt: 'alt',
|
||||
option: 'alt',
|
||||
return: 'enter',
|
||||
right: 'arrowright',
|
||||
space: ' ',
|
||||
spacebar: ' ',
|
||||
up: 'arrowup',
|
||||
win: 'meta',
|
||||
windows: 'meta'
|
||||
};
|
||||
|
||||
var CODES = {
|
||||
backspace: 8,
|
||||
tab: 9,
|
||||
enter: 13,
|
||||
shift: 16,
|
||||
control: 17,
|
||||
alt: 18,
|
||||
pause: 19,
|
||||
capslock: 20,
|
||||
escape: 27,
|
||||
' ': 32,
|
||||
pageup: 33,
|
||||
pagedown: 34,
|
||||
end: 35,
|
||||
home: 36,
|
||||
arrowleft: 37,
|
||||
arrowup: 38,
|
||||
arrowright: 39,
|
||||
arrowdown: 40,
|
||||
insert: 45,
|
||||
delete: 46,
|
||||
meta: 91,
|
||||
numlock: 144,
|
||||
scrolllock: 145,
|
||||
';': 186,
|
||||
'=': 187,
|
||||
',': 188,
|
||||
'-': 189,
|
||||
'.': 190,
|
||||
'/': 191,
|
||||
'`': 192,
|
||||
'[': 219,
|
||||
'\\': 220,
|
||||
']': 221,
|
||||
'\'': 222
|
||||
};
|
||||
|
||||
for (var f = 1; f < 20; f++) {
|
||||
CODES['f' + f] = 111 + f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is hotkey?
|
||||
*/
|
||||
|
||||
function isHotkey(hotkey, options, event) {
|
||||
if (options && !('byKey' in options)) {
|
||||
event = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
if (!Array.isArray(hotkey)) {
|
||||
hotkey = [hotkey];
|
||||
}
|
||||
|
||||
var array = hotkey.map(function (string) {
|
||||
return parseHotkey(string, options);
|
||||
});
|
||||
var check = function check(e) {
|
||||
return array.some(function (object) {
|
||||
return compareHotkey(object, e);
|
||||
});
|
||||
};
|
||||
var ret = event == null ? check : check(event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
function isCodeHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, event);
|
||||
}
|
||||
|
||||
function isKeyHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, { byKey: true }, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse.
|
||||
*/
|
||||
|
||||
function parseHotkey(hotkey, options) {
|
||||
var byKey = options && options.byKey;
|
||||
var ret = {};
|
||||
|
||||
// Special case to handle the `+` key since we use it as a separator.
|
||||
hotkey = hotkey.replace('++', '+add');
|
||||
var values = hotkey.split('+');
|
||||
var length = values.length;
|
||||
|
||||
|
||||
// Ensure that all the modifiers are set to false unless the hotkey has them.
|
||||
for (var k in MODIFIERS) {
|
||||
ret[MODIFIERS[k]] = false;
|
||||
}
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var value = _step.value;
|
||||
|
||||
var optional = value.endsWith('?') && value.length > 1;
|
||||
|
||||
if (optional) {
|
||||
value = value.slice(0, -1);
|
||||
}
|
||||
|
||||
var name = toKeyName(value);
|
||||
var modifier = MODIFIERS[name];
|
||||
|
||||
if (value.length > 1 && !modifier && !ALIASES[value] && !CODES[name]) {
|
||||
throw new TypeError('Unknown modifier: "' + value + '"');
|
||||
}
|
||||
|
||||
if (length === 1 || !modifier) {
|
||||
if (byKey) {
|
||||
ret.key = name;
|
||||
} else {
|
||||
ret.which = toKeyCode(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (modifier) {
|
||||
ret[modifier] = optional ? null : true;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare.
|
||||
*/
|
||||
|
||||
function compareHotkey(object, event) {
|
||||
for (var key in object) {
|
||||
var expected = object[key];
|
||||
var actual = void 0;
|
||||
|
||||
if (expected == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key === 'key' && event.key != null) {
|
||||
actual = event.key.toLowerCase();
|
||||
} else if (key === 'which') {
|
||||
actual = expected === 91 && event.which === 93 ? 91 : event.which;
|
||||
} else {
|
||||
actual = event[key];
|
||||
}
|
||||
|
||||
if (actual == null && expected === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (actual !== expected) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utils.
|
||||
*/
|
||||
|
||||
function toKeyCode(name) {
|
||||
name = toKeyName(name);
|
||||
var code = CODES[name] || name.toUpperCase().charCodeAt(0);
|
||||
return code;
|
||||
}
|
||||
|
||||
function toKeyName(name) {
|
||||
name = name.toLowerCase();
|
||||
name = ALIASES[name] || name;
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export.
|
||||
*/
|
||||
|
||||
exports.default = isHotkey;
|
||||
exports.isHotkey = isHotkey;
|
||||
exports.isCodeHotkey = isCodeHotkey;
|
||||
exports.isKeyHotkey = isKeyHotkey;
|
||||
exports.parseHotkey = parseHotkey;
|
||||
exports.compareHotkey = compareHotkey;
|
||||
exports.toKeyCode = toKeyCode;
|
||||
exports.toKeyName = toKeyName;
|
||||
});
|
||||
36
node_modules/slate-react/node_modules/is-hotkey/package.json
generated
vendored
Normal file
36
node_modules/slate-react/node_modules/is-hotkey/package.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "is-hotkey",
|
||||
"description": "Check whether a browser event matches a hotkey.",
|
||||
"version": "0.1.8",
|
||||
"license": "MIT",
|
||||
"repository": "git://github.com/ianstormtaylor/is-hotkey.git",
|
||||
"main": "./lib/index.js",
|
||||
"scripts": {
|
||||
"build": "babel ./src --out-dir ./lib",
|
||||
"clean": "rm -rf ./lib ./node_modules",
|
||||
"prepublish": "yarn run build",
|
||||
"release": "np",
|
||||
"test": "yarn run build && mocha",
|
||||
"watch": "babel ./lib --out-dir ./lib --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.10.1",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"mocha": "^3.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"code",
|
||||
"combo",
|
||||
"event",
|
||||
"hotkey",
|
||||
"key",
|
||||
"keycode",
|
||||
"keycodes",
|
||||
"keycombo",
|
||||
"keydown",
|
||||
"keyup",
|
||||
"mousetrap",
|
||||
"shortcut",
|
||||
"which"
|
||||
]
|
||||
}
|
||||
218
node_modules/slate-react/node_modules/is-hotkey/src/index.js
generated
vendored
Normal file
218
node_modules/slate-react/node_modules/is-hotkey/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
|
||||
/**
|
||||
* Constants.
|
||||
*/
|
||||
|
||||
const IS_MAC = (
|
||||
typeof window != 'undefined' &&
|
||||
/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)
|
||||
)
|
||||
|
||||
const MODIFIERS = {
|
||||
alt: 'altKey',
|
||||
control: 'ctrlKey',
|
||||
meta: 'metaKey',
|
||||
shift: 'shiftKey',
|
||||
}
|
||||
|
||||
const ALIASES = {
|
||||
add: '+',
|
||||
break: 'pause',
|
||||
cmd: 'meta',
|
||||
command: 'meta',
|
||||
ctl: 'control',
|
||||
ctrl: 'control',
|
||||
del: 'delete',
|
||||
down: 'arrowdown',
|
||||
esc: 'escape',
|
||||
ins: 'insert',
|
||||
left: 'arrowleft',
|
||||
mod: IS_MAC ? 'meta' : 'control',
|
||||
opt: 'alt',
|
||||
option: 'alt',
|
||||
return: 'enter',
|
||||
right: 'arrowright',
|
||||
space: ' ',
|
||||
spacebar: ' ',
|
||||
up: 'arrowup',
|
||||
win: 'meta',
|
||||
windows: 'meta',
|
||||
}
|
||||
|
||||
const CODES = {
|
||||
backspace: 8,
|
||||
tab: 9,
|
||||
enter: 13,
|
||||
shift: 16,
|
||||
control: 17,
|
||||
alt: 18,
|
||||
pause: 19,
|
||||
capslock: 20,
|
||||
escape: 27,
|
||||
' ': 32,
|
||||
pageup: 33,
|
||||
pagedown: 34,
|
||||
end: 35,
|
||||
home: 36,
|
||||
arrowleft: 37,
|
||||
arrowup: 38,
|
||||
arrowright: 39,
|
||||
arrowdown: 40,
|
||||
insert: 45,
|
||||
delete: 46,
|
||||
meta: 91,
|
||||
numlock: 144,
|
||||
scrolllock: 145,
|
||||
';': 186,
|
||||
'=': 187,
|
||||
',': 188,
|
||||
'-': 189,
|
||||
'.': 190,
|
||||
'/': 191,
|
||||
'`': 192,
|
||||
'[': 219,
|
||||
'\\': 220,
|
||||
']': 221,
|
||||
'\'': 222,
|
||||
}
|
||||
|
||||
for (var f = 1; f < 20; f++) {
|
||||
CODES['f' + f] = 111 + f
|
||||
}
|
||||
|
||||
/**
|
||||
* Is hotkey?
|
||||
*/
|
||||
|
||||
function isHotkey(hotkey, options, event) {
|
||||
if (options && !('byKey' in options)) {
|
||||
event = options
|
||||
options = null
|
||||
}
|
||||
|
||||
if (!Array.isArray(hotkey)) {
|
||||
hotkey = [hotkey]
|
||||
}
|
||||
|
||||
const array = hotkey.map(string => parseHotkey(string, options))
|
||||
const check = e => array.some(object => compareHotkey(object, e))
|
||||
const ret = event == null ? check : check(event)
|
||||
return ret
|
||||
}
|
||||
|
||||
function isCodeHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, event)
|
||||
}
|
||||
|
||||
function isKeyHotkey(hotkey, event) {
|
||||
return isHotkey(hotkey, { byKey: true }, event)
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse.
|
||||
*/
|
||||
|
||||
function parseHotkey(hotkey, options) {
|
||||
const byKey = options && options.byKey
|
||||
const ret = {}
|
||||
|
||||
// Special case to handle the `+` key since we use it as a separator.
|
||||
hotkey = hotkey.replace('++', '+add')
|
||||
const values = hotkey.split('+')
|
||||
const { length } = values
|
||||
|
||||
// Ensure that all the modifiers are set to false unless the hotkey has them.
|
||||
for (const k in MODIFIERS) {
|
||||
ret[MODIFIERS[k]] = false
|
||||
}
|
||||
|
||||
for (let value of values) {
|
||||
const optional = value.endsWith('?') && value.length > 1;
|
||||
|
||||
if (optional) {
|
||||
value = value.slice(0, -1)
|
||||
}
|
||||
|
||||
const name = toKeyName(value)
|
||||
const modifier = MODIFIERS[name]
|
||||
|
||||
if (length === 1 || !modifier) {
|
||||
if (byKey) {
|
||||
ret.key = name
|
||||
} else {
|
||||
ret.which = toKeyCode(value)
|
||||
}
|
||||
}
|
||||
|
||||
if (modifier) {
|
||||
ret[modifier] = optional ? null : true
|
||||
}
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare.
|
||||
*/
|
||||
|
||||
function compareHotkey(object, event) {
|
||||
for (const key in object) {
|
||||
const expected = object[key]
|
||||
let actual
|
||||
|
||||
if (expected == null) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (key === 'key' && event.key != null) {
|
||||
actual = event.key.toLowerCase()
|
||||
} else if (key === 'which') {
|
||||
actual = expected === 91 && event.which === 93 ? 91 : event.which
|
||||
} else {
|
||||
actual = event[key]
|
||||
}
|
||||
|
||||
if (actual == null && expected === false) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (actual !== expected) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Utils.
|
||||
*/
|
||||
|
||||
function toKeyCode(name) {
|
||||
name = toKeyName(name)
|
||||
const code = CODES[name] || name.toUpperCase().charCodeAt(0)
|
||||
return code
|
||||
}
|
||||
|
||||
function toKeyName(name) {
|
||||
name = name.toLowerCase()
|
||||
name = ALIASES[name] || name
|
||||
return name
|
||||
}
|
||||
|
||||
/**
|
||||
* Export.
|
||||
*/
|
||||
|
||||
export default isHotkey
|
||||
|
||||
export {
|
||||
isHotkey,
|
||||
isCodeHotkey,
|
||||
isKeyHotkey,
|
||||
parseHotkey,
|
||||
compareHotkey,
|
||||
toKeyCode,
|
||||
toKeyName,
|
||||
}
|
||||
21
node_modules/slate-react/node_modules/tiny-invariant/LICENSE
generated
vendored
Normal file
21
node_modules/slate-react/node_modules/tiny-invariant/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Alexander Reardon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
88
node_modules/slate-react/node_modules/tiny-invariant/README.md
generated
vendored
Normal file
88
node_modules/slate-react/node_modules/tiny-invariant/README.md
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# `tiny-invariant` 🔬💥
|
||||
|
||||
[](https://travis-ci.org/alexreardon/tiny-invariant)
|
||||
[](https://www.npmjs.com/package/tiny-invariant) [](https://david-dm.org/alexreardon/tiny-invariant)
|
||||
[](https://www.npmjs.com/package/tiny-invariant)
|
||||
[](https://www.npmjs.com/package/tiny-invariant)
|
||||
|
||||
A tiny [`invariant`](https://www.npmjs.com/package/invariant) alternative.
|
||||
|
||||
## What is `invariant`?
|
||||
|
||||
An `invariant` function takes a value, and if the value is [falsy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy) then the `invariant` function will throw. If the value is [truthy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy), then the function will not throw.
|
||||
|
||||
```js
|
||||
import invariant from 'tiny-invariant';
|
||||
|
||||
invariant(truthyValue, 'This should not throw!');
|
||||
|
||||
invariant(falsyValue, 'This will throw!');
|
||||
// Error('Invariant violation: This will throw!');
|
||||
```
|
||||
|
||||
## Why `tiny-invariant`?
|
||||
|
||||
The [`library: invariant`](https://www.npmjs.com/package/invariant) supports passing in arguments to the `invariant` function in a sprintf style `(condition, format, a, b, c, d, e, f)`. It has internal logic to execute the sprintf substitutions. The sprintf logic is not removed in production builds. `tiny-invariant` has dropped all of the sprintf logic. `tiny-invariant` allows you to pass a single string message. With [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) there is really no need for a custom message formatter to be built into the library. If you need a multi part message you can just do this: `invariant(condition, 'Hello, ${name} - how are you today?')`
|
||||
|
||||
## API: `(condition: mixed, message?: string) => void`
|
||||
|
||||
- `condition` is required and can be anything
|
||||
- `message` is an optional string
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# yarn
|
||||
yarn add tiny-invariant
|
||||
|
||||
# bash
|
||||
npm add tiny-invariant --save
|
||||
```
|
||||
|
||||
## Dropping your `message` for kb savings!
|
||||
|
||||
We recommend using [`babel-plugin-dev-expression`](https://www.npmjs.com/package/babel-plugin-dev-expression) to remove the `message` argument from your `invariant` calls in production builds to save kbs!
|
||||
|
||||
What it does it turn your code that looks like this:
|
||||
|
||||
```js
|
||||
invariant(condition, 'My cool message that takes up a lot of kbs');
|
||||
```
|
||||
|
||||
Into this
|
||||
|
||||
```js
|
||||
if (!condition) {
|
||||
if ('production' !== process.env.NODE_ENV) {
|
||||
invariant(false, 'My cool message that takes up a lot of kbs');
|
||||
} else {
|
||||
invariant(false);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Your bundler can then drop the code in the `"production" !== process.env.NODE_ENV` block for your production builds
|
||||
|
||||
Final result:
|
||||
|
||||
```js
|
||||
if (!condition) {
|
||||
invariant(false);
|
||||
}
|
||||
```
|
||||
|
||||
> For `rollup` use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) and set `NODE_ENV` to `production` and then `rollup` will treeshake out the unused code
|
||||
>
|
||||
> [`Webpack` instructions](https://webpack.js.org/guides/production/#specify-the-mode)
|
||||
|
||||
## Builds
|
||||
|
||||
- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library)
|
||||
- We have a `cjs` (CommonJS) build
|
||||
- We have a `umd` (Universal module definition) build in case you needed it
|
||||
|
||||
We expect `process.env.NODE_ENV` to be available at module compilation. We cache this value
|
||||
|
||||
## That's it!
|
||||
|
||||
🤘
|
||||
17
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js
generated
vendored
Normal file
17
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var isProduction = process.env.NODE_ENV === 'production';
|
||||
var prefix = 'Invariant failed';
|
||||
function invariant(condition, message) {
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isProduction) {
|
||||
throw new Error(prefix);
|
||||
} else {
|
||||
throw new Error(prefix + ": " + (message || ''));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = invariant;
|
||||
3
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js.flow
generated
vendored
Normal file
3
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js.flow
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../src';
|
||||
15
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.esm.js
generated
vendored
Normal file
15
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.esm.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var isProduction = process.env.NODE_ENV === 'production';
|
||||
var prefix = 'Invariant failed';
|
||||
function invariant(condition, message) {
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isProduction) {
|
||||
throw new Error(prefix);
|
||||
} else {
|
||||
throw new Error(prefix + ": " + (message || ''));
|
||||
}
|
||||
}
|
||||
|
||||
export default invariant;
|
||||
20
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.js
generated
vendored
Normal file
20
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.invariant = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
var prefix = 'Invariant failed';
|
||||
function invariant(condition, message) {
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
throw new Error(prefix + ": " + (message || ''));
|
||||
}
|
||||
}
|
||||
|
||||
return invariant;
|
||||
|
||||
}));
|
||||
1
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.min.js
generated
vendored
Normal file
1
node_modules/slate-react/node_modules/tiny-invariant/dist/tiny-invariant.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).invariant=n()}(this,function(){"use strict";return function(e,n){if(!e)throw new Error("Invariant failed")}});
|
||||
53
node_modules/slate-react/node_modules/tiny-invariant/package.json
generated
vendored
Normal file
53
node_modules/slate-react/node_modules/tiny-invariant/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "tiny-invariant",
|
||||
"version": "1.0.6",
|
||||
"keywords": [
|
||||
"invariant",
|
||||
"error"
|
||||
],
|
||||
"description": "A tiny invariant function",
|
||||
"main": "dist/tiny-invariant.cjs.js",
|
||||
"module": "dist/tiny-invariant.esm.js",
|
||||
"types": "src/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"/dist",
|
||||
"/src"
|
||||
],
|
||||
"author": "Alex Reardon <alexreardon@gmail.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alexreardon/tiny-invariant.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/alexreardon/tiny-invariant/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "yarn jest",
|
||||
"lint": "yarn prettier --debug-check src/** test/**",
|
||||
"typecheck": "yarn flow",
|
||||
"validate": "yarn lint && yarn flow",
|
||||
"build:clean": "rimraf dist",
|
||||
"build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/tiny-invariant.cjs.js.flow",
|
||||
"build:dist": "yarn rollup --config rollup.config.js",
|
||||
"build": "yarn build:clean && yarn build:dist && yarn build:flow",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/preset-env": "^7.5.0",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/runtime-corejs2": "^7.5.1",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-jest": "^24.8.0",
|
||||
"flow-bin": "^0.102.0",
|
||||
"jest": "^24.8.0",
|
||||
"prettier": "^1.18.2",
|
||||
"rimraf": "^2.6.3",
|
||||
"rollup": "^1.16.6",
|
||||
"rollup-plugin-babel": "^4.3.3",
|
||||
"rollup-plugin-replace": "^2.2.0",
|
||||
"rollup-plugin-uglify": "^6.0.2"
|
||||
}
|
||||
}
|
||||
1
node_modules/slate-react/node_modules/tiny-invariant/src/index.d.ts
generated
vendored
Normal file
1
node_modules/slate-react/node_modules/tiny-invariant/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function invariant(condition: any, message?: string): void
|
||||
22
node_modules/slate-react/node_modules/tiny-invariant/src/index.js
generated
vendored
Normal file
22
node_modules/slate-react/node_modules/tiny-invariant/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// @flow
|
||||
const isProduction: boolean = process.env.NODE_ENV === 'production';
|
||||
const prefix: string = 'Invariant failed';
|
||||
|
||||
// Throw an error if the condition fails
|
||||
// Strip out error messages for production
|
||||
// > Not providing an inline default argument for message as the result is smaller
|
||||
export default function invariant(condition: mixed, message?: string) {
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
// Condition not passed
|
||||
|
||||
if (isProduction) {
|
||||
// In production we strip the message but still throw
|
||||
throw new Error(prefix);
|
||||
} else {
|
||||
// When not in production we allow the message to pass through
|
||||
// *This block will be removed in production builds*
|
||||
throw new Error(`${prefix}: ${message || ''}`);
|
||||
}
|
||||
}
|
||||
73
node_modules/slate-react/package.json
generated
vendored
Normal file
73
node_modules/slate-react/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "slate-react",
|
||||
"description": "Tools for building completely customizable richtext editors with React.",
|
||||
"version": "0.91.11",
|
||||
"license": "MIT",
|
||||
"repository": "git://github.com/ianstormtaylor/slate.git",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.es.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"umd": "dist/slate-react.js",
|
||||
"umdMin": "dist/slate-react.min.js",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"dependencies": {
|
||||
"@juggle/resize-observer": "^3.4.0",
|
||||
"@types/is-hotkey": "^0.1.1",
|
||||
"@types/lodash": "^4.14.149",
|
||||
"direction": "^1.0.3",
|
||||
"is-hotkey": "^0.1.6",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"scroll-into-view-if-needed": "^2.2.20",
|
||||
"tiny-invariant": "1.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "^7.7.4",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/react": "^16.9.13",
|
||||
"@types/react-dom": "^16.9.4",
|
||||
"@types/react-test-renderer": "^16.8.0",
|
||||
"@types/resize-observer-browser": "^0.1.7",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
"react-test-renderer": ">=16.8.0",
|
||||
"slate": "^0.91.4",
|
||||
"slate-hyperscript": "^0.81.3",
|
||||
"source-map-loader": "^4.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
"slate": ">=0.65.3"
|
||||
},
|
||||
"umdGlobals": {
|
||||
"react": "React",
|
||||
"slate": "Slate"
|
||||
},
|
||||
"keywords": [
|
||||
"canvas",
|
||||
"contenteditable",
|
||||
"docs",
|
||||
"document",
|
||||
"edit",
|
||||
"editor",
|
||||
"editable",
|
||||
"html",
|
||||
"immutable",
|
||||
"markdown",
|
||||
"medium",
|
||||
"paper",
|
||||
"react",
|
||||
"rich",
|
||||
"richtext",
|
||||
"richtext",
|
||||
"slate",
|
||||
"text",
|
||||
"wysiwyg",
|
||||
"wysiwym"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user