platejs 54.0.0-beta.3 → 54.0.0-beta.4
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-DY104TqL.d.ts → AIChatRequestContext-DrUahdTc.d.ts} +2 -2
- package/dist/{BaseSuggestionPlugin-Deo6n6Fs.d.ts → BaseSuggestionPlugin-_7Ka6nY3.d.ts} +4 -4
- package/dist/{PlateStatic-CJX5bKuv.d.ts → PlateStatic-D3Cb-QwH.d.ts} +3 -3
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/react/index.d.ts +9 -9
- package/dist/authored/index.d.ts +3 -3
- package/dist/code-block/codemirror/index.d.ts +1 -1
- package/dist/{combobox-DAOYWuvC.d.ts → combobox-Dr0OYZIE.d.ts} +2 -2
- package/dist/{comparison-types-Dt-unJZY-DCddmbSD.d.ts → comparison-types-DdwE6mYq-BogsHoUO.d.ts} +1 -1
- package/dist/compiler/index.d.ts +2 -2
- package/dist/{core-ClHasORr.d.ts → core-BqR-fEDp.d.ts} +65 -26
- package/dist/diff/index.d.ts +2 -2
- package/dist/docs/api/core/plate-controller.md +1 -1
- package/dist/docs/api/core.md +45 -5
- package/dist/docs/api/dom.md +4 -7
- package/dist/docs/api/react-hooks.md +40 -22
- package/dist/docs/authored-changes.md +4 -2
- package/dist/docs/block-placeholder.md +4 -2
- package/dist/docs/board.md +57 -4
- package/dist/docs/comment.md +2 -2
- package/dist/docs/document-model.md +15 -3
- package/dist/docs/editor.md +50 -4
- package/dist/docs/llms.txt +1 -1
- package/dist/docs/markdown.md +97 -9
- package/dist/docs/plugin-input-rules.md +62 -3
- package/dist/docx/export/index.d.ts +3 -3
- package/dist/docx/export/lib/exportDocx.js +18 -13
- package/dist/docx/export/lib/internal/xml-builder.js +11 -16
- package/dist/docx/export/lib/reviewProjection.js +43 -3
- 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/board/index.d.ts +1 -1
- package/dist/features/callout/index.d.ts +3 -3
- package/dist/features/combobox/index.d.ts +2 -2
- package/dist/features/comments/BaseCommentsPlugin.js +33 -17
- 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 +3 -3
- package/dist/features/details/lib/BaseDetailsPlugin.js +15 -2
- package/dist/features/field/index.d.ts +2 -2
- package/dist/features/field/index.js +4 -2
- package/dist/features/field/lib/BaseFieldPlugin.js +51 -105
- package/dist/features/field/lib/applyFieldValues.js +188 -0
- package/dist/features/field/lib/fieldRules.internal.js +169 -7
- package/dist/features/find/index.d.ts +3 -3
- package/dist/features/footnote/index.d.ts +1 -1
- package/dist/features/ink/index.d.ts +1 -1
- package/dist/features/ink/lib/inkGone.internal.js +6 -6
- package/dist/features/ink/lib/inkPlaces.internal.js +8 -9
- package/dist/features/layout/index.d.ts +1 -1
- package/dist/features/lint/index.d.ts +3 -3
- package/dist/features/media/index.d.ts +2 -2
- package/dist/features/media/index.js +2 -2
- package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +200 -2
- 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/table/lib/BaseTablePlugin.js +50 -7
- package/dist/features/toc/index.d.ts +1 -1
- package/dist/features/upload/index.d.ts +1 -1
- 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/{htmlTypes-cg_cWsaN.d.ts → htmlTypes-eT2ZGDAj.d.ts} +1 -1
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/{index-D3-2iM1b.d.ts → index-B33E1CRJ.d.ts} +291 -4
- package/dist/{index-DKOFvteF.d.ts → index-B7moSod7.d.ts} +1 -1
- package/dist/{index-C9DiGDVj.d.ts → index-B8-5Sr7I.d.ts} +2 -2
- package/dist/{index-CzLwBZpY.d.ts → index-B8QJDAmG.d.ts} +2 -2
- package/dist/{index-Cmuluh6f.d.ts → index-BTx5oK7k.d.ts} +1 -1
- package/dist/{index-DPWyk3lG-DOYwohXO.d.ts → index-BWPcE4ac-Cto_IsNs.d.ts} +7 -1
- package/dist/{index-DpltOCot-A2b3p3Eb.d.ts → index-BXjLmx1n-CXk17buG.d.ts} +75 -27
- package/dist/{index-C6ql9pKw.d.ts → index-BXwU9QH6.d.ts} +2 -2
- package/dist/{index-CLsEe3LY.d.ts → index-BkwR-5hH.d.ts} +3 -3
- package/dist/{index-BZWFoUXt.d.ts → index-BsV2McRr.d.ts} +5 -5
- package/dist/{index-DQnjqtQa.d.ts → index-C9Fu-P4E.d.ts} +116 -21
- package/dist/{index-oIJAZxc2.d.ts → index-Ca48r1ng.d.ts} +3 -3
- package/dist/{index-Do9pj1GK.d.ts → index-Cob_iBdu.d.ts} +47 -6
- package/dist/{index-C1_JIhL4.d.ts → index-CpY7Xnxw.d.ts} +4 -4
- package/dist/{index-baQOK89E.d.ts → index-DNQXzU-X.d.ts} +1 -1
- package/dist/{index-8WO2vI0U.d.ts → index-DPowErHa.d.ts} +18 -20
- package/dist/{index-B5mYEawV.d.ts → index-DShbzec2.d.ts} +5 -6
- package/dist/{index-C35V_hj0.d.ts → index-DYdObeFQ.d.ts} +3 -3
- package/dist/{index-HPYawTae-BCUQLEWF.d.ts → index-Dq3Jlj8O-BJ6NxZm0.d.ts} +1 -1
- package/dist/{index-CdOLsPaW.d.ts → index-DwWQVwQt.d.ts} +3 -5
- package/dist/{index-r7yb77Wy.d.ts → index-JWgwL5l3.d.ts} +5 -3
- package/dist/{index-CktYvOgk.d.ts → index-M781pyx9.d.ts} +4 -4
- package/dist/{index-C0POz7rg.d.ts → index-d7io3MzC.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/lib/plugins/element-id/ElementIdPlugin.js +6 -16
- package/dist/lib/plugins/input-rules/InputRulesPlugin.js +73 -14
- package/dist/markdown/index.d.ts +2 -2
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/lib/MarkdownPlugin.js +8 -12
- package/dist/markdown/lib/RawHtmlPlugin.js +4 -2
- package/dist/markdown/lib/internal/markdownConversion.js +7 -4
- package/dist/markdown/lib/internal/markdownFootnoteWriter.js +35 -0
- package/dist/markdown/lib/internal/markdownRawHtml.js +40 -1
- package/dist/markdown/lib/internal/markdownTags.js +7 -1
- package/dist/math/index.d.ts +3 -3
- package/dist/math/react/index.d.ts +4 -4
- package/dist/migrations/index.d.ts +3 -3
- package/dist/migrations/migratePlateV54.js +4 -6
- package/dist/migrations/migratePlateV54RetiredMarks.internal.js +23 -8
- package/dist/migrations/migratePlateV54Suggestions.internal.js +2 -2
- package/dist/migrations/v53-manifest.internal.js +4 -0
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/react/index.d.ts +2 -2
- package/dist/react/components/EditorContentView.internal.js +26 -16
- package/dist/react/components/Plate.js +13 -20
- package/dist/react/features/board/boardExport.internal.js +470 -0
- package/dist/react/features/board/boardPictureStyles.internal.js +415 -0
- package/dist/react/features/board/boardView.internal.js +11 -6
- package/dist/react/features/board/index.d.ts +50 -6
- package/dist/react/features/callout/index.d.ts +3 -3
- package/dist/react/features/combobox/index.d.ts +5 -5
- package/dist/react/features/comments/index.d.ts +6 -6
- package/dist/react/features/date/index.d.ts +4 -4
- package/dist/react/features/details/index.d.ts +4 -4
- package/dist/react/features/field/FieldPlugin.js +5 -4
- package/dist/react/features/field/index.d.ts +19 -16
- 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/index.d.ts +5 -9
- package/dist/react/features/ink/inkPlacement.internal.js +2 -1
- package/dist/react/features/layout/index.d.ts +5 -5
- 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 +7 -6
- package/dist/react/features/table/useTableResize.js +10 -1
- 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 +6 -6
- package/dist/react/internal/plate-context.js +20 -11
- package/dist/react/stores/plate/useEditorSelector.js +22 -9
- package/dist/react/utils/BlockPlaceholderPlugin.js +5 -2
- package/dist/react/virtualized.d.ts +2 -2
- package/dist/{source-aUwpNnAw.d.ts → source-BGohy8vH.d.ts} +3 -3
- package/dist/static/index.d.ts +5 -5
- 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/yjs/index.d.ts +1 -1
- package/dist/yjs/react/index.d.ts +5 -5
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentChange, ElementApi, afterActiveTransactionEnds, canonicalRecordJson, getActiveEditorUpdateId, getDocumentValueNode, getEditorRuntimeOwner, getRecordSetVersion, readRecord, readShownRecords, recordSetChanges } from "../../../facade.js";
|
|
1
|
+
import { DocumentChange, ElementApi, afterActiveTransactionEnds, canonicalRecordJson, getActiveEditorUpdateId, getDocumentValueNode, getEditorRuntimeOwner, getRecordSetVersion, readElementById, readRecord, readShownRecords, recordSetChanges } from "../../../facade.js";
|
|
2
2
|
//#region src/features/ink/lib/inkGone.internal.ts
|
|
3
3
|
const COPIES = "ink-copies";
|
|
4
4
|
const GONE = "ink-gone";
|
|
@@ -208,7 +208,7 @@ const captureGone = (editor, tx, after, [gap, id], memo) => {
|
|
|
208
208
|
const names = namedInkBlocks(editor);
|
|
209
209
|
const { pending, queued } = session;
|
|
210
210
|
const walk = {
|
|
211
|
-
holder: (block) => tx.
|
|
211
|
+
holder: (block) => readElementById(tx.nodes, block) ?? void 0,
|
|
212
212
|
record: (block) => pending.get(block) ?? savedGone(editor, block)
|
|
213
213
|
};
|
|
214
214
|
const gone = (block) => !walk.holder(block);
|
|
@@ -257,7 +257,7 @@ const flushGone = (editor, tx) => {
|
|
|
257
257
|
if (!session) return;
|
|
258
258
|
const { pending } = session;
|
|
259
259
|
session.pending = /* @__PURE__ */ new Map();
|
|
260
|
-
writeGone(editor, tx, pending.keys(), (id) => tx.
|
|
260
|
+
writeGone(editor, tx, pending.keys(), (id) => readElementById(tx.nodes, id) ? void 0 : pending.get(id), (saved, place) => !sameGone(saved, place));
|
|
261
261
|
};
|
|
262
262
|
const addGone = (editor, tx, copies) => {
|
|
263
263
|
const blocks = copies.map(({ record }) => record.block);
|
|
@@ -266,8 +266,8 @@ const addGone = (editor, tx, copies) => {
|
|
|
266
266
|
const recent = session?.recent ?? [];
|
|
267
267
|
const standing = /* @__PURE__ */ new Map();
|
|
268
268
|
const stand = (id) => {
|
|
269
|
-
const holder = tx.
|
|
270
|
-
if (holder
|
|
269
|
+
const holder = readElementById(tx.nodes, id);
|
|
270
|
+
if (!holder || holder.root !== void 0 || standing.has(id)) return;
|
|
271
271
|
const { path } = holder;
|
|
272
272
|
const value = tx.value();
|
|
273
273
|
const past = [...path.slice(0, -1), (path.at(-1) ?? 0) + 1];
|
|
@@ -279,7 +279,7 @@ const addGone = (editor, tx, copies) => {
|
|
|
279
279
|
}
|
|
280
280
|
writeGone(editor, tx, standing.keys(), (id) => standing.get(id), (saved, place) => !sameGone(saved, place));
|
|
281
281
|
writeGone(editor, tx, blocks, (id) => {
|
|
282
|
-
if (tx.
|
|
282
|
+
if (readElementById(tx.nodes, id)) return void 0;
|
|
283
283
|
const departure = current?.get(id) ?? (session?.kept.has(id) ? void 0 : recent.findLast((run) => run.departed.has(id))?.departed.get(id));
|
|
284
284
|
return departure ? gapPlace(...departure) : session?.kept.get(id)?.place;
|
|
285
285
|
}, (saved) => saved === void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementApi, getActiveEditorUpdateId, getDocumentValueNode, getEditorCommitNode, getEditorCommitValue, getEditorRuntimeOwner, getRecordSetVersion, getSnapshotVersion, getValueRecords, readShownDocument, readShownRecords, recordSetChanges, withStoredAuthoredRead } from "../../../facade.js";
|
|
1
|
+
import { ElementApi, MAIN_ROOT_KEY, getActiveEditorUpdateId, getDocumentValueNode, getEditorCommitNode, getEditorCommitValue, getEditorRuntimeOwner, getRecordSetVersion, getSnapshotVersion, getValueRecords, readElementById, readShownDocument, readShownRecords, recordSetChanges, withStoredAuthoredRead } from "../../../facade.js";
|
|
2
2
|
import { COPIES, GONE, MARKS, besideAt, goneIn, idOf, reachGone, walkGone } from "./inkGone.internal.js";
|
|
3
3
|
import { inkText } from "./inkMatch.internal.js";
|
|
4
4
|
//#region src/features/ink/lib/inkPlaces.internal.ts
|
|
@@ -133,12 +133,11 @@ const moveGroup = (places, group, place, anchor) => {
|
|
|
133
133
|
};
|
|
134
134
|
const holderIn = (state, id) => {
|
|
135
135
|
metrics.holders += 1;
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
root: holder.root
|
|
136
|
+
const entry = readElementById(state.nodes, id);
|
|
137
|
+
return entry ? {
|
|
138
|
+
key: entry.key,
|
|
139
|
+
node: entry.node,
|
|
140
|
+
root: entry.root ?? MAIN_ROOT_KEY
|
|
142
141
|
} : void 0;
|
|
143
142
|
};
|
|
144
143
|
const keptHolderIn = (commit, holder) => {
|
|
@@ -213,7 +212,7 @@ const startEpoch = (places) => {
|
|
|
213
212
|
for (const group of [...places.groups.values()]) if (group.place.kind === "gone") dissolve(places, group);
|
|
214
213
|
};
|
|
215
214
|
const walkIn = (state, gone) => ({
|
|
216
|
-
holder: (id) => state.
|
|
215
|
+
holder: (id) => readElementById(state.nodes, id) ?? void 0,
|
|
217
216
|
record: (id) => goneIn(gone, id)
|
|
218
217
|
});
|
|
219
218
|
const goneGroupOf = (places, read, id) => {
|
|
@@ -237,7 +236,7 @@ const reanchor = (places, state, gone, group) => {
|
|
|
237
236
|
const { anchor, place } = group;
|
|
238
237
|
if (!anchor || place.kind !== "gone" || place.beside.at === "start") return;
|
|
239
238
|
metrics.holders += 1;
|
|
240
|
-
const holder = state.
|
|
239
|
+
const holder = readElementById(state.nodes, anchor.id);
|
|
241
240
|
const memo = {
|
|
242
241
|
...places.chainEnds,
|
|
243
242
|
walked: places.walked
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ColumnGroupElement, i as ColumnElement, n as BaseColumnItemPlugin, o as SetColumnsOptions, r as ColumnDefinition, s as ToggleColumnGroupOptions, t as BaseColumnGroupPlugin } from "../../index-
|
|
1
|
+
import { a as ColumnGroupElement, i as ColumnElement, n as BaseColumnItemPlugin, o as SetColumnsOptions, r as ColumnDefinition, s as ToggleColumnGroupOptions, t as BaseColumnGroupPlugin } from "../../index-d7io3MzC.js";
|
|
2
2
|
export { BaseColumnGroupPlugin, BaseColumnItemPlugin, ColumnDefinition, ColumnElement, ColumnGroupElement, SetColumnsOptions, ToggleColumnGroupOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../htmlTypes-
|
|
3
|
-
import { _ as BasePlugin, u as Editor } from "../../core-
|
|
1
|
+
import { Ci as Element, iu as TxDeclaredMethod } from "../../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "../../htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { _ as BasePlugin, u as Editor } from "../../core-BqR-fEDp.js";
|
|
4
4
|
type LintFinding = Readonly<{
|
|
5
5
|
id: string;
|
|
6
6
|
ruleId: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { AlignedMediaInsertInput, AudioElement, AudioPluginState, BaseAudioPlugin, BaseFilePlugin, BaseImagePlugin, BaseMediaEmbedPlugin, BaseVideoPlugin, EmbedUrlData, EmbedUrlParser, FileElement, FileInsertInput, FilePluginState, ImageDefinition, ImageElement, ImageInsertInput, ImagePluginState, MediaEmbedDefinition, MediaEmbedElement, MediaEmbedPluginState, MediaInsertInput, MediaPluginState, MediaUrlKind, MediaUrlProperties, ProviderMediaInsertInput, ResizableElement, VIDEO_PROVIDERS, VideoElement, VideoPluginState, defineMediaPlugin, mediaElementProperties, parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl };
|
|
1
|
+
import { A as MediaUrlProperties, C as FileElement, D as MediaInsertInput, E as ImageInsertInput, F as defineMediaPlugin, I as mediaElementProperties, M as ResizableElement, N as VideoElement, O as MediaPluginState, P as VideoPluginState, S as BaseVideoPlugin, T as FilePluginState, _ as AlignedMediaInsertInput, a as MediaEmbedRules, b as BaseAudioPlugin, c as VIDEO_PROVIDERS, d as parseTwitterUrl, f as parseVideoUrl, g as ImagePluginState, h as ImageElement, i as MediaEmbedPluginState, j as ProviderMediaInsertInput, k as MediaUrlKind, l as parseIframeUrl, m as ImageDefinition, n as MediaEmbedDefinition, o as EmbedUrlData, p as BaseImagePlugin, r as MediaEmbedElement, s as EmbedUrlParser, t as BaseMediaEmbedPlugin, u as parseMediaUrl, v as AudioElement, w as FileInsertInput, x as BaseFilePlugin, y as AudioPluginState } from "../../index-B33E1CRJ.js";
|
|
2
|
+
export { AlignedMediaInsertInput, AudioElement, AudioPluginState, BaseAudioPlugin, BaseFilePlugin, BaseImagePlugin, BaseMediaEmbedPlugin, BaseVideoPlugin, EmbedUrlData, EmbedUrlParser, FileElement, FileInsertInput, FilePluginState, ImageDefinition, ImageElement, ImageInsertInput, ImagePluginState, MediaEmbedDefinition, MediaEmbedElement, MediaEmbedPluginState, MediaEmbedRules, MediaInsertInput, MediaPluginState, MediaUrlKind, MediaUrlProperties, ProviderMediaInsertInput, ResizableElement, VIDEO_PROVIDERS, VideoElement, VideoPluginState, defineMediaPlugin, mediaElementProperties, parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseAudioPlugin, BaseFilePlugin, BaseVideoPlugin, defineMediaPlugin, mediaElementProperties } from "./lib/BaseMediaPlugin.js";
|
|
2
2
|
import { BaseImagePlugin } from "./lib/image/BaseImagePlugin.js";
|
|
3
3
|
import { VIDEO_PROVIDERS, parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl } from "./lib/media/parseMediaUrl.js";
|
|
4
|
-
import { BaseMediaEmbedPlugin } from "./lib/media-embed/BaseMediaEmbedPlugin.js";
|
|
5
|
-
export { BaseAudioPlugin, BaseFilePlugin, BaseImagePlugin, BaseMediaEmbedPlugin, BaseVideoPlugin, VIDEO_PROVIDERS, defineMediaPlugin, mediaElementProperties, parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl };
|
|
4
|
+
import { BaseMediaEmbedPlugin, MediaEmbedRules } from "./lib/media-embed/BaseMediaEmbedPlugin.js";
|
|
5
|
+
export { BaseAudioPlugin, BaseFilePlugin, BaseImagePlugin, BaseMediaEmbedPlugin, BaseVideoPlugin, MediaEmbedRules, VIDEO_PROVIDERS, defineMediaPlugin, mediaElementProperties, parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { getActiveCommandEditor, readAuthoredView } from "../../../../facade.js";
|
|
1
2
|
import { decideUrl, isStoredUrl } from "../../../../internal/utils/urlPolicy.js";
|
|
2
3
|
import { definePlugin } from "../../../../lib/plugin/definePlugin.js";
|
|
4
|
+
import { DOMPlugin } from "../../../../lib/plugins/dom/DOMPlugin.js";
|
|
5
|
+
import { defineInputRule } from "../../../../lib/plugins/input-rules/defineInputRule.js";
|
|
3
6
|
import { PLUGINS } from "../../../../utils/plate-keys.js";
|
|
4
|
-
import { property, schema } from "../../../../core.js";
|
|
7
|
+
import { ElementApi, PathApi, RangeApi, SelectionApi, TextApi, property, schema } from "../../../../core.js";
|
|
5
8
|
import { readHtmlMediaProvider, readHtmlMediaWidth, writeHtmlMediaProvider, writeHtmlMediaWidth } from "../mediaHtml.internal.js";
|
|
6
9
|
import { defineMediaPlugin, mediaElementProperties } from "../BaseMediaPlugin.js";
|
|
7
10
|
import { parseIframeUrl, parseMediaUrl, parseTwitterUrl, parseVideoUrl } from "../media/parseMediaUrl.js";
|
|
@@ -136,5 +139,200 @@ const BaseMediaEmbedPlugin = definePlugin(PLUGINS.mediaEmbed, {
|
|
|
136
139
|
url: normalized?.url ?? transformedUrl
|
|
137
140
|
};
|
|
138
141
|
}));
|
|
142
|
+
const hasOnlyKeys = (node, keys) => Object.keys(node).every((key) => keys.includes(key));
|
|
143
|
+
const BARE_BLOCK_KEYS = [
|
|
144
|
+
"children",
|
|
145
|
+
"id",
|
|
146
|
+
"type"
|
|
147
|
+
];
|
|
148
|
+
const BARE_LINK_KEYS = [
|
|
149
|
+
"children",
|
|
150
|
+
"id",
|
|
151
|
+
"type",
|
|
152
|
+
"url"
|
|
153
|
+
];
|
|
154
|
+
const YOUTUBE_ID = /^[\w-]{11}$/;
|
|
155
|
+
const NUMERIC_ID = /^\d+$/;
|
|
156
|
+
const ALPHANUMERIC_ID = /^[a-z\d]+$/i;
|
|
157
|
+
const PREFIXED_HOSTS = /* @__PURE__ */ new Set([
|
|
158
|
+
"coub.com",
|
|
159
|
+
"dailymotion.com",
|
|
160
|
+
"twitter.com",
|
|
161
|
+
"vimeo.com",
|
|
162
|
+
"x.com",
|
|
163
|
+
"youtube.com"
|
|
164
|
+
]);
|
|
165
|
+
const isBareBlock = (node, type) => ElementApi.isElement(node) && node.type === type && hasOnlyKeys(node, BARE_BLOCK_KEYS);
|
|
166
|
+
const readYoutubeId = (host, path, url) => {
|
|
167
|
+
if (host === "youtu.be") return path.length === 1 ? path[0] : void 0;
|
|
168
|
+
if (host !== "youtube.com") return void 0;
|
|
169
|
+
if (path.length === 1 && path[0] === "watch") return url.searchParams.get("v") ?? void 0;
|
|
170
|
+
return path.length === 2 && [
|
|
171
|
+
"embed",
|
|
172
|
+
"live",
|
|
173
|
+
"shorts"
|
|
174
|
+
].includes(path[0]) ? path[1] : void 0;
|
|
175
|
+
};
|
|
176
|
+
const readTweetId = (path) => {
|
|
177
|
+
const status = path[0] === "i" && path[1] === "web" ? path.slice(2) : path.slice(1);
|
|
178
|
+
return /^\w+$/.test(path[0] ?? "") && status[0] === "status" && (status.length === 2 || status.length === 4 && ["photo", "video"].includes(status[2]) && NUMERIC_ID.test(status[3])) ? status[1] : void 0;
|
|
179
|
+
};
|
|
180
|
+
const readExactProviderLink = (text) => {
|
|
181
|
+
let url;
|
|
182
|
+
try {
|
|
183
|
+
url = new URL(text);
|
|
184
|
+
} catch {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (url.href.toLowerCase() !== text.toLowerCase() || url.protocol !== "https:" && url.protocol !== "http:" || url.username || url.password || url.port) return;
|
|
188
|
+
const bareHost = url.hostname.replace(/^(?:m|mobile|www)\./, "");
|
|
189
|
+
const host = PREFIXED_HOSTS.has(bareHost) ? bareHost : url.hostname;
|
|
190
|
+
const path = url.pathname.slice(1).replace(/\/$/, "").split("/");
|
|
191
|
+
if (path.includes("")) return void 0;
|
|
192
|
+
const youtube = readYoutubeId(host, path, url);
|
|
193
|
+
if (youtube !== void 0) {
|
|
194
|
+
const start = url.searchParams.get("t") ?? url.searchParams.get("start") ?? new URLSearchParams(url.hash.slice(1)).get("t");
|
|
195
|
+
return YOUTUBE_ID.test(youtube) && youtube.toLowerCase() !== "videoseries" ? {
|
|
196
|
+
id: youtube,
|
|
197
|
+
provider: "youtube",
|
|
198
|
+
url: `https://www.youtube.com/watch?v=${youtube}${start ? `&t=${encodeURIComponent(start)}` : ""}`
|
|
199
|
+
} : void 0;
|
|
200
|
+
}
|
|
201
|
+
const [first, second] = path;
|
|
202
|
+
if (host === "vimeo.com" && path.length === 1 && NUMERIC_ID.test(first) || host === "player.vimeo.com" && path.length === 2 && first === "video" && NUMERIC_ID.test(second)) {
|
|
203
|
+
const id = host === "vimeo.com" ? first : second;
|
|
204
|
+
return {
|
|
205
|
+
id,
|
|
206
|
+
provider: "vimeo",
|
|
207
|
+
url: `https://vimeo.com/${id}`
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
if (host === "dailymotion.com" && path.length === 2 && first === "video" && ALPHANUMERIC_ID.test(second) || host === "dai.ly" && path.length === 1 && ALPHANUMERIC_ID.test(first)) {
|
|
211
|
+
const id = host === "dai.ly" ? first : second;
|
|
212
|
+
return {
|
|
213
|
+
id,
|
|
214
|
+
provider: "dailymotion",
|
|
215
|
+
url: `https://www.dailymotion.com/video/${id}`
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
const youku = host === "v.youku.com" && path.length === 2 && first === "v_show" ? /^id_([a-z\d]+)(?:==)?\.html$/i.exec(second)?.[1] : void 0;
|
|
219
|
+
if (youku) return {
|
|
220
|
+
id: youku,
|
|
221
|
+
provider: "youku",
|
|
222
|
+
url: `https://v.youku.com/v_show/id_${youku}.html`
|
|
223
|
+
};
|
|
224
|
+
if (host === "coub.com" && path.length === 2 && (first === "view" || first === "embed") && ALPHANUMERIC_ID.test(second)) return {
|
|
225
|
+
id: second,
|
|
226
|
+
provider: "coub",
|
|
227
|
+
url: `https://coub.com/view/${second}`
|
|
228
|
+
};
|
|
229
|
+
const tweet = host === "x.com" || host === "twitter.com" ? readTweetId(path) : void 0;
|
|
230
|
+
return tweet !== void 0 && NUMERIC_ID.test(tweet) ? {
|
|
231
|
+
id: tweet,
|
|
232
|
+
provider: "twitter",
|
|
233
|
+
url: `https://x.com/i/status/${tweet}`
|
|
234
|
+
} : void 0;
|
|
235
|
+
};
|
|
236
|
+
const SCHEME = /[a-z][a-z\d+.-]*:/gi;
|
|
237
|
+
const LEADING_SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
238
|
+
const schemesIn = (text) => text.match(SCHEME)?.length ?? 0;
|
|
239
|
+
const isOneLink = (text) => schemesIn(text) === 1 && LEADING_SCHEME.test(text);
|
|
240
|
+
const holdsOneLink = (url) => {
|
|
241
|
+
const [beforeFragment, ...fragment] = url.split("#");
|
|
242
|
+
const [address, ...query] = beforeFragment.split("?");
|
|
243
|
+
return isOneLink(address) && schemesIn(fragment.join("#")) === 0 && query.join("?").split("&").every((param) => {
|
|
244
|
+
const [key, ...rest] = param.split("=");
|
|
245
|
+
const value = rest.join("=");
|
|
246
|
+
return schemesIn(key) === 0 && (schemesIn(value) === 0 || isOneLink(value));
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
const editsPlainly = (view) => {
|
|
250
|
+
const authored = readAuthoredView(view);
|
|
251
|
+
return !authored || !("preview" in authored) && authored.intent !== "propose";
|
|
252
|
+
};
|
|
253
|
+
const readPastedLink = (text) => {
|
|
254
|
+
const url = text.replace(/^[ \t]+|[ \t]+$/g, "");
|
|
255
|
+
return url && holdsOneLink(url) ? readExactProviderLink(url) : void 0;
|
|
256
|
+
};
|
|
257
|
+
const isBareText = (node) => TextApi.isText(node) && hasOnlyKeys(node, ["text"]);
|
|
258
|
+
const isBareLink = (node, linkType) => {
|
|
259
|
+
if (!ElementApi.isElement(node) || node.type !== linkType || typeof node.url !== "string" || !hasOnlyKeys(node, BARE_LINK_KEYS)) return false;
|
|
260
|
+
const [leaf, ...rest] = node.children;
|
|
261
|
+
return rest.length === 0 && isBareText(leaf) && leaf.text === node.url;
|
|
262
|
+
};
|
|
263
|
+
const bareLineText = (children, linkType) => {
|
|
264
|
+
let link;
|
|
265
|
+
let text = "";
|
|
266
|
+
for (const child of children) {
|
|
267
|
+
if (isBareText(child)) {
|
|
268
|
+
text += child.text;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (link !== void 0 || !isBareLink(child, linkType)) return void 0;
|
|
272
|
+
link = child.url;
|
|
273
|
+
}
|
|
274
|
+
if (link === void 0) return text;
|
|
275
|
+
return link !== "" && /^[ \t]*$/.test(text) ? link : void 0;
|
|
276
|
+
};
|
|
277
|
+
const pasteAutoEmbedRule = (options = {}) => defineInputRule(BaseMediaEmbedPlugin, {
|
|
278
|
+
...options,
|
|
279
|
+
target: "insertData",
|
|
280
|
+
resolve: ({ data, editor, text }) => {
|
|
281
|
+
const link = text ? readPastedLink(text) : void 0;
|
|
282
|
+
const selection = editor.read.selection();
|
|
283
|
+
const view = getActiveCommandEditor();
|
|
284
|
+
const paragraph = editor.plugin(PLUGINS.paragraph);
|
|
285
|
+
if (!link || !paragraph.installed || !editsPlainly(view) || !selection || !RangeApi.isCollapsed(selection) || editor.read.selection.nodes().length > 0 || selection.anchor.root !== view.read.view.root()) return;
|
|
286
|
+
const block = editor.read.nodes.block({ at: selection });
|
|
287
|
+
const linkPlugin = editor.plugin(PLUGINS.link);
|
|
288
|
+
const linkType = linkPlugin.installed ? linkPlugin.schema.type : void 0;
|
|
289
|
+
const paragraphType = paragraph.schema.type;
|
|
290
|
+
if (!block || !isBareBlock(block[0], paragraphType) || bareLineText(block[0].children, linkType) !== "" || editor.plugin(DOMPlugin).api.clipboard.readSlice(data).kind === "slice") return;
|
|
291
|
+
return {
|
|
292
|
+
id: link.id,
|
|
293
|
+
key: editor.key(block[0]),
|
|
294
|
+
linkType,
|
|
295
|
+
paragraphType,
|
|
296
|
+
provider: link.provider,
|
|
297
|
+
root: SelectionApi.root(selection),
|
|
298
|
+
view
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
followUp: ({ tx }, match) => {
|
|
302
|
+
const entry = tx.nodes.get(match.key);
|
|
303
|
+
if (!entry || !editsPlainly(match.view) || SelectionApi.root(tx.selection()) === match.root && tx.selection.nodes().some(([, path]) => PathApi.isAncestor(entry[1], path))) return;
|
|
304
|
+
const [block] = entry;
|
|
305
|
+
if (!isBareBlock(block, match.paragraphType)) return;
|
|
306
|
+
const text = bareLineText(block.children, match.linkType);
|
|
307
|
+
const link = text === void 0 ? void 0 : readPastedLink(text);
|
|
308
|
+
if (link?.provider !== match.provider || link.id !== match.id) return;
|
|
309
|
+
if (!tx.mediaEmbed.insert({ url: link.url }, {
|
|
310
|
+
before: match.key,
|
|
311
|
+
select: false
|
|
312
|
+
})) return;
|
|
313
|
+
const line = tx.nodes.get(match.key);
|
|
314
|
+
const start = tx.points.start(match.key);
|
|
315
|
+
if (!line || !start) return;
|
|
316
|
+
const selection = tx.selection();
|
|
317
|
+
const onLine = (point) => point.root === start.root && PathApi.isAncestor(line[1], point.path);
|
|
318
|
+
const textSelectionOnLine = selection && "anchor" in selection && tx.selection.nodes().length === 0 && (onLine(selection.anchor) || onLine(selection.focus)) ? selection : void 0;
|
|
319
|
+
const newSelection = textSelectionOnLine && SelectionApi.text({
|
|
320
|
+
anchor: onLine(textSelectionOnLine.anchor) ? start : textSelectionOnLine.anchor,
|
|
321
|
+
focus: onLine(textSelectionOnLine.focus) ? start : textSelectionOnLine.focus
|
|
322
|
+
});
|
|
323
|
+
tx.nodes.replaceChildren([{ text: "" }], {
|
|
324
|
+
at: match.key,
|
|
325
|
+
...newSelection ? { newSelection } : {}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
/** Input rules that turn a pasted provider link into a media embed. */
|
|
330
|
+
const MediaEmbedRules = {
|
|
331
|
+
/**
|
|
332
|
+
* A provider link pasted alone on an empty paragraph becomes a media embed
|
|
333
|
+
* above that paragraph, as its own undo step after the paste. The paragraph
|
|
334
|
+
* stays, empty.
|
|
335
|
+
*/
|
|
336
|
+
autoEmbed: ({ variant: _, ...options }) => pasteAutoEmbedRule(options) };
|
|
139
337
|
//#endregion
|
|
140
|
-
export { BaseMediaEmbedPlugin };
|
|
338
|
+
export { BaseMediaEmbedPlugin, MediaEmbedRules };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../htmlTypes-
|
|
3
|
-
import {
|
|
4
|
-
import { n as ComboboxState, t as ComboboxEditor } from "../../combobox-
|
|
5
|
-
import "../../index-
|
|
1
|
+
import { fs as PropertyValueOptions, iu as TxDeclaredMethod, ji as ElementOf, ss as PropertyStringDescriptor } from "../../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "../../htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { _ as BasePlugin, _t as NodeInsertOptions, qa as DefinitionOf } from "../../core-BqR-fEDp.js";
|
|
4
|
+
import { n as ComboboxState, t as ComboboxEditor } from "../../combobox-Dr0OYZIE.js";
|
|
5
|
+
import "../../index-BTx5oK7k.js";
|
|
6
6
|
declare const isNonBlankRef: (value: unknown) => value is string;
|
|
7
7
|
type TMentionItemBase<TRef = string> = {
|
|
8
8
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseSuggestionPlugin } from "../../BaseSuggestionPlugin-
|
|
1
|
+
import { t as BaseSuggestionPlugin } from "../../BaseSuggestionPlugin-_7Ka6nY3.js";
|
|
2
2
|
/** How many palette slots the copied suggestion kit paints. */
|
|
3
3
|
declare const SUGGESTION_COLOR_COUNT = 7;
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as TableSelectionBounds, C as TableResize, D as TableResolvedCellBorders, E as TableResolvedCellBorder, O as TableRowHeightOptions, S as TableNodeTarget, T as TableResizeTarget, _ as TableCellInfo, a as TableDefinition, b as TableColumnWidthOptions, c as TableRowElement, d as TableAxisInsertOptions, f as TableBorderState, g as TableCellBorders, h as TableCellBorder, i as TableCellElement, j as TableTargetOptions, k as TableSelection, m as TableBorderTarget, n as BaseTablePlugin, o as TableElement, p as TableBorderStates, r as BaseTableRowPlugin, s as TablePluginState, t as BaseTableCellPlugin, u as BorderDirection, v as TableCellTarget, w as TableResizeOptions, x as TableCreateOptions, y as TableColumnResize } from "../../index-
|
|
1
|
+
import { A as TableSelectionBounds, C as TableResize, D as TableResolvedCellBorders, E as TableResolvedCellBorder, O as TableRowHeightOptions, S as TableNodeTarget, T as TableResizeTarget, _ as TableCellInfo, a as TableDefinition, b as TableColumnWidthOptions, c as TableRowElement, d as TableAxisInsertOptions, f as TableBorderState, g as TableCellBorders, h as TableCellBorder, i as TableCellElement, j as TableTargetOptions, k as TableSelection, m as TableBorderTarget, n as BaseTablePlugin, o as TableElement, p as TableBorderStates, r as BaseTableRowPlugin, s as TablePluginState, t as BaseTableCellPlugin, u as BorderDirection, v as TableCellTarget, w as TableResizeOptions, x as TableCreateOptions, y as TableColumnResize } from "../../index-JWgwL5l3.js";
|
|
2
2
|
export { BaseTableCellPlugin, BaseTablePlugin, BaseTableRowPlugin, BorderDirection, TableAxisInsertOptions, TableBorderState, TableBorderStates, TableBorderTarget, TableCellBorder, TableCellBorders, TableCellElement, TableCellInfo, TableCellTarget, TableColumnResize, TableColumnWidthOptions, TableCreateOptions, TableDefinition, TableElement, TableNodeTarget, TablePluginState, TableResize, TableResizeOptions, TableResizeTarget, TableResolvedCellBorder, TableResolvedCellBorders, TableRowElement, TableRowHeightOptions, TableSelection, TableSelectionBounds, TableTargetOptions };
|
|
@@ -6,6 +6,7 @@ import { DebugPlugin } from "../../../lib/plugins/debug/DebugPlugin.js";
|
|
|
6
6
|
import { BaseParagraphPlugin } from "../../../lib/plugins/paragraph/BaseParagraphPlugin.js";
|
|
7
7
|
import { PLUGINS } from "../../../utils/plate-keys.js";
|
|
8
8
|
import { ContentSlice, ElementApi, NodeApi, PathApi, PointApi, RangeApi, SelectionApi, TextApi, authoredVeto, editorCommands, editorReads, locateAt, property, schema, transferVeto, txLocate } from "../../../core.js";
|
|
9
|
+
import { AuthoredPlugin } from "../../../authored/AuthoredPlugin.js";
|
|
9
10
|
import { MAX_IMPORTED_TABLE_COLUMNS, getColSpan, getImportedTableCellColSpan, getRowSpan, getTableCellHtmlMappingProps, getTableCellHtmlProps, parseHtmlColSpan, parseHtmlRowSpan, parseTableCellHtml, resetImportedTableCellSpans } from "./internal/tableCellHtml.js";
|
|
10
11
|
import { compileDetachedTableGrid, compileTableGrid, getTableColumnSizes, isTableColumnSizes } from "./internal/grid.js";
|
|
11
12
|
import { createDetachedTableContext } from "./internal/context.js";
|
|
@@ -317,9 +318,48 @@ const hasDefaultCellContent = (editor, cell) => {
|
|
|
317
318
|
const text = paragraph.children[0];
|
|
318
319
|
return TextApi.isText(text) && text.text === "" && Object.keys(text).every((key) => key === "text");
|
|
319
320
|
};
|
|
320
|
-
const
|
|
321
|
+
const getColumnWidthsWrite = (editor, table) => {
|
|
322
|
+
const authored = editor.plugin(AuthoredPlugin);
|
|
323
|
+
if (!("authored" in table) || !authored.installed) return null;
|
|
324
|
+
const review = authored.read.reviewOf(table);
|
|
325
|
+
const write = review.marks.find((mark) => mark.kind === "format" && mark.key === "columnWidths");
|
|
326
|
+
return write ? {
|
|
327
|
+
read: authored.read,
|
|
328
|
+
review,
|
|
329
|
+
write
|
|
330
|
+
} : null;
|
|
331
|
+
};
|
|
332
|
+
const struckColumnsCache = /* @__PURE__ */ new WeakMap();
|
|
333
|
+
const getShownColumnSizes = (editor, table) => {
|
|
334
|
+
const stored = getTableColumnSizes(table);
|
|
335
|
+
const pending = getColumnWidthsWrite(editor, table);
|
|
336
|
+
if (!pending) return stored;
|
|
337
|
+
const { read, review, write } = pending;
|
|
338
|
+
const accepted = review.accepted.columnWidths;
|
|
339
|
+
const replaced = isTableColumnSizes(accepted) ? accepted : void 0;
|
|
340
|
+
const cached = struckColumnsCache.get(table);
|
|
341
|
+
let struck = cached?.write === write ? cached.struck : void 0;
|
|
342
|
+
if (!struck) {
|
|
343
|
+
const grid = compileTableGrid(table);
|
|
344
|
+
struck = Array.from({ length: grid.width }, (_, col) => grid.slots.some((row) => {
|
|
345
|
+
const cell = row[col]?.cell;
|
|
346
|
+
return !!cell && read.reviewOf(cell).marks.some((mark) => mark.change === write.change && mark.kind === "delete");
|
|
347
|
+
}));
|
|
348
|
+
struckColumnsCache.set(table, {
|
|
349
|
+
struck,
|
|
350
|
+
write
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
let storedIndex = 0;
|
|
354
|
+
return struck.map((isStruck, col) => {
|
|
355
|
+
if (isStruck) return replaced?.[col] ?? null;
|
|
356
|
+
storedIndex += 1;
|
|
357
|
+
return stored?.[storedIndex - 1] ?? null;
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
const getResolvedColumnWidths = (editor, table, state) => {
|
|
321
361
|
const columnCount = compileTableGrid(table).width;
|
|
322
|
-
const columnWidths =
|
|
362
|
+
const columnWidths = getShownColumnSizes(editor, table);
|
|
323
363
|
const fallbackWidth = getFallbackColumnWidth({
|
|
324
364
|
columnCount,
|
|
325
365
|
defaultTableWidth: state.defaultTableWidth,
|
|
@@ -553,23 +593,26 @@ const BaseTablePlugin = definePlugin(PLUGINS.table, {
|
|
|
553
593
|
node: "table"
|
|
554
594
|
}
|
|
555
595
|
})
|
|
556
|
-
}).extend(({ store }) => ({ api: () => ({
|
|
557
|
-
columnWidths: (table) => getResolvedColumnWidths(table, store.get()),
|
|
596
|
+
}).extend(({ store }) => ({ api: ({ editor }) => ({
|
|
597
|
+
columnWidths: (table) => getResolvedColumnWidths(editor, table, store.get()),
|
|
558
598
|
/**
|
|
559
599
|
* Captures table sizes and returns a pure delta-to-preview calculation.
|
|
560
600
|
* Interior boundaries preserve the adjacent columns' combined width.
|
|
561
601
|
* The left boundary exchanges first-column width for table indentation.
|
|
562
602
|
* Commit the result with `update.resize`; previews never change the editor.
|
|
603
|
+
* Throws a `RangeError` for a column edge while the table holds a pending
|
|
604
|
+
* column width change.
|
|
563
605
|
*/
|
|
564
606
|
createResize: (table, target) => {
|
|
565
607
|
const { minColumnWidth } = store.get();
|
|
566
608
|
const minimum = isPositiveFiniteNumber(minColumnWidth) ? minColumnWidth : 1;
|
|
567
|
-
const widths = getResolvedColumnWidths(table, store.get());
|
|
609
|
+
const widths = target.edge === "bottom" ? [] : getResolvedColumnWidths(editor, table, store.get());
|
|
568
610
|
const marginLeft = table.marginLeft ?? 0;
|
|
569
611
|
const index = target.edge === "right" ? target.colIndex : 0;
|
|
570
612
|
if (target.edge === "bottom") {
|
|
571
613
|
if (!Number.isSafeInteger(target.rowIndex) || target.rowIndex < 0 || target.rowIndex >= table.children.length || !isPositiveFiniteNumber(target.height)) throw new TypeError("Table resize requires a valid row and positive height.");
|
|
572
|
-
} else if (
|
|
614
|
+
} else if (getColumnWidthsWrite(editor, table)) throw new RangeError("Table resize cannot move a column while a column width change waits for review.");
|
|
615
|
+
else if (!Number.isSafeInteger(index) || index < 0 || index >= widths.length) throw new RangeError("Table resize requires an existing column.");
|
|
573
616
|
return (delta) => {
|
|
574
617
|
if (!Number.isFinite(delta)) throw new TypeError("Table resize delta must be finite.");
|
|
575
618
|
if (target.edge === "bottom") return {
|
|
@@ -641,7 +684,7 @@ const BaseTablePlugin = definePlugin(PLUGINS.table, {
|
|
|
641
684
|
if (!entry) return null;
|
|
642
685
|
const [cell] = entry;
|
|
643
686
|
const { defaultTableWidth, minColumnWidth } = store.get();
|
|
644
|
-
const columnWidths =
|
|
687
|
+
const columnWidths = getShownColumnSizes(editor, context.table);
|
|
645
688
|
const fallbackWidth = getFallbackColumnWidth({
|
|
646
689
|
columnCount: context.grid.width,
|
|
647
690
|
defaultTableWidth,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as readTocHeadings, n as Heading, r as TocDefinition, t as BaseTocPlugin } from "../../index-
|
|
1
|
+
import { i as readTocHeadings, n as Heading, r as TocDefinition, t as BaseTocPlugin } from "../../index-BXwU9QH6.js";
|
|
2
2
|
export { BaseTocPlugin, Heading, TocDefinition, readTocHeadings };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as UploadTask, a as UploadAdmissionError, c as UploadElement, d as UploadKind, f as UploadPluginState, g as UploadSubmitOptions, h as UploadRules, i as UploadAdmission, l as UploadFailure, m as UploadRule, n as UPLOAD_FILE_TYPES, o as UploadAdmitOptions, p as UploadRefusal, r as UPLOAD_KINDS, s as UploadClient, t as BaseUploadPlugin, u as UploadFileType, v as UploadTaskState } from "../../index-
|
|
1
|
+
import { _ as UploadTask, a as UploadAdmissionError, c as UploadElement, d as UploadKind, f as UploadPluginState, g as UploadSubmitOptions, h as UploadRules, i as UploadAdmission, l as UploadFailure, m as UploadRule, n as UPLOAD_FILE_TYPES, o as UploadAdmitOptions, p as UploadRefusal, r as UPLOAD_KINDS, s as UploadClient, t as BaseUploadPlugin, u as UploadFileType, v as UploadTaskState } from "../../index-BkwR-5hH.js";
|
|
2
2
|
export { BaseUploadPlugin, UPLOAD_FILE_TYPES, UPLOAD_KINDS, UploadAdmission, UploadAdmissionError, UploadAdmitOptions, UploadClient, UploadElement, UploadFailure, UploadFileType, UploadKind, UploadPluginState, UploadRefusal, UploadRule, UploadRules, UploadSubmitOptions, UploadTask, UploadTaskState };
|
package/dist/history/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as CarriedRun } from "../index-
|
|
2
|
-
import { a as HistoryJSON, c as HistoryPluginTypeProvider, d as HistoryTxApi, f as history, i as HistoryControlTx, l as HistoryPluginTypes, n as History, o as HistoryOptions, r as HistoryBatchJSON, s as HistoryPlugin, t as Batch, u as HistoryStateApi } from "../index-
|
|
1
|
+
import { D as CarriedRun } from "../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import { a as HistoryJSON, c as HistoryPluginTypeProvider, d as HistoryTxApi, f as history, i as HistoryControlTx, l as HistoryPluginTypes, n as History, o as HistoryOptions, r as HistoryBatchJSON, s as HistoryPlugin, t as Batch, u as HistoryStateApi } from "../index-DNQXzU-X.js";
|
|
3
3
|
export { Batch, type CarriedRun, History, HistoryBatchJSON, HistoryControlTx, HistoryJSON, HistoryOptions, HistoryPlugin, HistoryPluginTypeProvider, HistoryPluginTypes, HistoryStateApi, HistoryTxApi, history };
|
package/dist/html/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as HtmlEditorSerializeOptions, c as HtmlParseLimits, d as HtmlSerializeResult, f as HtmlSliceParseResult, i as HtmlEditorParseOptions, l as HtmlParseOptions, m as HtmlWarningDiagnostic, n as HtmlDiagnostic, o as HtmlErrorDiagnostic, p as HtmlSourceLocation, r as HtmlDocumentParseResult, s as HtmlModelLocation, t as HtmlApi, u as HtmlSerializeOptions } from "../htmlTypes-
|
|
2
|
-
import { Br as HtmlPlugin, F as HtmlMatchValue, I as HtmlMatcher, L as HtmlNodeSpec, M as HtmlAttributes, N as HtmlContentToken, P as HtmlElementPatch, Vr as decodeHtmlDataTransfer, z as HtmlWrapperSpec } from "../core-
|
|
3
|
-
import { n as serializeHtml, t as parseHtml } from "../index-
|
|
1
|
+
import { a as HtmlEditorSerializeOptions, c as HtmlParseLimits, d as HtmlSerializeResult, f as HtmlSliceParseResult, i as HtmlEditorParseOptions, l as HtmlParseOptions, m as HtmlWarningDiagnostic, n as HtmlDiagnostic, o as HtmlErrorDiagnostic, p as HtmlSourceLocation, r as HtmlDocumentParseResult, s as HtmlModelLocation, t as HtmlApi, u as HtmlSerializeOptions } from "../htmlTypes-eT2ZGDAj.js";
|
|
2
|
+
import { Br as HtmlPlugin, F as HtmlMatchValue, I as HtmlMatcher, L as HtmlNodeSpec, M as HtmlAttributes, N as HtmlContentToken, P as HtmlElementPatch, Vr as decodeHtmlDataTransfer, z as HtmlWrapperSpec } from "../core-BqR-fEDp.js";
|
|
3
|
+
import { n as serializeHtml, t as parseHtml } from "../index-DYdObeFQ.js";
|
|
4
4
|
export { type HtmlApi, type HtmlAttributes, type HtmlContentToken, type HtmlDiagnostic, type HtmlDocumentParseResult, type HtmlEditorParseOptions, type HtmlEditorSerializeOptions, type HtmlElementPatch, type HtmlErrorDiagnostic, type HtmlMatchValue, type HtmlMatcher, type HtmlModelLocation, type HtmlNodeSpec, type HtmlParseLimits, type HtmlParseOptions, HtmlPlugin, type HtmlSerializeOptions, type HtmlSerializeResult, type HtmlSliceParseResult, type HtmlSourceLocation, type HtmlWarningDiagnostic, type HtmlWrapperSpec, decodeHtmlDataTransfer, parseHtml, serializeHtml };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as HtmlParseLimits, l as HtmlParseOptions, m as HtmlWarningDiagnostic, n as HtmlDiagnostic, o as HtmlErrorDiagnostic, p as HtmlSourceLocation, r as HtmlDocumentParseResult, s as HtmlModelLocation } from "../../htmlTypes-
|
|
1
|
+
import { c as HtmlParseLimits, l as HtmlParseOptions, m as HtmlWarningDiagnostic, n as HtmlDiagnostic, o as HtmlErrorDiagnostic, p as HtmlSourceLocation, r as HtmlDocumentParseResult, s as HtmlModelLocation } from "../../htmlTypes-eT2ZGDAj.js";
|
|
2
2
|
declare const parseHtml: (source: string, options: HtmlParseOptions) => HtmlDocumentParseResult;
|
|
3
3
|
export { type HtmlDiagnostic, type HtmlDocumentParseResult, type HtmlErrorDiagnostic, type HtmlModelLocation, type HtmlParseLimits, type HtmlParseOptions, type HtmlSourceLocation, type HtmlWarningDiagnostic, parseHtml };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { As as SchemaContentPrefixSlot, Es as SchemaContent, Fo as PluginReference, Hn as EditorSchemaOverrideInput, Tt as EditorDocumentValue, Ui as InternalEditorSchemaApi, cc as SchemaProperty, j as ContentSlice, m as AuthoredProjectionDiagnostic, rr as EditorSchemaValidationDiagnostic, su as Value, uc as SchemaPropertyDefinition, ws as RootKey } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
2
|
type EditorSchemaIdentity = Readonly<{
|
|
3
3
|
id: string;
|
|
4
4
|
version: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createEditorFixture, c as jsx, i as createEditor, n as HyperscriptEditorFixture, o as createHyperscript, r as HyperscriptShorthands, s as createText, t as HyperscriptCreators } from "../index-
|
|
1
|
+
import { a as createEditorFixture, c as jsx, i as createEditor, n as HyperscriptEditorFixture, o as createHyperscript, r as HyperscriptShorthands, s as createText, t as HyperscriptCreators } from "../index-Dq3Jlj8O-BJ6NxZm0.js";
|
|
2
2
|
export { type HyperscriptCreators, type HyperscriptEditorFixture, type HyperscriptShorthands, createEditor, createEditorFixture, createHyperscript, createText, jsx };
|