platejs 54.0.0-beta.3 → 54.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/{AIChatRequestContext-DY104TqL.d.ts → AIChatRequestContext-CwCmEMVV.d.ts} +2 -2
  2. package/dist/{BaseSuggestionPlugin-Deo6n6Fs.d.ts → BaseSuggestionPlugin-CpVkv7k2.d.ts} +4 -4
  3. package/dist/{PlateStatic-CJX5bKuv.d.ts → PlateStatic-C7FfXu-Z.d.ts} +3 -3
  4. package/dist/ai/index.d.ts +1 -1
  5. package/dist/ai/react/index.d.ts +9 -9
  6. package/dist/authored/index.d.ts +3 -3
  7. package/dist/code-block/codemirror/index.d.ts +1 -1
  8. package/dist/{combobox-DAOYWuvC.d.ts → combobox-BhhymlUs.d.ts} +2 -2
  9. package/dist/{comparison-types-Dt-unJZY-DCddmbSD.d.ts → comparison-types-Bvvxzxq2-08gzpgF6.d.ts} +1 -1
  10. package/dist/compiler/index.d.ts +2 -2
  11. package/dist/{core-ClHasORr.d.ts → core-Bu--Bog3.d.ts} +65 -26
  12. package/dist/diff/index.d.ts +2 -2
  13. package/dist/docs/api/core/plate-controller.md +1 -1
  14. package/dist/docs/api/core.md +45 -5
  15. package/dist/docs/api/dom.md +9 -10
  16. package/dist/docs/api/react-hooks.md +40 -22
  17. package/dist/docs/authored-changes.md +4 -2
  18. package/dist/docs/block-placeholder.md +4 -2
  19. package/dist/docs/board.md +57 -4
  20. package/dist/docs/comment.md +2 -2
  21. package/dist/docs/document-model.md +15 -3
  22. package/dist/docs/editor.md +50 -4
  23. package/dist/docs/field.md +138 -20
  24. package/dist/docs/link.md +1 -1
  25. package/dist/docs/llms.txt +1 -1
  26. package/dist/docs/markdown.md +97 -9
  27. package/dist/docs/media.md +88 -2
  28. package/dist/docs/plugin-input-rules.md +65 -5
  29. package/dist/docs/roots.md +16 -10
  30. package/dist/docx/export/index.d.ts +3 -3
  31. package/dist/docx/export/lib/exportDocx.js +18 -13
  32. package/dist/docx/export/lib/internal/xml-builder.js +11 -16
  33. package/dist/docx/export/lib/reviewProjection.js +43 -3
  34. package/dist/docx/import/index.d.ts +4 -4
  35. package/dist/docx/paste/index.d.ts +4 -4
  36. package/dist/dom/index.d.ts +1 -1
  37. package/dist/excalidraw/index.d.ts +3 -3
  38. package/dist/excalidraw/react/index.d.ts +3 -3
  39. package/dist/facade.js +2 -2
  40. package/dist/features/board/index.d.ts +1 -1
  41. package/dist/features/callout/index.d.ts +3 -3
  42. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +14 -18
  43. package/dist/features/combobox/index.d.ts +2 -2
  44. package/dist/features/comments/BaseCommentsPlugin.js +38 -18
  45. package/dist/features/comments/index.d.ts +1 -1
  46. package/dist/features/date/index.d.ts +3 -3
  47. package/dist/features/details/index.d.ts +3 -3
  48. package/dist/features/details/lib/BaseDetailsPlugin.js +15 -2
  49. package/dist/features/field/index.d.ts +2 -2
  50. package/dist/features/field/index.js +4 -2
  51. package/dist/features/field/lib/BaseFieldPlugin.js +52 -106
  52. package/dist/features/field/lib/applyFieldValues.js +188 -0
  53. package/dist/features/field/lib/fieldRules.internal.js +174 -7
  54. package/dist/features/find/index.d.ts +3 -3
  55. package/dist/features/footnote/index.d.ts +1 -1
  56. package/dist/features/ink/index.d.ts +1 -1
  57. package/dist/features/ink/lib/inkGone.internal.js +6 -6
  58. package/dist/features/ink/lib/inkPlaces.internal.js +8 -9
  59. package/dist/features/layout/index.d.ts +1 -1
  60. package/dist/features/lint/index.d.ts +3 -3
  61. package/dist/features/media/index.d.ts +2 -2
  62. package/dist/features/media/index.js +2 -2
  63. package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +200 -2
  64. package/dist/features/mention/index.d.ts +5 -5
  65. package/dist/features/suggestion/index.d.ts +1 -1
  66. package/dist/features/table/index.d.ts +1 -1
  67. package/dist/features/table/lib/BaseTablePlugin.js +50 -7
  68. package/dist/features/toc/index.d.ts +1 -1
  69. package/dist/features/upload/index.d.ts +1 -1
  70. package/dist/history/index.d.ts +2 -2
  71. package/dist/html/index.d.ts +3 -3
  72. package/dist/html/server/index.d.ts +1 -1
  73. package/dist/{htmlTypes-cg_cWsaN.d.ts → htmlTypes-aE9Qlenu.d.ts} +1 -1
  74. package/dist/hyperscript/index.d.ts +1 -1
  75. package/dist/{index-C35V_hj0.d.ts → index-BR2S-6Js.d.ts} +3 -3
  76. package/dist/{index-CLsEe3LY.d.ts → index-BT1-fX5o.d.ts} +3 -3
  77. package/dist/{index-BZWFoUXt.d.ts → index-BXs4598V.d.ts} +5 -5
  78. package/dist/{index-C6ql9pKw.d.ts → index-BYAqyTSY.d.ts} +2 -2
  79. package/dist/{index-CdOLsPaW.d.ts → index-Be_YFFLS.d.ts} +3 -5
  80. package/dist/{index-CzLwBZpY.d.ts → index-Bf6EwY5O.d.ts} +2 -2
  81. package/dist/{index-HPYawTae-BCUQLEWF.d.ts → index-BwmXxqbi-COlJb0HZ.d.ts} +1 -1
  82. package/dist/{index-Cmuluh6f.d.ts → index-C9WSACSv.d.ts} +1 -1
  83. package/dist/{index-D3-2iM1b.d.ts → index-CGUt4h_4.d.ts} +291 -4
  84. package/dist/{index-DPWyk3lG-DOYwohXO.d.ts → index-CRmyGzS8-BTrk6JzL.d.ts} +7 -1
  85. package/dist/{index-baQOK89E.d.ts → index-CTwrWir_.d.ts} +1 -1
  86. package/dist/{index-CktYvOgk.d.ts → index-CYR4jNU7.d.ts} +4 -4
  87. package/dist/{index-DQnjqtQa.d.ts → index-CbcYN_S_.d.ts} +122 -21
  88. package/dist/{index-Do9pj1GK.d.ts → index-CeVE8JR-.d.ts} +47 -6
  89. package/dist/{index-C1_JIhL4.d.ts → index-DFvzP8N_.d.ts} +4 -4
  90. package/dist/{index-oIJAZxc2.d.ts → index-DgVsTFYL.d.ts} +3 -3
  91. package/dist/{index-8WO2vI0U.d.ts → index-DhVOU0pS.d.ts} +34 -29
  92. package/dist/{index-DKOFvteF.d.ts → index-DhurStYU.d.ts} +1 -1
  93. package/dist/{index-B5mYEawV.d.ts → index-DlBey0zf.d.ts} +10 -8
  94. package/dist/{index-C9DiGDVj.d.ts → index-DqKFQcfb.d.ts} +2 -2
  95. package/dist/{index-C0POz7rg.d.ts → index-DqpzKYwP.d.ts} +3 -3
  96. package/dist/{index-DpltOCot-A2b3p3Eb.d.ts → index-QuqD4Dyj-DlOIX0sH.d.ts} +75 -27
  97. package/dist/{index-r7yb77Wy.d.ts → index-dpi2ErEe.d.ts} +5 -3
  98. package/dist/index.d.ts +4 -4
  99. package/dist/internal/utils/vscodeClipboard.js +11 -0
  100. package/dist/lib/plugins/element-id/ElementIdPlugin.js +6 -16
  101. package/dist/lib/plugins/input-rules/InputRulesPlugin.js +73 -14
  102. package/dist/markdown/index.d.ts +2 -2
  103. package/dist/markdown/index.js +2 -1
  104. package/dist/markdown/lib/MarkdownPlugin.js +10 -13
  105. package/dist/markdown/lib/RawHtmlPlugin.js +4 -2
  106. package/dist/markdown/lib/internal/markdownConversion.js +7 -4
  107. package/dist/markdown/lib/internal/markdownFootnoteWriter.js +35 -0
  108. package/dist/markdown/lib/internal/markdownRawHtml.js +40 -1
  109. package/dist/markdown/lib/internal/markdownTags.js +7 -1
  110. package/dist/math/index.d.ts +3 -3
  111. package/dist/math/react/index.d.ts +4 -4
  112. package/dist/migrations/index.d.ts +3 -3
  113. package/dist/migrations/migratePlateV54.js +4 -6
  114. package/dist/migrations/migratePlateV54RetiredMarks.internal.js +23 -8
  115. package/dist/migrations/migratePlateV54Suggestions.internal.js +2 -2
  116. package/dist/migrations/v53-manifest.internal.js +4 -0
  117. package/dist/pagination/index.d.ts +1 -1
  118. package/dist/pagination/react/index.d.ts +2 -2
  119. package/dist/react/components/EditorContentView.internal.js +26 -16
  120. package/dist/react/components/Plate.js +13 -20
  121. package/dist/react/features/board/boardExport.internal.js +470 -0
  122. package/dist/react/features/board/boardPictureStyles.internal.js +415 -0
  123. package/dist/react/features/board/boardView.internal.js +11 -6
  124. package/dist/react/features/board/index.d.ts +50 -6
  125. package/dist/react/features/callout/index.d.ts +3 -3
  126. package/dist/react/features/combobox/index.d.ts +5 -5
  127. package/dist/react/features/comments/index.d.ts +6 -6
  128. package/dist/react/features/date/index.d.ts +4 -4
  129. package/dist/react/features/details/index.d.ts +4 -4
  130. package/dist/react/features/field/FieldPlugin.js +5 -4
  131. package/dist/react/features/field/index.d.ts +19 -16
  132. package/dist/react/features/footnote/index.d.ts +7 -7
  133. package/dist/react/features/format-painter/index.d.ts +4 -4
  134. package/dist/react/features/ink/InkContent.js +13 -0
  135. package/dist/react/features/ink/index.d.ts +5 -9
  136. package/dist/react/features/ink/inkPaint.internal.js +4 -1
  137. package/dist/react/features/ink/inkPlacement.internal.js +2 -1
  138. package/dist/react/features/layout/index.d.ts +5 -5
  139. package/dist/react/features/media/index.d.ts +5 -5
  140. package/dist/react/features/mention/index.d.ts +6 -6
  141. package/dist/react/features/suggestion/index.d.ts +6 -6
  142. package/dist/react/features/table/index.d.ts +7 -6
  143. package/dist/react/features/table/useTableResize.js +10 -1
  144. package/dist/react/features/toc/index.d.ts +2 -2
  145. package/dist/react/features/upload/index.d.ts +5 -5
  146. package/dist/react/index.d.ts +6 -6
  147. package/dist/react/internal/plate-context.js +20 -11
  148. package/dist/react/stores/plate/useEditorSelector.js +22 -9
  149. package/dist/react/utils/BlockPlaceholderPlugin.js +5 -2
  150. package/dist/react/virtualized.d.ts +2 -2
  151. package/dist/{source-aUwpNnAw.d.ts → source-GMnTi_Vr.d.ts} +3 -3
  152. package/dist/static/index.d.ts +5 -5
  153. package/dist/tabbable/index.d.ts +1 -1
  154. package/dist/tabbable/react/index.d.ts +3 -3
  155. package/dist/testing/index.d.ts +2 -2
  156. package/dist/yjs/index.d.ts +1 -1
  157. package/dist/yjs/react/index.d.ts +5 -5
  158. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import { Fa as NodeSelectionMode, Mc as Selection, Za as Path, ru as Value, us as Range } from "./index-DpltOCot-A2b3p3Eb.js";
2
- import "./core-ClHasORr.js";
1
+ import { $a as Path, Fc as Selection, La as NodeSelectionMode, ps as Range, su as Value } from "./index-QuqD4Dyj-DlOIX0sH.js";
2
+ import "./core-Bu--Bog3.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 { Ki as Location, eu as TxDeclaredMethod, nu as TxOnlyMethod, ro as Plugin, xa as NodeKey } from "./index-DpltOCot-A2b3p3Eb.js";
2
- import "./htmlTypes-cg_cWsaN.js";
3
- import { V as InternalBasePluginRuntimeExtension, _ as BasePlugin, ra as BasePluginDependencyReferenceFor, xo as PluginReference, yo as PluginDependency } from "./core-ClHasORr.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-C9DiGDVj.js";
1
+ import { Ca as NodeKey, Ji as Location, iu as TxDeclaredMethod, oo as Plugin, ou as TxOnlyMethod } from "./index-QuqD4Dyj-DlOIX0sH.js";
2
+ import "./htmlTypes-aE9Qlenu.js";
3
+ import { Co as PluginReference, V as InternalBasePluginRuntimeExtension, _ as BasePlugin, aa as BasePluginDependencyReferenceFor, xo as PluginDependency } from "./core-Bu--Bog3.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-DqKFQcfb.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-DpltOCot-A2b3p3Eb.js";
2
- import "./htmlTypes-cg_cWsaN.js";
3
- import { u as Editor } from "./core-ClHasORr.js";
1
+ import { Tt as EditorDocumentValue } from "./index-QuqD4Dyj-DlOIX0sH.js";
2
+ import "./htmlTypes-aE9Qlenu.js";
3
+ import { u as Editor } from "./core-Bu--Bog3.js";
4
4
  import React$1 from "react";
5
5
  type EditorStaticProps<E = Editor> = {
6
6
  /**
@@ -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-DY104TqL.js";
1
+ import { a as AIToolName, i as AIChatRequestRefs, n as AIChatRequestNodeRef, o as resolveAIChatRequestContext, r as AIChatRequestNodeSelection, t as AIChatRequestContext } from "../AIChatRequestContext-CwCmEMVV.js";
2
2
  export { AIChatRequestContext, AIChatRequestNodeRef, AIChatRequestNodeSelection, AIChatRequestRefs, AIToolName, resolveAIChatRequestContext };
@@ -1,12 +1,12 @@
1
- import { Fa as NodeSelectionMode, Io as PluginTypeProvider, Ki as Location, Mi as HistoryApi, Mo as PluginReference, Si as Element, Za as Path, b as BasePoint, da as NodeEntry, en as EditorNodesOptions, eu as TxDeclaredMethod, nu as TxOnlyMethod, ra as Node, ro as Plugin, ru as Value, un as EditorReadMethodTree, us as Range, v as BaseElement, xa as NodeKey } from "../../index-DpltOCot-A2b3p3Eb.js";
2
- import "../../htmlTypes-cg_cWsaN.js";
3
- import { Ga as DefinitionOf, Qi as HistoryPluginState, V as InternalBasePluginRuntimeExtension, _ as BasePlugin, ra as BasePluginDependencyReferenceFor, wo as PluginSchemaDeclaration, xo as PluginReference$1, yo as PluginDependency } from "../../core-ClHasORr.js";
4
- import { c as HistoryPluginTypeProvider, d as HistoryTxApi, n as History, u as HistoryStateApi } from "../../index-baQOK89E.js";
5
- import { a as AIToolName } from "../../AIChatRequestContext-DY104TqL.js";
6
- import { At as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-8WO2vI0U.js";
7
- import { D as MarkdownSyncPlugin, c as Handle, l as Join, r as MarkdownEditor, t as MarkdownApi, u as Unsafe } from "../../index-Do9pj1GK.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-C9DiGDVj.js";
9
- import "../../index-CktYvOgk.js";
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-QuqD4Dyj-DlOIX0sH.js";
2
+ import "../../htmlTypes-aE9Qlenu.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-Bu--Bog3.js";
4
+ import { c as HistoryPluginTypeProvider, d as HistoryTxApi, n as History, u as HistoryStateApi } from "../../index-CTwrWir_.js";
5
+ import { a as AIToolName } from "../../AIChatRequestContext-CwCmEMVV.js";
6
+ import { At as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-DhVOU0pS.js";
7
+ import { O as MarkdownSyncPlugin, d as Unsafe, i as MarkdownEditor, l as Handle, n as MarkdownApi, u as Join } from "../../index-CeVE8JR-.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-DqKFQcfb.js";
9
+ import "../../index-CYR4jNU7.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";
@@ -1,4 +1,4 @@
1
- import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../index-DpltOCot-A2b3p3Eb.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-C9DiGDVj.js";
3
- import { t as AuthoredPlugin } from "../index-CktYvOgk.js";
1
+ import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../index-QuqD4Dyj-DlOIX0sH.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-DqKFQcfb.js";
3
+ import { t as AuthoredPlugin } from "../index-CYR4jNU7.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,4 +1,4 @@
1
- import { Xn as ExternalTextAdapter } from "../../index-8WO2vI0U.js";
1
+ import { Xn as ExternalTextAdapter } from "../../index-DhVOU0pS.js";
2
2
  import { Extension } from "@codemirror/state";
3
3
  type CodeBlockCodeMirrorConfig = Readonly<{
4
4
  language?: string;
@@ -1,5 +1,5 @@
1
- import { vt as EditorCoreStateView } from "./index-DpltOCot-A2b3p3Eb.js";
2
- import { u as Editor } from "./core-ClHasORr.js";
1
+ import { vt as EditorCoreStateView } from "./index-QuqD4Dyj-DlOIX0sH.js";
2
+ import { u as Editor } from "./core-Bu--Bog3.js";
3
3
  type ComboboxEditor = Pick<Editor, 'plugin'> & {
4
4
  read: Pick<EditorCoreStateView, 'nodes'>;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { J as DocumentChange, Rn as EditorSchemaIdentity, Tt as EditorDocumentValue, ru as Value } from "./index-DpltOCot-A2b3p3Eb.js";
1
+ import { J as DocumentChange, Tt as EditorDocumentValue, su as Value, zn as EditorSchemaIdentity } from "./index-QuqD4Dyj-DlOIX0sH.js";
2
2
  /** A comparison-local interval in the canonical document token coordinate. */
3
3
  type ComparisonSpan = Readonly<{
4
4
  from: number;
@@ -1,5 +1,5 @@
1
- import { h as EditorApplicationSchema } from "../htmlTypes-cg_cWsaN.js";
2
- import { Jo as GeneratedEditorTypeProvider, st as BasePluginInput, tt as EditorCompilation, ut as EditorPropertyTypes } from "../core-ClHasORr.js";
1
+ import { h as EditorApplicationSchema } from "../htmlTypes-aE9Qlenu.js";
2
+ import { Xo as GeneratedEditorTypeProvider, st as BasePluginInput, tt as EditorCompilation, ut as EditorPropertyTypes } from "../core-Bu--Bog3.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, $t as EditorNodeUnsetOptions, Aa as NodeOf, Ar as EditorToggleBlockOptions, Cc as SchemaTextProperties, Cs as SchemaContent, Dc as SchemaTextPropertyOptions, Er as EditorStateViewProvider, Es as SchemaContentOptions, F as DecorationAttributes, Ga as NodeTypeSelector, Gi as LeafPosition, H as Descendant, Hn as EditorSchemaPlugin, Hs as SchemaElementPropertiesFor, Ht as EditorLevelsOptions, I as DecorationRefresh, Ia as NodeSetNodesOptions, Io as PluginTypeProvider, Is as SchemaElement, It as EditorGenericMethod, Js as SchemaElementShapeFor, Jt as EditorNodeChangeContext, K as DescendantIn, Ki as Location, Lo as PluginTypeProviderOf, Lr as EditorTransactionChangeContext, Ls as SchemaElementConstructionPropertiesFor, Ma as NodeRemoveNodesOptions, Mi as HistoryApi, Mn as EditorSchemaDerivedDefinition, Mo as PluginReference$1, Nn as EditorSchemaElement, Oc as SchemaTypesTarget, On as EditorSchemaContribution, Or as EditorTextChangeContext, P as Decoration, Pa as NodeSelection, Ps as SchemaContentRule, Qi as MaximizeMode, Qn as EditorSchemaSourceProvider, Qo as PropertyJsonDescriptor, Qr as EditorTransactionSpecBuilder, Qs as SchemaElementTypes, Qt as EditorNodeTypeProvider, R as DefinitionOf$1, Ra as NodeTarget, S as BaseText, Si as Element, So as PluginInstalledCapabilitiesOf, St as EditorDirectUpdate, Ta as NodeMatchPredicate, Tc as SchemaTextPropertyDefinition, To as PluginPortal, Tt as EditorDocumentValue, Ul as TransferPlugin$1, Un as EditorSchemaPluginProvider, Us as SchemaElementProperty, Vo as PluginWitnessFor, Vt as EditorJsonValue, Wl as TransferRead, Wo as Point$1, Ws as SchemaElementPropertyDefinition, Wt as EditorLifecycleErrorSink, X as EditorAboveOptions, Xr as EditorTransactionSelectionApi, Y as Editor$1, Yo as PropertyBooleanDescriptor, Z as EditorBlockOptions, Za as Path, Zo as PropertyEnumDescriptor, Zt as EditorNodeGetOptions, _a as NodeInsertNodesOptions, _l as TextInsertFragmentOptions, _o as PluginDependencyReferenceFor, ac as SchemaProperty, b as BasePoint, bc as SchemaTarget, bn as EditorSchemaContract, ci as EditorUpdatePolicy, cl as Text$1, cs as PropertyValueOf, da as NodeEntry, dn as EditorReadMethods, do as PluginContribution, en as EditorNodesOptions, es as PropertyNumberDescriptor, eu as TxDeclaredMethod, fc as SchemaPropertyKey, fi as EditorUpdateTransaction, ga as NodeIn, go as PluginDependencyReference, hi as EditorUpdateValueFromPlugin, ho as PluginDependencyContractReference, ic as SchemaPluginsOf, is as PropertyStringDescriptor, j as ContentSlice, jl as TransferApi, ki as ElementOf, kl as TransactionSpec, ks as SchemaContentRootContribution, lc as SchemaPropertyHandle, ln as EditorReadMethodRecord, lo as PluginCapabilities, ls as PropertyValueOptions, m as AuthoredProjectionDiagnostic, mi as EditorUpdateTransactionProvider, mo as PluginDefinitionInput, mt as EditorCommitContext, nc as SchemaKeyPrefix, nn as EditorParentOptions, no as PersistedDocumentInput, oi as EditorUpdateContext, ol as StructuralPlainTextDiagnostic, or as EditorSelection, os as PropertyValueDescriptor, pi as EditorUpdateTransactionOf, po as PluginDefinition, qt as EditorNextOptions, ra as Node$1, rc as SchemaNodeTypeProvider, rn as EditorPreviousOptions, ro as Plugin, ru as Value, sc as SchemaPropertyDefinition, si as EditorUpdateMethods, sr as EditorSelectionBlockOptions, tn as EditorNodesReadOptions, ts as PropertyOptionsOf, tu as TxMethodDeclarations, un as EditorReadMethodTree, us as Range, v as BaseElement, vl as TextInsertTextOptions, vr as EditorStateSchemaApi, vt as EditorCoreStateView, w as BlockInsertOptions$1, wa as NodeMatch, wc as SchemaTextProperty, wr as EditorStateView, ws as SchemaContentDefault, xa as NodeKey, xc as SchemaText, xs as RootKey, yi as EditorValueTypeProvider, yr as EditorStateSelectionApi, zt as EditorInstalledUpdateGroups } from "./index-DpltOCot-A2b3p3Eb.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-cg_cWsaN.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-B5mYEawV.js";
4
- import { d as HistoryTxApi, s as HistoryPlugin$1, u as HistoryStateApi } from "./index-baQOK89E.js";
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-QuqD4Dyj-DlOIX0sH.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-aE9Qlenu.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-DlBey0zf.js";
4
+ import { d as HistoryTxApi, s as HistoryPlugin$1, u as HistoryStateApi } from "./index-CTwrWir_.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?: NodeTarget;
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<InputRule<any, TEditor> | InputRuleReference>;
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>, 'split'> & {
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> = Omit<EditorNodeGetOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorAboveOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorBlockOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorLevelsOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorNextOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorPreviousOptions<TNode>, 'match' | 'type'> & {
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> = Omit<EditorParentOptions<TNode>, 'match' | 'type'> & {
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> = Omit<NonNullable<TOptions>, 'match' | 'type'> & {
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 $, InferEnabled as $a, definePlugin as $i, HeadingRules as $n, InputRulesDefinition as $r, UpsertLinkOptions as $t, DefinePluginFormats as A, RenderElementFn as Aa, AutoScrollOptions as Ai, CapturedFormat as An, PluginSelectorMethods as Ao, BaseParagraphDefinition as Ar, PlainTextSerializeResult as At, InjectNodeProps as B, AnyBasePluginDefinition as Ba, DebugPlugin as Bi, BaseStrikethroughPlugin as Bn, WithRequiredName as Bo, HtmlPlugin as Br, OutdentListOptions as Bt, BasePluginOn as C, MarkdownTagNode as Ca, ElementStatePlugin as Ci, BaseTextAlignPlugin as Cn, PluginSchemaContext as Co, RenderTextFn as Cr, PluginTransaction as Ct, ConfiguredPluginDescriptor as D, PluginFormatRegistry as Da, AutoScrollApi as Di, TextIndentDefinition as Dn, PluginSchemaReferences as Do, RenderLeafFn as Dr, PlainTextDiagnostic as Dt, ConfiguredBasePlugin as E, PluginFormatModelView as Ea, ElementIdPluginState as Ei, TextAlignDefinition as En, PluginSchemaMark as Eo, RenderTextProps as Er, CorePlugins as Et, HtmlMatchValue as F, ElementWith as Fa, ScrollIntoViewTarget as Fi, BaseCodePlugin as Fn, RuleDecision as Fo, createBlockStartInputRule as Fr, BulletedListRules as Ft, PluginShortcutInput as G, DefinitionOf as Ga, AffinityEdgeNodes as Gi, ItalicRules as Gn, AnyObject as Go, BlockStartInputRuleConfig as Gr, BaseLinkDefinition as Gt, LeafStaticProps as H, BasePluginDefinition as Ha, EditorError as Hi, BoldRules as Hn, InferPluginSchema as Ho, BaseInputRule as Hr, ToggleListOptions as Ht, HtmlMatcher as I, PluginFormatNode as Ia, ScrollMode as Ii, BaseHighlightPlugin as In, SelectionRules as Io, createMarkInputRule as Ir, ListElement as It, RenderStaticNodeWrapperProps as J, GetInjectNodePropsOptions as Ja, TransferDefinition as Ji, ScriptValue as Jn, GeneratedEditorTypeProvider as Jo, InputRule as Jr, CreateLinkNodeOptions as Jt, RenderStaticNodeWrapper as K, DeleteRules as Ka, AffinityPlugin as Ki, MarkComboRules as Kn, UnknownObject as Ko, BlockStartInputRuleMatch as Kr, BaseLinkPlugin as Kt, HtmlNodeSpec as L, TextWith as La, DebugApi as Li, BaseItalicPlugin as Ln, StructuralRuleContext as Lo, createTextSubstitutionInputRule as Lr, ListStyle as Lt, HtmlAttributes as M, RenderElementSlots as Ma, DomApi as Mi, FormattingContribution as Mn, PluginSelectors as Mo, inputRuleVeto as Mr, BULLETED_LIST_STYLES as Mt, HtmlContentToken as N, HandlerReturnType as Na, DomPluginState as Ni, formatting$1 as Nn, PluginStore as No, defineInputRule as Nr, BaseListDefinition as Nt, DeclaredPluginShortcutInput as O, PluginFormatSchemaView as Oa, AutoScrollChangeKind as Oi, TextIndentPluginState as On, PluginSelector as Oo, RenderLeafProps as Or, PlainTextDocumentOptions as Ot, HtmlElementPatch as P, DocxNodeMapping as Pa, DomPluginUpdate as Pi, BaseBoldPlugin as Pn, PluginViewStore as Po, createBlockFenceInputRule as Pr, BaseListPlugin as Pt, PluginCompatibilityArguments as Q, InferDependencies as Qa, HistoryPluginState as Qi, HeadingLevel as Qn, InputRulesConfig as Qr, UnwrapLinkOptions as Qt, HtmlPrepareDiagnosticInput as R, nanoid$1 as Ra, DebugDefinition as Ri, BaseKbdPlugin as Rn, StructuralRuleEditor as Ro, matchBlockStart as Rr, ListType as Rt, BasePluginImplementationContext as S, MarkdownTagAttributeView as Sa, ElementStateDefinition as Si, BaseLineHeightPlugin as Sn, PluginSchema as So, EditableProps as Sr, PluginState as St, BasePluginPortal as T, PluginFormatContext as Ta, ElementIdPlugin as Ti, LineHeightDefinition as Tn, PluginSchemaElement as To, RenderTextPieceProps as Tr, CoreEditorApi as Tt, NodeStaticProps as U, BaseTransformOptions as Ua, LogLevel as Ui, CodeRules as Un, InferPluginSchemaContribution as Uo, BlockFenceInputRuleConfig as Ur, isOrderedList as Ut, InternalBasePluginRuntimeExtension as V, BaseInjectProps as Va, DebugPluginState as Vi, BaseUnderlinePlugin as Vn, InferPluginNodeTypeProvider as Vo, decodeHtmlDataTransfer as Vr, TaskListRules as Vt, PartialBasePlugin as W, BreakRules as Wa, AffinityDefinition as Wi, HighlightRules as Wn, Nullable as Wo, BlockFenceInputRuleMatch as Wr, isListLevels as Wt, TransformOptions as X, InferApi as Xa, HistoryDefinition as Xi, UnderlineRules as Xn, InputRuleInsertTextOptions as Xr, LinkElement as Xt, TextStaticProps as Y, GetInjectNodePropsReturnType as Ya, TransferPlugin as Yi, StrikethroughRules as Yn, InputRuleEditor as Yr, LinkAttributes as Yt, MergePluginDefinitions as Z, InferConflicts as Za, HistoryPlugin as Zi, BaseHeadingPlugin as Zn, InputRuleTarget as Zr, LinkRules as Zt, BasePlugin as _, MarkdownNodeKinds as _a, TextSubstitutionInputRuleConfig as _i, Alignment as _n, PluginBaseContext as _o, getFragmentProp as _r, NodeInsertOptions as _t, SingleLinePlugin as a, BasePluginInstalledCapabilityWitness as aa, InsertDataInputRuleReadContext as ai, IndentPluginState as an, InferPluginStoreState as ao, getPluginNodeClass as ar, RuntimePluginsFromTuple as at, BasePluginDefinitionInput as b, MarkdownPluginRegistry as ba, TransformInputRuleContext as bi, BaseFontFamilyPlugin as bn, PluginPortalContext as bo, ApplyDeepToNodesOptions as br, PluginReadCapability as bt, PLUGINS as c, PlainTextEncodeContext as ca, InsertTextInputRuleReadContext as ci, BaseCodeBlockPlugin as cn, InferRead as co, mergeDeepToNodes as cr, BlockInsertOptions as ct, InferBaseEditorPlugins as d, MarkdownDecodeContext as da, MatchBlockFenceOptions as di, CodeBlockElement as dn, InferUpdate as do, Hotkeys as dr, InferEditorRuntimePlugins as dt, PluginInitialStateInput as ea, InsertBreakInputRule as ei, WrapLinkOptions as en, InferName as eo, ToggleHeadingOptions as er, CreateEditorOptions as et, InternalBaseEditorWithInstalledPlugins as f, MarkdownEncodeContext as fa, MatchBlockStartOptions as fi, CodeHighlightDefinition as fn, MergeRules as fo, createHotkey as fr, InferRuntimePlugins as ft, AnyPluginBase as g, MarkdownNodeKind as ga, SelectionInputRuleContext as gi, HighlightResult as gn, NormalizeRules as go, GetFragmentPropOptions as gr, MergeInstalledPluginDefinitions as gt, AnyBasePluginPortal as h, MarkdownMarks as ha, ResolvedInputRulesMeta as hi, HighlightNode as hn, NormalizePluginState as ho, FragmentPropMode as hr, InternalInstalledSchemaMutationProvider as ht, TrailingBlockPluginState as i, BasePluginDependencyReferences as ia, InsertDataInputRuleContext as ii, IndentDefinition as in, InferPluginReadGroups as io, HorizontalRuleRules as ir, PlatePluginsFromTuple as it, EditorShortcut as j, RenderElementProps as ja, AutoScrollUpdate as ji, FormattingBlockEntry as jn, PluginSelectorReturn as jo, BaseParagraphPlugin as jr, serializePlainText as jt, Decorate as k, ElementContentRootSlot as ka, AutoScrollChangesMap as ki, BaseFormattingPlugin as kn, PluginSelectorArgs as ko, StaticRenderLeafProps as kr, PlainTextEditorOptions as kt, PluginName as l, PlainTextNodeMapping as la, MarkInputRuleConfig as li, BaseCodeHighlightPlugin as ln, InferSelectors as lo, isUrl as lr, BlockUpsertOptions as lt, AnyBasePluginContext as m, MarkdownMarkWrapper as ma, ResolvedInputRule as mi, CodeHighlightPluginState as mn, NormalizePluginSelectors as mo, getInjectMatch as mr, InternalInstalledSchemaDefinitionsProvider as mt, TrailingBlockDefinition as n, BasePluginDependencyDescriptors as na, InsertBreakInputRuleReadContext as ni, BaseIndentPlugin as nn, InferOwnRead as no, BaseHorizontalRulePlugin as nr, EditorOptions as nt, SingleBlockPlugin as o, LowerBasePlugin as oa, InsertTextInputRule as oi, isNonNegativeSafeInteger as on, InferPluginUpdateGroups as oo, isPluginElementClass as or, createEditor as ot, AnyBasePlugin as p, MarkdownMarkWrapContext as pa, MatchDelimitedInlineOptions as pi, CodeHighlightLowlight as pn, NodeComponent as po, isHotkey as pr, InternalEditorMutationProvider as pt, RenderStaticNodeWrapperFunction as q, EditOnlyConfig as qa, AffinityPluginUpdate as qi, ScriptRules as qn, GeneratedEditorMutations as qo, DelimitedInlineInputRuleMatch as qr, BaseLinkPluginState as qt, TrailingBlockPlugin as r, BasePluginDependencyReferenceFor as ra, InsertDataInputRule as ri, IndentChangeOptions as rn, InferOwnUpdate as ro, BlockquoteRules as rr, EditorValueInput as rt, ExitBreakPlugin as s, NormalizeBasePluginInput$1 as sa, InsertTextInputRuleContext as si, CodeBlockRules as sn, InferPluginViewState as so, isPluginNodeClass as sr, BasePluginInput as st, isNominalPluginDescriptor as t, RequiredPluginState as ta, InsertBreakInputRuleContext as ti, getLinkHref as tn, InferOwnApi as to, BaseBlockquotePlugin as tr, EditorCompilation as tt, Editor as u, PlainTextNodeMappingInput as ua, MarkInputRuleMatch as ui, CodeBlockDefinition as un, InferTargetPlugins as uo, isDefined as ur, EditorPropertyTypes as ut, BasePluginConfiguration as v, MarkdownNodeMapping as va, TextSubstitutionMatch as vi, BaseFontBackgroundColorPlugin as vn, PluginDefinitionWitness as vo, IS_APPLE as vr, PluginDirectUpdate as vt, BasePluginOverride as w, HtmlMappingDiagnosticInput as wa, ElementIdEntry as wi, BaseTextIndentPlugin as wn, PluginSchemaDeclaration as wo, RenderTextHostProps as wr, PluginUpdate as wt, BasePluginExtendInput as x, MarkdownRefusal as xa, ElementStateApi as xi, BaseFontSizePlugin as xn, PluginReference as xo, applyDeepToNodes as xr, PluginReadState as xt, BasePluginContext as y, MarkdownNodeMappingInput as ya, TextSubstitutionPattern as yi, BaseFontColorPlugin as yn, PluginDependency as yo, defaultsDeepToNodes as yr, PluginOwnUpdate as yt, HtmlWrapperSpec as z, InternalPluginDefinitionOf as za, DebugErrorType as zi, BaseScriptPlugin as zn, WithAnyName as zo, matchDelimitedInline as zr, OrderedListRules as zt };
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 };
@@ -1,5 +1,5 @@
1
- import { ru as Value, vr as EditorStateSchemaApi } from "../index-DpltOCot-A2b3p3Eb.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-Dt-unJZY-DCddmbSD.js";
1
+ import { su as Value, yr as EditorStateSchemaApi } from "../index-QuqD4Dyj-DlOIX0sH.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-Bvvxzxq2-08gzpgF6.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 provides its model.
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
 
@@ -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 ? elementId.read.entry(id) : undefined;
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. - **Default:** `'div'`
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. - **Default:** `'span'`
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. - **Default:** `'span'`
771
+ The component type to render as.
772
+ - **Default:** `'span'`
733
773
  </APIItem>
734
774
  </APIProps>
735
775
  </API>
@@ -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
- it follows an `EditorContent` in another `EditorRoot`, its DOM calls run in
37
- that `EditorContent`, but `resolveEventRange` returns `null` for an event
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 any view of the editor
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`,
@@ -128,9 +125,11 @@ while it holds it. An unmounted editor only clears its focused state.
128
125
  #### `editor.api.dom.focus(options?: { retries?: number }): void`
129
126
 
130
127
  Focus the editor's [view](#views). Does nothing when no view is picked. The
131
- root's `nodeSelectionFocus` element takes focus while there is no selection or
132
- a node selection holds only the root's top-level blocks, and a range shown
133
- across roots stays shown.
128
+ root's `nodeSelectionFocus` element takes focus while no range is shown into
129
+ the root and the root's own selection is none or a node selection of its
130
+ top-level blocks, including one the root kept while the caret was in another
131
+ root. A range shown into the root stays shown. Inside an open update or read,
132
+ such a root's editable takes focus instead.
134
133
 
135
134
  #### `editor.api.dom.deselect(): void`
136
135