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
@@ -0,0 +1,3 @@
1
+ import { EditorImageRunData } from '../../../model.js';
2
+
3
+ export declare function parseInlineImage(element: Element): EditorImageRunData | undefined;
@@ -0,0 +1,3 @@
1
+ import { EditorTextStyle } from '../../../model.js';
2
+
3
+ export declare function parseInlineStyles(element: Element): EditorTextStyle | undefined;
@@ -0,0 +1,3 @@
1
+ import { EditorParagraphStyle } from '../../../model.js';
2
+
3
+ export declare function parseParagraphStyle(element: Element): EditorParagraphStyle | undefined;
@@ -0,0 +1,5 @@
1
+ import { EditorParagraphStyle, EditorTextStyle } from '../../../model.js';
2
+
3
+ export declare function textRunStylesToCss(style?: EditorTextStyle): string;
4
+ export declare function getPrimaryTextLanguage(language: EditorTextStyle["language"]): string | null;
5
+ export declare function paragraphStyleToCssText(style?: EditorParagraphStyle): string;
@@ -0,0 +1,7 @@
1
+ import { EditorDocument } from '../../types/document.js';
2
+
3
+ /**
4
+ * Resolve an `asset:<id>` reference (or pass through any other src) to the
5
+ * actual URL using the document's asset registry.
6
+ */
7
+ export declare function resolveImageSrc(document: Pick<EditorDocument, "assets"> | undefined, src: string | undefined): string;
@@ -0,0 +1,58 @@
1
+ import { EditorParagraphNode } from '../../types/nodes.js';
2
+ import { EditorDocument } from '../../types/document.js';
3
+ import { EditorEditingZone } from '../../types/selection.js';
4
+
5
+ export interface EditorParagraphLocation {
6
+ sectionIndex: number;
7
+ zone: EditorEditingZone;
8
+ paragraphIndexInSection: number;
9
+ /** When `zone === "footnote"`, identifies which footnote owns the paragraph. */
10
+ footnoteId?: string;
11
+ }
12
+ export interface TableLocation {
13
+ blockIndex: number;
14
+ rowIndex: number;
15
+ cellIndex: number;
16
+ paragraphIndex: number;
17
+ }
18
+ export interface DocumentParagraphIndexEntry {
19
+ paragraph: EditorParagraphNode;
20
+ location: EditorParagraphLocation;
21
+ tableLocation: TableLocation | null;
22
+ }
23
+ export declare class DocumentIndexBuilder {
24
+ private readonly document;
25
+ private readonly index;
26
+ constructor(document: EditorDocument);
27
+ build(): Map<string, DocumentParagraphIndexEntry>;
28
+ private indexZone;
29
+ private indexBlock;
30
+ private recordParagraph;
31
+ private indexFootnotes;
32
+ }
33
+ /**
34
+ * Cache abstraction so tests can deterministically seed or inspect the
35
+ * document index without going through WeakMap semantics.
36
+ */
37
+ export interface DocumentIndexCache {
38
+ getIndex(document: EditorDocument): Map<string, DocumentParagraphIndexEntry> | undefined;
39
+ setIndex(document: EditorDocument, index: Map<string, DocumentParagraphIndexEntry>): void;
40
+ getParagraphs(document: EditorDocument): EditorParagraphNode[] | undefined;
41
+ setParagraphs(document: EditorDocument, paragraphs: EditorParagraphNode[]): void;
42
+ }
43
+ export declare class WeakMapDocumentIndexCache implements DocumentIndexCache {
44
+ private readonly indexMap;
45
+ private readonly paragraphsMap;
46
+ getIndex(document: EditorDocument): Map<string, DocumentParagraphIndexEntry> | undefined;
47
+ setIndex(document: EditorDocument, index: Map<string, DocumentParagraphIndexEntry>): void;
48
+ getParagraphs(document: EditorDocument): EditorParagraphNode[] | undefined;
49
+ setParagraphs(document: EditorDocument, paragraphs: EditorParagraphNode[]): void;
50
+ }
51
+ export declare function getDocumentParagraphIndex(document: EditorDocument): Map<string, DocumentParagraphIndexEntry>;
52
+ export declare function getDocumentParagraphsCanonical(document: EditorDocument): EditorParagraphNode[];
53
+ export declare function getDocumentParagraphs(document: EditorDocument): EditorParagraphNode[];
54
+ export declare function getParagraphById(document: EditorDocument, paragraphId: string): EditorParagraphNode | undefined;
55
+ export declare function findParagraphLocation(document: EditorDocument, paragraphId: string): EditorParagraphLocation | null;
56
+ export declare function findParagraphTableLocation(document: EditorDocument, paragraphId: string, activeSectionIndex?: number): (TableLocation & {
57
+ zone: EditorEditingZone;
58
+ }) | null;
@@ -0,0 +1,4 @@
1
+ import { EditorDocument, EditorSection } from '../../types/document.js';
2
+
3
+ export declare function getDocumentSectionsCanonical(document: EditorDocument): EditorSection[];
4
+ export declare function getDocumentSections(document: EditorDocument): EditorSection[];
@@ -0,0 +1,26 @@
1
+ import { EditorBlockNode, EditorParagraphNode } from '../../types/nodes.js';
2
+ import { EditorState } from '../../editorState.js';
3
+ import { EditorEditingZone } from '../../types/selection.js';
4
+
5
+ export declare function getActiveSectionIndex(state: EditorState): number;
6
+ export declare function getActiveZone(state: EditorState): EditorEditingZone;
7
+ /**
8
+ * Strict variant: returns `null` when the state is invalid for the zone
9
+ * (e.g. footnote zone with no active footnote id). Use this when you
10
+ * need to distinguish a legitimate empty blocks list from "no such
11
+ * editing zone available right now".
12
+ */
13
+ export declare function tryGetEditableBlocksForZone(state: EditorState, zone: EditorEditingZone): EditorBlockNode[] | null;
14
+ /**
15
+ * Always returns an array. Falls back to `[]` when the state is invalid
16
+ * for the requested zone. This is the right default for renderers and
17
+ * command implementations that just want a paragraph stream.
18
+ */
19
+ export declare function getEditableBlocksForZone(state: EditorState, zone: EditorEditingZone): EditorBlockNode[];
20
+ export declare function getActiveSectionBlocks(state: EditorState): EditorBlockNode[];
21
+ /**
22
+ * Convenience: paragraphs (in document order) for the active editing zone.
23
+ * Combines `getEditableBlocksForZone` with the block→paragraph flatten so
24
+ * callers don't need to know about both helpers.
25
+ */
26
+ export declare function getParagraphs(state: EditorState): EditorParagraphNode[];
@@ -0,0 +1,18 @@
1
+ import { EditorDocument } from '../../types/document.js';
2
+ import { EditorPosition, EditorSelection, EditorEditingZone } from '../../types/selection.js';
3
+
4
+ export interface EditorState {
5
+ document: EditorDocument;
6
+ selection: EditorSelection;
7
+ activeSectionIndex?: number;
8
+ activeZone?: EditorEditingZone;
9
+ /**
10
+ * Identifies the footnote currently being edited when `activeZone === "footnote"`.
11
+ * Ignored for other zones.
12
+ */
13
+ activeFootnoteId?: string;
14
+ trackChangesEnabled?: boolean;
15
+ showMargins?: boolean;
16
+ showParagraphMarks?: boolean;
17
+ }
18
+ export type { EditorPosition, EditorSelection, EditorEditingZone };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Barrel file for the refactored `src/core/model/` module.
3
+ *
4
+ * The public surface (types, functions, constants) is byte-for-byte
5
+ * equivalent to the original `src/core/model.ts`, so all `import`
6
+ * statements that pointed there continue to work via the barrel
7
+ * re-export in `src/core/model.ts`.
8
+ */
9
+ export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageFillMode, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, } from '../../types/primitives.js';
10
+ export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorNamedStyle, } from '../../types/styles.js';
11
+ export type { EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorParagraphNode, EditorTableCellStyle, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from '../../types/nodes.js';
12
+ export type { EditorFootnote } from '../../types/documentFootnotes.js';
13
+ export type { EditorEndnote } from '../../types/documentEndnotes.js';
14
+ export type { EditorBookmark, EditorBookmarkAnchor, EditorBookmarks, } from '../../types/documentBookmarks.js';
15
+ export type { EditorPageMargins, EditorPageSettings, EditorSection, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocument, } from '../../types/document.js';
16
+ export type { EditorPosition, EditorSelection, EditorEditingZone, } from '../../types/selection.js';
17
+ export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from '../../types/layout.js';
18
+ export type { EditorState } from '../../editorState.js';
19
+ export { EDITOR_ASSET_REF_PREFIX } from '../../types/primitives.js';
20
+ export { DEFAULT_TEXT_STYLE, DEFAULT_PARAGRAPH_STYLE, EFFECTIVE_TEXT_STYLE_DEFAULTS, EFFECTIVE_PARAGRAPH_STYLE_DEFAULTS, } from '../../styleDefaults.js';
21
+ export { DEFAULT_EDITOR_PAGE_SETTINGS } from '../../pageGeometry.js';
22
+ export { getParagraphText, getParagraphLength, getRunIndex, getRunStartOffset, paragraphOffsetToPosition, positionToParagraphOffset, } from '../../queries.js';
23
+ export { textStyleMerger, paragraphStyleMerger, mergeTextStyles, mergeParagraphStyles, resolveDefaultParagraphStyleId, resolveNamedTextStyle, resolveNamedParagraphStyle, resolveEffectiveTextStyle, resolveEffectiveTextStyleForParagraph, resolveEffectiveParagraphStyle, } from '../../styleResolution.js';
24
+ export type { StyleMerger, Mergeable } from '../../styleResolution.js';
25
+ export { resolveImageSrc } from '../../assets.js';
26
+ export { normalizePageSettings, getDocumentPageSettings, getPageContentWidth, getPageHeaderZoneTop, getPageBodyTop, getPageFooterReferenceTop, getPageBodyBottom, getPageHeaderZoneHeight, getPageFooterZoneTop, getPageFooterZoneHeight, getPageContentHeight, } from '../../pageGeometry.js';
27
+ export { getDocumentSections, getDocumentSectionsCanonical, } from '../../documentSections.js';
28
+ export { DocumentIndexBuilder, getDocumentParagraphIndex, getDocumentParagraphs, getDocumentParagraphsCanonical, getParagraphById, findParagraphLocation, findParagraphTableLocation, WeakMapDocumentIndexCache, } from '../../documentIndex.js';
29
+ export type { EditorParagraphLocation, TableLocation, DocumentParagraphIndexEntry, DocumentIndexCache, } from '../../documentIndex.js';
30
+ export { getBlockParagraphs, collectSectionParagraphs, } from '../../paragraphWalker.js';
31
+ export { getActiveSectionIndex, getActiveZone, getEditableBlocksForZone, tryGetEditableBlocksForZone, getActiveSectionBlocks, getParagraphs, } from '../../editingZones.js';
@@ -0,0 +1,14 @@
1
+ import { EditorDocument, EditorPageSettings } from '../../types/document.js';
2
+
3
+ export declare const DEFAULT_EDITOR_PAGE_SETTINGS: EditorPageSettings;
4
+ export declare function normalizePageSettings(pageSettings: EditorPageSettings): EditorPageSettings;
5
+ export declare function getDocumentPageSettings(document: EditorDocument): EditorPageSettings;
6
+ export declare function getPageContentWidth(pageSettings: EditorPageSettings): number;
7
+ export declare function getPageHeaderZoneTop(pageSettings: EditorPageSettings): number;
8
+ export declare function getPageBodyTop(pageSettings: EditorPageSettings): number;
9
+ export declare function getPageFooterReferenceTop(pageSettings: EditorPageSettings): number;
10
+ export declare function getPageBodyBottom(pageSettings: EditorPageSettings): number;
11
+ export declare function getPageHeaderZoneHeight(pageSettings: EditorPageSettings): number;
12
+ export declare function getPageFooterZoneTop(pageSettings: EditorPageSettings): number;
13
+ export declare function getPageFooterZoneHeight(pageSettings: EditorPageSettings): number;
14
+ export declare function getPageContentHeight(pageSettings: EditorPageSettings): number;
@@ -0,0 +1,5 @@
1
+ import { EditorBlockNode, EditorParagraphNode } from '../../types/nodes.js';
2
+ import { EditorSection } from '../../types/document.js';
3
+
4
+ export declare function getBlockParagraphs(block: EditorBlockNode): EditorParagraphNode[];
5
+ export declare function collectSectionParagraphs(section: EditorSection): EditorParagraphNode[];
@@ -1,4 +1,5 @@
1
- import { EditorParagraphNode, EditorPosition } from '../../../model.js';
1
+ import { EditorParagraphNode } from '../../types/nodes.js';
2
+ import { EditorPosition } from '../../types/selection.js';
2
3
 
3
4
  export declare function getParagraphText(paragraph: EditorParagraphNode): string;
4
5
  export declare function getParagraphLength(paragraph: EditorParagraphNode): number;
@@ -0,0 +1,6 @@
1
+ import { EditorTextStyle, EditorParagraphStyle } from '../../types/styles.js';
2
+
3
+ export declare const DEFAULT_TEXT_STYLE: Required<EditorTextStyle>;
4
+ export declare const EFFECTIVE_TEXT_STYLE_DEFAULTS: Required<EditorTextStyle>;
5
+ export declare const DEFAULT_PARAGRAPH_STYLE: Required<EditorParagraphStyle>;
6
+ export declare const EFFECTIVE_PARAGRAPH_STYLE_DEFAULTS: Required<EditorParagraphStyle>;
@@ -0,0 +1,44 @@
1
+ import { EditorNamedStyle, EditorParagraphStyle, EditorTextStyle } from '../../types/styles.js';
2
+
3
+ /**
4
+ * A "mergeable" style is any object whose own enumerable string keys can
5
+ * be copied with `Object.entries`. We accept any object shape — real
6
+ * style interfaces don't declare an index signature and shouldn't have to.
7
+ */
8
+ export type Mergeable = object;
9
+ export interface StyleMerger<T> {
10
+ merge(resolved: T, local: Partial<T> | undefined): T;
11
+ }
12
+ export declare function createObjectMerger<T>(): StyleMerger<T>;
13
+ export declare const textStyleMerger: StyleMerger<EditorTextStyle>;
14
+ export declare const paragraphStyleMerger: StyleMerger<EditorParagraphStyle>;
15
+ /**
16
+ * Merge policy used throughout the editor:
17
+ * - `undefined` in `local` → inherit from `resolved` (key is skipped)
18
+ * - `null` in `local` → reset to system default (caller handles `null`)
19
+ * - any other value → override `resolved`
20
+ */
21
+ export declare function mergeTextStyles(resolved: EditorTextStyle, local: EditorTextStyle | undefined): EditorTextStyle;
22
+ export declare function mergeParagraphStyles(resolved: EditorParagraphStyle, local: EditorParagraphStyle | undefined): EditorParagraphStyle;
23
+ export declare function resolveDefaultParagraphStyleId(styles: Record<string, EditorNamedStyle> | undefined): string | undefined;
24
+ export declare function resolveNamedTextStyle(styleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorTextStyle;
25
+ export declare function resolveNamedParagraphStyle(styleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorParagraphStyle;
26
+ /**
27
+ * Resolve the effective text style for a run:
28
+ * 1. Resolve named style via styleId + basedOn chain
29
+ * 2. Apply local overrides (undefined → inherit, null → keep as null for reset)
30
+ * 3. Fill in system defaults for any remaining undefined values
31
+ */
32
+ export declare function resolveEffectiveTextStyle(style: EditorTextStyle | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorTextStyle>;
33
+ /**
34
+ * Resolve the effective text style for a run, inheriting textStyle from the
35
+ * paragraph named style when the run does not override it locally.
36
+ */
37
+ export declare function resolveEffectiveTextStyleForParagraph(style: EditorTextStyle | undefined, paragraphStyleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorTextStyle>;
38
+ /**
39
+ * Resolve the effective paragraph style:
40
+ * 1. Resolve named style via styleId + basedOn chain
41
+ * 2. Apply local overrides (undefined → inherit, null → keep as null for reset)
42
+ * 3. Fill in system defaults for any remaining undefined values
43
+ */
44
+ export declare function resolveEffectiveParagraphStyle(style: EditorParagraphStyle | undefined, styles: Record<string, EditorNamedStyle> | undefined): Required<EditorParagraphStyle>;
@@ -0,0 +1,86 @@
1
+ import { EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart } from '../../../primitives.js';
2
+ import { EditorBlockNode } from '../../../nodes.js';
3
+ import { EditorFootnote } from '../../../documentFootnotes.js';
4
+ import { EditorEndnote } from '../../../documentEndnotes.js';
5
+ import { EditorBookmarks } from '../../../documentBookmarks.js';
6
+ import { EditorNamedStyle } from '../../../styles.js';
7
+
8
+ export interface EditorPageMargins {
9
+ top: number;
10
+ right: number;
11
+ bottom: number;
12
+ left: number;
13
+ header: number;
14
+ footer: number;
15
+ gutter: number;
16
+ }
17
+ export interface EditorPageSettings {
18
+ width: number;
19
+ height: number;
20
+ orientation?: "portrait" | "landscape";
21
+ margins: EditorPageMargins;
22
+ }
23
+ export interface EditorSection {
24
+ id: string;
25
+ blocks: EditorBlockNode[];
26
+ pageSettings: EditorPageSettings;
27
+ header?: EditorBlockNode[];
28
+ firstPageHeader?: EditorBlockNode[];
29
+ evenPageHeader?: EditorBlockNode[];
30
+ footer?: EditorBlockNode[];
31
+ firstPageFooter?: EditorBlockNode[];
32
+ evenPageFooter?: EditorBlockNode[];
33
+ breakType?: "nextPage" | "continuous";
34
+ }
35
+ export interface EditorFootnoteSettings {
36
+ numberFormat?: EditorFootnoteNumberFormat;
37
+ restart?: EditorFootnoteRestart;
38
+ startAt?: number;
39
+ }
40
+ export interface EditorFootnotes {
41
+ items: Record<string, EditorFootnote>;
42
+ settings?: EditorFootnoteSettings;
43
+ separator?: EditorBlockNode[];
44
+ continuationSeparator?: EditorBlockNode[];
45
+ }
46
+ /**
47
+ * Endnote settings. Reuses the note number-format/restart vocabulary shared
48
+ * with footnotes (both are just "notes" in OOXML terms).
49
+ */
50
+ export interface EditorEndnoteSettings {
51
+ numberFormat?: EditorFootnoteNumberFormat;
52
+ restart?: EditorFootnoteRestart;
53
+ startAt?: number;
54
+ }
55
+ export interface EditorEndnotes {
56
+ items: Record<string, EditorEndnote>;
57
+ settings?: EditorEndnoteSettings;
58
+ separator?: EditorBlockNode[];
59
+ continuationSeparator?: EditorBlockNode[];
60
+ }
61
+ export interface EditorDocument {
62
+ id: string;
63
+ pageSettings?: EditorPageSettings;
64
+ sections?: EditorSection[];
65
+ styles?: Record<string, EditorNamedStyle>;
66
+ settings?: {
67
+ defaultTabStop?: number;
68
+ };
69
+ /**
70
+ * Out-of-band asset registry. Image runs reference entries here using
71
+ * `src = "asset:<id>"`. The map itself is treated as append-only and is
72
+ * deliberately excluded from per-keystroke equality checks/signatures.
73
+ */
74
+ assets?: Record<string, EditorAsset>;
75
+ footnotes?: EditorFootnotes;
76
+ endnotes?: EditorEndnotes;
77
+ /**
78
+ * Bookmark registry (`w:bookmarkStart`/`w:bookmarkEnd`). Targets for internal
79
+ * hyperlinks (`#name`) and cross-references.
80
+ */
81
+ bookmarks?: EditorBookmarks;
82
+ metadata?: {
83
+ title?: string;
84
+ [key: string]: unknown;
85
+ };
86
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Bookmark registry (Word's `w:bookmarkStart` / `w:bookmarkEnd`).
3
+ *
4
+ * Bookmarks are *ranges* that are independent of the run/paragraph tree: a
5
+ * bookmark can span paragraphs, start and end in different blocks, nest,
6
+ * overlap, or be zero-width. They are therefore modeled as a document-level
7
+ * registry (like footnotes/endnotes) rather than as run attributes. Each
8
+ * bookmark owns two logical anchors — `start` and `end` — expressed as a
9
+ * paragraph id plus a character offset into that paragraph's flattened text.
10
+ *
11
+ * This is the "Phase 1" representation: faithful import/export round-trip and a
12
+ * real target for internal hyperlinks (`#name`). Live-edit transforms
13
+ * (split/merge/paste keeping anchors correct) are intentionally out of scope
14
+ * here.
15
+ */
16
+ export interface EditorBookmarkAnchor {
17
+ /** Id of the paragraph this anchor lives in (`EditorParagraphNode.id`). */
18
+ paragraphId: string;
19
+ /** Character offset into the paragraph's flattened text stream. */
20
+ offset: number;
21
+ /**
22
+ * Document order in which the original marker appeared. Used purely to keep a
23
+ * deterministic emit order when several boundaries share one offset.
24
+ */
25
+ seq?: number;
26
+ }
27
+ export interface EditorBookmark {
28
+ /** Stable editor-local id (not the DOCX `w:id`). */
29
+ id: string;
30
+ /** Word bookmark name; this is the hyperlink / cross-reference target. */
31
+ name: string;
32
+ /** Hidden bookmarks (name starts with "_", e.g. `_Toc...`, `_Ref...`). */
33
+ hidden?: boolean;
34
+ /** Original DOCX `w:id`, used only as a hint for export id stability. */
35
+ docxIdHint?: number;
36
+ /** Table column bookmark range start column (`w:bookmarkStart/@w:colFirst`). */
37
+ colFirst?: number;
38
+ /** Table column bookmark range end column (`w:bookmarkStart/@w:colLast`). */
39
+ colLast?: number;
40
+ /** Start anchor. May be absent for malformed imports (orphan end). */
41
+ start?: EditorBookmarkAnchor;
42
+ /** End anchor. May be absent for malformed imports (orphan start). */
43
+ end?: EditorBookmarkAnchor;
44
+ }
45
+ export interface EditorBookmarks {
46
+ items: Record<string, EditorBookmark>;
47
+ /** Stable creation/import order for deterministic export. */
48
+ order: string[];
49
+ }
@@ -0,0 +1,8 @@
1
+ import { EditorBlockNode } from '../../../nodes.js';
2
+
3
+ export interface EditorEndnote {
4
+ id: string;
5
+ blocks: EditorBlockNode[];
6
+ /** Original DOCX `w:id`, kept for round-trip diagnostics only. */
7
+ docxId?: number;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { EditorBlockNode } from '../../../nodes.js';
2
+
3
+ export interface EditorFootnote {
4
+ id: string;
5
+ blocks: EditorBlockNode[];
6
+ /** Original DOCX `w:id`, kept for round-trip diagnostics only. */
7
+ docxId?: number;
8
+ }
@@ -0,0 +1,93 @@
1
+ import { EditorBlockNode, EditorTextBoxData } from '../../../nodes.js';
2
+ import { EditorPageSettings } from '../../../document.js';
3
+ import { EditorRevision, EditorImageRunData } from '../../../primitives.js';
4
+ import { EditorTextStyle } from '../../../styles.js';
5
+
6
+ export interface EditorCaretSlot {
7
+ paragraphId: string;
8
+ offset: number;
9
+ left: number;
10
+ top: number;
11
+ height: number;
12
+ }
13
+ export interface EditorLayoutFragmentChar {
14
+ char: string;
15
+ paragraphOffset: number;
16
+ runOffset: number;
17
+ }
18
+ export interface EditorLayoutFragment {
19
+ paragraphId: string;
20
+ runId: string;
21
+ startOffset: number;
22
+ endOffset: number;
23
+ text: string;
24
+ styles?: EditorTextStyle;
25
+ image?: EditorImageRunData;
26
+ textBox?: EditorTextBoxData;
27
+ revision?: EditorRevision;
28
+ chars: EditorLayoutFragmentChar[];
29
+ }
30
+ export interface EditorLayoutLine {
31
+ paragraphId: string;
32
+ index: number;
33
+ startOffset: number;
34
+ endOffset: number;
35
+ top: number;
36
+ height: number;
37
+ slots: EditorCaretSlot[];
38
+ fragments: EditorLayoutFragment[];
39
+ availableWidth?: number;
40
+ }
41
+ export interface EditorLayoutParagraph {
42
+ paragraphId: string;
43
+ text: string;
44
+ fragments: EditorLayoutFragment[];
45
+ lines: EditorLayoutLine[];
46
+ startOffset?: number;
47
+ endOffset?: number;
48
+ contentWidth?: number;
49
+ }
50
+ export interface EditorLayoutBlock {
51
+ blockId: string;
52
+ blockType: EditorBlockNode["type"];
53
+ paragraphId?: string;
54
+ globalIndex: number;
55
+ estimatedHeight: number;
56
+ layout?: EditorLayoutParagraph;
57
+ tableSegment?: {
58
+ startRowIndex: number;
59
+ endRowIndex: number;
60
+ repeatedHeaderRowCount: number;
61
+ startRowCellBlockStarts?: number[];
62
+ endRowCellBlockEnds?: number[];
63
+ startRowCellBlockPositions?: TableCellBlockPosition[];
64
+ endRowCellBlockPositions?: TableCellBlockPosition[];
65
+ };
66
+ sourceBlockId?: string;
67
+ sourceBlock: EditorBlockNode;
68
+ }
69
+ export interface TableCellBlockPosition {
70
+ blockIndex: number;
71
+ offset?: number;
72
+ }
73
+ export interface EditorLayoutPage {
74
+ id: string;
75
+ index: number;
76
+ height: number;
77
+ maxHeight: number;
78
+ blocks: EditorLayoutBlock[];
79
+ pageSettings: EditorPageSettings;
80
+ headerBlocks?: EditorLayoutBlock[];
81
+ footerBlocks?: EditorLayoutBlock[];
82
+ footnoteBlocks?: EditorLayoutBlock[];
83
+ footnoteReferenceIds?: string[];
84
+ bodyTop?: number;
85
+ bodyBottom?: number;
86
+ headerTop?: number;
87
+ footerTop?: number;
88
+ footnoteTop?: number;
89
+ footnoteSeparatorTop?: number;
90
+ }
91
+ export interface EditorLayoutDocument {
92
+ pages: EditorLayoutPage[];
93
+ }