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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./core-
|
|
1
|
+
import { $a as Path, Fc as Selection, La as NodeSelectionMode, ps as Range, su as Value } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "./core-BqR-fEDp.js";
|
|
3
3
|
type AIToolName = 'comment' | 'edit' | 'generate' | null;
|
|
4
4
|
/** Request-local reference into `AIChatRequestContext.children`. */
|
|
5
5
|
type AIChatRequestNodeRef = Readonly<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./htmlTypes-
|
|
3
|
-
import { V as InternalBasePluginRuntimeExtension, _ as BasePlugin,
|
|
4
|
-
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-
|
|
1
|
+
import { Ca as NodeKey, Ji as Location, iu as TxDeclaredMethod, oo as Plugin, ou as TxOnlyMethod } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "./htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { Co as PluginReference, V as InternalBasePluginRuntimeExtension, _ as BasePlugin, aa as BasePluginDependencyReferenceFor, xo as PluginDependency } from "./core-BqR-fEDp.js";
|
|
4
|
+
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-B8-5Sr7I.js";
|
|
5
5
|
/** Paints each node's pending authored changes as `data-editor-authored-*` attributes. */
|
|
6
6
|
declare const BaseSuggestionPlugin: BasePlugin<Readonly<{
|
|
7
7
|
inject: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Tt as EditorDocumentValue } from "./index-
|
|
2
|
-
import "./htmlTypes-
|
|
3
|
-
import { u as Editor } from "./core-
|
|
1
|
+
import { Tt as EditorDocumentValue } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "./htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { u as Editor } from "./core-BqR-fEDp.js";
|
|
4
4
|
import React$1 from "react";
|
|
5
5
|
type EditorStaticProps<E = Editor> = {
|
|
6
6
|
/**
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AIToolName, i as AIChatRequestRefs, n as AIChatRequestNodeRef, o as resolveAIChatRequestContext, r as AIChatRequestNodeSelection, t as AIChatRequestContext } from "../AIChatRequestContext-
|
|
1
|
+
import { a as AIToolName, i as AIChatRequestRefs, n as AIChatRequestNodeRef, o as resolveAIChatRequestContext, r as AIChatRequestNodeSelection, t as AIChatRequestContext } from "../AIChatRequestContext-DrUahdTc.js";
|
|
2
2
|
export { AIChatRequestContext, AIChatRequestNodeRef, AIChatRequestNodeSelection, AIChatRequestRefs, AIToolName, resolveAIChatRequestContext };
|
package/dist/ai/react/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../htmlTypes-
|
|
3
|
-
import {
|
|
4
|
-
import { c as HistoryPluginTypeProvider, d as HistoryTxApi, n as History, u as HistoryStateApi } from "../../index-
|
|
5
|
-
import { a as AIToolName } from "../../AIChatRequestContext-
|
|
6
|
-
import { At as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-
|
|
7
|
-
import {
|
|
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-
|
|
9
|
-
import "../../index-
|
|
1
|
+
import { $a as Path, Ca as NodeKey, Ci as Element, Fo as PluginReference, Ji as Location, La as NodeSelectionMode, Pi as HistoryApi, aa as Node, b as BasePoint, dn as EditorReadMethodTree, iu as TxDeclaredMethod, oo as Plugin, ou as TxOnlyMethod, pa as NodeEntry, ps as Range, su as Value, tn as EditorNodesOptions, v as BaseElement, zo as PluginTypeProvider } from "../../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import "../../htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { Co as PluginReference$1, Eo as PluginSchemaDeclaration, V as InternalBasePluginRuntimeExtension, _ as BasePlugin, aa as BasePluginDependencyReferenceFor, ea as HistoryPluginState, qa as DefinitionOf, xo as PluginDependency } from "../../core-BqR-fEDp.js";
|
|
4
|
+
import { c as HistoryPluginTypeProvider, d as HistoryTxApi, n as History, u as HistoryStateApi } from "../../index-DNQXzU-X.js";
|
|
5
|
+
import { a as AIToolName } from "../../AIChatRequestContext-DrUahdTc.js";
|
|
6
|
+
import { At as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-DPowErHa.js";
|
|
7
|
+
import { O as MarkdownSyncPlugin, d as Unsafe, i as MarkdownEditor, l as Handle, n as MarkdownApi, u as Join } from "../../index-Cob_iBdu.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-B8-5Sr7I.js";
|
|
9
|
+
import "../../index-M781pyx9.js";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import React$1 from "react";
|
|
12
12
|
import { ChatRequestOptions, ChatStatus, ChatTransport, DataUIPart, UIMessage } from "ai";
|
package/dist/authored/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../index-
|
|
2
|
-
import { C as projectAuthoredDocument, S as AuthoredView, T as proposeAuthoredComparison, 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 projectAuthoredRange, x as AuthoredReview, y as AuthoredRefusal } from "../index-
|
|
3
|
-
import { t as AuthoredPlugin } from "../index-
|
|
1
|
+
import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import { C as projectAuthoredDocument, S as AuthoredView, T as proposeAuthoredComparison, 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 projectAuthoredRange, x as AuthoredReview, y as AuthoredRefusal } from "../index-B8-5Sr7I.js";
|
|
3
|
+
import { t as AuthoredPlugin } from "../index-M781pyx9.js";
|
|
4
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, projectAuthoredDocument, projectAuthoredRange, proposeAuthoredComparison };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { vt as EditorCoreStateView } from "./index-
|
|
2
|
-
import { u as Editor } from "./core-
|
|
1
|
+
import { vt as EditorCoreStateView } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import { u as Editor } from "./core-BqR-fEDp.js";
|
|
3
3
|
type ComboboxEditor = Pick<Editor, 'plugin'> & {
|
|
4
4
|
read: Pick<EditorCoreStateView, 'nodes'>;
|
|
5
5
|
};
|
package/dist/{comparison-types-Dt-unJZY-DCddmbSD.d.ts → comparison-types-DdwE6mYq-BogsHoUO.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as DocumentChange,
|
|
1
|
+
import { J as DocumentChange, Tt as EditorDocumentValue, su as Value, zn as EditorSchemaIdentity } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
2
|
/** A comparison-local interval in the canonical document token coordinate. */
|
|
3
3
|
type ComparisonSpan = Readonly<{
|
|
4
4
|
from: number;
|
package/dist/compiler/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as EditorApplicationSchema } from "../htmlTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { h as EditorApplicationSchema } from "../htmlTypes-eT2ZGDAj.js";
|
|
2
|
+
import { Xo as GeneratedEditorTypeProvider, st as BasePluginInput, tt as EditorCompilation, ut as EditorPropertyTypes } from "../core-BqR-fEDp.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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as EditorBreakExitOptions, $
|
|
2
|
-
import { a as HtmlEditorSerializeOptions, d as HtmlSerializeResult, f as HtmlSliceParseResult, h as EditorApplicationSchema, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult, t as HtmlApi } from "./htmlTypes-
|
|
3
|
-
import { E as DataTransferEncodeContext, I as ScrollIntoViewOptions, P as HotkeySpec, _ as DOMRange, i as DOMClipboardApi, m as DOMPlugin$1, r as DOMApi, w as DataTransferDecodeContext } from "./index-
|
|
4
|
-
import { d as HistoryTxApi, s as HistoryPlugin$1, u as HistoryStateApi } from "./index-
|
|
1
|
+
import { $ as EditorBreakExitOptions, $a as Path, $n as EditorSchemaSourceProvider, $r as EditorTransactionSpecBuilder, $t as EditorNodeTypeProvider, Ac as SchemaTextPropertyOptions, Ba as NodeTarget, Bo as PluginTypeProviderOf, Bs as SchemaElementConstructionPropertiesFor, Bt as EditorInstalledUpdateGroups, Ca as NodeKey, Cc as SchemaTarget, Ci as Element, Da as NodeMatchPredicate, Dc as SchemaTextProperty, Di as ElementIdTarget, Dl as TextTarget, Dr as EditorStateViewProvider, Ds as SchemaContentDefault, Ea as NodeMatch, Ec as SchemaTextProperties, Es as SchemaContent, F as DecorationAttributes, Fl as TransferApi, Fo as PluginReference$1, Gs as SchemaElementPropertiesFor, Gt as EditorLifecycleErrorSink, H as Descendant, Ht as EditorJsonValue, I as DecorationRefresh, Ia as NodeSelection, Ji as Location, Jl as TransferRead, Jt as EditorNextOptions, K as DescendantIn, Ks as SchemaElementProperty, Ls as SchemaContentRule, Lt as EditorGenericMethod, Ma as NodeOf, Ms as SchemaContentRootContribution, Nl as TransactionSpec, Nn as EditorSchemaDerivedDefinition, Oc as SchemaTextPropertyDefinition, Oo as PluginPortal, P as Decoration, Pa as NodeRemoveNodesOptions, Pi as HistoryApi, Pn as EditorSchemaElement, Qo as PropertyBooleanDescriptor, Qt as EditorNodeGetOptions, R as DefinitionOf$1, Ra as NodeSetNodesOptions, Rr as EditorTransactionChangeContext, S as BaseText, St as EditorDirectUpdate, To as PluginInstalledCapabilitiesOf, Tr as EditorStateView, Tt as EditorDocumentValue, Un as EditorSchemaPlugin, Ut as EditorLevelsOptions, Wn as EditorSchemaPluginProvider, Wo as PluginWitnessFor, X as EditorAboveOptions, Y as Editor$1, Yt as EditorNodeChangeContext, Z as EditorBlockOptions, Zr as EditorTransactionSelectionApi, Zs as SchemaElementShapeFor, _o as PluginDefinitionInput, aa as Node$1, ac as SchemaKeyPrefix, au as TxMethodDeclarations, b as BasePoint, bi as EditorValueTypeProvider, bl as TextInsertFragmentOptions, bo as PluginDependencyReferenceFor, br as EditorStateSelectionApi, cc as SchemaProperty, ci as EditorUpdateMethods, cr as EditorSelectionBlockOptions, dl as Text$1, dn as EditorReadMethodTree, ds as PropertyValueOf, ea as MaximizeMode, en as EditorNodeUnsetOptions, es as PropertyEnumDescriptor, fc as SchemaPropertyHandle, fn as EditorReadMethods, fo as PluginCapabilities, fs as PropertyValueOptions, gi as EditorUpdateValueFromPlugin, go as PluginDefinition, hc as SchemaPropertyKey, hi as EditorUpdateTransactionProvider, in as EditorPreviousOptions, io as PersistedDocumentInput, is as PropertyOptionsOf, iu as TxDeclaredMethod, j as ContentSlice, jc as SchemaTypesTarget, ji as ElementOf, jr as EditorToggleBlockOptions, kn as EditorSchemaContribution, kr as EditorTextChangeContext, ks as SchemaContentOptions, li as EditorUpdatePolicy, ll as StructuralPlainTextDiagnostic, ls as PropertyValueDescriptor, lu as WithNodeTarget, m as AuthoredProjectionDiagnostic, mi as EditorUpdateTransactionOf, mo as PluginContribution, mt as EditorCommitContext, nn as EditorNodesReadOptions, oc as SchemaNodeTypeProvider, oo as Plugin, pa as NodeEntry, pi as EditorUpdateTransaction, ps as Range, qa as NodeTypeSelector, qi as LeafPosition, ql as TransferPlugin$1, qo as Point$1, qs as SchemaElementPropertyDefinition, rn as EditorParentOptions, rs as PropertyNumberDescriptor, sc as SchemaPluginsOf, si as EditorUpdateContext, sr as EditorSelection, ss as PropertyStringDescriptor, su as Value, tc as SchemaElementTypes, tn as EditorNodesOptions, ts as PropertyJsonDescriptor, uc as SchemaPropertyDefinition, un as EditorReadMethodRecord, v as BaseElement, va as NodeIn, vo as PluginDependencyContractReference, vt as EditorCoreStateView, w as BlockInsertOptions$1, wc as SchemaText, ws as RootKey, xl as TextInsertTextOptions, xn as EditorSchemaContract, ya as NodeInsertNodesOptions, yo as PluginDependencyReference, yr as EditorStateSchemaApi, zo as PluginTypeProvider, zs as SchemaElement } from "./index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import { a as HtmlEditorSerializeOptions, d as HtmlSerializeResult, f as HtmlSliceParseResult, h as EditorApplicationSchema, i as HtmlEditorParseOptions, r as HtmlDocumentParseResult, t as HtmlApi } from "./htmlTypes-eT2ZGDAj.js";
|
|
3
|
+
import { E as DataTransferEncodeContext, I as ScrollIntoViewOptions, P as HotkeySpec, _ as DOMRange, i as DOMClipboardApi, m as DOMPlugin$1, r as DOMApi, w as DataTransferDecodeContext } from "./index-DShbzec2.js";
|
|
4
|
+
import { d as HistoryTxApi, s as HistoryPlugin$1, u as HistoryStateApi } from "./index-DNQXzU-X.js";
|
|
5
5
|
import { Draft } from "mutative";
|
|
6
6
|
import { nanoid as nanoid$1 } from "nanoid";
|
|
7
7
|
import "zustand/vanilla";
|
|
@@ -1523,12 +1523,6 @@ type ElementIdPluginState = {
|
|
|
1523
1523
|
/** Generate one persisted ID for a newly materialized element. */
|
|
1524
1524
|
generateId: () => string;
|
|
1525
1525
|
};
|
|
1526
|
-
type ElementIdEntry = Readonly<{
|
|
1527
|
-
key: NodeKey;
|
|
1528
|
-
node: Element;
|
|
1529
|
-
path: Path;
|
|
1530
|
-
root: RootKey;
|
|
1531
|
-
}>;
|
|
1532
1526
|
declare const ElementIdPlugin: BasePlugin<Readonly<{
|
|
1533
1527
|
readonly __pluginWritableProperties: Readonly<{
|
|
1534
1528
|
descriptor: PropertyStringDescriptor<{
|
|
@@ -1560,7 +1554,6 @@ declare const ElementIdPlugin: BasePlugin<Readonly<{
|
|
|
1560
1554
|
readonly generateId: () => string;
|
|
1561
1555
|
};
|
|
1562
1556
|
readonly read: {
|
|
1563
|
-
readonly entry: (id: string) => ElementIdEntry | undefined;
|
|
1564
1557
|
readonly id: (key: NodeKey) => string | undefined;
|
|
1565
1558
|
};
|
|
1566
1559
|
}>> & Readonly<Record<never, never>>;
|
|
@@ -1586,7 +1579,7 @@ type InputRuleDecline = Readonly<{
|
|
|
1586
1579
|
}>;
|
|
1587
1580
|
type InputRuleTarget = 'insertBreak' | 'insertData' | 'insertText';
|
|
1588
1581
|
type InputRuleInsertTextOptions = Omit<TextInsertTextOptions, 'at'> & {
|
|
1589
|
-
at?:
|
|
1582
|
+
at?: TextTarget;
|
|
1590
1583
|
};
|
|
1591
1584
|
type ReadPluginPortal<TPortal> = Pick<TPortal, Extract<keyof TPortal, 'api' | 'installed' | 'name' | 'read' | 'schema' | 'selectors'>> & (TPortal extends {
|
|
1592
1585
|
store: infer TStore;
|
|
@@ -1601,8 +1594,10 @@ type InputRulePluginLookup = {
|
|
|
1601
1594
|
};
|
|
1602
1595
|
/** Read-only editor capabilities available while an input rule is selected. */
|
|
1603
1596
|
type InputRuleEditor<TEditor = Editor> = TEditor extends {
|
|
1597
|
+
key: infer TKeyApi;
|
|
1604
1598
|
read: infer TRead;
|
|
1605
1599
|
} ? {
|
|
1600
|
+
readonly key: TKeyApi;
|
|
1606
1601
|
readonly plugin: InputRulePluginLookup;
|
|
1607
1602
|
readonly read: { readonly [TKey in keyof TRead]: TRead[TKey]; };
|
|
1608
1603
|
} : never;
|
|
@@ -1743,10 +1738,39 @@ type InsertBreakInputRule<TMatch = true, TEditor = Editor> = BaseInputRule<Inser
|
|
|
1743
1738
|
};
|
|
1744
1739
|
type InsertDataInputRule<TMatch = true, TEditor = Editor> = BaseInputRule<InsertDataInputRuleReadContext<TEditor>> & {
|
|
1745
1740
|
apply: BivariantCallback<[context: InsertDataInputRuleContext<TEditor>, match: TMatch], InputRuleContinuation<DataTransfer | undefined> | InputRuleDecline | undefined>;
|
|
1741
|
+
followUp?: never;
|
|
1746
1742
|
mimeTypes?: string[];
|
|
1747
1743
|
resolve?: BivariantCallback<[context: InsertDataInputRuleReadContext<TEditor>], TMatch | undefined>;
|
|
1748
1744
|
target: 'insertData';
|
|
1749
1745
|
};
|
|
1746
|
+
/** A paste follow-up's context, which holds a transaction on the view that pasted. */
|
|
1747
|
+
type InsertDataFollowUpContext<TEditor = Editor> = {
|
|
1748
|
+
tx: InputRuleTransaction<TEditor>;
|
|
1749
|
+
};
|
|
1750
|
+
/**
|
|
1751
|
+
* An `insertData` rule that leaves the paste alone and runs `followUp` after
|
|
1752
|
+
* it, as its own undo step on the view that pasted. It runs only after a local
|
|
1753
|
+
* paste that landed content and that undo history saved, and never when that
|
|
1754
|
+
* view is read-only. `resolve` reads the state the paste started from, and
|
|
1755
|
+
* `followUp` gets its match and no range, so it checks what it acts on before
|
|
1756
|
+
* it writes. Declare it through `defineInputRule`.
|
|
1757
|
+
*/
|
|
1758
|
+
type InsertDataFollowUpInputRule<TMatch = unknown, TEditor = Editor> = BaseInputRule<InsertDataInputRuleReadContext<TEditor>> & {
|
|
1759
|
+
apply?: never;
|
|
1760
|
+
followUp: BivariantCallback<[context: InsertDataFollowUpContext<TEditor>, match: TMatch], undefined>;
|
|
1761
|
+
mimeTypes?: string[];
|
|
1762
|
+
resolve: BivariantCallback<[context: InsertDataInputRuleReadContext<TEditor>], TMatch | undefined>;
|
|
1763
|
+
target: 'insertData';
|
|
1764
|
+
};
|
|
1765
|
+
declare const checkedFollowUp: unique symbol;
|
|
1766
|
+
/**
|
|
1767
|
+
* A follow-up rule that `defineInputRule` returned. Only `defineInputRule`
|
|
1768
|
+
* checks that `followUp` takes what `resolve` returns, so a plugin's
|
|
1769
|
+
* `inputRules` takes a follow-up rule only in this form.
|
|
1770
|
+
*/
|
|
1771
|
+
type DefinedInsertDataFollowUpInputRule<TMatch = unknown, TEditor = Editor> = InsertDataFollowUpInputRule<TMatch, TEditor> & {
|
|
1772
|
+
readonly [checkedFollowUp]: true;
|
|
1773
|
+
};
|
|
1750
1774
|
type InsertTextInputRule<TMatch = true, TEditor = Editor> = BaseInputRule<InsertTextInputRuleReadContext<TEditor>> & {
|
|
1751
1775
|
apply: BivariantCallback<[context: InsertTextInputRuleContext<TEditor>, match: TMatch], InputRuleContinuation<{
|
|
1752
1776
|
options?: InputRuleInsertTextOptions;
|
|
@@ -1756,17 +1780,25 @@ type InsertTextInputRule<TMatch = true, TEditor = Editor> = BaseInputRule<Insert
|
|
|
1756
1780
|
target: 'insertText';
|
|
1757
1781
|
trigger: readonly string[] | string;
|
|
1758
1782
|
};
|
|
1759
|
-
type InputRule<TMatch = unknown, TEditor = Editor> = InsertBreakInputRule<TMatch, TEditor> | InsertDataInputRule<TMatch, TEditor> | InsertTextInputRule<TMatch, TEditor>;
|
|
1760
|
-
type StoredInputRule = InsertBreakInputRule<any, any> | InsertDataInputRule<any, any> | InsertTextInputRule<any, any>;
|
|
1783
|
+
type InputRule<TMatch = unknown, TEditor = Editor> = InsertBreakInputRule<TMatch, TEditor> | InsertDataInputRule<TMatch, TEditor> | InsertDataFollowUpInputRule<TMatch, TEditor> | InsertTextInputRule<TMatch, TEditor>;
|
|
1784
|
+
type StoredInputRule = InsertBreakInputRule<any, any> | InsertDataInputRule<any, any> | InsertDataFollowUpInputRule<any, any> | InsertTextInputRule<any, any>;
|
|
1761
1785
|
type InputRuleReference = (BaseInputRule<never> & {
|
|
1762
1786
|
apply: BivariantCallback<[context: never, match: never], unknown>;
|
|
1763
1787
|
resolve?: BivariantCallback<[context: never], unknown>;
|
|
1764
1788
|
target: 'insertBreak';
|
|
1765
1789
|
}) | (BaseInputRule<never> & {
|
|
1766
1790
|
apply: BivariantCallback<[context: never, match: never], unknown>;
|
|
1791
|
+
followUp?: never;
|
|
1767
1792
|
mimeTypes?: string[];
|
|
1768
1793
|
resolve?: BivariantCallback<[context: never], unknown>;
|
|
1769
1794
|
target: 'insertData';
|
|
1795
|
+
}) | (BaseInputRule<never> & {
|
|
1796
|
+
apply?: never;
|
|
1797
|
+
followUp: BivariantCallback<[context: never, match: never], undefined>;
|
|
1798
|
+
mimeTypes?: string[];
|
|
1799
|
+
resolve: BivariantCallback<[context: never], unknown>;
|
|
1800
|
+
target: 'insertData';
|
|
1801
|
+
readonly [checkedFollowUp]: true;
|
|
1770
1802
|
}) | (BaseInputRule<never> & {
|
|
1771
1803
|
apply: BivariantCallback<[context: never, match: never], unknown>;
|
|
1772
1804
|
resolve?: BivariantCallback<[context: never], unknown>;
|
|
@@ -1774,7 +1806,7 @@ type InputRuleReference = (BaseInputRule<never> & {
|
|
|
1774
1806
|
trigger: readonly string[] | string;
|
|
1775
1807
|
});
|
|
1776
1808
|
type InputRulesDefinition<TEditor = Editor> = InputRulesConfig<TEditor>;
|
|
1777
|
-
type InputRulesConfig<TEditor = Editor> = Array<
|
|
1809
|
+
type InputRulesConfig<TEditor = Editor> = Array<InsertBreakInputRule<any, TEditor> | InsertDataInputRule<any, TEditor> | DefinedInsertDataFollowUpInputRule<any, TEditor> | InsertTextInputRule<any, TEditor> | InputRuleReference>;
|
|
1778
1810
|
type ResolvedInputRule = StoredInputRule & {
|
|
1779
1811
|
id: string;
|
|
1780
1812
|
plugin: AnyBasePlugin;
|
|
@@ -2156,16 +2188,22 @@ type BoundResolvedInsertDataRule<P extends InputRuleOwner, TMatch> = Omit<Insert
|
|
|
2156
2188
|
apply: (context: InsertDataInputRuleContext<OwnerEditor<P>>, match: NoInfer<TMatch>) => ReturnType<InsertDataInputRule<TMatch, OwnerEditor<P>>['apply']>;
|
|
2157
2189
|
resolve: (context: InsertDataInputRuleReadContext<OwnerEditor<P>>) => TMatch | undefined;
|
|
2158
2190
|
};
|
|
2191
|
+
type BoundResolvedInsertDataFollowUpRule<P extends InputRuleOwner, TMatch> = Omit<InsertDataFollowUpInputRule<TMatch, OwnerEditor<P>>, 'followUp' | 'resolve'> & {
|
|
2192
|
+
followUp: (context: InsertDataFollowUpContext<OwnerEditor<P>>, match: NoInfer<TMatch>) => undefined;
|
|
2193
|
+
resolve: (context: InsertDataInputRuleReadContext<OwnerEditor<P>>) => TMatch | undefined;
|
|
2194
|
+
};
|
|
2159
2195
|
type BoundResolvedInsertTextRule<P extends InputRuleOwner, TMatch> = Omit<InsertTextInputRule<TMatch, OwnerEditor<P>>, 'apply' | 'resolve'> & {
|
|
2160
2196
|
apply: (context: InsertTextInputRuleContext<OwnerEditor<P>>, match: NoInfer<TMatch>) => ReturnType<InsertTextInputRule<TMatch, OwnerEditor<P>>['apply']>;
|
|
2161
2197
|
resolve: (context: InsertTextInputRuleReadContext<OwnerEditor<P>>) => TMatch | undefined;
|
|
2162
2198
|
};
|
|
2163
2199
|
declare function defineInputRule<TMatch = true, TEditor extends Editor = Editor>(rule: InsertBreakInputRule<TMatch, TEditor>): InsertBreakInputRule<TMatch, TEditor>;
|
|
2164
2200
|
declare function defineInputRule<TMatch = true, TEditor extends Editor = Editor>(rule: InsertDataInputRule<TMatch, TEditor>): InsertDataInputRule<TMatch, TEditor>;
|
|
2201
|
+
declare function defineInputRule<TMatch, TEditor extends Editor = Editor>(rule: InsertDataFollowUpInputRule<TMatch, TEditor>): DefinedInsertDataFollowUpInputRule<TMatch, TEditor>;
|
|
2165
2202
|
declare function defineInputRule<TMatch = true, TEditor extends Editor = Editor>(rule: InsertTextInputRule<TMatch, TEditor>): InsertTextInputRule<TMatch, TEditor>;
|
|
2166
2203
|
declare function defineInputRule<TRule extends InputRule>(rule: TRule): TRule;
|
|
2167
2204
|
declare function defineInputRule<P extends InputRuleOwner, TMatch>(owner: P, rule: BoundResolvedInsertBreakRule<P, TMatch>): InsertBreakInputRule<TMatch, OwnerEditor<P>>;
|
|
2168
2205
|
declare function defineInputRule<P extends InputRuleOwner, TMatch>(owner: P, rule: BoundResolvedInsertDataRule<P, TMatch>): InsertDataInputRule<TMatch, OwnerEditor<P>>;
|
|
2206
|
+
declare function defineInputRule<P extends InputRuleOwner, TMatch>(owner: P, rule: BoundResolvedInsertDataFollowUpRule<P, TMatch>): DefinedInsertDataFollowUpInputRule<TMatch, OwnerEditor<P>>;
|
|
2169
2207
|
declare function defineInputRule<P extends InputRuleOwner, TMatch>(owner: P, rule: BoundResolvedInsertTextRule<P, TMatch>): InsertTextInputRule<TMatch, OwnerEditor<P>>;
|
|
2170
2208
|
declare function defineInputRule<P extends InputRuleOwner>(owner: P, rule: InsertBreakInputRule<true, OwnerEditor<P>>): InsertBreakInputRule<true, OwnerEditor<P>>;
|
|
2171
2209
|
declare function defineInputRule<P extends InputRuleOwner>(owner: P, rule: InsertDataInputRule<true, OwnerEditor<P>>): InsertDataInputRule<true, OwnerEditor<P>>;
|
|
@@ -9351,7 +9389,7 @@ type PropertiesForMutation<TMutation> = TMutation extends EditorElementMutation
|
|
|
9351
9389
|
type PropertiesForPlugin<TSchema, TPlugin> = [TSchema] extends [InternalEditorMutationProvider<infer TMutations>] ? PropertiesForMutation<EditorMutationForPlugin<TMutations, TPlugin>> : [TSchema] extends [InternalEditorApplicationSchemaProvider] ? Readonly<Record<string, unknown>> : PropertiesForMutation<RawEditorMutationForPlugin<TPlugin>>;
|
|
9352
9390
|
type PluginNodeTypeSelector = PluginReference | string | ReadonlyArray<PluginReference | string>;
|
|
9353
9391
|
/** Broad insertion options for package APIs that forward a stored selector. */
|
|
9354
|
-
type NodeInsertOptions = Omit<NodeInsertNodesOptions<Node$1, NodeTypeSelector | undefined
|
|
9392
|
+
type NodeInsertOptions = Omit<WithNodeTarget<NodeInsertNodesOptions<Node$1, NodeTypeSelector | undefined>>, 'split'> & {
|
|
9355
9393
|
split?: Omit<NonNullable<NodeInsertNodesOptions<Node$1, NodeTypeSelector | undefined>['split']>, 'type'> & {
|
|
9356
9394
|
type?: PluginNodeTypeSelector;
|
|
9357
9395
|
};
|
|
@@ -9374,35 +9412,36 @@ type ElementForSelector<TSchema, TSelector> = TSelector extends ReadonlyArray<in
|
|
|
9374
9412
|
type: TSelector;
|
|
9375
9413
|
} : TSelector extends PluginReference ? ElementForPlugin<TSchema, TSelector> : never;
|
|
9376
9414
|
type PropertiesForSelector<TSchema, TSelector> = TSelector extends ReadonlyArray<infer TItem> ? PropertiesForSelector<TSchema, TItem> : TSelector extends PluginReference ? PropertiesForPlugin<TSchema, TSelector> : Readonly<Record<string, unknown>>;
|
|
9415
|
+
type SelectorOptions<TOptions> = WithNodeTarget<Omit<TOptions, 'match' | 'type'>>;
|
|
9377
9416
|
type NodesReadOptions<TNode extends Node$1, TSelector> = Omit<EditorNodesReadOptions<TNode>, 'match' | 'type'> & {
|
|
9378
9417
|
match?: NodeMatch<TNode>;
|
|
9379
9418
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9380
9419
|
};
|
|
9381
|
-
type NodeGetOptions<TNode extends Node$1, TSelector> =
|
|
9420
|
+
type NodeGetOptions<TNode extends Node$1, TSelector> = SelectorOptions<EditorNodeGetOptions<TNode>> & {
|
|
9382
9421
|
match?: NodeMatch<TNode>;
|
|
9383
9422
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9384
9423
|
};
|
|
9385
|
-
type AboveOptions<TNode extends Element, TSelector> =
|
|
9424
|
+
type AboveOptions<TNode extends Element, TSelector> = SelectorOptions<EditorAboveOptions<TNode>> & {
|
|
9386
9425
|
match?: NodeMatch<TNode>;
|
|
9387
9426
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9388
9427
|
};
|
|
9389
|
-
type BlockOptions<TNode extends Element, TSelector> =
|
|
9428
|
+
type BlockOptions<TNode extends Element, TSelector> = SelectorOptions<EditorBlockOptions<TNode>> & {
|
|
9390
9429
|
match?: NodeMatch<TNode>;
|
|
9391
9430
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9392
9431
|
};
|
|
9393
|
-
type LevelsOptions<TNode extends Node$1, TSelector> =
|
|
9432
|
+
type LevelsOptions<TNode extends Node$1, TSelector> = SelectorOptions<EditorLevelsOptions<TNode>> & {
|
|
9394
9433
|
match?: NodeMatch<TNode>;
|
|
9395
9434
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9396
9435
|
};
|
|
9397
|
-
type NextOptions<TNode extends Element, TSelector> =
|
|
9436
|
+
type NextOptions<TNode extends Element, TSelector> = SelectorOptions<EditorNextOptions<TNode>> & {
|
|
9398
9437
|
match?: NodeMatch<TNode>;
|
|
9399
9438
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9400
9439
|
};
|
|
9401
|
-
type PreviousOptions<TNode extends Node$1, TSelector> =
|
|
9440
|
+
type PreviousOptions<TNode extends Node$1, TSelector> = SelectorOptions<EditorPreviousOptions<TNode>> & {
|
|
9402
9441
|
match?: NodeMatch<TNode>;
|
|
9403
9442
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9404
9443
|
};
|
|
9405
|
-
type ParentOptions<TNode extends Element, TSelector> =
|
|
9444
|
+
type ParentOptions<TNode extends Element, TSelector> = SelectorOptions<EditorParentOptions<TNode>> & {
|
|
9406
9445
|
match?: NodeMatch<TNode>;
|
|
9407
9446
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9408
9447
|
};
|
|
@@ -9551,9 +9590,9 @@ type PluginWritablePropertyPatch<D> = { [TKey in PluginExactWritablePropertyKey<
|
|
|
9551
9590
|
type PluginForbiddenWritablePropertyPatch<D> = { [TKey in PluginForbiddenWritablePropertyKey<D>]?: never; };
|
|
9552
9591
|
type PluginNodeSetProps<D> = Partial<Omit<Element, 'children'>> & PluginWritablePropertyPatch<D> & PluginForbiddenWritablePropertyPatch<D>;
|
|
9553
9592
|
type PluginNodeSetOptions = Omit<NodeSetNodesOptions<any>, 'at'> & {
|
|
9554
|
-
at?: Descendant | Location | NodeKey | NodeSelection;
|
|
9593
|
+
at?: Descendant | ElementIdTarget | Location | NodeKey | NodeSelection;
|
|
9555
9594
|
};
|
|
9556
|
-
type NodeSelectorOptions<TOptions, TNode extends Node$1, TSelector> =
|
|
9595
|
+
type NodeSelectorOptions<TOptions, TNode extends Node$1, TSelector> = SelectorOptions<NonNullable<TOptions>> & {
|
|
9557
9596
|
match?: NodeMatch<TNode>;
|
|
9558
9597
|
type: TSelector & ([TNode] extends [never] ? never : unknown);
|
|
9559
9598
|
};
|
|
@@ -10859,4 +10898,4 @@ type NominalPluginReference = Readonly<{
|
|
|
10859
10898
|
name: string;
|
|
10860
10899
|
}>;
|
|
10861
10900
|
declare const isNominalPluginDescriptor: (value: unknown) => value is NominalPluginReference;
|
|
10862
|
-
export { PluginContributionCompatibility as $,
|
|
10901
|
+
export { PluginContributionCompatibility as $, InferConflicts as $a, HistoryPlugin as $i, HeadingRules as $n, InputRulesConfig as $r, UpsertLinkOptions as $t, DefinePluginFormats as A, PluginFormatSchemaView as Aa, AutoScrollChangeKind as Ai, CapturedFormat as An, PluginSelector as Ao, BaseParagraphDefinition as Ar, PlainTextSerializeResult as At, InjectNodeProps as B, nanoid$1 as Ba, DebugDefinition as Bi, BaseStrikethroughPlugin as Bn, StructuralRuleEditor as Bo, HtmlPlugin as Br, OutdentListOptions as Bt, BasePluginOn as C, MarkdownRefusal as Ca, TransformInputRuleContext as Ci, BaseTextAlignPlugin as Cn, PluginReference as Co, RenderTextFn as Cr, PluginTransaction as Ct, ConfiguredPluginDescriptor as D, PluginFormatContext as Da, ElementIdPlugin as Di, TextIndentDefinition as Dn, PluginSchemaElement as Do, RenderLeafFn as Dr, PlainTextDiagnostic as Dt, ConfiguredBasePlugin as E, HtmlMappingDiagnosticInput as Ea, ElementStatePlugin as Ei, TextAlignDefinition as En, PluginSchemaDeclaration as Eo, RenderTextProps as Er, CorePlugins as Et, HtmlMatchValue as F, HandlerReturnType as Fa, DomPluginState as Fi, BaseCodePlugin as Fn, PluginStore as Fo, createBlockStartInputRule as Fr, BulletedListRules as Ft, PluginShortcutInput as G, BaseTransformOptions as Ga, LogLevel as Gi, ItalicRules as Gn, InferPluginSchemaContribution as Go, BlockStartInputRuleConfig as Gr, BaseLinkDefinition as Gt, LeafStaticProps as H, AnyBasePluginDefinition as Ha, DebugPlugin as Hi, BoldRules as Hn, WithRequiredName as Ho, BaseInputRule as Hr, ToggleListOptions as Ht, HtmlMatcher as I, DocxNodeMapping as Ia, DomPluginUpdate as Ii, BaseHighlightPlugin as In, PluginViewStore as Io, createMarkInputRule as Ir, ListElement as It, RenderStaticNodeWrapperProps as J, DeleteRules as Ja, AffinityPlugin as Ji, ScriptValue as Jn, UnknownObject as Jo, DelimitedInlineInputRuleMatch as Jr, CreateLinkNodeOptions as Jt, RenderStaticNodeWrapper as K, BreakRules as Ka, AffinityDefinition as Ki, MarkComboRules as Kn, Nullable as Ko, BlockStartInputRuleMatch as Kr, BaseLinkPlugin as Kt, HtmlNodeSpec as L, ElementWith as La, ScrollIntoViewTarget as Li, BaseItalicPlugin as Ln, RuleDecision as Lo, createTextSubstitutionInputRule as Lr, ListStyle as Lt, HtmlAttributes as M, RenderElementFn as Ma, AutoScrollOptions as Mi, FormattingContribution as Mn, PluginSelectorMethods as Mo, inputRuleVeto as Mr, BULLETED_LIST_STYLES as Mt, HtmlContentToken as N, RenderElementProps as Na, AutoScrollUpdate as Ni, formatting$1 as Nn, PluginSelectorReturn as No, defineInputRule as Nr, BaseListDefinition as Nt, DeclaredPluginShortcutInput as O, PluginFormatModelView as Oa, ElementIdPluginState as Oi, TextIndentPluginState as On, PluginSchemaMark as Oo, RenderLeafProps as Or, PlainTextDocumentOptions as Ot, HtmlElementPatch as P, RenderElementSlots as Pa, DomApi as Pi, BaseBoldPlugin as Pn, PluginSelectors as Po, createBlockFenceInputRule as Pr, BaseListPlugin as Pt, PluginCompatibilityArguments as Q, InferApi as Qa, HistoryDefinition as Qi, HeadingLevel as Qn, InputRuleTarget as Qr, UnwrapLinkOptions as Qt, HtmlPrepareDiagnosticInput as R, PluginFormatNode as Ra, ScrollMode as Ri, BaseKbdPlugin as Rn, SelectionRules as Ro, matchBlockStart as Rr, ListType as Rt, BasePluginImplementationContext as S, MarkdownPluginRegistry as Sa, TextSubstitutionPattern as Si, BaseLineHeightPlugin as Sn, PluginPortalContext as So, EditableProps as Sr, PluginState as St, BasePluginPortal as T, MarkdownTagNode as Ta, ElementStateDefinition as Ti, LineHeightDefinition as Tn, PluginSchemaContext as To, RenderTextPieceProps as Tr, CoreEditorApi as Tt, NodeStaticProps as U, BaseInjectProps as Ua, DebugPluginState as Ui, CodeRules as Un, InferPluginNodeTypeProvider as Uo, BlockFenceInputRuleConfig as Ur, isOrderedList as Ut, InternalBasePluginRuntimeExtension as V, InternalPluginDefinitionOf as Va, DebugErrorType as Vi, BaseUnderlinePlugin as Vn, WithAnyName as Vo, decodeHtmlDataTransfer as Vr, TaskListRules as Vt, PartialBasePlugin as W, BasePluginDefinition as Wa, EditorError as Wi, HighlightRules as Wn, InferPluginSchema as Wo, BlockFenceInputRuleMatch as Wr, isListLevels as Wt, TransformOptions as X, GetInjectNodePropsOptions as Xa, TransferDefinition as Xi, UnderlineRules as Xn, GeneratedEditorTypeProvider as Xo, InputRuleEditor as Xr, LinkElement as Xt, TextStaticProps as Y, EditOnlyConfig as Ya, AffinityPluginUpdate as Yi, StrikethroughRules as Yn, GeneratedEditorMutations as Yo, InputRule as Yr, LinkAttributes as Yt, MergePluginDefinitions as Z, GetInjectNodePropsReturnType as Za, TransferPlugin as Zi, BaseHeadingPlugin as Zn, InputRuleInsertTextOptions as Zr, LinkRules as Zt, BasePlugin as _, MarkdownMarks as _a, ResolvedInputRule as _i, Alignment as _n, NormalizePluginState as _o, getFragmentProp as _r, NodeInsertOptions as _t, SingleLinePlugin as a, BasePluginDependencyReferenceFor as aa, InsertDataFollowUpInputRule as ai, IndentPluginState as an, InferOwnUpdate as ao, getPluginNodeClass as ar, RuntimePluginsFromTuple as at, BasePluginDefinitionInput as b, MarkdownNodeMapping as ba, TextSubstitutionInputRuleConfig as bi, BaseFontFamilyPlugin as bn, PluginDefinitionWitness as bo, ApplyDeepToNodesOptions as br, PluginReadCapability as bt, PLUGINS as c, LowerBasePlugin as ca, InsertDataInputRuleReadContext as ci, BaseCodeBlockPlugin as cn, InferPluginUpdateGroups as co, mergeDeepToNodes as cr, BlockInsertOptions as ct, InferBaseEditorPlugins as d, PlainTextNodeMapping as da, InsertTextInputRuleReadContext as di, CodeBlockElement as dn, InferSelectors as do, Hotkeys as dr, InferEditorRuntimePlugins as dt, HistoryPluginState as ea, InputRulesDefinition as ei, WrapLinkOptions as en, InferDependencies as eo, ToggleHeadingOptions as er, CreateEditorOptions as et, InternalBaseEditorWithInstalledPlugins as f, PlainTextNodeMappingInput as fa, MarkInputRuleConfig as fi, CodeHighlightDefinition as fn, InferTargetPlugins as fo, createHotkey as fr, InferRuntimePlugins as ft, AnyPluginBase as g, MarkdownMarkWrapper as ga, MatchDelimitedInlineOptions as gi, HighlightResult as gn, NormalizePluginSelectors as go, GetFragmentPropOptions as gr, MergeInstalledPluginDefinitions as gt, AnyBasePluginPortal as h, MarkdownMarkWrapContext as ha, MatchBlockStartOptions as hi, HighlightNode as hn, NodeComponent as ho, FragmentPropMode as hr, InternalInstalledSchemaMutationProvider as ht, TrailingBlockPluginState as i, BasePluginDependencyDescriptors as ia, InsertDataFollowUpContext as ii, IndentDefinition as in, InferOwnRead as io, HorizontalRuleRules as ir, PlatePluginsFromTuple as it, EditorShortcut as j, ElementContentRootSlot as ja, AutoScrollChangesMap as ji, FormattingBlockEntry as jn, PluginSelectorArgs as jo, BaseParagraphPlugin as jr, serializePlainText as jt, Decorate as k, PluginFormatRegistry as ka, AutoScrollApi as ki, BaseFormattingPlugin as kn, PluginSchemaReferences as ko, StaticRenderLeafProps as kr, PlainTextEditorOptions as kt, PluginName as l, NormalizeBasePluginInput$1 as la, InsertTextInputRule as li, BaseCodeHighlightPlugin as ln, InferPluginViewState as lo, isUrl as lr, BlockUpsertOptions as lt, AnyBasePluginContext as m, MarkdownEncodeContext as ma, MatchBlockFenceOptions as mi, CodeHighlightPluginState as mn, MergeRules as mo, getInjectMatch as mr, InternalInstalledSchemaDefinitionsProvider as mt, TrailingBlockDefinition as n, PluginInitialStateInput as na, InsertBreakInputRuleContext as ni, BaseIndentPlugin as nn, InferName as no, BaseHorizontalRulePlugin as nr, EditorOptions as nt, SingleBlockPlugin as o, BasePluginDependencyReferences as oa, InsertDataInputRule as oi, isNonNegativeSafeInteger as on, InferPluginReadGroups as oo, isPluginElementClass as or, createEditor as ot, AnyBasePlugin as p, MarkdownDecodeContext as pa, MarkInputRuleMatch as pi, CodeHighlightLowlight as pn, InferUpdate as po, isHotkey as pr, InternalEditorMutationProvider as pt, RenderStaticNodeWrapperFunction as q, DefinitionOf as qa, AffinityEdgeNodes as qi, ScriptRules as qn, AnyObject as qo, DefinedInsertDataFollowUpInputRule as qr, BaseLinkPluginState as qt, TrailingBlockPlugin as r, RequiredPluginState as ra, InsertBreakInputRuleReadContext as ri, IndentChangeOptions as rn, InferOwnApi as ro, BlockquoteRules as rr, EditorValueInput as rt, ExitBreakPlugin as s, BasePluginInstalledCapabilityWitness as sa, InsertDataInputRuleContext as si, CodeBlockRules as sn, InferPluginStoreState as so, isPluginNodeClass as sr, BasePluginInput as st, isNominalPluginDescriptor as t, definePlugin as ta, InsertBreakInputRule as ti, getLinkHref as tn, InferEnabled as to, BaseBlockquotePlugin as tr, EditorCompilation as tt, Editor as u, PlainTextEncodeContext as ua, InsertTextInputRuleContext as ui, CodeBlockDefinition as un, InferRead as uo, isDefined as ur, EditorPropertyTypes as ut, BasePluginConfiguration as v, MarkdownNodeKind as va, ResolvedInputRulesMeta as vi, BaseFontBackgroundColorPlugin as vn, NormalizeRules as vo, IS_APPLE as vr, PluginDirectUpdate as vt, BasePluginOverride as w, MarkdownTagAttributeView as wa, ElementStateApi as wi, BaseTextIndentPlugin as wn, PluginSchema as wo, RenderTextHostProps as wr, PluginUpdate as wt, BasePluginExtendInput as x, MarkdownNodeMappingInput as xa, TextSubstitutionMatch as xi, BaseFontSizePlugin as xn, PluginDependency as xo, applyDeepToNodes as xr, PluginReadState as xt, BasePluginContext as y, MarkdownNodeKinds as ya, SelectionInputRuleContext as yi, BaseFontColorPlugin as yn, PluginBaseContext as yo, defaultsDeepToNodes as yr, PluginOwnUpdate as yt, HtmlWrapperSpec as z, TextWith as za, DebugApi as zi, BaseScriptPlugin as zn, StructuralRuleContext as zo, matchDelimitedInline as zr, OrderedListRules as zt };
|
package/dist/diff/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as ComparisonConflictAlternative, c as ComparisonEffect, d as ComparisonResolutionResult, f as ComparisonSnapshot, h as TwoWayComparison, i as ComparisonConflict, l as ComparisonEvidence, m as ThreeWayComparison, n as Comparison, o as ComparisonCorrespondence, p as ComparisonSpan, r as ComparisonBranch, s as ComparisonDiagnostic, t as ComparedChange, u as ComparisonResolution } from "../comparison-types-
|
|
1
|
+
import { su as Value, yr as EditorStateSchemaApi } from "../index-BXjLmx1n-CXk17buG.js";
|
|
2
|
+
import { a as ComparisonConflictAlternative, c as ComparisonEffect, d as ComparisonResolutionResult, f as ComparisonSnapshot, h as TwoWayComparison, i as ComparisonConflict, l as ComparisonEvidence, m as ThreeWayComparison, n as Comparison, o as ComparisonCorrespondence, p as ComparisonSpan, r as ComparisonBranch, s as ComparisonDiagnostic, t as ComparedChange, u as ComparisonResolution } from "../comparison-types-DdwE6mYq-BogsHoUO.js";
|
|
3
3
|
type TwoWayInput<V extends Value> = Readonly<{
|
|
4
4
|
after: unknown;
|
|
5
5
|
before: unknown;
|
|
@@ -50,7 +50,7 @@ Set `primary` on `EditorRoot`; it defaults to `true`. A view with `primary={fals
|
|
|
50
50
|
`useEditor()` returns the nearest provider's selected editor and throws when no target exists. `useOptionalEditor()` uses the same selection and returns `null` without a provider or target.
|
|
51
51
|
|
|
52
52
|
- Inside `EditorContent`, hooks use that exact editable view, including its root, DOM, and current read-only state.
|
|
53
|
-
- Inside `EditorRoot`, outside its content, UI follows the view of that Plate the user focused or pressed last, then its first mounted view. A Plate without content
|
|
53
|
+
- Inside `EditorRoot`, outside its content, UI follows the view of that Plate the user focused or pressed last, then its first mounted view. A Plate without content gives its UI a root editor of that Plate, so its UI acts on that Plate alone, even while another Plate of the same editor holds the caret.
|
|
54
54
|
- Shared UI under the controller follows the mounted view the user focused or pressed last, then the first mounted primary view.
|
|
55
55
|
- Nested `EditorRoot` and `EditorController` components scope their descendants independently.
|
|
56
56
|
|
package/dist/docs/api/core.md
CHANGED
|
@@ -524,9 +524,41 @@ const editor = createEditor({
|
|
|
524
524
|
const elementId = editor.plugin(ElementIdPlugin);
|
|
525
525
|
const key = editor.key(element);
|
|
526
526
|
const id = elementId.read.id(key);
|
|
527
|
-
const entry = id ?
|
|
527
|
+
const entry = id ? editor.read.nodes.byId(id) : null;
|
|
528
|
+
|
|
529
|
+
editor.update.nodes.move({ at: { id: "intro" }, to: [0] });
|
|
530
|
+
editor.update((tx) => tx.nodes.remove({ at: { id: "intro" } }));
|
|
528
531
|
```
|
|
529
532
|
|
|
533
|
+
An editor that stores IDs finds and targets an element by its ID:
|
|
534
|
+
|
|
535
|
+
- `editor.read.nodes.byId(id)`: the element that holds `id`, as
|
|
536
|
+
`{ key, node, path, root? }`, or `null`. `root` is present only when the
|
|
537
|
+
element lives in a named root.
|
|
538
|
+
- `tx.nodes.byId(id)`: the same lookup inside an update, read from its draft.
|
|
539
|
+
It throws once its update ends.
|
|
540
|
+
- `{ id }`: a node target, such as `nodes.path({ id })` on a read or
|
|
541
|
+
`at: { id }` on a transform, which acts as the key of the element that holds
|
|
542
|
+
the ID. Text, mark, range and offset targets keep their point or range. A
|
|
543
|
+
target is an ID only as an object, not an array, whose one own key is a
|
|
544
|
+
string `id`.
|
|
545
|
+
|
|
546
|
+
An editor stores IDs when the schema gives every element type a generated,
|
|
547
|
+
unique string `id`, as the plugin's default target does, and no content admits
|
|
548
|
+
undeclared element types. In any other editor, `byId` and `at: { id }` throw.
|
|
549
|
+
|
|
550
|
+
A command, a plugin update method and every one-shot on `editor.update` or on
|
|
551
|
+
a writable view's `update` look an ID up in the command's document. Over
|
|
552
|
+
another author's pending suggestions, they reach a moved element's moved copy
|
|
553
|
+
and change nothing for an ID that only a struck original holds. A path in
|
|
554
|
+
`to`, `after` or `before`, and a child `position`, still names a place in the
|
|
555
|
+
stored document. A raw `editor.update((tx) => ...)` looks the ID up in the
|
|
556
|
+
stored draft, as it resolves a path or a key, so it reaches the struck
|
|
557
|
+
original. An editor view answers from its own document, except a read while a
|
|
558
|
+
command runs, which answers from the command's document. When no element holds
|
|
559
|
+
the ID, a write changes nothing and a read returns its empty result.
|
|
560
|
+
[Node identity](/docs/editor#node-identity) shows each route.
|
|
561
|
+
|
|
530
562
|
Configure `initialState.generateId` to replace the default full-length
|
|
531
563
|
`nanoid()` generator. Include `ElementIdPlugin` in the target passed to
|
|
532
564
|
`defineDocumentMigrations`. The plugin declares its `id` with `unique: true`,
|
|
@@ -542,7 +574,8 @@ The application schema can narrow the plugin-owned `id` target. Current
|
|
|
542
574
|
document admission generates and retains IDs only for elements that match the
|
|
543
575
|
compiled target. A narrowed target must match every type that can take a
|
|
544
576
|
matched type's place, so `target.group("block")` works while no element's
|
|
545
|
-
content admits both a block and an inline element.
|
|
577
|
+
content admits both a block and an inline element. Narrow it only when the
|
|
578
|
+
application never finds or targets an element by ID:
|
|
546
579
|
|
|
547
580
|
```ts
|
|
548
581
|
const editor = createEditor({
|
|
@@ -557,6 +590,10 @@ const editor = createEditor({
|
|
|
557
590
|
});
|
|
558
591
|
```
|
|
559
592
|
|
|
593
|
+
A block-only target leaves inline elements without IDs, so `nodes.byId` and
|
|
594
|
+
`at: { id }` throw in that editor, even for a block's ID. `read.id(key)` and
|
|
595
|
+
pen marks from `platejs/ink` keep working.
|
|
596
|
+
|
|
560
597
|
### `ElementStatePlugin`
|
|
561
598
|
|
|
562
599
|
Extend editor behavior.
|
|
@@ -670,7 +707,8 @@ Generic component for rendering an element.
|
|
|
670
707
|
Necessary for rendering the node children.
|
|
671
708
|
</APIItem>
|
|
672
709
|
<APIItem name="as" type="React.ElementType" optional>
|
|
673
|
-
The component type to render as.
|
|
710
|
+
The component type to render as.
|
|
711
|
+
- **Default:** `'div'`
|
|
674
712
|
</APIItem>
|
|
675
713
|
</APIProps>
|
|
676
714
|
</API>
|
|
@@ -705,7 +743,8 @@ Generic component for rendering a leaf.
|
|
|
705
743
|
</APISubList>
|
|
706
744
|
</APIItem>
|
|
707
745
|
<APIItem name="as" type="React.ElementType" optional>
|
|
708
|
-
The component type to render as.
|
|
746
|
+
The component type to render as.
|
|
747
|
+
- **Default:** `'span'`
|
|
709
748
|
</APIItem>
|
|
710
749
|
</APIProps>
|
|
711
750
|
</API>
|
|
@@ -729,7 +768,8 @@ Generic component for rendering text.
|
|
|
729
768
|
Necessary for rendering the node children.
|
|
730
769
|
</APIItem>
|
|
731
770
|
<APIItem name="as" type="React.ElementType" optional>
|
|
732
|
-
The component type to render as.
|
|
771
|
+
The component type to render as.
|
|
772
|
+
- **Default:** `'span'`
|
|
733
773
|
</APIItem>
|
|
734
774
|
</APIProps>
|
|
735
775
|
</API>
|
package/dist/docs/api/dom.md
CHANGED
|
@@ -33,14 +33,11 @@ view, picked by the editor you call it on:
|
|
|
33
33
|
- An editor from `useRootEditor(root)` runs in the view of `root` it follows,
|
|
34
34
|
as [`useRootEditor`](/docs/api/react-hooks) describes, so its DOM calls and
|
|
35
35
|
its commands reach the same view, even after focus moves to a button. While
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
from it, such as a drop. While it follows its own `EditorRoot` because no `EditorContent`
|
|
39
|
-
there shows `root`, and once a write through it that places the caret ends
|
|
40
|
-
a follow into another `EditorRoot`, it finds no `EditorContent`, so
|
|
36
|
+
no `EditorContent` in its `EditorRoot` shows `root`, it finds no
|
|
37
|
+
`EditorContent`, even when one in another `EditorRoot` holds the caret, so
|
|
41
38
|
`editable()` returns `null` and `hasDOMNode` returns `false`. `resolveNode`
|
|
42
|
-
and `resolvePoint` still resolve a text node that
|
|
43
|
-
renders.
|
|
39
|
+
and `resolvePoint` still resolve a text node of `root` that another view
|
|
40
|
+
renders with the default leaf.
|
|
44
41
|
- The editor `createEditor` returns runs in a view that shows the root the
|
|
45
42
|
call is about: its target's root, else the caret's root, else the primary
|
|
46
43
|
document. When the caret was placed in that root from an `EditorRoot`,
|