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
@@ -1,447 +1,10 @@
1
- export type EditorUnderlineStyle = "single" | "double" | "thick" | "dotted" | "dottedHeavy" | "dash" | "dashedHeavy" | "dashLong" | "dashLongHeavy" | "dotDash" | "dashDotHeavy" | "dotDotDash" | "dashDotDotHeavy" | "wave" | "wavyHeavy" | "wavyDouble" | "words";
2
- export type EditorLigatures = "none" | "standard" | "contextual" | "historical" | "standardContextual";
3
- export type EditorNumberSpacing = "default" | "proportional" | "tabular";
4
- export type EditorNumberForm = "default" | "lining" | "oldStyle";
5
- export interface EditorTextStyle {
6
- styleId?: string;
7
- bold?: boolean;
8
- italic?: boolean;
9
- underline?: boolean;
10
- underlineStyle?: EditorUnderlineStyle | null;
11
- underlineColor?: string | null;
12
- strike?: boolean;
13
- doubleStrike?: boolean;
14
- superscript?: boolean;
15
- subscript?: boolean;
16
- smallCaps?: boolean;
17
- allCaps?: boolean;
18
- hidden?: boolean;
19
- characterScale?: number | null;
20
- characterSpacing?: number | null;
21
- baselineShift?: number | null;
22
- kerningThreshold?: number | null;
23
- ligatures?: EditorLigatures | null;
24
- numberSpacing?: EditorNumberSpacing | null;
25
- numberForm?: EditorNumberForm | null;
26
- stylisticSet?: number | null;
27
- contextualAlternates?: boolean;
28
- fontFamily?: string | null;
29
- fontSize?: number | null;
30
- color?: string | null;
31
- highlight?: string | null;
32
- link?: string | null;
33
- }
34
- export interface EditorTabStop {
35
- position: number;
36
- type: "left" | "center" | "right" | "decimal" | "bar" | "clear";
37
- leader?: "none" | "dot" | "hyphen" | "underscore" | "heavy" | "middleDot";
38
- }
39
- export interface EditorParagraphStyle {
40
- styleId?: string;
41
- align?: "left" | "center" | "right" | "justify";
42
- spacingBefore?: number | null;
43
- spacingAfter?: number | null;
44
- lineHeight?: number | null;
45
- lineGridPitch?: number | null;
46
- lineGridType?: "lines" | "linesAndChars" | "snapToChars" | "implicit" | null;
47
- snapToGrid?: boolean;
48
- indentLeft?: number | null;
49
- indentRight?: number | null;
50
- indentFirstLine?: number | null;
51
- indentHanging?: number | null;
52
- shading?: string | null;
53
- borderTop?: EditorBorderStyle | null;
54
- borderRight?: EditorBorderStyle | null;
55
- borderBottom?: EditorBorderStyle | null;
56
- borderLeft?: EditorBorderStyle | null;
57
- tabs?: EditorTabStop[] | null;
58
- pageBreakBefore?: boolean;
59
- keepWithNext?: boolean;
60
- keepLinesTogether?: boolean;
61
- widowControl?: boolean;
62
- }
63
- export interface EditorNamedStyle {
64
- id: string;
65
- name: string;
66
- type: "paragraph" | "character" | "table";
67
- basedOn?: string;
68
- nextStyle?: string;
69
- paragraphStyle?: EditorParagraphStyle;
70
- textStyle?: EditorTextStyle;
71
- tableStyle?: EditorTableStyle;
72
- }
73
- export interface EditorParagraphListStyle {
74
- kind: "bullet" | "ordered";
75
- level?: number;
76
- format?: "decimal" | "lowerLetter" | "upperLetter" | "lowerRoman" | "upperRoman" | "bullet";
77
- startAt?: number;
78
- }
79
- export interface EditorImageRunData {
80
- src: string;
81
- width: number;
82
- height: number;
83
- alt?: string;
84
- }
85
- export interface EditorFieldData {
86
- type: "PAGE" | "NUMPAGES";
87
- }
88
1
  /**
89
- * Inline reference to a footnote body stored in `EditorDocument.footnotes`.
90
- * The `run.text` carries the materialized marker (e.g. "1", "2", "*") so
91
- * layout, hit-testing and export can treat the run as ordinary text.
2
+ * Re-export the refactored model module under its original path.
92
3
  *
93
- * Renumbering rewrites `run.text` to keep markers in sync with document
94
- * order. `customMark` (mapped from DOCX `w:customMarkFollows`) signals a
95
- * user-provided marker that should not be auto-numbered.
4
+ * The 1411-line monolithic `model.ts` was split into focused modules under
5
+ * `./model/` (types, queries, styleResolution, pageGeometry, documentIndex,
6
+ * editingZones, etc.). This file is now a one-liner barrel so the 43+
7
+ * existing `import { ... } from "../model.js"` sites continue to work
8
+ * without any change.
96
9
  */
97
- export interface EditorFootnoteReferenceData {
98
- footnoteId: string;
99
- customMark?: string;
100
- }
101
- export interface EditorRevision {
102
- id: string;
103
- type: "insert" | "delete";
104
- author: string;
105
- date: number;
106
- }
107
- export interface EditorTextRun {
108
- id: string;
109
- text: string;
110
- styles?: EditorTextStyle;
111
- image?: EditorImageRunData;
112
- field?: EditorFieldData;
113
- revision?: EditorRevision;
114
- /**
115
- * When set, this run is the inline marker of a footnote whose body lives in
116
- * `EditorDocument.footnotes.items[footnoteReference.footnoteId]`. The run
117
- * should be treated as atomic for selection/editing purposes.
118
- */
119
- footnoteReference?: EditorFootnoteReferenceData;
120
- }
121
- export interface EditorParagraphNode {
122
- id: string;
123
- type: "paragraph";
124
- runs: EditorTextRun[];
125
- style?: EditorParagraphStyle;
126
- list?: EditorParagraphListStyle;
127
- }
128
- export interface EditorBorderStyle {
129
- width: number;
130
- type: "solid" | "dashed" | "dotted" | "none";
131
- color: string;
132
- }
133
- export interface EditorTableCellStyle {
134
- shading?: string;
135
- width?: number | string;
136
- borderTop?: EditorBorderStyle;
137
- borderRight?: EditorBorderStyle;
138
- borderBottom?: EditorBorderStyle;
139
- borderLeft?: EditorBorderStyle;
140
- padding?: number;
141
- paddingTop?: number;
142
- paddingRight?: number;
143
- paddingBottom?: number;
144
- paddingLeft?: number;
145
- verticalAlign?: "top" | "middle" | "bottom";
146
- horizontalAlign?: "left" | "center" | "right" | "justify";
147
- }
148
- export interface EditorTableCellNode {
149
- id: string;
150
- blocks: EditorParagraphNode[];
151
- colSpan?: number;
152
- rowSpan?: number;
153
- vMerge?: "restart" | "continue";
154
- style?: EditorTableCellStyle;
155
- }
156
- export interface EditorTableRowStyle {
157
- height?: number | string;
158
- }
159
- export interface EditorTableRowNode {
160
- id: string;
161
- cells: EditorTableCellNode[];
162
- isHeader?: boolean;
163
- style?: EditorTableRowStyle;
164
- }
165
- export interface EditorTableStyle {
166
- styleId?: string;
167
- width?: number | string;
168
- align?: "left" | "center" | "right";
169
- indentLeft?: number;
170
- pageBreakBefore?: boolean;
171
- }
172
- export interface EditorTableNode {
173
- id: string;
174
- type: "table";
175
- rows: EditorTableRowNode[];
176
- gridCols?: number[];
177
- style?: EditorTableStyle;
178
- }
179
- export type EditorBlockNode = EditorParagraphNode | EditorTableNode;
180
- export interface EditorPageMargins {
181
- top: number;
182
- right: number;
183
- bottom: number;
184
- left: number;
185
- header: number;
186
- footer: number;
187
- gutter: number;
188
- }
189
- export interface EditorPageSettings {
190
- width: number;
191
- height: number;
192
- orientation?: "portrait" | "landscape";
193
- margins: EditorPageMargins;
194
- }
195
- export interface EditorSection {
196
- id: string;
197
- blocks: EditorBlockNode[];
198
- pageSettings: EditorPageSettings;
199
- header?: EditorBlockNode[];
200
- firstPageHeader?: EditorBlockNode[];
201
- evenPageHeader?: EditorBlockNode[];
202
- footer?: EditorBlockNode[];
203
- firstPageFooter?: EditorBlockNode[];
204
- evenPageFooter?: EditorBlockNode[];
205
- breakType?: "nextPage" | "continuous";
206
- }
207
- /**
208
- * An out-of-band asset bundled with the document (e.g. an embedded image).
209
- * Heavy binary data (data URLs) lives here exactly once; runs reference it
210
- * via `image.src = "asset:<id>"`. Keeping payloads off the per-paragraph
211
- * state lets equality checks, signatures and clones stay cheap on every
212
- * keystroke even when a document embeds large images.
213
- */
214
- export interface EditorAsset {
215
- id: string;
216
- /** Full data URL (e.g. `data:image/png;base64,...`) or remote URL. */
217
- url: string;
218
- }
219
- export declare const EDITOR_ASSET_REF_PREFIX = "asset:";
220
- export type EditorFootnoteNumberFormat = "decimal" | "lowerRoman" | "upperRoman" | "lowerLetter" | "upperLetter" | "symbol";
221
- export type EditorFootnoteRestart = "continuous" | "eachSection";
222
- /**
223
- * Body of a single footnote. `blocks` is fully editable, mirroring the
224
- * shape of a section's main content. The DOCX `<w:footnoteRef/>` marker
225
- * inside the body is NOT stored here — render/export reinjects it.
226
- */
227
- export interface EditorFootnote {
228
- id: string;
229
- blocks: EditorBlockNode[];
230
- /** Original DOCX `w:id`, kept for round-trip diagnostics only. */
231
- docxId?: number;
232
- }
233
- export interface EditorFootnoteSettings {
234
- numberFormat?: EditorFootnoteNumberFormat;
235
- restart?: EditorFootnoteRestart;
236
- startAt?: number;
237
- }
238
- export interface EditorFootnotes {
239
- items: Record<string, EditorFootnote>;
240
- settings?: EditorFootnoteSettings;
241
- /** Optional imported separator part (Fase futura: render/export). */
242
- separator?: EditorBlockNode[];
243
- /** Optional imported continuation separator part (Fase futura). */
244
- continuationSeparator?: EditorBlockNode[];
245
- }
246
- export interface EditorDocument {
247
- id: string;
248
- pageSettings?: EditorPageSettings;
249
- sections?: EditorSection[];
250
- styles?: Record<string, EditorNamedStyle>;
251
- /**
252
- * Out-of-band asset registry. Image runs reference entries here using
253
- * `src = "asset:<id>"`. The map itself is treated as append-only and is
254
- * deliberately excluded from per-keystroke equality checks/signatures.
255
- */
256
- assets?: Record<string, EditorAsset>;
257
- /**
258
- * Footnote bodies keyed by id. Inline references live in
259
- * `EditorTextRun.footnoteReference` and point here. May be undefined when
260
- * the document has no notes.
261
- */
262
- footnotes?: EditorFootnotes;
263
- metadata?: {
264
- title?: string;
265
- [key: string]: any;
266
- };
267
- }
268
- export { getParagraphLength, getParagraphText, getRunIndex, getRunStartOffset, paragraphOffsetToPosition, positionToParagraphOffset, } from '../model/queries.js';
269
- /**
270
- * Resolve an `asset:<id>` reference (or pass through any other src) to the
271
- * actual URL using the document's asset registry.
272
- */
273
- export declare function resolveImageSrc(document: Pick<EditorDocument, "assets"> | undefined, src: string | undefined): string;
274
- export declare const EFFECTIVE_TEXT_STYLE_DEFAULTS: Required<EditorTextStyle>;
275
- export declare const EFFECTIVE_PARAGRAPH_STYLE_DEFAULTS: Required<EditorParagraphStyle>;
276
- export declare function resolveNamedTextStyle(styleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorTextStyle;
277
- export declare function resolveNamedParagraphStyle(styleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorParagraphStyle;
278
- /**
279
- * Resolve the effective text style for a run:
280
- * 1. Resolve named style via styleId + basedOn chain
281
- * 2. Apply local overrides (undefined → inherit, null → keep as null for reset)
282
- * 3. Fill in system defaults for any remaining undefined values
283
- */
284
- export declare function resolveEffectiveTextStyle(style: EditorTextStyle | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorTextStyle>;
285
- /**
286
- * Resolve the effective text style for a run, inheriting textStyle from the
287
- * paragraph named style when the run does not override it locally.
288
- */
289
- export declare function resolveEffectiveTextStyleForParagraph(style: EditorTextStyle | undefined, paragraphStyleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorTextStyle>;
290
- /**
291
- * Resolve the effective paragraph style:
292
- * 1. Resolve named style via styleId + basedOn chain
293
- * 2. Apply local overrides (undefined → inherit, null → keep as null for reset)
294
- * 3. Fill in system defaults for any remaining undefined values
295
- */
296
- export declare function resolveEffectiveParagraphStyle(style: EditorParagraphStyle | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorParagraphStyle>;
297
- export interface EditorPosition {
298
- paragraphId: string;
299
- runId: string;
300
- offset: number;
301
- }
302
- export interface EditorSelection {
303
- anchor: EditorPosition;
304
- focus: EditorPosition;
305
- }
306
- export type EditorEditingZone = "main" | "header" | "footer" | "footnote";
307
- export interface EditorState {
308
- document: EditorDocument;
309
- selection: EditorSelection;
310
- activeSectionIndex?: number;
311
- activeZone?: EditorEditingZone;
312
- /**
313
- * Identifies the footnote currently being edited when `activeZone === "footnote"`.
314
- * Ignored for other zones.
315
- */
316
- activeFootnoteId?: string;
317
- trackChangesEnabled?: boolean;
318
- showMargins?: boolean;
319
- showParagraphMarks?: boolean;
320
- }
321
- export interface EditorCaretSlot {
322
- paragraphId: string;
323
- offset: number;
324
- left: number;
325
- top: number;
326
- height: number;
327
- }
328
- export interface EditorLayoutFragmentChar {
329
- char: string;
330
- paragraphOffset: number;
331
- runOffset: number;
332
- }
333
- export interface EditorLayoutFragment {
334
- paragraphId: string;
335
- runId: string;
336
- startOffset: number;
337
- endOffset: number;
338
- text: string;
339
- styles?: EditorTextStyle;
340
- image?: EditorImageRunData;
341
- revision?: EditorRevision;
342
- chars: EditorLayoutFragmentChar[];
343
- }
344
- export interface EditorLayoutLine {
345
- paragraphId: string;
346
- index: number;
347
- startOffset: number;
348
- endOffset: number;
349
- top: number;
350
- height: number;
351
- slots: EditorCaretSlot[];
352
- fragments: EditorLayoutFragment[];
353
- }
354
- export interface EditorLayoutParagraph {
355
- paragraphId: string;
356
- text: string;
357
- fragments: EditorLayoutFragment[];
358
- lines: EditorLayoutLine[];
359
- startOffset?: number;
360
- endOffset?: number;
361
- contentWidth?: number;
362
- }
363
- export interface EditorLayoutBlock {
364
- blockId: string;
365
- blockType: EditorBlockNode["type"];
366
- paragraphId?: string;
367
- globalIndex: number;
368
- estimatedHeight: number;
369
- layout?: EditorLayoutParagraph;
370
- tableSegment?: {
371
- startRowIndex: number;
372
- endRowIndex: number;
373
- repeatedHeaderRowCount: number;
374
- };
375
- sourceBlockId?: string;
376
- sourceBlock: EditorBlockNode;
377
- }
378
- export interface EditorLayoutPage {
379
- id: string;
380
- index: number;
381
- height: number;
382
- maxHeight: number;
383
- blocks: EditorLayoutBlock[];
384
- pageSettings: EditorPageSettings;
385
- headerBlocks?: EditorLayoutBlock[];
386
- footerBlocks?: EditorLayoutBlock[];
387
- footnoteBlocks?: EditorLayoutBlock[];
388
- footnoteReferenceIds?: string[];
389
- bodyTop?: number;
390
- bodyBottom?: number;
391
- headerTop?: number;
392
- footerTop?: number;
393
- footnoteTop?: number;
394
- footnoteSeparatorTop?: number;
395
- }
396
- export interface EditorLayoutDocument {
397
- pages: EditorLayoutPage[];
398
- }
399
- export declare const DEFAULT_EDITOR_PAGE_SETTINGS: EditorPageSettings;
400
- export declare function normalizePageSettings(pageSettings: EditorPageSettings): EditorPageSettings;
401
- export declare function getDocumentPageSettings(document: EditorDocument): EditorPageSettings;
402
- export declare function getPageContentWidth(pageSettings: EditorPageSettings): number;
403
- export declare function getPageHeaderZoneTop(pageSettings: EditorPageSettings): number;
404
- export declare function getPageBodyTop(pageSettings: EditorPageSettings): number;
405
- export declare function getPageFooterReferenceTop(pageSettings: EditorPageSettings): number;
406
- export declare function getPageBodyBottom(pageSettings: EditorPageSettings): number;
407
- export declare function getPageHeaderZoneHeight(pageSettings: EditorPageSettings): number;
408
- export declare function getPageFooterZoneTop(pageSettings: EditorPageSettings): number;
409
- export declare function getPageFooterZoneHeight(pageSettings: EditorPageSettings): number;
410
- export declare function getPageContentHeight(pageSettings: EditorPageSettings): number;
411
- export declare function getDocumentSectionsCanonical(document: EditorDocument): EditorSection[];
412
- export declare function getDocumentSections(document: EditorDocument): EditorSection[];
413
- export declare function getEditableBlocksForZone(state: EditorState, zone: EditorEditingZone): EditorBlockNode[];
414
- export declare function getActiveSectionBlocks(state: EditorState): EditorBlockNode[];
415
- export declare function getBlockParagraphs(block: EditorBlockNode): EditorParagraphNode[];
416
- export declare function getDocumentParagraphsCanonical(document: EditorDocument): EditorParagraphNode[];
417
- export declare function getDocumentParagraphs(document: EditorDocument): EditorParagraphNode[];
418
- export declare function getParagraphs(state: EditorState): EditorParagraphNode[];
419
- export declare function getActiveSectionIndex(state: EditorState): number;
420
- export declare function getActiveZone(state: EditorState): EditorEditingZone;
421
- export interface EditorParagraphLocation {
422
- sectionIndex: number;
423
- zone: EditorEditingZone;
424
- paragraphIndexInSection: number;
425
- /** When `zone === "footnote"`, identifies which footnote owns the paragraph. */
426
- footnoteId?: string;
427
- }
428
- export interface DocumentParagraphIndexEntry {
429
- paragraph: EditorParagraphNode;
430
- location: EditorParagraphLocation;
431
- tableLocation: {
432
- blockIndex: number;
433
- rowIndex: number;
434
- cellIndex: number;
435
- paragraphIndex: number;
436
- } | null;
437
- }
438
- export declare function getDocumentParagraphIndex(document: EditorDocument): Map<string, DocumentParagraphIndexEntry>;
439
- export declare function getParagraphById(document: EditorDocument, paragraphId: string): EditorParagraphNode | undefined;
440
- export declare function findParagraphLocation(document: EditorDocument, paragraphId: string): EditorParagraphLocation | null;
441
- export declare function findParagraphTableLocation(document: EditorDocument, paragraphId: string, activeSectionIndex?: number): {
442
- blockIndex: number;
443
- rowIndex: number;
444
- cellIndex: number;
445
- paragraphIndex: number;
446
- zone: EditorEditingZone;
447
- } | null;
10
+ export * from '../model/index.js';
@@ -1,17 +1,29 @@
1
+ import { JSX } from '../solid-js';
1
2
  import { EditorState } from '../model.js';
2
3
  import { Editor } from '../Editor.js';
3
4
  import { CommandRef } from '../commands/CommandRef.js';
4
5
 
5
6
  export type Unsubscribe = () => void;
7
+ export interface OasisCommandContext {
8
+ editor: OasisEditor;
9
+ commands: OasisCommandRegistry;
10
+ ui: OasisPluginUiRegistry;
11
+ getState(): EditorState;
12
+ getDocument(): EditorState["document"];
13
+ getSelection(): EditorState["selection"];
14
+ }
6
15
  export interface OasisCommand<TPayload = unknown, TResult = unknown> {
7
- execute: (payload?: TPayload) => TResult;
8
- refresh?: (payload?: TPayload) => CommandState;
16
+ execute: (payload?: TPayload, context?: OasisCommandContext) => TResult;
17
+ refresh?: (payload?: TPayload, context?: OasisCommandContext) => CommandState;
9
18
  }
10
19
  export interface OasisCommandRegistry {
11
20
  register: <TPayload = unknown, TResult = unknown>(name: string, command: OasisCommand<TPayload, TResult>) => void;
12
21
  unregister: (name: string) => void;
13
22
  get: (name: string) => OasisCommand | undefined;
14
23
  has: (name: string) => boolean;
24
+ execute: <TPayload = unknown, TResult = unknown>(name: string, payload?: TPayload) => TResult;
25
+ canExecute: (name: string, payload?: unknown) => boolean;
26
+ state: (name: string, payload?: unknown) => CommandState;
15
27
  }
16
28
  export interface CommandState {
17
29
  isEnabled: boolean;
@@ -21,10 +33,7 @@ export interface CommandState {
21
33
  export interface OasisEditor {
22
34
  readonly state: EditorState;
23
35
  readonly commands: OasisCommandRegistry;
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;
36
+ readonly ui: OasisPluginUiRegistry;
28
37
  on: (event: string, callback: (...args: unknown[]) => void) => Unsubscribe;
29
38
  once: (event: string, callback: (...args: unknown[]) => void) => Unsubscribe;
30
39
  off: (event: string, callback: (...args: unknown[]) => void) => void;
@@ -42,6 +51,49 @@ export interface PluginMenuItem extends PluginAction {
42
51
  separator?: boolean;
43
52
  labelKey?: string;
44
53
  }
54
+ export type FloatingActionScope = "container" | "viewport";
55
+ export type FloatingActionPlacement = "bottom-right" | "bottom-left" | "top-right" | "top-left";
56
+ export interface FloatingActionContribution extends PluginAction {
57
+ label?: string;
58
+ labelKey?: string;
59
+ tooltip?: string;
60
+ scope?: FloatingActionScope;
61
+ placement?: FloatingActionPlacement;
62
+ order?: number;
63
+ }
64
+ export type SidePanelMode = "dock" | "overlay";
65
+ export interface PluginUiRenderContext extends OasisCommandContext {
66
+ panelId?: string;
67
+ closePanel?: () => void;
68
+ }
69
+ export interface SidePanelContribution {
70
+ id: string;
71
+ title: string;
72
+ titleKey?: string;
73
+ icon?: string;
74
+ mode?: SidePanelMode;
75
+ width?: number | string;
76
+ order?: number;
77
+ render: (context: PluginUiRenderContext) => JSX.Element;
78
+ }
79
+ export interface OasisPluginUiContributions {
80
+ floatingActions?: FloatingActionContribution[];
81
+ sidePanels?: SidePanelContribution[];
82
+ }
83
+ export interface OasisPluginUiSnapshot {
84
+ floatingActions: FloatingActionContribution[];
85
+ sidePanels: SidePanelContribution[];
86
+ activeSidePanelId: string | null;
87
+ }
88
+ export interface OasisPluginUiRegistry {
89
+ registerFloatingAction(contribution: FloatingActionContribution): Unsubscribe;
90
+ registerSidePanel(contribution: SidePanelContribution): Unsubscribe;
91
+ openSidePanel(id: string): void;
92
+ closeSidePanel(id?: string): void;
93
+ toggleSidePanel(id: string): void;
94
+ getSnapshot(): OasisPluginUiSnapshot;
95
+ onChange(callback: () => void): Unsubscribe;
96
+ }
45
97
  export interface OasisPlugin {
46
98
  name: string;
47
99
  requires?: PluginReference[];
@@ -56,6 +108,7 @@ export interface OasisPlugin {
56
108
  }>;
57
109
  toolbar?: PluginAction[];
58
110
  menubar?: PluginMenuItem[];
111
+ ui?: OasisPluginUiContributions;
59
112
  init?: (editor: OasisEditor) => void | Promise<void>;
60
113
  afterInit?: (editor: OasisEditor) => void | Promise<void>;
61
114
  destroy?: (editor: OasisEditor) => void | Promise<void>;
@@ -11,6 +11,7 @@ export declare class PluginCollection {
11
11
  initializeAll(): Promise<void>;
12
12
  private initializePlugin;
13
13
  private registerPluginCommands;
14
+ private registerPluginUi;
14
15
  destroy(): Promise<void>;
15
16
  getPlugins(): OasisPlugin[];
16
17
  }
@@ -0,0 +1,20 @@
1
+ import { FloatingActionContribution, OasisPluginUiRegistry, OasisPluginUiSnapshot, SidePanelContribution, Unsubscribe } from '../../../plugin.js';
2
+
3
+ export declare class PluginUiRegistry implements OasisPluginUiRegistry {
4
+ private floatingActions;
5
+ private sidePanels;
6
+ private activeSidePanelId;
7
+ private listeners;
8
+ registerFloatingAction(contribution: FloatingActionContribution): Unsubscribe;
9
+ registerSidePanel(contribution: SidePanelContribution): Unsubscribe;
10
+ openSidePanel(id: string): void;
11
+ closeSidePanel(id?: string): void;
12
+ toggleSidePanel(id: string): void;
13
+ getSnapshot(): OasisPluginUiSnapshot;
14
+ onChange(callback: () => void): Unsubscribe;
15
+ clear(): void;
16
+ private unregisterFloatingAction;
17
+ private unregisterSidePanel;
18
+ private sort;
19
+ private emit;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { EditorState } from '../../../model.js';
2
+
3
+ export declare function moveVertical(state: EditorState, delta: -1 | 1): EditorState;
4
+ export declare function moveFocusHorizontally(state: EditorState, delta: -1 | 1): EditorState;
5
+ export declare function moveFocusVertical(state: EditorState, delta: -1 | 1): EditorState;
@@ -0,0 +1,13 @@
1
+ import { EditorParagraphNode, EditorPosition, EditorSelection, EditorState, EditorTextRun } from '../../../model.js';
2
+ import { normalizeSelection } from '../../../selection.js';
3
+
4
+ export declare function withSelection(position: EditorPosition): EditorSelection;
5
+ export declare function getFocusParagraph(state: EditorState): {
6
+ paragraph: EditorParagraphNode;
7
+ index: number;
8
+ offset: number;
9
+ };
10
+ export declare function deleteSelectionRange(state: EditorState): EditorState;
11
+ export declare function mapRunsInRange(paragraph: EditorParagraphNode, startOffset: number, endOffset: number, mapper: (run: EditorTextRun) => EditorTextRun): EditorParagraphNode;
12
+ export declare function preserveSelectionByParagraphOffsets(paragraphs: EditorParagraphNode[], normalized: ReturnType<typeof normalizeSelection>): EditorSelection;
13
+ export declare function collapseToBoundary(state: EditorState, direction: "start" | "end"): EditorState;
@@ -0,0 +1,6 @@
1
+ import { EditorParagraphListStyle } from '../../../model.js';
2
+
3
+ export type ToggleableTextStyleKey = "bold" | "italic" | "underline" | "strike" | "doubleStrike" | "superscript" | "subscript" | "smallCaps" | "allCaps" | "hidden" | "noProof" | "webHidden" | "specVanish" | "contextualAlternates";
4
+ export type ValueTextStyleKey = "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
5
+ export type ValueParagraphStyleKey = "styleId" | "align" | "spacingBefore" | "spacingAfter" | "lineHeight" | "indentLeft" | "indentRight" | "indentFirstLine" | "indentHanging" | "shading" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "tabs" | "pageBreakBefore" | "keepWithNext";
6
+ export type ParagraphListKind = EditorParagraphListStyle["kind"];
@@ -0,0 +1,8 @@
1
+ import { EditorParagraphStyle, EditorTextStyle } from '../../../model.js';
2
+ import { ToggleableTextStyleKey, ValueParagraphStyleKey, ValueTextStyleKey } from '../../textStyleKeys.js';
3
+
4
+ export declare function cloneStyle(style?: EditorTextStyle): EditorTextStyle | undefined;
5
+ export declare function stylesEqual(left?: EditorTextStyle, right?: EditorTextStyle): boolean;
6
+ export declare function setBooleanStyle(style: EditorTextStyle | undefined, key: ToggleableTextStyleKey, enabled: boolean): EditorTextStyle | undefined;
7
+ export declare function setValueStyle<K extends ValueTextStyleKey>(style: EditorTextStyle | undefined, key: K, value: EditorTextStyle[K] | null): EditorTextStyle | undefined;
8
+ export declare function setParagraphStyleValue<K extends ValueParagraphStyleKey>(style: EditorParagraphStyle | undefined, key: K, value: EditorParagraphStyle[K] | null): EditorParagraphStyle | undefined;
@@ -0,0 +1,21 @@
1
+ import { EditorDocument } from '../../../../core/model.js';
2
+
3
+ export interface BookmarkBoundaryEvent {
4
+ kind: "start" | "end";
5
+ /** Character offset into the paragraph's flattened text. */
6
+ offset: number;
7
+ /** Stable emit order for boundaries that share an offset. */
8
+ seq: number;
9
+ /** Allocated DOCX `w:id`. */
10
+ wId: number;
11
+ name?: string;
12
+ colFirst?: number;
13
+ colLast?: number;
14
+ }
15
+ export type BookmarkEventsByParagraph = Map<string, BookmarkBoundaryEvent[]>;
16
+ /**
17
+ * Allocate unique numeric `w:id`s (preferring each bookmark's imported hint)
18
+ * and group start/end boundary events by paragraph id.
19
+ */
20
+ export declare function buildBookmarkExportPlan(document: EditorDocument): BookmarkEventsByParagraph | undefined;
21
+ export declare function serializeBookmarkEvent(event: BookmarkBoundaryEvent): string;
@@ -0,0 +1,25 @@
1
+ import { EditorBorderStyle } from '../../../../core/model.js';
2
+
3
+ /**
4
+ * Serializes a concrete border into the attribute string that follows a border
5
+ * edge element name, e.g. the `w:val="single" w:sz="8" .../>` part of
6
+ * `<w:top w:val="single" .../>`. Shared by table-cell borders (`w:tcBorders`)
7
+ * and paragraph borders (`w:pBdr`).
8
+ *
9
+ * `w:sz` is in eighths of a point. A `none`/zero-width border becomes `nil`.
10
+ */
11
+ export declare function serializeDocxBorderAttrs(border: EditorBorderStyle, colorFallback?: string): string;
12
+ interface EditorBoxBorders {
13
+ borderTop?: EditorBorderStyle | null;
14
+ borderRight?: EditorBorderStyle | null;
15
+ borderBottom?: EditorBorderStyle | null;
16
+ borderLeft?: EditorBorderStyle | null;
17
+ }
18
+ /**
19
+ * Serializes a `w:pBdr` element for the defined paragraph border edges. Returns
20
+ * an empty string when no edge is set so callers can skip it. Unlike table
21
+ * cells (which always emit all four edges with defaults), paragraph borders only
22
+ * emit the edges that are actually present.
23
+ */
24
+ export declare function serializeParagraphBorders(style: EditorBoxBorders): string;
25
+ export {};