platejs 54.0.0-beta.2 → 54.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +56 -0
  3. package/dist/{AIChatRequestContext-BMVWhfPV.d.ts → AIChatRequestContext-DrUahdTc.d.ts} +2 -2
  4. package/dist/{BaseSuggestionPlugin-DBl3fqnm.d.ts → BaseSuggestionPlugin-_7Ka6nY3.d.ts} +7 -3
  5. package/dist/{PlateStatic-DhNv2ejp.d.ts → PlateStatic-D3Cb-QwH.d.ts} +7 -7
  6. package/dist/ai/index.d.ts +1 -1
  7. package/dist/ai/react/AIChatPlugin.js +113 -78
  8. package/dist/ai/react/CopilotPlugin.js +1 -1
  9. package/dist/ai/react/index.d.ts +23 -16
  10. package/dist/authored/index.d.ts +4 -4
  11. package/dist/code-block/codemirror/createCodeMirrorAdapter.js +12 -9
  12. package/dist/code-block/codemirror/index.d.ts +1 -1
  13. package/dist/{combobox-DkBGgyd3.d.ts → combobox-Dr0OYZIE.d.ts} +2 -2
  14. package/dist/{comparison-types-CYnJ35qU.d.ts → comparison-types-DdwE6mYq-BogsHoUO.d.ts} +10 -2
  15. package/dist/compiler/index.d.ts +2 -2
  16. package/dist/{core-BJG8l_mk.d.ts → core-BqR-fEDp.d.ts} +493 -116
  17. package/dist/diff/index.d.ts +2 -2
  18. package/dist/docs/ai.md +4 -3
  19. package/dist/docs/api/core/plate-components.md +0 -19
  20. package/dist/docs/api/core/plate-controller.md +5 -3
  21. package/dist/docs/api/core/plate-plugin.md +3 -0
  22. package/dist/docs/api/core/plate-store.md +3 -3
  23. package/dist/docs/api/core.md +45 -5
  24. package/dist/docs/api/dom.md +11 -4
  25. package/dist/docs/api/editor-transforms.md +2 -1
  26. package/dist/docs/api/react-hooks.md +45 -13
  27. package/dist/docs/authored-changes.md +9 -4
  28. package/dist/docs/basic-blocks.md +42 -29
  29. package/dist/docs/block-placeholder.md +4 -2
  30. package/dist/docs/blockquote.md +5 -3
  31. package/dist/docs/board.md +118 -10
  32. package/dist/docs/code-block.md +47 -0
  33. package/dist/docs/comment.md +2 -2
  34. package/dist/docs/discussion.md +1 -1
  35. package/dist/docs/document-model.md +15 -3
  36. package/dist/docs/docx.md +1 -1
  37. package/dist/docs/dom-coverage.md +5 -0
  38. package/dist/docs/editor.md +50 -4
  39. package/dist/docs/examples/editable-voids.md +2 -3
  40. package/dist/docs/external-text.md +2 -0
  41. package/dist/docs/field.md +370 -0
  42. package/dist/docs/find.md +9 -6
  43. package/dist/docs/form.md +2 -0
  44. package/dist/docs/heading.md +6 -0
  45. package/dist/docs/installation/manual.md +0 -4
  46. package/dist/docs/link.md +3 -3
  47. package/dist/docs/llms.txt +4 -2
  48. package/dist/docs/markdown.md +270 -14
  49. package/dist/docs/plugin-components.md +13 -10
  50. package/dist/docs/plugin-input-rules.md +66 -15
  51. package/dist/docs/prompt-editor.md +205 -0
  52. package/dist/docs/roots.md +8 -6
  53. package/dist/docs/rtl.md +6 -4
  54. package/dist/docs/selection.md +7 -4
  55. package/dist/docs/suggestion.md +1 -1
  56. package/dist/docs/toolbar.md +26 -30
  57. package/dist/docs/upload.md +106 -17
  58. package/dist/docx/export/index.d.ts +3 -3
  59. package/dist/docx/export/lib/docxStaticComponents.js +12 -2
  60. package/dist/docx/export/lib/exportDocx.js +46 -17
  61. package/dist/docx/export/lib/internal/xml-builder.js +11 -16
  62. package/dist/docx/export/lib/reviewPart.js +1 -1
  63. package/dist/docx/export/lib/reviewProjection.js +52 -10
  64. package/dist/docx/import/index.d.ts +4 -4
  65. package/dist/docx/paste/index.d.ts +4 -4
  66. package/dist/dom/index.d.ts +1 -6
  67. package/dist/dom/plite-dom.internal.js +2 -2
  68. package/dist/excalidraw/index.d.ts +3 -2
  69. package/dist/excalidraw/react/index.d.ts +3 -2
  70. package/dist/facade.js +2 -2
  71. package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +13 -5
  72. package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +32 -10
  73. package/dist/features/board/index.d.ts +2 -2
  74. package/dist/features/board/lib/BaseBoardPlugin.js +14 -1
  75. package/dist/features/board/lib/boardStroke.internal.js +13 -1
  76. package/dist/features/board/lib/boardTypes.internal.js +16 -0
  77. package/dist/features/callout/index.d.ts +3 -2
  78. package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +14 -5
  79. package/dist/features/combobox/index.d.ts +2 -2
  80. package/dist/features/comments/BaseCommentsPlugin.js +33 -17
  81. package/dist/features/comments/index.d.ts +1 -1
  82. package/dist/features/date/index.d.ts +3 -2
  83. package/dist/features/details/index.d.ts +3 -2
  84. package/dist/features/details/lib/BaseDetailsPlugin.js +25 -12
  85. package/dist/features/field/index.d.ts +2 -0
  86. package/dist/features/field/index.js +4 -0
  87. package/dist/features/field/lib/BaseFieldPlugin.js +360 -0
  88. package/dist/features/field/lib/applyFieldValues.js +188 -0
  89. package/dist/features/field/lib/fieldRules.internal.js +204 -0
  90. package/dist/features/find/index.d.ts +3 -2
  91. package/dist/features/footnote/index.d.ts +1 -1
  92. package/dist/features/ink/index.d.ts +1 -1
  93. package/dist/features/ink/lib/BaseInkPlugin.js +126 -103
  94. package/dist/features/ink/lib/inkCodec.internal.js +130 -0
  95. package/dist/features/ink/lib/inkGone.internal.js +229 -48
  96. package/dist/features/ink/lib/inkPlaces.internal.js +534 -64
  97. package/dist/features/layout/index.d.ts +1 -1
  98. package/dist/features/link/lib/BaseLinkPlugin.js +6 -4
  99. package/dist/features/lint/index.d.ts +3 -2
  100. package/dist/features/media/index.d.ts +2 -2
  101. package/dist/features/media/index.js +2 -2
  102. package/dist/features/media/lib/media/parseMediaUrl.js +11 -1
  103. package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +206 -4
  104. package/dist/features/mention/index.d.ts +5 -4
  105. package/dist/features/suggestion/index.d.ts +1 -1
  106. package/dist/features/table/index.d.ts +1 -1
  107. package/dist/features/table/lib/BaseTablePlugin.js +64 -15
  108. package/dist/features/table/lib/internal/selection.js +4 -2
  109. package/dist/features/toc/index.d.ts +1 -1
  110. package/dist/features/upload/index.d.ts +2 -2
  111. package/dist/features/upload/lib/BaseUploadPlugin.js +464 -250
  112. package/dist/history/index.d.ts +2 -2
  113. package/dist/html/index.d.ts +3 -3
  114. package/dist/html/server/index.d.ts +1 -1
  115. package/dist/{htmlTypes-DjeFG3P8.d.ts → htmlTypes-eT2ZGDAj.d.ts} +2 -31
  116. package/dist/hyperscript/index.d.ts +1 -1
  117. package/dist/{index-DzD6BIFJ.d.ts → index-B33E1CRJ.d.ts} +295 -6
  118. package/dist/{index-Cl77E9yr.d.ts → index-B7moSod7.d.ts} +2 -2
  119. package/dist/{index-hsC_sOn2.d.ts → index-B8-5Sr7I.d.ts} +35 -5
  120. package/dist/{index-BiQerPJS.d.ts → index-B8QJDAmG.d.ts} +2 -2
  121. package/dist/{index-BBKGrsG3.d.ts → index-BTx5oK7k.d.ts} +1 -1
  122. package/dist/{index-iaZOhA76.d.ts → index-BWPcE4ac-Cto_IsNs.d.ts} +7 -1
  123. package/dist/{index-BU6k1Aev.d.ts → index-BXjLmx1n-CXk17buG.d.ts} +4781 -4584
  124. package/dist/{index-kLKMc-pI.d.ts → index-BXwU9QH6.d.ts} +2 -2
  125. package/dist/{index-DTgaSxKr.d.ts → index-BkwR-5hH.d.ts} +40 -4
  126. package/dist/{index-Bq3sdm3S.d.ts → index-BsV2McRr.d.ts} +5 -4
  127. package/dist/index-C9Fu-P4E.d.ts +773 -0
  128. package/dist/{index-D5W-p9bS.d.ts → index-Ca48r1ng.d.ts} +49 -4
  129. package/dist/{index-CcZbqPqk.d.ts → index-Cob_iBdu.d.ts} +116 -41
  130. package/dist/{index-Bxfvicyy.d.ts → index-CpY7Xnxw.d.ts} +4 -3
  131. package/dist/{index-BkR7-GLI.d.ts → index-DNQXzU-X.d.ts} +2 -2
  132. package/dist/{index-D1CFXA-i.d.ts → index-DPowErHa.d.ts} +471 -141
  133. package/dist/{index-DaM37gF6.d.ts → index-DShbzec2.d.ts} +38 -23
  134. package/dist/{index-DC_MNGyu.d.ts → index-DYdObeFQ.d.ts} +3 -3
  135. package/dist/{index-Bc2Yg_2j.d.ts → index-Dq3Jlj8O-BJ6NxZm0.d.ts} +2 -2
  136. package/dist/{index-CT7miqQN.d.ts → index-DwWQVwQt.d.ts} +29 -11
  137. package/dist/{index-xdmCBvlT.d.ts → index-JWgwL5l3.d.ts} +5 -2
  138. package/dist/{index-DLA2DUR2.d.ts → index-M781pyx9.d.ts} +4 -3
  139. package/dist/{index-DdIRduDG.d.ts → index-d7io3MzC.d.ts} +3 -2
  140. package/dist/index.d.ts +4 -4
  141. package/dist/{react/internal → internal}/penStroke.internal.js +1 -1
  142. package/dist/internal/plugin/OverridePlugin.js +101 -119
  143. package/dist/internal/plugin/collectPlateNodeMappings.js +5 -1
  144. package/dist/internal/plugin/pastedUploadFiles.js +4 -0
  145. package/dist/internal/plugin/resolvePlugin.js +1 -1
  146. package/dist/internal/plugin/resolvePlugins.js +3 -0
  147. package/dist/internal/plugin/uploadDrafts.js +6 -0
  148. package/dist/internal/utils/mergePlugins.js +1 -0
  149. package/dist/lib/plugins/element-id/ElementIdPlugin.js +14 -18
  150. package/dist/lib/plugins/html/HtmlPlugin.js +9 -0
  151. package/dist/lib/plugins/html/htmlSafety.js +1 -1
  152. package/dist/lib/plugins/input-rules/InputRulesPlugin.js +77 -28
  153. package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +16 -0
  154. package/dist/markdown/index.d.ts +2 -2
  155. package/dist/markdown/index.js +3 -1
  156. package/dist/markdown/lib/MarkdownPlugin.js +14 -11
  157. package/dist/markdown/lib/RawHtmlPlugin.js +26 -0
  158. package/dist/markdown/lib/deserializer/mdastToSlate.js +12 -2
  159. package/dist/markdown/lib/internal/markdownConversion.js +776 -74
  160. package/dist/markdown/lib/internal/markdownDiagnostics.js +18 -7
  161. package/dist/markdown/lib/internal/markdownFootnoteWriter.js +35 -0
  162. package/dist/markdown/lib/internal/markdownFrontmatter.js +102 -0
  163. package/dist/markdown/lib/internal/markdownIntrinsics.js +125 -43
  164. package/dist/markdown/lib/internal/markdownLine.js +5 -3
  165. package/dist/markdown/lib/internal/markdownMappings.js +19 -7
  166. package/dist/markdown/lib/internal/markdownOpenTail.js +381 -0
  167. package/dist/markdown/lib/internal/markdownRawHtml.js +353 -0
  168. package/dist/markdown/lib/internal/markdownSegments.js +57 -48
  169. package/dist/markdown/lib/internal/markdownTags.js +29 -9
  170. package/dist/markdown/lib/serializer/convertNodesSerialize.js +10 -8
  171. package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +226 -0
  172. package/dist/markdown/lib/serializer/listToMdastTree.js +2 -0
  173. package/dist/math/index.d.ts +3 -2
  174. package/dist/math/react/index.d.ts +4 -3
  175. package/dist/migrations/index.d.ts +3 -3
  176. package/dist/migrations/migratePlateV54.js +4 -6
  177. package/dist/migrations/migratePlateV54RetiredMarks.internal.js +23 -8
  178. package/dist/migrations/migratePlateV54Suggestions.internal.js +2 -2
  179. package/dist/migrations/v53-manifest.internal.js +4 -0
  180. package/dist/pagination/index.d.ts +1 -1
  181. package/dist/pagination/react/index.d.ts +4 -4
  182. package/dist/react/components/EditorContentView.internal.js +42 -23
  183. package/dist/react/components/EditorProvider.js +5 -5
  184. package/dist/react/components/Plate.js +102 -128
  185. package/dist/react/components/PlateContainer.js +40 -32
  186. package/dist/react/components/PlateController.js +28 -16
  187. package/dist/react/components/PlateRoot.internal.js +3 -2
  188. package/dist/react/core.js +4 -4
  189. package/dist/react/features/board/BoardSurface.js +116 -87
  190. package/dist/react/features/board/boardClipboard.internal.js +15 -5
  191. package/dist/react/features/board/boardExport.internal.js +470 -0
  192. package/dist/react/features/board/boardGesture.internal.js +6 -3
  193. package/dist/react/features/board/boardIndex.internal.js +7 -18
  194. package/dist/react/features/board/boardPictureStyles.internal.js +415 -0
  195. package/dist/react/features/board/boardPictures.internal.js +19 -13
  196. package/dist/react/features/board/boardView.internal.js +190 -50
  197. package/dist/react/features/board/boardVoice.internal.js +10 -11
  198. package/dist/react/features/board/index.d.ts +108 -18
  199. package/dist/react/features/callout/index.d.ts +3 -2
  200. package/dist/react/features/combobox/index.d.ts +8 -8
  201. package/dist/react/features/comments/index.d.ts +6 -5
  202. package/dist/react/features/date/index.d.ts +4 -3
  203. package/dist/react/features/details/index.d.ts +4 -3
  204. package/dist/react/features/field/FieldPlugin.js +35 -0
  205. package/dist/react/features/field/index.d.ts +315 -0
  206. package/dist/react/features/field/index.js +2 -0
  207. package/dist/react/features/footnote/index.d.ts +7 -6
  208. package/dist/react/features/format-painter/index.d.ts +4 -3
  209. package/dist/react/features/ink/InkContent.js +313 -0
  210. package/dist/react/features/ink/index.d.ts +57 -33
  211. package/dist/react/features/ink/index.js +2 -2
  212. package/dist/react/features/ink/inkCapture.internal.js +39 -17
  213. package/dist/react/features/ink/inkInput.internal.js +1 -1
  214. package/dist/react/features/ink/inkLayout.internal.js +6 -3
  215. package/dist/react/features/ink/inkPaint.internal.js +78 -2
  216. package/dist/react/features/ink/inkPlacement.internal.js +332 -104
  217. package/dist/react/features/ink/inkWatch.internal.js +7 -5
  218. package/dist/react/features/layout/index.d.ts +5 -4
  219. package/dist/react/features/media/index.d.ts +5 -4
  220. package/dist/react/features/mention/index.d.ts +6 -5
  221. package/dist/react/features/resizable/Resizable.js +4 -6
  222. package/dist/react/features/resizable/index.d.ts +5 -5
  223. package/dist/react/features/suggestion/index.d.ts +6 -5
  224. package/dist/react/features/table/TablePlugin.js +4 -11
  225. package/dist/react/features/table/index.d.ts +10 -8
  226. package/dist/react/features/table/useTableResize.js +10 -1
  227. package/dist/react/features/toc/index.d.ts +2 -2
  228. package/dist/react/features/upload/index.d.ts +11 -6
  229. package/dist/react/index.d.ts +6 -6
  230. package/dist/react/index.js +4 -4
  231. package/dist/react/internal/plate-context.js +434 -188
  232. package/dist/react/plite-react.js +2 -2
  233. package/dist/react/plugins/navigation-feedback/NavigationFeedbackPlugin.js +12 -10
  234. package/dist/react/stores/plate/useEditor.js +32 -14
  235. package/dist/react/stores/plate/useEditorHistory.js +55 -0
  236. package/dist/react/stores/plate/useEditorSelector.js +79 -21
  237. package/dist/react/utils/BlockPlaceholderPlugin.js +5 -2
  238. package/dist/react/utils/pipeRenderElement.internal.js +1 -1
  239. package/dist/react/utils/pluginRenderElement.internal.js +1 -1
  240. package/dist/react/virtualized.d.ts +4 -4
  241. package/dist/{source-CNKy99Th.d.ts → source-BGohy8vH.d.ts} +4 -4
  242. package/dist/static/index.d.ts +18 -18
  243. package/dist/static/internal/renderStaticHtmlWithOverrides.js +2 -2
  244. package/dist/static/internal/staticPresentation.js +4 -4
  245. package/dist/static/internal/writeStaticSelectionClipboardData.js +7 -2
  246. package/dist/tabbable/index.d.ts +1 -1
  247. package/dist/tabbable/react/index.d.ts +3 -3
  248. package/dist/testing/index.d.ts +3 -3
  249. package/dist/yjs/index.d.ts +1 -1
  250. package/dist/yjs/react/index.d.ts +6 -6
  251. package/package.json +20 -2
  252. package/dist/markdown/lib/serializer/convertTextsSerialize.js +0 -163
  253. package/dist/react/components/EditorSelectionView.js +0 -40
  254. package/dist/react/features/ink/InkLayer.js +0 -218
  255. package/dist/react/internal/createPlateTargetScope.js +0 -62
@@ -1,6 +1,6 @@
1
- import { $i as NodeKey, $u as EditorJsonValue, Cl as PropertyValueOptions, Ec as Element, Kl as SchemaElementPropertyDefinition, Mc as ElementOf, Os as Descendant, Qo as TxDeclaredMethod, Sl as PropertyValueOf, Ul as SchemaElementProperties, _u as SchemaPropertySplitPolicy, bl as PropertyValueDescriptor, dl as PropertyEnumDescriptor, fl as PropertyJsonDescriptor, gu as SchemaPropertyRole, ki as EditorUniqueHolder, ml as PropertyNumberDescriptor, mu as SchemaPropertyLandingPolicy, su as SchemaPropertyCopyPolicy, vl as PropertyStringDescriptor, vu as SchemaPropertyTypeChangePolicy, xl as PropertyValueKind, y as ContentSlice } from "./index-BU6k1Aev.js";
2
- import "./htmlTypes-DjeFG3P8.js";
3
- import { Wa as DefinitionOf, _ as BasePlugin, ct as BlockInsertOptions } from "./core-BJG8l_mk.js";
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-BXjLmx1n-CXk17buG.js";
2
+ import "./htmlTypes-eT2ZGDAj.js";
3
+ import { _ as BasePlugin, ct as BlockInsertOptions, qa as DefinitionOf } from "./core-BqR-fEDp.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'];
@@ -953,6 +953,12 @@ type BoardNoteElement = ElementOf<typeof BaseBoardNotePlugin>;
953
953
  * `BOARD_STROKE_REACH`, or by half a side shorter than twice that.
954
954
  */
955
955
  type BoardStrokePoints = readonly number[];
956
+ /** Where a stroke draws: an SVG path over a box of `width` by `height`. */
957
+ type BoardStrokePath = Readonly<{
958
+ height: number;
959
+ path: string;
960
+ width: number;
961
+ }>;
956
962
  /** A point of a pen line in board coordinates, with its pressure from 0 to 1. */
957
963
  type BoardInkPoint = readonly [x: number, y: number, pressure: number];
958
964
  declare const isBoardStrokePoints: (value: unknown) => value is BoardStrokePoints;
@@ -1120,12 +1126,34 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1120
1126
  }>>, Readonly<{
1121
1127
  kind: 'types';
1122
1128
  types: string[];
1129
+ }>, Readonly<{
1130
+ key: string;
1131
+ map: (value: Readonly<{
1132
+ x: number;
1133
+ y: number;
1134
+ }> | Readonly<{
1135
+ frame: string;
1136
+ frameOrigin: BoardPlace;
1137
+ x: number;
1138
+ y: number;
1139
+ }>, renamed: (name: string) => string | undefined) => Readonly<{
1140
+ x: number;
1141
+ y: number;
1142
+ }> | Readonly<{
1143
+ frame: string;
1144
+ frameOrigin: BoardPlace;
1145
+ x: number;
1146
+ y: number;
1147
+ }>;
1123
1148
  }>>;
1124
1149
  readonly shapeId: SchemaElementPropertyDefinition<PropertyStringDescriptor<{
1125
1150
  readonly generate: typeof nanoid;
1126
1151
  }>, Readonly<{
1127
1152
  kind: 'types';
1128
1153
  types: readonly string[];
1154
+ }>, Readonly<{
1155
+ key: string;
1156
+ map: (value: string, renamed: (name: string) => string | undefined) => string;
1129
1157
  }>>;
1130
1158
  readonly size: SchemaElementPropertyDefinition<PropertyJsonDescriptor<Readonly<{
1131
1159
  height: number;
@@ -1154,6 +1182,15 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1154
1182
  }>>, Readonly<{
1155
1183
  kind: 'types';
1156
1184
  types: string[];
1185
+ }>, Readonly<{
1186
+ key: string;
1187
+ map: (value: Readonly<{
1188
+ height: number;
1189
+ width: number;
1190
+ }>, renamed: (name: string) => string | undefined) => Readonly<{
1191
+ height: number;
1192
+ width: number;
1193
+ }>;
1157
1194
  }>>;
1158
1195
  readonly zIndex: SchemaElementPropertyDefinition<PropertyStringDescriptor<{
1159
1196
  readonly required: true;
@@ -1162,6 +1199,9 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1162
1199
  }>, Readonly<{
1163
1200
  kind: 'types';
1164
1201
  types: readonly string[];
1202
+ }>, Readonly<{
1203
+ key: string;
1204
+ map: (value: string, renamed: (name: string) => string | undefined) => string;
1165
1205
  }>>;
1166
1206
  readonly framePlace?: Readonly<{
1167
1207
  copy: SchemaPropertyCopyPolicy;
@@ -1941,6 +1981,11 @@ declare const BaseBoardPlugin: BasePlugin<Readonly<{
1941
1981
  readonly slice: (ids: readonly string[]) => ContentSlice | null;
1942
1982
  /** The members of the board block `board`, in stored order. */
1943
1983
  readonly shapes: (board: NodeKey) => BoardMemberEntry[];
1984
+ /**
1985
+ * Where the pen line `id` draws its outline within its box, the
1986
+ * path the live board draws, or null when `id` names no pen line.
1987
+ */
1988
+ readonly strokePath: (id: string) => BoardStrokePath | null;
1944
1989
  };
1945
1990
  readonly readMiddleware: true;
1946
1991
  readonly update: {
@@ -2104,4 +2149,4 @@ declare const BaseBoardStrokePlugin: BasePlugin<Readonly<{}> & Readonly<{
2104
2149
  };
2105
2150
  }>>;
2106
2151
  type BoardStrokeElement = ElementOf<typeof BaseBoardStrokePlugin>;
2107
- export { BoardFramePlace as A, isStackingKey as B, BoardArrowEnds as C, BoardFrameEntry as D, BoardArrowEntry as E, BoardRestackDirection as F, BOARD_STROKE_STYLES as H, BoardShapeInsertProps as I, BoardSize as L, isBoardFramePlace as M, isBoardShapePlace as N, BoardMemberEntry as O, BoardPlace as P, defineBoardShape as R, BoardArrowEnd as S, isBoardArrowEnd as T, BoardStyleProperties as U, BOARD_ARROW_STYLES as V, BoardStyles as W, BoardFrameElement as _, BoardElement as a, BoardArrowEndInput as b, isBoardStrokePoints as c, BaseBoardImagePlugin as d, BoardImageElement as f, BaseBoardFramePlugin as g, BoardGeoElement as h, BoardDefinition as i, BoardShapePlace as j, BoardShapeEntry as k, BaseBoardNotePlugin as l, BoardGeo as m, BoardStrokeElement as n, BoardInkPoint as o, BaseBoardGeoPlugin as p, BaseBoardPlugin as r, BoardStrokePoints as s, BaseBoardStrokePlugin as t, BoardNoteElement as u, BaseBoardArrowPlugin as v, BoardArrowSide as w, BoardArrowAnchor as x, BoardArrowElement as y, isBoardSize as z };
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 };
@@ -1,12 +1,13 @@
1
- import { Aa as PluginReference, Ba as RootKey, Ln as EditorDocumentValue, eo as Value, ol as EditorSchemaRepairCode, x as AuthoredProjectionDiagnostic, y as ContentSlice } from "./index-BU6k1Aev.js";
2
- import { _ as EditorSchemaValidationDiagnostic, h as EditorApplicationSchema } from "./htmlTypes-DjeFG3P8.js";
3
- import { Wa as DefinitionOf, _ as BasePlugin, u as Editor } from "./core-BJG8l_mk.js";
1
+ import { Fo as PluginReference, Qo as PropertyBooleanDescriptor, Tt as EditorDocumentValue, Zn as EditorSchemaRepairCode, j as ContentSlice, m as AuthoredProjectionDiagnostic, rr as EditorSchemaValidationDiagnostic, su as Value, ws as RootKey } from "./index-BXjLmx1n-CXk17buG.js";
2
+ import { h as EditorApplicationSchema } from "./htmlTypes-eT2ZGDAj.js";
3
+ import { _ as BasePlugin, qa as DefinitionOf, u as Editor } from "./core-BqR-fEDp.js";
4
4
  import { Association, Blockquote, Break, Code, Emphasis, Heading, Html, Image, InlineCode, Link, List, ListItem, Nodes, Paragraph, Parents, PhrasingContent, Root, Strong, TableCell, TableRow, Text, ThematicBreak } from "mdast";
5
5
  import "mdast-util-math";
6
6
  import { MdxJsxFlowElement, MdxJsxTextElement } from "mdast-util-mdx";
7
7
  import { Node, Point } from "unist";
8
8
  import { Options } from "remark-stringify";
9
9
  import { Processor, Transformer } from "unified";
10
+ import "parse5";
10
11
  type MarkdownParseLimits = Readonly<{
11
12
  maxBytes: number;
12
13
  maxDepth: number;
@@ -40,7 +41,27 @@ type PolicyDiagnostic<T extends object> = Readonly<T & {
40
41
  }> | Readonly<T & {
41
42
  severity: 'warning';
42
43
  }>;
43
- type MarkdownDiagnostic = AuthoredProjectionDiagnostic | Readonly<{
44
+ /**
45
+ * A Markdown file's leading front matter block, stored at
46
+ * `meta['markdown.frontmatter']`: its format and the text between its fences,
47
+ * with LF line endings.
48
+ */
49
+ type MarkdownFrontmatter = Readonly<{
50
+ format: 'toml' | 'yaml';
51
+ value: string;
52
+ }>;
53
+ type MarkdownDiagnostic = AuthoredProjectionDiagnostic | PolicyDiagnostic<{
54
+ code: 'markdown-frontmatter-omitted';
55
+ impact: 'lossy';
56
+ message: string;
57
+ /**
58
+ * `shape` when the stored block is not an object whose keys are exactly
59
+ * a string `format` and a string `value`, `format` when the format is
60
+ * neither `yaml` nor `toml`, and `unreadable` when the written block
61
+ * would not read back as the same value.
62
+ */
63
+ reason: 'format' | 'shape' | 'unreadable';
64
+ }> | Readonly<{
44
65
  actual: number;
45
66
  code: 'markdown-inline-blocks';
46
67
  message: string;
@@ -158,14 +179,21 @@ type MarkdownParsePolicy = Readonly<{
158
179
  lossPolicy?: 'allow' | 'reject';
159
180
  /**
160
181
  * The source is an unfinished stream prefix, such as a streaming AI answer.
161
- * A trailing tag that has not finished arriving is hidden; use a final parse
162
- * once the stream completes.
182
+ * A trailing tag that has not finished arriving is hidden. `parse`,
183
+ * `parseSlice` and `parseInline` also show a bold, italic or strikethrough
184
+ * run that has not closed yet styled as it will read once it closes, and
185
+ * hide up to three trailing `*`, `_`, `~` or `\` characters in all until
186
+ * the next characters decide them, so a later chunk can take back styling a
187
+ * preview showed. Use a final parse once the stream completes.
163
188
  */
164
189
  partial?: boolean;
165
190
  }>;
166
191
  type MarkdownSerializePolicy = Readonly<{
167
192
  lossPolicy?: 'allow' | 'reject';
168
- /** Mark keys written as plain text without Markdown formatting. */
193
+ /**
194
+ * Mark keys written as plain text without Markdown formatting. Naming
195
+ * `rawHtml` writes text that `RawHtmlPlugin` marked as escaped text.
196
+ */
169
197
  plainMarks?: readonly string[] | null;
170
198
  preserveEmptyParagraphs?: boolean;
171
199
  /**
@@ -193,6 +221,13 @@ type MarkdownSerializeOptions = MarkdownSerializePolicy & Readonly<{
193
221
  type MarkdownEditorSerializeOptions<V extends Value = Value> = MarkdownSerializePolicy & Readonly<{
194
222
  document?: EditorDocumentValue<V>;
195
223
  }>;
224
+ /**
225
+ * The front matter block that a Markdown document parse stored on the
226
+ * document, or `undefined` when the stored value is missing or is not a
227
+ * `MarkdownFrontmatter`. The block comes back as stored; a document serialize
228
+ * is what checks that it can be written.
229
+ */
230
+ declare const getMarkdownFrontmatter: (document: EditorDocumentValue) => MarkdownFrontmatter | undefined;
196
231
  /**
197
232
  * Get an identifier from an association to match it to others.
198
233
  *
@@ -570,20 +605,6 @@ type ContainerPhrasing = (parent: PhrasingParents, info: Info) => string;
570
605
  * Tracker.
571
606
  */
572
607
  type CreateTracker = (info: TrackFields) => Tracker;
573
- /**
574
- * Whether to encode things — with fields representing the surrounding of a
575
- * whole.
576
- */
577
- interface EncodeSurrounding {
578
- /**
579
- * Whether to encode after.
580
- */
581
- after: boolean;
582
- /**
583
- * Whether to encode before.
584
- */
585
- before: boolean;
586
- }
587
608
  /**
588
609
  * Enter something.
589
610
  *
@@ -631,7 +652,9 @@ type Handlers = Record<Nodes['type'], Handle>;
631
652
  * @returns
632
653
  * Serialized markdown representing `node`.
633
654
  */
634
- type Handle = (node: any, parent: Parents | undefined, state: State, Info: Info) => string;
655
+ type Handle = (
656
+ // type-coverage:ignore-next-line
657
+ node: any, parent: Parents | undefined, state: State, Info: Info) => string;
635
658
  /**
636
659
  * Pad serialized markdown.
637
660
  *
@@ -745,7 +768,10 @@ interface Options$1 {
745
768
  */
746
769
  closeAtx?: boolean | null | undefined;
747
770
  /**
748
- * Marker to use for emphasis (default: `'*'`).
771
+ * Preferred marker to use for emphasis (default: `'*'`).
772
+ *
773
+ * The other marker is sometimes used, to form for example emphasis next to
774
+ * or inside of other emphasis (`*a*_b_`).
749
775
  */
750
776
  emphasis?: '*' | '_' | null | undefined;
751
777
  /**
@@ -822,7 +848,10 @@ interface Options$1 {
822
848
  */
823
849
  setext?: boolean | null | undefined;
824
850
  /**
825
- * Marker to use for strong (default: `'*'`).
851
+ * Preferred marker to use for strong (default: `'*'`).
852
+ *
853
+ * The other marker is sometimes used, to form for example strong next to or
854
+ * inside of other strong (`**a**__b__`).
826
855
  */
827
856
  strong?: '*' | '_' | null | undefined;
828
857
  /**
@@ -855,6 +884,14 @@ type PhrasingParents = Parents extends {
855
884
  * Configuration for `safe`
856
885
  */
857
886
  interface SafeConfig extends SafeFields {
887
+ /**
888
+ * Node directly after the value (optional).
889
+ */
890
+ afterNode?: Nodes | undefined;
891
+ /**
892
+ * Node directly before the value (optional).
893
+ */
894
+ beforeNode?: Nodes | undefined;
858
895
  /**
859
896
  * Extra characters that *must* be encoded (as character references) instead
860
897
  * of escaped (character escapes) (optional).
@@ -909,18 +946,6 @@ interface State {
909
946
  * Get an identifier from an association to match it to others.
910
947
  */
911
948
  associationId: AssociationId;
912
- /**
913
- * Info on whether to encode the surrounding of *attention*.
914
- *
915
- * Whether attention (emphasis, strong, strikethrough) forms
916
- * depends on the characters inside and outside them.
917
- * The characters inside can be handled by *attention* itself.
918
- * However the outside characters are already handled.
919
- * Or handled afterwards.
920
- * This field can be used to signal from *attention* that some parent
921
- * function (practically `containerPhrasing`) has to handle the surrounding.
922
- */
923
- attentionEncodeSurroundingInfo: EncodeSurrounding | undefined;
924
949
  /**
925
950
  * List marker currently in use.
926
951
  */
@@ -1054,17 +1079,25 @@ interface Unsafe {
1054
1079
  * This is internal and must not be defined.
1055
1080
  */
1056
1081
  _compiled?: RegExp | null | undefined;
1082
+ /**
1083
+ * `character` is bad when these nodes are after it (optional).
1084
+ */
1085
+ afterNode?: Array<Nodes['type']> | Nodes['type'] | null | undefined;
1057
1086
  /**
1058
1087
  * `character` is bad when this is after it (optional).
1059
1088
  */
1060
1089
  after?: string | null | undefined;
1061
1090
  /**
1062
- * `character` is bad at a break (cannot be used together with `before`) (optional).
1091
+ * `character` is bad at a break (potentially w/ `before` between)
1092
+ * (optional).
1063
1093
  */
1064
1094
  atBreak?: boolean | null | undefined;
1065
1095
  /**
1066
- * `character` is bad when this is before it (cannot be used together with
1067
- * `atBreak`) (optional).
1096
+ * `character` is bad when these nodes are before it (optional).
1097
+ */
1098
+ beforeNode?: Array<Nodes['type']> | Nodes['type'] | null | undefined;
1099
+ /**
1100
+ * `character` is bad when this is before it (optional).
1068
1101
  */
1069
1102
  before?: string | null | undefined;
1070
1103
  /**
@@ -1079,9 +1112,17 @@ interface Unsafe {
1079
1112
  * Constructs where this is fine again (optional).
1080
1113
  */
1081
1114
  notInConstruct?: Array<ConstructName> | ConstructName | null | undefined;
1115
+ /**
1116
+ * Compile the regex with `u` (default: `false`).
1117
+ */
1118
+ unicode?: boolean | null | undefined;
1082
1119
  }
1083
1120
  type MarkdownPluginState = {
1084
- /** Mark keys serialized as plain text. */
1121
+ /**
1122
+ * Mark keys serialized as plain text. Naming `rawHtml` also stops import
1123
+ * from marking raw HTML, so tags stay plain text and comment blocks drop
1124
+ * with `RawHtmlPlugin` installed.
1125
+ */
1085
1126
  plainMarks: readonly string[] | null;
1086
1127
  /** Remark plugins used for parsing and serialization. */
1087
1128
  remarkPlugins: readonly MarkdownSyncPluggable[];
@@ -1181,4 +1222,38 @@ type MarkdownEditor<E = Editor, V extends Value = Value> = E & {
1181
1222
  markdown: MarkdownApi<V>;
1182
1223
  };
1183
1224
  };
1184
- export { MarkdownSourceLocation as C, MarkdownWarningDiagnostic as D, MarkdownSyncTransformer as E, MarkdownSliceParseResult as S, MarkdownSyncPlugin as T, MarkdownParseOptions as _, MarkdownPluginState as a, MarkdownSerializePolicy as b, Handle as c, MarkdownDiagnostic as d, MarkdownDocumentParseResult as f, MarkdownParseLimits as g, MarkdownModelLocation as h, MarkdownPlugin as i, Join as l, MarkdownErrorDiagnostic as m, MarkdownDefinition as n, parseMarkdown as o, MarkdownEditorSerializeOptions as p, MarkdownEditor as r, serializeMarkdown as s, MarkdownApi as t, Unsafe as u, MarkdownParsePolicy as v, MarkdownSyncPluggable as w, MarkdownSerializeResult as x, MarkdownSerializeOptions as y };
1225
+ /**
1226
+ * Marks text that Markdown import kept from raw HTML, such as a README's
1227
+ * centered header or an HTML comment, so Markdown export writes it back as
1228
+ * HTML when its block passes Plate's safety check and as escaped text
1229
+ * otherwise. Install it beside `MarkdownPlugin`. Every other format writes the
1230
+ * text as plain visible text.
1231
+ */
1232
+ declare const RawHtmlPlugin: BasePlugin<Readonly<{
1233
+ formats: true;
1234
+ }> & Readonly<{
1235
+ name: "rawHtml";
1236
+ }> & Readonly<Record<never, never>> & Readonly<{
1237
+ __pluginWritableProperties: Readonly<{
1238
+ descriptor: PropertyBooleanDescriptor<{
1239
+ readonly default: false;
1240
+ readonly omitDefault: true;
1241
+ }>;
1242
+ key: "rawHtml";
1243
+ localId: "rawHtml";
1244
+ ownerName: "rawHtml";
1245
+ placement: "text";
1246
+ unaliased: true;
1247
+ value: boolean;
1248
+ }>;
1249
+ schema: {
1250
+ readonly mark: {
1251
+ readonly inclusive: false;
1252
+ readonly property: PropertyBooleanDescriptor<{
1253
+ readonly default: false;
1254
+ readonly omitDefault: true;
1255
+ }>;
1256
+ };
1257
+ };
1258
+ }>>;
1259
+ export { MarkdownWarningDiagnostic as A, MarkdownSerializePolicy as C, MarkdownSyncPluggable as D, MarkdownSourceLocation as E, MarkdownSyncPlugin as O, MarkdownSerializeOptions as S, MarkdownSliceParseResult as T, MarkdownFrontmatter as _, MarkdownPlugin as a, MarkdownParseOptions as b, serializeMarkdown as c, Unsafe as d, getMarkdownFrontmatter as f, MarkdownErrorDiagnostic as g, MarkdownEditorSerializeOptions as h, MarkdownEditor as i, MarkdownSyncTransformer as k, Handle as l, MarkdownDocumentParseResult as m, MarkdownApi as n, MarkdownPluginState as o, MarkdownDiagnostic as p, MarkdownDefinition as r, parseMarkdown as s, RawHtmlPlugin as t, Join as u, MarkdownModelLocation as v, MarkdownSerializeResult as w, MarkdownParsePolicy as x, MarkdownParseLimits as y };
@@ -1,6 +1,7 @@
1
- import { Mu as Location, Ru as BaseRange, eo as Value, zu as Range } from "./index-BU6k1Aev.js";
2
- import { _ as BasePlugin } from "./core-BJG8l_mk.js";
3
- import { r as AnnotationChange } from "./index-iaZOhA76.js";
1
+ import { Ji as Location, ps as Range, su as Value, x as BaseRange } from "./index-BXjLmx1n-CXk17buG.js";
2
+ import "./htmlTypes-eT2ZGDAj.js";
3
+ import { _ as BasePlugin } from "./core-BqR-fEDp.js";
4
+ import { r as AnnotationChange } from "./index-BWPcE4ac-Cto_IsNs.js";
4
5
  type CommentUser = Readonly<{
5
6
  id: string;
6
7
  name: string;
@@ -1,4 +1,4 @@
1
- import { Ft as CarriedRun, It as RootFactsJson, Ma as PluginTypeProvider, Qo as TxDeclaredMethod, Rn as EditorEffect, Zc as EditorSchemaIdentity, a as encodeEditorSelection, eo as Value, es as TxOnlyMethod, f as encodeEditorEffect, gs as Selection, ln as Editor, na as Plugin, os as DocumentChange, qi as HistoryApi } from "./index-BU6k1Aev.js";
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-BXjLmx1n-CXk17buG.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;
@@ -163,4 +163,4 @@ type HistoryPlugin<TEnabled extends boolean | undefined = undefined> = Plugin<Hi
163
163
  type HistoryAction = 'redo' | 'undo';
164
164
  /** Create the inverse-change history plugin. */
165
165
  declare const history: <const TEnabled extends boolean | undefined = undefined>(options?: HistoryOptions<TEnabled>) => HistoryPlugin<TEnabled>;
166
- export { HistoryPluginTypes as a, history as c, HistoryBatchJSON as d, HistoryJSON as f, HistoryPluginTypeProvider as i, Batch as l, HistoryOptions as n, HistoryStateApi as o, HistoryPlugin as r, HistoryTxApi as s, HistoryControlTx as t, History as u };
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 };