platejs 54.0.0-beta.7 → 54.0.0-beta.8

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 (218) hide show
  1. package/dist/{AIChatRequestContext-DVGOeWhQ.d.ts → AIChatRequestContext-PbXTTovP.d.ts} +4 -2
  2. package/dist/{BaseSuggestionPlugin-BRFMMyEo.d.ts → BaseSuggestionPlugin-Dg-cdX26.d.ts} +10 -4
  3. package/dist/{PlateStatic-DIwBAVqF.d.ts → PlateStatic-CggiBCuD.d.ts} +3 -3
  4. package/dist/ai/index.d.ts +40 -2
  5. package/dist/ai/index.js +2 -1
  6. package/dist/ai/lib/lockedContext.internal.js +105 -0
  7. package/dist/ai/lib/lockedContext.js +179 -0
  8. package/dist/ai/react/AIChatPlugin.js +498 -103
  9. package/dist/ai/react/CopilotPlugin.js +37 -6
  10. package/dist/ai/react/aiOutputLanding.internal.js +19 -4
  11. package/dist/ai/react/index.d.ts +42 -9
  12. package/dist/authored/index.d.ts +4 -4
  13. package/dist/authored/index.js +2 -2
  14. package/dist/code-block/codemirror/index.d.ts +1 -1
  15. package/dist/{combobox-CfCJYKT0.d.ts → combobox-CUUSZR07.d.ts} +2 -2
  16. package/dist/compiler/index.d.ts +2 -2
  17. package/dist/{core-Cqc_KzpG.d.ts → core-D8i_gkA6.d.ts} +173 -106
  18. package/dist/diff/index.d.ts +3 -30
  19. package/dist/docs/api/core/plate-plugin.md +10 -9
  20. package/dist/docs/api/core.md +10 -5
  21. package/dist/docs/api/document-change.md +17 -10
  22. package/dist/docs/api/react-hooks.md +11 -5
  23. package/dist/docs/authored-changes.md +9 -6
  24. package/dist/docs/board.md +5 -4
  25. package/dist/docs/bold.md +0 -2
  26. package/dist/docs/document-model.md +3 -3
  27. package/dist/docs/docx.md +44 -0
  28. package/dist/docs/editor-methods.md +3 -3
  29. package/dist/docs/examples/version-history.md +1 -1
  30. package/dist/docs/footnote.md +80 -28
  31. package/dist/docs/html.md +10 -5
  32. package/dist/docs/indent.md +7 -5
  33. package/dist/docs/ink.md +18 -20
  34. package/dist/docs/installation/node.md +1 -1
  35. package/dist/docs/list.md +23 -3
  36. package/dist/docs/llms.txt +4 -3
  37. package/dist/docs/lock.md +264 -0
  38. package/dist/docs/markdown.md +13 -96
  39. package/dist/docs/plugin-context.md +14 -10
  40. package/dist/docs/serializing.md +26 -3
  41. package/dist/docs/static.md +19 -5
  42. package/dist/docx/export/index.d.ts +3 -3
  43. package/dist/docx/export/lib/exportDocx.js +58 -12
  44. package/dist/docx/import/index.d.ts +4 -4
  45. package/dist/docx/paste/index.d.ts +4 -4
  46. package/dist/dom/index.d.ts +1 -1
  47. package/dist/excalidraw/index.d.ts +3 -3
  48. package/dist/excalidraw/react/index.d.ts +3 -3
  49. package/dist/facade.js +2 -2
  50. package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +1 -1
  51. package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +27 -6
  52. package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +64 -12
  53. package/dist/features/board/index.d.ts +1 -1
  54. package/dist/features/board/lib/boardTypes.internal.js +3 -0
  55. package/dist/features/callout/index.d.ts +3 -3
  56. package/dist/features/callout/lib/BaseCalloutPlugin.js +1 -4
  57. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +1 -2
  58. package/dist/features/combobox/index.d.ts +2 -2
  59. package/dist/features/combobox/lib/filterWords.js +7 -11
  60. package/dist/features/comments/index.d.ts +1 -1
  61. package/dist/features/date/index.d.ts +3 -3
  62. package/dist/features/details/index.d.ts +4 -3
  63. package/dist/features/details/lib/BaseDetailsPlugin.js +228 -122
  64. package/dist/features/field/index.d.ts +1 -1
  65. package/dist/features/field/lib/BaseFieldPlugin.js +18 -2
  66. package/dist/features/find/index.d.ts +3 -3
  67. package/dist/features/footnote/index.d.ts +1 -1
  68. package/dist/features/footnote/lib/BaseFootnotePlugin.js +9 -2
  69. package/dist/features/ink/index.d.ts +2 -2
  70. package/dist/features/ink/lib/BaseInkPlugin.js +118 -82
  71. package/dist/features/ink/lib/inkMatch.internal.js +79 -78
  72. package/dist/features/ink/lib/inkPlaces.internal.js +166 -535
  73. package/dist/features/layout/index.d.ts +1 -1
  74. package/dist/features/layout/lib/BaseColumnPlugin.js +37 -14
  75. package/dist/features/link/lib/BaseLinkPlugin.js +38 -3
  76. package/dist/features/lint/index.d.ts +3 -3
  77. package/dist/features/list/lib/BaseListPlugin.js +30 -11
  78. package/dist/features/list/lib/listFamily.internal.js +2 -2
  79. package/dist/features/list/lib/listHtml.internal.js +1 -0
  80. package/dist/features/lock/index.d.ts +2 -0
  81. package/dist/features/lock/index.js +2 -0
  82. package/dist/features/lock/lib/BaseLockPlugin.js +526 -0
  83. package/dist/features/media/index.d.ts +1 -1
  84. package/dist/features/mention/index.d.ts +5 -5
  85. package/dist/features/suggestion/index.d.ts +1 -1
  86. package/dist/features/table/index.d.ts +1 -1
  87. package/dist/features/toc/index.d.ts +1 -1
  88. package/dist/features/upload/index.d.ts +1 -1
  89. package/dist/features/upload/lib/BaseUploadPlugin.js +5 -4
  90. package/dist/history/index.d.ts +2 -2
  91. package/dist/html/index.d.ts +3 -3
  92. package/dist/html/server/index.d.ts +1 -1
  93. package/dist/html/server/index.js +2 -1
  94. package/dist/html/server/serverCssParser.internal.js +500 -0
  95. package/dist/html/server/serverCssStyle.internal.js +208 -0
  96. package/dist/{htmlTypes-i_FBCMf2.d.ts → htmlTypes-zTLU3aTb.d.ts} +9 -13
  97. package/dist/hyperscript/index.d.ts +1 -1
  98. package/dist/index-0YxPsHwd.d.ts +1 -0
  99. package/dist/{index-Bv13FX9o.d.ts → index-3CExu_fj.d.ts} +3 -3
  100. package/dist/{index-CTTjpWgb-Fdrn8NP4.d.ts → index-4PpawhYe-yelJvgk1.d.ts} +1 -1
  101. package/dist/{index-B4ZhSQdk.d.ts → index-BCYBYfGM.d.ts} +3 -3
  102. package/dist/{index-CJGkjkH6.d.ts → index-BODDOPEd.d.ts} +1 -1
  103. package/dist/{index-DNXr_SN-.d.ts → index-BPOa4Z5n.d.ts} +9 -3
  104. package/dist/{index-Cc2ajXAd.d.ts → index-BSBkt2bm.d.ts} +44 -48
  105. package/dist/{index-CLNem74G.d.ts → index-BeyI3RUg.d.ts} +42 -39
  106. package/dist/{index-CmISVYmz.d.ts → index-BisOdLXI.d.ts} +14 -49
  107. package/dist/{index-CVAHIQ3p.d.ts → index-Bt5YI_JN.d.ts} +4 -4
  108. package/dist/{index-CrJ9Km8W.d.ts → index-CD_Ym9WQ.d.ts} +2 -2
  109. package/dist/{index-KteL56rA.d.ts → index-CX_JaDRY.d.ts} +4 -3
  110. package/dist/{index-BI0NS7kx.d.ts → index-CfK4uv4I.d.ts} +3 -3
  111. package/dist/{index-By7BkzIN.d.ts → index-CfRUKYCM.d.ts} +2 -2
  112. package/dist/{index-OMa7dlcS.d.ts → index-Cil7kghY.d.ts} +5 -5
  113. package/dist/index-D11C0iLb.d.ts +97 -0
  114. package/dist/{index-CS4G_W_R.d.ts → index-DJW6AjJ6.d.ts} +1 -1
  115. package/dist/{comparison-types-CsmDG5r2-z1s4gX06.d.ts → index-DM-b6jEe-BqkdOlav.d.ts} +19 -57
  116. package/dist/{index-1PlYsibA.d.ts → index-DoZhM7nD.d.ts} +3 -3
  117. package/dist/{index-DfkFmApH.d.ts → index-DsNwo8dd.d.ts} +35 -14
  118. package/dist/{index-CxG1Atvg.d.ts → index-DuElD_q6.d.ts} +3 -3
  119. package/dist/{index-BWCC4DCP.d.ts → index-f3aV3Kt-.d.ts} +5 -5
  120. package/dist/{index-uVbqCpDa.d.ts → index-u_h6ow4e.d.ts} +3 -3
  121. package/dist/{index-1rcWTB-o.d.ts → index-yZDmK6ab.d.ts} +3 -3
  122. package/dist/index.d.ts +3 -3
  123. package/dist/internal/plugin/OverridePlugin.js +22 -3
  124. package/dist/internal/plugin/blockInsertion.js +4 -4
  125. package/dist/internal/plugin/collectPlateNodeMappings.js +11 -4
  126. package/dist/internal/plugin/compilePlainTextMappings.js +2 -0
  127. package/dist/internal/plugin/plateRuntime.js +7 -1
  128. package/dist/internal/plugin/resolvePlugin.js +4 -1
  129. package/dist/internal/plugin/resolvePlugins.js +5 -3
  130. package/dist/lib/plugins/html/HtmlPlugin.js +32 -13
  131. package/dist/lib/plugins/html/htmlAst.js +5 -3
  132. package/dist/lib/plugins/html/htmlDom.js +1 -10
  133. package/dist/markdown/index.d.ts +2 -2
  134. package/dist/markdown/index.js +1 -2
  135. package/dist/markdown/lib/MarkdownPlugin.js +5 -7
  136. package/dist/markdown/lib/deserializer/convertNodesDeserialize.js +27 -3
  137. package/dist/markdown/lib/internal/markdownConversion.js +308 -340
  138. package/dist/markdown/lib/internal/markdownIntrinsics.js +36 -71
  139. package/dist/markdown/lib/internal/markdownLine.js +2 -4
  140. package/dist/markdown/lib/internal/markdownMappings.js +21 -3
  141. package/dist/markdown/lib/internal/markdownSafety.js +101 -1
  142. package/dist/markdown/lib/internal/markdownTags.js +2 -26
  143. package/dist/markdown/lib/serializer/convertNodesSerialize.js +5 -3
  144. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +1 -10
  145. package/dist/math/index.d.ts +3 -3
  146. package/dist/math/react/index.d.ts +4 -4
  147. package/dist/migrations/documentMigrationSelection.internal.js +107 -2
  148. package/dist/migrations/documentMigrations.js +17 -112
  149. package/dist/migrations/index.d.ts +3 -3
  150. package/dist/migrations/migratePlateV54.js +41 -40
  151. package/dist/migrations/migratePlateV54Ast.internal.js +143 -55
  152. package/dist/migrations/migratePlateV54CodeBlocks.internal.js +24 -29
  153. package/dist/migrations/migratePlateV54Inputs.internal.js +39 -32
  154. package/dist/migrations/migratePlateV54Profile.internal.js +52 -22
  155. package/dist/migrations/migratePlateV54Stage.internal.js +127 -0
  156. package/dist/migrations/migratePlateV54Urls.internal.js +77 -57
  157. package/dist/pagination/index.d.ts +1 -1
  158. package/dist/pagination/react/index.d.ts +2 -2
  159. package/dist/react/components/NodeSelection.js +8 -1
  160. package/dist/react/components/Plate.js +198 -152
  161. package/dist/react/components/PlateView.js +1 -1
  162. package/dist/{static/internal/getPlainText.js → react/components/getPlainText.internal.js} +1 -4
  163. package/dist/react/components/plate-nodes.js +48 -40
  164. package/dist/{static/internal/writeStaticSelectionClipboardData.js → react/components/writeStaticSelectionClipboardData.internal.js} +3 -4
  165. package/dist/react/features/board/BoardShape.js +48 -22
  166. package/dist/react/features/board/boardConnect.internal.js +0 -9
  167. package/dist/react/features/board/boardKeys.internal.js +41 -12
  168. package/dist/react/features/board/boardPicking.internal.js +0 -17
  169. package/dist/react/features/board/boardResize.internal.js +13 -18
  170. package/dist/react/features/board/boardView.internal.js +37 -8
  171. package/dist/react/features/board/boardVoice.internal.js +17 -4
  172. package/dist/react/features/board/index.d.ts +13 -11
  173. package/dist/react/features/callout/index.d.ts +3 -3
  174. package/dist/react/features/combobox/comboboxOwner.internal.js +10 -4
  175. package/dist/react/features/combobox/index.d.ts +5 -5
  176. package/dist/react/features/comments/index.d.ts +5 -5
  177. package/dist/react/features/date/index.d.ts +4 -4
  178. package/dist/react/features/details/index.d.ts +5 -5
  179. package/dist/react/features/field/index.d.ts +6 -5
  180. package/dist/react/features/footnote/index.d.ts +7 -7
  181. package/dist/react/features/format-painter/index.d.ts +4 -4
  182. package/dist/react/features/ink/InkContent.js +28 -100
  183. package/dist/react/features/ink/InkPlugin.js +12 -23
  184. package/dist/react/features/ink/index.d.ts +29 -102
  185. package/dist/react/features/ink/index.js +1 -2
  186. package/dist/react/features/ink/inkCapture.internal.js +97 -61
  187. package/dist/react/features/ink/inkImages.internal.js +20 -5
  188. package/dist/react/features/ink/inkMeasure.internal.js +35 -22
  189. package/dist/react/features/ink/inkPlacement.internal.js +78 -203
  190. package/dist/react/features/ink/inkWatch.internal.js +1 -32
  191. package/dist/react/features/layout/index.d.ts +5 -5
  192. package/dist/react/features/lock/LockPlugin.js +66 -0
  193. package/dist/react/features/lock/index.d.ts +58 -0
  194. package/dist/react/features/lock/index.js +2 -0
  195. package/dist/react/features/media/index.d.ts +5 -5
  196. package/dist/react/features/mention/index.d.ts +6 -6
  197. package/dist/react/features/suggestion/index.d.ts +6 -6
  198. package/dist/react/features/table/index.d.ts +5 -5
  199. package/dist/react/features/toc/index.d.ts +2 -2
  200. package/dist/react/features/upload/index.d.ts +5 -5
  201. package/dist/react/index.d.ts +4 -4
  202. package/dist/react/utils/pipeRenderElement.internal.js +32 -30
  203. package/dist/react/virtualized.d.ts +2 -2
  204. package/dist/{source-Dcgqj5Mf.d.ts → source-B1rLozUs.d.ts} +3 -3
  205. package/dist/static/components/plite-nodes.js +1 -1
  206. package/dist/static/index.d.ts +8 -10
  207. package/dist/static/pluginRenderLeafStatic.internal.js +1 -2
  208. package/dist/tabbable/index.d.ts +1 -1
  209. package/dist/tabbable/react/index.d.ts +3 -3
  210. package/dist/testing/index.d.ts +2 -2
  211. package/dist/{tx-only-1FM45FSj-D40jacZv.d.ts → tx-only-D8lpB-sT-ZiAbZRMU.d.ts} +133 -59
  212. package/dist/yjs/index.d.ts +1 -1
  213. package/dist/yjs/react/index.d.ts +5 -5
  214. package/package.json +16 -3
  215. package/dist/features/ink/lib/inkGone.internal.js +0 -290
  216. package/dist/markdown/lib/RawHtmlPlugin.js +0 -26
  217. package/dist/markdown/lib/internal/markdownRawHtml.js +0 -353
  218. package/dist/react/features/ink/InkCopyView.js +0 -214
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { subscribeSharedEditorViewState } from "../../facade.js";
2
+ import { hasNonWritableAt, subscribeSharedEditorViewState } from "../../facade.js";
3
+ import { markInnerWrapNodeChildren } from "../../internal/plugin/plateRuntime.js";
3
4
  import { PLUGINS } from "../../utils/plate-keys.js";
4
5
  import { NodeApi, RangeApi, defineEffect, defineStateField, editorCommands, locateAt, txLocate } from "../../core.js";
5
6
  import { definePlugin } from "../../react/plugin/definePlugin.js";
@@ -95,8 +96,20 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
95
96
  };
96
97
  return {
97
98
  accept: () => {
98
- const { suggestionText } = store.get();
99
+ const { suggestionNodeKey, suggestionText } = store.get();
99
100
  if (!suggestionText?.length) return false;
101
+ const selection = tx.selection();
102
+ const block = selection ? tx.nodes.block({ at: selection }) : void 0;
103
+ const liveBlockKey = block ? tx.key(block[1]) : null;
104
+ if (!selection || suggestionNodeKey && liveBlockKey !== suggestionNodeKey || hasNonWritableAt(editor, selection)) {
105
+ tx.tags.add("history-skip");
106
+ tx.tags.add(COPILOT_SKIP_ABORT_TAG);
107
+ setSuggestion({
108
+ nodeKey: null,
109
+ text: null
110
+ });
111
+ return false;
112
+ }
100
113
  const parsed = editor.api.markdown.parseInline(suggestionText);
101
114
  if (!parsed.ok) return false;
102
115
  tx.tags.add(COPILOT_SKIP_ABORT_TAG);
@@ -109,6 +122,18 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
109
122
  acceptNextWord: () => {
110
123
  const { getNextWord, suggestionNodeKey, suggestionText } = store.get();
111
124
  if (!getNextWord || !suggestionText?.length) return false;
125
+ const selection = tx.selection();
126
+ const block = selection ? tx.nodes.block({ at: selection }) : void 0;
127
+ const liveBlockKey = block ? tx.key(block[1]) : null;
128
+ if (!selection || suggestionNodeKey && liveBlockKey !== suggestionNodeKey || hasNonWritableAt(editor, selection)) {
129
+ tx.tags.add("history-skip");
130
+ tx.tags.add(COPILOT_SKIP_ABORT_TAG);
131
+ setSuggestion({
132
+ nodeKey: null,
133
+ text: null
134
+ });
135
+ return false;
136
+ }
112
137
  const { firstWord, remainingText } = getNextWord({ text: suggestionText });
113
138
  const parsed = editor.api.markdown.parseInline(firstWord);
114
139
  if (!parsed.ok) return false;
@@ -141,7 +166,7 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
141
166
  tx.tags.add("history-skip");
142
167
  const block = tx.nodes.block();
143
168
  const blockKey = key ?? (block ? tx.key(block[1]) : null);
144
- if (!blockKey) return;
169
+ if (!blockKey || hasNonWritableAt(editor, blockKey)) return;
145
170
  setSuggestion({
146
171
  nodeKey: blockKey,
147
172
  text
@@ -154,7 +179,12 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
154
179
  let debouncedTrigger = null;
155
180
  const views = /* @__PURE__ */ new Set();
156
181
  let mounted = false;
157
- const isWritable = () => !context.editor.read.view.isReadOnly() && (!mounted || Array.from(views).some((element) => element.isConnected && element.getAttribute("data-readonly") !== "true" && element.getAttribute("aria-readonly") !== "true" && element.getAttribute("aria-disabled") !== "true"));
182
+ const isWritable = () => {
183
+ if (context.editor.read.view.isReadOnly()) return false;
184
+ const selection = context.editor.read.selection();
185
+ if (selection && hasNonWritableAt(context.editor, selection)) return false;
186
+ return !mounted || Array.from(views).some((element) => element.isConnected && element.getAttribute("data-readonly") !== "true" && element.getAttribute("aria-readonly") !== "true" && element.getAttribute("aria-disabled") !== "true");
187
+ };
158
188
  const stop = () => {
159
189
  debouncedTrigger?.cancel();
160
190
  const { abortController } = context.store.get();
@@ -293,6 +323,7 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
293
323
  completeOptions.onError?.(error);
294
324
  },
295
325
  onFinish: (sourcePrompt, completion) => {
326
+ if (blockKey && hasNonWritableAt(commandEditor, blockKey)) return;
296
327
  context.update.setBlockSuggestion({
297
328
  key: blockKey,
298
329
  text: completion
@@ -336,11 +367,11 @@ const CopilotPlugin = definePlugin(PLUGINS.copilot, {
336
367
  }).extend((context) => {
337
368
  let previousSelection = null;
338
369
  return {
339
- slots: { wrapNodeChildren: () => {
370
+ slots: { wrapNodeChildren: markInnerWrapNodeChildren(() => {
340
371
  const GhostText = context.store.get().renderGhostText;
341
372
  if (!GhostText) return void 0;
342
373
  return ({ children }) => /* @__PURE__ */ React.createElement(React.Fragment, null, children, /* @__PURE__ */ React.createElement(GhostText, null));
343
- } },
374
+ }) },
344
375
  selectors: { isSuggested: (state, key) => state.suggestionNodeKey === key },
345
376
  shortcuts: {
346
377
  accept: {
@@ -62,6 +62,21 @@ const wholeTextBlocks = (state, range, land) => {
62
62
  nodes
63
63
  } : void 0;
64
64
  };
65
+ const extractCopiedBlockProps = (node, schema, options) => {
66
+ const props = {};
67
+ for (const [key, value] of Object.entries(NodeApi.extractProps(node))) {
68
+ if (key === "locked") continue;
69
+ if (!options?.preserveIdentity) {
70
+ if ((schema?.property({
71
+ key,
72
+ placement: "element",
73
+ type: node.type
74
+ }))?.lifecycle.copy === "drop") continue;
75
+ }
76
+ props[key] = value;
77
+ }
78
+ return props;
79
+ };
65
80
  /**
66
81
  * Copy the source block's formatting onto AI output. An answer that writes
67
82
  * lists keeps them, so only an answer without list items takes the source's
@@ -69,11 +84,11 @@ const wholeTextBlocks = (state, range, land) => {
69
84
  * decides. A copied indent becomes the first level, and the landing sets the
70
85
  * depth.
71
86
  */
72
- const formatAIOutput = ({ blocks, format, sourceBlock }) => {
87
+ const formatAIOutput = ({ blocks, format, schema, sourceBlock }) => {
73
88
  if (format === "none") return blocks;
74
89
  const firstText = NodeApi.first(sourceBlock, [0]);
75
90
  if (!TextApi.isText(firstText[0])) return null;
76
- const { children: _children, indent, listId: _listId, listLevels: _listLevels, listRestart: _listRestart, listStart: _listStart, ...blockProps } = sourceBlock;
91
+ const { indent, listId: _listId, listLevels: _listLevels, listRestart: _listRestart, listStart: _listStart, ...blockProps } = extractCopiedBlockProps(sourceBlock, schema);
77
92
  const textProps = NodeApi.extractProps(firstText[0]);
78
93
  const ownProps = hasListItems(blocks) ? {} : {
79
94
  ...blockProps,
@@ -259,7 +274,7 @@ const keepsShape = (answer, roundTrip) => {
259
274
  */
260
275
  const suggestionBlocks = (editor, state, { answer, roundTrip, source }) => {
261
276
  if (roundTrip && answer.length === source.length && keepsShape(answer, roundTrip)) return answer.map((block, index) => ({
262
- ...NodeApi.extractProps(source[index]),
277
+ ...extractCopiedBlockProps(source[index], editor.read.schema, { preserveIdentity: true }),
263
278
  children: block.children,
264
279
  type: source[index].type
265
280
  }));
@@ -269,4 +284,4 @@ const suggestionBlocks = (editor, state, { answer, roundTrip, source }) => {
269
284
  });
270
285
  };
271
286
  //#endregion
272
- export { captureTextRange, fillEmptyListItem, formatAIOutput, landAIOutput, suggestionBlocks, textEdits, wholeTextBlocks, withoutText };
287
+ export { captureTextRange, extractCopiedBlockProps, fillEmptyListItem, formatAIOutput, landAIOutput, suggestionBlocks, textEdits, wholeTextBlocks, withoutText };
@@ -1,12 +1,14 @@
1
- import { Aa as NodeKey, Ho as PluginReference, Ko as PluginTypeProvider, Oi as Element, Wa as NodeSelectionMode, b as BasePoint, ba as NodeEntry, bs as Range, bu as TxOnlyMethod, fa as Node, oo as Path, pn as EditorReadMethodTree, po as Plugin, rn as EditorNodesOptions, ta as Location, v as BaseElement, vu as TxDeclaredMethod, xu as Value, zi as HistoryApi } from "../../tx-only-1FM45FSj-D40jacZv.js";
2
- import "../../htmlTypes-i_FBCMf2.js";
3
- import { $i as BasePluginDependencyReferenceFor, Ba as DefinitionOf, H as InternalBasePluginRuntimeExtension, Ji as HistoryPluginState, go as PluginReference$1, mo as PluginDependency, v as BasePlugin, yo as PluginSchemaDeclaration } from "../../core-Cqc_KzpG.js";
4
- import { c as HistoryStateApi, l as HistoryTxApi, n as History, s as HistoryPluginTypeProvider } from "../../index-BWCC4DCP.js";
5
- import { a as AIToolName } from "../../AIChatRequestContext-DVGOeWhQ.js";
6
- import { kt as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-DfkFmApH.js";
7
- import { O as MarkdownSyncPlugin, d as Unsafe, i as MarkdownEditor, l as Handle, n as MarkdownApi, u as Join } from "../../index-Cc2ajXAd.js";
8
- import { S as AuthoredView, _ as AuthoredPlugin, b as AuthoredResult, c as AuthoredDecision, h as AuthoredPage, m as AuthoredOutcome, n as AuthoredChangeDetails, o as AuthoredChangesDelta, r as AuthoredChangeGroup, t as AuthoredChange, u as AuthoredGroupDetails, v as AuthoredQuery, x as AuthoredReview, y as AuthoredRefusal } from "../../index-CLNem74G.js";
9
- import "../../index-CVAHIQ3p.js";
1
+ import { Aa as NodeKey, Ho as PluginReference, Ko as PluginTypeProvider, Oi as Element, Wa as NodeSelectionMode, b as BasePoint, ba as NodeEntry, bs as Range, bu as TxOnlyMethod, fa as Node, oo as Path, pn as EditorReadMethodTree, po as Plugin, rn as EditorNodesOptions, ta as Location, v as BaseElement, vu as TxDeclaredMethod, xu as Value, zi as HistoryApi } from "../../tx-only-D8lpB-sT-ZiAbZRMU.js";
2
+ import "../../htmlTypes-zTLU3aTb.js";
3
+ import { $i as BasePluginDependencyReferenceFor, Ba as DefinitionOf, H as InternalBasePluginRuntimeExtension, Ji as HistoryPluginState, go as PluginReference$1, mo as PluginDependency, v as BasePlugin, yo as PluginSchemaDeclaration } from "../../core-D8i_gkA6.js";
4
+ import { c as HistoryStateApi, l as HistoryTxApi, n as History, s as HistoryPluginTypeProvider } from "../../index-f3aV3Kt-.js";
5
+ import { a as AIToolName } from "../../AIChatRequestContext-PbXTTovP.js";
6
+ import { A as MarkdownSyncPlugin, c as Handle, l as Join, r as MarkdownEditor, t as MarkdownApi, u as Unsafe } from "../../index-BSBkt2bm.js";
7
+ import { kt as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-DsNwo8dd.js";
8
+ import { n as Comparison } from "../../index-DM-b6jEe-BqkdOlav.js";
9
+ import "../../index-0YxPsHwd.js";
10
+ import { S as AuthoredView, _ as AuthoredPlugin, b as AuthoredResult, c as AuthoredDecision, h as AuthoredPage, m as AuthoredOutcome, n as AuthoredChangeDetails, o as AuthoredChangesDelta, r as AuthoredChangeGroup, s as AuthoredComparisonImportResult, t as AuthoredChange, u as AuthoredGroupDetails, v as AuthoredQuery, x as AuthoredReview, y as AuthoredRefusal } from "../../index-BeyI3RUg.js";
11
+ import "../../index-Bt5YI_JN.js";
10
12
  import * as React from "react";
11
13
  import React$1 from "react";
12
14
  import { ChatRequestOptions, ChatStatus, ChatTransport, DataUIPart, UIMessage } from "ai";
@@ -53,6 +55,9 @@ type AIChatPluginState = {
53
55
  key: NodeKey;
54
56
  }>>;
55
57
  _changeId: string | null;
58
+ _lockedBlockRefs: Record<string, Readonly<{
59
+ key: NodeKey;
60
+ }>>;
56
61
  _requestId: string | null;
57
62
  _tableCellRefs: Record<string, Readonly<{
58
63
  key: NodeKey;
@@ -71,6 +76,8 @@ type AIChatPluginState = {
71
76
  mode: AIMode;
72
77
  open: boolean;
73
78
  previewValue: Value;
79
+ /** Refusal message when an AI write was blocked by a non-writable target. */
80
+ refusalMessage: string | null;
74
81
  streaming: boolean;
75
82
  toolName: AIToolName;
76
83
  /** Text that opens AI Space, or a pattern tested against the typed text. */
@@ -167,6 +174,11 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
167
174
  };
168
175
  };
169
176
  readonly _changeId: string | null;
177
+ readonly _lockedBlockRefs: {
178
+ readonly [x: string]: {
179
+ readonly key: NodeKey;
180
+ };
181
+ };
170
182
  readonly _requestId: string | null;
171
183
  readonly _tableCellRefs: {
172
184
  readonly [x: string]: {
@@ -210,6 +222,7 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
210
222
  readonly id?: string;
211
223
  readonly type: string;
212
224
  }[];
225
+ readonly refusalMessage: string | null;
213
226
  readonly streaming: boolean;
214
227
  readonly toolName: AIToolName;
215
228
  readonly trigger: readonly string[] | RegExp | string;
@@ -290,6 +303,10 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
290
303
  }> & Readonly<{
291
304
  __pluginWritableProperties: never;
292
305
  }> & Readonly<Record<"api", {
306
+ proposeComparison: (input: Readonly<{
307
+ comparison: Comparison;
308
+ groupIds?: readonly string[];
309
+ }>) => AuthoredComparisonImportResult;
293
310
  setView: (view: AuthoredView) => void;
294
311
  subscribeChanges: (listener: (delta: AuthoredChangesDelta) => void) => () => void;
295
312
  subscribeRefusals: (listener: (refusal: AuthoredRefusal) => void) => () => void;
@@ -396,6 +413,11 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
396
413
  };
397
414
  };
398
415
  readonly _changeId: string | null;
416
+ readonly _lockedBlockRefs: {
417
+ readonly [x: string]: {
418
+ readonly key: NodeKey;
419
+ };
420
+ };
399
421
  readonly _requestId: string | null;
400
422
  readonly _tableCellRefs: {
401
423
  readonly [x: string]: {
@@ -439,6 +461,7 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
439
461
  readonly id?: string;
440
462
  readonly type: string;
441
463
  }[];
464
+ readonly refusalMessage: string | null;
442
465
  readonly streaming: boolean;
443
466
  readonly toolName: AIToolName;
444
467
  readonly trigger: readonly string[] | RegExp | string;
@@ -519,6 +542,10 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
519
542
  }> & Readonly<{
520
543
  __pluginWritableProperties: never;
521
544
  }> & Readonly<Record<"api", {
545
+ proposeComparison: (input: Readonly<{
546
+ comparison: Comparison;
547
+ groupIds?: readonly string[];
548
+ }>) => AuthoredComparisonImportResult;
522
549
  setView: (view: AuthoredView) => void;
523
550
  subscribeChanges: (listener: (delta: AuthoredChangesDelta) => void) => () => void;
524
551
  subscribeRefusals: (listener: (refusal: AuthoredRefusal) => void) => () => void;
@@ -692,6 +719,11 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
692
719
  };
693
720
  };
694
721
  readonly _changeId: string | null;
722
+ readonly _lockedBlockRefs: {
723
+ readonly [x: string]: {
724
+ readonly key: NodeKey;
725
+ };
726
+ };
695
727
  readonly _requestId: string | null;
696
728
  readonly _tableCellRefs: {
697
729
  readonly [x: string]: {
@@ -735,6 +767,7 @@ declare const AIChatPlugin: InternalPluginAuthorExtension<Plugin$1<Readonly<{
735
767
  readonly id?: string;
736
768
  readonly type: string;
737
769
  }[];
770
+ readonly refusalMessage: string | null;
738
771
  readonly streaming: boolean;
739
772
  readonly toolName: AIToolName;
740
773
  readonly trigger: readonly string[] | RegExp | string;
@@ -1,4 +1,4 @@
1
- import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../tx-only-1FM45FSj-D40jacZv.js";
2
- import { C as GaveWrite, D as proposeAuthoredComparison, E as projectAuthoredRange, S as AuthoredView, T as projectAuthoredDocument, a as AuthoredChangePart, b as AuthoredResult, c as AuthoredDecision, d as AuthoredGroupPart, f as AuthoredMark, g as AuthoredPlaceError, h as AuthoredPage, i as AuthoredChangeKind, l as AuthoredFormatProjection, m as AuthoredOutcome, n as AuthoredChangeDetails, o as AuthoredChangesDelta, p as AuthoredOptions, r as AuthoredChangeGroup, s as AuthoredComparisonImportResult, t as AuthoredChange, u as AuthoredGroupDetails, v as AuthoredQuery, w as SplitGave, x as AuthoredReview, y as AuthoredRefusal } from "../index-CLNem74G.js";
3
- import { t as AuthoredPlugin } from "../index-CVAHIQ3p.js";
4
- export { type AuthoredChange, type AuthoredChangeDetails, type AuthoredChangeGroup, type AuthoredChangeKind, type AuthoredChangePart, type AuthoredChangesDelta, type AuthoredComparisonImportResult, type AuthoredDecision, type AuthoredDocumentProjection, type AuthoredFormatProjection, type AuthoredGroupDetails, type AuthoredGroupPart, type AuthoredMark, type AuthoredOptions, type AuthoredOutcome, type AuthoredPage, AuthoredPlaceError, AuthoredPlugin, type AuthoredProjectionDiagnostic, type AuthoredProjectionRefusal, type AuthoredQuery, type AuthoredRefusal, type AuthoredResult, type AuthoredReview, type AuthoredView, type GaveWrite, type SplitGave, projectAuthoredDocument, projectAuthoredRange, proposeAuthoredComparison };
1
+ import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../tx-only-D8lpB-sT-ZiAbZRMU.js";
2
+ import { C as GaveWrite, E as projectAuthoredRange, S as AuthoredView, T as projectAuthoredDocument, a as AuthoredChangePart, b as AuthoredResult, c as AuthoredDecision, d as AuthoredGroupPart, f as AuthoredMark, g as AuthoredPlaceError, h as AuthoredPage, i as AuthoredChangeKind, l as AuthoredFormatProjection, m as AuthoredOutcome, n as AuthoredChangeDetails, o as AuthoredChangesDelta, p as AuthoredOptions, r as AuthoredChangeGroup, s as AuthoredComparisonImportResult, t as AuthoredChange, u as AuthoredGroupDetails, v as AuthoredQuery, w as SplitGave, x as AuthoredReview, y as AuthoredRefusal } from "../index-BeyI3RUg.js";
3
+ import { t as AuthoredPlugin } from "../index-Bt5YI_JN.js";
4
+ export { type AuthoredChange, type AuthoredChangeDetails, type AuthoredChangeGroup, type AuthoredChangeKind, type AuthoredChangePart, type AuthoredChangesDelta, type AuthoredComparisonImportResult, type AuthoredDecision, type AuthoredDocumentProjection, type AuthoredFormatProjection, type AuthoredGroupDetails, type AuthoredGroupPart, type AuthoredMark, type AuthoredOptions, type AuthoredOutcome, type AuthoredPage, AuthoredPlaceError, AuthoredPlugin, type AuthoredProjectionDiagnostic, type AuthoredProjectionRefusal, type AuthoredQuery, type AuthoredRefusal, type AuthoredResult, type AuthoredReview, type AuthoredView, type GaveWrite, type SplitGave, projectAuthoredDocument, projectAuthoredRange };
@@ -1,3 +1,3 @@
1
1
  import { AuthoredPlugin } from "./AuthoredPlugin.js";
2
- import { AuthoredPlaceError, projectAuthoredDocument, projectAuthoredRange, proposeAuthoredComparison } from "plitejs/authored";
3
- export { AuthoredPlaceError, AuthoredPlugin, projectAuthoredDocument, projectAuthoredRange, proposeAuthoredComparison };
2
+ import { AuthoredPlaceError, projectAuthoredDocument, projectAuthoredRange } from "plitejs/authored";
3
+ export { AuthoredPlaceError, AuthoredPlugin, projectAuthoredDocument, projectAuthoredRange };
@@ -1,4 +1,4 @@
1
- import { Jn as ExternalTextAdapter } from "../../index-DfkFmApH.js";
1
+ import { Jn as ExternalTextAdapter } from "../../index-DsNwo8dd.js";
2
2
  import { Extension } from "@codemirror/state";
3
3
  type CodeBlockCodeMirrorConfig = Readonly<{
4
4
  language?: string;
@@ -1,5 +1,5 @@
1
- import { vt as EditorCoreStateView } from "./tx-only-1FM45FSj-D40jacZv.js";
2
- import { u as Editor } from "./core-Cqc_KzpG.js";
1
+ import { vt as EditorCoreStateView } from "./tx-only-D8lpB-sT-ZiAbZRMU.js";
2
+ import { u as Editor } from "./core-D8i_gkA6.js";
3
3
  type ComboboxEditor = Pick<Editor, 'plugin'> & {
4
4
  read: Pick<EditorCoreStateView, 'nodes'>;
5
5
  };
@@ -1,5 +1,5 @@
1
- import { h as EditorApplicationSchema } from "../htmlTypes-i_FBCMf2.js";
2
- import { Uo as GeneratedEditorTypeProvider, ct as BasePluginInput, dt as EditorPropertyTypes, nt as EditorCompilation } from "../core-Cqc_KzpG.js";
1
+ import { h as EditorApplicationSchema } from "../htmlTypes-zTLU3aTb.js";
2
+ import { Uo as GeneratedEditorTypeProvider, ct as BasePluginInput, dt as EditorPropertyTypes, nt as EditorCompilation } from "../core-D8i_gkA6.js";
3
3
  /**
4
4
  * Compile nominal plugins and optional application schema into immutable JSON data.
5
5
  * Evaluates configuration, API factories and validators without activating plugins