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.
- package/dist/{AIChatRequestContext-DVGOeWhQ.d.ts → AIChatRequestContext-PbXTTovP.d.ts} +4 -2
- package/dist/{BaseSuggestionPlugin-BRFMMyEo.d.ts → BaseSuggestionPlugin-Dg-cdX26.d.ts} +10 -4
- package/dist/{PlateStatic-DIwBAVqF.d.ts → PlateStatic-CggiBCuD.d.ts} +3 -3
- package/dist/ai/index.d.ts +40 -2
- package/dist/ai/index.js +2 -1
- package/dist/ai/lib/lockedContext.internal.js +105 -0
- package/dist/ai/lib/lockedContext.js +179 -0
- package/dist/ai/react/AIChatPlugin.js +498 -103
- package/dist/ai/react/CopilotPlugin.js +37 -6
- package/dist/ai/react/aiOutputLanding.internal.js +19 -4
- package/dist/ai/react/index.d.ts +42 -9
- package/dist/authored/index.d.ts +4 -4
- package/dist/authored/index.js +2 -2
- package/dist/code-block/codemirror/index.d.ts +1 -1
- package/dist/{combobox-CfCJYKT0.d.ts → combobox-CUUSZR07.d.ts} +2 -2
- package/dist/compiler/index.d.ts +2 -2
- package/dist/{core-Cqc_KzpG.d.ts → core-D8i_gkA6.d.ts} +173 -106
- package/dist/diff/index.d.ts +3 -30
- package/dist/docs/api/core/plate-plugin.md +10 -9
- package/dist/docs/api/core.md +10 -5
- package/dist/docs/api/document-change.md +17 -10
- package/dist/docs/api/react-hooks.md +11 -5
- package/dist/docs/authored-changes.md +9 -6
- package/dist/docs/board.md +5 -4
- package/dist/docs/bold.md +0 -2
- package/dist/docs/document-model.md +3 -3
- package/dist/docs/docx.md +44 -0
- package/dist/docs/editor-methods.md +3 -3
- package/dist/docs/examples/version-history.md +1 -1
- package/dist/docs/footnote.md +80 -28
- package/dist/docs/html.md +10 -5
- package/dist/docs/indent.md +7 -5
- package/dist/docs/ink.md +18 -20
- package/dist/docs/installation/node.md +1 -1
- package/dist/docs/list.md +23 -3
- package/dist/docs/llms.txt +4 -3
- package/dist/docs/lock.md +264 -0
- package/dist/docs/markdown.md +13 -96
- package/dist/docs/plugin-context.md +14 -10
- package/dist/docs/serializing.md +26 -3
- package/dist/docs/static.md +19 -5
- package/dist/docx/export/index.d.ts +3 -3
- package/dist/docx/export/lib/exportDocx.js +58 -12
- package/dist/docx/import/index.d.ts +4 -4
- package/dist/docx/paste/index.d.ts +4 -4
- package/dist/dom/index.d.ts +1 -1
- package/dist/excalidraw/index.d.ts +3 -3
- package/dist/excalidraw/react/index.d.ts +3 -3
- package/dist/facade.js +2 -2
- package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +1 -1
- package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +27 -6
- package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +64 -12
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board/lib/boardTypes.internal.js +3 -0
- package/dist/features/callout/index.d.ts +3 -3
- package/dist/features/callout/lib/BaseCalloutPlugin.js +1 -4
- package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +1 -2
- package/dist/features/combobox/index.d.ts +2 -2
- package/dist/features/combobox/lib/filterWords.js +7 -11
- package/dist/features/comments/index.d.ts +1 -1
- package/dist/features/date/index.d.ts +3 -3
- package/dist/features/details/index.d.ts +4 -3
- package/dist/features/details/lib/BaseDetailsPlugin.js +228 -122
- package/dist/features/field/index.d.ts +1 -1
- package/dist/features/field/lib/BaseFieldPlugin.js +18 -2
- package/dist/features/find/index.d.ts +3 -3
- package/dist/features/footnote/index.d.ts +1 -1
- package/dist/features/footnote/lib/BaseFootnotePlugin.js +9 -2
- package/dist/features/ink/index.d.ts +2 -2
- package/dist/features/ink/lib/BaseInkPlugin.js +118 -82
- package/dist/features/ink/lib/inkMatch.internal.js +79 -78
- package/dist/features/ink/lib/inkPlaces.internal.js +166 -535
- package/dist/features/layout/index.d.ts +1 -1
- package/dist/features/layout/lib/BaseColumnPlugin.js +37 -14
- package/dist/features/link/lib/BaseLinkPlugin.js +38 -3
- package/dist/features/lint/index.d.ts +3 -3
- package/dist/features/list/lib/BaseListPlugin.js +30 -11
- package/dist/features/list/lib/listFamily.internal.js +2 -2
- package/dist/features/list/lib/listHtml.internal.js +1 -0
- package/dist/features/lock/index.d.ts +2 -0
- package/dist/features/lock/index.js +2 -0
- package/dist/features/lock/lib/BaseLockPlugin.js +526 -0
- package/dist/features/media/index.d.ts +1 -1
- package/dist/features/mention/index.d.ts +5 -5
- package/dist/features/suggestion/index.d.ts +1 -1
- package/dist/features/table/index.d.ts +1 -1
- package/dist/features/toc/index.d.ts +1 -1
- package/dist/features/upload/index.d.ts +1 -1
- package/dist/features/upload/lib/BaseUploadPlugin.js +5 -4
- package/dist/history/index.d.ts +2 -2
- package/dist/html/index.d.ts +3 -3
- package/dist/html/server/index.d.ts +1 -1
- package/dist/html/server/index.js +2 -1
- package/dist/html/server/serverCssParser.internal.js +500 -0
- package/dist/html/server/serverCssStyle.internal.js +208 -0
- package/dist/{htmlTypes-i_FBCMf2.d.ts → htmlTypes-zTLU3aTb.d.ts} +9 -13
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/index-0YxPsHwd.d.ts +1 -0
- package/dist/{index-Bv13FX9o.d.ts → index-3CExu_fj.d.ts} +3 -3
- package/dist/{index-CTTjpWgb-Fdrn8NP4.d.ts → index-4PpawhYe-yelJvgk1.d.ts} +1 -1
- package/dist/{index-B4ZhSQdk.d.ts → index-BCYBYfGM.d.ts} +3 -3
- package/dist/{index-CJGkjkH6.d.ts → index-BODDOPEd.d.ts} +1 -1
- package/dist/{index-DNXr_SN-.d.ts → index-BPOa4Z5n.d.ts} +9 -3
- package/dist/{index-Cc2ajXAd.d.ts → index-BSBkt2bm.d.ts} +44 -48
- package/dist/{index-CLNem74G.d.ts → index-BeyI3RUg.d.ts} +42 -39
- package/dist/{index-CmISVYmz.d.ts → index-BisOdLXI.d.ts} +14 -49
- package/dist/{index-CVAHIQ3p.d.ts → index-Bt5YI_JN.d.ts} +4 -4
- package/dist/{index-CrJ9Km8W.d.ts → index-CD_Ym9WQ.d.ts} +2 -2
- package/dist/{index-KteL56rA.d.ts → index-CX_JaDRY.d.ts} +4 -3
- package/dist/{index-BI0NS7kx.d.ts → index-CfK4uv4I.d.ts} +3 -3
- package/dist/{index-By7BkzIN.d.ts → index-CfRUKYCM.d.ts} +2 -2
- package/dist/{index-OMa7dlcS.d.ts → index-Cil7kghY.d.ts} +5 -5
- package/dist/index-D11C0iLb.d.ts +97 -0
- package/dist/{index-CS4G_W_R.d.ts → index-DJW6AjJ6.d.ts} +1 -1
- package/dist/{comparison-types-CsmDG5r2-z1s4gX06.d.ts → index-DM-b6jEe-BqkdOlav.d.ts} +19 -57
- package/dist/{index-1PlYsibA.d.ts → index-DoZhM7nD.d.ts} +3 -3
- package/dist/{index-DfkFmApH.d.ts → index-DsNwo8dd.d.ts} +35 -14
- package/dist/{index-CxG1Atvg.d.ts → index-DuElD_q6.d.ts} +3 -3
- package/dist/{index-BWCC4DCP.d.ts → index-f3aV3Kt-.d.ts} +5 -5
- package/dist/{index-uVbqCpDa.d.ts → index-u_h6ow4e.d.ts} +3 -3
- package/dist/{index-1rcWTB-o.d.ts → index-yZDmK6ab.d.ts} +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/internal/plugin/OverridePlugin.js +22 -3
- package/dist/internal/plugin/blockInsertion.js +4 -4
- package/dist/internal/plugin/collectPlateNodeMappings.js +11 -4
- package/dist/internal/plugin/compilePlainTextMappings.js +2 -0
- package/dist/internal/plugin/plateRuntime.js +7 -1
- package/dist/internal/plugin/resolvePlugin.js +4 -1
- package/dist/internal/plugin/resolvePlugins.js +5 -3
- package/dist/lib/plugins/html/HtmlPlugin.js +32 -13
- package/dist/lib/plugins/html/htmlAst.js +5 -3
- package/dist/lib/plugins/html/htmlDom.js +1 -10
- package/dist/markdown/index.d.ts +2 -2
- package/dist/markdown/index.js +1 -2
- package/dist/markdown/lib/MarkdownPlugin.js +5 -7
- package/dist/markdown/lib/deserializer/convertNodesDeserialize.js +27 -3
- package/dist/markdown/lib/internal/markdownConversion.js +308 -340
- package/dist/markdown/lib/internal/markdownIntrinsics.js +36 -71
- package/dist/markdown/lib/internal/markdownLine.js +2 -4
- package/dist/markdown/lib/internal/markdownMappings.js +21 -3
- package/dist/markdown/lib/internal/markdownSafety.js +101 -1
- package/dist/markdown/lib/internal/markdownTags.js +2 -26
- package/dist/markdown/lib/serializer/convertNodesSerialize.js +5 -3
- package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +1 -10
- package/dist/math/index.d.ts +3 -3
- package/dist/math/react/index.d.ts +4 -4
- package/dist/migrations/documentMigrationSelection.internal.js +107 -2
- package/dist/migrations/documentMigrations.js +17 -112
- package/dist/migrations/index.d.ts +3 -3
- package/dist/migrations/migratePlateV54.js +41 -40
- package/dist/migrations/migratePlateV54Ast.internal.js +143 -55
- package/dist/migrations/migratePlateV54CodeBlocks.internal.js +24 -29
- package/dist/migrations/migratePlateV54Inputs.internal.js +39 -32
- package/dist/migrations/migratePlateV54Profile.internal.js +52 -22
- package/dist/migrations/migratePlateV54Stage.internal.js +127 -0
- package/dist/migrations/migratePlateV54Urls.internal.js +77 -57
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/react/index.d.ts +2 -2
- package/dist/react/components/NodeSelection.js +8 -1
- package/dist/react/components/Plate.js +198 -152
- package/dist/react/components/PlateView.js +1 -1
- package/dist/{static/internal/getPlainText.js → react/components/getPlainText.internal.js} +1 -4
- package/dist/react/components/plate-nodes.js +48 -40
- package/dist/{static/internal/writeStaticSelectionClipboardData.js → react/components/writeStaticSelectionClipboardData.internal.js} +3 -4
- package/dist/react/features/board/BoardShape.js +48 -22
- package/dist/react/features/board/boardConnect.internal.js +0 -9
- package/dist/react/features/board/boardKeys.internal.js +41 -12
- package/dist/react/features/board/boardPicking.internal.js +0 -17
- package/dist/react/features/board/boardResize.internal.js +13 -18
- package/dist/react/features/board/boardView.internal.js +37 -8
- package/dist/react/features/board/boardVoice.internal.js +17 -4
- package/dist/react/features/board/index.d.ts +13 -11
- package/dist/react/features/callout/index.d.ts +3 -3
- package/dist/react/features/combobox/comboboxOwner.internal.js +10 -4
- package/dist/react/features/combobox/index.d.ts +5 -5
- package/dist/react/features/comments/index.d.ts +5 -5
- package/dist/react/features/date/index.d.ts +4 -4
- package/dist/react/features/details/index.d.ts +5 -5
- package/dist/react/features/field/index.d.ts +6 -5
- package/dist/react/features/footnote/index.d.ts +7 -7
- package/dist/react/features/format-painter/index.d.ts +4 -4
- package/dist/react/features/ink/InkContent.js +28 -100
- package/dist/react/features/ink/InkPlugin.js +12 -23
- package/dist/react/features/ink/index.d.ts +29 -102
- package/dist/react/features/ink/index.js +1 -2
- package/dist/react/features/ink/inkCapture.internal.js +97 -61
- package/dist/react/features/ink/inkImages.internal.js +20 -5
- package/dist/react/features/ink/inkMeasure.internal.js +35 -22
- package/dist/react/features/ink/inkPlacement.internal.js +78 -203
- package/dist/react/features/ink/inkWatch.internal.js +1 -32
- package/dist/react/features/layout/index.d.ts +5 -5
- package/dist/react/features/lock/LockPlugin.js +66 -0
- package/dist/react/features/lock/index.d.ts +58 -0
- package/dist/react/features/lock/index.js +2 -0
- package/dist/react/features/media/index.d.ts +5 -5
- package/dist/react/features/mention/index.d.ts +6 -6
- package/dist/react/features/suggestion/index.d.ts +6 -6
- package/dist/react/features/table/index.d.ts +5 -5
- package/dist/react/features/toc/index.d.ts +2 -2
- package/dist/react/features/upload/index.d.ts +5 -5
- package/dist/react/index.d.ts +4 -4
- package/dist/react/utils/pipeRenderElement.internal.js +32 -30
- package/dist/react/virtualized.d.ts +2 -2
- package/dist/{source-Dcgqj5Mf.d.ts → source-B1rLozUs.d.ts} +3 -3
- package/dist/static/components/plite-nodes.js +1 -1
- package/dist/static/index.d.ts +8 -10
- package/dist/static/pluginRenderLeafStatic.internal.js +1 -2
- package/dist/tabbable/index.d.ts +1 -1
- package/dist/tabbable/react/index.d.ts +3 -3
- package/dist/testing/index.d.ts +2 -2
- package/dist/{tx-only-1FM45FSj-D40jacZv.d.ts → tx-only-D8lpB-sT-ZiAbZRMU.d.ts} +133 -59
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/react/index.d.ts +5 -5
- package/package.json +16 -3
- package/dist/features/ink/lib/inkGone.internal.js +0 -290
- package/dist/markdown/lib/RawHtmlPlugin.js +0 -26
- package/dist/markdown/lib/internal/markdownRawHtml.js +0 -353
- 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 = () =>
|
|
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 {
|
|
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
|
-
...
|
|
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 };
|
package/dist/ai/react/index.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
import "../../htmlTypes-
|
|
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-
|
|
4
|
-
import { c as HistoryStateApi, l as HistoryTxApi, n as History, s as HistoryPluginTypeProvider } from "../../index-
|
|
5
|
-
import { a as AIToolName } from "../../AIChatRequestContext-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../../index-
|
|
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;
|
package/dist/authored/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../tx-only-
|
|
2
|
-
import { C as GaveWrite,
|
|
3
|
-
import { t as AuthoredPlugin } from "../index-
|
|
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
|
+
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 };
|
package/dist/authored/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AuthoredPlugin } from "./AuthoredPlugin.js";
|
|
2
|
-
import { AuthoredPlaceError, projectAuthoredDocument, projectAuthoredRange
|
|
3
|
-
export { AuthoredPlaceError, AuthoredPlugin, projectAuthoredDocument, projectAuthoredRange
|
|
2
|
+
import { AuthoredPlaceError, projectAuthoredDocument, projectAuthoredRange } from "plitejs/authored";
|
|
3
|
+
export { AuthoredPlaceError, AuthoredPlugin, projectAuthoredDocument, projectAuthoredRange };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { vt as EditorCoreStateView } from "./tx-only-
|
|
2
|
-
import { u as Editor } from "./core-
|
|
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
|
};
|
package/dist/compiler/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as EditorApplicationSchema } from "../htmlTypes-
|
|
2
|
-
import { Uo as GeneratedEditorTypeProvider, ct as BasePluginInput, dt as EditorPropertyTypes, nt as EditorCompilation } from "../core-
|
|
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
|