@yoopta/editor 4.3.1 → 4.4.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/README.md CHANGED
@@ -1,99 +1,283 @@
1
- <h2 align="center">Yoopta-Editor v1 🎉</h2>
2
- <p align="center">Yoopta-Editor - is an open source notion-like editor 💥</p>
3
- <div align="center">
4
- <img width="574" alt="Screen Shot 2023-01-25 at 16 04 29" src="https://user-images.githubusercontent.com/29093118/215324525-882bf403-646c-4267-bb5f-c0f37509ac09.png">
5
- </div>
1
+ # Core package
6
2
 
7
- <div align="center">
3
+ This is core package for Yoopta-Editor
8
4
 
9
- </div>
5
+ ### Installation
10
6
 
11
- <p align="center">
12
- <a target="_blank" rel="noopener noreferrer" href="https://yopage.co/blog/0zntIA46L4/W0epdDpnRa">Full docs</a> |
13
- <a target="_blank" rel="noopener noreferrer" href="https://yopage.co/blog/0zntIA46L4/qOQqVaxxRZ">Get started</a> |
14
- <a target="_blank" rel="noopener noreferrer" href="https://yopage.co/blog/0zntIA46L4/kUoZ2DoHnG">API</a> |
15
- <a target="_blank" rel="noopener noreferrer" href="https://yopage.co/blog/0zntIA46L4/qo9nK4lDG5">FAQs</a> |
16
- <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/basic">Examples</a>
17
- </p>
7
+ ```bash
8
+ yarn add @yoopta/editor
9
+ ```
18
10
 
19
- ### Features
11
+ ### Usage
20
12
 
21
- - Triggering by "/" to show list of elements and search needed element by typing
22
- - Drag and drop beetween elements
23
- - Redo/Undo your changes (Ctrl-Z/Ctrl-V)
24
- - Offline ready mode
25
- - Shortcuts
26
- - A cool representation of the data in JSON format, so you can easily save the content data to the database and validate
27
- You can import two plugins from library: `<YooptaEditor />` and `<YooptaRender />`. <br>
28
- `<YooptaEditor />` - it's for building beautiful content <br>
29
- `<YooptaRender />` - it's just for rendering from your saved data, without any editor tools and libraries, so it make you page loading faster
30
- - Custom styling
31
- ...and other
13
+ ```tsx
14
+ import YooptaEditor, { createYooptaEditor, YooEditor } from '@yoopta/editor';
15
+ // plugins
16
+ import Paragraph from '@yoopta/paragraph';
32
17
 
33
- ### Install
18
+ const plugins = [Paragraph];
34
19
 
35
- yarn add yoopta-editor
36
- or
37
- npm install yoopta-editor
20
+ const Editor = () => {
21
+ // create instance
22
+ const editor: YooEditor = useMemo(() => createYooptaEditor(), []);
38
23
 
39
- ### Peer dependencies
24
+ return <YooptaEditor editor={editor} plugins={plugins} />;
25
+ };
26
+ ```
40
27
 
41
- yarn add react react-dom slate slate-react
42
- or
43
- npm install react react-dom slate slate-react
28
+ ### YooptaEditor component props
44
29
 
45
- ### Quickstart
30
+ ```ts
31
+ type Props = {
32
+ /**
33
+ * Instance of editor
34
+ */
35
+ editor: YooEditor;
36
+ /**
37
+ * Optional custom id. Useful for multiple instances
38
+ */
39
+ id?: string;
40
+ /**
41
+ * List of plugins
42
+ */
43
+ plugins: YooptaPlugin[];
44
+ /**
45
+ * List of marks from @yoopta/marks
46
+ */
47
+ marks?: YooptaMark<any>[];
48
+ /**
49
+ * Optional value of editor. DEFAULT - [undefined]
50
+ */
51
+ value?: YooptaContentValue;
52
+ /**
53
+ * Autofocus when editor is ready. DEFAULT - [true]
54
+ */
55
+ autoFocus?: boolean;
56
+ /**
57
+ * Additional className for your needs. DEFAULT - [.yoopta-editor]
58
+ */
59
+ className?: string;
60
+ /**
61
+ * Box for selection area to select by mouse several blocks. DEFAULT - [document]
62
+ */
63
+ selectionBoxRoot?: HTMLElement | React.MutableRefObject<HTMLElement | null> | false;
64
+ children?: React.ReactNode;
65
+ tools?: Partial<Tools>;
66
+ placeholder?: string;
67
+ readOnly?: boolean;
68
+ width?: number | string;
69
+ };
70
+ ```
46
71
 
47
- ```jsx
48
- import { YooptaEditor } from '@yoopta/editor';
49
- import { useState } from 'react';
72
+ ### API from editor instance
50
73
 
51
- import 'yoopta-editor/dist/index.css';
74
+ ```tsx
75
+ type YooEditor<TNodes> = {
76
+ /**
77
+ * Unique identifier for the editor instance.
78
+ */
79
+ id: string;
52
80
 
53
- function App() {
54
- const [editorValue, setEditorValue] = useState([]);
81
+ /**
82
+ * Inserts a single block of data into the editor.
83
+ */
84
+ insertBlock: (data: YooptaBlockData, options?: YooptaEditorTransformOptions) => void;
55
85
 
56
- const onChange = (data) => setEditorValue(data);
86
+ /**
87
+ * Inserts multiple blocks of data into the editor at once.
88
+ */
89
+ insertBlocks: (blocks: YooptaBlockData[], options?: YooptaEditorTransformOptions) => void;
57
90
 
58
- return (
59
- <div>
60
- <YooptaEditor value={editorValue} onChange={onChange} />
61
- </div>
62
- );
63
- }
64
- ```
91
+ /**
92
+ * Splits the current block at the cursor's position.
93
+ */
94
+ splitBlock: (options?: YooptaEditorTransformOptions) => void;
95
+
96
+ /**
97
+ * Updates a block with new data based on its id.
98
+ */
99
+ updateBlock: (id: string, data: Partial<YooptaBlockData>) => void;
100
+
101
+ /**
102
+ * Deletes a block from the editor.
103
+ */
104
+ deleteBlock: (options?: DeleteBlockOptions) => void;
105
+
106
+ /**
107
+ * Duplicates a block within the editor.
108
+ */
109
+ duplicateBlock: (options?: DuplicateBlockOptions) => void;
110
+
111
+ /**
112
+ * Retrieves a block's data based on provided options.
113
+ */
114
+ getBlock: (options?: YooptaEditorTransformOptions) => void;
115
+
116
+ /**
117
+ * Toggles a block's type in the editor.
118
+ */
119
+ toggleBlock: (toBlockType?: string, options?: ToggleBlockOptions) => void;
120
+
121
+ /**
122
+ * Increases the depth of a block, typically used for nested structures like lists.
123
+ */
124
+ increaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
125
+
126
+ /**
127
+ * Decreases the depth of a block.
128
+ */
129
+ decreaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
130
+
131
+ /**
132
+ * Applies any staged changes to the editor.
133
+ */
134
+ applyChanges: () => void;
135
+
136
+ /**
137
+ * Moves a block to a different position within the editor.
138
+ */
139
+ moveBlock: (blockId: string, to: YooptaBlockPath) => void;
140
+
141
+ /**
142
+ * Focuses on a block based on its id.
143
+ */
144
+ focusBlock: (id: string, options?: FocusBlockOptions) => void;
145
+
146
+ /**
147
+ * Current selection path in the editor.
148
+ */
149
+ selection: YooptaBlockPath | null;
150
+
151
+ /**
152
+ * Array of currently selected block indices.
153
+ */
154
+ selectedBlocks: number[] | null;
155
+
156
+ /**
157
+ * Holds the structured data representing the editor's content.
158
+ */
159
+ children: Record<string, YooptaBlockData>;
65
160
 
66
- ### Check out other DEMO's 👇
161
+ /**
162
+ * Retrieves the entire editor's value.
163
+ */
164
+ getEditorValue: () => TNodes;
67
165
 
68
- - <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/basic">Basic usage</a>
69
- - <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/offline">Offline mode</a>
70
- - <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/media">Working with media</a>
71
- - <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/render">Just rendering</a>
72
- - <a target="_blank" rel="noopener noreferrer" href="https://yoopta-editor.vercel.app/styling">Custom styling</a>
73
- <br>
74
- <br>
166
+ /**
167
+ * Sets the editor's content.
168
+ */
169
+ setEditorValue: (value: YooptaContentValue) => void;
75
170
 
76
- <div style="padding: 10px">❗ Yoopta-Editor is on <span style="color: #007aff">BETA</span> version now. The core functionality works, but you may encounter some bugs.
77
- I have big plans for the v2 version with a lot of cool features and improvements.
78
- Let's build together the best open source editor ever ☝ <br>
79
- Read more about future plans <a target="_blank" rel="noopener noreferrer" href="https://yopage.co/blog/0zntIA46L4/5iK8VNiBI8">"What's next Lebovski?"</a>
80
- </div>
81
- <br>
82
- <div style="padding: 10px; marging: 10px">
83
- 📝 This WYSIWYG editor build on top of <a target="_blank" rel="noopener noreferrer" href="https://github.com/ianstormtaylor/slate">Slate JS framework</a> <br>
84
- 💙 SlateJS - is the best tool for building rich-text editors. It has beautiful design and great API
85
- </div>
171
+ /**
172
+ * Sets the selection path in the editor.
173
+ */
174
+ setSelection: (path: YooptaBlockPath | null, options?: SetSelectionOptions) => void;
86
175
 
87
- ## Donation.
176
+ /**
177
+ * Sets or clears the selection for a block.
178
+ */
179
+ setBlockSelected: (path: number[] | null, options?: BlockSelectedOptions) => void;
88
180
 
89
- ### If you like this open source project you can support me using <a href="https://buy.stripe.com/9AQcQo6G57dyexGeUU">Stripe link</a> 💙
181
+ /**
182
+ * Map of individual block editors.
183
+ */
184
+ blockEditorsMap: YooptaPluginsEditorMap;
90
185
 
91
- ### Used by
186
+ /**
187
+ * Definitions of all blocks in the editor.
188
+ */
189
+ blocks: YooptaBlocks;
92
190
 
93
- - <a href="https://tapflow.co/">Tapflow - The perfect tool for building and selling online courses</a>
94
- - <a href="https://equalize.team">Equalize.team</a>
95
- - <a href="https://yopage.co/">Yopage.co - blogging platform</a>
191
+ /**
192
+ * Formatting options available in the editor.
193
+ */
194
+ formats: YooptaFormats;
96
195
 
97
- ### License
196
+ /**
197
+ * Keyboard shortcuts configured for the editor.
198
+ */
199
+ shortcuts: Record<string, YooptaBlock>;
98
200
 
99
- MIT LICENSE
201
+ /**
202
+ * Registered plugins.
203
+ */
204
+ plugins: Record<string, Plugin<string, unknown>>;
205
+
206
+ /**
207
+ * Subscribes to an event.
208
+ */
209
+ on: (event: YooEditorEvents, fn: (payload: any) => void) => void;
210
+
211
+ /**
212
+ * Subscribes once to an event.
213
+ */
214
+ once: (event: YooEditorEvents, fn: (payload: any) => void) => void;
215
+
216
+ /**
217
+ * Unsubscribes from an event.
218
+ */
219
+ off: (event: YooEditorEvents, fn: (payload: any) => void) => void;
220
+
221
+ /**
222
+ * Emits an event.
223
+ */
224
+ emit: (event: YooEditorEvents, payload: any) => void;
225
+
226
+ /**
227
+ * Indicates if the editor is read-only.
228
+ */
229
+ readOnly: boolean;
230
+
231
+ /**
232
+ * Returns whether the editor is focused.
233
+ */
234
+ isFocused: () => boolean;
235
+
236
+ /**
237
+ * Blurs the editor, removing focus.
238
+ */
239
+ blur: (options?: EditorBlurOptions) => void;
240
+
241
+ /**
242
+ * Focuses the editor.
243
+ */
244
+ focus: () => void;
245
+ };
246
+ ```
247
+
248
+ ### Hooks from @yoopta/editor
249
+
250
+ ```ts
251
+ /**
252
+ * Hook to access the Yoopta editor instance. Must be used in children components of <YooptaEditor />.
253
+ * @returns {YooEditor} The editor instance.
254
+ */
255
+ useYooptaEditor();
256
+
257
+ /**
258
+ * Hook to check if the editor is in read-only mode.
259
+ * @returns {boolean} True if the editor is read-only.
260
+ */
261
+ useYooptaReadOnly();
262
+
263
+ /**
264
+ * Hook to check if the editor is focused.
265
+ * @returns {boolean} True if the editor is focused.
266
+ */
267
+ useYooptaFocused();
268
+
269
+ /**
270
+ * Hook to get the data for a specific block by its ID.
271
+ * @param {string} blockId The ID of the block.
272
+ * @returns {YooptaBlockData | undefined} The data of the block, or undefined if not found.
273
+ */
274
+ useBlockData(blockId);
275
+
276
+ /**
277
+ * Hook to get the options for a plugin.
278
+ * @template TOptions The type of options expected.
279
+ * @param {string} blockType The block type associated with the plugin.
280
+ * @returns {PluginOptions<TOptions>} The options of the plugin.
281
+ */
282
+ useYooptaPluginOptions<TOptions>(blockType);
283
+ ```
@@ -4,6 +4,7 @@ import { Tools } from './contexts/YooptaContext/ToolsContext';
4
4
  import { YooptaPlugin } from './plugins';
5
5
  import { YooptaMark } from './marks';
6
6
  type Props = {
7
+ id?: string;
7
8
  editor: YooEditor;
8
9
  plugins: YooptaPlugin[];
9
10
  marks?: YooptaMark<any>[];
@@ -17,6 +18,6 @@ type Props = {
17
18
  readOnly?: boolean;
18
19
  width?: number | string;
19
20
  };
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;
21
+ declare const YooptaEditor: ({ id, editor, value, marks: marksProps, plugins: pluginsProps, autoFocus, className, tools, selectionBoxRoot, children, placeholder, readOnly, width, }: Props) => import("react/jsx-runtime").JSX.Element;
21
22
  export { YooptaEditor };
22
23
  //# 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,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;AAIrC,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,4CAqFP,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"YooptaEditor.d.ts","sourceRoot":"","sources":["../src/YooptaEditor.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAmB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;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S,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
+ {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,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 +1 @@
1
- {"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;2BAarB,YAAY;6BASV,cAAc;CAK3D,CAAC"}
1
+ {"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;2BAYrB,YAAY;6BASV,cAAc;CAK3D,CAAC"}
@@ -14,8 +14,7 @@ declare const YooptaContextProvider: ({ children, editorState }: {
14
14
  }) => import("react/jsx-runtime").JSX.Element;
15
15
  declare const useYooptaEditor: () => YooEditor;
16
16
  declare const useBlockData: (blockId: string) => import("../../editor/types").YooptaBlockData<import("slate").Descendant>;
17
- declare const useYooptaBlock: (blockType: string) => import("../../editor/types").YooptaBlock;
18
- declare const useYooptaPlugin: (type: string) => import("../../plugins/types").Plugin<string, unknown, Record<string, unknown>>;
17
+ declare const useYooptaFocused: () => boolean;
19
18
  declare const useYooptaReadOnly: () => boolean;
20
19
  declare const useYooptaPluginOptions: <TOptions>(blockType: string) => PluginOptions<TOptions>;
21
20
  type UseBlockSelectedProps = {
@@ -26,5 +25,5 @@ type UseBlockSelectedProps = {
26
25
  blockId?: string;
27
26
  };
28
27
  declare const useBlockSelected: ({ blockId, path }: UseBlockSelectedProps) => boolean;
29
- export { useYooptaEditor, useBlockData, useYooptaPlugin, useYooptaPluginOptions, useYooptaBlock, useBlockSelected, useYooptaReadOnly, YooptaContextProvider, };
28
+ export { useYooptaEditor, useBlockData, useYooptaPluginOptions, useBlockSelected, useYooptaReadOnly, useYooptaFocused, YooptaContextProvider, };
30
29
  //# sourceMappingURL=YooptaContext.d.ts.map
@@ -1 +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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AAC9E,QAAA,MAAM,gBAAgB,eAAsC,CAAC;AAC7D,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,wBAA0B,MAAM,4BACc,CAAC;AAE3E,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,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/editor/core/blur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,SAAS,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC,GAAG;IAC5E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAWF,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,iBAAsB,QAiBtE"}
@@ -0,0 +1,3 @@
1
+ import { YooEditor } from '../types';
2
+ export declare function focus(editor: YooEditor): void;
3
+ //# sourceMappingURL=focus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/editor/core/focus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,QAUtC"}
@@ -0,0 +1,3 @@
1
+ import { YooEditor } from '../types';
2
+ export declare function isFocused(editor: YooEditor): boolean;
3
+ //# sourceMappingURL=isFocused.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFocused.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isFocused.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAE1C"}
@@ -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;AA4BpC,eAAO,MAAM,kBAAkB,QAAO,SAsCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA8BpC,eAAO,MAAM,kBAAkB,QAAO,SAyCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
@@ -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,QA8B7F"}
1
+ {"version":3,"file":"focusBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/transforms/focusBlock.ts"],"names":[],"mappings":"AAGA,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,QAgC7F"}
@@ -1,6 +1,6 @@
1
1
  import { Descendant, Editor, Path, Point } from 'slate';
2
2
  import { Plugin, PluginElementsMap, PluginOptions, PluginElementProps } from '../plugins/types';
3
- import { EditorBlurOptions } from './selection/blur';
3
+ import { EditorBlurOptions } from './core/blur';
4
4
  import { BlockSelectedOptions } from './selection/setBlockSelected';
5
5
  import { SetSelectionOptions } from './selection/setSelection';
6
6
  import { CreateBlockOptions } from './transforms/createBlock';
@@ -52,7 +52,7 @@ export type YooptaBlock = {
52
52
  };
53
53
  export type YooptaBlocks = Record<string, YooptaBlock>;
54
54
  export type YooptaFormats = Record<string, TextFormat>;
55
- export type YooEditorEvents = 'change' | 'block:copy';
55
+ export type YooEditorEvents = 'change' | 'focus' | 'blur' | 'block:copy';
56
56
  export type YooEditor<TNodes = any> = {
57
57
  id: string;
58
58
  insertBlock: (data: YooptaBlockData, options?: YooptaEditorTransformOptions) => void;
@@ -62,7 +62,7 @@ export type YooEditor<TNodes = any> = {
62
62
  deleteBlock: (options?: DeleteBlockOptions) => void;
63
63
  duplicateBlock: (options?: DuplicateBlockOptions) => void;
64
64
  getBlock: (options?: YooptaEditorTransformOptions) => void;
65
- toggleBlock: (toBlockType?: string, options?: ToggleBlockOptions) => void;
65
+ toggleBlock: (toBlockType: string, options?: ToggleBlockOptions) => void;
66
66
  increaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
67
67
  decreaseBlockDepth: (options?: YooptaEditorTransformOptions) => void;
68
68
  applyChanges: () => void;
@@ -75,7 +75,6 @@ export type YooEditor<TNodes = any> = {
75
75
  setEditorValue: (value: YooptaContentValue) => void;
76
76
  setSelection: (path: YooptaBlockPath | null, options?: SetSelectionOptions) => void;
77
77
  setBlockSelected: (path: number[] | null, options?: BlockSelectedOptions) => void;
78
- blur: (options?: EditorBlurOptions) => void;
79
78
  blockEditorsMap: YooptaPluginsEditorMap;
80
79
  blocks: YooptaBlocks;
81
80
  formats: YooptaFormats;
@@ -86,6 +85,9 @@ export type YooEditor<TNodes = any> = {
86
85
  off: (event: YooEditorEvents, fn: (payload: any) => void) => void;
87
86
  emit: (event: YooEditorEvents, payload: any) => void;
88
87
  readOnly: boolean;
88
+ isFocused: () => boolean;
89
+ blur: (options?: EditorBlurOptions) => void;
90
+ focus: () => void;
89
91
  };
90
92
  export type SlateElement<K extends string = string, T = any> = {
91
93
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO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AAC;IACzB,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,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,GAAG,YAAY,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { YooptaPlugin } from './plugins';
2
- export { useBlockData, useYooptaBlock, useYooptaEditor, useYooptaPlugin, useBlockSelected, useYooptaReadOnly, useYooptaPluginOptions, } from './contexts/YooptaContext/YooptaContext';
2
+ export { useBlockData, useYooptaEditor, useYooptaFocused, useBlockSelected, useYooptaReadOnly, useYooptaPluginOptions, } from './contexts/YooptaContext/YooptaContext';
3
3
  import { YooptaEditor } from './YooptaEditor';
4
4
  export { UI } from './UI';
5
5
  export { useYooptaTools, Tools } from './contexts/YooptaContext/ToolsContext';
@@ -13,7 +13,7 @@ export { createYooptaEditor } from './editor';
13
13
  export { createYooptaMark, YooptaMarkParams, YooptaMark } from './marks';
14
14
  export { YooEditor, SlateElement, YooptaBlockData, YooptaBlock, YooptaContentValue } from './editor/types';
15
15
  export { buildBlockData, buildBlockElement } from './components/Editor/utils';
16
- export default YooptaEditor;
17
16
  export { PluginElementRenderProps, PluginEventHandlerOptions, PluginCustomEditorRenderProps, YooptaMarkProps, } from './plugins/types';
18
17
  import './styles.css';
18
+ export default YooptaEditor;
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA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