@yoopta/editor 2.0.1 → 4.0.0-rc.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.
Files changed (163) hide show
  1. package/dist/UI/BlockOptions/BlockOptions.d.ts +23 -0
  2. package/dist/UI/BlockOptions/BlockOptions.d.ts.map +1 -0
  3. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +10 -0
  4. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +1 -0
  5. package/dist/UI/index.d.ts +29 -0
  6. package/dist/UI/index.d.ts.map +1 -0
  7. package/dist/YooptaEditor.d.ts +18 -3
  8. package/dist/YooptaEditor.d.ts.map +1 -0
  9. package/dist/components/Block/Block.d.ts +8 -0
  10. package/dist/components/Block/Block.d.ts.map +1 -0
  11. package/dist/components/Block/BlockActions.d.ts +12 -0
  12. package/dist/components/Block/BlockActions.d.ts.map +1 -0
  13. package/dist/components/Editor/Editor.d.ts +8 -12
  14. package/dist/components/Editor/Editor.d.ts.map +1 -0
  15. package/dist/components/Editor/RenderBlocks.d.ts +10 -0
  16. package/dist/components/Editor/RenderBlocks.d.ts.map +1 -0
  17. package/dist/components/Editor/defaultValue.d.ts +7 -0
  18. package/dist/components/Editor/defaultValue.d.ts.map +1 -0
  19. package/dist/components/Editor/dnd.d.ts +10 -0
  20. package/dist/components/Editor/dnd.d.ts.map +1 -0
  21. package/dist/components/Editor/utils.d.ts +2 -6
  22. package/dist/components/Editor/utils.d.ts.map +1 -0
  23. package/dist/components/NoSsr/NoSsr.d.ts +1 -0
  24. package/dist/components/NoSsr/NoSsr.d.ts.map +1 -0
  25. package/dist/components/SelectionBox/SelectionBox.d.ts +20 -0
  26. package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -0
  27. package/dist/components/SelectionBox/hooks.d.ts +7 -0
  28. package/dist/components/SelectionBox/hooks.d.ts.map +1 -0
  29. package/dist/components/TextLeaf/TextLeaf.d.ts +8 -0
  30. package/dist/components/TextLeaf/TextLeaf.d.ts.map +1 -0
  31. package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts +25 -0
  32. package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts.map +1 -0
  33. package/dist/contexts/UltraYooptaContext/UltraYooptaContext.d.ts +31 -0
  34. package/dist/contexts/UltraYooptaContext/UltraYooptaContext.d.ts.map +1 -0
  35. package/dist/editor/core/getEditorValue.d.ts +3 -0
  36. package/dist/editor/core/getEditorValue.d.ts.map +1 -0
  37. package/dist/editor/index.d.ts +4 -0
  38. package/dist/editor/index.d.ts.map +1 -0
  39. package/dist/editor/selection/blur.d.ts +7 -0
  40. package/dist/editor/selection/blur.d.ts.map +1 -0
  41. package/dist/editor/selection/setBlockSelected.d.ts +7 -0
  42. package/dist/editor/selection/setBlockSelected.d.ts.map +1 -0
  43. package/dist/editor/selection/setSelection.d.ts +3 -0
  44. package/dist/editor/selection/setSelection.d.ts.map +1 -0
  45. package/dist/editor/textFormats/getValue.d.ts +3 -0
  46. package/dist/editor/textFormats/getValue.d.ts.map +1 -0
  47. package/dist/editor/textFormats/isActive.d.ts +3 -0
  48. package/dist/editor/textFormats/isActive.d.ts.map +1 -0
  49. package/dist/editor/textFormats/toggle.d.ts +3 -0
  50. package/dist/editor/textFormats/toggle.d.ts.map +1 -0
  51. package/dist/editor/textFormats/update.d.ts +3 -0
  52. package/dist/editor/textFormats/update.d.ts.map +1 -0
  53. package/dist/editor/transforms/createBlock.d.ts +6 -0
  54. package/dist/editor/transforms/createBlock.d.ts.map +1 -0
  55. package/dist/editor/transforms/decreaseBlockDepth.d.ts +3 -0
  56. package/dist/editor/transforms/decreaseBlockDepth.d.ts.map +1 -0
  57. package/dist/editor/transforms/deleteBlock.d.ts +7 -0
  58. package/dist/editor/transforms/deleteBlock.d.ts.map +1 -0
  59. package/dist/editor/transforms/duplicateBlock.d.ts +6 -0
  60. package/dist/editor/transforms/duplicateBlock.d.ts.map +1 -0
  61. package/dist/editor/transforms/focusBlock.d.ts +7 -0
  62. package/dist/editor/transforms/focusBlock.d.ts.map +1 -0
  63. package/dist/editor/transforms/getBlockElement.d.ts +2 -0
  64. package/dist/editor/transforms/getBlockElement.d.ts.map +1 -0
  65. package/dist/editor/transforms/increaseBlockDepth.d.ts +3 -0
  66. package/dist/editor/transforms/increaseBlockDepth.d.ts.map +1 -0
  67. package/dist/editor/transforms/insertBlock.d.ts +3 -0
  68. package/dist/editor/transforms/insertBlock.d.ts.map +1 -0
  69. package/dist/editor/transforms/moveBlock.d.ts +3 -0
  70. package/dist/editor/transforms/moveBlock.d.ts.map +1 -0
  71. package/dist/editor/transforms/splitBlock.d.ts +3 -0
  72. package/dist/editor/transforms/splitBlock.d.ts.map +1 -0
  73. package/dist/editor/transforms/toggleBlock.d.ts +4 -0
  74. package/dist/editor/transforms/toggleBlock.d.ts.map +1 -0
  75. package/dist/editor/transforms/updateBlock.d.ts +3 -0
  76. package/dist/editor/transforms/updateBlock.d.ts.map +1 -0
  77. package/dist/editor/transforms/updateBlockElement.d.ts +3 -0
  78. package/dist/editor/transforms/updateBlockElement.d.ts.map +1 -0
  79. package/dist/editor/types.d.ts +92 -0
  80. package/dist/editor/types.d.ts.map +1 -0
  81. package/dist/extensions/shortcuts.d.ts +4 -0
  82. package/dist/extensions/shortcuts.d.ts.map +1 -0
  83. package/dist/handlers/index.d.ts +5 -0
  84. package/dist/handlers/index.d.ts.map +1 -0
  85. package/dist/handlers/onKeyDown.d.ts +4 -0
  86. package/dist/handlers/onKeyDown.d.ts.map +1 -0
  87. package/dist/hooks/useForceRender.d.ts +2 -0
  88. package/dist/hooks/useForceRender.d.ts.map +1 -0
  89. package/dist/index.d.ts +12 -38
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +5 -6
  92. package/dist/marks/index.d.ts +13 -0
  93. package/dist/marks/index.d.ts.map +1 -0
  94. package/dist/plugins/SlateEditorComponent.d.ts +12 -0
  95. package/dist/plugins/SlateEditorComponent.d.ts.map +1 -0
  96. package/dist/plugins/createYooptaPlugin.d.ts +9 -0
  97. package/dist/plugins/createYooptaPlugin.d.ts.map +1 -0
  98. package/dist/plugins/extenstions/withInlines.d.ts +2 -0
  99. package/dist/plugins/extenstions/withInlines.d.ts.map +1 -0
  100. package/dist/plugins/index.d.ts +2 -0
  101. package/dist/plugins/index.d.ts.map +1 -0
  102. package/dist/plugins/types.d.ts +71 -0
  103. package/dist/plugins/types.d.ts.map +1 -0
  104. package/dist/tools/ActionMenuList/ActionMenuComponent.d.ts +14 -0
  105. package/dist/tools/ActionMenuList/ActionMenuComponent.d.ts.map +1 -0
  106. package/dist/tools/ActionMenuList/ActionMenuList.d.ts +10 -0
  107. package/dist/tools/ActionMenuList/ActionMenuList.d.ts.map +1 -0
  108. package/dist/tools/ActionMenuList/events.d.ts +12 -0
  109. package/dist/tools/ActionMenuList/events.d.ts.map +1 -0
  110. package/dist/tools/Toolbar/HighlightColor.d.ts +14 -0
  111. package/dist/tools/Toolbar/HighlightColor.d.ts.map +1 -0
  112. package/dist/tools/Toolbar/Toolbar.d.ts +4 -0
  113. package/dist/tools/Toolbar/Toolbar.d.ts.map +1 -0
  114. package/dist/tools/Toolbar/ToolbarComponent.d.ts +9 -0
  115. package/dist/tools/Toolbar/ToolbarComponent.d.ts.map +1 -0
  116. package/dist/types/eventHandlers.d.ts +1 -0
  117. package/dist/types/eventHandlers.d.ts.map +1 -0
  118. package/dist/utils/blockElements.d.ts +13 -0
  119. package/dist/utils/blockElements.d.ts.map +1 -0
  120. package/dist/utils/deepClone.d.ts +1 -0
  121. package/dist/utils/deepClone.d.ts.map +1 -0
  122. package/dist/utils/editorBuilders.d.ts +11 -0
  123. package/dist/utils/editorBuilders.d.ts.map +1 -0
  124. package/dist/utils/findPluginBlockBySelectionPath.d.ts +3 -0
  125. package/dist/utils/findPluginBlockBySelectionPath.d.ts.map +1 -0
  126. package/dist/utils/findPluginBlockByType.d.ts +7 -0
  127. package/dist/utils/findPluginBlockByType.d.ts.map +1 -0
  128. package/dist/utils/findSlateBySelectionPath.d.ts +3 -0
  129. package/dist/utils/findSlateBySelectionPath.d.ts.map +1 -0
  130. package/dist/utils/generateId.d.ts +1 -0
  131. package/dist/utils/generateId.d.ts.map +1 -0
  132. package/dist/utils/getMaxOffsetInElement.d.ts +2 -0
  133. package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -0
  134. package/dist/utils/hotkeys.d.ts +4 -0
  135. package/dist/utils/hotkeys.d.ts.map +1 -0
  136. package/dist/utils/serializeHTML.d.ts +1 -0
  137. package/dist/utils/serializeHTML.d.ts.map +1 -0
  138. package/package.json +18 -18
  139. package/dist/components/Editor/TextLeaf/TextLeaf.d.ts +0 -9
  140. package/dist/components/Editor/plugins/deleteFragment.d.ts +0 -2
  141. package/dist/components/Editor/plugins/nonEmptyEditor.d.ts +0 -2
  142. package/dist/components/Editor/plugins/pasteHtml.d.ts +0 -3
  143. package/dist/components/Editor/plugins/shortcuts.d.ts +0 -2
  144. package/dist/components/Editor/plugins/voids.d.ts +0 -2
  145. package/dist/components/ElementOptions/ElementOptions.d.ts +0 -18
  146. package/dist/components/ElementOptions/Overlay.d.ts +0 -7
  147. package/dist/components/ElementWrapper/ElementActions.d.ts +0 -12
  148. package/dist/components/ElementWrapper/ElementWrapper.d.ts +0 -14
  149. package/dist/components/YooptaEditor/YooptaEditor.d.ts +0 -21
  150. package/dist/contexts/NodeSettingsContext/NodeSettingsContext.d.ts +0 -29
  151. package/dist/contexts/YooptaContext/YooptaContext.d.ts +0 -54
  152. package/dist/hooks/useDragDrop.d.ts +0 -25
  153. package/dist/hooks/useHover.d.ts +0 -2
  154. package/dist/hooks/useIntersetionObserver.d.ts +0 -12
  155. package/dist/hooks/useScrollToElement.d.ts +0 -1
  156. package/dist/types.d.ts +0 -53
  157. package/dist/utils/deserializeHTML.d.ts +0 -4
  158. package/dist/utils/getElementClassname.d.ts +0 -8
  159. package/dist/utils/marks.d.ts +0 -14
  160. package/dist/utils/nodes.d.ts +0 -5
  161. package/dist/utils/plugins.d.ts +0 -102
  162. package/dist/utils/storage.d.ts +0 -4
  163. package/dist/utils/validate.d.ts +0 -1
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export type YooptaMark<TProps> = {
3
+ type: string;
4
+ hotkey?: string;
5
+ render: (props: TProps) => JSX.Element;
6
+ };
7
+ export type YooptaMarkParams<TProps> = {
8
+ type: string;
9
+ hotkey?: string;
10
+ render: (props: TProps) => JSX.Element;
11
+ };
12
+ export declare function createYooptaMark<TProps>({ type, hotkey, render }: YooptaMarkParams<TProps>): YooptaMark<TProps>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/marks/index.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,MAAM,IAAI;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC;CACxC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAM/G"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { YooptaMark } from '../marks';
3
+ import { PluginParams } from './types';
4
+ type Props<TKeys extends string, TProps, TOptions> = PluginParams<TKeys, TProps, TOptions> & {
5
+ id: string;
6
+ marks?: YooptaMark<any>[];
7
+ options: PluginParams<TKeys, TProps, TOptions>['options'];
8
+ placeholder?: string;
9
+ };
10
+ declare const SlateEditorComponent: <TKeys extends string, TProps, TOptions>({ id, customEditor, elements, marks, events, options, placeholder, }: Props<TKeys, TProps, TOptions>) => JSX.Element;
11
+ export { SlateEditorComponent };
12
+ //# sourceMappingURL=SlateEditorComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlateEditorComponent.d.ts","sourceRoot":"","sources":["../../src/plugins/SlateEditorComponent.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAIL,YAAY,EAEb,MAAM,SAAS,CAAC;AAWjB,KAAK,KAAK,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG;IAC3F,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAgBF,QAAA,MAAM,oBAAoB,+JA0LzB,CAAC;AA6GF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Descendant } from 'slate';
2
+ import { PluginOptions, PluginParams } from './types';
3
+ export declare class YooptaPlugin<TKeys extends string = string, TProps = Descendant, TOptions = Record<string, unknown>> {
4
+ private readonly plugin;
5
+ constructor(plugin: PluginParams<TKeys, TProps, TOptions>);
6
+ get getPlugin(): PluginParams<TKeys, TProps, TOptions>;
7
+ extend(options: Partial<PluginOptions<TOptions>>): YooptaPlugin<TKeys, TProps, TOptions>;
8
+ }
9
+ //# sourceMappingURL=createYooptaPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createYooptaPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/createYooptaPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,SAAS,CAAC;AAEpE,qBAAa,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9G,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAEnD,MAAM,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;IAIzD,IAAI,SAAS,0CAEZ;IAED,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;CAUzF"}
@@ -0,0 +1,2 @@
1
+ export declare const withInlines: (editor: any) => any;
2
+ //# sourceMappingURL=withInlines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withInlines.d.ts","sourceRoot":"","sources":["../../../src/plugins/extenstions/withInlines.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,WAAW,sBA0BvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { YooptaPlugin } from './createYooptaPlugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,71 @@
1
+ /// <reference types="react" />
2
+ import { Descendant, Editor } from 'slate';
3
+ import { RenderElementProps as RenderSlateElementProps, RenderLeafProps } from 'slate-react';
4
+ import { YooEditor, YooptaBlockData } from '../editor/types';
5
+ import { YooptaMark } from '../marks';
6
+ import { EditorEventHandlers } from '../types/eventHandlers';
7
+ import { HOTKEYS_TYPE } from '../utils/hotkeys';
8
+ export type RenderPluginProps<TKeys extends string, TProps, TOptions> = {
9
+ id: string;
10
+ elements: PluginReturn<TKeys, TProps, TOptions>['elements'];
11
+ marks?: YooptaMark<unknown>[];
12
+ };
13
+ export type PluginOptions<T> = {
14
+ displayLabel?: string;
15
+ shortcuts?: string[];
16
+ align?: 'left' | 'center' | 'right';
17
+ } & T;
18
+ export type PluginElementOptions = {
19
+ draggable?: boolean;
20
+ };
21
+ export type PluginElementRenderProps<TPluginOptions = unknown> = RenderSlateElementProps & {
22
+ blockId: string;
23
+ options?: TPluginOptions;
24
+ };
25
+ export type PluginDefaultProps = {
26
+ nodeType?: 'block' | 'inline' | 'void' | 'inlineVoid';
27
+ };
28
+ export type PluginElementProps<T> = PluginDefaultProps & T;
29
+ export type PluginElement<T, TPluginOptions = Record<string, unknown>> = {
30
+ render: (props: PluginElementRenderProps<TPluginOptions>) => JSX.Element;
31
+ props?: PluginElementProps<T>;
32
+ options?: PluginElementOptions;
33
+ asRoot?: boolean;
34
+ children?: string[];
35
+ };
36
+ export type PluginElementsMap<TKeys extends string = string, TProps = PluginDefaultProps> = {
37
+ [key in TKeys]: PluginElement<TProps>;
38
+ };
39
+ export type EventHandlers = {
40
+ [key in keyof EditorEventHandlers]: (editor: YooEditor, slate: Editor, options: PluginEventHandlerOptions) => EditorEventHandlers[key] | void;
41
+ };
42
+ export type PluginEventHandlerOptions = {
43
+ hotkeys: HOTKEYS_TYPE;
44
+ defaultBlock: YooptaBlockData;
45
+ currentBlock: YooptaBlockData;
46
+ };
47
+ export type PluginParams<TKeys extends string = string, TProps = Descendant, TOptions = Record<string, unknown>> = {
48
+ type: string;
49
+ customEditor?: (props: PluginElementRenderProps) => JSX.Element;
50
+ elements: PluginElementsMap<TKeys, TProps>;
51
+ events?: EventHandlers;
52
+ options?: PluginOptions<TOptions>;
53
+ };
54
+ export type PluginReturn<TKeys extends string, TProps, TOptions = Record<string, unknown>> = {
55
+ type: string;
56
+ elements: PluginParams<TKeys, TProps>['elements'];
57
+ options?: PluginOptions<TOptions>;
58
+ events?: EventHandlers;
59
+ };
60
+ export type LeafFormats<K extends string, V> = {
61
+ [key in K]: V;
62
+ };
63
+ export type ExtendedLeaf<K extends string, V> = RenderLeafProps['leaf'] & LeafFormats<K, V>;
64
+ export type YooptaMarkProps<K extends string, V> = {
65
+ children: RenderLeafProps['children'];
66
+ leaf: ExtendedLeaf<K, V>;
67
+ };
68
+ export type ExtendedLeafProps<K extends string, V> = RenderLeafProps & {
69
+ leaf: ExtendedLeaf<K, V>;
70
+ };
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,IAAI;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5D,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,M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AAE,CAAC,IAAI;IAAE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAAE,CAAC;AAEvH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,eAAe,GAAG;IACrE,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { YooEditor } from '../../editor/types';
3
+ type Props = {
4
+ actions: string[];
5
+ editor: YooEditor;
6
+ onMouseEnter?: (e: React.MouseEvent) => void;
7
+ selectedAction: string;
8
+ onClose: () => void;
9
+ empty: boolean;
10
+ mode?: 'toggle' | 'create';
11
+ };
12
+ declare const ActionMenuComponent: ({ actions: actionsProps, editor, onMouseEnter, selectedAction, onClose, empty, mode, }: Props) => JSX.Element;
13
+ export { ActionMenuComponent };
14
+ //# sourceMappingURL=ActionMenuComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionMenuComponent.d.ts","sourceRoot":"","sources":["../../../src/tools/ActionMenuList/ActionMenuComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAG5D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B,CAAC;AAUF,QAAA,MAAM,mBAAmB,2FAQtB,KAAK,gBAuDP,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { YooptaBlock } from '../../editor/types';
3
+ type Props = {
4
+ trigger?: string;
5
+ actions?: YooptaBlock[];
6
+ render?: (props: any) => JSX.Element;
7
+ };
8
+ declare const ActionMenuList: ({ trigger, render }: Props) => JSX.Element | null;
9
+ export { ActionMenuList };
10
+ //# sourceMappingURL=ActionMenuList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionMenuList.d.ts","sourceRoot":"","sources":["../../../src/tools/ActionMenuList/ActionMenuList.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiBjD,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IAQjB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,cAAc,wBAA+B,KAAK,uBA+GvD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Editor } from 'slate';
2
+ import { YooEditor } from '../../editor/types';
3
+ export declare const events: {
4
+ onKeyDown: (editor: YooEditor, slate: Editor, options: any) => (event: React.KeyboardEvent) => any;
5
+ onKeyUp: (editor: YooEditor, slate: Editor, { open, close, change, state }: {
6
+ open: any;
7
+ close: any;
8
+ change: any;
9
+ state: any;
10
+ }) => (event: React.KeyboardEvent) => any;
11
+ };
12
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/tools/ActionMenuList/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA2F/C,eAAO,MAAM,MAAM;wBAxFsB,SAAS,SAAS,MAAM,2BAAsB,mBAAmB;sBA6E/F,SAAS,SAAS,MAAM;;;;;kBACzB,mBAAmB;CAa5B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { CSSProperties } from 'react';
2
+ import { YooEditor } from '../../editor/types';
3
+ type Props = {
4
+ editor: YooEditor;
5
+ highlightColors: CSSProperties;
6
+ onClose: () => void;
7
+ refs: {
8
+ setFloating: (el: HTMLElement) => void;
9
+ };
10
+ floatingStyles: React.CSSProperties;
11
+ };
12
+ declare const HighlightColor: ({ editor, highlightColors, onClose, refs, floatingStyles }: Props) => JSX.Element;
13
+ export { HighlightColor };
14
+ //# sourceMappingURL=HighlightColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightColor.d.ts","sourceRoot":"","sources":["../../../src/tools/Toolbar/HighlightColor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA6C/C,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,aAAa,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE;QAAE,WAAW,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAA;KAAE,CAAC;IACjD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,cAAc,+DAAgE,KAAK,gBAgExF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ declare const Toolbar: () => JSX.Element | null;
3
+ export { Toolbar };
4
+ //# sourceMappingURL=Toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/tools/Toolbar/Toolbar.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,OAAO,0BAqDZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { YooEditor, YooptaBlock } from '../../editor/types';
3
+ type ToolbarComponentProps = {
4
+ activeBlock?: YooptaBlock;
5
+ editor: YooEditor;
6
+ };
7
+ declare const ToolbarComponent: ({ activeBlock, editor }: ToolbarComponentProps) => JSX.Element;
8
+ export { ToolbarComponent };
9
+ //# sourceMappingURL=ToolbarComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarComponent.d.ts","sourceRoot":"","sources":["../../../src/tools/Toolbar/ToolbarComponent.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAe5D,KAAK,qBAAqB,GAAG;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAMF,QAAA,MAAM,gBAAgB,4BAA6B,qBAAqB,gBAgKvE,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -102,3 +102,4 @@ export type EditorEventHandlers = {
102
102
  onTransitionEnd?: React.TransitionEventHandler;
103
103
  onTransitionEndCapture?: React.TransitionEventHandler;
104
104
  };
105
+ //# sourceMappingURL=eventHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventHandlers.d.ts","sourceRoot":"","sources":["../../src/types/eventHandlers.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAE/C,MAAM,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC;IAC5C,KAAK,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC;IACpC,YAA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qBAAqB,CAAC;IACnD,2BAA2B,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC;IAE1D,eAAe,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IAC/C,sBAAsB,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;CACvD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Editor, NodeEntry, Path } from 'slate';
2
+ import { SlateElement } from '../editor/types';
3
+ import { PluginElement, PluginElementProps, PluginElementsMap } from '../plugins/types';
4
+ export declare function getRootBlockElementType(elems: PluginElementsMap<string, unknown> | undefined): string | undefined;
5
+ export declare function getRootBlockElement(elems: PluginElementsMap<string, unknown> | undefined): PluginElement<unknown> | undefined;
6
+ export declare function isRootElementVoid(elems: PluginElementsMap<string, unknown> | undefined): boolean;
7
+ export type GetBlockElementNodeOptions = {
8
+ at?: Path;
9
+ elementType?: string;
10
+ };
11
+ export declare function getBlockElementNode(slate: Editor, options?: GetBlockElementNodeOptions): NodeEntry<SlateElement> | undefined;
12
+ export declare function buildSlateNodeElement(type: string, props?: PluginElementProps<unknown>): SlateElement<any>;
13
+ //# sourceMappingURL=blockElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockElements.d.ts","sourceRoot":"","sources":["../../src/utils/blockElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,SAAS,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGxF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOjH;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACpD,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAOpC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,CAGhG;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,0BAA+B,GACvC,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAuBrC;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,kBAAkB,CAAC,OAAO,CAAyB,GACzD,YAAY,CAAC,GAAG,CAAC,CAEnB"}
@@ -1 +1,2 @@
1
1
  export declare function deepClone(object: any): any;
2
+ //# sourceMappingURL=deepClone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepClone.d.ts","sourceRoot":"","sources":["../../src/utils/deepClone.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,OAIpC"}
@@ -0,0 +1,11 @@
1
+ import { Editor } from 'slate';
2
+ import { YooEditor } from '../editor/types';
3
+ import { PluginReturn, PluginElement } from '../plugins/types';
4
+ import { YooptaMark } from '../marks';
5
+ export declare function buildMarks(editor: any, marks: YooptaMark<any>[]): import("../editor/types").YooptaFormats;
6
+ export declare function buildBlocks(editor: any, plugins: PluginReturn<string, PluginElement<unknown>>[]): import("../editor/types").YooptaBlocks;
7
+ export declare function buildBlockSlateEditors(editor: YooEditor): {};
8
+ export declare function buildSlateEditor(editor: YooEditor): Editor;
9
+ export declare function buildBlockShortcuts(editor: YooEditor): {};
10
+ export declare function buildPlugins(plugins: PluginReturn<string, PluginElement<unknown>>[]): Record<string, PluginReturn<string, unknown>>;
11
+ //# sourceMappingURL=editorBuilders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorBuilders.d.ts","sourceRoot":"","sources":["../../src/utils/editorBuilders.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAqB,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAatC,wBAAgB,UAAU,CAAC,MAAM,KAAA,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,2CAgB1D;AAED,wBAAgB,WAAW,CAAC,MAAM,KAAA,EAAE,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,0CAqD1F;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,MASvD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAG1D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAepD;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,GACtD,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2B/C"}
@@ -0,0 +1,3 @@
1
+ import { YooEditor, YooptaEditorTransformOptions } from '../editor/types';
2
+ export declare function findPluginBlockBySelectionPath(editor: YooEditor, options?: Pick<YooptaEditorTransformOptions, 'at'>): import("../editor/types").YooptaBlockData<import("slate").Descendant> | null;
3
+ //# sourceMappingURL=findPluginBlockBySelectionPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findPluginBlockBySelectionPath.d.ts","sourceRoot":"","sources":["../../src/utils/findPluginBlockBySelectionPath.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE1E,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,IAAI,CAAC,4BAA4B,EAAE,IAAI,CAAM,gFAYvD"}
@@ -0,0 +1,7 @@
1
+ import { YooEditor } from '../editor/types';
2
+ type Options = {
3
+ type: string;
4
+ };
5
+ export declare function findPluginBlockByType(editor: YooEditor, options: Options): import("../editor/types").YooptaBlockData<import("slate").Descendant> | null;
6
+ export {};
7
+ //# sourceMappingURL=findPluginBlockByType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findPluginBlockByType.d.ts","sourceRoot":"","sources":["../../src/utils/findPluginBlockByType.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,gFAWxE"}
@@ -0,0 +1,3 @@
1
+ import { YooEditor, YooptaEditorTransformOptions } from '../editor/types';
2
+ export declare function findSlateBySelectionPath(editor: YooEditor, options?: Pick<YooptaEditorTransformOptions, 'at'>): (import("slate-react").ReactEditor & import("slate").BaseEditor) | undefined;
3
+ //# sourceMappingURL=findSlateBySelectionPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findSlateBySelectionPath.d.ts","sourceRoot":"","sources":["../../src/utils/findSlateBySelectionPath.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE1E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,IAAI,CAAC,4BAA4B,EAAE,IAAI,CAAM,gFAWjH"}
@@ -1 +1,2 @@
1
1
  export declare const generateId: () => string;
2
+ //# sourceMappingURL=generateId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateId.d.ts","sourceRoot":"","sources":["../../src/utils/generateId.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,cAKtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getMaxOffsetInElement(editor: any, elementPath: any): number;
2
+ //# sourceMappingURL=getMaxOffsetInElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMaxOffsetInElement.d.ts","sourceRoot":"","sources":["../../src/utils/getMaxOffsetInElement.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,MAAM,KAAA,EAAE,WAAW,KAAA,UAYxD"}
@@ -34,8 +34,12 @@ export declare const HOTKEYS: {
34
34
  isCmdEnter: (event: KeyboardEvent) => boolean;
35
35
  isCmd: (event: KeyboardEvent) => boolean;
36
36
  isEscape: (event: KeyboardEvent) => boolean;
37
+ isSlashCommand: (event: KeyboardEvent) => boolean;
38
+ isShiftArrowUp: (event: KeyboardEvent) => boolean;
39
+ isShiftArrowDown: (event: KeyboardEvent) => boolean;
37
40
  isKekceburek: (event: KeyboardEvent) => boolean;
38
41
  };
39
42
  export type HOTKEYS_TYPE = {
40
43
  [key in keyof typeof HOTKEYS]: (event: KeyboardEvent) => boolean;
41
44
  };
45
+ //# sourceMappingURL=hotkeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../../src/utils/hotkeys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAwEtC,eAAO,MAAM,OAAO;oBARH,aAAa;uBAAb,aAAa;yBAAb,aAAa;0BAAb,aAAa;uBAAb,aAAa;yBAAb,aAAa;8BAAb,aAAa;6BAAb,aAAa;kCAAb,aAAa;iCAAb,aAAa;kCAAb,aAAa;iCAAb,aAAa;8BAAb,aAAa;6BAAb,aAAa;kCAAb,aAAa;iCAAb,aAAa;sBAAb,aAAa;gCAAb,aAAa;+BAAb,aAAa;wBAAb,aAAa;yBAAb,aAAa;oBAAb,aAAa;0BAAb,aAAa;qBAAb,aAAa;kCAAb,aAAa;oBAAb,aAAa;qBAAb,aAAa;sBAAb,aAAa;mBAAb,aAAa;wBAAb,aAAa;yBAAb,aAAa;wBAAb,aAAa;mBAAb,aAAa;sBAAb,aAAa;4BAAb,aAAa;4BAAb,aAAa;8BAAb,aAAa;0BAAb,aAAa;CA+C7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;KACxB,GAAG,IAAI,MAAM,OAAO,OAAO,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO;CACjE,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { Descendant } from 'slate';
2
2
  export declare function serializeHtml(data: Descendant[], pluginsMap: any): string;
3
+ //# sourceMappingURL=serializeHTML.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeHTML.d.ts","sourceRoot":"","sources":["../../src/utils/serializeHTML.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,OAAO,CAAC;AA8BzC,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,KAAA,UAG3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "2.0.1",
3
+ "version": "4.0.0-rc.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -10,32 +10,32 @@
10
10
  "files": [
11
11
  "dist/"
12
12
  ],
13
- "scripts": {
14
- "prebuild": "rm -rf dist",
15
- "build:rollup": "rollup -c",
16
- "build": "rollup -c --environment NODE_ENV:production",
17
- "dev": "rm -rf dist && rollup -c -w --environment NODE_ENV:development --open",
18
- "coverage": "vitest run --coverage",
19
- "test": "vitest",
20
- "test:ui": "vitest --ui",
21
- "test:integration": "playwright test"
22
- },
23
13
  "dependencies": {
24
- "body-scroll-lock": "^4.0.0-beta.0",
25
- "classnames": "^2.3.1",
14
+ "@dnd-kit/core": "^6.1.0",
15
+ "@dnd-kit/sortable": "^8.0.0",
16
+ "@dnd-kit/utilities": "^3.2.2",
17
+ "@floating-ui/react": "^0.26.9",
18
+ "@radix-ui/react-icons": "^1.3.0",
19
+ "@radix-ui/react-toolbar": "^1.0.4",
26
20
  "copy-to-clipboard": "^3.3.2",
21
+ "eventemitter3": "^5.0.1",
22
+ "immer": "^10.0.3",
27
23
  "is-hotkey": "^0.2.0",
28
24
  "lodash.clonedeep": "^4.5.0",
29
- "lodash.uniqwith": "^4.5.0",
30
25
  "nanoid": "^4.0.1",
26
+ "slate": ">=0.72.3",
31
27
  "slate-history": "^0.66.0",
32
- "slate-hyperscript": "^0.77.0"
28
+ "slate-hyperscript": "^0.77.0",
29
+ "slate-react": ">=0.95.0"
33
30
  },
34
31
  "peerDependencies": {
35
32
  "react": ">=17.0.2",
36
- "react-dom": ">=17.0.2",
37
- "slate": ">=0.72.3",
38
- "slate-react": ">=0.95.0"
33
+ "react-dom": ">=17.0.2"
34
+ },
35
+ "scripts": {
36
+ "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
37
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production",
38
+ "publish": "yarn build && npm publish --access public"
39
39
  },
40
40
  "keywords": [
41
41
  "contenteditable",
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { RenderLeafProps } from 'slate-react';
3
- import { YooptaPluginType } from '../../../utils/plugins';
4
- type LeafProps = RenderLeafProps & {
5
- placeholder?: YooptaPluginType['placeholder'];
6
- leaf: any;
7
- };
8
- declare const TextLeaf: import("react").MemoExoticComponent<({ attributes, children, placeholder, leaf }: LeafProps) => JSX.Element>;
9
- export { TextLeaf };
@@ -1,2 +0,0 @@
1
- import { YooEditor } from '../../../types';
2
- export declare const withDeleteFragment: (editor: YooEditor) => YooEditor;
@@ -1,2 +0,0 @@
1
- import { YooEditor } from '../../../types';
2
- export declare const withNonEmptyEditor: (editor: YooEditor) => YooEditor;
@@ -1,3 +0,0 @@
1
- import { YooEditor } from '../../../types';
2
- declare const withHtml: (editor: YooEditor) => YooEditor;
3
- export { withHtml };
@@ -1,2 +0,0 @@
1
- import { YooEditor } from '../../../types';
2
- export declare const withShortcuts: (editor: YooEditor) => YooEditor;
@@ -1,2 +0,0 @@
1
- import { YooEditor } from '../../../types';
2
- export declare const withVoidNodes: (editor: YooEditor) => YooEditor;
@@ -1,18 +0,0 @@
1
- import { CSSProperties, MouseEvent, ReactNode } from 'react';
2
- type RenderProps = {
3
- handleDelete?: () => void;
4
- handleDuplicate?: () => void;
5
- handleCopy?: () => void;
6
- };
7
- type Props = {
8
- style: CSSProperties | undefined;
9
- onClose: (e?: MouseEvent) => void;
10
- additionalFields?: any;
11
- element: any;
12
- render?: (props: RenderProps) => ReactNode;
13
- onDelete?: () => void;
14
- onDuplicate?: () => void;
15
- onCopy?: () => void;
16
- };
17
- declare const ElementOptions: ({ onClose, style, element, render, ...props }: Props) => JSX.Element;
18
- export { ElementOptions };
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type Props = {
3
- onClose: () => void;
4
- children: ReactNode;
5
- };
6
- declare const Overlay: ({ children, onClose }: Props) => import("react").ReactPortal;
7
- export { Overlay };
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { NodeSettingsContextHandlers, NodeSettingsContextValues } from '../../contexts/NodeSettingsContext/NodeSettingsContext';
3
- import { Editor } from 'slate';
4
- import { YooptaBaseElement } from '../../types';
5
- type Props = {
6
- editor: Editor;
7
- element: YooptaBaseElement<string>;
8
- values: NodeSettingsContextValues;
9
- handlers: NodeSettingsContextHandlers;
10
- };
11
- declare const ElementActions: ({ element, editor, values, handlers }: Props) => JSX.Element;
12
- export { ElementActions };
@@ -1,14 +0,0 @@
1
- import { HTMLAttributes, ReactElement } from 'react';
2
- import { RenderElementProps } from 'slate-react';
3
- import { YooptaElementConfig } from '../../types';
4
- import { YooptaRenderHTMLAttributes } from '../../utils/plugins';
5
- type Props = RenderElementProps & {
6
- nodeType: YooptaElementConfig['nodeType'];
7
- render: (props: RenderElementProps & YooptaRenderHTMLAttributes) => ReactElement;
8
- HTMLAttributes?: HTMLAttributes<HTMLElement>;
9
- };
10
- declare const ElementWrapper: {
11
- ({ children, element, attributes, nodeType, render, HTMLAttributes }: Props): JSX.Element;
12
- displayName: string;
13
- };
14
- export { ElementWrapper };
@@ -1,21 +0,0 @@
1
- import { Key } from 'react';
2
- import { YooptaBaseElement, YooptaEditorValue, YooptaTools, YooptaNodeElementSettings } from '../../types';
3
- import { YooptaMark } from '../../utils/marks';
4
- import { YooptaPlugin } from '../../utils/plugins';
5
- import { OFFLINE_STORAGE } from '../../utils/storage';
6
- export type YooptaEditorProps<V> = {
7
- onChange: (_value: YooptaEditorValue<V>) => void;
8
- value: YooptaEditorValue<V>;
9
- key?: Key;
10
- placeholder?: string;
11
- plugins: YooptaPlugin<any, any>[];
12
- readOnly?: boolean;
13
- autoFocus?: boolean;
14
- offline?: OFFLINE_STORAGE;
15
- marks?: YooptaMark[];
16
- nodeElementSettings?: YooptaNodeElementSettings;
17
- className?: string;
18
- tools?: YooptaTools;
19
- };
20
- declare const YooptaEditor: <V extends YooptaBaseElement<string>>({ key, value, plugins, marks, readOnly, onChange, placeholder, autoFocus, offline, className, tools, }: YooptaEditorProps<V>) => JSX.Element;
21
- export { YooptaEditor };
@@ -1,29 +0,0 @@
1
- import { CSSProperties, MouseEvent, ReactNode } from 'react';
2
- import { YooptaBaseElement } from '../../types';
3
- import { DragDropValues, DragDropHandlers } from '../../hooks/useDragDrop';
4
- export type HoveredElement = YooptaBaseElement<string> | null;
5
- export type SelectedNodeElement = YooptaBaseElement<string> | null;
6
- export type NodeSettingsContextValues = DragDropValues & {
7
- hoveredElement: HoveredElement;
8
- isElementOptionsOpen: boolean;
9
- nodeSettingsPos?: CSSProperties | null;
10
- selectedNodeElement: SelectedNodeElement;
11
- };
12
- export type NodeSettingsContextHandlers = DragDropHandlers & {
13
- openNodeSettings: (_dragRef: any, _node: HoveredElement) => void;
14
- closeNodeSettings: () => void;
15
- hoverIn: (_e: MouseEvent<HTMLDivElement>, _node: YooptaBaseElement<string>) => void;
16
- triggerPlusButton: (_node: HoveredElement) => void;
17
- deleteNode: () => void;
18
- duplicateNode: () => void;
19
- copyLinkNode: () => void;
20
- changeHoveredNode: (_hoveredProps: HoveredElement) => void;
21
- changeSelectedNodeElement: (_node: SelectedNodeElement) => void;
22
- };
23
- export type NodeSettingsContextType = [NodeSettingsContextValues, NodeSettingsContextHandlers];
24
- type NodeSettingsProps = {
25
- children: ReactNode;
26
- };
27
- declare const NodeSettingsProvider: ({ children }: NodeSettingsProps) => JSX.Element;
28
- declare const useNodeElementSettings: () => NodeSettingsContextType;
29
- export { NodeSettingsProvider, useNodeElementSettings };