oasis-editor 0.0.1 → 0.0.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 (363) hide show
  1. package/README.md +388 -1
  2. package/dist/OasisEditorApp-DEnDLTaw.js +45893 -0
  3. package/dist/app/bootstrap/createOasisEditorApp.d.ts +2 -3
  4. package/dist/app/bootstrap/createOasisEditorContainer.d.ts +2 -3
  5. package/dist/app/client/OasisEditorClient.d.ts +97 -0
  6. package/dist/app/controllers/EditorCommandsController.d.ts +1 -1
  7. package/dist/app/controllers/createResizeSession.d.ts +43 -0
  8. package/dist/app/controllers/createRotateSession.d.ts +36 -0
  9. package/dist/app/controllers/documentIO/DocumentImporter.d.ts +1 -1
  10. package/dist/app/controllers/tableResize/tableResizeApply.d.ts +5 -0
  11. package/dist/app/controllers/tableResize/tableResizeConstraints.d.ts +17 -0
  12. package/dist/app/controllers/tableResize/tableResizeDom.d.ts +9 -0
  13. package/dist/app/controllers/tableResize/tableResizeGeometry.d.ts +5 -0
  14. package/dist/app/controllers/tableResize/tableResizeHitTest.d.ts +4 -0
  15. package/dist/app/controllers/tableResize/tableResizeTypes.d.ts +65 -0
  16. package/dist/app/controllers/tableResize/tableResizeUnits.d.ts +6 -0
  17. package/dist/app/controllers/useEditorDocumentIO.d.ts +3 -3
  18. package/dist/app/controllers/useEditorHistoryActions.d.ts +3 -1
  19. package/dist/app/controllers/useEditorImageOperations.d.ts +6 -14
  20. package/dist/app/controllers/useEditorLayout.d.ts +2 -2
  21. package/dist/app/controllers/useEditorStyle.d.ts +1 -1
  22. package/dist/app/controllers/useEditorSurfaceEvents.d.ts +1 -0
  23. package/dist/app/controllers/useEditorTableOperations.d.ts +2 -2
  24. package/dist/app/controllers/useEditorTableResize.d.ts +2 -24
  25. package/dist/app/controllers/useEditorTextBoxOperations.d.ts +24 -0
  26. package/dist/app/services/userPreferences.d.ts +4 -0
  27. package/dist/assets/importDocxWorker-R5rI6JIO.js +12 -0
  28. package/dist/branding/apple-touch-icon.png +0 -0
  29. package/dist/branding/brand-mark.webp +0 -0
  30. package/dist/branding/favicon-16x16.png +0 -0
  31. package/dist/branding/favicon-32x32.png +0 -0
  32. package/dist/branding/favicon.ico +0 -0
  33. package/dist/branding/github-pages-icon.png +0 -0
  34. package/dist/branding/icon-192.png +0 -0
  35. package/dist/branding/icon-512.png +0 -0
  36. package/dist/branding/logo-full.png +0 -0
  37. package/dist/branding/logo-mark-square.png +0 -0
  38. package/dist/branding/social-card.png +0 -0
  39. package/dist/core/Editor.d.ts +4 -5
  40. package/dist/core/cloneState.d.ts +3 -1
  41. package/dist/core/commands/CommandRegistry.d.ts +6 -1
  42. package/dist/core/commands/block.d.ts +1 -1
  43. package/dist/core/commands/builtinCommands.d.ts +2 -0
  44. package/dist/core/commands/floatingLayout.d.ts +29 -0
  45. package/dist/core/commands/image.d.ts +16 -8
  46. package/dist/core/commands/list.d.ts +1 -1
  47. package/dist/core/commands/publicCommandTypes.d.ts +110 -0
  48. package/dist/core/commands/selectedObjectRun.d.ts +20 -0
  49. package/dist/core/commands/table/insertTableCommand.d.ts +3 -0
  50. package/dist/core/commands/table/tableCellStyleCommands.d.ts +5 -0
  51. package/dist/core/commands/table/tableColumnCommands.d.ts +3 -0
  52. package/dist/core/commands/table/tableCommandUtils.d.ts +16 -0
  53. package/dist/core/commands/table/tableRowCommands.d.ts +5 -0
  54. package/dist/core/commands/table/tableStyleCommands.d.ts +4 -0
  55. package/dist/core/commands/table.d.ts +5 -10
  56. package/dist/core/commands/text.d.ts +1 -1
  57. package/dist/core/commands/textBox.d.ts +21 -0
  58. package/dist/core/document/blockReplacement.d.ts +7 -0
  59. package/dist/core/document/bookmarkAnchors.d.ts +8 -0
  60. package/dist/core/document/clone.d.ts +8 -0
  61. package/dist/core/document/paragraphRunBuild.d.ts +14 -0
  62. package/dist/core/document/paragraphRunEdit.d.ts +3 -0
  63. package/dist/core/document/paragraphRunQuery.d.ts +14 -0
  64. package/dist/core/document/paragraphRuns.d.ts +3 -0
  65. package/dist/core/editorCommands.d.ts +2 -0
  66. package/dist/core/editorState.d.ts +5 -3
  67. package/dist/core/endnotes.d.ts +41 -0
  68. package/dist/core/engine.d.ts +18 -3
  69. package/dist/core/html/htmlBlockWalker.d.ts +17 -0
  70. package/dist/core/html/htmlEscape.d.ts +1 -0
  71. package/dist/core/html/htmlStyleParser.d.ts +3 -0
  72. package/dist/core/html/htmlTextSerializer.d.ts +5 -0
  73. package/dist/core/html/inlineImageParser.d.ts +3 -0
  74. package/dist/core/html/inlineStyleParser.d.ts +3 -0
  75. package/dist/core/html/paragraphStyleParser.d.ts +3 -0
  76. package/dist/core/html/styleCss.d.ts +5 -0
  77. package/dist/core/model/assets.d.ts +7 -0
  78. package/dist/core/model/documentIndex.d.ts +58 -0
  79. package/dist/core/model/documentSections.d.ts +4 -0
  80. package/dist/core/model/editingZones.d.ts +26 -0
  81. package/dist/core/model/editorState.d.ts +18 -0
  82. package/dist/core/model/index.d.ts +31 -0
  83. package/dist/core/model/pageGeometry.d.ts +14 -0
  84. package/dist/core/model/paragraphWalker.d.ts +5 -0
  85. package/dist/core/model/queries.d.ts +2 -1
  86. package/dist/core/model/styleDefaults.d.ts +6 -0
  87. package/dist/core/model/styleResolution.d.ts +44 -0
  88. package/dist/core/model/types/document.d.ts +86 -0
  89. package/dist/core/model/types/documentBookmarks.d.ts +49 -0
  90. package/dist/core/model/types/documentEndnotes.d.ts +8 -0
  91. package/dist/core/model/types/documentFootnotes.d.ts +8 -0
  92. package/dist/core/model/types/layout.d.ts +93 -0
  93. package/dist/core/model/types/nodes.d.ts +192 -0
  94. package/dist/core/model/types/primitives.d.ts +140 -0
  95. package/dist/core/model/types/selection.d.ts +14 -0
  96. package/dist/core/model/types/styles.d.ts +149 -0
  97. package/dist/core/model.d.ts +7 -444
  98. package/dist/core/plugin.d.ts +59 -6
  99. package/dist/core/plugins/PluginCollection.d.ts +1 -0
  100. package/dist/core/plugins/PluginUiRegistry.d.ts +20 -0
  101. package/dist/core/selection/navigation.d.ts +5 -0
  102. package/dist/core/selection/rangeEditing.d.ts +13 -0
  103. package/dist/core/textStyle/textStyleKeys.d.ts +6 -0
  104. package/dist/core/textStyle/textStyleMutations.d.ts +8 -0
  105. package/dist/export/docx/bookmarksXml.d.ts +21 -0
  106. package/dist/export/docx/borders.d.ts +25 -0
  107. package/dist/export/docx/docxTypes.d.ts +35 -2
  108. package/dist/export/docx/endnotesXml.d.ts +24 -0
  109. package/dist/export/docx/stylesXml.d.ts +3 -0
  110. package/dist/export/docx/tableXml.d.ts +7 -1
  111. package/dist/export/docx/text/blocksXml.d.ts +7 -0
  112. package/dist/export/docx/text/constants.d.ts +6 -0
  113. package/dist/export/docx/text/drawingContainerXml.d.ts +16 -0
  114. package/dist/export/docx/text/dropCapXml.d.ts +9 -0
  115. package/dist/export/docx/text/endnoteRunXml.d.ts +5 -0
  116. package/dist/export/docx/text/fieldRunXml.d.ts +11 -0
  117. package/dist/export/docx/text/footnoteRunXml.d.ts +5 -0
  118. package/dist/export/docx/text/hyperlinkXml.d.ts +3 -0
  119. package/dist/export/docx/text/imageRunXml.d.ts +3 -0
  120. package/dist/export/docx/text/paragraphPropertiesXml.d.ts +16 -0
  121. package/dist/export/docx/text/runPropertiesXml.d.ts +3 -0
  122. package/dist/export/docx/text/runTextXml.d.ts +1 -0
  123. package/dist/export/docx/text/runXml.d.ts +5 -0
  124. package/dist/export/docx/text/styleMaterialization.d.ts +4 -0
  125. package/dist/export/docx/text/textBoxRunXml.d.ts +4 -0
  126. package/dist/export/docx/textXml.d.ts +1 -6
  127. package/dist/export/pdf/OasisPdfWriter.d.ts +1 -0
  128. package/dist/export/pdf/draw/borderDash.d.ts +11 -0
  129. package/dist/export/pdf/draw/drawFragment.d.ts +1 -0
  130. package/dist/export/pdf/draw/drawParagraph.d.ts +8 -1
  131. package/dist/export/pdf/fonts/TrueTypePdfFontSubsetter.d.ts +5 -0
  132. package/dist/export/pdf/fonts/officeFontAssets.d.ts +24 -0
  133. package/dist/export/pdf/units.d.ts +2 -1
  134. package/dist/i18n/index.d.ts +1 -1
  135. package/dist/i18n/locales/en.d.ts +108 -0
  136. package/dist/i18n/locales/pt-BR.d.ts +108 -0
  137. package/dist/import/DocumentFormatImporter.d.ts +26 -0
  138. package/dist/import/documentImporterRegistry.d.ts +6 -0
  139. package/dist/import/docx/bookmarks.d.ts +8 -0
  140. package/dist/import/docx/borders.d.ts +37 -0
  141. package/dist/import/docx/docxImporter.d.ts +3 -0
  142. package/dist/import/docx/dropCap.d.ts +13 -0
  143. package/dist/import/docx/endnotes.d.ts +17 -0
  144. package/dist/import/docx/footnotes.d.ts +2 -2
  145. package/dist/import/docx/headerFooter.d.ts +2 -2
  146. package/dist/import/docx/nestedBlocks.d.ts +15 -0
  147. package/dist/import/docx/numbering.d.ts +16 -1
  148. package/dist/import/docx/{styles.d.ts → paragraphStyle.d.ts} +2 -8
  149. package/dist/import/docx/paragraphs.d.ts +5 -4
  150. package/dist/import/docx/runStyle.d.ts +6 -0
  151. package/dist/import/docx/runs/drawingImage.d.ts +13 -0
  152. package/dist/import/docx/runs/fields.d.ts +3 -0
  153. package/dist/import/docx/runs/relationships.d.ts +11 -0
  154. package/dist/import/docx/runs/textBox.d.ts +6 -0
  155. package/dist/import/docx/runs/types.d.ts +42 -0
  156. package/dist/import/docx/runs/units.d.ts +11 -0
  157. package/dist/import/docx/runs/vmlImage.d.ts +6 -0
  158. package/dist/import/docx/runs.d.ts +14 -34
  159. package/dist/import/docx/sectionProperties.d.ts +1 -1
  160. package/dist/import/docx/settings.d.ts +1 -0
  161. package/dist/import/docx/styleUtils.d.ts +6 -0
  162. package/dist/import/docx/stylesXml.d.ts +4 -0
  163. package/dist/import/docx/tables.d.ts +2 -2
  164. package/dist/import/docx/theme.d.ts +17 -0
  165. package/dist/import/docx/themeColors.d.ts +37 -0
  166. package/dist/import/docx/themeFonts.d.ts +5 -1
  167. package/dist/import/docx/xmlHelpers.d.ts +3 -1
  168. package/dist/import/html/htmlImporter.d.ts +3 -0
  169. package/dist/import/html/importHtmlToEditorDocument.d.ts +8 -0
  170. package/dist/index-DuS88s1l.js +36810 -0
  171. package/dist/index.d.ts +39 -14
  172. package/dist/layoutProjection/blockHeights.d.ts +1 -1
  173. package/dist/layoutProjection/blocksPagination.d.ts +1 -1
  174. package/dist/layoutProjection/constants.d.ts +9 -1
  175. package/dist/layoutProjection/documentLayout.d.ts +0 -1
  176. package/dist/layoutProjection/dropCapExclusion.d.ts +23 -0
  177. package/dist/layoutProjection/endnotePagination.d.ts +8 -0
  178. package/dist/layoutProjection/floatingObjects.d.ts +45 -0
  179. package/dist/layoutProjection/footnotePagination.d.ts +1 -2
  180. package/dist/layoutProjection/headerFooterFootnotes.d.ts +1 -1
  181. package/dist/layoutProjection/headerFooterProjection.d.ts +3 -3
  182. package/dist/layoutProjection/index.d.ts +9 -7
  183. package/dist/layoutProjection/paragraphBorders.d.ts +14 -0
  184. package/dist/layoutProjection/paragraphPagination.d.ts +23 -9
  185. package/dist/layoutProjection/paragraphProjection.d.ts +1 -1
  186. package/dist/layoutProjection/sectionPagination.d.ts +3 -2
  187. package/dist/layoutProjection/tablePagination.d.ts +3 -2
  188. package/dist/layoutProjection/tableProjection.d.ts +1 -1
  189. package/dist/oasis-editor.css +1 -1
  190. package/dist/oasis-editor.js +52 -80462
  191. package/dist/oasis-editor.umd.cjs +4 -4
  192. package/dist/plugins/internal/createEssentialsPlugin.d.ts +8 -1
  193. package/dist/react.d.ts +12 -0
  194. package/dist/react.js +24 -0
  195. package/dist/testing/wordLayoutParity.d.ts +0 -3
  196. package/dist/text/fonts/FontMetricsProvider.d.ts +38 -0
  197. package/dist/text/fonts/FontProgramFactory.d.ts +6 -0
  198. package/dist/text/fonts/core/types.d.ts +69 -0
  199. package/dist/text/fonts/decoders/Brotli.d.ts +4 -0
  200. package/dist/text/fonts/decoders/FontDecoderRegistry.d.ts +10 -0
  201. package/dist/text/fonts/decoders/TtfDecoder.d.ts +8 -0
  202. package/dist/text/fonts/decoders/Woff2Decoder.d.ts +45 -0
  203. package/dist/text/fonts/layout/SimpleTextLayouter.d.ts +7 -0
  204. package/dist/text/fonts/preciseFontMetrics.d.ts +16 -0
  205. package/dist/text/fonts/preciseFontMode.d.ts +7 -0
  206. package/dist/text/fonts/sfnt/SfntFontProgram.d.ts +29 -0
  207. package/dist/text/fonts/vendor/woff2/buffer.d.ts +24 -0
  208. package/dist/text/fonts/vendor/woff2/glyf-reconstructor.d.ts +55 -0
  209. package/dist/text/fonts/vendor/woff2/hmtx-reconstructor.d.ts +5 -0
  210. package/dist/text/fonts/vendor/woff2/sfnt-builder.d.ts +7 -0
  211. package/dist/text/fonts/vendor/woff2/utils.d.ts +12 -0
  212. package/dist/text/truetype/AdvanceWidthSource.d.ts +19 -0
  213. package/dist/text/truetype/BinaryReader.d.ts +28 -0
  214. package/dist/text/truetype/CmapParser.d.ts +15 -0
  215. package/dist/text/truetype/SfntTableDirectory.d.ts +26 -0
  216. package/dist/text/truetype/TrueTypeFont.d.ts +36 -0
  217. package/dist/text/truetype/TrueTypeParseError.d.ts +11 -0
  218. package/dist/text/truetype/tableParsers.d.ts +45 -0
  219. package/dist/ui/OasisEditorApp.d.ts +1 -1
  220. package/dist/ui/OasisEditorAppLazy.d.ts +16 -0
  221. package/dist/ui/OasisEditorAppProps.d.ts +10 -2
  222. package/dist/ui/OasisEditorEditor.d.ts +17 -8
  223. package/dist/ui/OasisEditorLoading.d.ts +25 -0
  224. package/dist/ui/app/EditorDialogsLayer.d.ts +4 -0
  225. package/dist/ui/app/EditorWorkspace.d.ts +6 -0
  226. package/dist/ui/app/buildEditorViewProps.d.ts +7 -3
  227. package/dist/ui/app/createRuntimeCommandHost.d.ts +2 -1
  228. package/dist/ui/app/localFontAccess.d.ts +33 -0
  229. package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +2 -2
  230. package/dist/ui/app/useEditorContextMenuClipboard.d.ts +18 -0
  231. package/dist/ui/app/useEditorDialogs.d.ts +18 -0
  232. package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +3 -0
  233. package/dist/ui/app/useEditorRuntimePlugins.d.ts +3 -0
  234. package/dist/ui/app/useEditorUiOptions.d.ts +1 -1
  235. package/dist/ui/app/useParagraphDialogBridge.d.ts +29 -0
  236. package/dist/ui/app/useTablePropertiesDialogBridge.d.ts +30 -0
  237. package/dist/ui/canvas/CanvasHitTestService.d.ts +17 -0
  238. package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +57 -1
  239. package/dist/ui/canvas/CanvasSelectionGeometry.d.ts +16 -0
  240. package/dist/ui/canvas/CanvasTableLayout.d.ts +3 -1
  241. package/dist/ui/canvas/canvasBlockPainter.d.ts +2 -2
  242. package/dist/ui/canvas/canvasBorders.d.ts +17 -0
  243. package/dist/ui/canvas/canvasDropCapPainter.d.ts +16 -0
  244. package/dist/ui/canvas/canvasParagraphPainter.d.ts +24 -2
  245. package/dist/ui/canvas/canvasTextBoxPainter.d.ts +24 -0
  246. package/dist/ui/canvas/imageContour.d.ts +10 -0
  247. package/dist/ui/canvas/textBoxRenderHeight.d.ts +14 -0
  248. package/dist/ui/canvas/verticalText.d.ts +104 -0
  249. package/dist/ui/components/Dialogs/FontDialog.d.ts +2 -65
  250. package/dist/ui/components/Dialogs/FontDialogModel.d.ts +5 -0
  251. package/dist/ui/components/Dialogs/ParagraphDialog.d.ts +49 -0
  252. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +80 -0
  253. package/dist/ui/components/Dialogs/font-dialog/AdvancedFontTab.d.ts +6 -0
  254. package/dist/ui/components/Dialogs/font-dialog/FontDialogController.d.ts +21 -0
  255. package/dist/ui/components/Dialogs/font-dialog/FontDialogTypes.d.ts +112 -0
  256. package/dist/ui/components/Dialogs/font-dialog/FontPreview.d.ts +6 -0
  257. package/dist/ui/components/Dialogs/font-dialog/FontTab.d.ts +6 -0
  258. package/dist/ui/components/Dialogs/font-dialog/useFontDialogController.d.ts +4 -0
  259. package/dist/ui/components/FloatingToolbar/FloatingLayoutOptions.d.ts +17 -0
  260. package/dist/ui/components/Menubar/Menubar.d.ts +2 -1
  261. package/dist/ui/components/Menubar/builtinMenuIds.d.ts +36 -0
  262. package/dist/ui/components/OasisBrandMark.d.ts +7 -0
  263. package/dist/ui/components/PluginUi/PluginUiHost.d.ts +8 -0
  264. package/dist/ui/components/Ruler/HorizontalRuler.d.ts +11 -0
  265. package/dist/ui/components/Ruler/rulerGeometry.d.ts +63 -0
  266. package/dist/ui/components/Toolbar/Toolbar.d.ts +2 -0
  267. package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +40 -0
  268. package/dist/ui/components/Toolbar/primitives/ColorPicker.d.ts +1 -1
  269. package/dist/ui/components/Toolbar/primitives/Separator.d.ts +4 -3
  270. package/dist/ui/components/Toolbar/registry/ToolbarRegistry.d.ts +7 -2
  271. package/dist/ui/components/Toolbar/schema/items.d.ts +1 -1
  272. package/dist/ui/components/WelcomeOverlay.d.ts +13 -0
  273. package/dist/ui/editorLayoutConstants.d.ts +12 -0
  274. package/dist/ui/editorUiTypes.d.ts +35 -4
  275. package/dist/ui/fontSizeUnits.d.ts +15 -0
  276. package/dist/ui/mount.d.ts +2 -1
  277. package/dist/ui/overlays/ResizeHandlesOverlay.d.ts +34 -0
  278. package/dist/ui/public/Button.d.ts +10 -0
  279. package/dist/ui/public/Checkbox.d.ts +9 -0
  280. package/dist/ui/public/DialogFooter.d.ts +6 -0
  281. package/dist/ui/public/FloatingActionButton.d.ts +8 -0
  282. package/dist/ui/public/IconButton.d.ts +10 -0
  283. package/dist/ui/public/SelectField.d.ts +15 -0
  284. package/dist/ui/public/SidePanel.d.ts +12 -0
  285. package/dist/ui/public/TextField.d.ts +9 -0
  286. package/dist/ui/public/index.d.ts +36 -0
  287. package/dist/ui/resizeGeometry.d.ts +28 -0
  288. package/dist/ui/shells/DocumentShell.d.ts +6 -0
  289. package/dist/ui/textMeasurement/alignment.d.ts +3 -0
  290. package/dist/ui/textMeasurement/characterWidth.d.ts +9 -0
  291. package/dist/ui/textMeasurement/composer.d.ts +5 -0
  292. package/dist/ui/textMeasurement/constants.d.ts +4 -0
  293. package/dist/ui/textMeasurement/fontMetrics.d.ts +12 -0
  294. package/dist/ui/textMeasurement/indentation.d.ts +12 -0
  295. package/dist/ui/textMeasurement/layoutLine.d.ts +4 -0
  296. package/dist/ui/textMeasurement/paragraphLineHeight.d.ts +22 -0
  297. package/dist/ui/textMeasurement/tabStops.d.ts +4 -0
  298. package/dist/ui/textMeasurement/tokenizer.d.ts +6 -0
  299. package/dist/ui/textMeasurement/types.d.ts +27 -0
  300. package/dist/ui/textMeasurement.d.ts +5 -11
  301. package/dist/ui/toolbarStyleState.d.ts +15 -2
  302. package/dist/ui/utils/customIcons.d.ts +20 -0
  303. package/dist/ui.d.ts +42 -0
  304. package/dist/ui.js +19 -0
  305. package/dist/utils/imageFormats.d.ts +14 -0
  306. package/dist/utils/throttle.d.ts +1 -1
  307. package/dist/vue.d.ts +9 -0
  308. package/dist/vue.js +33 -0
  309. package/package.json +90 -62
  310. package/dist/__tests__/app/PersistenceService.test.d.ts +0 -1
  311. package/dist/__tests__/app/footnoteUiCommands.test.d.ts +0 -1
  312. package/dist/__tests__/commands/text.test.d.ts +0 -1
  313. package/dist/__tests__/core/editorPluginIntegration.test.d.ts +0 -1
  314. package/dist/__tests__/core/editorState.test.d.ts +0 -1
  315. package/dist/__tests__/core/footnotes.test.d.ts +0 -1
  316. package/dist/__tests__/core/model.test.d.ts +0 -1
  317. package/dist/__tests__/core/pluginCollection.test.d.ts +0 -1
  318. package/dist/__tests__/core/tableCommands.test.d.ts +0 -1
  319. package/dist/__tests__/export/docxExport.test.d.ts +0 -1
  320. package/dist/__tests__/export/footnotesExport.test.d.ts +0 -1
  321. package/dist/__tests__/export/pdfWriter.test.d.ts +0 -1
  322. package/dist/__tests__/export/underlineStyle.test.d.ts +0 -1
  323. package/dist/__tests__/import/docxComplexSmoke.test.d.ts +0 -1
  324. package/dist/__tests__/import/docxImport.test.d.ts +0 -1
  325. package/dist/__tests__/import/footnotesImport.test.d.ts +0 -1
  326. package/dist/__tests__/integration/documentFlow.test.d.ts +0 -1
  327. package/dist/__tests__/ui/CanvasTableLayout.test.d.ts +0 -1
  328. package/dist/__tests__/ui/canvasHitTestService.test.d.ts +0 -1
  329. package/dist/__tests__/ui/canvasLayoutSnapshot.test.d.ts +0 -1
  330. package/dist/__tests__/ui/canvasSelectionGeometry.test.d.ts +0 -1
  331. package/dist/__tests__/ui/canvasTextRendering.test.d.ts +0 -1
  332. package/dist/__tests__/ui/composeMeasuredParagraphLines.test.d.ts +0 -1
  333. package/dist/__tests__/ui/dialog.test.d.ts +0 -1
  334. package/dist/__tests__/ui/fontDialog.test.d.ts +0 -1
  335. package/dist/__tests__/ui/footnotesLayout.test.d.ts +0 -1
  336. package/dist/__tests__/ui/layoutIdentity.test.d.ts +0 -1
  337. package/dist/__tests__/ui/layoutProjection.test.d.ts +0 -1
  338. package/dist/__tests__/ui/registry.test.d.ts +0 -1
  339. package/dist/__tests__/ui/tabs.test.d.ts +0 -1
  340. package/dist/__tests__/ui/textMeasurementAlignment.test.d.ts +0 -1
  341. package/dist/__tests__/word-parity/fixtures/corpus.d.ts +0 -10
  342. package/dist/__tests__/word-parity/fixtures/loremFixtures.d.ts +0 -8
  343. package/dist/__tests__/word-parity/wordLayout.word-parity.d.ts +0 -1
  344. package/dist/assets/Arimo-Bold.ttf +0 -0
  345. package/dist/assets/Arimo-BoldItalic.ttf +0 -0
  346. package/dist/assets/Arimo-Italic.ttf +0 -0
  347. package/dist/assets/Arimo-Regular.ttf +0 -0
  348. package/dist/assets/Carlito-Bold.ttf +0 -0
  349. package/dist/assets/Carlito-BoldItalic.ttf +0 -0
  350. package/dist/assets/Carlito-Italic.ttf +0 -0
  351. package/dist/assets/Carlito-Regular.ttf +0 -0
  352. package/dist/assets/Roboto-Italic.ttf +0 -0
  353. package/dist/assets/Roboto-Medium.ttf +0 -0
  354. package/dist/assets/Roboto-MediumItalic.ttf +0 -0
  355. package/dist/assets/Roboto-Regular.ttf +0 -0
  356. package/dist/assets/Tinos-Bold.ttf +0 -0
  357. package/dist/assets/Tinos-BoldItalic.ttf +0 -0
  358. package/dist/assets/Tinos-Italic.ttf +0 -0
  359. package/dist/assets/Tinos-Regular.ttf +0 -0
  360. package/dist/assets/importDocxWorker-DIQ28Lka.js +0 -12
  361. package/dist/core/commands/utils.d.ts +0 -69
  362. package/dist/demo/OasisSiteApp.d.ts +0 -1
  363. package/dist/main.d.ts +0 -1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,7 @@
1
1
  import { EditorState, EditorDocument } from '../model.js';
2
2
  import { CommandRegistry } from '../commands/CommandRegistry.js';
3
- import { OasisCommand, OasisEditor, OasisPlugin } from '../plugin.js';
3
+ import { PluginUiRegistry } from '../plugins/PluginUiRegistry.js';
4
+ import { OasisEditor, OasisPlugin } from '../plugin.js';
4
5
 
5
6
  export interface EditorOptions {
6
7
  doc?: EditorDocument;
@@ -16,18 +17,16 @@ export declare class Editor implements OasisEditor {
16
17
  private pluginCollection;
17
18
  private listeners;
18
19
  readonly commands: CommandRegistry;
20
+ readonly ui: PluginUiRegistry;
19
21
  constructor(options?: EditorOptions);
20
22
  static create(options?: EditorOptions): Promise<Editor>;
21
23
  private initializeState;
22
24
  get state(): EditorState;
23
25
  dispatch(updater: (state: EditorState) => EditorState): void;
24
- registerCommand<TPayload = unknown, TResult = unknown>(name: string, command: OasisCommand<TPayload, TResult>): void;
25
- unregisterCommand(name: string): void;
26
- execute<TPayload = unknown, TResult = unknown>(name: string, payload?: TPayload): TResult;
27
- canExecute(name: string, payload?: unknown): boolean;
28
26
  destroy(): Promise<void>;
29
27
  on(event: string, callback: (...args: unknown[]) => void): () => void;
30
28
  once(event: string, callback: (...args: unknown[]) => void): () => void;
31
29
  off(event: string, callback: (...args: unknown[]) => void): void;
32
30
  private emit;
31
+ private createCommandContext;
33
32
  }
@@ -1,8 +1,10 @@
1
- import { EditorBlockNode, EditorFootnote, EditorFootnotes, EditorSection, EditorState } from '../model.js';
1
+ import { EditorBlockNode, EditorEndnote, EditorEndnotes, EditorFootnote, EditorFootnotes, EditorSection, EditorState } from '../model.js';
2
2
 
3
3
  export declare function cloneBlock(block: EditorBlockNode): EditorBlockNode;
4
4
  export declare const cloneDocumentBlock: typeof cloneBlock;
5
5
  export declare function cloneSection(section: EditorSection): EditorSection;
6
6
  export declare function cloneFootnote(footnote: EditorFootnote): EditorFootnote;
7
7
  export declare function cloneFootnotes(footnotes: EditorFootnotes | undefined): EditorFootnotes | undefined;
8
+ export declare function cloneEndnote(endnote: EditorEndnote): EditorEndnote;
9
+ export declare function cloneEndnotes(endnotes: EditorEndnotes | undefined): EditorEndnotes | undefined;
8
10
  export declare function cloneEditorState(source: EditorState): EditorState;
@@ -1,10 +1,15 @@
1
- import { OasisCommand, OasisCommandRegistry } from '../../../plugin.js';
1
+ import { CommandState, OasisCommand, OasisCommandContext, OasisCommandRegistry } from '../../../plugin.js';
2
2
 
3
3
  export declare class CommandRegistry implements OasisCommandRegistry {
4
4
  private commands;
5
+ private contextProvider;
6
+ setContextProvider(provider: () => OasisCommandContext): void;
5
7
  register<TPayload = unknown, TResult = unknown>(name: string, command: OasisCommand<TPayload, TResult>): void;
6
8
  unregister(name: string): void;
7
9
  get(name: string): OasisCommand | undefined;
8
10
  has(name: string): boolean;
11
+ execute<TPayload = unknown, TResult = unknown>(name: string, payload?: TPayload): TResult;
12
+ canExecute(name: string, payload?: unknown): boolean;
13
+ state(name: string, payload?: unknown): CommandState;
9
14
  clear(): void;
10
15
  }
@@ -1,5 +1,5 @@
1
1
  import { EditorParagraphStyle, EditorPosition, EditorState, EditorSection, EditorTabStop } from '../../../model.js';
2
- import { ValueParagraphStyleKey } from '../../utils.js';
2
+ import { ValueParagraphStyleKey } from '../../../textStyle/textStyleKeys.js';
3
3
 
4
4
  export declare function moveBlockToPosition(state: EditorState, blockId: string, targetPosition: EditorPosition): EditorState;
5
5
  export declare function splitBlockAtSelection(state: EditorState): EditorState;
@@ -0,0 +1,2 @@
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
2
+ export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -0,0 +1,29 @@
1
+ import { EditorImageFloatingLayout } from '../../../model.js';
2
+
3
+ /**
4
+ * The text-wrapping presets exposed by the Word-style "Layout Options" popup.
5
+ * Maps onto the `floating` field of an image/text-box run:
6
+ * - `inline` → no `floating` (the object flows in line with text)
7
+ * - `square`/`tight`/`through`/`topAndBottom` → `floating.wrap` of the same name
8
+ * - `behind` → `wrap:"none"`, `behindDoc:true` (behind the text)
9
+ * - `front` → `wrap:"none"`, `behindDoc:false` (in front of the text)
10
+ */
11
+ export type WrapPreset = "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "front";
12
+ /**
13
+ * Builds the `floating` patch for a given preset, preserving the previous
14
+ * position/offset/distance settings. Returns `undefined` for `inline`, which
15
+ * callers should use to delete the `floating` field entirely.
16
+ */
17
+ export declare function wrapPresetToFloating(prev: EditorImageFloatingLayout | undefined, preset: WrapPreset): EditorImageFloatingLayout | undefined;
18
+ /**
19
+ * Reflects the current `floating` state back to a preset so the popup can mark
20
+ * the active option.
21
+ */
22
+ export declare function floatingToWrapPreset(floating: EditorImageFloatingLayout | undefined): WrapPreset;
23
+ /**
24
+ * Toggles "Move with text" (anchored to the paragraph) vs "Fix position on
25
+ * page" (anchored to the page) by patching the vertical anchor's `relativeFrom`.
26
+ */
27
+ export declare function applyMoveWithText(floating: EditorImageFloatingLayout, fixed: boolean): EditorImageFloatingLayout;
28
+ /** True when the object is pinned to the page rather than moving with text. */
29
+ export declare function isFloatingFixedPosition(floating: EditorImageFloatingLayout | undefined): boolean;
@@ -1,15 +1,23 @@
1
- import { EditorParagraphNode, EditorPosition, EditorState, EditorTextRun, EditorImageRunData } from '../../../model.js';
1
+ import { EditorPosition, EditorState, EditorImageRunData } from '../../../model.js';
2
+ import { SelectedObjectRun } from '../../selectedObjectRun.js';
3
+ import { WrapPreset } from '../../floatingLayout.js';
2
4
 
3
- export interface SelectedImageRun {
4
- paragraph: EditorParagraphNode;
5
- paragraphIndex: number;
6
- run: EditorTextRun;
7
- runIndex: number;
8
- offset: number;
9
- }
5
+ export type SelectedImageRun = SelectedObjectRun;
10
6
  export declare function getSelectedImageRun(state: EditorState): SelectedImageRun | null;
11
7
  export declare function insertImageAtSelection(state: EditorState, image: EditorImageRunData): EditorState;
12
8
  export declare function resizeSelectedImage(state: EditorState, width: number, height: number): EditorState;
9
+ export declare function rotateSelectedImage(state: EditorState, rotation: number): EditorState;
10
+ export declare function getSelectedImageWrapPreset(state: EditorState): WrapPreset | null;
11
+ export declare function isSelectedImageFixedPosition(state: EditorState): boolean;
12
+ export declare function setSelectedImageWrapPreset(state: EditorState, preset: WrapPreset): EditorState;
13
+ export declare function setSelectedImageFixedPosition(state: EditorState, fixed: boolean): EditorState;
14
+ /**
15
+ * Sets the tight/through wrap contour for the image run identified by `runId`.
16
+ * Matches by run id (not the current selection) because the polygon is traced
17
+ * asynchronously and applied after the alpha decode resolves. Passing an empty
18
+ * polygon removes the contour. Selection is preserved.
19
+ */
20
+ export declare function setImageWrapPolygon(state: EditorState, runId: string, polygon: EditorImageRunData["wrapPolygon"]): EditorState;
13
21
  export declare function getSelectedImageAlt(state: EditorState): string | null;
14
22
  export declare function setSelectedImageAlt(state: EditorState, alt: string | null): EditorState;
15
23
  export declare function moveSelectedImageToPosition(state: EditorState, targetPosition: EditorPosition): EditorState;
@@ -1,5 +1,5 @@
1
1
  import { EditorParagraphListStyle, EditorState } from '../../../model.js';
2
- import { ParagraphListKind } from '../../utils.js';
2
+ import { ParagraphListKind } from '../../../textStyle/textStyleKeys.js';
3
3
 
4
4
  export declare function splitListItemAtSelection(state: EditorState): EditorState;
5
5
  export declare function clearParagraphListAtSelection(state: EditorState): EditorState;
@@ -0,0 +1,110 @@
1
+ import { CommandRef } from '../../CommandRef.js';
2
+ import { EditorPageMargins } from '../../../model.js';
3
+
4
+ export interface InsertTablePayload {
5
+ rows: number;
6
+ columns: number;
7
+ }
8
+ export interface SetFontSizePayload {
9
+ size: number | string | null;
10
+ }
11
+ export interface SetPageMarginsPayload extends Partial<EditorPageMargins> {
12
+ }
13
+ export interface OasisCommandPayloads {
14
+ selectAll: undefined;
15
+ insertFootnote: undefined;
16
+ pastePlainText: undefined;
17
+ bold: undefined;
18
+ italic: undefined;
19
+ underline: undefined;
20
+ strike: undefined;
21
+ superscript: undefined;
22
+ subscript: undefined;
23
+ link: string | undefined;
24
+ unlink: undefined;
25
+ alignLeft: undefined;
26
+ alignCenter: undefined;
27
+ alignRight: undefined;
28
+ alignJustify: undefined;
29
+ orderedList: undefined;
30
+ bulletList: undefined;
31
+ find: undefined;
32
+ replace: undefined;
33
+ toggleTrackChanges: undefined;
34
+ acceptRevisions: undefined;
35
+ rejectRevisions: undefined;
36
+ toggleShowMargins: undefined;
37
+ toggleShowParagraphMarks: undefined;
38
+ togglePreciseFonts: undefined;
39
+ undo: undefined;
40
+ redo: undefined;
41
+ pageBreak: undefined;
42
+ lineBreak: undefined;
43
+ splitBlock: undefined;
44
+ setFontFamily: string | null;
45
+ setFontSize: SetFontSizePayload | number | string | null;
46
+ setColor: string | null;
47
+ setHighlight: string | null;
48
+ setTextShading: string | null;
49
+ setStyleId: string;
50
+ setUnderlineStyle: string | null;
51
+ documentStyles: undefined;
52
+ print: undefined;
53
+ copy: undefined;
54
+ exportDocx: undefined;
55
+ exportPdf: undefined;
56
+ importDocument: undefined;
57
+ insertImage: undefined;
58
+ editImageAlt: undefined;
59
+ outdent: undefined;
60
+ indent: undefined;
61
+ togglePageBreakBefore: undefined;
62
+ toggleKeepWithNext: undefined;
63
+ setSpacingAfter: number | null;
64
+ setSpacingBefore: number | null;
65
+ setIndentLeft: number | null;
66
+ setIndentRight: number | null;
67
+ setIndentFirstLine: number | null;
68
+ setIndentHanging: number | null;
69
+ setParagraphShading: string | null;
70
+ applyParagraphBorders: undefined;
71
+ setLineHeight: number | null;
72
+ setListFormat: string;
73
+ setListStartAt: number | null;
74
+ toggleOrientation: undefined;
75
+ sectionBreakNextPage: undefined;
76
+ sectionBreakContinuous: undefined;
77
+ setPageMargins: SetPageMarginsPayload;
78
+ tableContext: undefined;
79
+ tableMerge: undefined;
80
+ tableSplit: undefined;
81
+ tableInsertColumnBefore: undefined;
82
+ tableInsertColumnAfter: undefined;
83
+ tableDeleteColumn: undefined;
84
+ tableInsertRowBefore: undefined;
85
+ tableInsertRowAfter: undefined;
86
+ tableDeleteRow: undefined;
87
+ tableCellShading: string | null;
88
+ tableCellBorders: undefined;
89
+ tableCellNoBorders: undefined;
90
+ tableWidth100: undefined;
91
+ tableAlignLeft: undefined;
92
+ tableAlignCenter: undefined;
93
+ tableAlignRight: undefined;
94
+ tableSetCellWidth: string | number;
95
+ insertTable: InsertTablePayload;
96
+ }
97
+ export interface OasisCommandResults {
98
+ documentStyles: unknown;
99
+ [command: string]: unknown;
100
+ }
101
+ export type OasisCommandName = keyof OasisCommandPayloads & string;
102
+ export type CommandPayloadArgs<TCommand extends OasisCommandName> = OasisCommandPayloads[TCommand] extends undefined ? [payload?: undefined] : [payload: OasisCommandPayloads[TCommand]];
103
+ export interface TypedCommandBus<TState> {
104
+ execute<TCommand extends OasisCommandName>(command: TCommand, ...args: CommandPayloadArgs<TCommand>): TCommand extends keyof OasisCommandResults ? OasisCommandResults[TCommand] : unknown;
105
+ execute(command: CommandRef, payloadOverride?: unknown): unknown;
106
+ canExecute<TCommand extends OasisCommandName>(command: TCommand, ...args: CommandPayloadArgs<TCommand>): boolean;
107
+ canExecute(command: CommandRef, payloadOverride?: unknown): boolean;
108
+ state<TCommand extends OasisCommandName>(command: TCommand): TState;
109
+ state(command: CommandRef): TState;
110
+ }
@@ -0,0 +1,20 @@
1
+ import { EditorParagraphNode, EditorState, EditorTextRun } from '../../../model.js';
2
+
3
+ /**
4
+ * A run holding an inline object (image or text box) that is the sole content
5
+ * of the current selection.
6
+ */
7
+ export interface SelectedObjectRun {
8
+ paragraph: EditorParagraphNode;
9
+ paragraphIndex: number;
10
+ run: EditorTextRun;
11
+ runIndex: number;
12
+ offset: number;
13
+ }
14
+ /**
15
+ * Finds the object run currently selected, when the selection is exactly one
16
+ * object-replacement character wide within a single paragraph. `predicate`
17
+ * decides which kind of object run qualifies (e.g. `run.image` vs
18
+ * `run.textBox`). Returns `null` when the selection is not a single object.
19
+ */
20
+ export declare function getSelectedObjectRun(state: EditorState, predicate: (run: EditorTextRun) => boolean): SelectedObjectRun | null;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from '../../../../../model.js';
2
+
3
+ export declare function insertTableAtSelection(state: EditorState, rows: number, cols: number): EditorState;
@@ -0,0 +1,5 @@
1
+ import { EditorBorderStyle, EditorState, EditorTableCellStyle } from '../../../../../model.js';
2
+
3
+ export declare function setTableCellStyleValue<K extends keyof EditorTableCellStyle>(state: EditorState, key: K, value: EditorTableCellStyle[K] | null): EditorState;
4
+ export declare function setTableCellWidth(state: EditorState, width: number | string | null): EditorState;
5
+ export declare function setTableCellBorders(state: EditorState, border: EditorBorderStyle | null): EditorState;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from '../../../../../model.js';
2
+
3
+ export declare function setTableColumnWidths(state: EditorState, tableId: string, columnWidths: Record<number, number | string>, tableWidth?: number | string, tableIndentLeft?: number | string): EditorState;
@@ -0,0 +1,16 @@
1
+ import { EditorBlockNode, EditorDocument, EditorEditingZone, EditorState, EditorTableNode, TableLocation } from '../../../../../model.js';
2
+
3
+ export type StylePatchValue<T, K extends keyof T> = T[K] | null;
4
+ export interface ActiveTableLocation {
5
+ activeSectionIndex: number;
6
+ loc: TableLocation & {
7
+ zone: EditorEditingZone;
8
+ };
9
+ }
10
+ export declare function patchStyleValue<T extends object, K extends keyof T>(style: T | undefined, key: K, value: StylePatchValue<T, K>): T | undefined;
11
+ export declare function updateStateSections(state: EditorState, updateBlocks: (blocks: EditorBlockNode[]) => EditorBlockNode[]): EditorState;
12
+ export declare function updateTablesInBlocks(blocks: EditorBlockNode[], updateTable: (table: EditorTableNode) => EditorTableNode): EditorBlockNode[];
13
+ export declare function updateNestedTablesInBlocks(blocks: EditorBlockNode[], updateTable: (table: EditorTableNode) => EditorTableNode): EditorBlockNode[];
14
+ export declare function getBlocksForZone(document: EditorDocument, sectionIndex: number, zone: EditorEditingZone): EditorBlockNode[] | undefined;
15
+ export declare function resolveActiveTableLocation(state: EditorState): ActiveTableLocation | null;
16
+ export declare function updateActiveTableBlocks(state: EditorState, updateTable: (table: EditorTableNode) => EditorTableNode): EditorState;
@@ -0,0 +1,5 @@
1
+ import { EditorState, EditorTableRowStyle } from '../../../../../model.js';
2
+
3
+ export declare function setSelectedTableRowStyleValue<K extends keyof EditorTableRowStyle>(state: EditorState, key: K, value: EditorTableRowStyle[K] | null): EditorState;
4
+ export declare function setSelectedTableRowHeader(state: EditorState, value: boolean | null): EditorState;
5
+ export declare function setTableRowHeight(state: EditorState, tableId: string, rowIndex: number, height: number | string | null): EditorState;
@@ -0,0 +1,4 @@
1
+ import { EditorState, EditorTableStyle } from '../../../../../model.js';
2
+
3
+ export declare function setTableStyleValue<K extends keyof EditorTableStyle>(state: EditorState, key: K, value: EditorTableStyle[K] | null): EditorState;
4
+ export declare function setActiveTableStyleValue<K extends keyof EditorTableStyle>(state: EditorState, tableId: string, key: K, value: EditorTableStyle[K] | null): EditorState;
@@ -1,10 +1,5 @@
1
- import { EditorState, EditorTableCellStyle, EditorBorderStyle, EditorTableStyle } from '../../../model.js';
2
-
3
- export declare function setTableCellStyleValue<K extends keyof EditorTableCellStyle>(state: EditorState, key: K, value: EditorTableCellStyle[K] | null): EditorState;
4
- export declare function setTableStyleValue<K extends keyof EditorTableStyle>(state: EditorState, key: K, value: EditorTableStyle[K] | null): EditorState;
5
- export declare function setTableCellWidth(state: EditorState, width: number | string | null): EditorState;
6
- export declare function setTableRowHeight(state: EditorState, tableId: string, rowIndex: number, height: number | string | null): EditorState;
7
- export declare function setTableColumnWidths(state: EditorState, tableId: string, columnWidths: Record<number, number | string>, // visualColumnIndex -> width
8
- tableWidth?: number | string, tableIndentLeft?: number | string): EditorState;
9
- export declare function setTableCellBorders(state: EditorState, border: EditorBorderStyle | null): EditorState;
10
- export declare function insertTableAtSelection(state: EditorState, rows: number, cols: number): EditorState;
1
+ export * from '../../table/tableCellStyleCommands.js';
2
+ export * from '../../table/tableStyleCommands.js';
3
+ export * from '../../table/tableRowCommands.js';
4
+ export * from '../../table/tableColumnCommands.js';
5
+ export * from '../../table/insertTableCommand.js';
@@ -1,5 +1,5 @@
1
1
  import { EditorPosition, EditorState, EditorTextStyle } from '../../../model.js';
2
- import { ToggleableTextStyleKey, ValueTextStyleKey } from '../../utils.js';
2
+ import { ToggleableTextStyleKey, ValueTextStyleKey } from '../../../textStyle/textStyleKeys.js';
3
3
 
4
4
  export declare function moveOrCopySelectionToPosition(state: EditorState, targetPosition: EditorPosition, options?: {
5
5
  copy?: boolean;
@@ -0,0 +1,21 @@
1
+ import { EditorState } from '../../../model.js';
2
+ import { SelectedObjectRun } from '../../selectedObjectRun.js';
3
+ import { WrapPreset } from '../../floatingLayout.js';
4
+
5
+ export type SelectedTextBoxRun = SelectedObjectRun;
6
+ export declare function getSelectedTextBoxRun(state: EditorState): SelectedTextBoxRun | null;
7
+ export interface ResizeTextBoxOptions {
8
+ /**
9
+ * The handle that was dragged (one of the 8 compass directions). Determines
10
+ * which edges move: a west/north drag must shift the floating anchor offset so
11
+ * the opposite (east/south) edge stays fixed, and a height-changing drag
12
+ * disables auto-fit so the manual height sticks.
13
+ */
14
+ handleDirection?: string;
15
+ }
16
+ export declare function rotateSelectedTextBox(state: EditorState, rotation: number): EditorState;
17
+ export declare function getSelectedTextBoxWrapPreset(state: EditorState): WrapPreset | null;
18
+ export declare function isSelectedTextBoxFixedPosition(state: EditorState): boolean;
19
+ export declare function setSelectedTextBoxWrapPreset(state: EditorState, preset: WrapPreset): EditorState;
20
+ export declare function setSelectedTextBoxFixedPosition(state: EditorState, fixed: boolean): EditorState;
21
+ export declare function resizeSelectedTextBox(state: EditorState, width: number, height: number, options?: ResizeTextBoxOptions): EditorState;
@@ -0,0 +1,7 @@
1
+ import { EditorBlockNode, EditorParagraphNode, EditorSection, EditorSelection, EditorState, EditorTableCellNode } from '../../../model.js';
2
+
3
+ export declare function blocksContainTables(nodes: EditorBlockNode[]): boolean;
4
+ export declare function replaceParagraphsInBlocks(blocks: EditorBlockNode[], newParagraphs: EditorParagraphNode[]): EditorBlockNode[];
5
+ export declare function replaceParagraphsInSection(section: EditorSection, paragraphs: EditorParagraphNode[], zone: "main" | "header" | "footer"): EditorSection;
6
+ export declare function cloneStateWithParagraphs(state: EditorState, paragraphs: EditorParagraphNode[], selection: EditorSelection): EditorState;
7
+ export declare function updateTableCellsInBlocks(blocks: EditorBlockNode[], selectedParagraphIds: Set<string>, updateCell: (cell: EditorTableCellNode) => EditorTableCellNode): EditorBlockNode[];
@@ -0,0 +1,8 @@
1
+ import { EditorBookmarks, EditorParagraphNode } from '../../../model.js';
2
+
3
+ /**
4
+ * Remap every bookmark anchor that lives in `oldParagraphs` to its new position
5
+ * in `newParagraphs`. Anchors whose paragraph is not part of this zone are left
6
+ * untouched. Returns the same registry instance when nothing changed.
7
+ */
8
+ export declare function transformBookmarksAcrossParagraphEdit(bookmarks: EditorBookmarks, oldParagraphs: EditorParagraphNode[], newParagraphs: EditorParagraphNode[]): EditorBookmarks;
@@ -0,0 +1,8 @@
1
+ import { EditorBlockNode, EditorParagraphListStyle, EditorParagraphNode, EditorTextBoxData, EditorTextRun } from '../../../model.js';
2
+
3
+ export declare function cloneTextBox(textBox: EditorTextBoxData): EditorTextBoxData;
4
+ export declare function cloneRun(run: EditorTextRun): EditorTextRun;
5
+ export declare function cloneParagraph(paragraph: EditorParagraphNode): EditorParagraphNode;
6
+ export declare function cloneParagraphList(list?: EditorParagraphListStyle): EditorParagraphListStyle | undefined;
7
+ export declare function cloneParagraphs(paragraphs: EditorParagraphNode[]): EditorParagraphNode[];
8
+ export declare function cloneBlocks(blocks: EditorBlockNode[]): EditorBlockNode[];
@@ -0,0 +1,14 @@
1
+ import { EditorParagraphNode, EditorTextRun, EditorTextStyle } from '../../../model.js';
2
+
3
+ export declare function normalizeRuns(runs: EditorTextRun[], fallbackStyles?: EditorTextStyle): EditorTextRun[];
4
+ export declare function buildParagraphFromRuns(paragraph: EditorParagraphNode, runs: EditorTextRun[], fallbackStyles?: EditorTextStyle): EditorParagraphNode;
5
+ export declare function createParagraphFromRuns(textRuns: Array<{
6
+ text: string;
7
+ styles?: EditorTextStyle;
8
+ }>): EditorParagraphNode;
9
+ export declare function createParagraphFromRunsLike(paragraph: EditorParagraphNode, textRuns: Array<{
10
+ text: string;
11
+ styles?: EditorTextStyle;
12
+ }>): EditorParagraphNode;
13
+ export declare function cloneParagraphWithListLevel(paragraph: EditorParagraphNode, level: number): EditorParagraphNode;
14
+ export declare function clearParagraphList(paragraph: EditorParagraphNode): EditorParagraphNode;
@@ -0,0 +1,3 @@
1
+ import { EditorParagraphNode, EditorTextRun } from '../../../model.js';
2
+
3
+ export declare function insertRunsAtOffset(paragraph: EditorParagraphNode, offset: number, textRuns: EditorTextRun[]): EditorParagraphNode;
@@ -0,0 +1,14 @@
1
+ import { EditorParagraphNode, EditorTextRun, EditorTextStyle } from '../../../model.js';
2
+
3
+ export declare function getStyleAtOffset(paragraph: EditorParagraphNode, offset: number): EditorTextStyle | undefined;
4
+ export declare function getRunAtOffset(paragraph: EditorParagraphNode, offset: number): {
5
+ run: EditorTextRun;
6
+ startOffset: number;
7
+ endOffset: number;
8
+ } | null;
9
+ export declare function expandLinkRangeInParagraph(paragraph: EditorParagraphNode, offset: number): {
10
+ href: string;
11
+ startOffset: number;
12
+ endOffset: number;
13
+ } | null;
14
+ export declare function sliceRuns(paragraph: EditorParagraphNode, startOffset: number, endOffset: number): EditorTextRun[];
@@ -0,0 +1,3 @@
1
+ export { buildParagraphFromRuns, clearParagraphList, cloneParagraphWithListLevel, createParagraphFromRuns, createParagraphFromRunsLike, normalizeRuns, } from '../../paragraphRunBuild.js';
2
+ export { expandLinkRangeInParagraph, getRunAtOffset, getStyleAtOffset, sliceRuns, } from '../../paragraphRunQuery.js';
3
+ export { insertRunsAtOffset } from '../../paragraphRunEdit.js';
@@ -2,6 +2,8 @@
2
2
  * @deprecated Use imports from `src/core/commands/*` instead.
3
3
  */
4
4
  export * from '../commands/image.js';
5
+ export * from '../commands/textBox.js';
6
+ export * from '../commands/floatingLayout.js';
5
7
  export * from '../commands/text.js';
6
8
  export * from '../commands/block.js';
7
9
  export * from '../commands/list.js';
@@ -1,13 +1,15 @@
1
- import { EditorAsset, EditorBlockNode, EditorDocument, EditorFootnote, EditorPageSettings, EditorParagraphNode, EditorSection, EditorState, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun, EditorTextStyle, EditorImageRunData, EditorNamedStyle } from '../model.js';
1
+ import { EditorAsset, EditorBlockNode, EditorDocument, EditorFootnote, EditorPageSettings, EditorParagraphNode, EditorSection, EditorState, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun, EditorTextStyle, EditorTextBoxData, EditorImageRunData, EditorNamedStyle } from '../model.js';
2
2
 
3
3
  export declare function resetEditorIds(): void;
4
+ export declare function createEditorBookmarkId(): string;
4
5
  export declare function createEditorRun(text?: string): EditorTextRun;
5
- export declare function createEditorStyledRun(text?: string, styles?: EditorTextStyle, image?: EditorImageRunData): EditorTextRun;
6
+ export declare function createEditorStyledRun(text?: string, styles?: EditorTextStyle, image?: EditorImageRunData, textBox?: EditorTextBoxData): EditorTextRun;
6
7
  export declare function createEditorParagraph(text?: string): EditorParagraphNode;
7
8
  export declare function createEditorParagraphFromRuns(runs: Array<{
8
9
  text: string;
9
10
  styles?: EditorTextStyle;
10
11
  image?: EditorImageRunData;
12
+ textBox?: EditorTextBoxData;
11
13
  }>): EditorParagraphNode;
12
14
  export declare function createEditorTableCell(paragraphs: EditorParagraphNode[], colSpan?: number, options?: {
13
15
  rowSpan?: number;
@@ -26,7 +28,7 @@ export declare function createFootnoteReferenceRun(footnoteId: string, marker: s
26
28
  export declare const DEFAULT_EDITOR_STYLES: Record<string, EditorNamedStyle>;
27
29
  export declare function createEditorDocument(blocks: EditorBlockNode[], pageSettings?: EditorPageSettings, sections?: EditorSection[], styles?: Record<string, EditorNamedStyle>, metadata?: {
28
30
  title?: string;
29
- [key: string]: any;
31
+ [key: string]: unknown;
30
32
  }, assets?: Record<string, EditorAsset>): EditorDocument;
31
33
  export declare function getDocumentCharacterCount(document: EditorDocument): number;
32
34
  export declare function getDocumentWordCount(document: EditorDocument): number;
@@ -0,0 +1,41 @@
1
+ import { EditorBlockNode, EditorDocument, EditorEndnote, EditorEndnotes, EditorParagraphNode, EditorTextRun } from '../model.js';
2
+
3
+ export declare function resetEndnoteIds(): void;
4
+ export declare function createEndnoteId(): string;
5
+ /**
6
+ * Iterate every paragraph in document order (endnote bodies excluded), yielding
7
+ * each endnote reference run with its owning paragraph. Order matches reading
8
+ * order, which is what numbering depends on.
9
+ */
10
+ export declare function iterateEndnoteReferenceRuns(document: EditorDocument): Generator<{
11
+ paragraph: EditorParagraphNode;
12
+ run: EditorTextRun;
13
+ }, void, void>;
14
+ export declare function collectEndnoteReferences(document: EditorDocument): Array<{
15
+ paragraph: EditorParagraphNode;
16
+ run: EditorTextRun;
17
+ }>;
18
+ export declare function getEndnotes(document: EditorDocument): EditorEndnotes | undefined;
19
+ export declare function getEndnoteBlocks(document: EditorDocument, endnoteId: string): EditorBlockNode[];
20
+ export declare function getEndnoteParagraphs(document: EditorDocument, endnoteId: string): EditorParagraphNode[];
21
+ export declare function findEndnoteByParagraphId(document: EditorDocument, paragraphId: string): {
22
+ endnoteId: string;
23
+ endnote: EditorEndnote;
24
+ } | null;
25
+ export declare function findEndnoteReference(document: EditorDocument, endnoteId: string): {
26
+ paragraph: EditorParagraphNode;
27
+ run: EditorTextRun;
28
+ } | null;
29
+ export interface EndnoteReferenceInfo {
30
+ endnoteId: string;
31
+ customMark?: string;
32
+ index: number;
33
+ }
34
+ export declare function listReferencedEndnotes(document: EditorDocument): EndnoteReferenceInfo[];
35
+ /**
36
+ * Rewrite the text of endnote reference runs based on document order. Also
37
+ * removes endnote bodies that no longer have any reference in the document.
38
+ *
39
+ * Returns a new document only if anything actually changed.
40
+ */
41
+ export declare function renumberEndnotes(document: EditorDocument): EditorDocument;
@@ -1,13 +1,28 @@
1
- import { EditorLayoutLine, EditorLayoutFragment, EditorNamedStyle, EditorParagraphNode } from '../model.js';
1
+ import { EditorLayoutLine, EditorLayoutFragment, EditorNamedStyle, EditorParagraphNode, EditorTextStyle } from '../model.js';
2
2
 
3
+ export interface FloatingExclusionRect {
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ wrap: "none" | "square" | "tight" | "through" | "topAndBottom";
9
+ sourceRunId: string;
10
+ /** Absolute-layout-coordinate tight/through contour. When present, the
11
+ * composer carves per-line intervals from this outline instead of the rect. */
12
+ polygon?: Array<{
13
+ x: number;
14
+ y: number;
15
+ }>;
16
+ }
3
17
  export interface TextMeasureOptions {
4
18
  paragraph: EditorParagraphNode;
5
19
  fragments: EditorLayoutFragment[];
6
20
  styles?: Record<string, EditorNamedStyle>;
7
21
  contentWidth?: number;
8
- layoutMode?: "fast" | "wordParity";
22
+ defaultTabStop?: number;
23
+ exclusions?: FloatingExclusionRect[];
9
24
  }
10
25
  export interface ITextMeasurer {
11
26
  composeMeasuredParagraphLines(options: TextMeasureOptions): EditorLayoutLine[];
12
- resolveRenderedLineHeightPx(styles: any, lineHeightMultiple: number): number;
27
+ resolveRenderedLineHeightPx(styles: EditorTextStyle | undefined, lineHeightMultiple: number): number;
13
28
  }
@@ -0,0 +1,17 @@
1
+ import { EditorParagraphListStyle, EditorTextRun, EditorTextStyle } from '../../../model.js';
2
+
3
+ /**
4
+ * Recursively collects inline runs from a DOM node, propagating inherited text
5
+ * styles down the tree. Shared between the clipboard paste parser and the HTML
6
+ * document importer so both treat inline formatting identically.
7
+ *
8
+ * - Text nodes become styled runs.
9
+ * - `<br>` becomes a newline run.
10
+ * - `<img>` becomes an object-replacement run carrying the parsed image data.
11
+ * - Any other element merges its inline styles and recurses into its children.
12
+ */
13
+ export declare function collectInlineRuns(node: Node, inheritedStyle: EditorTextStyle | undefined): EditorTextRun[];
14
+ /** Tags that map to a single editor paragraph. */
15
+ export declare function isParagraphTag(tagName: string): boolean;
16
+ /** Returns the list kind for `<ul>`/`<ol>`, or `null` for other tags. */
17
+ export declare function listKindForTag(tagName: string): EditorParagraphListStyle["kind"] | null;
@@ -0,0 +1 @@
1
+ export declare function escapeHtml(text: string): string;
@@ -0,0 +1,3 @@
1
+ export { parseInlineImage } from '../../inlineImageParser.js';
2
+ export { parseInlineStyles } from '../../inlineStyleParser.js';
3
+ export { parseParagraphStyle } from '../../paragraphStyleParser.js';
@@ -0,0 +1,5 @@
1
+ import { EditorDocument, EditorTextRun } from '../../../model.js';
2
+
3
+ export declare function serializeImageRunToHtml(run: EditorTextRun, document?: Pick<EditorDocument, "assets">): string;
4
+ export declare function serializeTextRunToHtml(run: EditorTextRun, document?: Pick<EditorDocument, "assets">): string;
5
+ export declare function serializeParagraphRunsToHtml(runs: EditorTextRun[], document?: Pick<EditorDocument, "assets">): string;