platejs 54.0.0-beta.6 → 54.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/dist/{AIChatRequestContext-BYpGufVe.d.ts → AIChatRequestContext-PbXTTovP.d.ts} +4 -2
  2. package/dist/{BaseSuggestionPlugin-C52LR8RN.d.ts → BaseSuggestionPlugin-Dg-cdX26.d.ts} +14 -7
  3. package/dist/{PlateStatic-DMClx-tH.d.ts → PlateStatic-CggiBCuD.d.ts} +3 -3
  4. package/dist/ai/index.d.ts +40 -2
  5. package/dist/ai/index.js +2 -1
  6. package/dist/ai/lib/lockedContext.internal.js +105 -0
  7. package/dist/ai/lib/lockedContext.js +179 -0
  8. package/dist/ai/react/AIChatPlugin.js +510 -109
  9. package/dist/ai/react/CopilotPlugin.js +46 -10
  10. package/dist/ai/react/aiOutputLanding.internal.js +19 -4
  11. package/dist/ai/react/index.d.ts +127 -82
  12. package/dist/ai/react/useAIChat.js +41 -36
  13. package/dist/authored/index.d.ts +4 -4
  14. package/dist/authored/index.js +2 -2
  15. package/dist/code-block/codemirror/index.d.ts +1 -1
  16. package/dist/{combobox-DgYdu5mZ.d.ts → combobox-CUUSZR07.d.ts} +2 -2
  17. package/dist/compiler/index.d.ts +2 -2
  18. package/dist/{core-CQKT9eNc.d.ts → core-D8i_gkA6.d.ts} +583 -579
  19. package/dist/core.js +1 -2
  20. package/dist/diff/index.d.ts +3 -30
  21. package/dist/docs/annotations.md +37 -120
  22. package/dist/docs/api/core/plate-components.md +5 -4
  23. package/dist/docs/api/core/plate-plugin.md +11 -10
  24. package/dist/docs/api/core/plate-store.md +5 -5
  25. package/dist/docs/api/core.md +41 -69
  26. package/dist/docs/api/document-change.md +38 -10
  27. package/dist/docs/api/editor-api.md +19 -16
  28. package/dist/docs/api/editor-transforms.md +27 -8
  29. package/dist/docs/api/react-hooks.md +112 -133
  30. package/dist/docs/authored-changes.md +21 -19
  31. package/dist/docs/board.md +48 -37
  32. package/dist/docs/bold.md +0 -2
  33. package/dist/docs/clipboard.md +11 -7
  34. package/dist/docs/decorations.md +3 -4
  35. package/dist/docs/dnd.md +1 -1
  36. package/dist/docs/document-model.md +3 -3
  37. package/dist/docs/docx.md +50 -4
  38. package/dist/docs/editor-methods.md +10 -19
  39. package/dist/docs/editor.md +22 -66
  40. package/dist/docs/examples/version-history.md +1 -1
  41. package/dist/docs/field.md +120 -54
  42. package/dist/docs/find.md +36 -28
  43. package/dist/docs/footnote.md +94 -36
  44. package/dist/docs/history.md +166 -12
  45. package/dist/docs/html.md +10 -5
  46. package/dist/docs/indent.md +7 -5
  47. package/dist/docs/ink.md +229 -0
  48. package/dist/docs/installation/node.md +1 -1
  49. package/dist/docs/installation/plate-ui.md +16 -0
  50. package/dist/docs/list.md +23 -3
  51. package/dist/docs/llms.txt +7 -6
  52. package/dist/docs/lock.md +264 -0
  53. package/dist/docs/markdown.md +17 -99
  54. package/dist/docs/plugin-context.md +14 -10
  55. package/dist/docs/roots.md +92 -28
  56. package/dist/docs/schema.md +5 -3
  57. package/dist/docs/serializing.md +26 -3
  58. package/dist/docs/static.md +19 -5
  59. package/dist/docs/suggestion.md +27 -14
  60. package/dist/docs/table.md +2 -2
  61. package/dist/docs/toc.md +2 -2
  62. package/dist/docx/export/index.d.ts +3 -3
  63. package/dist/docx/export/lib/comments.js +124 -44
  64. package/dist/docx/export/lib/exportDocx.js +89 -34
  65. package/dist/docx/export/lib/hostIndex.js +92 -0
  66. package/dist/docx/export/lib/reviewProjection.js +154 -55
  67. package/dist/docx/import/index.d.ts +4 -4
  68. package/dist/docx/paste/index.d.ts +4 -4
  69. package/dist/dom/index.d.ts +2 -2
  70. package/dist/dom/plite-dom.internal.js +2 -2
  71. package/dist/excalidraw/index.d.ts +3 -3
  72. package/dist/excalidraw/react/index.d.ts +3 -3
  73. package/dist/facade.js +3 -3
  74. package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +1 -1
  75. package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +31 -8
  76. package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +64 -12
  77. package/dist/features/basic-styles/lib/BaseFormattingPlugin.js +5 -2
  78. package/dist/features/board/index.d.ts +2 -2
  79. package/dist/features/board/index.js +2 -1
  80. package/dist/features/board/lib/BaseBoardPlugin.js +80 -22
  81. package/dist/features/board/lib/BaseBoardTextPlugin.js +12 -0
  82. package/dist/features/board/lib/boardArrow.internal.js +2 -2
  83. package/dist/features/board/lib/boardHeights.internal.js +57 -0
  84. package/dist/features/board/lib/boardHtml.internal.js +18 -1
  85. package/dist/features/board/lib/boardMember.internal.js +2 -2
  86. package/dist/features/board/lib/boardShape.internal.js +6 -1
  87. package/dist/features/board/lib/boardStyle.internal.js +5 -1
  88. package/dist/features/board/lib/boardTypes.internal.js +7 -1
  89. package/dist/features/callout/index.d.ts +3 -3
  90. package/dist/features/callout/lib/BaseCalloutPlugin.js +1 -4
  91. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +1 -2
  92. package/dist/features/combobox/index.d.ts +2 -2
  93. package/dist/features/combobox/lib/filterWords.js +7 -11
  94. package/dist/features/comments/BaseCommentsPlugin.js +47 -227
  95. package/dist/features/comments/comment-thread-index.internal.js +822 -0
  96. package/dist/features/comments/index.d.ts +2 -2
  97. package/dist/features/date/index.d.ts +3 -3
  98. package/dist/features/details/index.d.ts +4 -3
  99. package/dist/features/details/lib/BaseDetailsPlugin.js +228 -122
  100. package/dist/features/field/index.d.ts +2 -2
  101. package/dist/features/field/lib/BaseFieldPlugin.js +166 -53
  102. package/dist/features/field/lib/applyFieldValues.js +45 -26
  103. package/dist/features/field/lib/fieldRules.internal.js +518 -100
  104. package/dist/features/find/index.d.ts +15 -16
  105. package/dist/features/find/lib/BaseFindPlugin.js +871 -123
  106. package/dist/features/footnote/index.d.ts +1 -1
  107. package/dist/features/footnote/lib/BaseFootnotePlugin.js +44 -17
  108. package/dist/features/ink/index.d.ts +2 -2
  109. package/dist/features/ink/lib/BaseInkPlugin.js +477 -80
  110. package/dist/features/ink/lib/inkAnchor.internal.js +436 -0
  111. package/dist/features/ink/lib/inkMatch.internal.js +276 -64
  112. package/dist/features/ink/lib/inkPlaces.internal.js +172 -500
  113. package/dist/features/ink/lib/inkReflow.internal.js +406 -0
  114. package/dist/features/layout/index.d.ts +1 -1
  115. package/dist/features/layout/lib/BaseColumnPlugin.js +37 -14
  116. package/dist/features/link/lib/BaseLinkPlugin.js +38 -3
  117. package/dist/features/lint/index.d.ts +16 -16
  118. package/dist/features/list/lib/BaseListPlugin.js +32 -12
  119. package/dist/features/list/lib/listFamily.internal.js +2 -2
  120. package/dist/features/list/lib/listHtml.internal.js +1 -0
  121. package/dist/features/lock/index.d.ts +2 -0
  122. package/dist/features/lock/index.js +2 -0
  123. package/dist/features/lock/lib/BaseLockPlugin.js +526 -0
  124. package/dist/features/media/index.d.ts +1 -1
  125. package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +2 -1
  126. package/dist/features/mention/index.d.ts +5 -5
  127. package/dist/features/suggestion/index.d.ts +1 -1
  128. package/dist/features/table/index.d.ts +1 -1
  129. package/dist/features/table/lib/BaseTablePlugin.js +284 -142
  130. package/dist/features/toc/index.d.ts +1 -1
  131. package/dist/features/upload/index.d.ts +1 -1
  132. package/dist/features/upload/lib/BaseUploadPlugin.js +10 -8
  133. package/dist/history/index.d.ts +3 -3
  134. package/dist/history/index.js +2 -1
  135. package/dist/html/index.d.ts +3 -3
  136. package/dist/html/server/index.d.ts +1 -1
  137. package/dist/html/server/index.js +2 -1
  138. package/dist/html/server/serverCssParser.internal.js +500 -0
  139. package/dist/html/server/serverCssStyle.internal.js +208 -0
  140. package/dist/{htmlTypes-8IFX0ezP.d.ts → htmlTypes-zTLU3aTb.d.ts} +10 -14
  141. package/dist/hyperscript/index.d.ts +1 -1
  142. package/dist/index-0YxPsHwd.d.ts +1 -0
  143. package/dist/{index-D2w_9_tb.d.ts → index-3CExu_fj.d.ts} +32 -32
  144. package/dist/{index-PDROnF1G-Ds_dbJsr.d.ts → index-4PpawhYe-yelJvgk1.d.ts} +1 -1
  145. package/dist/{index-C-5w6252.d.ts → index-BCYBYfGM.d.ts} +41 -41
  146. package/dist/{index-B4oeyc99.d.ts → index-BODDOPEd.d.ts} +1 -1
  147. package/dist/{index-BcuSI8EM.d.ts → index-BPOa4Z5n.d.ts} +17 -9
  148. package/dist/{index-DUk2VZ_1.d.ts → index-BSBkt2bm.d.ts} +48 -52
  149. package/dist/{index-BBsiQIzw.d.ts → index-BeyI3RUg.d.ts} +64 -44
  150. package/dist/{index-BfHCmKG3.d.ts → index-BisOdLXI.d.ts} +119 -106
  151. package/dist/{index-BapA_uvI.d.ts → index-Bt5YI_JN.d.ts} +5 -5
  152. package/dist/{index-BAz_KJSV.d.ts → index-CD_Ym9WQ.d.ts} +2 -2
  153. package/dist/{index-AOVPovEr.d.ts → index-CX_JaDRY.d.ts} +212 -224
  154. package/dist/{index-DE1Mcccg.d.ts → index-CfK4uv4I.d.ts} +3 -3
  155. package/dist/{index-BTFrh2Cz.d.ts → index-CfRUKYCM.d.ts} +2 -2
  156. package/dist/{index-DM6z4D7q.d.ts → index-Cil7kghY.d.ts} +35 -33
  157. package/dist/index-D11C0iLb.d.ts +97 -0
  158. package/dist/{index-CrUMAwqm.d.ts → index-DJW6AjJ6.d.ts} +1 -5
  159. package/dist/{comparison-types-DBQFu7Rt-DYc2TC2H.d.ts → index-DM-b6jEe-BqkdOlav.d.ts} +19 -57
  160. package/dist/{index-Cp0QfjUV.d.ts → index-DoZhM7nD.d.ts} +11 -12
  161. package/dist/{index-BbsVGwn8.d.ts → index-DsNwo8dd.d.ts} +333 -396
  162. package/dist/{index-Dh7pWHZo.d.ts → index-DuElD_q6.d.ts} +298 -38
  163. package/dist/{index-BIP1GoWI.d.ts → index-f3aV3Kt-.d.ts} +6 -16
  164. package/dist/{index-DFMkcY5V.d.ts → index-u_h6ow4e.d.ts} +149 -130
  165. package/dist/{index-DbPoiwq_.d.ts → index-yZDmK6ab.d.ts} +3 -3
  166. package/dist/index.d.ts +4 -4
  167. package/dist/index.js +1 -2
  168. package/dist/internal/plugin/OverridePlugin.js +22 -3
  169. package/dist/internal/plugin/blockInsertion.js +4 -4
  170. package/dist/internal/plugin/collectPlateNodeMappings.js +11 -4
  171. package/dist/internal/plugin/compilePlainTextMappings.js +2 -0
  172. package/dist/internal/plugin/compilePlateModel.js +15 -1
  173. package/dist/internal/plugin/plateChangeHandlers.js +1 -1
  174. package/dist/internal/plugin/plateRuntime.js +7 -1
  175. package/dist/internal/plugin/resolvePlugin.js +14 -2
  176. package/dist/internal/plugin/resolvePlugins.js +5 -3
  177. package/dist/lib/editor/withPlite.js +33 -3
  178. package/dist/lib/plugins/dom/DOMPlugin.js +6 -2
  179. package/dist/lib/plugins/html/HtmlPlugin.js +37 -16
  180. package/dist/lib/plugins/html/htmlAst.js +5 -3
  181. package/dist/lib/plugins/html/htmlDom.js +1 -10
  182. package/dist/lib/plugins/input-rules/createInputRules.js +3 -3
  183. package/dist/lib/utils/getInjectMatch.js +1 -1
  184. package/dist/markdown/index.d.ts +2 -2
  185. package/dist/markdown/index.js +1 -2
  186. package/dist/markdown/lib/MarkdownPlugin.js +5 -7
  187. package/dist/markdown/lib/deserializer/convertNodesDeserialize.js +29 -5
  188. package/dist/markdown/lib/internal/markdownConversion.js +315 -357
  189. package/dist/markdown/lib/internal/markdownIntrinsics.js +36 -71
  190. package/dist/markdown/lib/internal/markdownLine.js +2 -4
  191. package/dist/markdown/lib/internal/markdownMappings.js +21 -3
  192. package/dist/markdown/lib/internal/markdownSafety.js +101 -1
  193. package/dist/markdown/lib/internal/markdownTags.js +2 -26
  194. package/dist/markdown/lib/serializer/convertNodesSerialize.js +5 -3
  195. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +1 -10
  196. package/dist/math/index.d.ts +3 -3
  197. package/dist/math/react/index.d.ts +4 -4
  198. package/dist/migrations/documentMigrationSelection.internal.js +107 -2
  199. package/dist/migrations/documentMigrations.js +37 -114
  200. package/dist/migrations/index.d.ts +3 -3
  201. package/dist/migrations/migratePlateV54.js +41 -40
  202. package/dist/migrations/migratePlateV54Ast.internal.js +147 -56
  203. package/dist/migrations/migratePlateV54CodeBlocks.internal.js +24 -29
  204. package/dist/migrations/migratePlateV54Inputs.internal.js +39 -32
  205. package/dist/migrations/migratePlateV54Profile.internal.js +52 -26
  206. package/dist/migrations/migratePlateV54Stage.internal.js +127 -0
  207. package/dist/migrations/migratePlateV54Urls.internal.js +77 -57
  208. package/dist/pagination/index.d.ts +1 -1
  209. package/dist/pagination/react/PagedEditorContent.js +6 -6
  210. package/dist/pagination/react/index.d.ts +16 -13
  211. package/dist/react/components/NodeSelection.js +136 -50
  212. package/dist/react/components/Plate.js +214 -145
  213. package/dist/react/components/PlateContainer.js +51 -47
  214. package/dist/react/components/PlateContent.js +3 -3
  215. package/dist/react/components/PlateView.js +1 -1
  216. package/dist/{static/internal/getPlainText.js → react/components/getPlainText.internal.js} +1 -4
  217. package/dist/react/components/plate-nodes.js +48 -40
  218. package/dist/{static/internal/writeStaticSelectionClipboardData.js → react/components/writeStaticSelectionClipboardData.internal.js} +3 -4
  219. package/dist/react/core.js +3 -4
  220. package/dist/react/editor/getPlateCorePlugins.internal.js +1 -1
  221. package/dist/react/editor/withPlate.js +10 -4
  222. package/dist/react/features/board/BoardPlugin.js +7 -1
  223. package/dist/react/features/board/BoardShape.js +261 -180
  224. package/dist/react/features/board/BoardSurface.js +2 -2
  225. package/dist/react/features/board/boardConnect.internal.js +0 -9
  226. package/dist/react/features/board/boardExport.internal.js +225 -80
  227. package/dist/react/features/board/boardGesture.internal.js +193 -33
  228. package/dist/react/features/board/boardIndex.internal.js +271 -26
  229. package/dist/react/features/board/boardKeys.internal.js +48 -15
  230. package/dist/react/features/board/boardPick.internal.js +3 -2
  231. package/dist/react/features/board/boardPicking.internal.js +0 -17
  232. package/dist/react/features/board/boardPreview.internal.js +56 -8
  233. package/dist/react/features/board/boardResize.internal.js +123 -46
  234. package/dist/react/features/board/boardSnap.internal.js +14 -9
  235. package/dist/react/features/board/boardView.internal.js +477 -32
  236. package/dist/react/features/board/boardVoice.internal.js +18 -4
  237. package/dist/react/features/board/index.d.ts +329 -47
  238. package/dist/react/features/board/index.js +2 -2
  239. package/dist/react/features/callout/index.d.ts +3 -3
  240. package/dist/react/features/combobox/comboboxOwner.internal.js +10 -4
  241. package/dist/react/features/combobox/index.d.ts +5 -5
  242. package/dist/react/features/comments/index.d.ts +66 -65
  243. package/dist/react/features/date/index.d.ts +4 -4
  244. package/dist/react/features/details/index.d.ts +6 -6
  245. package/dist/react/features/field/FieldPlugin.js +3 -3
  246. package/dist/react/features/field/index.d.ts +73 -92
  247. package/dist/react/features/footnote/index.d.ts +63 -60
  248. package/dist/react/features/format-painter/index.d.ts +4 -4
  249. package/dist/react/features/ink/InkContent.js +76 -120
  250. package/dist/react/features/ink/InkPlugin.js +40 -17
  251. package/dist/react/features/ink/index.d.ts +214 -377
  252. package/dist/react/features/ink/index.js +1 -2
  253. package/dist/react/features/ink/inkCapture.internal.js +99 -61
  254. package/dist/react/features/ink/inkImages.internal.js +278 -0
  255. package/dist/react/features/ink/inkMeasure.internal.js +42 -16
  256. package/dist/react/features/ink/inkPaint.internal.js +31 -23
  257. package/dist/react/features/ink/inkPick.internal.js +45 -20
  258. package/dist/react/features/ink/inkPlacement.internal.js +205 -185
  259. package/dist/react/features/ink/inkWatch.internal.js +1 -32
  260. package/dist/react/features/layout/index.d.ts +6 -6
  261. package/dist/react/features/list/ListPlugin.js +10 -6
  262. package/dist/react/features/lock/LockPlugin.js +66 -0
  263. package/dist/react/features/lock/index.d.ts +58 -0
  264. package/dist/react/features/lock/index.js +2 -0
  265. package/dist/react/features/media/index.d.ts +26 -26
  266. package/dist/react/features/mention/index.d.ts +6 -6
  267. package/dist/react/features/suggestion/index.d.ts +6 -6
  268. package/dist/react/features/suggestion/suggestion-view.internal.js +38 -36
  269. package/dist/react/features/suggestion/useSuggestion.js +17 -14
  270. package/dist/react/features/table/TablePlugin.js +12 -5
  271. package/dist/react/features/table/index.d.ts +20 -22
  272. package/dist/react/features/table/useTableResize.js +4 -4
  273. package/dist/react/features/toc/index.d.ts +2 -2
  274. package/dist/react/features/upload/index.d.ts +44 -44
  275. package/dist/react/index.d.ts +5 -6
  276. package/dist/react/index.js +3 -4
  277. package/dist/react/internal/plate-context.js +13 -42
  278. package/dist/react/internal/plite-components.js +2 -2
  279. package/dist/react/internal/usePlateModelRevision.js +2 -3
  280. package/dist/react/plite-react.js +2 -2
  281. package/dist/react/stores/element/useElementStore.js +78 -52
  282. package/dist/react/stores/plate/useEditor.js +70 -32
  283. package/dist/react/stores/plate/useEditorSelector.js +193 -53
  284. package/dist/react/utils/BlockPlaceholderPlugin.js +10 -4
  285. package/dist/react/utils/pipeRenderElement.internal.js +32 -30
  286. package/dist/react/virtualized.d.ts +4 -4
  287. package/dist/react/virtualized.js +2 -2
  288. package/dist/root.js +1 -2
  289. package/dist/{source-D5CyclpX.d.ts → source-B1rLozUs.d.ts} +3 -3
  290. package/dist/static/components/PlateStatic.js +13 -2
  291. package/dist/static/components/plite-nodes.js +1 -1
  292. package/dist/static/index.d.ts +9 -11
  293. package/dist/static/internal/staticDocumentView.js +67 -1
  294. package/dist/static/pluginRenderLeafStatic.internal.js +1 -2
  295. package/dist/static/pluginRenderTextStatic.internal.js +2 -1
  296. package/dist/tabbable/index.d.ts +1 -1
  297. package/dist/tabbable/react/index.d.ts +3 -3
  298. package/dist/testing/index.d.ts +2 -2
  299. package/dist/{index-DHt8nZQ6-NUTahb8N.d.ts → tx-only-D8lpB-sT-ZiAbZRMU.d.ts} +6980 -6633
  300. package/dist/yjs/index.d.ts +1 -1
  301. package/dist/yjs/react/index.d.ts +5 -5
  302. package/package.json +16 -7
  303. package/dist/docs/migration/plite-to-plate.md +0 -352
  304. package/dist/features/comments/plite-comments.internal.js +0 -2
  305. package/dist/features/ink/lib/inkGone.internal.js +0 -288
  306. package/dist/index-BvQzYVAW-Jvz2iG8B.d.ts +0 -65
  307. package/dist/lib/plugins/element-id/ElementIdPlugin.js +0 -43
  308. package/dist/lib/plugins/element-id/elementIdAdmission.internal.js +0 -34
  309. package/dist/markdown/lib/RawHtmlPlugin.js +0 -26
  310. package/dist/markdown/lib/internal/markdownRawHtml.js +0 -353
  311. package/dist/react/features/ink/InkCopyView.js +0 -203
  312. package/dist/react/libs/jotai.js +0 -3
@@ -1,6 +1,6 @@
1
- import { Ca as NodeKey, Ci as Element, H as Descendant, Ht as EditorJsonValue, Ws as SchemaElementProperties, bc as SchemaPropertyTypeChangePolicy, ds as PropertyValueOf, es as PropertyEnumDescriptor, fs as PropertyValueOptions, gc as SchemaPropertyLandingPolicy, ii as EditorUniqueHolder, iu as TxDeclaredMethod, j as ContentSlice, ji as ElementOf, lc as SchemaPropertyCopyPolicy, ls as PropertyValueDescriptor, qs as SchemaElementPropertyDefinition, rs as PropertyNumberDescriptor, ss as PropertyStringDescriptor, ts as PropertyJsonDescriptor, us as PropertyValueKind, vc as SchemaPropertyRole, yc as SchemaPropertySplitPolicy } from "./index-DHt8nZQ6-NUTahb8N.js";
2
- import "./htmlTypes-8IFX0ezP.js";
3
- import { _ as BasePlugin, ct as BlockInsertOptions, qa as DefinitionOf } from "./core-CQKT9eNc.js";
1
+ import { Aa as NodeKey, Ac as SchemaPropertyLandingPolicy, Cc as SchemaPropertyCopyPolicy, H as Descendant, Ii as ElementOf, M as ContentSlice$1, Mc as SchemaPropertyRole, Nc as SchemaPropertySplitPolicy, Oi as Element, Pc as SchemaPropertyTypeChangePolicy, Wt as EditorJsonValue, _s as PropertyValueKind, as as PropertyBooleanDescriptor, ci as EditorUniqueHolder, cs as PropertyJsonDescriptor, gs as PropertyValueDescriptor, ic as SchemaElementProperties, ms as PropertyStringDescriptor, sc as SchemaElementPropertyDefinition, ss as PropertyEnumDescriptor, us as PropertyNumberDescriptor, vs as PropertyValueOf, vu as TxDeclaredMethod, ys as PropertyValueOptions } from "./tx-only-D8lpB-sT-ZiAbZRMU.js";
2
+ import "./htmlTypes-zTLU3aTb.js";
3
+ import { Ba as DefinitionOf, lt as BlockInsertOptions, v as BasePlugin } from "./core-D8i_gkA6.js";
4
4
  import { nanoid } from "nanoid";
5
5
  declare const BOARD_DASHES: readonly ['dashed', 'dotted', 'solid'];
6
6
  declare const BOARD_STYLE_SIZES: readonly ['l', 'm', 's', 'xl'];
@@ -767,6 +767,26 @@ type BoardGeoElement = ElementOf<typeof BaseBoardGeoPlugin>;
767
767
  * plugin, the upload plugin or both.
768
768
  */
769
769
  declare const BaseBoardImagePlugin: BasePlugin<Readonly<{
770
+ readonly update: {
771
+ /**
772
+ * Add an image shape holding `children`, one image element or upload
773
+ * draft, at `x` and `y` above every shape of the board block `board`, and
774
+ * return its id. It is 320 by 240 unless `width` and `height` say
775
+ * otherwise, and it joins the frame `frame` names when it overlaps it, or
776
+ * else the frontmost frame under its middle. Return undefined when `board`
777
+ * is no board or a number is not finite.
778
+ */
779
+ readonly insert: TxDeclaredMethod<({ children, frame, height, width, x, y }: Readonly<{
780
+ children: readonly [Descendant];
781
+ frame?: string;
782
+ height?: number;
783
+ width?: number;
784
+ x: number;
785
+ y: number;
786
+ }>, { board }: Readonly<{
787
+ board: NodeKey;
788
+ }>) => string | undefined>;
789
+ };
770
790
  readonly __pluginWritableProperties: never;
771
791
  readonly schema: {
772
792
  readonly element: {
@@ -798,26 +818,6 @@ declare const BaseBoardImagePlugin: BasePlugin<Readonly<{
798
818
  readonly targetPlugins: readonly ["image", "upload"];
799
819
  readonly name: "boardImage";
800
820
  readonly formats: true;
801
- readonly update: {
802
- /**
803
- * Add an image shape holding `children`, one image element or upload
804
- * draft, at `x` and `y` above every shape of the board block `board`, and
805
- * return its id. It is 320 by 240 unless `width` and `height` say
806
- * otherwise, and it joins the frame `frame` names when it overlaps it, or
807
- * else the frontmost frame under its middle. Return undefined when `board`
808
- * is no board or a number is not finite.
809
- */
810
- readonly insert: TxDeclaredMethod<({ children, frame, height, width, x, y }: Readonly<{
811
- children: readonly [Descendant];
812
- frame?: string;
813
- height?: number;
814
- width?: number;
815
- x: number;
816
- y: number;
817
- }>, { board }: Readonly<{
818
- board: NodeKey;
819
- }>) => string | undefined>;
820
- };
821
821
  }>> & Readonly<Record<never, never>>;
822
822
  /** A stored image shape: a board member holding at most one image or upload draft. */
823
823
  type BoardImageElement = ElementOf<typeof BaseBoardImagePlugin>;
@@ -1383,6 +1383,133 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1383
1383
  board: NodeKey;
1384
1384
  }>) => string | undefined>;
1385
1385
  };
1386
+ }>> & Readonly<Record<never, never>>, BasePlugin<Readonly<{
1387
+ readonly __pluginWritableProperties: Readonly<{
1388
+ descriptor: PropertyBooleanDescriptor<{
1389
+ readonly default: true;
1390
+ }>;
1391
+ key: "autoSize";
1392
+ localId: "autoSize";
1393
+ ownerName: "boardText";
1394
+ placement: "element";
1395
+ unaliased: true;
1396
+ value: boolean;
1397
+ }> | Readonly<{
1398
+ descriptor: PropertyNumberDescriptor<Readonly<{
1399
+ default: number;
1400
+ }> & Readonly<{
1401
+ validate: (value: unknown) => value is number;
1402
+ validationVersion: 1;
1403
+ }>>;
1404
+ key: "opacity";
1405
+ localId: "opacity";
1406
+ ownerName: "boardText";
1407
+ placement: "element";
1408
+ unaliased: true;
1409
+ value: number;
1410
+ }> | Readonly<{
1411
+ descriptor: PropertyEnumDescriptor<readonly ["l", "m", "s", "xl"], Readonly<{
1412
+ default: "l" | "m" | "s" | "xl";
1413
+ }>>;
1414
+ key: "textSize";
1415
+ localId: "textSize";
1416
+ ownerName: "boardText";
1417
+ placement: "element";
1418
+ unaliased: true;
1419
+ value: "l" | "m" | "s" | "xl";
1420
+ }>;
1421
+ readonly schema: {
1422
+ readonly element: {
1423
+ readonly blockContent: false;
1424
+ readonly content: Readonly<{
1425
+ allowed: Readonly<{
1426
+ kind: 'types';
1427
+ types: readonly string[];
1428
+ }>;
1429
+ prefix?: readonly Readonly<{
1430
+ element: string | Readonly<{
1431
+ source: string;
1432
+ type: string;
1433
+ }>;
1434
+ properties?: Readonly<Record<string, EditorJsonValue>>;
1435
+ }>[] | undefined;
1436
+ } & {
1437
+ readonly default: {
1438
+ type: string;
1439
+ };
1440
+ readonly min: 1;
1441
+ } & Readonly<{
1442
+ '~schema.content.rule'?: Readonly<{
1443
+ kind: 'types';
1444
+ types: readonly string[];
1445
+ }> | undefined;
1446
+ }>>;
1447
+ readonly object: true;
1448
+ readonly properties: {
1449
+ readonly autoSize: PropertyBooleanDescriptor<{
1450
+ readonly default: true;
1451
+ }>;
1452
+ } & BoardStyleProperties<{
1453
+ readonly opacity: 1;
1454
+ readonly textSize: 'm';
1455
+ }>;
1456
+ };
1457
+ };
1458
+ readonly targetPlugins: readonly [BasePlugin<Readonly<{
1459
+ formats: true;
1460
+ rules: true;
1461
+ }> & Readonly<{
1462
+ name: "paragraph";
1463
+ }> & Readonly<Record<never, never>> & Readonly<{
1464
+ __pluginWritableProperties: never;
1465
+ schema: {
1466
+ readonly element: Readonly<{
1467
+ content: Readonly<{
1468
+ allowed: Readonly<{
1469
+ kind: 'any';
1470
+ rules: readonly [Readonly<{
1471
+ kind: 'text';
1472
+ }>, Readonly<{
1473
+ group: 'inline';
1474
+ kind: 'group';
1475
+ }>];
1476
+ }>;
1477
+ prefix?: readonly Readonly<{
1478
+ element: string | Readonly<{
1479
+ source: string;
1480
+ type: string;
1481
+ }>;
1482
+ properties?: Readonly<Record<string, EditorJsonValue>>;
1483
+ }>[] | undefined;
1484
+ } & Readonly<{
1485
+ default: 'text';
1486
+ min: 1;
1487
+ }> & Readonly<{
1488
+ '~schema.content.rule'?: Readonly<{
1489
+ kind: 'any';
1490
+ rules: readonly [Readonly<{
1491
+ kind: 'text';
1492
+ }>, Readonly<{
1493
+ group: 'inline';
1494
+ kind: 'group';
1495
+ }>];
1496
+ }> | undefined;
1497
+ }>>;
1498
+ }>;
1499
+ };
1500
+ }>>, "heading"];
1501
+ readonly name: "boardText";
1502
+ readonly formats: true;
1503
+ readonly update: {
1504
+ insert: TxDeclaredMethod<(props: BoardShapeInsertProps<{
1505
+ readonly autoSize: boolean;
1506
+ } & {
1507
+ opacity: number;
1508
+ textSize: "l" | "m" | "s" | "xl";
1509
+ }>, options: Readonly<{
1510
+ board: NodeKey;
1511
+ }>) => string | undefined>;
1512
+ };
1386
1513
  }>> & Readonly<Record<never, never>>, BasePlugin<Readonly<{
1387
1514
  readonly __pluginWritableProperties: Readonly<{
1388
1515
  descriptor: PropertyEnumDescriptor<readonly ["dashed", "dotted", "solid"], Readonly<{
@@ -1559,6 +1686,18 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1559
1686
  }>) => string | undefined>;
1560
1687
  };
1561
1688
  }>> & Readonly<Record<never, never>>, BasePlugin<Readonly<{
1689
+ readonly update: {
1690
+ readonly insert: TxDeclaredMethod<({ children, frame, height, width, x, y }: Readonly<{
1691
+ children: readonly [Descendant];
1692
+ frame?: string;
1693
+ height?: number;
1694
+ width?: number;
1695
+ x: number;
1696
+ y: number;
1697
+ }>, { board }: Readonly<{
1698
+ board: NodeKey;
1699
+ }>) => string | undefined>;
1700
+ };
1562
1701
  readonly __pluginWritableProperties: never;
1563
1702
  readonly schema: {
1564
1703
  readonly element: {
@@ -1590,18 +1729,6 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1590
1729
  readonly targetPlugins: readonly ["image", "upload"];
1591
1730
  readonly name: "boardImage";
1592
1731
  readonly formats: true;
1593
- readonly update: {
1594
- readonly insert: TxDeclaredMethod<({ children, frame, height, width, x, y }: Readonly<{
1595
- children: readonly [Descendant];
1596
- frame?: string;
1597
- height?: number;
1598
- width?: number;
1599
- x: number;
1600
- y: number;
1601
- }>, { board }: Readonly<{
1602
- board: NodeKey;
1603
- }>) => string | undefined>;
1604
- };
1605
1732
  }>> & Readonly<Record<never, never>>, BasePlugin<Readonly<{
1606
1733
  readonly __pluginWritableProperties: Readonly<{
1607
1734
  descriptor: PropertyEnumDescriptor<readonly ["dashed", "dotted", "solid"], Readonly<{
@@ -1978,7 +2105,7 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1978
2105
  * The slice a copy of shapes `ids` carries, as the clipboard exports
1979
2106
  * it, or null when no id names a shape or they sit in two boards.
1980
2107
  */
1981
- readonly slice: (ids: readonly string[]) => ContentSlice | null;
2108
+ readonly slice: (ids: readonly string[]) => ContentSlice$1 | null;
1982
2109
  /** The members of the board block `board`, in stored order. */
1983
2110
  readonly shapes: (board: NodeKey) => BoardMemberEntry[];
1984
2111
  /**
@@ -1997,7 +2124,7 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1997
2124
  * ids, or undefined when `board` is no board, `slice` holds anything
1998
2125
  * but shapes, or the paste is refused.
1999
2126
  */
2000
- readonly insertCopy: TxDeclaredMethod<(slice: ContentSlice, { board, place }: Readonly<{
2127
+ readonly insertCopy: TxDeclaredMethod<(slice: ContentSlice$1, { board, place }: Readonly<{
2001
2128
  board: NodeKey;
2002
2129
  place?: BoardPlace;
2003
2130
  }>) => string[] | undefined>;
@@ -2036,6 +2163,8 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
2036
2163
  * frontmost frame under its middle, or leaves its frame. An image
2037
2164
  * shape keeps its ratio: its height follows the given width, and a
2038
2165
  * shrink stops at a short edge of 8, so it can store another width.
2166
+ * Resizing a free-text shape locks its width by setting `autoSize`
2167
+ * to `false`.
2039
2168
  */
2040
2169
  readonly resize: TxDeclaredMethod<(id: string, rect: BoardPlace & BoardSize) => void>;
2041
2170
  /**
@@ -2149,4 +2278,135 @@ declare const BaseBoardStrokePlugin: BasePlugin<Readonly<{}> & Readonly<{
2149
2278
  };
2150
2279
  }>>;
2151
2280
  type BoardStrokeElement = ElementOf<typeof BaseBoardStrokePlugin>;
2152
- export { BoardShapeEntry as A, isBoardSize as B, BoardArrowEnd as C, BoardArrowEntry as D, isBoardArrowEnd as E, BoardPlace as F, BoardStyles as G, BOARD_ARROW_STYLES as H, BoardRestackDirection as I, BoardShapeInsertProps as L, BoardShapePlace as M, isBoardFramePlace as N, BoardFrameEntry as O, isBoardShapePlace as P, BoardSize as R, BoardArrowAnchor as S, BoardArrowSide as T, BOARD_STROKE_STYLES as U, isStackingKey as V, BoardStyleProperties as W, BaseBoardFramePlugin as _, BoardElement as a, BoardArrowElement as b, BoardStrokePoints as c, BoardNoteElement as d, BaseBoardImagePlugin as f, BoardGeoElement as g, BoardGeo as h, BoardDefinition as i, BoardFramePlace as j, BoardMemberEntry as k, isBoardStrokePoints as l, BaseBoardGeoPlugin as m, BoardStrokeElement as n, BoardInkPoint as o, BoardImageElement as p, BaseBoardPlugin as r, BoardStrokePath as s, BaseBoardStrokePlugin as t, BaseBoardNotePlugin as u, BoardFrameElement as v, BoardArrowEnds as w, BoardArrowEndInput as x, BaseBoardArrowPlugin as y, defineBoardShape as z };
2281
+ /** Free text on a board, growing with its content while `autoSize` is true until resized. */
2282
+ declare const BaseBoardTextPlugin: BasePlugin<Readonly<{
2283
+ readonly __pluginWritableProperties: Readonly<{
2284
+ descriptor: PropertyBooleanDescriptor<{
2285
+ readonly default: true;
2286
+ }>;
2287
+ key: "autoSize";
2288
+ localId: "autoSize";
2289
+ ownerName: "boardText";
2290
+ placement: "element";
2291
+ unaliased: true;
2292
+ value: boolean;
2293
+ }> | Readonly<{
2294
+ descriptor: PropertyNumberDescriptor<Readonly<{
2295
+ default: number;
2296
+ }> & Readonly<{
2297
+ validate: (value: unknown) => value is number;
2298
+ validationVersion: 1;
2299
+ }>>;
2300
+ key: "opacity";
2301
+ localId: "opacity";
2302
+ ownerName: "boardText";
2303
+ placement: "element";
2304
+ unaliased: true;
2305
+ value: number;
2306
+ }> | Readonly<{
2307
+ descriptor: PropertyEnumDescriptor<readonly ["l", "m", "s", "xl"], Readonly<{
2308
+ default: "l" | "m" | "s" | "xl";
2309
+ }>>;
2310
+ key: "textSize";
2311
+ localId: "textSize";
2312
+ ownerName: "boardText";
2313
+ placement: "element";
2314
+ unaliased: true;
2315
+ value: "l" | "m" | "s" | "xl";
2316
+ }>;
2317
+ readonly schema: {
2318
+ readonly element: {
2319
+ readonly blockContent: false;
2320
+ readonly content: Readonly<{
2321
+ allowed: Readonly<{
2322
+ kind: 'types';
2323
+ types: readonly string[];
2324
+ }>;
2325
+ prefix?: readonly Readonly<{
2326
+ element: string | Readonly<{
2327
+ source: string;
2328
+ type: string;
2329
+ }>;
2330
+ properties?: Readonly<Record<string, EditorJsonValue>>;
2331
+ }>[] | undefined;
2332
+ } & {
2333
+ readonly default: {
2334
+ type: string;
2335
+ };
2336
+ readonly min: 1;
2337
+ } & Readonly<{
2338
+ '~schema.content.rule'?: Readonly<{
2339
+ kind: 'types';
2340
+ types: readonly string[];
2341
+ }> | undefined;
2342
+ }>>;
2343
+ readonly object: true;
2344
+ readonly properties: {
2345
+ readonly autoSize: PropertyBooleanDescriptor<{
2346
+ readonly default: true;
2347
+ }>;
2348
+ } & BoardStyleProperties<{
2349
+ readonly opacity: 1;
2350
+ readonly textSize: 'm';
2351
+ }>;
2352
+ };
2353
+ };
2354
+ readonly targetPlugins: readonly [BasePlugin<Readonly<{
2355
+ formats: true;
2356
+ rules: true;
2357
+ }> & Readonly<{
2358
+ name: "paragraph";
2359
+ }> & Readonly<Record<never, never>> & Readonly<{
2360
+ __pluginWritableProperties: never;
2361
+ schema: {
2362
+ readonly element: Readonly<{
2363
+ content: Readonly<{
2364
+ allowed: Readonly<{
2365
+ kind: 'any';
2366
+ rules: readonly [Readonly<{
2367
+ kind: 'text';
2368
+ }>, Readonly<{
2369
+ group: 'inline';
2370
+ kind: 'group';
2371
+ }>];
2372
+ }>;
2373
+ prefix?: readonly Readonly<{
2374
+ element: string | Readonly<{
2375
+ source: string;
2376
+ type: string;
2377
+ }>;
2378
+ properties?: Readonly<Record<string, EditorJsonValue>>;
2379
+ }>[] | undefined;
2380
+ } & Readonly<{
2381
+ default: 'text';
2382
+ min: 1;
2383
+ }> & Readonly<{
2384
+ '~schema.content.rule'?: Readonly<{
2385
+ kind: 'any';
2386
+ rules: readonly [Readonly<{
2387
+ kind: 'text';
2388
+ }>, Readonly<{
2389
+ group: 'inline';
2390
+ kind: 'group';
2391
+ }>];
2392
+ }> | undefined;
2393
+ }>>;
2394
+ }>;
2395
+ };
2396
+ }>>, "heading"];
2397
+ readonly name: "boardText";
2398
+ readonly formats: true;
2399
+ readonly update: {
2400
+ insert: TxDeclaredMethod<(props: BoardShapeInsertProps<{
2401
+ readonly autoSize: boolean;
2402
+ } & {
2403
+ opacity: number;
2404
+ textSize: "l" | "m" | "s" | "xl";
2405
+ }>, options: Readonly<{
2406
+ board: NodeKey;
2407
+ }>) => string | undefined>;
2408
+ };
2409
+ }>> & Readonly<Record<never, never>>;
2410
+ /** Element type for a free-text shape on a board. */
2411
+ type BoardTextElement = ElementOf<typeof BaseBoardTextPlugin>;
2412
+ export { BoardFrameEntry as A, BoardSize as B, BoardArrowEndInput as C, BoardArrowSide as D, BoardArrowEnds as E, isBoardFramePlace as F, BOARD_STROKE_STYLES as G, isBoardSize as H, isBoardShapePlace as I, BoardStyleProperties as K, BoardPlace as L, BoardShapeEntry as M, BoardFramePlace as N, isBoardArrowEnd as O, BoardShapePlace as P, BoardRestackDirection as R, BoardArrowElement as S, BoardArrowEnd as T, isStackingKey as U, defineBoardShape as V, BOARD_ARROW_STYLES as W, BoardGeo as _, BaseBoardPlugin as a, BoardFrameElement as b, BoardInkPoint as c, isBoardStrokePoints as d, BaseBoardNotePlugin as f, BaseBoardGeoPlugin as g, BoardImageElement as h, BoardStrokeElement as i, BoardMemberEntry as j, BoardArrowEntry as k, BoardStrokePath as l, BaseBoardImagePlugin as m, BoardTextElement as n, BoardDefinition as o, BoardNoteElement as p, BoardStyles as q, BaseBoardStrokePlugin as r, BoardElement as s, BaseBoardTextPlugin as t, BoardStrokePoints as u, BoardGeoElement as v, BoardArrowAnchor as w, BaseBoardArrowPlugin as x, BaseBoardFramePlugin as y, BoardShapeInsertProps as z };
@@ -1,4 +1,4 @@
1
- import { Au as encodeEditorSelection, Cs as RootFactsJson, D as CarriedRun, Et as EditorEffect, Fc as Selection, J as DocumentChange, Pi as HistoryApi, Y as Editor, iu as TxDeclaredMethod, ku as encodeEditorEffect, oo as Plugin, ou as TxOnlyMethod, su as Value, zn as EditorSchemaIdentity, zo as PluginTypeProvider } from "./index-DHt8nZQ6-NUTahb8N.js";
1
+ import { D as CarriedRun, Et as EditorEffect, Is as RootFactsJson, J as DocumentChange, Ko as PluginTypeProvider, Uu as encodeEditorEffect, Vn as EditorSchemaIdentity, Wu as encodeEditorSelection, Y as Editor, Yc as Selection, bu as TxOnlyMethod, po as Plugin, vu as TxDeclaredMethod, xu as Value, zi as HistoryApi } from "./tx-only-D8lpB-sT-ZiAbZRMU.js";
2
2
  interface Batch<_V extends Value = Value> {
3
3
  /** Canonical change to apply when this batch is consumed. */
4
4
  readonly change: DocumentChange;
@@ -48,8 +48,8 @@ type HistoryJSON = Readonly<{
48
48
  redos: readonly HistoryBatchJSON[];
49
49
  schema: EditorSchemaIdentity;
50
50
  undos: readonly HistoryBatchJSON[];
51
- /** 7 for every history this build saves. It still reads 4, 5 and 6. */
52
- version: 4 | 5 | 6 | 7;
51
+ /** 8 for every history this build saves (carrying v4 DocumentChangeJson). */
52
+ version: 8;
53
53
  }>;
54
54
  type HistoryBatchJSON = Readonly<{
55
55
  change: ReturnType<DocumentChange['toJSON']>;
@@ -65,8 +65,8 @@ type HistoryBatchJSON = Readonly<{
65
65
  /** Only beside `unsettle` on a step whose commit settled a decision's text. */
66
66
  rest?: ReturnType<DocumentChange['toJSON']>;
67
67
  /**
68
- * Only at version 7: the facts of what the step moved, split and joined,
69
- * per root, or null when they are unknown. A step with no fact omits it.
68
+ * The facts of what the step moved, split and joined, per root, or null when
69
+ * they are unknown. A step with no fact omits it.
70
70
  */
71
71
  record?: Readonly<Record<string, RootFactsJson>> | null;
72
72
  /**
@@ -122,14 +122,6 @@ type HistoryTxApi<V extends Value = Value> = {
122
122
  /** Do not save this transaction to history. */
123
123
  skip: HistoryControlTx;
124
124
  };
125
- type HistoryOptions<TEnabled extends boolean | undefined = undefined> = {
126
- /** Disable history for an editor that installs history through a preset. */
127
- enabled?: TEnabled;
128
- /** Maximum number of undo and redo batches retained per branch. */
129
- maxDepth?: number;
130
- /** Idle time in milliseconds before an automatic edit starts a new batch. */
131
- newBatchDelay?: number;
132
- };
133
125
  type HistoryPluginTypes<V extends Value = Value> = {
134
126
  api: {
135
127
  history: HistoryApi;
@@ -161,6 +153,4 @@ declare namespace HistoryPluginTypeProvider {
161
153
  }
162
154
  type HistoryPlugin<TEnabled extends boolean | undefined = undefined> = Plugin<HistoryPluginDefinition<TEnabled>> & HistoryPluginTypeProvider;
163
155
  type HistoryAction = 'redo' | 'undo';
164
- /** Create the inverse-change history plugin. */
165
- declare const history: <const TEnabled extends boolean | undefined = undefined>(options?: HistoryOptions<TEnabled>) => HistoryPlugin<TEnabled>;
166
- export { HistoryJSON as a, HistoryPluginTypeProvider as c, HistoryTxApi as d, history as f, HistoryControlTx as i, HistoryPluginTypes as l, History as n, HistoryOptions as o, HistoryBatchJSON as r, HistoryPlugin as s, Batch as t, HistoryStateApi as u };
156
+ export { HistoryJSON as a, HistoryStateApi as c, HistoryControlTx as i, HistoryTxApi as l, History as n, HistoryPlugin as o, HistoryBatchJSON as r, HistoryPluginTypeProvider as s, Batch as t };