platejs 54.0.0-beta.2 → 54.0.0-beta.3

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 (237) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +56 -0
  3. package/dist/{AIChatRequestContext-BMVWhfPV.d.ts → AIChatRequestContext-DY104TqL.d.ts} +2 -2
  4. package/dist/{BaseSuggestionPlugin-DBl3fqnm.d.ts → BaseSuggestionPlugin-Deo6n6Fs.d.ts} +7 -3
  5. package/dist/{PlateStatic-DhNv2ejp.d.ts → PlateStatic-CJX5bKuv.d.ts} +7 -7
  6. package/dist/ai/index.d.ts +1 -1
  7. package/dist/ai/react/AIChatPlugin.js +113 -78
  8. package/dist/ai/react/CopilotPlugin.js +1 -1
  9. package/dist/ai/react/index.d.ts +23 -16
  10. package/dist/authored/index.d.ts +4 -4
  11. package/dist/code-block/codemirror/createCodeMirrorAdapter.js +12 -9
  12. package/dist/code-block/codemirror/index.d.ts +1 -1
  13. package/dist/{combobox-DkBGgyd3.d.ts → combobox-DAOYWuvC.d.ts} +2 -2
  14. package/dist/{comparison-types-CYnJ35qU.d.ts → comparison-types-Dt-unJZY-DCddmbSD.d.ts} +10 -2
  15. package/dist/compiler/index.d.ts +2 -2
  16. package/dist/{core-BJG8l_mk.d.ts → core-ClHasORr.d.ts} +433 -95
  17. package/dist/diff/index.d.ts +2 -2
  18. package/dist/docs/ai.md +4 -3
  19. package/dist/docs/api/core/plate-components.md +0 -19
  20. package/dist/docs/api/core/plate-controller.md +4 -2
  21. package/dist/docs/api/core/plate-plugin.md +3 -0
  22. package/dist/docs/api/core/plate-store.md +3 -3
  23. package/dist/docs/api/dom.md +14 -4
  24. package/dist/docs/api/editor-transforms.md +2 -1
  25. package/dist/docs/api/react-hooks.md +25 -11
  26. package/dist/docs/authored-changes.md +5 -2
  27. package/dist/docs/basic-blocks.md +42 -29
  28. package/dist/docs/blockquote.md +5 -3
  29. package/dist/docs/board.md +63 -8
  30. package/dist/docs/code-block.md +47 -0
  31. package/dist/docs/discussion.md +1 -1
  32. package/dist/docs/docx.md +1 -1
  33. package/dist/docs/dom-coverage.md +5 -0
  34. package/dist/docs/examples/editable-voids.md +2 -3
  35. package/dist/docs/external-text.md +2 -0
  36. package/dist/docs/field.md +370 -0
  37. package/dist/docs/find.md +9 -6
  38. package/dist/docs/form.md +2 -0
  39. package/dist/docs/heading.md +6 -0
  40. package/dist/docs/installation/manual.md +0 -4
  41. package/dist/docs/link.md +3 -3
  42. package/dist/docs/llms.txt +4 -2
  43. package/dist/docs/markdown.md +176 -8
  44. package/dist/docs/plugin-components.md +13 -10
  45. package/dist/docs/plugin-input-rules.md +4 -12
  46. package/dist/docs/prompt-editor.md +205 -0
  47. package/dist/docs/roots.md +8 -6
  48. package/dist/docs/rtl.md +6 -4
  49. package/dist/docs/selection.md +7 -4
  50. package/dist/docs/suggestion.md +1 -1
  51. package/dist/docs/toolbar.md +26 -30
  52. package/dist/docs/upload.md +106 -17
  53. package/dist/docx/export/index.d.ts +3 -3
  54. package/dist/docx/export/lib/docxStaticComponents.js +12 -2
  55. package/dist/docx/export/lib/exportDocx.js +29 -5
  56. package/dist/docx/export/lib/reviewPart.js +1 -1
  57. package/dist/docx/export/lib/reviewProjection.js +10 -8
  58. package/dist/docx/import/index.d.ts +4 -4
  59. package/dist/docx/paste/index.d.ts +4 -4
  60. package/dist/dom/index.d.ts +1 -6
  61. package/dist/dom/plite-dom.internal.js +2 -2
  62. package/dist/excalidraw/index.d.ts +3 -2
  63. package/dist/excalidraw/react/index.d.ts +3 -2
  64. package/dist/facade.js +2 -2
  65. package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +13 -5
  66. package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +32 -10
  67. package/dist/features/board/index.d.ts +2 -2
  68. package/dist/features/board/lib/BaseBoardPlugin.js +14 -1
  69. package/dist/features/board/lib/boardStroke.internal.js +13 -1
  70. package/dist/features/board/lib/boardTypes.internal.js +16 -0
  71. package/dist/features/callout/index.d.ts +3 -2
  72. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +14 -5
  73. package/dist/features/combobox/index.d.ts +2 -2
  74. package/dist/features/comments/index.d.ts +1 -1
  75. package/dist/features/date/index.d.ts +3 -2
  76. package/dist/features/details/index.d.ts +3 -2
  77. package/dist/features/details/lib/BaseDetailsPlugin.js +10 -10
  78. package/dist/features/field/index.d.ts +2 -0
  79. package/dist/features/field/index.js +2 -0
  80. package/dist/features/field/lib/BaseFieldPlugin.js +414 -0
  81. package/dist/features/field/lib/fieldRules.internal.js +42 -0
  82. package/dist/features/find/index.d.ts +3 -2
  83. package/dist/features/footnote/index.d.ts +1 -1
  84. package/dist/features/ink/index.d.ts +1 -1
  85. package/dist/features/ink/lib/BaseInkPlugin.js +126 -103
  86. package/dist/features/ink/lib/inkCodec.internal.js +130 -0
  87. package/dist/features/ink/lib/inkGone.internal.js +229 -48
  88. package/dist/features/ink/lib/inkPlaces.internal.js +533 -62
  89. package/dist/features/layout/index.d.ts +1 -1
  90. package/dist/features/link/lib/BaseLinkPlugin.js +6 -4
  91. package/dist/features/lint/index.d.ts +3 -2
  92. package/dist/features/media/index.d.ts +1 -1
  93. package/dist/features/media/lib/media/parseMediaUrl.js +11 -1
  94. package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +6 -2
  95. package/dist/features/mention/index.d.ts +5 -4
  96. package/dist/features/suggestion/index.d.ts +1 -1
  97. package/dist/features/table/index.d.ts +1 -1
  98. package/dist/features/table/lib/BaseTablePlugin.js +14 -8
  99. package/dist/features/table/lib/internal/selection.js +4 -2
  100. package/dist/features/toc/index.d.ts +1 -1
  101. package/dist/features/upload/index.d.ts +2 -2
  102. package/dist/features/upload/lib/BaseUploadPlugin.js +464 -250
  103. package/dist/history/index.d.ts +2 -2
  104. package/dist/html/index.d.ts +3 -3
  105. package/dist/html/server/index.d.ts +1 -1
  106. package/dist/{htmlTypes-DjeFG3P8.d.ts → htmlTypes-cg_cWsaN.d.ts} +2 -31
  107. package/dist/hyperscript/index.d.ts +1 -1
  108. package/dist/{index-D1CFXA-i.d.ts → index-8WO2vI0U.d.ts} +475 -143
  109. package/dist/{index-DaM37gF6.d.ts → index-B5mYEawV.d.ts} +37 -21
  110. package/dist/{index-Bq3sdm3S.d.ts → index-BZWFoUXt.d.ts} +5 -4
  111. package/dist/{index-DdIRduDG.d.ts → index-C0POz7rg.d.ts} +3 -2
  112. package/dist/{index-Bxfvicyy.d.ts → index-C1_JIhL4.d.ts} +4 -3
  113. package/dist/{index-DC_MNGyu.d.ts → index-C35V_hj0.d.ts} +3 -3
  114. package/dist/{index-kLKMc-pI.d.ts → index-C6ql9pKw.d.ts} +2 -2
  115. package/dist/{index-hsC_sOn2.d.ts → index-C9DiGDVj.d.ts} +35 -5
  116. package/dist/{index-DTgaSxKr.d.ts → index-CLsEe3LY.d.ts} +40 -4
  117. package/dist/{index-CT7miqQN.d.ts → index-CdOLsPaW.d.ts} +29 -9
  118. package/dist/{index-DLA2DUR2.d.ts → index-CktYvOgk.d.ts} +4 -3
  119. package/dist/{index-BBKGrsG3.d.ts → index-Cmuluh6f.d.ts} +1 -1
  120. package/dist/{index-BiQerPJS.d.ts → index-CzLwBZpY.d.ts} +2 -2
  121. package/dist/{index-DzD6BIFJ.d.ts → index-D3-2iM1b.d.ts} +7 -5
  122. package/dist/{index-Cl77E9yr.d.ts → index-DKOFvteF.d.ts} +2 -2
  123. package/dist/{index-iaZOhA76.d.ts → index-DPWyk3lG-DOYwohXO.d.ts} +1 -1
  124. package/dist/index-DQnjqtQa.d.ts +678 -0
  125. package/dist/{index-CcZbqPqk.d.ts → index-Do9pj1GK.d.ts} +73 -39
  126. package/dist/{index-BU6k1Aev.d.ts → index-DpltOCot-A2b3p3Eb.d.ts} +4735 -4586
  127. package/dist/{index-Bc2Yg_2j.d.ts → index-HPYawTae-BCUQLEWF.d.ts} +2 -2
  128. package/dist/{index-BkR7-GLI.d.ts → index-baQOK89E.d.ts} +2 -2
  129. package/dist/{index-D5W-p9bS.d.ts → index-oIJAZxc2.d.ts} +49 -4
  130. package/dist/{index-xdmCBvlT.d.ts → index-r7yb77Wy.d.ts} +3 -2
  131. package/dist/index.d.ts +4 -4
  132. package/dist/{react/internal → internal}/penStroke.internal.js +1 -1
  133. package/dist/internal/plugin/OverridePlugin.js +101 -119
  134. package/dist/internal/plugin/collectPlateNodeMappings.js +5 -1
  135. package/dist/internal/plugin/pastedUploadFiles.js +4 -0
  136. package/dist/internal/plugin/resolvePlugin.js +1 -1
  137. package/dist/internal/plugin/resolvePlugins.js +3 -0
  138. package/dist/internal/plugin/uploadDrafts.js +6 -0
  139. package/dist/internal/utils/mergePlugins.js +1 -0
  140. package/dist/lib/plugins/element-id/ElementIdPlugin.js +8 -2
  141. package/dist/lib/plugins/html/HtmlPlugin.js +9 -0
  142. package/dist/lib/plugins/html/htmlSafety.js +1 -1
  143. package/dist/lib/plugins/input-rules/InputRulesPlugin.js +5 -15
  144. package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +16 -0
  145. package/dist/markdown/index.d.ts +2 -2
  146. package/dist/markdown/index.js +2 -1
  147. package/dist/markdown/lib/MarkdownPlugin.js +16 -9
  148. package/dist/markdown/lib/RawHtmlPlugin.js +24 -0
  149. package/dist/markdown/lib/deserializer/mdastToSlate.js +12 -2
  150. package/dist/markdown/lib/internal/markdownConversion.js +773 -74
  151. package/dist/markdown/lib/internal/markdownDiagnostics.js +18 -7
  152. package/dist/markdown/lib/internal/markdownFrontmatter.js +102 -0
  153. package/dist/markdown/lib/internal/markdownIntrinsics.js +125 -43
  154. package/dist/markdown/lib/internal/markdownLine.js +5 -3
  155. package/dist/markdown/lib/internal/markdownMappings.js +19 -7
  156. package/dist/markdown/lib/internal/markdownOpenTail.js +381 -0
  157. package/dist/markdown/lib/internal/markdownRawHtml.js +314 -0
  158. package/dist/markdown/lib/internal/markdownSegments.js +57 -48
  159. package/dist/markdown/lib/internal/markdownTags.js +22 -8
  160. package/dist/markdown/lib/serializer/convertNodesSerialize.js +10 -8
  161. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +226 -0
  162. package/dist/markdown/lib/serializer/listToMdastTree.js +2 -0
  163. package/dist/math/index.d.ts +3 -2
  164. package/dist/math/react/index.d.ts +4 -3
  165. package/dist/migrations/index.d.ts +3 -3
  166. package/dist/pagination/index.d.ts +1 -1
  167. package/dist/pagination/react/index.d.ts +4 -4
  168. package/dist/react/components/EditorContentView.internal.js +17 -8
  169. package/dist/react/components/EditorProvider.js +5 -5
  170. package/dist/react/components/Plate.js +103 -122
  171. package/dist/react/components/PlateContainer.js +40 -32
  172. package/dist/react/components/PlateController.js +28 -16
  173. package/dist/react/components/PlateRoot.internal.js +3 -2
  174. package/dist/react/core.js +4 -4
  175. package/dist/react/features/board/BoardSurface.js +116 -87
  176. package/dist/react/features/board/boardClipboard.internal.js +15 -5
  177. package/dist/react/features/board/boardGesture.internal.js +6 -3
  178. package/dist/react/features/board/boardIndex.internal.js +7 -18
  179. package/dist/react/features/board/boardPictures.internal.js +19 -13
  180. package/dist/react/features/board/boardView.internal.js +184 -49
  181. package/dist/react/features/board/boardVoice.internal.js +10 -11
  182. package/dist/react/features/board/index.d.ts +64 -18
  183. package/dist/react/features/callout/index.d.ts +3 -2
  184. package/dist/react/features/combobox/index.d.ts +8 -8
  185. package/dist/react/features/comments/index.d.ts +6 -5
  186. package/dist/react/features/date/index.d.ts +4 -3
  187. package/dist/react/features/details/index.d.ts +4 -3
  188. package/dist/react/features/field/FieldPlugin.js +34 -0
  189. package/dist/react/features/field/index.d.ts +312 -0
  190. package/dist/react/features/field/index.js +2 -0
  191. package/dist/react/features/footnote/index.d.ts +7 -6
  192. package/dist/react/features/format-painter/index.d.ts +4 -3
  193. package/dist/react/features/ink/InkContent.js +313 -0
  194. package/dist/react/features/ink/index.d.ts +57 -29
  195. package/dist/react/features/ink/index.js +2 -2
  196. package/dist/react/features/ink/inkCapture.internal.js +39 -17
  197. package/dist/react/features/ink/inkInput.internal.js +1 -1
  198. package/dist/react/features/ink/inkLayout.internal.js +6 -3
  199. package/dist/react/features/ink/inkPaint.internal.js +78 -2
  200. package/dist/react/features/ink/inkPlacement.internal.js +331 -104
  201. package/dist/react/features/ink/inkWatch.internal.js +7 -5
  202. package/dist/react/features/layout/index.d.ts +5 -4
  203. package/dist/react/features/media/index.d.ts +5 -4
  204. package/dist/react/features/mention/index.d.ts +6 -5
  205. package/dist/react/features/resizable/Resizable.js +4 -6
  206. package/dist/react/features/resizable/index.d.ts +5 -5
  207. package/dist/react/features/suggestion/index.d.ts +6 -5
  208. package/dist/react/features/table/TablePlugin.js +4 -11
  209. package/dist/react/features/table/index.d.ts +8 -7
  210. package/dist/react/features/toc/index.d.ts +2 -2
  211. package/dist/react/features/upload/index.d.ts +11 -6
  212. package/dist/react/index.d.ts +6 -6
  213. package/dist/react/index.js +4 -4
  214. package/dist/react/internal/plate-context.js +425 -188
  215. package/dist/react/plite-react.js +2 -2
  216. package/dist/react/plugins/navigation-feedback/NavigationFeedbackPlugin.js +12 -10
  217. package/dist/react/stores/plate/useEditor.js +32 -14
  218. package/dist/react/stores/plate/useEditorHistory.js +55 -0
  219. package/dist/react/stores/plate/useEditorSelector.js +66 -21
  220. package/dist/react/utils/pipeRenderElement.internal.js +1 -1
  221. package/dist/react/utils/pluginRenderElement.internal.js +1 -1
  222. package/dist/react/virtualized.d.ts +4 -4
  223. package/dist/{source-CNKy99Th.d.ts → source-aUwpNnAw.d.ts} +4 -4
  224. package/dist/static/index.d.ts +18 -18
  225. package/dist/static/internal/renderStaticHtmlWithOverrides.js +2 -2
  226. package/dist/static/internal/staticPresentation.js +4 -4
  227. package/dist/static/internal/writeStaticSelectionClipboardData.js +7 -2
  228. package/dist/tabbable/index.d.ts +1 -1
  229. package/dist/tabbable/react/index.d.ts +3 -3
  230. package/dist/testing/index.d.ts +3 -3
  231. package/dist/yjs/index.d.ts +1 -1
  232. package/dist/yjs/react/index.d.ts +6 -6
  233. package/package.json +20 -2
  234. package/dist/markdown/lib/serializer/convertTextsSerialize.js +0 -163
  235. package/dist/react/components/EditorSelectionView.js +0 -40
  236. package/dist/react/features/ink/InkLayer.js +0 -218
  237. package/dist/react/internal/createPlateTargetScope.js +0 -62
@@ -1,10 +1,11 @@
1
- import { ElementApi } from "../../../facade.js";
1
+ import { ElementApi, getEditorRuntimeOwner } from "../../../facade.js";
2
2
  import { DOMPlugin } from "../../../lib/plugins/dom/DOMPlugin.js";
3
3
  import { useEditorRootElement } from "../../plite-react.js";
4
4
  import { definePlugin } from "../../plugin/definePlugin.js";
5
5
  import React from "react";
6
6
  //#region src/react/plugins/navigation-feedback/NavigationFeedbackPlugin.ts
7
- const mountedFeedback = /* @__PURE__ */ new WeakMap();
7
+ const feedbackByRoot = /* @__PURE__ */ new WeakMap();
8
+ const isModelEditor = (editor) => getEditorRuntimeOwner(editor) === editor;
8
9
  const emptySnapshot = () => null;
9
10
  const publish = (state, target) => {
10
11
  if (state.target === target) return;
@@ -24,8 +25,9 @@ const NavigationFeedbackPlugin = definePlugin("navigation", {
24
25
  api: ({ editor, store }) => ({
25
26
  /** Flash one live element in this mounted view without changing the document or selection. */
26
27
  flashTarget: ({ key, attributes = {}, duration = store.get("duration") }) => {
27
- const state = mountedFeedback.get(editor);
28
- if (!state || state.root !== editor.api.dom.root()) return false;
28
+ const root = isModelEditor(editor) ? null : editor.api.dom.root();
29
+ const state = root && feedbackByRoot.get(root);
30
+ if (!root || !state) return false;
29
31
  const path = editor.read.nodes.path(key);
30
32
  if (!path || !ElementApi.isElement(editor.read.nodes.get(path)?.[0])) return false;
31
33
  if (!Number.isFinite(duration) || duration < 0) throw new RangeError("Flash duration must be a finite non-negative number.");
@@ -43,14 +45,15 @@ const NavigationFeedbackPlugin = definePlugin("navigation", {
43
45
  pulse
44
46
  }));
45
47
  state.timeout = setTimeout(() => {
46
- if (mountedFeedback.get(editor) === state && state.target?.pulse === pulse) clear(state);
48
+ if (feedbackByRoot.get(root) === state && state.target?.pulse === pulse) clear(state);
47
49
  }, duration);
48
50
  return true;
49
51
  },
50
52
  /** Clear this mounted view's feedback, returning whether a target was active. */
51
53
  clear: () => {
52
- const state = mountedFeedback.get(editor);
53
- if (!state || state.root !== editor.api.dom.root()) return false;
54
+ const root = isModelEditor(editor) ? null : editor.api.dom.root();
55
+ const state = root && feedbackByRoot.get(root);
56
+ if (!state) return false;
54
57
  const hadTarget = state.target !== null;
55
58
  clear(state);
56
59
  return hadTarget;
@@ -62,20 +65,19 @@ const NavigationFeedbackPlugin = definePlugin("navigation", {
62
65
  React.useLayoutEffect(() => {
63
66
  if (!root) return void 0;
64
67
  const next = {
65
- root,
66
68
  target: null,
67
69
  pulse: 0,
68
70
  timeout: null,
69
71
  listeners: /* @__PURE__ */ new Set()
70
72
  };
71
- mountedFeedback.set(view, next);
73
+ feedbackByRoot.set(root, next);
72
74
  setState(next);
73
75
  const unsubscribe = view.subscribeCommit(() => {
74
76
  if (next.target && !view.read.nodes.path(next.target.key)) clear(next);
75
77
  });
76
78
  return () => {
77
79
  unsubscribe();
78
- if (mountedFeedback.get(view) === next) mountedFeedback.delete(view);
80
+ if (feedbackByRoot.get(root) === next) feedbackByRoot.delete(root);
79
81
  next.listeners.clear();
80
82
  clear(next);
81
83
  };
@@ -1,6 +1,6 @@
1
1
  import { RangeApi } from "../../../facade.js";
2
- import { useEditorRuntimeState } from "../../plite-react.js";
3
- import { PlateEditorContext, PlateModelContext, PlateViewFactsContext } from "../../internal/plate-context.js";
2
+ import { useEditorRootElement, useEditorRuntimeState } from "../../plite-react.js";
3
+ import { PlateModelContext, outsideEveryProvider, readBoolean, subscribeNothing, usePickedRoot, usePlateScope, usePlateTarget, useTargetViewState } from "../../internal/plate-context.js";
4
4
  import React from "react";
5
5
  import { c } from "react/compiler-runtime";
6
6
  //#region src/react/stores/plate/useEditor.ts
@@ -14,46 +14,64 @@ function useEditor() {
14
14
  }
15
15
  /** Get the complete document editor owned by the nearest EditorRoot. */
16
16
  function useModelEditor() {
17
- const editor = React.useContext(PlateModelContext)?.editor;
17
+ const editor = (usePickedRoot()?.model ?? React.use(PlateModelContext))?.editor;
18
18
  if (!editor) throw new Error("useModelEditor() requires an active EditorRoot.");
19
19
  return editor;
20
20
  }
21
21
  /** Get the provider's selected editor, or null when no editor is available. */
22
22
  function useOptionalEditor() {
23
- return React.useContext(PlateEditorContext)?.editor ?? null;
23
+ return usePlateTarget()?.editor ?? null;
24
24
  }
25
25
  /** Get the selected editor's application ID. */
26
26
  const useEditorId = () => {
27
27
  return useEditor().id;
28
28
  };
29
+ const noEditorDOM = { api: { dom: {
30
+ editable: () => null,
31
+ root: () => null,
32
+ scroll: () => null
33
+ } } };
29
34
  /** Whether the selected command view has a mounted editable. */
30
35
  const useEditorMounted = () => {
31
- return React.useContext(PlateViewFactsContext).mounted;
36
+ const $ = c(4);
37
+ const { server } = usePlateScope();
38
+ const mounted = useEditorRootElement(useOptionalEditor() ?? noEditorDOM) != null;
39
+ let t0;
40
+ if ($[0] !== mounted) {
41
+ t0 = readBoolean(mounted);
42
+ $[0] = mounted;
43
+ $[1] = t0;
44
+ } else t0 = $[1];
45
+ const t1 = server?.mounted ?? false;
46
+ let t2;
47
+ if ($[2] !== t1) {
48
+ t2 = readBoolean(t1);
49
+ $[2] = t1;
50
+ $[3] = t2;
51
+ } else t2 = $[3];
52
+ return React.useSyncExternalStore(subscribeNothing, t0, t2);
32
53
  };
33
54
  /** Whether the selected command view is currently focused. */
34
55
  const useEditorFocused = () => {
35
- return React.useContext(PlateViewFactsContext).focused;
56
+ return useTargetViewState(usePlateTarget(), "focused", false);
36
57
  };
37
58
  /** Whether the selected command view is composing text. */
38
59
  const useEditorComposing = () => {
39
- return React.useContext(PlateViewFactsContext).composing;
60
+ return useTargetViewState(usePlateTarget(), "composing", false);
40
61
  };
41
62
  /** Whether the selected command view rejects editing, including after unmount. */
42
63
  const useEditorReadOnly = () => {
43
- return React.useContext(PlateViewFactsContext).readOnly;
64
+ return useTargetViewState(usePlateTarget(), "readOnly", usePlateScope() !== outsideEveryProvider);
44
65
  };
45
66
  /** Get the selected Plate container ref; its value is null before mount. */
46
67
  function useEditorContainerRef() {
47
- const target = React.useContext(PlateEditorContext);
68
+ const target = usePlateTarget();
48
69
  const emptyRef = React.useRef(null);
49
70
  return target?.containerRef ?? emptyRef;
50
71
  }
51
- /**
52
- * Get the selected view's Editable ref; its value is null before mount. Inside
53
- * `EditorSelectionView` it is the Editable of the view holding the selection.
54
- */
72
+ /** Get the selected view's Editable ref; its value is null before mount. */
55
73
  function useEditableRef() {
56
- const target = React.useContext(PlateEditorContext);
74
+ const target = usePlateTarget();
57
75
  const emptyRef = React.useRef(null);
58
76
  return target?.editableRef ?? emptyRef;
59
77
  }
@@ -0,0 +1,55 @@
1
+ import { getViewPresentation } from "../../../facade.js";
2
+ import { useEditorHistory as useEditorHistory$1 } from "../../plite-react.js";
3
+ import { useOptionalEditorContext } from "../../internal/plite-components.js";
4
+ import { useOptionalEditor } from "./useEditor.js";
5
+ import { c } from "react/compiler-runtime";
6
+ //#region src/react/stores/plate/useEditorHistory.ts
7
+ /**
8
+ * Create undo/redo commands and keyboard handling.
9
+ *
10
+ * Without `editor` or `root`, while the editor `useEditor()` returns belongs to
11
+ * the `EditorRoot` around the hook, they run through that `EditorRoot`'s shown
12
+ * writable view used last, and are on only while a shown writable `Editable`
13
+ * reaches every root the next undo or redo changes. When no provider gives an
14
+ * editor, they do the same and need an `EditorRoot` around the hook.
15
+ * Otherwise, such as under `EditorController` or under an `EditorProvider`
16
+ * given another editor, they bind to that editor, as with `editor`. With
17
+ * `editor` or `root`, they replay the next batch whatever roots it changes.
18
+ * With `root`, they are off while no view of it is shown. With `editor`, they
19
+ * can stay on while no `Editable` runs that editor, and a click then does
20
+ * nothing. They are off while their view is read-only or composes text.
21
+ */
22
+ function useEditorHistory(t0) {
23
+ const $ = c(9);
24
+ let t1;
25
+ if ($[0] !== t0) {
26
+ t1 = t0 === void 0 ? {} : t0;
27
+ $[0] = t0;
28
+ $[1] = t1;
29
+ } else t1 = $[1];
30
+ const options = t1;
31
+ const editor = useOptionalEditor();
32
+ const around = useOptionalEditorContext();
33
+ let t2;
34
+ if ($[2] !== around || $[3] !== editor) {
35
+ t2 = editor !== null && around !== null && getViewPresentation(editor) === getViewPresentation(around);
36
+ $[2] = around;
37
+ $[3] = editor;
38
+ $[4] = t2;
39
+ } else t2 = $[4];
40
+ const followsRoot = t2;
41
+ let t3;
42
+ if ($[5] !== editor || $[6] !== followsRoot || $[7] !== options) {
43
+ t3 = options.editor || options.root || !editor || followsRoot ? options : {
44
+ editor,
45
+ focusPolicy: options.focusPolicy
46
+ };
47
+ $[5] = editor;
48
+ $[6] = followsRoot;
49
+ $[7] = options;
50
+ $[8] = t3;
51
+ } else t3 = $[8];
52
+ return useEditorHistory$1(t3);
53
+ }
54
+ //#endregion
55
+ export { useEditorHistory };
@@ -1,25 +1,70 @@
1
- import { useEditorRuntimeState } from "../../plite-react.js";
2
- import { useEditor } from "./useEditor.js";
3
- import { c } from "react/compiler-runtime";
1
+ import { runEditorObserver, sameResult } from "../../../facade.js";
2
+ import { usePlateScope } from "../../internal/plate-context.js";
3
+ import React from "react";
4
4
  //#region src/react/stores/plate/useEditorSelector.ts
5
- const useEditorSelector = (selector, t0) => {
6
- const $ = c(5);
7
- let t1;
8
- if ($[0] !== t0) {
9
- t1 = t0 === void 0 ? {} : t0;
10
- $[0] = t0;
11
- $[1] = t1;
12
- } else t1 = $[1];
13
- const options = t1;
14
- const editor = useEditor();
15
- let t2;
16
- if ($[2] !== editor || $[3] !== selector) {
17
- t2 = () => selector(editor);
18
- $[2] = editor;
19
- $[3] = selector;
20
- $[4] = t2;
21
- } else t2 = $[4];
22
- return useEditorRuntimeState(editor, t2, options);
5
+ const createSelection = () => {
6
+ let last;
7
+ let shouldUpdate;
8
+ return {
9
+ read: (editor, selector, equalityFn, shouldUpdateNow) => {
10
+ if (!editor) throw new Error("useEditor() requires an active Plate editor.");
11
+ shouldUpdate = shouldUpdateNow;
12
+ const version = editor.read.lastCommit()?.version;
13
+ if (last?.editor !== editor || last.selector !== selector || last.version !== version) {
14
+ const value = editor.read(() => selector(editor));
15
+ last = {
16
+ editor,
17
+ selector,
18
+ value: last && equalityFn(last.value, value) ? last.value : value,
19
+ version
20
+ };
21
+ }
22
+ return last.value;
23
+ },
24
+ wants: (editor, change) => {
25
+ let wanted = true;
26
+ runEditorObserver(editor, "commit-listener", () => {
27
+ wanted = shouldUpdate?.(change) ?? true;
28
+ });
29
+ return wanted;
30
+ }
31
+ };
32
+ };
33
+ /**
34
+ * Subscribe to a value derived from the selected editor. A selector that
35
+ * keeps its identity between renders runs at most once per commit, and once
36
+ * more when the selected editor changes, such as when the caret moves to
37
+ * another root. A selector written inline gets a new identity each render, so
38
+ * it also runs on every render of its component. A change that leaves the
39
+ * value equal renders nothing.
40
+ */
41
+ const useEditorSelector = (selector, options = {}) => {
42
+ const { equalityFn = sameResult, shouldUpdate } = options;
43
+ const scope = usePlateScope();
44
+ const [selection] = React.useState(createSelection);
45
+ const read = (editor) => selection.read(editor, selector, equalityFn, shouldUpdate);
46
+ return React.useSyncExternalStore(React.useCallback((listener) => {
47
+ let editor_0;
48
+ let stopCommits;
49
+ const follow = () => {
50
+ const next = scope.getSnapshot()?.editor;
51
+ if (next === editor_0) return;
52
+ stopCommits?.();
53
+ editor_0 = next;
54
+ stopCommits = next?.subscribeCommit((change) => {
55
+ if (selection.wants(next, change)) listener();
56
+ });
57
+ };
58
+ follow();
59
+ const stopScope = scope.subscribe(() => {
60
+ follow();
61
+ listener();
62
+ });
63
+ return () => {
64
+ stopScope();
65
+ stopCommits?.();
66
+ };
67
+ }, [scope, selection]), () => read(scope.getSnapshot()?.editor), () => read(scope.getServerSnapshot()?.editor));
23
68
  };
24
69
  //#endregion
25
70
  export { useEditorSelector };
@@ -6,9 +6,9 @@ import { getPluginNodeClass } from "../../lib/utils/pluginNodeClass.js";
6
6
  import { useEditorReadOnly } from "../plite-react.js";
7
7
  import { useEditorContext } from "../internal/plite-components.js";
8
8
  import { usePlateRenderContext } from "../internal/plate-context.js";
9
- import { ElementProvider } from "../stores/element/useElementStore.js";
10
9
  import { getElementNodeKey, usePlateRenderedAttributes } from "../internal/rendered-attributes.js";
11
10
  import { createPluginContext } from "../plugin/createPluginContext.internal.js";
11
+ import { ElementProvider } from "../stores/element/useElementStore.js";
12
12
  import { getDefaultElementTag } from "../../internal/plugin/defaultElementTag.js";
13
13
  import { pipeInjectNodeProps } from "../../internal/plugin/pipeInjectNodeProps.js";
14
14
  import { EditorElement, isHtmlVoidElementTag } from "../components/plate-nodes.js";
@@ -5,9 +5,9 @@ import { isEditOnly } from "../../internal/plugin/isEditOnlyDisabled.js";
5
5
  import { useClaimEditableDOMCommit, useEditorReadOnly } from "../plite-react.js";
6
6
  import { useEditorContext } from "../internal/plite-components.js";
7
7
  import { useEditor } from "../stores/plate/useEditor.js";
8
- import { ElementProvider } from "../stores/element/useElementStore.js";
9
8
  import { getElementNodeKey, usePlateRenderedAttributes } from "../internal/rendered-attributes.js";
10
9
  import { createPluginContext } from "../plugin/createPluginContext.internal.js";
10
+ import { ElementProvider } from "../stores/element/useElementStore.js";
11
11
  import { getDefaultElementTag } from "../../internal/plugin/defaultElementTag.js";
12
12
  import { EditorElement } from "../components/plate-nodes.js";
13
13
  import { useRedrawWithBlock } from "../internal/block-redraws.js";
@@ -1,6 +1,6 @@
1
- import { Ba as RootKey, Ec as Element } from "../index-BU6k1Aev.js";
2
- import { Cr as EditableProps, _n as EditorContentProps } from "../index-D1CFXA-i.js";
3
- import React from "react";
1
+ import { Si as Element, xs as RootKey } from "../index-DpltOCot-A2b3p3Eb.js";
2
+ import { Wn as EditableProps, _n as EditorContentProps } from "../index-8WO2vI0U.js";
3
+ import React$1 from "react";
4
4
  type VirtualizedEditableProps<TElement extends Element = Element, TRoot extends RootKey = RootKey> = EditableProps<TElement, TRoot> & {
5
5
  /** Estimated height in CSS pixels for an unmeasured top-level block. */
6
6
  estimatedBlockSize?: number;
@@ -9,5 +9,5 @@ type VirtualizedEditableProps<TElement extends Element = Element, TRoot extends
9
9
  };
10
10
  type VirtualizedEditorContentProps<TElement extends Element = Element, TRoot extends RootKey = RootKey> = EditorContentProps<TElement, TRoot> & Pick<VirtualizedEditableProps<TElement, TRoot>, 'estimatedBlockSize' | 'overscan'>;
11
11
  /** Render Plate content with explicit top-level viewport virtualization. */
12
- declare const VirtualizedEditorContent: <TElement extends Element = Element, TRoot extends RootKey = RootKey>({ estimatedBlockSize, overscan, ...props }: VirtualizedEditorContentProps<TElement, TRoot>) => React.JSX.Element;
12
+ declare const VirtualizedEditorContent: <TElement extends Element = Element, TRoot extends RootKey = RootKey>({ estimatedBlockSize, overscan, ...props }: VirtualizedEditorContentProps<TElement, TRoot>) => React$1.JSX.Element;
13
13
  export { VirtualizedEditorContent, VirtualizedEditorContentProps };
@@ -1,6 +1,6 @@
1
- import { Ba as RootKey, Ju as Path, eo as Value, ol as EditorSchemaRepairCode, x as AuthoredProjectionDiagnostic, zu as Range } from "./index-BU6k1Aev.js";
2
- import "./core-BJG8l_mk.js";
3
- import "./index-DLA2DUR2.js";
1
+ import { Xn as EditorSchemaRepairCode, Za as Path, m as AuthoredProjectionDiagnostic, ru as Value, us as Range, xs as RootKey } from "./index-DpltOCot-A2b3p3Eb.js";
2
+ import "./core-ClHasORr.js";
3
+ import "./index-CktYvOgk.js";
4
4
  import "saxes";
5
5
  type DocxImportLimits = Readonly<{
6
6
  maxComments: number;
@@ -86,7 +86,7 @@ type DocxDiagnostic = AuthoredProjectionDiagnostic | Readonly<{
86
86
  severity: 'warning';
87
87
  }> | Readonly<{
88
88
  code: 'property-dropped';
89
- /** How many runs, paragraphs or cells lost the property. */
89
+ /** How many runs, paragraphs, cells or elements lost the property. */
90
90
  count: number;
91
91
  feature: string;
92
92
  impact: 'lossy';
@@ -1,9 +1,9 @@
1
- import { Ec as Element, Ic as EditorSchemaSource, Ju as Path, Ln as EditorDocumentValue, Mc as ElementOf, wc as TextOf, x as AuthoredProjectionDiagnostic, yc as Text } from "../index-BU6k1Aev.js";
2
- import "../htmlTypes-DjeFG3P8.js";
3
- import { Er as RenderTextProps, Go as UnknownObject, Pa as RenderElementProps, Ra as InternalPluginDefinitionOf, Va as BasePluginDefinition, bo as PluginReference, kr as StaticRenderLeafProps, st as BasePluginInput, u as Editor, y as BasePluginContext, za as AnyBasePluginDefinition } from "../core-BJG8l_mk.js";
4
- import { n as EditorStaticProps, t as EditorStatic } from "../PlateStatic-DhNv2ejp.js";
5
- import "../index-DLA2DUR2.js";
6
- import React from "react";
1
+ import { Si as Element, Tt as EditorDocumentValue, Za as Path, Zn as EditorSchemaSource, cl as Text, ki as ElementOf, m as AuthoredProjectionDiagnostic, xl as TextOf } from "../index-DpltOCot-A2b3p3Eb.js";
2
+ import "../htmlTypes-cg_cWsaN.js";
3
+ import { Ba as AnyBasePluginDefinition, Er as RenderTextProps, Ha as BasePluginDefinition, Ko as UnknownObject, ja as RenderElementProps, kr as StaticRenderLeafProps, st as BasePluginInput, u as Editor, xo as PluginReference, y as BasePluginContext, za as InternalPluginDefinitionOf } from "../core-ClHasORr.js";
4
+ import { n as EditorStaticProps, t as EditorStatic } from "../PlateStatic-CJX5bKuv.js";
5
+ import "../index-CktYvOgk.js";
6
+ import React$1 from "react";
7
7
  type NodePropsDescriptor = EditorSchemaSource & PluginReference;
8
8
  type ElementPropsNode<TPlugin extends NodePropsDescriptor> = Extract<ElementOf<TPlugin>, Element>;
9
9
  type ElementPropsConfig<TPlugin extends NodePropsDescriptor> = InternalPluginDefinitionOf<TPlugin>;
@@ -17,32 +17,32 @@ type ElementRenderProps<N extends Element = Element, C extends AnyBasePluginDefi
17
17
  type EditorElementProps<TPlugin extends NodePropsDescriptor> = TPlugin extends NodePropsDescriptor ? ElementRenderProps<ElementPropsNode<TPlugin>, ElementPropsConfig<TPlugin>> : never;
18
18
  type EditorNodeProps<C extends AnyBasePluginDefinition = BasePluginDefinition> = Omit<BasePluginContext<C>, 'slots'> & {
19
19
  /** Merged with `attributes.ref`. */
20
- ref?: React.Ref<HTMLElement>;
20
+ ref?: React$1.Ref<HTMLElement>;
21
21
  };
22
22
  type EditorHTMLProps<C extends AnyBasePluginDefinition = BasePluginDefinition, T extends keyof HTMLElementTagNameMap = 'div'> = EditorNodeProps<C> & {
23
23
  /** HTML attributes to pass to the underlying HTML element. */
24
- attributes: React.PropsWithoutRef<React.JSX.IntrinsicElements[T]> & UnknownObject;
24
+ attributes: React$1.PropsWithoutRef<React$1.JSX.IntrinsicElements[T]> & UnknownObject;
25
25
  as?: T;
26
26
  /** Class to be merged with `attributes.className`. */
27
27
  className?: string;
28
28
  /** Style to be merged with `attributes.style`. */
29
- style?: React.CSSProperties;
29
+ style?: React$1.CSSProperties;
30
30
  };
31
31
  declare const EditorElement: {
32
32
  <N extends Element = Element, C extends AnyBasePluginDefinition = BasePluginDefinition, T extends keyof HTMLElementTagNameMap = 'div'>(props: Omit<RenderElementProps<N>, 'attributes'> & Pick<EditorNodeProps<C>, 'ref'> & {
33
- attributes: React.PropsWithoutRef<React.JSX.IntrinsicElements[T]> & UnknownObject;
33
+ attributes: React$1.PropsWithoutRef<React$1.JSX.IntrinsicElements[T]> & UnknownObject;
34
34
  as?: T;
35
35
  className?: string;
36
36
  path: Path;
37
- style?: React.CSSProperties;
38
- }): React.ReactElement;
37
+ style?: React$1.CSSProperties;
38
+ }): React$1.ReactElement;
39
39
  <T extends keyof HTMLElementTagNameMap = 'div'>(props: Omit<RenderElementProps, 'attributes'> & Pick<EditorNodeProps<never>, 'ref'> & {
40
- attributes: React.PropsWithoutRef<React.JSX.IntrinsicElements[T]> & UnknownObject;
40
+ attributes: React$1.PropsWithoutRef<React$1.JSX.IntrinsicElements[T]> & UnknownObject;
41
41
  as?: T;
42
42
  className?: string;
43
43
  path: Path;
44
- style?: React.CSSProperties;
45
- }): React.ReactElement;
44
+ style?: React$1.CSSProperties;
45
+ }): React$1.ReactElement;
46
46
  };
47
47
  /** Props for the static text component owned by a plugin descriptor. */
48
48
  type EditorTextProps<TPlugin extends NodePropsDescriptor> = TPlugin extends NodePropsDescriptor ? EditorNodeProps<TextPropsConfig<TPlugin>> & RenderTextProps<TextPropsNode<TPlugin>> & {
@@ -50,7 +50,7 @@ type EditorTextProps<TPlugin extends NodePropsDescriptor> = TPlugin extends Node
50
50
  } : never;
51
51
  declare const EditorText: <N extends Text = Text, C extends AnyBasePluginDefinition = BasePluginDefinition, T extends keyof HTMLElementTagNameMap = 'span'>(props: (EditorNodeProps<C> & RenderTextProps<N> & {
52
52
  attributes: UnknownObject;
53
- }) & EditorHTMLProps<C, T>) => React.ReactElement;
53
+ }) & EditorHTMLProps<C, T>) => React$1.ReactElement;
54
54
  type LeafRenderProps<N extends Text = Text, C extends AnyBasePluginDefinition = BasePluginDefinition> = EditorNodeProps<C> & StaticRenderLeafProps<N, N> & {
55
55
  attributes: UnknownObject;
56
56
  inset?: boolean;
@@ -60,7 +60,7 @@ type EditorLeafProps<TPlugin extends NodePropsDescriptor> = TPlugin extends Node
60
60
  declare const EditorLeaf: <N extends Text = Text, C extends AnyBasePluginDefinition = BasePluginDefinition, T extends keyof HTMLElementTagNameMap = 'span'>({ className, ...props }: (EditorNodeProps<C> & StaticRenderLeafProps<N, N> & {
61
61
  attributes: UnknownObject;
62
62
  inset?: boolean;
63
- }) & EditorHTMLProps<C, T>) => React.ReactElement;
63
+ }) & EditorHTMLProps<C, T>) => React$1.ReactElement;
64
64
  type StaticHtmlDiagnostic = AuthoredProjectionDiagnostic | Readonly<{
65
65
  code: 'missing-static-presentation';
66
66
  message: string;
@@ -77,7 +77,7 @@ type StaticHtmlResult = Readonly<{
77
77
  }>;
78
78
  type RenderStaticHtmlOptions<T extends EditorStaticProps = EditorStaticProps> = {
79
79
  /** Component used to render the captured document. */
80
- component?: React.ComponentType<T>;
80
+ component?: React$1.ComponentType<T>;
81
81
  /** Complete document to render. Defaults to the editor's current document. */
82
82
  document?: EditorDocumentValue;
83
83
  /**
@@ -21,7 +21,7 @@ const renderStaticHtmlWithOverrides = async (editor, { component: Component = Ed
21
21
  }));
22
22
  return Object.freeze({
23
23
  data: html,
24
- diagnostics: Object.freeze([...projected.diagnostics, ...Array.from(missing, (plugin) => Object.freeze({
24
+ diagnostics: Object.freeze([...projected.diagnostics, ...Array.from(missing.keys(), (plugin) => Object.freeze({
25
25
  code: "missing-static-presentation",
26
26
  message: `Plugin "${plugin}" has no drawing in the presentation, so its content was drawn without it.`,
27
27
  plugin,
@@ -30,4 +30,4 @@ const renderStaticHtmlWithOverrides = async (editor, { component: Component = Ed
30
30
  });
31
31
  };
32
32
  //#endregion
33
- export { renderStaticHtmlWithOverrides };
33
+ export { loadStaticRenderer, renderStaticHtmlWithOverrides };
@@ -15,11 +15,11 @@ const compilePeers = (plugins) => {
15
15
  return peers;
16
16
  };
17
17
  /**
18
- * Returns the set that rendering fills with the names of plugins whose drawing
19
- * the presentation lacked.
18
+ * Returns the map that rendering fills from the name of each plugin whose
19
+ * drawing the presentation lacked to the features it lacked, render or slots.
20
20
  */
21
21
  const bindStaticPresentation = (editor, { overrides, plugins }) => {
22
- const missing = /* @__PURE__ */ new Set();
22
+ const missing = /* @__PURE__ */ new Map();
23
23
  if (overrides || plugins) PRESENTATIONS.set(editor, {
24
24
  ...overrides,
25
25
  missing,
@@ -43,7 +43,7 @@ const resolveDrawing = (editor, plugin, feature, read, readInstalled = read) =>
43
43
  const drawing = peer ? read(peer) ?? void 0 : void 0;
44
44
  if (drawing !== void 0) return drawing;
45
45
  if (!isComponent(readInstalled(plugin))) return own;
46
- presentation.missing.add(plugin.name);
46
+ presentation.missing.set(plugin.name, (presentation.missing.get(plugin.name) ?? /* @__PURE__ */ new Set()).add(feature));
47
47
  };
48
48
  const getStaticElementComponent = (editor, plugin) => PRESENTATIONS.get(editor)?.components?.[plugin.name] ?? resolveDrawing(editor, plugin, "render", ({ component }) => component);
49
49
  const getStaticMarkComponent = (editor, plugin, placement) => resolveDrawing(editor, plugin, "render", ({ component, render }) => placement === "text" ? component : render.mark?.leafComponent ?? (render.mark?.placement === "text" ? void 0 : component));
@@ -1,5 +1,5 @@
1
1
  import { ContentSlice, MAIN_ROOT_KEY, PathApi, SelectionApi, TextApi, projectEditorView } from "../../facade.js";
2
- import { readDOMSelectionRange } from "../../dom/plite-dom.internal.js";
2
+ import { cleanDOMClipboardContents, readDOMSelectionRange } from "../../dom/plite-dom.internal.js";
3
3
  import { getPlainText } from "./getPlainText.js";
4
4
  import { exportContentSlice } from "plitejs/internal";
5
5
  //#region src/static/internal/writeStaticSelectionClipboardData.ts
@@ -195,10 +195,15 @@ const getStaticSelectionPayload = (editor, host) => {
195
195
  textNode.nodeValue = textNode.nodeValue?.replaceAll(sentinelToken, "") ?? "";
196
196
  textNode = textWalker.nextNode();
197
197
  }
198
+ const text = getPlainText(htmlContainer);
199
+ htmlContainer.querySelectorAll("[data-editor-string]").forEach((marker) => {
200
+ if (marker.textContent === "") marker.textContent = "";
201
+ });
202
+ cleanDOMClipboardContents(htmlContainer);
198
203
  return {
199
204
  html: htmlContainer.innerHTML,
200
205
  slice: exportContentSlice(editor, assembled),
201
- text: getPlainText(htmlContainer)
206
+ text
202
207
  };
203
208
  };
204
209
  const writeStaticSelectionClipboardData = (editor, data, host) => {
@@ -1,2 +1,2 @@
1
- import { n as TabbableEventContext, r as TabbablePluginState, t as TabbableEntry } from "../index-BiQerPJS.js";
1
+ import { n as TabbableEventContext, r as TabbablePluginState, t as TabbableEntry } from "../index-CzLwBZpY.js";
2
2
  export { TabbableEntry, TabbableEventContext, TabbablePluginState };
@@ -1,6 +1,6 @@
1
- import { Wa as DefinitionOf } from "../../core-BJG8l_mk.js";
2
- import { At as Plugin } from "../../index-D1CFXA-i.js";
3
- import { n as TabbableEventContext, t as TabbableEntry } from "../../index-BiQerPJS.js";
1
+ import { Ga as DefinitionOf } from "../../core-ClHasORr.js";
2
+ import { At as Plugin } from "../../index-8WO2vI0U.js";
3
+ import { n as TabbableEventContext, t as TabbableEntry } from "../../index-CzLwBZpY.js";
4
4
  declare const TabbablePlugin: Plugin<Readonly<{
5
5
  readonly name: "tabbable";
6
6
  readonly initialState: {
@@ -1,5 +1,5 @@
1
- import { At as setEditorFocused, Ec as Element, Mu as Location, Os as Descendant, Wu as Point, _o as unhangRange, ao as deleteForward, bs as TextSelection, co as getSnapshot, do as isBlock, eo as Value, fo as isEditor, go as string, gs as Selection, ho as replace, in as AnyEditor, io as deleteBackward, kt as getLiveSelection, ln as Editor, lo as insertBreak, mo as positions, no as after, oo as getChildren, po as move, ro as before, so as getSelection, uo as insertText, yc as Text, zu as Range } from "../index-BU6k1Aev.js";
2
- import { i as createHyperscript, o as createEditor } from "../index-Bc2Yg_2j.js";
1
+ import { Au as getSnapshot, Bu as positions, Cl as TextSelection, Eu as getChildren, Fu as isEditor, H as Descendant, Ju as setEditorFocused, Ki as Location, Mc as Selection, Mu as insertText, Ou as getLiveSelection, Pu as isBlock, Ru as move, Si as Element, Uu as replace, Wo as Point, Y as Editor, Zu as string, au as after$1, cl as Text, f as AnyEditor, id as unhangRange, ju as insertBreak, ku as getSelection, ru as Value, su as before$1, us as Range, vu as deleteBackward, yu as deleteForward } from "../index-DpltOCot-A2b3p3Eb.js";
2
+ import { i as createEditor, o as createHyperscript } from "../index-HPYawTae-BCUQLEWF.js";
3
3
  declare const createDataTransfer: (dataMap?: Map<string, string>) => DataTransfer;
4
4
  type TestEditorFixture = {
5
5
  children: Element[];
@@ -172,4 +172,4 @@ declare const hjsx: typeof jsx;
172
172
  declare const end: (editor: AnyEditor, at: Location) => Point;
173
173
  /** The editable element property `installBrowserHandle()` sets. */
174
174
  declare const BROWSER_HANDLE_KEY = "__EDITOR_BROWSER_HANDLE__";
175
- export { BROWSER_HANDLE_KEY, TestEditor, TestEditorFixture, after, before, createDataTransfer, createEditor, createEditorFromFixture, createHyperscript, deleteBackward, deleteForward, elements, end, getChildren, getLiveSelection as getEditorLiveSelection, getSelection, getSnapshot, hjsx, insertBreak, insertText, isBlock, isEditor, jsx, jsxt, move, positions, projectTestSelectionRange, replace, setEditorFocused, string, unhangRange, voidChildren };
175
+ export { BROWSER_HANDLE_KEY, TestEditor, TestEditorFixture, after$1 as after, before$1 as before, createDataTransfer, createEditor, createEditorFromFixture, createHyperscript, deleteBackward, deleteForward, elements, end, getChildren, getLiveSelection as getEditorLiveSelection, getSelection, getSnapshot, hjsx, insertBreak, insertText, isBlock, isEditor, jsx, jsxt, move, positions, projectTestSelectionRange, replace, setEditorFocused, string, unhangRange, voidChildren };
@@ -1,2 +1,2 @@
1
- import { a as YjsAwarenessState, c as YjsInitialReadiness, d as YjsRemoteCursor, f as YjsRemoteCursorData, i as YjsAwarenessLike, l as YjsPluginOptions, n as YjsAdmissionStatus, p as YjsUpdatePolicy, r as YjsAwarenessChange, s as YjsCursorDataSchema, t as yjs } from "../index-Cl77E9yr.js";
1
+ import { c as YjsPluginOptions, d as YjsRemoteCursorData, f as YjsUpdatePolicy, i as YjsAwarenessState, n as YjsAwarenessChange, o as YjsCursorDataSchema, p as yjs, r as YjsAwarenessLike, s as YjsInitialReadiness, t as YjsAdmissionStatus, u as YjsRemoteCursor } from "../index-DKOFvteF.js";
2
2
  export { type YjsAdmissionStatus, type YjsAwarenessChange, type YjsAwarenessLike, type YjsAwarenessState, type YjsCursorDataSchema, type YjsInitialReadiness, type YjsPluginOptions, type YjsRemoteCursor, type YjsRemoteCursorData, YjsUpdatePolicy, yjs };
@@ -1,8 +1,8 @@
1
- import { $i as NodeKey, Hs as NodeEntry, Ru as BaseRange, _a as PluginFactoryTypeLambda$1, ds as DecorationRefresh, ya as PluginFactoryTypeProviderOf } from "../../index-BU6k1Aev.js";
2
- import "../../htmlTypes-DjeFG3P8.js";
3
- import { Ra as InternalPluginDefinitionOf, V as InternalBasePluginRuntimeExtension, bo as PluginReference, jo as PluginSelectors, za as AnyBasePluginDefinition } from "../../core-BJG8l_mk.js";
4
- import { At as Plugin, Ct as InternalPluginAuthorStageInput, Kn as RangeGeometry, Nt as PluginContext, St as InternalPluginAuthorStageCompatibility, Tt as InternalPluginAuthorState, Wt as Shortcuts, cn as InternalReactPluginAdapterResult, wt as InternalPluginAuthorStageKeys, xt as InternalPluginAuthorExtension } from "../../index-D1CFXA-i.js";
5
- import { a as YjsAwarenessState, c as YjsInitialReadiness, d as YjsRemoteCursor, f as YjsRemoteCursorData, i as YjsAwarenessLike, l as YjsPluginOptions, n as YjsAdmissionStatus, o as YjsBaseApi, p as YjsUpdatePolicy, r as YjsAwarenessChange, s as YjsCursorDataSchema, t as yjs, u as YjsPresenceApi } from "../../index-Cl77E9yr.js";
1
+ import { I as DecorationRefresh, bo as PluginFactoryTypeProviderOf, da as NodeEntry, vo as PluginFactoryTypeLambda$1, x as BaseRange, xa as NodeKey } from "../../index-DpltOCot-A2b3p3Eb.js";
2
+ import "../../htmlTypes-cg_cWsaN.js";
3
+ import { Ba as AnyBasePluginDefinition, Mo as PluginSelectors, V as InternalBasePluginRuntimeExtension, xo as PluginReference, za as InternalPluginDefinitionOf } from "../../core-ClHasORr.js";
4
+ import { At as Plugin, Ct as InternalPluginAuthorStageInput, Nt as PluginContext, St as InternalPluginAuthorStageCompatibility, Tt as InternalPluginAuthorState, Wt as Shortcuts, Xr as RangeGeometry, cn as InternalReactPluginAdapterResult, wt as InternalPluginAuthorStageKeys, xt as InternalPluginAuthorExtension } from "../../index-8WO2vI0U.js";
5
+ import { a as YjsBaseApi, c as YjsPluginOptions, d as YjsRemoteCursorData, f as YjsUpdatePolicy, i as YjsAwarenessState, l as YjsPresenceApi, n as YjsAwarenessChange, o as YjsCursorDataSchema, p as yjs, r as YjsAwarenessLike, s as YjsInitialReadiness, t as YjsAdmissionStatus, u as YjsRemoteCursor } from "../../index-DKOFvteF.js";
6
6
  import { RefObject } from "react";
7
7
  import "yjs";
8
8
  type YjsCursorDataForApi<TApi> = TApi extends YjsPresenceApi<infer TCursorData> ? TCursorData : YjsRemoteCursorData;
@@ -90,5 +90,5 @@ interface YjsPluginFactoryType {
90
90
  readonly output: PlateYjsPlugin<this['input']>;
91
91
  }
92
92
  /** Creates complete Plate Yjs descriptors from app-owned resources. */
93
- declare const YjsPlugin: PluginFactory<YjsPluginFactoryType, YjsPluginOptions>;
93
+ declare const YjsPlugin: PluginFactory<YjsPluginFactoryType, YjsPluginOptions<Readonly<Record<string, unknown>>>>;
94
94
  export { type YjsAdmissionStatus, type YjsAwarenessChange, type YjsAwarenessLike, type YjsAwarenessState, type YjsCursorDataSchema, type YjsInitialReadiness, YjsPlugin, type YjsPluginOptions, type YjsRemoteCursor, type YjsRemoteCursorData, YjsUpdatePolicy, useYjsAdmissionStatus, useYjsRemoteCursor, useYjsRemoteCursorGeometry, useYjsRemoteCursorIds, yjs };