@yoopta/editor 4.0.0-rc.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/UI/BlockOptions/BlockOptions.d.ts +5 -5
- package/dist/UI/BlockOptions/BlockOptions.d.ts.map +1 -1
- package/dist/UI/BlockOptions/utils.d.ts +30 -0
- package/dist/UI/BlockOptions/utils.d.ts.map +1 -0
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +2 -1
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +1 -1
- package/dist/UI/index.d.ts +8 -7
- package/dist/UI/index.d.ts.map +1 -1
- package/dist/YooptaEditor.d.ts +9 -6
- package/dist/YooptaEditor.d.ts.map +1 -1
- package/dist/components/Block/Block.d.ts +1 -2
- package/dist/components/Block/Block.d.ts.map +1 -1
- package/dist/components/Block/BlockActions.d.ts +1 -2
- package/dist/components/Block/BlockActions.d.ts.map +1 -1
- package/dist/components/Editor/Editor.d.ts +4 -2
- package/dist/components/Editor/Editor.d.ts.map +1 -1
- package/dist/components/Editor/RenderBlocks.d.ts +2 -2
- package/dist/components/Editor/RenderBlocks.d.ts.map +1 -1
- package/dist/components/Editor/utils.d.ts.map +1 -1
- package/dist/components/SelectionBox/SelectionBox.d.ts +2 -2
- package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -1
- package/dist/components/SelectionBox/hooks.d.ts.map +1 -1
- package/dist/components/TextLeaf/TextLeaf.d.ts +1 -2
- package/dist/components/TextLeaf/TextLeaf.d.ts.map +1 -1
- package/dist/contexts/{UltraYooptaContext → YooptaContext}/ToolsContext.d.ts +1 -1
- package/dist/contexts/YooptaContext/ToolsContext.d.ts.map +1 -0
- package/dist/contexts/{UltraYooptaContext/UltraYooptaContext.d.ts → YooptaContext/YooptaContext.d.ts} +8 -9
- package/dist/contexts/YooptaContext/YooptaContext.d.ts.map +1 -0
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/selection/setBlockSelected.d.ts +1 -1
- package/dist/editor/selection/setBlockSelected.d.ts.map +1 -1
- package/dist/editor/textFormats/toggle.d.ts.map +1 -1
- package/dist/editor/textFormats/update.d.ts.map +1 -1
- package/dist/editor/transforms/createBlock.d.ts.map +1 -1
- package/dist/editor/transforms/decreaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/transforms/deleteBlock.d.ts.map +1 -1
- package/dist/editor/transforms/duplicateBlock.d.ts.map +1 -1
- package/dist/editor/transforms/focusBlock.d.ts.map +1 -1
- package/dist/editor/transforms/getBlock.d.ts +2 -0
- package/dist/editor/transforms/getBlock.d.ts.map +1 -0
- package/dist/editor/transforms/increaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/transforms/insertBlock.d.ts +1 -1
- package/dist/editor/transforms/insertBlock.d.ts.map +1 -1
- package/dist/editor/transforms/insertBlocks.d.ts +3 -0
- package/dist/editor/transforms/insertBlocks.d.ts.map +1 -0
- package/dist/editor/transforms/splitBlock.d.ts.map +1 -1
- package/dist/editor/transforms/toggleBlock.d.ts +4 -2
- package/dist/editor/transforms/toggleBlock.d.ts.map +1 -1
- package/dist/editor/transforms/updateBlock.d.ts.map +1 -1
- package/dist/editor/transforms/updateBlockElement.d.ts.map +1 -1
- package/dist/editor/types.d.ts +15 -13
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/handlers/onKeyDown.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/marks/FakeSelectionMark.d.ts +5 -0
- package/dist/marks/FakeSelectionMark.d.ts.map +1 -0
- package/dist/parsers/deserializeHTML.d.ts +10 -0
- package/dist/parsers/deserializeHTML.d.ts.map +1 -0
- package/dist/parsers/deserializeMarkdown.d.ts +2 -0
- package/dist/parsers/deserializeMarkdown.d.ts.map +1 -0
- package/dist/parsers/index.d.ts +10 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/serializeHTML.d.ts +2 -0
- package/dist/parsers/serializeHTML.d.ts.map +1 -0
- package/dist/parsers/serializeMarkdown.d.ts +2 -0
- package/dist/parsers/serializeMarkdown.d.ts.map +1 -0
- package/dist/plugins/SlateEditorComponent.d.ts +4 -5
- package/dist/plugins/SlateEditorComponent.d.ts.map +1 -1
- package/dist/plugins/createYooptaPlugin.d.ts +12 -4
- package/dist/plugins/createYooptaPlugin.d.ts.map +1 -1
- package/dist/plugins/extenstions/withInlines.d.ts.map +1 -1
- package/dist/plugins/types.d.ts +24 -14
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/utils/editorBuilders.d.ts +3 -3
- package/dist/utils/editorBuilders.d.ts.map +1 -1
- package/dist/utils/generateId.d.ts.map +1 -1
- package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -1
- package/dist/utils/validators.d.ts +2 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/package.json +8 -11
- package/LICENSE +0 -21
- package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts.map +0 -1
- package/dist/contexts/UltraYooptaContext/UltraYooptaContext.d.ts.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
declare const BlockOptionsMenuGroup: ({ children }: {
|
|
3
3
|
children: any;
|
|
4
|
-
}) => JSX.Element;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const BlockOptionsMenuContent: ({ children }: {
|
|
6
6
|
children: any;
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const BlockOptionsMenuItem: ({ children }: {
|
|
9
9
|
children: any;
|
|
10
|
-
}) => JSX.Element;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
type BlockOptionsSeparatorProps = {
|
|
12
12
|
className?: string;
|
|
13
13
|
};
|
|
14
|
-
declare const BlockOptionsSeparator: ({ className }: BlockOptionsSeparatorProps) => JSX.Element;
|
|
14
|
+
declare const BlockOptionsSeparator: ({ className }: BlockOptionsSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
type BlockOptionsProps = {
|
|
16
16
|
isOpen: boolean;
|
|
17
17
|
onClose: () => void;
|
|
@@ -19,6 +19,6 @@ type BlockOptionsProps = {
|
|
|
19
19
|
style: CSSProperties;
|
|
20
20
|
children?: React.ReactNode;
|
|
21
21
|
};
|
|
22
|
-
declare const BlockOptions: ({ isOpen, onClose, refs, style, children }: BlockOptionsProps) => JSX.Element | null;
|
|
22
|
+
declare const BlockOptions: ({ isOpen, onClose, refs, style, children }: BlockOptionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
23
23
|
export { BlockOptions, BlockOptionsMenuContent, BlockOptionsMenuGroup, BlockOptionsMenuItem, BlockOptionsSeparator };
|
|
24
24
|
//# sourceMappingURL=BlockOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockOptions.d.ts","sourceRoot":"","sources":["../../../src/UI/BlockOptions/BlockOptions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BlockOptions.d.ts","sourceRoot":"","sources":["../../../src/UI/BlockOptions/BlockOptions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAmBhD,QAAA,MAAM,qBAAqB;;6CAA0F,CAAC;AAEtH,QAAA,MAAM,uBAAuB;;6CAO5B,CAAC;AAEF,QAAA,MAAM,oBAAoB;;6CAIzB,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,qBAAqB,kBAAmB,0BAA0B,4CAEvE,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAM,YAAY,+CAAgD,iBAAiB,mDAoIlF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { YooEditor } from '../../editor/types';
|
|
2
|
+
type Params = {
|
|
3
|
+
editor: YooEditor;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
empty?: boolean;
|
|
6
|
+
view?: 'small' | 'default';
|
|
7
|
+
};
|
|
8
|
+
export declare function buildActionMenuRenderProps({ editor, view, onClose }: Params): {
|
|
9
|
+
actions: {
|
|
10
|
+
type: string;
|
|
11
|
+
title: any;
|
|
12
|
+
description: any;
|
|
13
|
+
}[];
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
empty: boolean;
|
|
16
|
+
getItemProps: (type: any) => {
|
|
17
|
+
onMouseEnter: () => undefined;
|
|
18
|
+
'data-action-menu-item': boolean;
|
|
19
|
+
'data-action-menu-item-type': any;
|
|
20
|
+
'aria-selected': boolean;
|
|
21
|
+
onClick: () => void;
|
|
22
|
+
};
|
|
23
|
+
getRootProps: () => {
|
|
24
|
+
'data-action-menu-list': boolean;
|
|
25
|
+
};
|
|
26
|
+
editor: YooEditor<any>;
|
|
27
|
+
view: "small" | "default" | undefined;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/UI/BlockOptions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,KAAK,MAAM,GAAG;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;EA8C3E"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
type Props = {
|
|
3
|
+
id?: string;
|
|
3
4
|
className?: string;
|
|
4
5
|
style?: React.CSSProperties;
|
|
5
6
|
onClick?: () => void;
|
|
6
7
|
children: ReactNode;
|
|
7
8
|
};
|
|
8
|
-
declare const ExtendedBlockActions: ({ className, style, onClick, children }: Props) => JSX.Element;
|
|
9
|
+
declare const ExtendedBlockActions: ({ id, className, style, onClick, children }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export { ExtendedBlockActions };
|
|
10
11
|
//# sourceMappingURL=ExtendedBlockActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendedBlockActions.d.ts","sourceRoot":"","sources":["../../../src/UI/ExtendedBlockActions/ExtendedBlockActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExtendedBlockActions.d.ts","sourceRoot":"","sources":["../../../src/UI/ExtendedBlockActions/ExtendedBlockActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAI5C,KAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,oBAAoB,gDAAiD,KAAK,mDAsD/E,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/UI/index.d.ts
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const UI: {
|
|
3
|
-
ExtendedBlockActions: ({ className, style, onClick, children }: {
|
|
3
|
+
ExtendedBlockActions: ({ id, className, style, onClick, children }: {
|
|
4
|
+
id?: string | undefined;
|
|
4
5
|
className?: string | undefined;
|
|
5
6
|
style?: import("react").CSSProperties | undefined;
|
|
6
7
|
onClick?: (() => void) | undefined;
|
|
7
8
|
children: import("react").ReactNode;
|
|
8
|
-
}) => JSX.Element;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
BlockOptions: ({ isOpen, onClose, refs, style, children }: {
|
|
10
11
|
isOpen: boolean;
|
|
11
12
|
onClose: () => void;
|
|
12
13
|
refs: any;
|
|
13
14
|
style: import("react").CSSProperties;
|
|
14
15
|
children?: import("react").ReactNode;
|
|
15
|
-
}) => JSX.Element | null;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
17
|
BlockOptionsMenuContent: ({ children }: {
|
|
17
18
|
children: any;
|
|
18
|
-
}) => JSX.Element;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
BlockOptionsMenuGroup: ({ children }: {
|
|
20
21
|
children: any;
|
|
21
|
-
}) => JSX.Element;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
BlockOptionsMenuItem: ({ children }: {
|
|
23
24
|
children: any;
|
|
24
|
-
}) => JSX.Element;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
BlockOptionsSeparator: ({ className }: {
|
|
26
27
|
className?: string | undefined;
|
|
27
|
-
}) => JSX.Element;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
29
|
};
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/UI/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/UI/index.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/UI/index.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC"}
|
package/dist/YooptaEditor.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { YooEditor,
|
|
3
|
-
import { Tools } from './contexts/
|
|
2
|
+
import { YooEditor, YooptaContentValue } from './editor/types';
|
|
3
|
+
import { Tools } from './contexts/YooptaContext/ToolsContext';
|
|
4
4
|
import { YooptaPlugin } from './plugins';
|
|
5
5
|
import { YooptaMark } from './marks';
|
|
6
6
|
type Props = {
|
|
7
7
|
editor: YooEditor;
|
|
8
8
|
plugins: YooptaPlugin[];
|
|
9
9
|
marks?: YooptaMark<any>[];
|
|
10
|
-
value?:
|
|
10
|
+
value?: YooptaContentValue;
|
|
11
11
|
autoFocus?: boolean;
|
|
12
12
|
className?: string;
|
|
13
|
-
selectionBoxRoot?: HTMLElement |
|
|
13
|
+
selectionBoxRoot?: HTMLElement | React.MutableRefObject<HTMLElement | null> | false;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
tools?: Tools
|
|
15
|
+
tools?: Partial<Tools>;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
width?: number | string;
|
|
16
19
|
};
|
|
17
|
-
declare const YooptaEditor: ({ editor, value, marks, plugins: pluginsProps, autoFocus, className, tools, selectionBoxRoot, children, }: Props) => JSX.Element;
|
|
20
|
+
declare const YooptaEditor: ({ editor, value, marks: marksProps, plugins: pluginsProps, autoFocus, className, tools, selectionBoxRoot, children, placeholder, readOnly, width, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
18
21
|
export { YooptaEditor };
|
|
19
22
|
//# sourceMappingURL=YooptaEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YooptaEditor.d.ts","sourceRoot":"","sources":["../src/YooptaEditor.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAmB,
|
|
1
|
+
{"version":3,"file":"YooptaEditor.d.ts","sourceRoot":"","sources":["../src/YooptaEditor.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAmB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGhF,OAAO,EAAE,KAAK,EAAiB,MAAM,uCAAuC,CAAC;AAQ7E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC;IACpF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAgCF,QAAA,MAAM,YAAY,wJAaf,KAAK,4CAoFP,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../src/components/Block/Block.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../src/components/Block/Block.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,KAAK;;;;6CA8DV,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { YooEditor, YooptaBlockData } from '../../editor/types';
|
|
3
2
|
type ActionsProps = {
|
|
4
3
|
block: YooptaBlockData;
|
|
@@ -7,6 +6,6 @@ type ActionsProps = {
|
|
|
7
6
|
showActions: boolean;
|
|
8
7
|
onChangeActiveBlock: (id: string) => void;
|
|
9
8
|
};
|
|
10
|
-
declare const BlockActions: ({ block, editor, dragHandleProps, showActions, onChangeActiveBlock }: ActionsProps) => JSX.Element;
|
|
9
|
+
declare const BlockActions: ({ block, editor, dragHandleProps, showActions, onChangeActiveBlock }: ActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export { BlockActions };
|
|
12
11
|
//# sourceMappingURL=BlockActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/BlockActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/BlockActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAajF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAMF,QAAA,MAAM,YAAY,yEAA0E,YAAY,4CAuFvG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { YooptaMark } from '../../marks';
|
|
3
3
|
type Props = {
|
|
4
4
|
marks?: YooptaMark<any>[];
|
|
5
|
-
selectionBoxRoot?: HTMLElement |
|
|
5
|
+
selectionBoxRoot?: HTMLElement | React.MutableRefObject<HTMLElement | null> | false;
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
className?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
width?: number | string;
|
|
8
10
|
};
|
|
9
|
-
declare const Editor: ({ marks, className,
|
|
11
|
+
declare const Editor: ({ placeholder, marks, className, selectionBoxRoot, width, autoFocus }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export { Editor };
|
|
11
13
|
//# sourceMappingURL=Editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAYzC,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAmBF,QAAA,MAAM,MAAM,0EAAkF,KAAK,4CAoTlG,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { YooEditor } from '../../editor/types';
|
|
3
2
|
import { YooptaMark } from '../../marks';
|
|
4
3
|
type Props = {
|
|
5
4
|
editor: YooEditor;
|
|
6
5
|
marks?: YooptaMark<any>[];
|
|
6
|
+
placeholder?: string;
|
|
7
7
|
};
|
|
8
|
-
declare const RenderBlocks: ({ editor, marks }: Props) => JSX.Element;
|
|
8
|
+
declare const RenderBlocks: ({ editor, marks, placeholder }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export { RenderBlocks };
|
|
10
10
|
//# sourceMappingURL=RenderBlocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderBlocks.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/RenderBlocks.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RenderBlocks.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/RenderBlocks.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,YAAY,mCAAoC,KAAK,4CA4D1D,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnE,eAAO,MAAM,iBAAiB,aAAc,QAAQ,YAAY,CAAC,KAAG,YAQlE,CAAC;AAEH,eAAO,MAAM,cAAc,WAAY,QAAQ,eAAe,CAAC,KAAG,eAShE,CAAC;AAEH,eAAO,MAAM,wBAAwB;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnE,eAAO,MAAM,iBAAiB,aAAc,QAAQ,YAAY,CAAC,KAAG,YAQlE,CAAC;AAEH,eAAO,MAAM,cAAc,WAAY,QAAQ,eAAe,CAAC,KAAG,eAShE,CAAC;AAEH,eAAO,MAAM,wBAAwB;;CAMpC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { YooEditor } from '../../editor/types';
|
|
|
3
3
|
export type RectangeSelectionProps = {
|
|
4
4
|
editor: YooEditor;
|
|
5
5
|
yooptaEditorRef: React.RefObject<HTMLDivElement>;
|
|
6
|
-
root?: HTMLElement |
|
|
6
|
+
root?: HTMLElement | React.MutableRefObject<HTMLElement | null> | false;
|
|
7
7
|
};
|
|
8
8
|
export type RectangeSelectionState = {
|
|
9
9
|
origin: [number, number];
|
|
@@ -15,6 +15,6 @@ export type SelectionBoxProps = {
|
|
|
15
15
|
coords: RectangeSelectionState['coords'];
|
|
16
16
|
isOpen: boolean;
|
|
17
17
|
};
|
|
18
|
-
declare const SelectionBox: ({ origin, coords, isOpen }: SelectionBoxProps) => JSX.Element | null;
|
|
18
|
+
declare const SelectionBox: ({ origin, coords, isOpen }: SelectionBoxProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
19
|
export { SelectionBox };
|
|
20
20
|
//# sourceMappingURL=SelectionBox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionBox.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionBox/SelectionBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"SelectionBox.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionBox/SelectionBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC;CACzE,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,YAAY,+BAAgC,iBAAiB,mDAyBlE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionBox/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BhF,KAAK,uBAAuB,GAAG,sBAAsB,GAAG;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAGF,eAAO,MAAM,uBAAuB,uCAIjC,sBAAsB,KAAG,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionBox/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BhF,KAAK,uBAAuB,GAAG,sBAAsB,GAAG;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAGF,eAAO,MAAM,uBAAuB,uCAIjC,sBAAsB,KAAG,uBA0G3B,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ExtendedLeafProps } from '../../plugins/types';
|
|
3
2
|
type Props = Pick<ExtendedLeafProps<any, any>, 'attributes' | 'children'> & {
|
|
4
3
|
placeholder?: string;
|
|
5
4
|
};
|
|
6
|
-
declare const TextLeaf: ({ children, attributes, placeholder }: Props) => JSX.Element;
|
|
5
|
+
declare const TextLeaf: ({ children, attributes, placeholder }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export { TextLeaf };
|
|
8
7
|
//# sourceMappingURL=TextLeaf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextLeaf.d.ts","sourceRoot":"","sources":["../../../src/components/TextLeaf/TextLeaf.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextLeaf.d.ts","sourceRoot":"","sources":["../../../src/components/TextLeaf/TextLeaf.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,GAAG;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,QAAQ,0CAA2C,KAAK,4CAa7D,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -17,7 +17,7 @@ type Props = {
|
|
|
17
17
|
tools?: Partial<Tools>;
|
|
18
18
|
children: React.ReactNode;
|
|
19
19
|
};
|
|
20
|
-
export declare const ToolsProvider: ({ children, tools }: Props) => JSX.Element;
|
|
20
|
+
export declare const ToolsProvider: ({ children, tools }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export declare const useYooptaTools: () => ToolsContextType;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=ToolsContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolsContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/ToolsContext.tsx"],"names":[],"mappings":";AAGA,MAAM,MAAM,SAAS,CAAC,WAAW,GAAG,GAAG,EAAE,SAAS,GAAG,GAAG,IAAI;IAC1D,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACzC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;CACpC,CAAC;AAIF,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,aAAa,wBAAyB,KAAK,4CAkCvD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,gBAOjC,CAAC"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Editor } from 'slate';
|
|
3
2
|
import { YooEditor, YooptaBlockPath } from '../../editor/types';
|
|
4
3
|
import { PluginOptions } from '../../plugins/types';
|
|
5
|
-
export type UltraYooptaContextPluginsEditorMap = Record<string, Editor>;
|
|
6
4
|
export type YooptaEditorContext = {
|
|
7
5
|
editor: YooEditor;
|
|
8
6
|
};
|
|
9
|
-
export declare const
|
|
7
|
+
export declare const YooptaContext: import("react").Context<YooptaEditorContext>;
|
|
10
8
|
/**
|
|
11
9
|
*
|
|
12
10
|
*/
|
|
13
|
-
declare const
|
|
11
|
+
declare const YooptaContextProvider: ({ children, editorState }: {
|
|
14
12
|
children: any;
|
|
15
13
|
editorState: any;
|
|
16
|
-
}) => JSX.Element;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
15
|
declare const useYooptaEditor: () => YooEditor;
|
|
18
16
|
declare const useBlockData: (blockId: string) => import("../../editor/types").YooptaBlockData<import("slate").Descendant>;
|
|
19
17
|
declare const useYooptaBlock: (blockType: string) => import("../../editor/types").YooptaBlock;
|
|
20
|
-
declare const useYooptaPlugin: (type: string) => import("../../plugins/types").
|
|
21
|
-
declare const
|
|
18
|
+
declare const useYooptaPlugin: (type: string) => import("../../plugins/types").Plugin<string, unknown, Record<string, unknown>>;
|
|
19
|
+
declare const useYooptaReadOnly: () => boolean;
|
|
20
|
+
declare const useYooptaPluginOptions: <TOptions>(blockType: string) => PluginOptions<TOptions>;
|
|
22
21
|
type UseBlockSelectedProps = {
|
|
23
22
|
blockId: string;
|
|
24
23
|
path?: YooptaBlockPath;
|
|
@@ -27,5 +26,5 @@ type UseBlockSelectedProps = {
|
|
|
27
26
|
blockId?: string;
|
|
28
27
|
};
|
|
29
28
|
declare const useBlockSelected: ({ blockId, path }: UseBlockSelectedProps) => boolean;
|
|
30
|
-
export { useYooptaEditor, useBlockData, useYooptaPlugin, useYooptaPluginOptions, useYooptaBlock, useBlockSelected,
|
|
31
|
-
//# sourceMappingURL=
|
|
29
|
+
export { useYooptaEditor, useBlockData, useYooptaPlugin, useYooptaPluginOptions, useYooptaBlock, useBlockSelected, useYooptaReadOnly, YooptaContextProvider, };
|
|
30
|
+
//# sourceMappingURL=YooptaContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YooptaContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/YooptaContext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAqCF,eAAO,MAAM,aAAa,8CAAuD,CAAC;AAElF;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;6CAQ1B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,SAQ3B,CAAC;AAEF,QAAA,MAAM,YAAY,YAAa,MAAM,6EAAwC,CAAC;AAC9E,QAAA,MAAM,cAAc,cAAe,MAAM,6CAAwC,CAAC;AAClF,QAAA,MAAM,eAAe,SAAU,MAAM,mFAAoC,CAAC;AAC1E,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,wBAA0B,MAAM,4BACI,CAAC;AAEjE,KAAK,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvH,QAAA,MAAM,gBAAgB,sBAAuB,qBAAqB,YAkBjE,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA2BpC,eAAO,MAAM,kBAAkB,QAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA2BpC,eAAO,MAAM,kBAAkB,QAAO,SAoCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
|
|
@@ -3,5 +3,5 @@ export type BlockSelectedOptions = {
|
|
|
3
3
|
only?: boolean;
|
|
4
4
|
allSelected?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function setBlockSelected(editor: YooEditor,
|
|
6
|
+
export declare function setBlockSelected(editor: YooEditor, paths: number[] | null, options?: BlockSelectedOptions): void;
|
|
7
7
|
//# sourceMappingURL=setBlockSelected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setBlockSelected.d.ts","sourceRoot":"","sources":["../../../src/editor/selection/setBlockSelected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,UAAU,CAAC;AAMtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"setBlockSelected.d.ts","sourceRoot":"","sources":["../../../src/editor/selection/setBlockSelected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,UAAU,CAAC;AAMtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,GAAE,oBAAyB,QAoB7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/editor/textFormats/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/editor/textFormats/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAcrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/editor/textFormats/update.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/editor/textFormats/update.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAU9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/createBlock.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"createBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/createBlock.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,QAoDxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decreaseBlockDepth.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/decreaseBlockDepth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,
|
|
1
|
+
{"version":3,"file":"decreaseBlockDepth.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/decreaseBlockDepth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,QAc/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/deleteBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deleteBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/deleteBlock.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,kBAAuB,QA0E9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/duplicateBlock.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEpF,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,GAAG;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,
|
|
1
|
+
{"version":3,"file":"duplicateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/duplicateBlock.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEpF,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,GAAG;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,QA0DpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/focusBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEzF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG;IACxF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAkBF,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,
|
|
1
|
+
{"version":3,"file":"focusBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/focusBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEzF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG;IACxF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAkBF,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,QA8B7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/getBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"increaseBlockDepth.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/increaseBlockDepth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,
|
|
1
|
+
{"version":3,"file":"increaseBlockDepth.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/increaseBlockDepth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEnE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,QAc/F"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { YooEditor, YooptaEditorTransformOptions, YooptaBlockData } from '../types';
|
|
2
|
-
export declare function insertBlock(editor: YooEditor,
|
|
2
|
+
export declare function insertBlock(editor: YooEditor, blockData: YooptaBlockData, options?: YooptaEditorTransformOptions): void;
|
|
3
3
|
//# sourceMappingURL=insertBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/insertBlock.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"insertBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/insertBlock.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGpF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,GAAE,4BAAiC,QAyDpH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertBlocks.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/insertBlocks.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,eAAe,EAAmB,MAAM,UAAU,CAAC;AAErG,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,OAAO,GAAE,4BAAiC,QAsEpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/splitBlock.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAGpF,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,
|
|
1
|
+
{"version":3,"file":"splitBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/splitBlock.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAGpF,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,4BAAiC,QA0DvF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { YooEditor, YooptaEditorTransformOptions } from '../types';
|
|
2
|
-
export type ToggleBlockOptions = YooptaEditorTransformOptions
|
|
3
|
-
|
|
2
|
+
export type ToggleBlockOptions = YooptaEditorTransformOptions & {
|
|
3
|
+
deleteText?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function toggleBlock(editor: YooEditor, toBlockTypeArg: string, options?: ToggleBlockOptions): void;
|
|
4
6
|
//# sourceMappingURL=toggleBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/toggleBlock.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAmB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/toggleBlock.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAmB,4BAA4B,EAAmB,MAAM,UAAU,CAAC;AAErG,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;CAEtB,CAAC;AAKF,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,QAsDlG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/updateBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,WAAW,CAAC,YAAY,SAAS,MAAM,EAAE,MAAM,EAC7D,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/updateBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,WAAW,CAAC,YAAY,SAAS,MAAM,EAAE,MAAM,EAC7D,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,QAqC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBlockElement.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/updateBlockElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,YAAY,SAAS,MAAM,EAAE,aAAa,EAC3E,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"updateBlockElement.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/updateBlockElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,YAAY,SAAS,MAAM,EAAE,aAAa,EAC3E,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,aAAa,QAoC5B"}
|
package/dist/editor/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Descendant, Editor, Path, Point } from 'slate';
|
|
2
|
-
import {
|
|
2
|
+
import { Plugin, PluginElementsMap, PluginOptions, PluginElementProps } from '../plugins/types';
|
|
3
3
|
import { EditorBlurOptions } from './selection/blur';
|
|
4
4
|
import { BlockSelectedOptions } from './selection/setBlockSelected';
|
|
5
5
|
import { SetSelectionOptions } from './selection/setSelection';
|
|
@@ -9,20 +9,18 @@ import { DuplicateBlockOptions } from './transforms/duplicateBlock';
|
|
|
9
9
|
import { FocusBlockOptions } from './transforms/focusBlock';
|
|
10
10
|
import { ToggleBlockOptions } from './transforms/toggleBlock';
|
|
11
11
|
export type YooptaBlockPath = [number];
|
|
12
|
-
export type YooptaBlockDataKey = string;
|
|
13
|
-
export type YooptaChildrenValue = Record<YooptaBlockDataKey, YooptaBlockData>;
|
|
14
12
|
export type YooptaBlockData<T = Descendant | SlateElement> = {
|
|
15
13
|
id: string;
|
|
16
14
|
value: T[];
|
|
17
15
|
type: string;
|
|
18
16
|
meta: YooptaBlockBaseMeta;
|
|
19
17
|
};
|
|
20
|
-
export type
|
|
21
|
-
export type YooptaBlockType = 'block' | 'inline' | 'void';
|
|
18
|
+
export type YooptaContentValue = Record<string, YooptaBlockData>;
|
|
22
19
|
export type YooptaBlockBaseMeta = {
|
|
23
20
|
order: number;
|
|
24
21
|
depth: number;
|
|
25
22
|
};
|
|
23
|
+
export type SlateEditor = Editor;
|
|
26
24
|
export type FocusAt = Path | Point;
|
|
27
25
|
export type YooptaEditorTransformOptions = {
|
|
28
26
|
at?: YooptaBlockPath | null;
|
|
@@ -44,23 +42,26 @@ export type YooptaBlock = {
|
|
|
44
42
|
type: string;
|
|
45
43
|
options?: PluginOptions<any>;
|
|
46
44
|
elements: PluginElementsMap<string>;
|
|
45
|
+
hasCustomEditor?: boolean;
|
|
47
46
|
isActive: () => boolean;
|
|
48
47
|
create: (options?: CreateBlockOptions) => void;
|
|
49
|
-
toggle: (
|
|
48
|
+
toggle: (options?: ToggleBlockOptions) => void;
|
|
50
49
|
update: (id: string, data: Partial<YooptaBlockData>) => void;
|
|
51
50
|
updateElement: <TElementKeys extends string, TElementProps>(blockId: string, elementType: TElementKeys, elementProps: TElementProps) => void;
|
|
52
51
|
delete: (options: DeleteBlockOptions) => void;
|
|
53
52
|
};
|
|
54
53
|
export type YooptaBlocks = Record<string, YooptaBlock>;
|
|
55
54
|
export type YooptaFormats = Record<string, TextFormat>;
|
|
56
|
-
export type
|
|
55
|
+
export type YooEditorEvents = 'change' | 'block:copy';
|
|
56
|
+
export type YooEditor<TNodes = any> = {
|
|
57
57
|
insertBlock: (data: YooptaBlockData, options?: YooptaEditorTransformOptions) => void;
|
|
58
|
+
insertBlocks: (blocks: YooptaBlockData[], options?: YooptaEditorTransformOptions) => void;
|
|
58
59
|
splitBlock: (options?: YooptaEditorTransformOptions) => void;
|
|
59
60
|
updateBlock: (id: string, data: Partial<YooptaBlockData>) => void;
|
|
60
61
|
deleteBlock: (options?: DeleteBlockOptions) => void;
|
|
61
62
|
duplicateBlock: (options?: DuplicateBlockOptions) => void;
|
|
62
63
|
getBlock: (options?: YooptaEditorTransformOptions) => void;
|
|
63
|
-
toggleBlock: (toBlockType
|
|
64
|
+
toggleBlock: (toBlockType?: string, options?: ToggleBlockOptions) => void;
|
|
64
65
|
increaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
|
|
65
66
|
decreaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
|
|
66
67
|
applyChanges: () => void;
|
|
@@ -77,11 +78,12 @@ export type YooEditor<TNodes = any, TKey extends string = any> = {
|
|
|
77
78
|
blocks: YooptaBlocks;
|
|
78
79
|
formats: YooptaFormats;
|
|
79
80
|
shortcuts: Record<string, YooptaBlock>;
|
|
80
|
-
plugins: Record<string,
|
|
81
|
-
on: (event:
|
|
82
|
-
once: (event:
|
|
83
|
-
off: (event:
|
|
84
|
-
emit: (event:
|
|
81
|
+
plugins: Record<string, Plugin<string, unknown>>;
|
|
82
|
+
on: (event: YooEditorEvents, fn: (payload: any) => void) => void;
|
|
83
|
+
once: (event: YooEditorEvents, fn: (payload: any) => void) => void;
|
|
84
|
+
off: (event: YooEditorEvents, fn: (payload: any) => void) => void;
|
|
85
|
+
emit: (event: YooEditorEvents, payload: any) => void;
|
|
86
|
+
readOnly: boolean;
|
|
85
87
|
};
|
|
86
88
|
export type SlateElement<K extends string = string, T = any> = {
|
|
87
89
|
id: string;
|