platejs 54.0.0-beta.5 → 54.0.0-beta.6

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 (157) hide show
  1. package/dist/{AIChatRequestContext-CwCmEMVV.d.ts → AIChatRequestContext-BYpGufVe.d.ts} +2 -2
  2. package/dist/{BaseSuggestionPlugin-CpVkv7k2.d.ts → BaseSuggestionPlugin-C52LR8RN.d.ts} +4 -4
  3. package/dist/{PlateStatic-C7FfXu-Z.d.ts → PlateStatic-DMClx-tH.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-BhhymlUs.d.ts → combobox-DgYdu5mZ.d.ts} +2 -2
  9. package/dist/{comparison-types-Bvvxzxq2-08gzpgF6.d.ts → comparison-types-DBQFu7Rt-DYc2TC2H.d.ts} +1 -1
  10. package/dist/compiler/index.d.ts +2 -2
  11. package/dist/{core-Bu--Bog3.d.ts → core-CQKT9eNc.d.ts} +6 -6
  12. package/dist/diff/index.d.ts +2 -2
  13. package/dist/docs/annotations.md +4 -2
  14. package/dist/docs/api/anchor.md +15 -0
  15. package/dist/docs/api/core/plate-components.md +12 -4
  16. package/dist/docs/api/core.md +4 -3
  17. package/dist/docs/api/range.md +17 -0
  18. package/dist/docs/authored-changes.md +3 -3
  19. package/dist/docs/board.md +2 -1
  20. package/dist/docs/comment.md +3 -1
  21. package/dist/docs/editor.md +5 -2
  22. package/dist/docs/field.md +148 -20
  23. package/dist/docs/installation/plate-ui.md +40 -14
  24. package/dist/docs/llms.txt +1 -1
  25. package/dist/docs/migration/plite-to-plate.md +105 -4
  26. package/dist/docs/plugin-methods.md +3 -1
  27. package/dist/docs/roots.md +18 -1
  28. package/dist/docs/selection.md +5 -0
  29. package/dist/docs/suggestion.md +2 -2
  30. package/dist/docs/toolbar.md +11 -2
  31. package/dist/docx/export/index.d.ts +3 -3
  32. package/dist/docx/export/lib/internal/unit-conversion.js +1 -1
  33. package/dist/docx/export/lib/internal/xml-builder.js +1 -1
  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/board/lib/boardShape.internal.js +1 -1
  42. package/dist/features/callout/index.d.ts +3 -3
  43. package/dist/features/combobox/index.d.ts +2 -2
  44. package/dist/features/comments/index.d.ts +1 -1
  45. package/dist/features/date/index.d.ts +3 -3
  46. package/dist/features/details/index.d.ts +3 -3
  47. package/dist/features/field/index.d.ts +2 -2
  48. package/dist/features/field/index.js +2 -2
  49. package/dist/features/field/lib/BaseFieldPlugin.js +108 -39
  50. package/dist/features/field/lib/applyFieldValues.js +312 -82
  51. package/dist/features/field/lib/fieldRules.internal.js +84 -1
  52. package/dist/features/find/index.d.ts +3 -3
  53. package/dist/features/footnote/index.d.ts +1 -1
  54. package/dist/features/ink/index.d.ts +1 -1
  55. package/dist/features/ink/lib/BaseInkPlugin.js +28 -31
  56. package/dist/features/ink/lib/inkCodec.internal.js +16 -1
  57. package/dist/features/ink/lib/inkGone.internal.js +1 -1
  58. package/dist/features/ink/lib/inkMatch.internal.js +35 -11
  59. package/dist/features/ink/lib/inkPlaces.internal.js +8 -3
  60. package/dist/features/layout/index.d.ts +1 -1
  61. package/dist/features/lint/index.d.ts +3 -3
  62. package/dist/features/list/lib/listIndex.internal.js +1 -1
  63. package/dist/features/list/lib/listNumbering.internal.js +1 -1
  64. package/dist/features/media/index.d.ts +1 -1
  65. package/dist/features/mention/index.d.ts +5 -5
  66. package/dist/features/suggestion/BaseSuggestionPlugin.js +3 -2
  67. package/dist/features/suggestion/index.d.ts +5 -4
  68. package/dist/features/suggestion/suggestionColorOf.js +5 -4
  69. package/dist/features/table/index.d.ts +1 -1
  70. package/dist/features/table/lib/internal/selection.js +1 -1
  71. package/dist/features/toc/index.d.ts +1 -1
  72. package/dist/features/upload/index.d.ts +1 -1
  73. package/dist/history/index.d.ts +2 -2
  74. package/dist/html/index.d.ts +3 -3
  75. package/dist/html/server/index.d.ts +1 -1
  76. package/dist/{htmlTypes-aE9Qlenu.d.ts → htmlTypes-8IFX0ezP.d.ts} +1 -1
  77. package/dist/hyperscript/index.d.ts +1 -1
  78. package/dist/{index-CbcYN_S_.d.ts → index-AOVPovEr.d.ts} +150 -18
  79. package/dist/{index-C9WSACSv.d.ts → index-B4oeyc99.d.ts} +1 -1
  80. package/dist/{index-BYAqyTSY.d.ts → index-BAz_KJSV.d.ts} +2 -2
  81. package/dist/{index-DqKFQcfb.d.ts → index-BBsiQIzw.d.ts} +2 -2
  82. package/dist/{index-CTwrWir_.d.ts → index-BIP1GoWI.d.ts} +1 -1
  83. package/dist/{index-Bf6EwY5O.d.ts → index-BTFrh2Cz.d.ts} +2 -2
  84. package/dist/{index-CYR4jNU7.d.ts → index-BapA_uvI.d.ts} +4 -4
  85. package/dist/{index-DhVOU0pS.d.ts → index-BbsVGwn8.d.ts} +6 -6
  86. package/dist/{index-DlBey0zf.d.ts → index-BcuSI8EM.d.ts} +1 -1
  87. package/dist/{index-Be_YFFLS.d.ts → index-BfHCmKG3.d.ts} +41 -16
  88. package/dist/{index-CRmyGzS8-BTrk6JzL.d.ts → index-BvQzYVAW-Jvz2iG8B.d.ts} +1 -1
  89. package/dist/{index-BT1-fX5o.d.ts → index-C-5w6252.d.ts} +3 -3
  90. package/dist/{index-dpi2ErEe.d.ts → index-Cp0QfjUV.d.ts} +3 -3
  91. package/dist/{index-DhurStYU.d.ts → index-CrUMAwqm.d.ts} +5 -1
  92. package/dist/{index-CGUt4h_4.d.ts → index-D2w_9_tb.d.ts} +3 -3
  93. package/dist/{index-BR2S-6Js.d.ts → index-DE1Mcccg.d.ts} +3 -3
  94. package/dist/{index-DFvzP8N_.d.ts → index-DFMkcY5V.d.ts} +4 -4
  95. package/dist/{index-QuqD4Dyj-DlOIX0sH.d.ts → index-DHt8nZQ6-NUTahb8N.d.ts} +111 -70
  96. package/dist/{index-BXs4598V.d.ts → index-DM6z4D7q.d.ts} +5 -5
  97. package/dist/{index-CeVE8JR-.d.ts → index-DUk2VZ_1.d.ts} +3 -3
  98. package/dist/{index-DqpzKYwP.d.ts → index-DbPoiwq_.d.ts} +3 -3
  99. package/dist/{index-DgVsTFYL.d.ts → index-Dh7pWHZo.d.ts} +3 -3
  100. package/dist/{index-BwmXxqbi-COlJb0HZ.d.ts → index-PDROnF1G-Ds_dbJsr.d.ts} +1 -1
  101. package/dist/index.d.ts +3 -3
  102. package/dist/internal/penStroke.internal.js +28 -3
  103. package/dist/internal/plugin/OverridePlugin.js +2 -0
  104. package/dist/internal/plugin/compilePlateModel.js +2 -8
  105. package/dist/internal/plugin/pluginStore.js +0 -3
  106. package/dist/internal/plugin/resolvePlugins.js +1 -1
  107. package/dist/lib/plugin/createPluginContext.internal.js +2 -3
  108. package/dist/lib/plugins/html/HtmlPlugin.js +1 -0
  109. package/dist/markdown/index.d.ts +1 -1
  110. package/dist/markdown/lib/internal/markdownRawHtml.js +1 -1
  111. package/dist/markdown/lib/serializer/convertNodesSerialize.js +1 -1
  112. package/dist/markdown/lib/serializer/listToMdastTree.js +1 -1
  113. package/dist/math/index.d.ts +3 -3
  114. package/dist/math/react/index.d.ts +4 -4
  115. package/dist/migrations/index.d.ts +3 -3
  116. package/dist/pagination/index.d.ts +1 -1
  117. package/dist/pagination/react/index.d.ts +2 -2
  118. package/dist/react/features/board/BoardShape.js +351 -130
  119. package/dist/react/features/board/boardIndex.internal.js +2 -1
  120. package/dist/react/features/board/boardInk.internal.js +2 -13
  121. package/dist/react/features/board/index.d.ts +55 -43
  122. package/dist/react/features/board/index.js +2 -2
  123. package/dist/react/features/callout/index.d.ts +3 -3
  124. package/dist/react/features/combobox/index.d.ts +5 -5
  125. package/dist/react/features/comments/index.d.ts +6 -6
  126. package/dist/react/features/date/index.d.ts +4 -4
  127. package/dist/react/features/details/index.d.ts +4 -4
  128. package/dist/react/features/field/index.d.ts +20 -5
  129. package/dist/react/features/footnote/index.d.ts +7 -7
  130. package/dist/react/features/format-painter/index.d.ts +4 -4
  131. package/dist/react/features/ink/InkContent.js +45 -20
  132. package/dist/react/features/ink/InkPlugin.js +52 -5
  133. package/dist/react/features/ink/index.d.ts +312 -16
  134. package/dist/react/features/ink/inkCapture.internal.js +36 -9
  135. package/dist/react/features/ink/inkMeasure.internal.js +1 -1
  136. package/dist/react/features/ink/inkPaint.internal.js +13 -6
  137. package/dist/react/features/ink/inkPick.internal.js +218 -0
  138. package/dist/react/features/ink/inkPlacement.internal.js +8 -3
  139. package/dist/react/features/ink/inkWatch.internal.js +1 -1
  140. package/dist/react/features/layout/index.d.ts +5 -5
  141. package/dist/react/features/media/index.d.ts +5 -5
  142. package/dist/react/features/mention/index.d.ts +6 -6
  143. package/dist/react/features/suggestion/index.d.ts +6 -6
  144. package/dist/react/features/table/index.d.ts +5 -5
  145. package/dist/react/features/toc/index.d.ts +2 -2
  146. package/dist/react/features/upload/index.d.ts +5 -5
  147. package/dist/react/index.d.ts +5 -5
  148. package/dist/react/internal/rendered-attributes.js +1 -1
  149. package/dist/react/virtualized.d.ts +2 -2
  150. package/dist/{source-GMnTi_Vr.d.ts → source-D5CyclpX.d.ts} +3 -3
  151. package/dist/static/index.d.ts +5 -5
  152. package/dist/tabbable/index.d.ts +1 -1
  153. package/dist/tabbable/react/index.d.ts +3 -3
  154. package/dist/testing/index.d.ts +2 -2
  155. package/dist/yjs/index.d.ts +1 -1
  156. package/dist/yjs/react/index.d.ts +5 -5
  157. package/package.json +2 -2
@@ -1,5 +1,5 @@
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";
1
+ import { $a as Path, Fc as Selection, La as NodeSelectionMode, ps as Range, su as Value } from "./index-DHt8nZQ6-NUTahb8N.js";
2
+ import "./core-CQKT9eNc.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 { 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";
1
+ import { Ca as NodeKey, Ji as Location, iu as TxDeclaredMethod, oo as Plugin, ou as TxOnlyMethod } from "./index-DHt8nZQ6-NUTahb8N.js";
2
+ import "./htmlTypes-8IFX0ezP.js";
3
+ import { Co as PluginReference, V as InternalBasePluginRuntimeExtension, _ as BasePlugin, aa as BasePluginDependencyReferenceFor, xo as PluginDependency } from "./core-CQKT9eNc.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-BBsiQIzw.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-QuqD4Dyj-DlOIX0sH.js";
2
- import "./htmlTypes-aE9Qlenu.js";
3
- import { u as Editor } from "./core-Bu--Bog3.js";
1
+ import { Tt as EditorDocumentValue } from "./index-DHt8nZQ6-NUTahb8N.js";
2
+ import "./htmlTypes-8IFX0ezP.js";
3
+ import { u as Editor } from "./core-CQKT9eNc.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-CwCmEMVV.js";
1
+ import { a as AIToolName, i as AIChatRequestRefs, n as AIChatRequestNodeRef, o as resolveAIChatRequestContext, r as AIChatRequestNodeSelection, t as AIChatRequestContext } from "../AIChatRequestContext-BYpGufVe.js";
2
2
  export { AIChatRequestContext, AIChatRequestNodeRef, AIChatRequestNodeSelection, AIChatRequestRefs, AIToolName, resolveAIChatRequestContext };
@@ -1,12 +1,12 @@
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";
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-DHt8nZQ6-NUTahb8N.js";
2
+ import "../../htmlTypes-8IFX0ezP.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-CQKT9eNc.js";
4
+ import { c as HistoryPluginTypeProvider, d as HistoryTxApi, n as History, u as HistoryStateApi } from "../../index-BIP1GoWI.js";
5
+ import { a as AIToolName } from "../../AIChatRequestContext-BYpGufVe.js";
6
+ import { At as Plugin$1, n as InternalReactEditorWithInstalledPlugins, t as Editor, xt as InternalPluginAuthorExtension } from "../../index-BbsVGwn8.js";
7
+ import { O as MarkdownSyncPlugin, d as Unsafe, i as MarkdownEditor, l as Handle, n as MarkdownApi, u as Join } from "../../index-DUk2VZ_1.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-BBsiQIzw.js";
9
+ import "../../index-BapA_uvI.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-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";
1
+ import { h as AuthoredProjectionRefusal, m as AuthoredProjectionDiagnostic, p as AuthoredDocumentProjection } from "../index-DHt8nZQ6-NUTahb8N.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-BBsiQIzw.js";
3
+ import { t as AuthoredPlugin } from "../index-BapA_uvI.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-DhVOU0pS.js";
1
+ import { Xn as ExternalTextAdapter } from "../../index-BbsVGwn8.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-QuqD4Dyj-DlOIX0sH.js";
2
- import { u as Editor } from "./core-Bu--Bog3.js";
1
+ import { vt as EditorCoreStateView } from "./index-DHt8nZQ6-NUTahb8N.js";
2
+ import { u as Editor } from "./core-CQKT9eNc.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, Tt as EditorDocumentValue, su as Value, zn as EditorSchemaIdentity } from "./index-QuqD4Dyj-DlOIX0sH.js";
1
+ import { J as DocumentChange, Tt as EditorDocumentValue, su as Value, zn as EditorSchemaIdentity } from "./index-DHt8nZQ6-NUTahb8N.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-aE9Qlenu.js";
2
- import { Xo as GeneratedEditorTypeProvider, st as BasePluginInput, tt as EditorCompilation, ut as EditorPropertyTypes } from "../core-Bu--Bog3.js";
1
+ import { h as EditorApplicationSchema } from "../htmlTypes-8IFX0ezP.js";
2
+ import { Xo as GeneratedEditorTypeProvider, st as BasePluginInput, tt as EditorCompilation, ut as EditorPropertyTypes } from "../core-CQKT9eNc.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, $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";
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-DHt8nZQ6-NUTahb8N.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-8IFX0ezP.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-BcuSI8EM.js";
4
+ import { d as HistoryTxApi, s as HistoryPlugin$1, u as HistoryStateApi } from "./index-BIP1GoWI.js";
5
5
  import { Draft } from "mutative";
6
6
  import { nanoid as nanoid$1 } from "nanoid";
7
7
  import "zustand/vanilla";
@@ -836,7 +836,7 @@ type PluginFormatNode<D extends AnyBasePluginDefinition> = [FormatElementNode<D>
836
836
  type DocxNodeMapping<D extends AnyBasePluginDefinition> = Readonly<{
837
837
  /**
838
838
  * What Word keeps and drops of each element, such as "Word keeps each field
839
- * answer and drops its settings." It is the warning's message.
839
+ * answer and drops its name and settings." It is the warning's message.
840
840
  */
841
841
  dropped: string;
842
842
  /** The text Word export writes in place of `node`. */
@@ -9589,7 +9589,7 @@ type ValidatePluginWritablePropertyPatch<D, TProps> = [InvalidPluginWritableProp
9589
9589
  type PluginWritablePropertyPatch<D> = { [TKey in PluginExactWritablePropertyKey<D>]?: PluginWritablePropertyPatchValue<D, TKey>; };
9590
9590
  type PluginForbiddenWritablePropertyPatch<D> = { [TKey in PluginForbiddenWritablePropertyKey<D>]?: never; };
9591
9591
  type PluginNodeSetProps<D> = Partial<Omit<Element, 'children'>> & PluginWritablePropertyPatch<D> & PluginForbiddenWritablePropertyPatch<D>;
9592
- type PluginNodeSetOptions = Omit<NodeSetNodesOptions<any>, 'at'> & {
9592
+ type PluginNodeSetOptions = Omit<NodeSetNodesOptions<Element>, 'at'> & {
9593
9593
  at?: Descendant | ElementIdTarget | Location | NodeKey | NodeSelection;
9594
9594
  };
9595
9595
  type NodeSelectorOptions<TOptions, TNode extends Node$1, TSelector> = SelectorOptions<NonNullable<TOptions>> & {
@@ -1,5 +1,5 @@
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";
1
+ import { su as Value, yr as EditorStateSchemaApi } from "../index-DHt8nZQ6-NUTahb8N.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-DBQFu7Rt-DYc2TC2H.js";
3
3
  type TwoWayInput<V extends Value> = Readonly<{
4
4
  after: unknown;
5
5
  before: unknown;
@@ -69,8 +69,10 @@ const annotations = [
69
69
  ];
70
70
  ```
71
71
 
72
- Use `nearest` for durable annotations. Complete deletion collapses the range to
73
- a valid position, while saved undo and redo restore its exact endpoints.
72
+ Use `nearest` for durable annotations. A range whose text is deleted still
73
+ spans the place where the text was.
74
+ [`editor.read.ranges.isEmpty`](/docs/api/range#editor-reads) tells whether it
75
+ still covers anything, and saved undo and redo restore its exact endpoints.
74
76
 
75
77
  When annotations come from React state, pass the current array. A new array
76
78
  identity refreshes the store automatically.
@@ -28,6 +28,21 @@ const target = editor.anchor(selection, {
28
28
  - `"nearest"` resolves to the nearest valid location. Saved undo and redo
29
29
  restore the exact value recorded on each side of the history batch.
30
30
 
31
+ A `"nearest"` range whose text is deleted still spans the place where the text
32
+ was. [`editor.read.ranges.isEmpty`](/docs/api/range#editor-reads)
33
+ tells whether it still covers anything, and undo brings the text back inside it.
34
+
35
+ When a drag, or a paste that directly follows its cut, moves all of a
36
+ `"nearest"` range's text within one root, the range moves with the text, and
37
+ undo and redo move it back and forth. When the gesture moves part of the text,
38
+ the range keeps the part that stays, and letters the gesture brings from
39
+ outside the range never join it. A drop that rebuilds the block holding that
40
+ part maps the range by position instead. A move recorded in a view that
41
+ proposes changes keeps the range on the struck original until the move is
42
+ decided. A copy, a second paste, a paste without formatting, a paste after
43
+ another edit or into another editor or root, and an editor bound to Yjs map
44
+ the range by position.
45
+
31
46
  Paths and points accept `"backward"` or `"forward"` association. Ranges also
32
47
  accept `"inward"` and `"outward"`. Ranges default to `"inward"`, so text inserted at either edge stays outside the anchored span; paths and points default to `"forward"`. Pass `root` for a rootless value that belongs
33
48
  to a named document root.
@@ -288,8 +288,10 @@ export function Editor(props: EditorContentProps) {
288
288
  return (
289
289
  <>
290
290
  <EditorContent {...props} />
291
- <NodeSelectionHighlight className="z-1 bg-brand/[.13]" />
292
- <NodeSelectionDrag className="z-50 border border-brand/25 bg-brand/15" />
291
+ <NodeSelectionHighlight className="z-1 bg-editor-primary/[.13]" />
292
+ <NodeSelectionDrag
293
+ className="z-50 border border-editor-primary/25 bg-editor-primary/15"
294
+ />
293
295
  </>
294
296
  );
295
297
  }
@@ -312,6 +314,12 @@ the selection from its anchor block. A table cell selection keeps its own
312
314
  `Shift` cell extension, and an object selection keeps the object's own arrows
313
315
  without `Shift`.
314
316
 
317
+ Outside a drag, `Escape` collapses a node selection to a caret at the end of
318
+ its focus block, or right after the focus block when that block is an object
319
+ such as an image. Menus, toolbars and plugin keydown handlers see `Escape`
320
+ first, and the selection stays when one of them handles it. A read-only editor
321
+ keeps the selection.
322
+
315
323
  Escape, pointer cancellation, window blur, and readonly transitions stop the
316
324
  current drag and discard pending movement. Previously published selection stays
317
325
  in the model. Shift anchors follow node identity across document changes.
@@ -360,9 +368,9 @@ export function Page({ cover }: { cover: string }) {
360
368
  </div>
361
369
  <EditorRoot editor={editor}>
362
370
  <EditorContent />
363
- <NodeSelectionHighlight className="z-1 bg-brand/[.13]" />
371
+ <NodeSelectionHighlight className="z-1 bg-editor-primary/[.13]" />
364
372
  <NodeSelectionDrag
365
- className="z-50 border border-brand/25 bg-brand/15"
373
+ className="z-50 border border-editor-primary/25 bg-editor-primary/15"
366
374
  container={container}
367
375
  />
368
376
  </EditorRoot>
@@ -538,8 +538,7 @@ An editor that stores IDs finds and targets an element by its ID:
538
538
  - `tx.nodes.byId(id)`: the same lookup inside an update, read from its draft.
539
539
  It throws once its update ends.
540
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
541
+ `at: { id }` on a transform, which names the element that holds the ID. Text, mark, range and offset targets keep their point or range. A
543
542
  target is an ID only as an object, not an array, whose one own key is a
544
543
  string `id`.
545
544
 
@@ -555,7 +554,9 @@ and change nothing for an ID that only a struck original holds. A path in
555
554
  stored document. A raw `editor.update((tx) => ...)` looks the ID up in the
556
555
  stored draft, as it resolves a path or a key, so it reaches the struck
557
556
  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
557
+ command runs, which answers from the command's document. A view bound to a
558
+ root reads an ID only in that root, while a node key reads the element in
559
+ whichever root holds it. When no element holds
559
560
  the ID, a write changes nothing and a read returns its empty result.
560
561
  [Node identity](/docs/editor#node-identity) shows each route.
561
562
 
@@ -21,6 +21,7 @@ implicit; extra roots are stored on each point with `root`.
21
21
  - [Static methods](/docs/api/range#static-methods)
22
22
  - [Retrieval methods](/docs/api/range#retrieval-methods)
23
23
  - [Check methods](/docs/api/range#check-methods)
24
+ - [Editor reads](/docs/api/range#editor-reads)
24
25
 
25
26
  ## Static methods
26
27
 
@@ -86,3 +87,19 @@ Check if a `range` is forward. This is the opposite of `RangeApi.isBackward` and
86
87
  #### `RangeApi.isRange(value: unknown) => value is Range`
87
88
 
88
89
  Check if a `value` implements the `Range` interface.
90
+
91
+ ## Editor reads
92
+
93
+ `editor.read.ranges` reads ranges against the editor's document. It also holds
94
+ `edges`, `fromEntries`, `get`, `project` and `unhang`.
95
+
96
+ #### `editor.read.ranges.isEmpty(range: Range) => boolean`
97
+
98
+ Check whether a `range` covers nothing a reader sees: no letter, and no void
99
+ element, such as a mention, wholly inside it. A collapsed range is empty, and
100
+ so is one that crosses only the edges of text leaves or containers. It reads
101
+ only the range's own nodes.
102
+
103
+ ```typescript
104
+ const covers = !editor.read.ranges.isEmpty(range);
105
+ ```
@@ -150,11 +150,11 @@ authored.api.setView({ preview: "proposed" });
150
150
 
151
151
  A preview throws on a plain edit, but some other writes still change the stored document, such as an update that makes a decision, undo and redo, and remote collaboration changes. An `Editable` that shows a preview keeps its caret and selection, and drops typing, deleting, pasting, cutting and dropping. Undo and redo still work there.
152
152
 
153
- Typing or pasting inside struck text lands after the pending deletion. A word confirmed with an input method splits the deletion around it instead. An `edit` view applies the new text as written, and a `propose` view records it as an insertion. A `propose` view refuses a write it cannot record as a proposal, such as a row added to a table or a partial edit inside an element whose content holds one text, and rolls it back; `api.subscribeRefusals(listener)` reports each refusal.
153
+ Typing inside struck text, or confirming a word with an input method there, lands at the caret and splits the pending deletion around it. Pasting inside struck text lands after the pending deletion, and typing in a line deleted whole lands at the end of the line before. An `edit` view applies the new text as written, and a `propose` view records it as an insertion. A `propose` view refuses a write it cannot record as a proposal, such as a row added to a table or a partial edit inside an element whose content holds one text, and rolls it back; `api.subscribeRefusals(listener)` reports each refusal.
154
154
 
155
155
  A `propose` view and both previews work when the schema's generated properties are all text properties, or all element properties with an exact key, a value that is not a set, a target that does not depend on the element's place, and a role other than `content`. `content` is the default role, so declare `role: 'metadata'`. `ElementIdPlugin`'s `id` is such a property. When it records, a suggestion generates the element values that a later build needs. A suggested Enter stores the new element's id on that element. A suggestion whose decision could remove a container's child, such as deleting a quote's only line, or change the container's type also stores the block that decision would build there, as a spare block in the document's review marks and `records`. Previews, projections and decisions show those stored values and call no element property's generator. When a stored block, such as one written after the suggestion, repeats a unique value that a spare block holds, the decision that builds that spare block gives it a fresh value, which differs from the value the preview showed. Under any other generated property, or a schema that generates both an element property and a text property, `setView` keeps the current view and a proposal writes nothing. Each reports the refusal code `generated-values`.
156
156
 
157
- Deleting a block that owns a [content root](/docs/roots#content-roots) in a `propose` view strikes the block and leaves the root's content unchanged and unmarked, so style the root as deleted in the block's component. Typing or pasting inside that root writes nothing until someone decides the deletion. Accepting it removes the block and its root, and returns `blocked` while the root holds text another pending change inserted. Rejecting it keeps both. Rejecting a proposed block that owns a content root removes the root too. A `propose` view still refuses deleting a named root that no element owns.
157
+ Deleting a block that owns a [content root](/docs/roots#content-roots) in a `propose` view strikes the block and leaves the root's content unchanged and unmarked, so style the root as deleted in the block's component. Typing or pasting inside that root writes nothing until someone decides the deletion. Accepting it removes the block and its root, and returns `blocked` while the root holds text that another pending change of the same author inserted. Rejecting it keeps both. Rejecting a proposed block that owns a content root removes the root too. A `propose` view still refuses deleting a named root that no element owns.
158
158
 
159
159
  Accepting a struck table or row, or rejecting a suggested one, removes it with every pending change inside it, another author's included. A decision that removes a table's last row removes the table. An `edit` view's removal of a whole table or row takes the pending changes inside it too. Until someone decides a struck table or row, both views refuse these writes with reason `grid`:
160
160
 
@@ -204,7 +204,7 @@ Each `AuthoredChange` has its `id`, `authorId`, `createdAt`, `kind`, current `ra
204
204
 
205
205
  Except for a split or join inside a top-level block, no revision covers where a change sits, so an edit before it keeps the revision. Its `ranges` can move while its revision stays the same, so read them again after each document change. A join, split, wrap or unwrap's revision ignores the text and leaves inside the element, so typing inside keeps it. It changes when the element's own fields change, or the order or shapes of the elements inside it. The revision of a split or join inside a top-level block, such as a quote, also covers its index inside that block, because a decision merges its line into the block before it. The index counts blocks, so it does not say which block comes before the line. After the blocks before it change order, or one of them is replaced or changes type, a decision read before still applies and merges the line into the block now before it. A block that lands between the halves of a top-level split or join also keeps the revision, and a decision read before merges the line into that block.
206
206
 
207
- A decision names the changes as they were read, and a change whose revision moved since returns `stale`. Accepting a change can need other changes accepted with it, and rejecting one can need its dependants rejected. The result is then `blocked`, `with` names the changes it needs, and nothing applies. The editor never decides a change you did not name. Accepting a line someone typed right after another author's pending join applies without waiting for that join. The line stays where it is stored, and accepting the join later places it after the joined line, as deciding both at once does. Between different authors, the order of decisions can still change where such a line ends. It can also change where a line someone moved in Editing ends when the split that made it is rejected. Several decisions in one call decide together:
207
+ A decision names the changes as they were read, and a change whose revision moved since returns `stale`. A decision never waits on another author's pending change, which stays pending on what the decision leaves. Accepting a change can still need other changes of the same author accepted with it, such as a link that author split and then changed on one half, and rejecting one can need its dependants rejected. The result is then `blocked`, `with` names the changes it needs, and nothing applies. The editor never decides a change you did not name, with one exception: in an editor with no shared room or Yjs binding, an Editing write that replaces a selection holding another author's whole pending deletion accepts that deletion in the same undo step. Accepting a line someone typed right after another author's pending join applies without waiting for that join. The line stays where it is stored, and accepting the join later places it after the joined line, as deciding both at once does. Between different authors, the order of decisions can still change where such a line ends. It can also change where a line someone moved in Editing ends when the split that made it is rejected. Several decisions in one call decide together:
208
208
 
209
209
  ```tsx
210
210
  if (result.status === "blocked") {
@@ -720,4 +720,5 @@ The image shape, `boardImage`: an object block that holds at most one `image` el
720
720
  | `BoardMessages`, `BoardShapeDescription`, `BoardCorner`, `BoardPickState` | `platejs/board/react` | The type of `messages`, the shape that `messages.shape` describes, the corner a resize moves, and where picking stands when the board says `picking` or `pick`. |
721
721
  | `useBoardView(selector)`, `useBoardActions()` | `platejs/board/react` | Inside the surface's `toolbar`, read the view's `tool`, `toolLocked`, `camera` and `nextStyle`, its board's selected shapes as `selectedShapes`, each style a pick would set as `styles`, whether it can write as `writable`, and whether its board takes picture files as `takesPictureFiles`. A camera `zoom` of 1 is 100 percent. Call `setTool`, `setToolLocked`, `setStyle`, `fit`, `zoomIn`, `zoomOut`, `resetZoom`, `removeFrame`, `focus`, `upload` and `exportPicture`. From any zoom, `zoomIn` and `zoomOut` go to the next step the `=` or `+` and `-` keys use, and stop at 800 and 10 percent. `resetZoom` zooms to 100 percent, as Shift+0 does. All three work in a read-only view too. `toolLocked` says whether the note, shape, frame and arrow tools stay picked after they add a shape. It is off when the view mounts and is never stored, and `setToolLocked` turns it on or off, as Q does, without changing the tool or the selection. `focus` moves focus back to the board and keeps its selection, such as after a toolbar menu closes. A shape whose text is being edited ends its edit and stays selected. `setStyle` merges into the next style. With the select tool it also writes each style to every selected shape that takes it and to the shape whose text is being edited, as one undo step that keeps the caret. With a drawing tool it styles only the next shape. Each entry of `styles` is `{ mixed: false, value }` when its targets share a value and `{ mixed: true }` when they differ, and a style no target takes has no entry. A read-only view's `setStyle` changes nothing. `upload(files)` lands picture files as image shapes in a row centered on the view, as [Picture files](#picture-files) describes. It changes nothing with an empty list or while `takesPictureFiles` is false. `exportPicture({ format, kit })` draws the selected shapes, or the whole board when nothing is selected, as a `'png'` or `'svg'` picture with the static plugins in `kit`. `kit` can be a promise, such as a dynamic import, as [Export](#export) shows. It reads the selection when it is called and loads its drawing code on the first call. It resolves `null` when there is nothing to draw, and rejects when the surface is not on the page or leaves it before the picture is drawn. Both hooks throw outside a `BoardSurface`. |
722
722
  | `BoardPicture`, `BoardPictureOptions`, `BoardPictureWarning` | `platejs/board/react` | What `exportPicture` resolves, what it takes, and each warning in the picture's `warnings`. A warning's `code` is `content-undrawn`, `downscaled`, `font-missing`, `image-unreadable` or `shape-undrawn`, and the last two also name the `shapeId`. |
723
- | `useArrowPath(element)`, `useStrokePath(element)` | `platejs/board/react` | The drawn path of an arrow or a pen line in a mounted board. `useStrokePath` returns the `BoardStrokePath` that `strokePath(id)` reads, or `undefined` when the element is not a pen line of that board. |
723
+ | `BoardArrowPath`, `BoardArrowhead`, `BoardArrowLabel` | `platejs/board/react` | Draw an arrow inside its `BoardShape`. `BoardArrowPath` is an SVG `path` whose `d` runs between the arrow's ends. `BoardArrowhead` is an SVG `g` that draws its children at the arrow's end, turned so that the positive x axis points along the arrow. It sets its own `transform` and `display`, so style the head through its children. `BoardArrowLabel` is an absolutely positioned `div` that holds the arrow's text, centered on the arrow's middle. It sets its own `left` and `top`, and a `style` can override its `position` and the `translate` that centers it. All three follow a moved, dragged or resized shape without a render of the arrow. An arrow's `BoardShape` is an empty box at the board's origin, and `d` is in board coordinates. So draw the path and the head in a 1 by 1 `svg`, because Firefox draws nothing in an `svg` of zero size. Give that `svg` visible overflow and `pointer-events: none`, and put it inside an element with `contentEditable={false}`. A press picks an arrow only when it lands on one of the arrow's elements, so give one path `pointerEvents="stroke"`, such as a wide transparent `BoardArrowPath`. Until the arrow has a drawing, the path has no `d` and the head and the label are hidden. Each throws outside an arrow's `BoardShape`. |
724
+ | `useStrokePath(element)` | `platejs/board/react` | The drawn path of a pen line in a mounted board. It returns the `BoardStrokePath` that `strokePath(id)` reads, or `undefined` when the element is not a pen line of that board. |
@@ -103,7 +103,9 @@ Click “overlapping” to open both conversations. Edit the highlighted text, t
103
103
 
104
104
  _Registry item `comment-overlap-demo`: `npx shadcn@latest add @plate/comment-overlap-demo`._
105
105
 
106
- Inserting text inside a range expands it; deleting text contracts it. Text inserted at either boundary stays outside. An intentional atomic replacement carries the target to its replacement text. Deleting the target and typing later is a separate edit, so the later text does not inherit the comment. Content that lands between a deleted range's ends can still join it, such as text typed into a paragraph the range emptied, a block moved into that spot, or same-style text the delete joins to the range's first letters. When no range can be shown, `attachment(id)` reports `unavailable`; **All comments** keeps the thread and its original excerpt reachable without a stale block badge. Undo and redo in the live session restore mapped coverage, including backward direction and overlaps.
106
+ Inserting text inside a range expands it; deleting text contracts it. Text inserted at either boundary stays outside. An intentional atomic replacement carries the target to its replacement text. Deleting the target and typing later is a separate edit, so the later text does not inherit the comment. Content that lands between a deleted range's ends can still join it, such as text typed into a paragraph the range emptied or a block moved into that spot. When no range can be shown, `attachment(id)` reports `unavailable`; **All comments** keeps the thread and its original excerpt reachable without a stale block badge. Undo and redo in the live session restore mapped coverage, including backward direction and overlaps.
107
+
108
+ Drag a commented phrase, or cut it and paste it right away in the same editor, and the comment moves with the text. Undo and redo move it back and forth. When only part of the phrase moves, the comment keeps the part that stays, and letters the move brings from outside never join it. In Suggesting, the comment stays on the struck original until the move is accepted or rejected. A pasted copy, and a cut pasted a second time, carry no comment. A paste without formatting, a paste after another edit or into another editor, and any move in a document bound to Yjs map the comment by position, so a comment whose whole text moves reads `unavailable`.
107
109
 
108
110
  ### Save, reload, and retry
109
111
 
@@ -632,7 +632,7 @@ when the schema gives every element type a generated, unique string `id`, as
632
632
  `ElementIdPlugin`'s default target does, and no content admits undeclared
633
633
  element types. In any other editor, both throw.
634
634
 
635
- An `{ id }` target acts as the key of the element that holds the ID. Text,
635
+ An `{ id }` target names the element that holds the ID. Text,
636
636
  mark, range and offset targets keep their point or range. A target is an ID
637
637
  only as an object, not an array, whose one own key is a string `id`, so a live
638
638
  element that carries an `id` stays a node target. When no element holds the
@@ -650,7 +650,10 @@ The route decides which document the ID is looked up in:
650
650
  - A raw `editor.update((tx) => ...)` looks it up in the stored draft, as it
651
651
  resolves a path or a key. It reaches the struck original.
652
652
  - An editor view answers from its own document. A read on a view while a
653
- command runs answers from the command's document.
653
+ command runs answers from the command's document. A view bound to a root
654
+ reads an ID only in that root, so its `nodes.get({ id })` and
655
+ `nodes.path({ id })` return nothing for an ID another root holds. A node key
656
+ still reads the element in whichever root holds it.
654
657
 
655
658
  The default generator is full-length `nanoid()`. Loads and moves preserve valid
656
659
  IDs. Copies, splits, duplicates, and pasted copies receive fresh IDs. No two