platejs 54.0.0-beta.1 → 54.0.0-beta.3

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 (723) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES.md +113 -0
  3. package/dist/AIChatRequestContext-DY104TqL.d.ts +34 -0
  4. package/dist/BaseSuggestionPlugin-Deo6n6Fs.d.ts +90 -0
  5. package/dist/PlateStatic-CJX5bKuv.d.ts +19 -0
  6. package/dist/_virtual/_rolldown/runtime.js +28 -0
  7. package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
  8. package/dist/ai/index.d.ts +2 -0
  9. package/dist/ai/index.js +2 -0
  10. package/dist/ai/lib/AIChatRequestContext.js +16 -0
  11. package/dist/ai/lib/findQuotedSpan.internal.js +63 -0
  12. package/dist/ai/react/AIChatPlugin.js +1238 -0
  13. package/dist/ai/react/CopilotPlugin.js +399 -0
  14. package/dist/ai/react/aiOutputLanding.internal.js +272 -0
  15. package/dist/ai/react/index.d.ts +1213 -0
  16. package/dist/ai/react/index.js +4 -0
  17. package/dist/ai/react/useAIChat.js +327 -0
  18. package/dist/authored/AuthoredPlugin.js +11 -0
  19. package/dist/authored/index.d.ts +4 -0
  20. package/dist/authored/index.js +3 -0
  21. package/dist/code-block/codemirror/createCodeMirrorAdapter.js +507 -0
  22. package/dist/code-block/codemirror/index.d.ts +18 -0
  23. package/dist/code-block/codemirror/index.js +2 -0
  24. package/dist/combobox-DAOYWuvC.d.ts +22 -0
  25. package/dist/comparison-types-Dt-unJZY-DCddmbSD.d.ts +177 -0
  26. package/dist/compiler/compileEditor.js +10 -0
  27. package/dist/compiler/index.d.ts +12 -0
  28. package/dist/compiler/index.js +2 -0
  29. package/dist/core-ClHasORr.d.ts +10862 -0
  30. package/dist/core.js +34 -0
  31. package/dist/diff/index.d.ts +30 -0
  32. package/dist/diff/index.js +1 -0
  33. package/dist/docs/ai.md +596 -0
  34. package/dist/docs/annotations.md +240 -0
  35. package/dist/docs/api/anchor.md +90 -0
  36. package/dist/docs/api/core/plate-components.md +582 -0
  37. package/dist/docs/api/core/plate-controller.md +81 -0
  38. package/dist/docs/api/core/plate-editor.md +310 -0
  39. package/dist/docs/api/core/plate-plugin.md +826 -0
  40. package/dist/docs/api/core/plate-store.md +106 -0
  41. package/dist/docs/api/core.md +735 -0
  42. package/dist/docs/api/document-change.md +225 -0
  43. package/dist/docs/api/dom.md +475 -0
  44. package/dist/docs/api/editor-api.md +569 -0
  45. package/dist/docs/api/editor-transforms.md +673 -0
  46. package/dist/docs/api/element.md +88 -0
  47. package/dist/docs/api/location.md +58 -0
  48. package/dist/docs/api/node.md +213 -0
  49. package/dist/docs/api/path.md +123 -0
  50. package/dist/docs/api/plate.md +99 -0
  51. package/dist/docs/api/point.md +59 -0
  52. package/dist/docs/api/range.md +88 -0
  53. package/dist/docs/api/react-hooks.md +636 -0
  54. package/dist/docs/api/resizable.md +121 -0
  55. package/dist/docs/api/selection.md +168 -0
  56. package/dist/docs/api/text.md +55 -0
  57. package/dist/docs/api/utils.md +149 -0
  58. package/dist/docs/authored-changes.md +452 -0
  59. package/dist/docs/autoformat.md +155 -0
  60. package/dist/docs/basic-blocks.md +205 -0
  61. package/dist/docs/basic-marks.md +187 -0
  62. package/dist/docs/block-menu.md +69 -0
  63. package/dist/docs/block-placeholder.md +164 -0
  64. package/dist/docs/blockquote.md +164 -0
  65. package/dist/docs/board.md +670 -0
  66. package/dist/docs/bold.md +142 -0
  67. package/dist/docs/browser.md +189 -0
  68. package/dist/docs/callout.md +148 -0
  69. package/dist/docs/clear-formatting.md +169 -0
  70. package/dist/docs/clipboard.md +500 -0
  71. package/dist/docs/code-block.md +530 -0
  72. package/dist/docs/code.md +134 -0
  73. package/dist/docs/column.md +173 -0
  74. package/dist/docs/combobox.md +247 -0
  75. package/dist/docs/comment.md +572 -0
  76. package/dist/docs/controlled.md +280 -0
  77. package/dist/docs/copilot.md +443 -0
  78. package/dist/docs/date.md +199 -0
  79. package/dist/docs/debugging.md +218 -0
  80. package/dist/docs/decorations.md +67 -0
  81. package/dist/docs/details.md +276 -0
  82. package/dist/docs/discussion.md +170 -0
  83. package/dist/docs/dnd.md +354 -0
  84. package/dist/docs/document-meta.md +233 -0
  85. package/dist/docs/document-model.md +383 -0
  86. package/dist/docs/docx.md +473 -0
  87. package/dist/docs/dom-coverage.md +101 -0
  88. package/dist/docs/editing-behavior.md +322 -0
  89. package/dist/docs/editor-methods.md +233 -0
  90. package/dist/docs/editor.md +940 -0
  91. package/dist/docs/emoji.md +209 -0
  92. package/dist/docs/equation.md +263 -0
  93. package/dist/docs/examples/collaboration-example.md +61 -0
  94. package/dist/docs/examples/editable-voids.md +58 -0
  95. package/dist/docs/examples/export.md +79 -0
  96. package/dist/docs/examples/huge-document.md +3 -0
  97. package/dist/docs/examples/hundreds-editors.md +41 -0
  98. package/dist/docs/examples/preview-markdown.md +43 -0
  99. package/dist/docs/examples/version-history.md +54 -0
  100. package/dist/docs/excalidraw.md +200 -0
  101. package/dist/docs/exit-break.md +267 -0
  102. package/dist/docs/external-text.md +145 -0
  103. package/dist/docs/feature-kits.md +147 -0
  104. package/dist/docs/field.md +370 -0
  105. package/dist/docs/find.md +175 -0
  106. package/dist/docs/font.md +186 -0
  107. package/dist/docs/footnote.md +530 -0
  108. package/dist/docs/form.md +441 -0
  109. package/dist/docs/format-painter.md +224 -0
  110. package/dist/docs/heading.md +99 -0
  111. package/dist/docs/highlight.md +135 -0
  112. package/dist/docs/history.md +408 -0
  113. package/dist/docs/horizontal-rule.md +181 -0
  114. package/dist/docs/html.md +379 -0
  115. package/dist/docs/indent.md +221 -0
  116. package/dist/docs/index.md +91 -0
  117. package/dist/docs/installation/docs.md +24 -0
  118. package/dist/docs/installation/manual.md +392 -0
  119. package/dist/docs/installation/mcp.md +147 -0
  120. package/dist/docs/installation/next.md +368 -0
  121. package/dist/docs/installation/node.md +148 -0
  122. package/dist/docs/installation/plate-ui.md +269 -0
  123. package/dist/docs/installation/react.md +347 -0
  124. package/dist/docs/installation/rsc.md +138 -0
  125. package/dist/docs/installation.md +93 -0
  126. package/dist/docs/italic.md +128 -0
  127. package/dist/docs/kbd.md +125 -0
  128. package/dist/docs/line-height.md +171 -0
  129. package/dist/docs/link.md +319 -0
  130. package/dist/docs/lint.md +408 -0
  131. package/dist/docs/list.md +213 -0
  132. package/dist/docs/llms.txt +147 -0
  133. package/dist/docs/locations.md +232 -0
  134. package/dist/docs/markdown.md +794 -0
  135. package/dist/docs/media.md +619 -0
  136. package/dist/docs/mention.md +187 -0
  137. package/dist/docs/migration/plite-to-plate.md +251 -0
  138. package/dist/docs/multi-select.md +97 -0
  139. package/dist/docs/navigation-feedback.md +196 -0
  140. package/dist/docs/pagination.md +164 -0
  141. package/dist/docs/performance.md +105 -0
  142. package/dist/docs/plugin-components.md +236 -0
  143. package/dist/docs/plugin-context.md +386 -0
  144. package/dist/docs/plugin-input-rules.md +974 -0
  145. package/dist/docs/plugin-methods.md +421 -0
  146. package/dist/docs/plugin-rules.md +904 -0
  147. package/dist/docs/plugin-shortcuts.md +387 -0
  148. package/dist/docs/plugin.md +560 -0
  149. package/dist/docs/prompt-editor.md +205 -0
  150. package/dist/docs/releases.md +3 -0
  151. package/dist/docs/roots.md +313 -0
  152. package/dist/docs/rtl.md +64 -0
  153. package/dist/docs/schema.md +148 -0
  154. package/dist/docs/selection.md +232 -0
  155. package/dist/docs/serializing.md +187 -0
  156. package/dist/docs/single-block.md +136 -0
  157. package/dist/docs/slash-command.md +144 -0
  158. package/dist/docs/static.md +438 -0
  159. package/dist/docs/strikethrough.md +131 -0
  160. package/dist/docs/subscript.md +113 -0
  161. package/dist/docs/suggestion.md +352 -0
  162. package/dist/docs/superscript.md +113 -0
  163. package/dist/docs/tabbable.md +238 -0
  164. package/dist/docs/table.md +303 -0
  165. package/dist/docs/text-align.md +161 -0
  166. package/dist/docs/toc.md +295 -0
  167. package/dist/docs/toolbar.md +291 -0
  168. package/dist/docs/trailing-block.md +138 -0
  169. package/dist/docs/transactions.md +300 -0
  170. package/dist/docs/troubleshooting.md +159 -0
  171. package/dist/docs/typescript.md +77 -0
  172. package/dist/docs/underline.md +125 -0
  173. package/dist/docs/unit-testing.md +340 -0
  174. package/dist/docs/upload.md +344 -0
  175. package/dist/docs/virtualized-rendering.md +75 -0
  176. package/dist/docs/yjs.md +256 -0
  177. package/dist/docx/export/index.d.ts +112 -0
  178. package/dist/docx/export/index.js +2 -0
  179. package/dist/docx/export/lib/comments.js +231 -0
  180. package/dist/docx/export/lib/docxStaticComponents.js +381 -0
  181. package/dist/docx/export/lib/exportDocx.js +379 -0
  182. package/dist/docx/export/lib/exportHtmlToDocx.internal.js +70 -0
  183. package/dist/docx/export/lib/generatedParts.js +51 -0
  184. package/dist/docx/export/lib/html-to-docx.internal.js +40 -0
  185. package/dist/docx/export/lib/internal/constants.js +106 -0
  186. package/dist/docx/export/lib/internal/docx-document.js +652 -0
  187. package/dist/docx/export/lib/internal/escape-xml.js +4 -0
  188. package/dist/docx/export/lib/internal/html-to-docx.js +148 -0
  189. package/dist/docx/export/lib/internal/list-item.js +85 -0
  190. package/dist/docx/export/lib/internal/list.js +43 -0
  191. package/dist/docx/export/lib/internal/math.js +187 -0
  192. package/dist/docx/export/lib/internal/namespaces.js +40 -0
  193. package/dist/docx/export/lib/internal/render-document-file.js +403 -0
  194. package/dist/docx/export/lib/internal/schemas/content-types.js +25 -0
  195. package/dist/docx/export/lib/internal/schemas/core.js +26 -0
  196. package/dist/docx/export/lib/internal/schemas/document-rels.js +15 -0
  197. package/dist/docx/export/lib/internal/schemas/document.template.js +36 -0
  198. package/dist/docx/export/lib/internal/schemas/font-table.js +55 -0
  199. package/dist/docx/export/lib/internal/schemas/generic-rels.js +9 -0
  200. package/dist/docx/export/lib/internal/schemas/numbering.js +18 -0
  201. package/dist/docx/export/lib/internal/schemas/rels.js +12 -0
  202. package/dist/docx/export/lib/internal/schemas/settings.js +17 -0
  203. package/dist/docx/export/lib/internal/schemas/styles.js +142 -0
  204. package/dist/docx/export/lib/internal/schemas/theme.js +198 -0
  205. package/dist/docx/export/lib/internal/schemas/web-settings.js +10 -0
  206. package/dist/docx/export/lib/internal/unit-conversion.js +24 -0
  207. package/dist/docx/export/lib/internal/vnode.js +4 -0
  208. package/dist/docx/export/lib/internal/word-styles.js +123 -0
  209. package/dist/docx/export/lib/internal/xml-builder.js +1808 -0
  210. package/dist/docx/export/lib/outputSafety.js +123 -0
  211. package/dist/docx/export/lib/reviewPart.js +234 -0
  212. package/dist/docx/export/lib/reviewProjection.js +163 -0
  213. package/dist/docx/export/lib/sourcePreservation.js +375 -0
  214. package/dist/docx/html/cleanWordHtml.internal.js +371 -0
  215. package/dist/docx/import/index.d.ts +44 -0
  216. package/dist/docx/import/index.js +3 -0
  217. package/dist/docx/import/lib/importDocx.js +1298 -0
  218. package/dist/docx/import/lib/wordFormatting.js +608 -0
  219. package/dist/docx/internal/abort.js +8 -0
  220. package/dist/docx/internal/docxPackage.js +322 -0
  221. package/dist/docx/internal/domParser.js +23 -0
  222. package/dist/docx/internal/packageParts.js +73 -0
  223. package/dist/docx/internal/readDocxNumbering.js +199 -0
  224. package/dist/docx/internal/reviewPart.js +249 -0
  225. package/dist/docx/internal/source.js +77 -0
  226. package/dist/docx/internal/sourceEligibility.js +349 -0
  227. package/dist/docx/internal/wordMath.js +375 -0
  228. package/dist/docx/internal/wordMathVocabulary.js +110 -0
  229. package/dist/docx/paste/index.d.ts +28 -0
  230. package/dist/docx/paste/index.js +2 -0
  231. package/dist/docx/paste/lib/WordPastePlugin.js +329 -0
  232. package/dist/dom/index.d.ts +2 -0
  233. package/dist/dom/index.js +2 -0
  234. package/dist/dom/plite-dom.internal.js +2 -0
  235. package/dist/excalidraw/index.d.ts +58 -0
  236. package/dist/excalidraw/index.js +2 -0
  237. package/dist/excalidraw/lib/BaseExcalidrawPlugin.js +15 -0
  238. package/dist/excalidraw/react/ExcalidrawPlugin.js +6 -0
  239. package/dist/excalidraw/react/index.d.ts +102 -0
  240. package/dist/excalidraw/react/index.js +3 -0
  241. package/dist/excalidraw/react/useExcalidrawSync.js +103 -0
  242. package/dist/facade.js +3 -0
  243. package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +195 -0
  244. package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +126 -0
  245. package/dist/features/basic-nodes/lib/BaseMarkPlugins.js +326 -0
  246. package/dist/features/basic-styles/lib/BaseFormattingPlugin.js +391 -0
  247. package/dist/features/basic-styles/lib/BaseStylePlugins.js +261 -0
  248. package/dist/features/board/index.d.ts +2 -0
  249. package/dist/features/board/index.js +9 -0
  250. package/dist/features/board/lib/BaseBoardArrowPlugin.js +123 -0
  251. package/dist/features/board/lib/BaseBoardFramePlugin.js +84 -0
  252. package/dist/features/board/lib/BaseBoardGeoPlugin.js +12 -0
  253. package/dist/features/board/lib/BaseBoardImagePlugin.js +69 -0
  254. package/dist/features/board/lib/BaseBoardNotePlugin.js +11 -0
  255. package/dist/features/board/lib/BaseBoardPlugin.js +622 -0
  256. package/dist/features/board/lib/BaseBoardStrokePlugin.js +80 -0
  257. package/dist/features/board/lib/boardArrow.internal.js +193 -0
  258. package/dist/features/board/lib/boardCopy.internal.js +278 -0
  259. package/dist/features/board/lib/boardFrame.internal.js +125 -0
  260. package/dist/features/board/lib/boardHtml.internal.js +97 -0
  261. package/dist/features/board/lib/boardMember.internal.js +143 -0
  262. package/dist/features/board/lib/boardRatio.internal.js +21 -0
  263. package/dist/features/board/lib/boardShape.internal.js +193 -0
  264. package/dist/features/board/lib/boardStroke.internal.js +45 -0
  265. package/dist/features/board/lib/boardStyle.internal.js +126 -0
  266. package/dist/features/board/lib/boardTypes.internal.js +16 -0
  267. package/dist/features/callout/index.d.ts +85 -0
  268. package/dist/features/callout/index.js +2 -0
  269. package/dist/features/callout/lib/BaseCalloutPlugin.js +30 -0
  270. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +713 -0
  271. package/dist/features/code-block/lib/CodeBlockRules.js +21 -0
  272. package/dist/features/combobox/index.d.ts +3 -0
  273. package/dist/features/combobox/index.js +2 -0
  274. package/dist/features/combobox/lib/combobox.internal.js +111 -0
  275. package/dist/features/combobox/lib/filterWords.js +23 -0
  276. package/dist/features/comments/BaseCommentsPlugin.js +1237 -0
  277. package/dist/features/comments/index.d.ts +2 -0
  278. package/dist/features/comments/index.js +2 -0
  279. package/dist/features/comments/plite-comments.internal.js +2 -0
  280. package/dist/features/date/index.d.ts +42 -0
  281. package/dist/features/date/index.js +3 -0
  282. package/dist/features/date/lib/BaseDatePlugin.js +65 -0
  283. package/dist/features/date/lib/dateValue.js +17 -0
  284. package/dist/features/date/lib/legacyDateValue.internal.js +39 -0
  285. package/dist/features/details/index.d.ts +361 -0
  286. package/dist/features/details/index.js +2 -0
  287. package/dist/features/details/lib/BaseDetailsPlugin.js +438 -0
  288. package/dist/features/field/index.d.ts +2 -0
  289. package/dist/features/field/index.js +2 -0
  290. package/dist/features/field/lib/BaseFieldPlugin.js +414 -0
  291. package/dist/features/field/lib/fieldRules.internal.js +42 -0
  292. package/dist/features/find/index.d.ts +75 -0
  293. package/dist/features/find/index.js +2 -0
  294. package/dist/features/find/lib/BaseFindPlugin.js +301 -0
  295. package/dist/features/footnote/index.d.ts +2 -0
  296. package/dist/features/footnote/index.js +2 -0
  297. package/dist/features/footnote/lib/BaseFootnotePlugin.js +434 -0
  298. package/dist/features/footnote/lib/internal/getFootnoteTarget.js +31 -0
  299. package/dist/features/indent/lib/BaseIndentPlugin.js +164 -0
  300. package/dist/features/indent/lib/indentLevel.internal.js +9 -0
  301. package/dist/features/ink/index.d.ts +2 -0
  302. package/dist/features/ink/index.js +2 -0
  303. package/dist/features/ink/lib/BaseInkPlugin.js +406 -0
  304. package/dist/features/ink/lib/inkCodec.internal.js +130 -0
  305. package/dist/features/ink/lib/inkGone.internal.js +288 -0
  306. package/dist/features/ink/lib/inkMatch.internal.js +207 -0
  307. package/dist/features/ink/lib/inkPlaces.internal.js +556 -0
  308. package/dist/features/layout/index.d.ts +2 -0
  309. package/dist/features/layout/index.js +2 -0
  310. package/dist/features/layout/lib/BaseColumnPlugin.js +249 -0
  311. package/dist/features/link/lib/BaseLinkPlugin.js +470 -0
  312. package/dist/features/lint/index.d.ts +91 -0
  313. package/dist/features/lint/index.js +2 -0
  314. package/dist/features/lint/lib/BaseLintPlugin.js +639 -0
  315. package/dist/features/list/lib/BaseListPlugin.js +869 -0
  316. package/dist/features/list/lib/listConversion.internal.js +55 -0
  317. package/dist/features/list/lib/listFamily.internal.js +120 -0
  318. package/dist/features/list/lib/listHtml.internal.js +79 -0
  319. package/dist/features/list/lib/listIdentity.internal.js +455 -0
  320. package/dist/features/list/lib/listIndex.internal.js +342 -0
  321. package/dist/features/list/lib/listNumbering.internal.js +391 -0
  322. package/dist/features/list/lib/listPaste.internal.js +81 -0
  323. package/dist/features/media/index.d.ts +2 -0
  324. package/dist/features/media/index.js +5 -0
  325. package/dist/features/media/lib/BaseMediaPlugin.js +351 -0
  326. package/dist/features/media/lib/image/BaseImagePlugin.js +395 -0
  327. package/dist/features/media/lib/media/parseMediaUrl.js +161 -0
  328. package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +140 -0
  329. package/dist/features/media/lib/mediaHtml.internal.js +43 -0
  330. package/dist/features/mention/index.d.ts +73 -0
  331. package/dist/features/mention/index.js +2 -0
  332. package/dist/features/mention/lib/BaseMentionPlugin.js +120 -0
  333. package/dist/features/suggestion/BaseSuggestionPlugin.js +30 -0
  334. package/dist/features/suggestion/index.d.ts +9 -0
  335. package/dist/features/suggestion/index.js +3 -0
  336. package/dist/features/suggestion/suggestionColorOf.js +14 -0
  337. package/dist/features/table/index.d.ts +2 -0
  338. package/dist/features/table/index.js +2 -0
  339. package/dist/features/table/lib/BaseTablePlugin.js +1400 -0
  340. package/dist/features/table/lib/internal/context.js +58 -0
  341. package/dist/features/table/lib/internal/grid.js +193 -0
  342. package/dist/features/table/lib/internal/mutation.js +636 -0
  343. package/dist/features/table/lib/internal/paste.js +327 -0
  344. package/dist/features/table/lib/internal/selection.js +309 -0
  345. package/dist/features/table/lib/internal/tableCellHtml.js +280 -0
  346. package/dist/features/table/lib/internal/tabularText.js +50 -0
  347. package/dist/features/toc/index.d.ts +2 -0
  348. package/dist/features/toc/index.js +2 -0
  349. package/dist/features/toc/lib/BaseTocPlugin.js +41 -0
  350. package/dist/features/upload/index.d.ts +2 -0
  351. package/dist/features/upload/index.js +2 -0
  352. package/dist/features/upload/lib/BaseUploadPlugin.js +930 -0
  353. package/dist/features/upload/lib/mimeTypes.internal.js +3982 -0
  354. package/dist/history/index.d.ts +3 -0
  355. package/dist/history/index.js +1 -0
  356. package/dist/history/plite-history.internal.js +2 -0
  357. package/dist/html/index.d.ts +4 -0
  358. package/dist/html/index.js +3 -0
  359. package/dist/html/server/index.d.ts +3 -0
  360. package/dist/html/server/index.js +16 -0
  361. package/dist/htmlTypes-cg_cWsaN.d.ts +198 -0
  362. package/dist/hyperscript/index.d.ts +2 -0
  363. package/dist/hyperscript/index.js +1 -0
  364. package/dist/index-8WO2vI0U.d.ts +6519 -0
  365. package/dist/index-B5mYEawV.d.ts +750 -0
  366. package/dist/index-BZWFoUXt.d.ts +159 -0
  367. package/dist/index-C0POz7rg.d.ts +400 -0
  368. package/dist/index-C1_JIhL4.d.ts +526 -0
  369. package/dist/index-C35V_hj0.d.ts +6 -0
  370. package/dist/index-C6ql9pKw.d.ts +36 -0
  371. package/dist/index-C9DiGDVj.d.ts +558 -0
  372. package/dist/index-CLsEe3LY.d.ts +297 -0
  373. package/dist/index-CdOLsPaW.d.ts +318 -0
  374. package/dist/index-CktYvOgk.d.ts +29 -0
  375. package/dist/index-Cmuluh6f.d.ts +8 -0
  376. package/dist/index-CzLwBZpY.d.ts +46 -0
  377. package/dist/index-D3-2iM1b.d.ts +1084 -0
  378. package/dist/index-DKOFvteF.d.ts +184 -0
  379. package/dist/index-DPWyk3lG-DOYwohXO.d.ts +59 -0
  380. package/dist/index-DQnjqtQa.d.ts +678 -0
  381. package/dist/index-Do9pj1GK.d.ts +1218 -0
  382. package/dist/index-DpltOCot-A2b3p3Eb.d.ts +7644 -0
  383. package/dist/index-HPYawTae-BCUQLEWF.d.ts +111 -0
  384. package/dist/index-baQOK89E.d.ts +166 -0
  385. package/dist/index-oIJAZxc2.d.ts +2152 -0
  386. package/dist/index-r7yb77Wy.d.ts +2660 -0
  387. package/dist/index.d.ts +4 -4
  388. package/dist/index.js +45 -7
  389. package/dist/internal/failInvariant.js +6 -0
  390. package/dist/internal/mergePlateRenderedAttributes.js +41 -0
  391. package/dist/internal/penStroke.internal.js +66 -0
  392. package/dist/internal/plugin/OverridePlugin.js +165 -0
  393. package/dist/internal/plugin/blockInsertion.js +67 -0
  394. package/dist/internal/plugin/blockRelease.js +60 -0
  395. package/dist/internal/plugin/collectPlateNodeMappings.js +62 -0
  396. package/dist/internal/plugin/compilePlainTextMappings.js +56 -0
  397. package/dist/internal/plugin/compilePlateFormats.js +127 -0
  398. package/dist/internal/plugin/compilePlateModel.js +780 -0
  399. package/dist/internal/plugin/compilePlateShortcuts.js +21 -0
  400. package/dist/internal/plugin/defaultElementTag.js +8 -0
  401. package/dist/internal/plugin/getPlateDecorationSources.js +47 -0
  402. package/dist/internal/plugin/getPluginRenderAttributes.js +20 -0
  403. package/dist/internal/plugin/imageLink.js +11 -0
  404. package/dist/internal/plugin/inlineInsertion.js +29 -0
  405. package/dist/internal/plugin/insertionAnchor.js +28 -0
  406. package/dist/internal/plugin/isEditOnlyDisabled.js +27 -0
  407. package/dist/internal/plugin/markdownParagraph.js +7 -0
  408. package/dist/internal/plugin/mergePluginCapabilities.js +90 -0
  409. package/dist/internal/plugin/pastedUploadFiles.js +4 -0
  410. package/dist/internal/plugin/pipeInjectNodeProps.js +30 -0
  411. package/dist/internal/plugin/plateChangeHandlers.js +74 -0
  412. package/dist/internal/plugin/plateRuntime.js +23 -0
  413. package/dist/internal/plugin/pluginFormatOperation.js +100 -0
  414. package/dist/internal/plugin/pluginInjectNodeProps.js +79 -0
  415. package/dist/internal/plugin/pluginStore.js +167 -0
  416. package/dist/internal/plugin/resolvePlugin.js +231 -0
  417. package/dist/internal/plugin/resolvePlugins.js +1173 -0
  418. package/dist/internal/plugin/uploadDrafts.js +6 -0
  419. package/dist/internal/utils/isFunction.js +6 -0
  420. package/dist/internal/utils/mergePlugins.js +219 -0
  421. package/dist/internal/utils/snapshotApiValue.js +29 -0
  422. package/dist/internal/utils/trustedContentSlice.js +9 -0
  423. package/dist/internal/utils/urlPolicy.js +110 -0
  424. package/dist/lib/editor/editorApplicationSchema.js +19 -0
  425. package/dist/lib/editor/editorUser.internal.js +39 -0
  426. package/dist/lib/editor/withPlite.js +480 -0
  427. package/dist/lib/libs/nanoid.js +2 -0
  428. package/dist/lib/libs/zustand.js +29 -0
  429. package/dist/lib/plugin/assertNoPrepareDocument.internal.js +7 -0
  430. package/dist/lib/plugin/createPluginContext.internal.js +363 -0
  431. package/dist/lib/plugin/defineBasePlugin.internal.js +203 -0
  432. package/dist/lib/plugin/definePlugin.js +11 -0
  433. package/dist/lib/plugin/pluginAuthoringContext.js +19 -0
  434. package/dist/lib/plugins/HistoryPlugin.js +15 -0
  435. package/dist/lib/plugins/TransferPlugin.js +7 -0
  436. package/dist/lib/plugins/affinity/AffinityPlugin.js +163 -0
  437. package/dist/lib/plugins/debug/DebugPlugin.js +65 -0
  438. package/dist/lib/plugins/dom/DOMPlugin.js +75 -0
  439. package/dist/lib/plugins/dom/plateDOMPlugin.internal.js +6 -0
  440. package/dist/lib/plugins/element-id/ElementIdPlugin.js +53 -0
  441. package/dist/lib/plugins/element-id/elementIdAdmission.internal.js +34 -0
  442. package/dist/lib/plugins/element-state/ElementStatePlugin.js +14 -0
  443. package/dist/lib/plugins/getCorePlugins.internal.js +25 -0
  444. package/dist/lib/plugins/html/HtmlPlugin.js +1970 -0
  445. package/dist/lib/plugins/html/htmlAst.js +314 -0
  446. package/dist/lib/plugins/html/htmlConversion.js +15 -0
  447. package/dist/lib/plugins/html/htmlDom.js +203 -0
  448. package/dist/lib/plugins/html/htmlMatcher.internal.js +85 -0
  449. package/dist/lib/plugins/html/htmlSafety.js +150 -0
  450. package/dist/lib/plugins/input-rules/InputRulesPlugin.js +327 -0
  451. package/dist/lib/plugins/input-rules/createInputRules.js +290 -0
  452. package/dist/lib/plugins/input-rules/defineInputRule.js +6 -0
  453. package/dist/lib/plugins/input-rules/inputRuleContinuation.internal.js +13 -0
  454. package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +16 -0
  455. package/dist/lib/plugins/input-rules/inputRuleVeto.js +9 -0
  456. package/dist/lib/plugins/input-rules/markInputRule.internal.js +44 -0
  457. package/dist/lib/plugins/paragraph/BaseParagraphPlugin.js +17 -0
  458. package/dist/lib/utils/applyDeepToNodes.js +17 -0
  459. package/dist/lib/utils/defaultsDeepToNodes.js +12 -0
  460. package/dist/lib/utils/environment.js +4 -0
  461. package/dist/lib/utils/getFragmentProp.js +27 -0
  462. package/dist/lib/utils/getInjectMatch.js +42 -0
  463. package/dist/lib/utils/hotkeys.js +113 -0
  464. package/dist/lib/utils/isDefined.js +5 -0
  465. package/dist/lib/utils/isUrl.js +27 -0
  466. package/dist/lib/utils/mergeDeepToNodes.js +12 -0
  467. package/dist/lib/utils/pluginNodeClass.js +10 -0
  468. package/dist/markdown/index.d.ts +2 -0
  469. package/dist/markdown/index.js +3 -0
  470. package/dist/markdown/lib/MarkdownPlugin.js +171 -0
  471. package/dist/markdown/lib/RawHtmlPlugin.js +24 -0
  472. package/dist/markdown/lib/deserializer/convertChildrenDeserialize.js +8 -0
  473. package/dist/markdown/lib/deserializer/convertNodesDeserialize.js +79 -0
  474. package/dist/markdown/lib/deserializer/mdastToSlate.js +28 -0
  475. package/dist/markdown/lib/internal/markdownAttributes.js +178 -0
  476. package/dist/markdown/lib/internal/markdownConversion.js +1365 -0
  477. package/dist/markdown/lib/internal/markdownDiagnostics.js +145 -0
  478. package/dist/markdown/lib/internal/markdownDocument.js +70 -0
  479. package/dist/markdown/lib/internal/markdownFrontmatter.js +102 -0
  480. package/dist/markdown/lib/internal/markdownIntrinsics.js +383 -0
  481. package/dist/markdown/lib/internal/markdownLine.js +550 -0
  482. package/dist/markdown/lib/internal/markdownMappings.js +677 -0
  483. package/dist/markdown/lib/internal/markdownOpenTail.js +381 -0
  484. package/dist/markdown/lib/internal/markdownRawHtml.js +314 -0
  485. package/dist/markdown/lib/internal/markdownReferences.js +70 -0
  486. package/dist/markdown/lib/internal/markdownSafety.js +57 -0
  487. package/dist/markdown/lib/internal/markdownSegments.js +143 -0
  488. package/dist/markdown/lib/internal/markdownTags.js +709 -0
  489. package/dist/markdown/lib/serializer/convertNodesSerialize.js +85 -0
  490. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +226 -0
  491. package/dist/markdown/lib/serializer/listToMdastTree.js +235 -0
  492. package/dist/markdown/lib/serializer/mdastContent.js +22 -0
  493. package/dist/markdown/lib/serializer/reportOmittedProperties.js +34 -0
  494. package/dist/markdown/lib/utils/remarkPlugins.js +34 -0
  495. package/dist/math/index.d.ts +519 -0
  496. package/dist/math/index.js +2 -0
  497. package/dist/math/lib/BaseEquationPlugin.js +345 -0
  498. package/dist/math/lib/mathmlTex.internal.js +1123 -0
  499. package/dist/math/lib/mathmlTexSymbols.internal.js +1852 -0
  500. package/dist/math/react/EquationPlugin.js +7 -0
  501. package/dist/math/react/index.d.ts +66 -0
  502. package/dist/math/react/index.js +2 -0
  503. package/dist/migrations/documentMigrationAuthored.internal.js +18 -0
  504. package/dist/migrations/documentMigrationSelection.internal.js +27 -0
  505. package/dist/migrations/documentMigrationTarget.internal.js +17 -0
  506. package/dist/migrations/documentMigrations.js +320 -0
  507. package/dist/migrations/extractLegacyCommentRanges.js +141 -0
  508. package/dist/migrations/index.d.ts +206 -0
  509. package/dist/migrations/index.js +5 -0
  510. package/dist/migrations/migrateListIdentity.js +93 -0
  511. package/dist/migrations/migratePlateV54.js +170 -0
  512. package/dist/migrations/migratePlateV54Ast.internal.js +381 -0
  513. package/dist/migrations/migratePlateV54BuiltIns.internal.js +87 -0
  514. package/dist/migrations/migratePlateV54CodeBlocks.internal.js +87 -0
  515. package/dist/migrations/migratePlateV54Inputs.internal.js +186 -0
  516. package/dist/migrations/migratePlateV54Ownership.internal.js +20 -0
  517. package/dist/migrations/migratePlateV54Profile.internal.js +367 -0
  518. package/dist/migrations/migratePlateV54RetiredMarks.internal.js +48 -0
  519. package/dist/migrations/migratePlateV54Suggestions.internal.js +236 -0
  520. package/dist/migrations/migratePlateV54Urls.internal.js +125 -0
  521. package/dist/migrations/v53-manifest.internal.js +271 -0
  522. package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +73 -0
  523. package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +75 -0
  524. package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/with-selector.js +11 -0
  525. package/dist/pagination/index.d.ts +167 -0
  526. package/dist/pagination/index.js +2 -0
  527. package/dist/pagination/react/PagedEditorContent.js +77 -0
  528. package/dist/pagination/react/index.d.ts +37 -0
  529. package/dist/pagination/react/index.js +5 -0
  530. package/dist/plain-text.js +38 -0
  531. package/dist/react/components/EditorContentView.internal.js +284 -0
  532. package/dist/react/components/EditorProvider.js +32 -0
  533. package/dist/react/components/EditorRefEffect.js +65 -0
  534. package/dist/react/components/NodeSelection.js +836 -0
  535. package/dist/react/components/Plate.js +244 -0
  536. package/dist/react/components/PlateContainer.js +103 -0
  537. package/dist/react/components/PlateContent.js +36 -0
  538. package/dist/react/components/PlateController.js +39 -0
  539. package/dist/react/components/PlateRoot.internal.js +89 -0
  540. package/dist/react/components/PlateView.js +43 -0
  541. package/dist/react/components/plate-nodes.js +146 -0
  542. package/dist/react/core.js +59 -0
  543. package/dist/react/editor/getPlateCorePlugins.internal.js +20 -0
  544. package/dist/react/editor/useCreateEditor.js +43 -0
  545. package/dist/react/editor/withPlate.js +22 -0
  546. package/dist/react/features/basic-nodes/BasicNodesPlugins.js +29 -0
  547. package/dist/react/features/basic-styles/BasicStylePlugins.js +15 -0
  548. package/dist/react/features/board/BoardPlugin.js +23 -0
  549. package/dist/react/features/board/BoardShape.js +272 -0
  550. package/dist/react/features/board/BoardSurface.js +315 -0
  551. package/dist/react/features/board/boardClipboard.internal.js +100 -0
  552. package/dist/react/features/board/boardConnect.internal.js +198 -0
  553. package/dist/react/features/board/boardGesture.internal.js +583 -0
  554. package/dist/react/features/board/boardIndex.internal.js +426 -0
  555. package/dist/react/features/board/boardInk.internal.js +41 -0
  556. package/dist/react/features/board/boardKeys.internal.js +484 -0
  557. package/dist/react/features/board/boardPick.internal.js +73 -0
  558. package/dist/react/features/board/boardPicking.internal.js +84 -0
  559. package/dist/react/features/board/boardPictures.internal.js +96 -0
  560. package/dist/react/features/board/boardPreview.internal.js +177 -0
  561. package/dist/react/features/board/boardResize.internal.js +153 -0
  562. package/dist/react/features/board/boardSnap.internal.js +267 -0
  563. package/dist/react/features/board/boardView.internal.js +1074 -0
  564. package/dist/react/features/board/boardVoice.internal.js +192 -0
  565. package/dist/react/features/board/index.d.ts +2140 -0
  566. package/dist/react/features/board/index.js +4 -0
  567. package/dist/react/features/callout/CalloutPlugin.js +6 -0
  568. package/dist/react/features/callout/index.d.ts +84 -0
  569. package/dist/react/features/callout/index.js +2 -0
  570. package/dist/react/features/code-block/CodeBlockPlugin.js +9 -0
  571. package/dist/react/features/combobox/comboboxOwner.internal.js +269 -0
  572. package/dist/react/features/combobox/index.d.ts +63 -0
  573. package/dist/react/features/combobox/index.js +2 -0
  574. package/dist/react/features/combobox/useCombobox.js +71 -0
  575. package/dist/react/features/comments/CommentsPlugin.js +34 -0
  576. package/dist/react/features/comments/index.d.ts +605 -0
  577. package/dist/react/features/comments/index.js +2 -0
  578. package/dist/react/features/date/DatePlugin.js +6 -0
  579. package/dist/react/features/date/index.d.ts +40 -0
  580. package/dist/react/features/date/index.js +2 -0
  581. package/dist/react/features/details/DetailsPlugin.js +8 -0
  582. package/dist/react/features/details/index.d.ts +500 -0
  583. package/dist/react/features/details/index.js +2 -0
  584. package/dist/react/features/field/FieldPlugin.js +34 -0
  585. package/dist/react/features/field/index.d.ts +312 -0
  586. package/dist/react/features/field/index.js +2 -0
  587. package/dist/react/features/footnote/FootnotePlugin.js +36 -0
  588. package/dist/react/features/footnote/index.d.ts +245 -0
  589. package/dist/react/features/footnote/index.js +2 -0
  590. package/dist/react/features/format-painter/FormatPainterPlugin.js +156 -0
  591. package/dist/react/features/format-painter/index.d.ts +205 -0
  592. package/dist/react/features/format-painter/index.js +2 -0
  593. package/dist/react/features/indent/IndentPlugin.js +6 -0
  594. package/dist/react/features/ink/InkContent.js +313 -0
  595. package/dist/react/features/ink/InkCopyView.js +203 -0
  596. package/dist/react/features/ink/InkPlugin.js +35 -0
  597. package/dist/react/features/ink/index.d.ts +354 -0
  598. package/dist/react/features/ink/index.js +4 -0
  599. package/dist/react/features/ink/inkCapture.internal.js +336 -0
  600. package/dist/react/features/ink/inkInput.internal.js +19 -0
  601. package/dist/react/features/ink/inkLayout.internal.js +29 -0
  602. package/dist/react/features/ink/inkMeasure.internal.js +242 -0
  603. package/dist/react/features/ink/inkPaint.internal.js +93 -0
  604. package/dist/react/features/ink/inkPlacement.internal.js +557 -0
  605. package/dist/react/features/ink/inkWatch.internal.js +288 -0
  606. package/dist/react/features/layout/ColumnPlugin.js +8 -0
  607. package/dist/react/features/layout/index.d.ts +543 -0
  608. package/dist/react/features/layout/index.js +2 -0
  609. package/dist/react/features/link/LinkPlugin.js +7 -0
  610. package/dist/react/features/list/ListPlugin.js +125 -0
  611. package/dist/react/features/media/index.d.ts +670 -0
  612. package/dist/react/features/media/index.js +2 -0
  613. package/dist/react/features/media/plugins.js +12 -0
  614. package/dist/react/features/mention/MentionPlugin.js +6 -0
  615. package/dist/react/features/mention/index.d.ts +63 -0
  616. package/dist/react/features/mention/index.js +2 -0
  617. package/dist/react/features/resizable/Resizable.js +201 -0
  618. package/dist/react/features/resizable/index.d.ts +27 -0
  619. package/dist/react/features/resizable/index.js +2 -0
  620. package/dist/react/features/resizable/resizeLength.internal.js +11 -0
  621. package/dist/react/features/suggestion/SuggestionPlugin.js +24 -0
  622. package/dist/react/features/suggestion/index.d.ts +45 -0
  623. package/dist/react/features/suggestion/index.js +3 -0
  624. package/dist/react/features/suggestion/suggestion-view.internal.js +112 -0
  625. package/dist/react/features/suggestion/useSuggestion.js +135 -0
  626. package/dist/react/features/table/TablePlugin.js +425 -0
  627. package/dist/react/features/table/index.d.ts +4707 -0
  628. package/dist/react/features/table/index.js +3 -0
  629. package/dist/react/features/table/tableSelectionHostBinding.internal.js +97 -0
  630. package/dist/react/features/table/useTableResize.js +88 -0
  631. package/dist/react/features/toc/TocPlugin.js +6 -0
  632. package/dist/react/features/toc/index.d.ts +20 -0
  633. package/dist/react/features/toc/index.js +2 -0
  634. package/dist/react/features/upload/UploadPlugin.js +41 -0
  635. package/dist/react/features/upload/index.d.ts +313 -0
  636. package/dist/react/features/upload/index.js +2 -0
  637. package/dist/react/index.d.ts +6 -4
  638. package/dist/react/index.js +76 -7
  639. package/dist/react/internal/block-redraws.js +83 -0
  640. package/dist/react/internal/getPlateEditorInstanceKey.js +13 -0
  641. package/dist/react/internal/plate-context.js +507 -0
  642. package/dist/react/internal/plite-components.js +12 -0
  643. package/dist/react/internal/react-helpers.js +19 -0
  644. package/dist/react/internal/rendered-attributes.js +190 -0
  645. package/dist/react/internal/useDeepCompareMemo.js +13 -0
  646. package/dist/react/internal/usePlateInstancesWarn.js +24 -0
  647. package/dist/react/internal/usePlateModelRevision.js +17 -0
  648. package/dist/react/internal/useZustandSelector.js +35 -0
  649. package/dist/react/libs/jotai.js +3 -0
  650. package/dist/react/plite-react.js +2 -0
  651. package/dist/react/plugin/createPluginContext.internal.js +7 -0
  652. package/dist/react/plugin/definePlugin.js +26 -0
  653. package/dist/react/plugin/pluginFactory.internal.js +43 -0
  654. package/dist/react/plugin/toReactPlugin.js +86 -0
  655. package/dist/react/plugins/navigation-feedback/NavigationFeedbackPlugin.js +109 -0
  656. package/dist/react/plugins/paragraph/ParagraphPlugin.js +14 -0
  657. package/dist/react/stores/element/useElement.js +11 -0
  658. package/dist/react/stores/element/useElementSelector.js +20 -0
  659. package/dist/react/stores/element/useElementStore.js +150 -0
  660. package/dist/react/stores/element/useElementStoreSelector.internal.js +69 -0
  661. package/dist/react/stores/element/usePath.js +57 -0
  662. package/dist/react/stores/plate/useEditor.js +136 -0
  663. package/dist/react/stores/plate/useEditorHistory.js +55 -0
  664. package/dist/react/stores/plate/useEditorSelector.js +70 -0
  665. package/dist/react/stores/plate/usePluginStore.js +56 -0
  666. package/dist/react/stores/plate/useViewStore.js +35 -0
  667. package/dist/react/stores/plate-controller/document-focus.internal.js +72 -0
  668. package/dist/react/stores/plate-controller/useFocusedLast.js +30 -0
  669. package/dist/react/utils/BlockPlaceholderPlugin.js +59 -0
  670. package/dist/react/utils/annotationPointer.internal.js +35 -0
  671. package/dist/react/utils/bindPointerSession.internal.js +35 -0
  672. package/dist/react/utils/dispatchPlateShortcut.internal.js +19 -0
  673. package/dist/react/utils/dom-attributes.internal.js +160 -0
  674. package/dist/react/utils/editableKeyDown.internal.js +11 -0
  675. package/dist/react/utils/getRenderNodeProps.internal.js +58 -0
  676. package/dist/react/utils/pipeHandler.internal.js +71 -0
  677. package/dist/react/utils/pipeRenderElement.internal.js +495 -0
  678. package/dist/react/utils/pipeRenderLeaf.internal.js +181 -0
  679. package/dist/react/utils/pipeRenderText.internal.js +138 -0
  680. package/dist/react/utils/pluginRenderElement.internal.js +163 -0
  681. package/dist/react/utils/pluginRenderLeaf.internal.js +89 -0
  682. package/dist/react/utils/pluginRenderText.internal.js +52 -0
  683. package/dist/react/utils/tapOrder.internal.js +106 -0
  684. package/dist/react/utils/useSelectionFragment.js +24 -0
  685. package/dist/react/virtualized.d.ts +13 -0
  686. package/dist/react/virtualized.js +48 -0
  687. package/dist/root.js +45 -0
  688. package/dist/source-aUwpNnAw.d.ts +144 -0
  689. package/dist/static/components/PlateStatic.js +389 -0
  690. package/dist/static/components/plite-nodes.js +43 -0
  691. package/dist/static/index.d.ts +129 -1
  692. package/dist/static/index.js +4 -1
  693. package/dist/static/internal/getPlainText.js +23 -0
  694. package/dist/static/internal/renderStaticHtmlWithOverrides.js +33 -0
  695. package/dist/static/internal/staticDocumentView.js +53 -0
  696. package/dist/static/internal/staticPresentation.js +67 -0
  697. package/dist/static/internal/writeStaticSelectionClipboardData.js +222 -0
  698. package/dist/static/pipeRenderElementStatic.internal.js +32 -0
  699. package/dist/static/pluginRenderElementStatic.internal.js +70 -0
  700. package/dist/static/pluginRenderLeafStatic.internal.js +87 -0
  701. package/dist/static/pluginRenderTextStatic.internal.js +87 -0
  702. package/dist/static/renderStaticHtml.js +9 -0
  703. package/dist/static/utils/getRenderNodeStaticProps.internal.js +31 -0
  704. package/dist/tabbable/index.d.ts +2 -0
  705. package/dist/tabbable/index.js +0 -0
  706. package/dist/tabbable/react/TabbableEffects.internal.js +186 -0
  707. package/dist/tabbable/react/TabbablePlugin.js +15 -0
  708. package/dist/tabbable/react/index.d.ts +16 -0
  709. package/dist/tabbable/react/index.js +2 -0
  710. package/dist/testing/index.d.ts +175 -0
  711. package/dist/testing/index.js +1 -0
  712. package/dist/utils/plate-keys.js +78 -0
  713. package/dist/utils/plugins/ExitBreakPlugin.js +26 -0
  714. package/dist/utils/plugins/SingleBlockPlugin.js +21 -0
  715. package/dist/utils/plugins/SingleLinePlugin.js +32 -0
  716. package/dist/utils/plugins/TrailingBlockPlugin.js +29 -0
  717. package/dist/utils/plugins/joinSingleRootBlock.internal.js +24 -0
  718. package/dist/yjs/index.d.ts +2 -0
  719. package/dist/yjs/index.js +1 -0
  720. package/dist/yjs/react/YjsPlugin.js +60 -0
  721. package/dist/yjs/react/index.d.ts +94 -0
  722. package/dist/yjs/react/index.js +3 -0
  723. package/package.json +684 -36
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Plate utils
1
+ # Plate
2
2
 
3
3
  ## License
4
4
 
5
- [MIT](../../LICENSE)
5
+ [MIT](https://github.com/udecode/plate/blob/main/LICENSE)
@@ -0,0 +1,113 @@
1
+ # Third-party notices
2
+
3
+ ## html-to-docx
4
+
5
+ `platejs/docx/export` includes code adapted from [html-to-docx](https://github.com/TurboDocx/html-to-docx) in `src/docx/export/lib/internal/`, distributed under the MIT License:
6
+
7
+ ```text
8
+ Copyright (c) 2020 privateOmega <privateOmega@protonmail.com>
9
+ Copyright (c) 2023 turbodocx
10
+
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ ```
30
+
31
+ ## KaTeX
32
+
33
+ `platejs` includes data derived from [KaTeX](https://github.com/KaTeX/KaTeX) 0.16.22: the table in `src/math/lib/mathmlTexSymbols.internal.ts`, generated from KaTeX's source and output, and the TeX samples in `src/math/lib/__fixtures__/katex-supported-tex.json`, copied from KaTeX's `docs/supported.md`. KaTeX is distributed under the MIT License:
34
+
35
+ ```text
36
+ The MIT License (MIT)
37
+
38
+ Copyright (c) 2013-2020 Khan Academy and other contributors
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
+ SOFTWARE.
57
+ ```
58
+
59
+ ## Excalidraw
60
+
61
+ `platejs` includes the segment and ellipse intersection tests in `src/features/board/lib/boardArrow.internal.ts`, adapted from [Excalidraw](https://github.com/excalidraw/excalidraw)'s `@excalidraw/math`. Excalidraw is distributed under the MIT License:
62
+
63
+ ```text
64
+ MIT License
65
+
66
+ Copyright (c) 2020 Excalidraw
67
+
68
+ Permission is hereby granted, free of charge, to any person obtaining a copy
69
+ of this software and associated documentation files (the "Software"), to deal
70
+ in the Software without restriction, including without limitation the rights
71
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
72
+ copies of the Software, and to permit persons to whom the Software is
73
+ furnished to do so, subject to the following conditions:
74
+
75
+ The above copyright notice and this permission notice shall be included in all
76
+ copies or substantial portions of the Software.
77
+
78
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
79
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
80
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
81
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
82
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
83
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
84
+ SOFTWARE.
85
+ ```
86
+
87
+ ## perfect-freehand
88
+
89
+ `platejs` includes the pen stroke path and simulated pressure in `src/internal/penStroke.internal.ts`, adapted from [perfect-freehand](https://github.com/steveruizok/perfect-freehand). The board and ink input draw their pen strokes with it. perfect-freehand is distributed under the MIT License:
90
+
91
+ ```text
92
+ MIT License
93
+
94
+ Copyright (c) 2021 Stephen Ruiz Ltd
95
+
96
+ Permission is hereby granted, free of charge, to any person obtaining a copy
97
+ of this software and associated documentation files (the "Software"), to deal
98
+ in the Software without restriction, including without limitation the rights
99
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
100
+ copies of the Software, and to permit persons to whom the Software is
101
+ furnished to do so, subject to the following conditions:
102
+
103
+ The above copyright notice and this permission notice shall be included in all
104
+ copies or substantial portions of the Software.
105
+
106
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
107
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
108
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
109
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
110
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
111
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
112
+ SOFTWARE.
113
+ ```
@@ -0,0 +1,34 @@
1
+ import { Fa as NodeSelectionMode, Mc as Selection, Za as Path, ru as Value, us as Range } from "./index-DpltOCot-A2b3p3Eb.js";
2
+ import "./core-ClHasORr.js";
3
+ type AIToolName = 'comment' | 'edit' | 'generate' | null;
4
+ /** Request-local reference into `AIChatRequestContext.children`. */
5
+ type AIChatRequestNodeRef = Readonly<{
6
+ path: Path;
7
+ ref: string;
8
+ }>;
9
+ type AIChatRequestRefs = Readonly<{
10
+ blocks: readonly AIChatRequestNodeRef[];
11
+ tableCells: readonly AIChatRequestNodeRef[];
12
+ }>;
13
+ /** Exact directional membership alongside the representative request range. */
14
+ type AIChatRequestNodeSelection = Readonly<{
15
+ anchorPath: Path;
16
+ focusPath: Path;
17
+ mode: NodeSelectionMode;
18
+ paths: readonly [Path, ...Path[]];
19
+ }>;
20
+ /** Self-contained editor snapshot for one AI chat request. */
21
+ type AIChatRequestContext = Readonly<{
22
+ /** The blocks the request covers, without review marks. */
23
+ children: Value;
24
+ nodeSelection: AIChatRequestNodeSelection | null;
25
+ refs: AIChatRequestRefs;
26
+ selection: Range | null;
27
+ toolName?: AIToolName;
28
+ }>;
29
+ /** Restore the model selection and its semantic selected-content state. */
30
+ declare const resolveAIChatRequestContext: (context: Pick<AIChatRequestContext, 'nodeSelection' | 'selection'>) => {
31
+ isSelecting: boolean;
32
+ selection: Selection;
33
+ };
34
+ export { AIToolName as a, AIChatRequestRefs as i, AIChatRequestNodeRef as n, resolveAIChatRequestContext as o, AIChatRequestNodeSelection as r, AIChatRequestContext as t };
@@ -0,0 +1,90 @@
1
+ import { Ki as Location, eu as TxDeclaredMethod, nu as TxOnlyMethod, ro as Plugin, xa as NodeKey } from "./index-DpltOCot-A2b3p3Eb.js";
2
+ import "./htmlTypes-cg_cWsaN.js";
3
+ import { V as InternalBasePluginRuntimeExtension, _ as BasePlugin, ra as BasePluginDependencyReferenceFor, xo as PluginReference, yo as PluginDependency } from "./core-ClHasORr.js";
4
+ import { S as AuthoredView, _ as AuthoredPlugin, b as AuthoredResult, c as AuthoredDecision, h as AuthoredPage, m as AuthoredOutcome, n as AuthoredChangeDetails, o as AuthoredChangesDelta, r as AuthoredChangeGroup, t as AuthoredChange, u as AuthoredGroupDetails, v as AuthoredQuery, x as AuthoredReview, y as AuthoredRefusal } from "./index-C9DiGDVj.js";
5
+ /** Paints each node's pending authored changes as `data-editor-authored-*` attributes. */
6
+ declare const BaseSuggestionPlugin: BasePlugin<Readonly<{
7
+ inject: true;
8
+ }> & Readonly<{
9
+ name: "suggestion";
10
+ }> & Readonly<{
11
+ dependencies: readonly [PluginReference<"authored"> & PluginDependency<Readonly<{
12
+ name: "authored";
13
+ }> & Readonly<{
14
+ __pluginWritableProperties: never;
15
+ }> & Readonly<Record<"api", {
16
+ setView: (view: AuthoredView) => void;
17
+ subscribeChanges: (listener: (delta: AuthoredChangesDelta) => void) => () => void;
18
+ subscribeRefusals: (listener: (refusal: AuthoredRefusal) => void) => () => void;
19
+ }>> & Readonly<Record<"read", {
20
+ view: () => AuthoredView;
21
+ change: (id: string) => AuthoredChange | null;
22
+ changes: (query?: AuthoredQuery) => AuthoredPage;
23
+ details: (id: string) => AuthoredChangeDetails | null;
24
+ groupDetails: (changeId: string, options?: Readonly<{
25
+ limit?: number;
26
+ }>) => AuthoredGroupDetails | null;
27
+ groups: (query: Readonly<{
28
+ at: Location | NodeKey;
29
+ }>) => readonly AuthoredChangeGroup[];
30
+ groupOf: (changeId: string) => AuthoredChangeGroup | null;
31
+ outcome: (id: string) => AuthoredOutcome | null;
32
+ reviewOf: (node: unknown) => AuthoredReview;
33
+ }>> & Readonly<Record<"update", {
34
+ decide: TxDeclaredMethod<(decisions: AuthoredDecision | readonly AuthoredDecision[]) => AuthoredResult>;
35
+ withdraw: TxDeclaredMethod<(changes: readonly AuthoredChange[]) => AuthoredResult>;
36
+ propose: TxOnlyMethod<(options?: {
37
+ changeId?: string;
38
+ }) => string>;
39
+ }>> & Readonly<{
40
+ dependencies: readonly [Readonly<Pick<BasePluginDependencyReferenceFor<Plugin<Readonly<{
41
+ readonly schema: {
42
+ readonly records: {
43
+ readonly "authored-contexts": {
44
+ readonly history: "retain";
45
+ };
46
+ readonly "authored-landed": {};
47
+ readonly "authored-reserves": {};
48
+ readonly "authored-verdicts": {};
49
+ };
50
+ };
51
+ }> & Readonly<{
52
+ name: "authored-records";
53
+ }>>>, "enabled" | "name">> & PluginDependency<never>];
54
+ }>> & Pick<InternalBasePluginRuntimeExtension<BasePlugin<Readonly<{}> & Readonly<{
55
+ name: "authored";
56
+ }> & Readonly<{
57
+ dependencies: readonly [BasePluginDependencyReferenceFor<Plugin<Readonly<{
58
+ readonly schema: {
59
+ readonly records: {
60
+ readonly "authored-contexts": {
61
+ readonly history: "retain";
62
+ };
63
+ readonly "authored-landed": {};
64
+ readonly "authored-reserves": {};
65
+ readonly "authored-verdicts": {};
66
+ };
67
+ };
68
+ }> & Readonly<{
69
+ name: "authored-records";
70
+ }>>>];
71
+ }> & Readonly<Record<never, never>>>, Readonly<{}> & Readonly<{
72
+ name: "authored";
73
+ }> & Readonly<{
74
+ dependencies: readonly [BasePluginDependencyReferenceFor<Plugin<Readonly<{
75
+ readonly schema: {
76
+ readonly records: {
77
+ readonly "authored-contexts": {
78
+ readonly history: "retain";
79
+ };
80
+ readonly "authored-landed": {};
81
+ readonly "authored-reserves": {};
82
+ readonly "authored-verdicts": {};
83
+ };
84
+ };
85
+ }> & Readonly<{
86
+ name: "authored-records";
87
+ }>>>];
88
+ }> & Readonly<Record<never, never>>, AuthoredPlugin>, "~schema.plugins">];
89
+ }> & Readonly<Record<never, never>>>;
90
+ export { BaseSuggestionPlugin as t };
@@ -0,0 +1,19 @@
1
+ import { Tt as EditorDocumentValue } from "./index-DpltOCot-A2b3p3Eb.js";
2
+ import "./htmlTypes-cg_cWsaN.js";
3
+ import { u as Editor } from "./core-ClHasORr.js";
4
+ import React$1 from "react";
5
+ type EditorStaticProps<E = Editor> = {
6
+ /**
7
+ * A document to render instead of the editor's own, such as a streamed
8
+ * preview. The editor supplies the plugins and is not edited. Pass the same
9
+ * object again to reuse its validated view. Reads, plugin reads and plugin
10
+ * APIs on the rendered editor see the document; an editor captured when a
11
+ * plugin was created still holds its own value.
12
+ */
13
+ document?: EditorDocumentValue;
14
+ /** Editor instance. */
15
+ editor: E;
16
+ style?: React$1.CSSProperties;
17
+ } & React$1.HTMLAttributes<HTMLDivElement>;
18
+ declare function EditorStatic<E = Editor>(props: EditorStaticProps<E>): React$1.JSX.Element;
19
+ export { EditorStaticProps as n, EditorStatic as t };
@@ -0,0 +1,28 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
7
+ var __exportAll = (all, no_symbols) => {
8
+ let target = {};
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
14
+ return target;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
18
+ key = keys[i];
19
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
20
+ get: ((k) => from[k]).bind(null, key),
21
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
+ });
23
+ }
24
+ return to;
25
+ };
26
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
27
+ //#endregion
28
+ export { __commonJSMin, __exportAll, __reExport };
@@ -0,0 +1,9 @@
1
+ import { __commonJSMin } from "./_rolldown/runtime.js";
2
+ import * as m from "react";
3
+ //#region builtin:esm-external-require-react
4
+ var require_builtin_esm_external_require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ module.exports = { ...m };
6
+ }));
7
+ //#endregion
8
+ export default require_builtin_esm_external_require_react();
9
+ export { require_builtin_esm_external_require_react };
@@ -0,0 +1,2 @@
1
+ import { a as AIToolName, i as AIChatRequestRefs, n as AIChatRequestNodeRef, o as resolveAIChatRequestContext, r as AIChatRequestNodeSelection, t as AIChatRequestContext } from "../AIChatRequestContext-DY104TqL.js";
2
+ export { AIChatRequestContext, AIChatRequestNodeRef, AIChatRequestNodeSelection, AIChatRequestRefs, AIToolName, resolveAIChatRequestContext };
@@ -0,0 +1,2 @@
1
+ import { resolveAIChatRequestContext } from "./lib/AIChatRequestContext.js";
2
+ export { resolveAIChatRequestContext };
@@ -0,0 +1,16 @@
1
+ import { RangeApi, SelectionApi } from "../../core.js";
2
+ //#region src/ai/lib/AIChatRequestContext.ts
3
+ /** Restore the model selection and its semantic selected-content state. */
4
+ const resolveAIChatRequestContext = (context) => {
5
+ const { nodeSelection, selection } = context;
6
+ return {
7
+ isSelecting: !!nodeSelection || !!selection && RangeApi.isExpanded(selection),
8
+ selection: nodeSelection ? SelectionApi.nodes(nodeSelection.paths, {
9
+ anchorPath: nodeSelection.anchorPath,
10
+ focusPath: nodeSelection.focusPath,
11
+ mode: nodeSelection.mode
12
+ }) : selection ? SelectionApi.text(selection) : null
13
+ };
14
+ };
15
+ //#endregion
16
+ export { resolveAIChatRequestContext };
@@ -0,0 +1,63 @@
1
+ import { distance } from "fastest-levenshtein";
2
+ //#region src/ai/lib/findQuotedSpan.internal.ts
3
+ const maxEditDistance = (length) => length <= 2 ? 0 : length <= 5 ? 1 : length <= 10 ? 2 : length <= 20 ? 3 : 5;
4
+ const findFuzzyMatch = (text, quote) => {
5
+ const maxDistance = maxEditDistance(quote.length);
6
+ let best = {
7
+ distance: Number.POSITIVE_INFINITY,
8
+ end: -1,
9
+ start: -1
10
+ };
11
+ for (let index = 0; index <= text.length - quote.length; index++) for (let delta = -maxDistance; delta <= maxDistance; delta++) {
12
+ const length = quote.length + delta;
13
+ if (length <= 0 || index + length > text.length) continue;
14
+ const candidate = distance(text.slice(index, index + length), quote);
15
+ if (candidate <= maxDistance && candidate < best.distance) best = {
16
+ distance: candidate,
17
+ end: index + length,
18
+ start: index
19
+ };
20
+ }
21
+ return best.start === -1 ? null : best;
22
+ };
23
+ const findPrefixMatch = (text, quote) => {
24
+ for (let length = quote.length - 1; length > 0; length--) {
25
+ const start = text.indexOf(quote.slice(0, length));
26
+ if (start !== -1) return {
27
+ end: start + length,
28
+ start
29
+ };
30
+ }
31
+ return null;
32
+ };
33
+ const findQuotedSpan = (segments, quote) => {
34
+ const text = segments.join("");
35
+ if (!text) return null;
36
+ const exact = text.indexOf(quote);
37
+ const match = exact === -1 ? findFuzzyMatch(text, quote) ?? findPrefixMatch(text, quote) : {
38
+ end: exact + quote.length,
39
+ start: exact
40
+ };
41
+ if (!match) return null;
42
+ const starts = [];
43
+ let length = 0;
44
+ for (const segment of segments) {
45
+ starts.push(length);
46
+ length += segment.length;
47
+ }
48
+ const closingSegment = (offset) => starts.findIndex((start, index) => offset <= start + segments[index].length);
49
+ const openingSegment = (offset) => {
50
+ const opened = starts.indexOf(offset);
51
+ return opened === -1 ? closingSegment(offset) : opened;
52
+ };
53
+ const pointIn = (segment, offset) => ({
54
+ offset: offset - starts[segment],
55
+ segment
56
+ });
57
+ return {
58
+ end: pointIn(closingSegment(match.end), match.end),
59
+ start: pointIn(openingSegment(match.start), match.start)
60
+ };
61
+ };
62
+ //#endregion
63
+ export { findQuotedSpan };