@yoopta/editor 6.0.0-beta.2 → 6.0.0-beta.21
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/README.md +109 -173
- package/dist/components/Editor/render-blocks.d.ts +4 -2
- package/dist/components/Editor/render-blocks.d.ts.map +1 -1
- package/dist/components/Editor/render-editor.d.ts +3 -5
- package/dist/components/Editor/render-editor.d.ts.map +1 -1
- package/dist/components/Editor/selection.d.ts.map +1 -1
- package/dist/editor/blocks/focusBlock.d.ts.map +1 -1
- package/dist/editor/blocks/toggleBlock.d.ts.map +1 -1
- package/dist/editor/core/applyTransforms.d.ts.map +1 -1
- package/dist/editor/core/history.d.ts +2 -2
- package/dist/editor/core/history.d.ts.map +1 -1
- package/dist/editor/elements/create-element-structure.d.ts.map +1 -1
- package/dist/editor/elements/getElementRect.d.ts +28 -0
- package/dist/editor/elements/getElementRect.d.ts.map +1 -0
- package/dist/editor/elements/index.d.ts +4 -2
- package/dist/editor/elements/index.d.ts.map +1 -1
- package/dist/editor/index.d.ts +11 -2
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/paths/isBlockSelected.d.ts.map +1 -1
- package/dist/editor/selection/index.d.ts +4 -1
- package/dist/editor/selection/index.d.ts.map +1 -1
- package/dist/editor/selection/toDOMRange.d.ts +33 -0
- package/dist/editor/selection/toDOMRange.d.ts.map +1 -0
- package/dist/editor/types.d.ts +18 -5
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/parsers/deserializeHTML.d.ts +9 -1
- package/dist/parsers/deserializeHTML.d.ts.map +1 -1
- package/dist/parsers/deserializeHTML.test.d.ts +2 -0
- package/dist/parsers/deserializeHTML.test.d.ts.map +1 -0
- package/dist/parsers/deserializeYooptaJSON.d.ts +16 -0
- package/dist/parsers/deserializeYooptaJSON.d.ts.map +1 -0
- package/dist/parsers/getHTML.d.ts.map +1 -1
- package/dist/parsers/getYooptaJSON.d.ts +20 -0
- package/dist/parsers/getYooptaJSON.d.ts.map +1 -0
- package/dist/plugins/hooks.d.ts.map +1 -1
- package/dist/plugins/slate-editor-component.d.ts.map +1 -1
- package/dist/utils/block-elements.d.ts.map +1 -1
- package/dist/utils/editor-builders.d.ts +0 -1
- package/dist/utils/editor-builders.d.ts.map +1 -1
- package/dist/utils/enter-action.d.ts.map +1 -1
- package/dist/utils/execute-backspace-action.d.ts.map +1 -1
- package/dist/utils/weakMaps.d.ts +2 -1
- package/dist/utils/weakMaps.d.ts.map +1 -1
- package/dist/yoopta-editor.d.ts +10 -12
- package/dist/yoopta-editor.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/SelectionBox/SelectionBox.d.ts +0 -19
- package/dist/components/SelectionBox/SelectionBox.d.ts.map +0 -1
- package/dist/components/SelectionBox/hooks.d.ts +0 -7
- package/dist/components/SelectionBox/hooks.d.ts.map +0 -1
package/dist/editor/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Descendant, Path, Point, Selection } from 'slate';
|
|
1
|
+
import type { Descendant, NodeEntry, Path, Point, Range as SlateRange, Selection } from 'slate';
|
|
2
2
|
import type { ReactEditor } from 'slate-react';
|
|
3
|
+
import type { YooptaMark } from '../marks';
|
|
3
4
|
import type { decreaseBlockDepth } from './blocks/decreaseBlockDepth';
|
|
4
5
|
import type { deleteBlock } from './blocks/deleteBlock';
|
|
5
6
|
import type { duplicateBlock } from './blocks/duplicateBlock';
|
|
@@ -13,6 +14,7 @@ import type { EditorBlurOptions } from './core/blur';
|
|
|
13
14
|
import type { HistoryStack, HistoryStackName, YooptaHistory } from './core/history';
|
|
14
15
|
import type { getEmail } from '../parsers/getEmail';
|
|
15
16
|
import type { getHTML } from '../parsers/getHTML';
|
|
17
|
+
import type { getYooptaJSON } from '../parsers/getYooptaJSON';
|
|
16
18
|
import type { WithoutFirstArg } from '../utils/types';
|
|
17
19
|
import type { moveBlock } from './blocks/moveBlock';
|
|
18
20
|
import type { SplitBlockOptions } from './blocks/splitBlock';
|
|
@@ -28,6 +30,7 @@ import type { getElement } from './elements/getElement';
|
|
|
28
30
|
import type { getElementChildren } from './elements/getElementChildren';
|
|
29
31
|
import type { getElementEntry } from './elements/getElementEntry';
|
|
30
32
|
import type { getElementPath } from './elements/getElementPath';
|
|
33
|
+
import type { getElementRect } from './elements/getElementRect';
|
|
31
34
|
import type { getElements } from './elements/getElements';
|
|
32
35
|
import type { getParentElementPath } from './elements/getParentElementPath';
|
|
33
36
|
import type { insertElement } from './elements/insertElement';
|
|
@@ -71,7 +74,7 @@ export type YooptaBlock = {
|
|
|
71
74
|
};
|
|
72
75
|
export type YooptaBlocks = Record<string, YooptaBlock>;
|
|
73
76
|
export type YooptaFormats = Record<string, TextFormat>;
|
|
74
|
-
export type YooptaEditorEventKeys = 'change' | 'focus' | 'blur' | 'block:copy' | 'path-change';
|
|
77
|
+
export type YooptaEditorEventKeys = 'change' | 'focus' | 'blur' | 'block:copy' | 'path-change' | 'decorations:change';
|
|
75
78
|
export type YooptaEventChangePayload = {
|
|
76
79
|
operations: YooptaOperation[];
|
|
77
80
|
value: YooptaContentValue;
|
|
@@ -82,9 +85,12 @@ export type YooptaEventsMap = {
|
|
|
82
85
|
blur: boolean;
|
|
83
86
|
'block:copy': YooptaBlockData;
|
|
84
87
|
'path-change': YooptaPath;
|
|
88
|
+
'decorations:change': undefined;
|
|
85
89
|
};
|
|
90
|
+
export type DecoratorFn = (blockId: string, entry: NodeEntry) => SlateRange[];
|
|
91
|
+
export type LeafDecoratorRenderFn = (leaf: Record<string, unknown>, children: unknown) => unknown;
|
|
86
92
|
export type BaseCommands = Record<string, (...args: any[]) => any>;
|
|
87
|
-
export type
|
|
93
|
+
export type YooEditor = {
|
|
88
94
|
id: string;
|
|
89
95
|
readOnly: boolean;
|
|
90
96
|
isEmpty: () => boolean;
|
|
@@ -107,6 +113,7 @@ export type BaseYooEditor = {
|
|
|
107
113
|
getElements: WithoutFirstArg<typeof getElements>;
|
|
108
114
|
getElementEntry: WithoutFirstArg<typeof getElementEntry>;
|
|
109
115
|
getElementPath: WithoutFirstArg<typeof getElementPath>;
|
|
116
|
+
getElementRect: WithoutFirstArg<typeof getElementRect>;
|
|
110
117
|
getParentElementPath: WithoutFirstArg<typeof getParentElementPath>;
|
|
111
118
|
getElementChildren: WithoutFirstArg<typeof getElementChildren>;
|
|
112
119
|
isElementEmpty: WithoutFirstArg<typeof isElementEmpty>;
|
|
@@ -120,9 +127,13 @@ export type BaseYooEditor = {
|
|
|
120
127
|
getEditorValue: () => YooptaContentValue;
|
|
121
128
|
setEditorValue: WithoutFirstArg<typeof setEditorValue>;
|
|
122
129
|
blockEditorsMap: YooptaPluginsEditorMap;
|
|
130
|
+
/** Optional factory override for building Slate editors — used by collaboration to inject withYjs */
|
|
131
|
+
buildSlateEditorFn?: (blockId: string) => SlateEditor;
|
|
132
|
+
/** Returns true if the given Slate editor is currently applying a remote collaborative change */
|
|
133
|
+
isRemoteSlateOp?: (slate: SlateEditor) => boolean;
|
|
123
134
|
formats: YooptaFormats;
|
|
135
|
+
marks: YooptaMark<any>[];
|
|
124
136
|
plugins: Record<string, Plugin<Record<string, SlateElement>, unknown>>;
|
|
125
|
-
commands: Record<string, (...args: any[]) => any>;
|
|
126
137
|
applyTransforms: WithoutFirstArg<typeof applyTransforms>;
|
|
127
138
|
batchOperations: (fn: () => void) => void;
|
|
128
139
|
on: <K extends keyof YooptaEventsMap>(event: K, fn: (payload: YooptaEventsMap[K]) => void) => void;
|
|
@@ -136,6 +147,7 @@ export type BaseYooEditor = {
|
|
|
136
147
|
getMarkdown: WithoutFirstArg<typeof getMarkdown>;
|
|
137
148
|
getPlainText: WithoutFirstArg<typeof getPlainText>;
|
|
138
149
|
getEmail: WithoutFirstArg<typeof getEmail>;
|
|
150
|
+
getYooptaJSON: WithoutFirstArg<typeof getYooptaJSON>;
|
|
139
151
|
historyStack: Record<HistoryStackName, HistoryStack[]>;
|
|
140
152
|
isSavingHistory: WithoutFirstArg<typeof YooptaHistory.isSavingHistory>;
|
|
141
153
|
isMergingHistory: WithoutFirstArg<typeof YooptaHistory.isMergingHistory>;
|
|
@@ -146,6 +158,8 @@ export type BaseYooEditor = {
|
|
|
146
158
|
redo: WithoutFirstArg<typeof YooptaHistory.redo>;
|
|
147
159
|
undo: WithoutFirstArg<typeof YooptaHistory.undo>;
|
|
148
160
|
refElement: HTMLElement | null;
|
|
161
|
+
decorators: Map<string, DecoratorFn>;
|
|
162
|
+
leafDecorators: Map<string, LeafDecoratorRenderFn>;
|
|
149
163
|
};
|
|
150
164
|
export type SlateElementTextNode = {
|
|
151
165
|
text: string;
|
|
@@ -162,5 +176,4 @@ export type SlateElement<K extends string = string, T = any> = {
|
|
|
162
176
|
children: Descendant[];
|
|
163
177
|
props?: PluginElementProps<T>;
|
|
164
178
|
};
|
|
165
|
-
export type YooEditor = BaseYooEditor;
|
|
166
179
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,s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AC,MAAM,EAAE,WAAW,CAAC,CAAC;IACrC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AAGF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,GAAG,IAAI;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { YooptaEditor, type YooptaEditorProps, type YooptaOnChangeOptions } from './yoopta-editor';
|
|
1
|
+
import { type RenderBlockProps, YooptaEditor, type YooptaEditorProps, type YooptaOnChangeOptions } from './yoopta-editor';
|
|
2
2
|
export { YooptaPlugin } from './plugins';
|
|
3
3
|
export { useBlockData, useYooptaEditor, useYooptaFocused, useBlockSelected, useYooptaReadOnly, useYooptaPluginOptions, } from './contexts/YooptaContext/YooptaContext';
|
|
4
4
|
export { deserializeHTML } from './parsers/deserializeHTML';
|
|
@@ -9,9 +9,9 @@ export { getRootBlockElementType, getRootBlockElement, getAllowedPluginsFromElem
|
|
|
9
9
|
export { findSlateBySelectionPath } from './utils/findSlateBySelectionPath';
|
|
10
10
|
export { deserializeTextNodes } from './parsers/deserializeTextNodes';
|
|
11
11
|
export { serializeTextNodes, serializeTextNodesIntoMarkdown } from './parsers/serializeTextNodes';
|
|
12
|
-
export { createYooptaEditor } from './editor';
|
|
12
|
+
export { createYooptaEditor, CreateYooptaEditorOptions } from './editor';
|
|
13
13
|
export { createYooptaMark, YooptaMarkParams, YooptaMark } from './marks';
|
|
14
|
-
export { YooEditor,
|
|
14
|
+
export { YooEditor, SlateElement, YooptaBlockData, YooptaBlock, YooptaContentValue, SlateEditor, YooptaPath, YooptaPathIndex, YooptaEventChangePayload, YooptaEventsMap, YooptaEditorEventKeys, DecoratorFn, LeafDecoratorRenderFn, } from './editor/types';
|
|
15
15
|
export { buildBlockData, buildBlockElement } from './components/Editor/utils';
|
|
16
16
|
export { buildBlockElementsStructure } from './utils/block-elements';
|
|
17
17
|
export { buildSlateEditor } from './utils/build-slate';
|
|
@@ -23,9 +23,9 @@ export { Blocks } from './editor/blocks';
|
|
|
23
23
|
export { Marks } from './editor/textFormats';
|
|
24
24
|
export { Selection } from './editor/selection';
|
|
25
25
|
export { Paths } from './editor/paths';
|
|
26
|
-
export { InsertBlockOperation, DeleteBlockOperation, NormalizePathsBlockOperation, SetSelectionBlockOperation, SplitBlockOperation, SetBlockValueOperation, SetBlockMetaOperation, MergeBlockOperation, MoveBlockOperation, SetSlateOperation, SetEditorValueOperation, YooptaOperation, } from './editor/core/applyTransforms';
|
|
26
|
+
export { InsertBlockOperation, DeleteBlockOperation, NormalizePathsBlockOperation, SetSelectionBlockOperation, SplitBlockOperation, SetBlockValueOperation, SetBlockMetaOperation, MergeBlockOperation, ToogleBlockOperation, MoveBlockOperation, SetSlateOperation, SetEditorValueOperation, YooptaOperation, } from './editor/core/applyTransforms';
|
|
27
27
|
export default YooptaEditor;
|
|
28
|
-
export { YooptaEditorProps, YooptaOnChangeOptions };
|
|
28
|
+
export { RenderBlockProps, YooptaEditorProps, YooptaOnChangeOptions };
|
|
29
29
|
export declare function useElementSelected(): {
|
|
30
30
|
isElementSelected: boolean;
|
|
31
31
|
isElementFocused: boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAElG,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,W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