oasis-editor 0.0.1

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 (287) hide show
  1. package/README.md +1 -0
  2. package/dist/__tests__/app/PersistenceService.test.d.ts +1 -0
  3. package/dist/__tests__/app/footnoteUiCommands.test.d.ts +1 -0
  4. package/dist/__tests__/commands/text.test.d.ts +1 -0
  5. package/dist/__tests__/core/editorPluginIntegration.test.d.ts +1 -0
  6. package/dist/__tests__/core/editorState.test.d.ts +1 -0
  7. package/dist/__tests__/core/footnotes.test.d.ts +1 -0
  8. package/dist/__tests__/core/model.test.d.ts +1 -0
  9. package/dist/__tests__/core/pluginCollection.test.d.ts +1 -0
  10. package/dist/__tests__/core/tableCommands.test.d.ts +1 -0
  11. package/dist/__tests__/export/docxExport.test.d.ts +1 -0
  12. package/dist/__tests__/export/footnotesExport.test.d.ts +1 -0
  13. package/dist/__tests__/export/pdfWriter.test.d.ts +1 -0
  14. package/dist/__tests__/export/underlineStyle.test.d.ts +1 -0
  15. package/dist/__tests__/import/docxComplexSmoke.test.d.ts +1 -0
  16. package/dist/__tests__/import/docxImport.test.d.ts +1 -0
  17. package/dist/__tests__/import/footnotesImport.test.d.ts +1 -0
  18. package/dist/__tests__/integration/documentFlow.test.d.ts +1 -0
  19. package/dist/__tests__/ui/CanvasTableLayout.test.d.ts +1 -0
  20. package/dist/__tests__/ui/canvasHitTestService.test.d.ts +1 -0
  21. package/dist/__tests__/ui/canvasLayoutSnapshot.test.d.ts +1 -0
  22. package/dist/__tests__/ui/canvasSelectionGeometry.test.d.ts +1 -0
  23. package/dist/__tests__/ui/canvasTextRendering.test.d.ts +1 -0
  24. package/dist/__tests__/ui/composeMeasuredParagraphLines.test.d.ts +1 -0
  25. package/dist/__tests__/ui/dialog.test.d.ts +1 -0
  26. package/dist/__tests__/ui/fontDialog.test.d.ts +1 -0
  27. package/dist/__tests__/ui/footnotesLayout.test.d.ts +1 -0
  28. package/dist/__tests__/ui/layoutIdentity.test.d.ts +1 -0
  29. package/dist/__tests__/ui/layoutProjection.test.d.ts +1 -0
  30. package/dist/__tests__/ui/registry.test.d.ts +1 -0
  31. package/dist/__tests__/ui/tabs.test.d.ts +1 -0
  32. package/dist/__tests__/ui/textMeasurementAlignment.test.d.ts +1 -0
  33. package/dist/__tests__/word-parity/fixtures/corpus.d.ts +10 -0
  34. package/dist/__tests__/word-parity/fixtures/loremFixtures.d.ts +8 -0
  35. package/dist/__tests__/word-parity/wordLayout.word-parity.d.ts +1 -0
  36. package/dist/app/bootstrap/createOasisEditorApp.d.ts +6 -0
  37. package/dist/app/bootstrap/createOasisEditorContainer.d.ts +6 -0
  38. package/dist/app/clipboard/htmlClipboardParser.d.ts +3 -0
  39. package/dist/app/controllers/EditorCommandRegistry.d.ts +23 -0
  40. package/dist/app/controllers/EditorCommandsController.d.ts +53 -0
  41. package/dist/app/controllers/documentIO/DocumentExporter.d.ts +11 -0
  42. package/dist/app/controllers/documentIO/DocumentImporter.d.ts +17 -0
  43. package/dist/app/controllers/documentIO/ImageInsertionService.d.ts +14 -0
  44. package/dist/app/controllers/documentIO/downloadBlob.d.ts +1 -0
  45. package/dist/app/controllers/tableOpsCellSpanCommands.d.ts +21 -0
  46. package/dist/app/controllers/tableOpsGuards.d.ts +19 -0
  47. package/dist/app/controllers/tableOpsMutationCommands.d.ts +4 -0
  48. package/dist/app/controllers/tableOpsRowColumnCommands.d.ts +12 -0
  49. package/dist/app/controllers/tableOpsSelectionAwareCommands.d.ts +20 -0
  50. package/dist/app/controllers/tableOpsSelectionNavigation.d.ts +7 -0
  51. package/dist/app/controllers/tableOpsSelectionRanges.d.ts +34 -0
  52. package/dist/app/controllers/useEditorClipboard.d.ts +28 -0
  53. package/dist/app/controllers/useEditorDocumentIO.d.ts +31 -0
  54. package/dist/app/controllers/useEditorFindReplace.d.ts +28 -0
  55. package/dist/app/controllers/useEditorHistoryActions.d.ts +21 -0
  56. package/dist/app/controllers/useEditorImageOperations.d.ts +72 -0
  57. package/dist/app/controllers/useEditorKeyboard.d.ts +50 -0
  58. package/dist/app/controllers/useEditorLayout.d.ts +42 -0
  59. package/dist/app/controllers/useEditorNavigation.d.ts +22 -0
  60. package/dist/app/controllers/useEditorPersistence.d.ts +16 -0
  61. package/dist/app/controllers/useEditorRevision.d.ts +12 -0
  62. package/dist/app/controllers/useEditorStyle.d.ts +23 -0
  63. package/dist/app/controllers/useEditorSurfaceEvents.d.ts +44 -0
  64. package/dist/app/controllers/useEditorTableDrag.d.ts +29 -0
  65. package/dist/app/controllers/useEditorTableOperations.d.ts +45 -0
  66. package/dist/app/controllers/useEditorTableResize.d.ts +32 -0
  67. package/dist/app/controllers/useEditorTextDrag.d.ts +38 -0
  68. package/dist/app/controllers/useEditorTextInput.d.ts +27 -0
  69. package/dist/app/services/FindReplaceService.d.ts +12 -0
  70. package/dist/app/services/PersistenceService.d.ts +11 -0
  71. package/dist/assets/Arimo-Bold.ttf +0 -0
  72. package/dist/assets/Arimo-BoldItalic.ttf +0 -0
  73. package/dist/assets/Arimo-Italic.ttf +0 -0
  74. package/dist/assets/Arimo-Regular.ttf +0 -0
  75. package/dist/assets/Carlito-Bold.ttf +0 -0
  76. package/dist/assets/Carlito-BoldItalic.ttf +0 -0
  77. package/dist/assets/Carlito-Italic.ttf +0 -0
  78. package/dist/assets/Carlito-Regular.ttf +0 -0
  79. package/dist/assets/Roboto-Italic.ttf +0 -0
  80. package/dist/assets/Roboto-Medium.ttf +0 -0
  81. package/dist/assets/Roboto-MediumItalic.ttf +0 -0
  82. package/dist/assets/Roboto-Regular.ttf +0 -0
  83. package/dist/assets/Tinos-Bold.ttf +0 -0
  84. package/dist/assets/Tinos-BoldItalic.ttf +0 -0
  85. package/dist/assets/Tinos-Italic.ttf +0 -0
  86. package/dist/assets/Tinos-Regular.ttf +0 -0
  87. package/dist/assets/importDocxWorker-DIQ28Lka.js +12 -0
  88. package/dist/core/Editor.d.ts +33 -0
  89. package/dist/core/cloneState.d.ts +8 -0
  90. package/dist/core/commands/CommandBus.d.ts +9 -0
  91. package/dist/core/commands/CommandRef.d.ts +10 -0
  92. package/dist/core/commands/CommandRegistry.d.ts +10 -0
  93. package/dist/core/commands/block.d.ts +11 -0
  94. package/dist/core/commands/clipboard.d.ts +13 -0
  95. package/dist/core/commands/footnotes.d.ts +27 -0
  96. package/dist/core/commands/history.d.ts +7 -0
  97. package/dist/core/commands/image.d.ts +15 -0
  98. package/dist/core/commands/link.d.ts +4 -0
  99. package/dist/core/commands/list.d.ts +10 -0
  100. package/dist/core/commands/misc.d.ts +3 -0
  101. package/dist/core/commands/selection.d.ts +12 -0
  102. package/dist/core/commands/table.d.ts +10 -0
  103. package/dist/core/commands/text.d.ts +12 -0
  104. package/dist/core/commands/utils.d.ts +69 -0
  105. package/dist/core/editorCommands.d.ts +14 -0
  106. package/dist/core/editorState.d.ts +66 -0
  107. package/dist/core/engine.d.ts +13 -0
  108. package/dist/core/footnotes.d.ts +42 -0
  109. package/dist/core/headings.d.ts +9 -0
  110. package/dist/core/model/queries.d.ts +8 -0
  111. package/dist/core/model.d.ts +447 -0
  112. package/dist/core/plugin.d.ts +64 -0
  113. package/dist/core/plugins/PluginCollection.d.ts +16 -0
  114. package/dist/core/selection.d.ts +19 -0
  115. package/dist/core/tableLayout.d.ts +13 -0
  116. package/dist/core/textStyleMappings.d.ts +8 -0
  117. package/dist/core/wordBoundaries.d.ts +7 -0
  118. package/dist/demo/OasisSiteApp.d.ts +1 -0
  119. package/dist/export/docx/docxTypes.d.ts +66 -0
  120. package/dist/export/docx/exportEditorDocumentToDocx.d.ts +4 -0
  121. package/dist/export/docx/footnotesXml.d.ts +40 -0
  122. package/dist/export/docx/tableXml.d.ts +4 -0
  123. package/dist/export/docx/textXml.d.ts +6 -0
  124. package/dist/export/docx/xmlUtils.d.ts +10 -0
  125. package/dist/export/pdf/OasisPdfWriter.d.ts +93 -0
  126. package/dist/export/pdf/draw/drawBlockList.d.ts +5 -0
  127. package/dist/export/pdf/draw/drawFragment.d.ts +7 -0
  128. package/dist/export/pdf/draw/drawPageBackground.d.ts +3 -0
  129. package/dist/export/pdf/draw/drawParagraph.d.ts +5 -0
  130. package/dist/export/pdf/draw/drawTable.d.ts +5 -0
  131. package/dist/export/pdf/draw/fragmentGeometry.d.ts +12 -0
  132. package/dist/export/pdf/draw/lists.d.ts +6 -0
  133. package/dist/export/pdf/exportEditorDocumentToPdf.d.ts +4 -0
  134. package/dist/export/pdf/fonts/PdfFontRegistry.d.ts +28 -0
  135. package/dist/export/pdf/fonts/collectPdfFontFamilies.d.ts +3 -0
  136. package/dist/export/pdf/images.d.ts +4 -0
  137. package/dist/export/pdf/layout/PdfTextMeasurer.d.ts +24 -0
  138. package/dist/export/pdf/layout/layoutParagraph.d.ts +37 -0
  139. package/dist/export/pdf/units.d.ts +6 -0
  140. package/dist/i18n/index.d.ts +7 -0
  141. package/dist/i18n/locales/en.d.ts +251 -0
  142. package/dist/i18n/locales/pt-BR.d.ts +251 -0
  143. package/dist/import/docx/assetRegistry.d.ts +18 -0
  144. package/dist/import/docx/footnotes.d.ts +17 -0
  145. package/dist/import/docx/headerFooter.d.ts +7 -0
  146. package/dist/import/docx/importDocxInWorker.d.ts +8 -0
  147. package/dist/import/docx/importDocxToEditorDocument.d.ts +7 -0
  148. package/dist/import/docx/importDocxWorker.d.ts +1 -0
  149. package/dist/import/docx/numbering.d.ts +9 -0
  150. package/dist/import/docx/paragraphs.d.ts +12 -0
  151. package/dist/import/docx/relationships.d.ts +4 -0
  152. package/dist/import/docx/runs.d.ts +41 -0
  153. package/dist/import/docx/sectionProperties.d.ts +16 -0
  154. package/dist/import/docx/settings.d.ts +4 -0
  155. package/dist/import/docx/styles.d.ts +24 -0
  156. package/dist/import/docx/tables.d.ts +8 -0
  157. package/dist/import/docx/themeFonts.d.ts +12 -0
  158. package/dist/import/docx/units.d.ts +9 -0
  159. package/dist/import/docx/xmlHelpers.d.ts +15 -0
  160. package/dist/index.d.ts +43 -0
  161. package/dist/layoutProjection/blockHeights.d.ts +1 -0
  162. package/dist/layoutProjection/blocksPagination.d.ts +18 -0
  163. package/dist/layoutProjection/constants.d.ts +1 -0
  164. package/dist/layoutProjection/documentLayout.d.ts +7 -0
  165. package/dist/layoutProjection/footnotePagination.d.ts +21 -0
  166. package/dist/layoutProjection/headerFooterFootnotes.d.ts +4 -0
  167. package/dist/layoutProjection/headerFooterProjection.d.ts +14 -0
  168. package/dist/layoutProjection/index.d.ts +7 -0
  169. package/dist/layoutProjection/paragraphPagination.d.ts +20 -0
  170. package/dist/layoutProjection/paragraphProjection.d.ts +1 -0
  171. package/dist/layoutProjection/sectionPagination.d.ts +35 -0
  172. package/dist/layoutProjection/tablePagination.d.ts +14 -0
  173. package/dist/layoutProjection/tableProjection.d.ts +1 -0
  174. package/dist/main.d.ts +1 -0
  175. package/dist/oasis-editor.css +1 -0
  176. package/dist/oasis-editor.js +80464 -0
  177. package/dist/oasis-editor.umd.cjs +24 -0
  178. package/dist/plugins/internal/createEssentialsPlugin.d.ts +135 -0
  179. package/dist/plugins/internal/essentialsCommandBuilders.d.ts +10 -0
  180. package/dist/plugins/internal/essentialsCommandGroups.d.ts +39 -0
  181. package/dist/testing/wordLayoutParity.d.ts +62 -0
  182. package/dist/ui/OasisEditorApp.d.ts +4 -0
  183. package/dist/ui/OasisEditorAppProps.d.ts +49 -0
  184. package/dist/ui/OasisEditorContainer.d.ts +6 -0
  185. package/dist/ui/OasisEditorEditor.d.ts +103 -0
  186. package/dist/ui/app/EditorDialogsLayer.d.ts +26 -0
  187. package/dist/ui/app/EditorDragLayers.d.ts +20 -0
  188. package/dist/ui/app/EditorWorkspace.d.ts +37 -0
  189. package/dist/ui/app/buildEditorViewProps.d.ts +59 -0
  190. package/dist/ui/app/createEditorEssentialsPlugin.d.ts +42 -0
  191. package/dist/ui/app/createRuntimeCommandHost.d.ts +29 -0
  192. package/dist/ui/app/fontOptions.d.ts +5 -0
  193. package/dist/ui/app/shouldShowCaret.d.ts +9 -0
  194. package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +16 -0
  195. package/dist/ui/app/useEditorAppState.d.ts +11 -0
  196. package/dist/ui/app/useEditorContextMenuClipboard.d.ts +33 -0
  197. package/dist/ui/app/useEditorDialogs.d.ts +38 -0
  198. package/dist/ui/app/useEditorFocus.d.ts +11 -0
  199. package/dist/ui/app/useEditorFontOptions.d.ts +17 -0
  200. package/dist/ui/app/useEditorInteractionWiring.d.ts +64 -0
  201. package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +33 -0
  202. package/dist/ui/app/useEditorRuntimePlugins.d.ts +14 -0
  203. package/dist/ui/app/useEditorTransactions.d.ts +20 -0
  204. package/dist/ui/app/useEditorUiOptions.d.ts +24 -0
  205. package/dist/ui/app/useFontDialogBridge.d.ts +31 -0
  206. package/dist/ui/canvas/CanvasDebug.d.ts +125 -0
  207. package/dist/ui/canvas/CanvasGeometry.d.ts +35 -0
  208. package/dist/ui/canvas/CanvasHitTestService.d.ts +37 -0
  209. package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +93 -0
  210. package/dist/ui/canvas/CanvasSelectionGeometry.d.ts +20 -0
  211. package/dist/ui/canvas/CanvasTableLayout.d.ts +65 -0
  212. package/dist/ui/canvas/canvasBlockPainter.d.ts +4 -0
  213. package/dist/ui/canvas/canvasImageCache.d.ts +1 -0
  214. package/dist/ui/canvas/canvasPageRenderer.d.ts +18 -0
  215. package/dist/ui/canvas/canvasParagraphPainter.d.ts +12 -0
  216. package/dist/ui/canvas/canvasTablePainter.d.ts +3 -0
  217. package/dist/ui/canvas/listNumbering.d.ts +3 -0
  218. package/dist/ui/caretGeometry.d.ts +30 -0
  219. package/dist/ui/clipboardImage.d.ts +2 -0
  220. package/dist/ui/components/CanvasEditorSurface.d.ts +5 -0
  221. package/dist/ui/components/CaretOverlay.d.ts +9 -0
  222. package/dist/ui/components/ContextMenu/ContextMenu.d.ts +19 -0
  223. package/dist/ui/components/Dialogs/Dialog.d.ts +17 -0
  224. package/dist/ui/components/Dialogs/FontDialog.d.ts +67 -0
  225. package/dist/ui/components/Dialogs/FontDialogModel.d.ts +15 -0
  226. package/dist/ui/components/Dialogs/ImageAltDialog.d.ts +8 -0
  227. package/dist/ui/components/Dialogs/LineSpacingDialog.d.ts +17 -0
  228. package/dist/ui/components/Dialogs/LinkDialog.d.ts +8 -0
  229. package/dist/ui/components/DropCaret.d.ts +16 -0
  230. package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +7 -0
  231. package/dist/ui/components/FloatingToolbar/FloatingTableToolbar.d.ts +11 -0
  232. package/dist/ui/components/Menubar/Menubar.d.ts +7 -0
  233. package/dist/ui/components/Menubar/defaultMenuItems.d.ts +3 -0
  234. package/dist/ui/components/Menubar/menuRegistry.d.ts +28 -0
  235. package/dist/ui/components/Outline/OutlinePanel.d.ts +10 -0
  236. package/dist/ui/components/PageBreak.d.ts +4 -0
  237. package/dist/ui/components/RevisionOverlay.d.ts +6 -0
  238. package/dist/ui/components/SelectionOverlay.d.ts +11 -0
  239. package/dist/ui/components/Tabs/Tabs.d.ts +18 -0
  240. package/dist/ui/components/TitleBar/TitleBar.d.ts +6 -0
  241. package/dist/ui/components/Toolbar/LineSpacingButton.d.ts +6 -0
  242. package/dist/ui/components/Toolbar/Toolbar.d.ts +15 -0
  243. package/dist/ui/components/Toolbar/ToolbarOverflowManager.d.ts +13 -0
  244. package/dist/ui/components/Toolbar/controls/ListOptionsControl.d.ts +7 -0
  245. package/dist/ui/components/Toolbar/controls/UnderlineControl.d.ts +10 -0
  246. package/dist/ui/components/Toolbar/groups/MetricGroup.d.ts +6 -0
  247. package/dist/ui/components/Toolbar/groups/SectionGroup.d.ts +6 -0
  248. package/dist/ui/components/Toolbar/groups/TableGroup.d.ts +6 -0
  249. package/dist/ui/components/Toolbar/presets/defaultPalette.d.ts +4 -0
  250. package/dist/ui/components/Toolbar/presets/defaultToolbar.d.ts +9 -0
  251. package/dist/ui/components/Toolbar/primitives/Button.d.ts +11 -0
  252. package/dist/ui/components/Toolbar/primitives/ColorPicker.d.ts +22 -0
  253. package/dist/ui/components/Toolbar/primitives/GridPicker.d.ts +12 -0
  254. package/dist/ui/components/Toolbar/primitives/Menu.d.ts +20 -0
  255. package/dist/ui/components/Toolbar/primitives/Popover.d.ts +34 -0
  256. package/dist/ui/components/Toolbar/primitives/Select.d.ts +12 -0
  257. package/dist/ui/components/Toolbar/primitives/Separator.d.ts +6 -0
  258. package/dist/ui/components/Toolbar/primitives/SplitButton.d.ts +30 -0
  259. package/dist/ui/components/Toolbar/primitives/useDismiss.d.ts +15 -0
  260. package/dist/ui/components/Toolbar/primitives/usePopoverPosition.d.ts +31 -0
  261. package/dist/ui/components/Toolbar/registry/ToolbarRegistry.d.ts +23 -0
  262. package/dist/ui/components/Toolbar/renderers/ToolbarItemRenderer.d.ts +13 -0
  263. package/dist/ui/components/Toolbar/renderers/renderers.d.ts +14 -0
  264. package/dist/ui/components/Toolbar/schema/items.d.ts +136 -0
  265. package/dist/ui/components/Toolbar/schema/palette.d.ts +15 -0
  266. package/dist/ui/components/Toolbar/state/bindItem.d.ts +28 -0
  267. package/dist/ui/components/Toolbar/state/createToolbarApi.d.ts +14 -0
  268. package/dist/ui/components/Toolbar/underlineStyles.d.ts +16 -0
  269. package/dist/ui/editorHistory.d.ts +25 -0
  270. package/dist/ui/editorUiTypes.d.ts +65 -0
  271. package/dist/ui/imageGeometry.d.ts +15 -0
  272. package/dist/ui/layoutIdentity.d.ts +23 -0
  273. package/dist/ui/layoutInvalidation.d.ts +9 -0
  274. package/dist/ui/mount.d.ts +10 -0
  275. package/dist/ui/shells/BalloonShell.d.ts +3 -0
  276. package/dist/ui/shells/DocumentShell.d.ts +29 -0
  277. package/dist/ui/shells/InlineShell.d.ts +3 -0
  278. package/dist/ui/tableGeometry.d.ts +16 -0
  279. package/dist/ui/tableUiUtils.d.ts +5 -0
  280. package/dist/ui/textMeasurement.d.ts +14 -0
  281. package/dist/ui/toolbarStyleState.d.ts +46 -0
  282. package/dist/ui/utils/IconManager.d.ts +2 -0
  283. package/dist/utils/indexeddb.d.ts +12 -0
  284. package/dist/utils/logger.d.ts +22 -0
  285. package/dist/utils/performanceMetrics.d.ts +58 -0
  286. package/dist/utils/throttle.d.ts +4 -0
  287. package/package.json +65 -0
@@ -0,0 +1,20 @@
1
+ import { JSX } from '../../../../solid-js';
2
+
3
+ export interface MenuProps {
4
+ icon?: string;
5
+ label?: string;
6
+ tooltip?: string;
7
+ testId?: string;
8
+ active?: boolean;
9
+ disabled?: boolean;
10
+ hideChevron?: boolean;
11
+ /** Extra class for the popover panel. */
12
+ panelClass?: string;
13
+ keepMounted?: boolean;
14
+ children: JSX.Element;
15
+ }
16
+ /**
17
+ * A dropdown: an icon/label trigger button that opens a portalled panel.
18
+ * Replaces ToolbarDropdown; built on the shared Popover primitive.
19
+ */
20
+ export declare function Menu(props: MenuProps): JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { JSX } from '../../../../solid-js';
2
+ import { PopoverPlacement } from '../../../../usePopoverPosition.js';
3
+
4
+ export interface PopoverTriggerApi {
5
+ /** Attach to the element that the panel should be anchored/positioned to. */
6
+ ref: (el: HTMLElement) => void;
7
+ open: boolean;
8
+ setOpen: (open: boolean) => void;
9
+ toggle: () => void;
10
+ }
11
+ export interface PopoverProps {
12
+ open: boolean;
13
+ onOpenChange: (open: boolean) => void;
14
+ /** Renders the trigger; must attach `api.ref` to the positioning anchor. */
15
+ trigger: (api: PopoverTriggerApi) => JSX.Element;
16
+ children: JSX.Element;
17
+ placement?: PopoverPlacement;
18
+ panelClass?: string;
19
+ panelRole?: JSX.HTMLAttributes<HTMLDivElement>["role"];
20
+ panelTestId?: string;
21
+ onPanelMouseLeave?: () => void;
22
+ closeOnEscape?: boolean;
23
+ /**
24
+ * Keep the panel mounted (hidden) while closed so nested Solid state — e.g.
25
+ * an open sub-menu inside a metrics/table panel — survives reopening.
26
+ */
27
+ keepMounted?: boolean;
28
+ }
29
+ /**
30
+ * The single portalled popover primitive. Every dropdown / split / color /
31
+ * grid / spacing menu composes this instead of re-implementing portal +
32
+ * positioning + click-outside.
33
+ */
34
+ export declare function Popover(props: PopoverProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { JSX } from '../../../../solid-js';
2
+
3
+ export interface ToolbarSelectProps extends JSX.SelectHTMLAttributes<HTMLSelectElement> {
4
+ wide?: boolean;
5
+ small?: boolean;
6
+ tooltip?: string;
7
+ }
8
+ /**
9
+ * HTML select wrapper. Keeps the uncontrolled-with-sync pattern: the value is
10
+ * pushed imperatively in an effect to avoid SolidJS controlled-select pitfalls.
11
+ */
12
+ export declare function Select(props: ToolbarSelectProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { JSX } from '../../../../solid-js';
2
+
3
+ /** Vertical divider between toolbar item groups. */
4
+ export declare function Separator(props: {
5
+ hidden?: boolean;
6
+ }): JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { JSX } from '../../../../solid-js';
2
+
3
+ type PanelRole = JSX.HTMLAttributes<HTMLDivElement>["role"];
4
+ export interface SplitButtonProps {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ tooltip?: string;
8
+ rootClass?: string;
9
+ rootActive?: boolean;
10
+ /** Main (left) button. */
11
+ mainContent: JSX.Element;
12
+ mainTestId?: string;
13
+ mainAriaLabel?: string;
14
+ mainPressed?: boolean;
15
+ onMain: () => void;
16
+ /** Chevron (right) button. */
17
+ menuTestId?: string;
18
+ menuAriaLabel?: string;
19
+ /** Popover panel. */
20
+ panelClass?: string;
21
+ panelRole?: PanelRole;
22
+ onPanelMouseLeave?: () => void;
23
+ children: JSX.Element;
24
+ }
25
+ /**
26
+ * Split button: a main action button plus a chevron that opens a popover.
27
+ * Backs the underline and color controls (same markup/classes preserved).
28
+ */
29
+ export declare function SplitButton(props: SplitButtonProps): JSX.Element;
30
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Accessor } from '../../../../solid-js';
2
+
3
+ export interface DismissOptions {
4
+ /** Elements that should NOT trigger a dismiss when clicked (anchor + panel). */
5
+ refs: Accessor<Array<HTMLElement | undefined>>;
6
+ open: Accessor<boolean>;
7
+ onDismiss: () => void;
8
+ /** Dismiss when Escape is pressed. Defaults to true. */
9
+ closeOnEscape?: boolean;
10
+ }
11
+ /**
12
+ * Click-outside + Escape dismissal for popovers. Listeners are attached only
13
+ * while `open` is true. Replaces the per-component `handleClickOutside` copies.
14
+ */
15
+ export declare function useDismiss(options: DismissOptions): void;
@@ -0,0 +1,31 @@
1
+ import { Accessor } from '../../../../solid-js';
2
+
3
+ export type PopoverPlacement = "bottom-start" | "bottom-end";
4
+ export interface PopoverPositionOptions {
5
+ /** The element the panel is anchored to. */
6
+ anchor: Accessor<HTMLElement | undefined>;
7
+ /** The floating panel element (used to measure its width for clamping). */
8
+ panel: Accessor<HTMLElement | undefined>;
9
+ /** Whether the popover is currently open. Listeners attach only while open. */
10
+ open: Accessor<boolean>;
11
+ placement?: PopoverPlacement;
12
+ /** Vertical gap between anchor and panel, in px. */
13
+ gap?: number;
14
+ /** Minimum distance from the viewport edges, in px. */
15
+ viewportPadding?: number;
16
+ /** Fallback panel width when it cannot be measured yet, in px. */
17
+ fallbackWidth?: number;
18
+ }
19
+ export interface PopoverCoords {
20
+ top: number;
21
+ left: number;
22
+ }
23
+ /**
24
+ * Viewport-aware positioning for a portalled popover panel.
25
+ *
26
+ * Consolidates the `updateCoords` logic that used to be copy-pasted across
27
+ * ColorSplitButton, UnderlineSplitButton, LineSpacingButton, TableGridPicker
28
+ * and ToolbarDropdown. The math is preserved verbatim: anchor below, left
29
+ * clamped into the viewport accounting for the measured panel width.
30
+ */
31
+ export declare function usePopoverPosition(options: PopoverPositionOptions): Accessor<PopoverCoords>;
@@ -0,0 +1,23 @@
1
+ import { ToolbarItem } from '../../../../../schema/items.js';
2
+
3
+ export interface ToolbarRegistry {
4
+ /** Add or update by id (last-write-wins). New items append, then sort by `order`. */
5
+ register(item: ToolbarItem): void;
6
+ /** Insert positionally before an existing item. */
7
+ insertBefore(targetId: string, item: ToolbarItem): void;
8
+ /** Insert positionally after an existing item. */
9
+ insertAfter(targetId: string, item: ToolbarItem): void;
10
+ /** Replace an existing item in place, preserving its position. */
11
+ replace(targetId: string, item: ToolbarItem): void;
12
+ remove(id: string): void;
13
+ /** Move an existing item to an absolute index. */
14
+ move(id: string, toIndex: number): void;
15
+ get(id: string): ToolbarItem | undefined;
16
+ getOrdered(): ToolbarItem[];
17
+ /** Backward-friendly alias for getOrdered. */
18
+ getItems(): ToolbarItem[];
19
+ clear(): void;
20
+ /** Subscribe to mutations; returns an unsubscribe function. */
21
+ onChange(callback: () => void): () => void;
22
+ }
23
+ export declare function createToolbarRegistry(): ToolbarRegistry;
@@ -0,0 +1,13 @@
1
+ import { JSX } from '../../../../solid-js';
2
+ import { ToolbarActionApi, ToolbarItem } from '../../../../../schema/items.js';
3
+
4
+ /**
5
+ * Renders a single toolbar item by dispatching on its `type` to the renderer
6
+ * map. Wraps each item so contextual visibility toggles `display` instead of
7
+ * unmounting — required by the imperative OverflowManager (DOM moves break if
8
+ * the child count changes).
9
+ */
10
+ export declare function ToolbarItemRenderer(props: {
11
+ item: ToolbarItem;
12
+ api: ToolbarActionApi;
13
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { Component } from '../../../../solid-js';
2
+ import { ToolbarActionApi, ToolbarItem, ToolbarItemType } from '../../../../../schema/items.js';
3
+
4
+ export interface RendererProps<I extends ToolbarItem = ToolbarItem> {
5
+ item: I;
6
+ api: ToolbarActionApi;
7
+ }
8
+ export declare const TOOLBAR_RENDERERS: Record<ToolbarItemType, Component<RendererProps>>;
9
+ /**
10
+ * Register a renderer for a custom item `type`. Lets consumers add entirely new
11
+ * control kinds without modifying the toolbar core.
12
+ */
13
+ export declare function registerToolbarRenderer(type: string, component: Component<RendererProps>): void;
14
+ export declare function resolveRenderer(type: string): Component<RendererProps> | undefined;
@@ -0,0 +1,136 @@
1
+ import { JSX } from '../../../../solid-js';
2
+ import { CommandBus } from '../../../../../../../../core/commands/CommandBus.js';
3
+ import { CommandRef } from '../../../../../../../../core/commands/CommandRef.js';
4
+ import { TranslationKey } from '../../../../../../../../i18n/index.js';
5
+ import { ColorPalette } from '../../../../palette.js';
6
+
7
+ /** Reactive snapshot of a command's state, as consumed by toolbar items. */
8
+ export interface ToolbarCommandState {
9
+ isEnabled: boolean;
10
+ isActive: boolean;
11
+ value: unknown;
12
+ }
13
+ /**
14
+ * Narrow, read-only view of a document's named style. Carried as the value of
15
+ * the `documentStyles` command, for building select option lists.
16
+ */
17
+ export interface ToolbarDocumentStyle {
18
+ id: string;
19
+ name: string;
20
+ fontFamily?: string;
21
+ fontSize?: number;
22
+ }
23
+ /**
24
+ * Narrow surface every toolbar item depends on (DIP/ISP). Items only dispatch
25
+ * and observe commands — they never touch editor internals or `EditorState`.
26
+ * Even option-list data (e.g. document styles) arrives via `commandState`.
27
+ */
28
+ export interface ToolbarActionApi {
29
+ commands: CommandBus<ToolbarCommandState>;
30
+ t(key: TranslationKey, params?: unknown[]): string;
31
+ focusEditor(): void;
32
+ }
33
+ /** Per-item reactive overrides. All optional; default to command-derived. */
34
+ export interface ItemReactiveOverrides {
35
+ isActive?: (api: ToolbarActionApi) => boolean;
36
+ isDisabled?: (api: ToolbarActionApi) => boolean;
37
+ value?: (api: ToolbarActionApi) => unknown;
38
+ /** Contextual visibility — item stays mounted; the renderer toggles display. */
39
+ isVisible?: (api: ToolbarActionApi) => boolean;
40
+ }
41
+ interface ToolbarItemBase extends ItemReactiveOverrides {
42
+ id: string;
43
+ order?: number;
44
+ /** Logical section id (used for grouping/ordering, not rendering layout). */
45
+ group?: string;
46
+ testId?: string;
47
+ tooltipKey?: TranslationKey;
48
+ tooltip?: string;
49
+ iconName?: string;
50
+ }
51
+ export interface ButtonItem extends ToolbarItemBase {
52
+ type: "button";
53
+ /** The command this button dispatches — the only way an item acts. */
54
+ command: CommandRef;
55
+ labelKey?: TranslationKey;
56
+ label?: string;
57
+ wide?: boolean;
58
+ }
59
+ export interface ToggleItem extends ToolbarItemBase {
60
+ type: "toggle";
61
+ /** Toggles dispatch and derive `active` from this command (or an override). */
62
+ command: CommandRef;
63
+ labelKey?: TranslationKey;
64
+ label?: string;
65
+ wide?: boolean;
66
+ }
67
+ export type MenuContent = {
68
+ kind: "items";
69
+ items: ToolbarItem[];
70
+ } | {
71
+ kind: "custom";
72
+ render: (api: ToolbarActionApi) => JSX.Element;
73
+ };
74
+ export interface SplitItem extends ToolbarItemBase {
75
+ type: "split";
76
+ /** Command the main button dispatches (the chevron opens `menu`). */
77
+ command: CommandRef;
78
+ /** Chevron-opened content. */
79
+ menu: MenuContent;
80
+ }
81
+ export interface MenuItem extends ToolbarItemBase {
82
+ type: "menu";
83
+ content: MenuContent;
84
+ labelKey?: TranslationKey;
85
+ label?: string;
86
+ hideChevron?: boolean;
87
+ keepMounted?: boolean;
88
+ /** Extra class applied to the popover panel (e.g. "oasis-editor-toolbar-panel"). */
89
+ panelClass?: string;
90
+ }
91
+ export interface SelectOption {
92
+ value: string;
93
+ label: string;
94
+ }
95
+ export interface SelectItem extends ToolbarItemBase {
96
+ type: "select";
97
+ /** Command dispatched with the chosen value as payload. */
98
+ command: CommandRef;
99
+ options: (api: ToolbarActionApi) => SelectOption[];
100
+ /** Leading "empty" option label, if any (e.g. font placeholder). */
101
+ placeholder?: string;
102
+ width?: "wide" | "small" | "default";
103
+ }
104
+ export interface ColorPickerItem extends ToolbarItemBase {
105
+ type: "colorPicker";
106
+ kind: "color" | "highlight";
107
+ /** Command dispatched with the chosen color (or null) as payload. */
108
+ command: CommandRef;
109
+ palette?: ColorPalette;
110
+ defaultValue: string;
111
+ }
112
+ export interface GridPickerItem extends ToolbarItemBase {
113
+ type: "gridPicker";
114
+ /** Command dispatched with `{ rows, cols }` as payload. */
115
+ command: CommandRef;
116
+ maxRows?: number;
117
+ maxCols?: number;
118
+ }
119
+ export interface SeparatorItem {
120
+ type: "separator";
121
+ id: string;
122
+ order?: number;
123
+ group?: string;
124
+ isVisible?: (api: ToolbarActionApi) => boolean;
125
+ }
126
+ export interface GroupItem extends ToolbarItemBase {
127
+ type: "group";
128
+ items: ToolbarItem[];
129
+ }
130
+ export interface CustomItem extends ToolbarItemBase {
131
+ type: "custom";
132
+ render: (api: ToolbarActionApi) => JSX.Element;
133
+ }
134
+ export type ToolbarItem = ButtonItem | ToggleItem | SplitItem | MenuItem | SelectItem | ColorPickerItem | GridPickerItem | SeparatorItem | GroupItem | CustomItem;
135
+ export type ToolbarItemType = ToolbarItem["type"];
136
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface ColorSwatch {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ export interface ThemeColor {
6
+ name: string;
7
+ /** Shades from lightest to darkest, rendered as a vertical column. */
8
+ values: string[];
9
+ }
10
+ export interface ColorPalette {
11
+ themeColors: ThemeColor[];
12
+ standardColors: ColorSwatch[];
13
+ /** Show the native `<input type="color">` "more colors" action. Default true. */
14
+ allowCustom?: boolean;
15
+ }
@@ -0,0 +1,28 @@
1
+ import { CommandRef } from '../../../../../../../../core/commands/CommandRef.js';
2
+ import { ToolbarActionApi, ToolbarItem } from '../../../../../schema/items.js';
3
+
4
+ export interface ItemBinding {
5
+ active: () => boolean;
6
+ disabled: () => boolean;
7
+ value: () => unknown;
8
+ visible: () => boolean;
9
+ }
10
+ /**
11
+ * Resolves an item's reactive display state. Per-item overrides win; otherwise
12
+ * the bound command's state is used (DIP — controls never read editor internals).
13
+ */
14
+ export declare function bindItem(item: ToolbarItem, api: ToolbarActionApi): ItemBinding;
15
+ /** Unified action dispatch through the command registry. */
16
+ export declare function runItem(item: {
17
+ command: CommandRef;
18
+ }, api: ToolbarActionApi): void;
19
+ /** Resolve a tooltip from `tooltipKey` (i18n) or literal `tooltip`. */
20
+ export declare function resolveTooltip(item: {
21
+ tooltipKey?: Parameters<ToolbarActionApi["t"]>[0];
22
+ tooltip?: string;
23
+ }, api: ToolbarActionApi): string | undefined;
24
+ /** Resolve a label from `labelKey` (i18n) or literal `label`. */
25
+ export declare function resolveLabel(item: {
26
+ labelKey?: Parameters<ToolbarActionApi["t"]>[0];
27
+ label?: string;
28
+ }, api: ToolbarActionApi): string | undefined;
@@ -0,0 +1,14 @@
1
+ import { CommandBus } from '../../../../../../../../core/commands/CommandBus.js';
2
+ import { ToolbarActionApi, ToolbarCommandState } from '../../../../../schema/items.js';
3
+
4
+ /**
5
+ * Narrow host the toolbar needs from its embedding editor: nothing but the
6
+ * command registry — dispatch operations and observe their reactive state.
7
+ * There is no god context and no out-of-band editor read.
8
+ */
9
+ export interface ToolbarHost {
10
+ commands: CommandBus<ToolbarCommandState>;
11
+ focusEditor(): void;
12
+ }
13
+ /** Builds the {@link ToolbarActionApi} from the narrow {@link ToolbarHost}. */
14
+ export declare function createToolbarApi(host: () => ToolbarHost): ToolbarActionApi;
@@ -0,0 +1,16 @@
1
+ import { EditorUnderlineStyle } from '../../../../../../core/model.js';
2
+
3
+ export interface UnderlineStyleOption {
4
+ /** Word-style underline value (e.g. "single", "double", "dotted"). */
5
+ value: EditorUnderlineStyle;
6
+ /** Human-readable label. */
7
+ label: string;
8
+ /** CSS used by the menu preview stroke. */
9
+ preview: {
10
+ borderStyle: "solid" | "dashed" | "dotted" | "double" | "wavy";
11
+ borderBottomWidth?: string;
12
+ /** Optional inline SVG fallback for wavy patterns (canvas + PDF approximate this). */
13
+ svg?: string;
14
+ };
15
+ }
16
+ export declare const UNDERLINE_STYLE_OPTIONS: UnderlineStyleOption[];
@@ -0,0 +1,25 @@
1
+ import { EditorState } from '../../core/model.js';
2
+
3
+ export interface EditorTransactionOptions {
4
+ mergeKey?: string;
5
+ }
6
+ export interface EditorTransactionMeta {
7
+ mergeKey: string;
8
+ timestamp: number;
9
+ }
10
+ export interface EditorHistoryState {
11
+ undoStack: EditorState[];
12
+ redoStack: EditorState[];
13
+ lastTransactionMeta: EditorTransactionMeta | null;
14
+ }
15
+ export declare function createEmptyEditorHistoryState(): EditorHistoryState;
16
+ export declare function applyEditorHistoryTransaction(history: EditorHistoryState, previous: EditorState, next: EditorState, options?: EditorTransactionOptions, now?: number): EditorHistoryState;
17
+ export declare function resetEditorHistoryGrouping(history: EditorHistoryState): EditorHistoryState;
18
+ export declare function takeEditorUndoStep(history: EditorHistoryState, current: EditorState): {
19
+ history: EditorHistoryState;
20
+ nextState: EditorState;
21
+ } | null;
22
+ export declare function takeEditorRedoStep(history: EditorHistoryState, current: EditorState): {
23
+ history: EditorHistoryState;
24
+ nextState: EditorState;
25
+ } | null;
@@ -0,0 +1,65 @@
1
+ import { Accessor } from '../solid-js';
2
+ import { EditorState, EditorLayoutParagraph } from '../../core/model.js';
3
+ export interface InputBox {
4
+ left: number;
5
+ top: number;
6
+ height: number;
7
+ }
8
+ export interface CaretBox extends InputBox {
9
+ visible: boolean;
10
+ }
11
+ export interface SelectionBox {
12
+ left: number;
13
+ top: number;
14
+ width: number;
15
+ height: number;
16
+ }
17
+ export interface SelectedImageBox {
18
+ paragraphId: string;
19
+ startOffset: number;
20
+ endOffset: number;
21
+ left: number;
22
+ top: number;
23
+ width: number;
24
+ height: number;
25
+ }
26
+ export interface RevisionBox {
27
+ revisionId: string;
28
+ author: string;
29
+ date: number;
30
+ type: "insert" | "delete";
31
+ left: number;
32
+ top: number;
33
+ }
34
+ export type ImageResizeHandleDirection = "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
35
+ export declare const IMAGE_RESIZE_HANDLE_DIRECTIONS: ImageResizeHandleDirection[];
36
+ export interface EditorSurfaceProps {
37
+ state: Accessor<EditorState>;
38
+ measuredBlockHeights?: Accessor<Record<string, number>>;
39
+ measuredParagraphLayouts?: Accessor<Record<string, EditorLayoutParagraph>>;
40
+ layoutMode?: "fast" | "wordParity";
41
+ /**
42
+ * Phase 4: scroll viewport accessor for page virtualization.
43
+ * When provided, only pages within (or near) the viewport are rendered with
44
+ * their full block content; off-screen pages are replaced with a same-sized
45
+ * placeholder so scroll geometry is preserved. Optional — when omitted, all
46
+ * pages render in full (legacy behaviour).
47
+ */
48
+ viewportRef?: () => HTMLElement | undefined;
49
+ onSurfaceMouseDown: (event: MouseEvent) => void;
50
+ onSurfaceClick?: (event: MouseEvent) => void;
51
+ onSurfaceMouseMove?: (event: MouseEvent) => void;
52
+ onSurfaceDblClick: (event: MouseEvent) => void;
53
+ onParagraphMouseDown: (paragraphId: string, event: MouseEvent & {
54
+ currentTarget: HTMLParagraphElement;
55
+ }) => void;
56
+ onImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
57
+ currentTarget: HTMLElement;
58
+ }) => void;
59
+ onImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ImageResizeHandleDirection, event: MouseEvent & {
60
+ currentTarget: HTMLElement;
61
+ }) => void;
62
+ onTableDragHandleMouseDown: (tableId: string, event: MouseEvent) => void;
63
+ onRevisionMouseEnter: (revisionId: string, event: MouseEvent) => void;
64
+ onRevisionMouseLeave?: (revisionId: string, event: MouseEvent) => void;
65
+ }
@@ -0,0 +1,15 @@
1
+ import { EditorDocument } from '../../core/model.js';
2
+
3
+ export declare const DEFAULT_MAX_INSERTED_IMAGE_WIDTH = 624;
4
+ /**
5
+ * Maximum inline image width in CSS pixels for the given paragraph context.
6
+ *
7
+ * - When the paragraph lives inside a table cell, returns the cell's inner
8
+ * content width so the image fits the cell instead of overflowing it.
9
+ * - When the paragraph is in the regular body/header/footer flow, returns
10
+ * the page's content width (between margins).
11
+ *
12
+ * The `_surface` parameter is kept for API compatibility with callers that
13
+ * pass it; it is not used internally.
14
+ */
15
+ export declare function getMaxInlineImageWidth(_surface: HTMLElement | undefined, document: EditorDocument, paragraphId?: string, activeSectionIndex?: number): number;
@@ -0,0 +1,23 @@
1
+ import { EditorLayoutBlock, EditorLayoutDocument, EditorLayoutPage, EditorLayoutParagraph } from '../../core/model.js';
2
+
3
+ /**
4
+ * Returns true when two projected paragraph layouts produce visually identical
5
+ * output (same text, same line breaks, same vertical metrics). Reusing the
6
+ * previous object reference lets downstream consumers (canvas paint, DOM
7
+ * reconciliation) short-circuit work via cheap identity comparisons.
8
+ */
9
+ export declare function areLayoutParagraphsEquivalentForRender(previous: EditorLayoutParagraph | undefined, next: EditorLayoutParagraph | undefined): boolean;
10
+ export declare function canReuseLayoutBlock(previous: EditorLayoutBlock | undefined, next: EditorLayoutBlock): previous is EditorLayoutBlock;
11
+ export declare function canReuseLayoutPage(previous: EditorLayoutPage | undefined, next: EditorLayoutPage): previous is EditorLayoutPage;
12
+ /**
13
+ * Creates a stateful function that preserves object identity for projected
14
+ * layout pages/blocks when their contents are unchanged. Pages whose blocks
15
+ * are all reused will themselves be reused, so reactive consumers can skip
16
+ * work on a per-page basis.
17
+ *
18
+ * Usage:
19
+ *
20
+ * const stabilize = createLayoutIdentityStabilizer();
21
+ * const stableLayout = stabilize(projectDocumentLayout(...));
22
+ */
23
+ export declare function createLayoutIdentityStabilizer(): (layout: EditorLayoutDocument) => EditorLayoutDocument;
@@ -0,0 +1,9 @@
1
+ import { EditorState } from '../../core/model.js';
2
+ import { LayoutInvalidation } from '../../app/controllers/useEditorLayout.js';
3
+
4
+ /**
5
+ * Cheap diff between two editor states. Produces an explicit
6
+ * `LayoutInvalidation` hint for the layout controller, so the layout effect
7
+ * never has to walk every paragraph in the document on every keystroke.
8
+ */
9
+ export declare function computeLayoutInvalidationFromTransaction(prev: EditorState, next: EditorState): LayoutInvalidation;
@@ -0,0 +1,10 @@
1
+ import { OasisEditorAppProps } from '../OasisEditorApp.js';
2
+
3
+ export interface OasisMountInstance {
4
+ unmount: () => void;
5
+ }
6
+ /**
7
+ * Public vanilla JS mount function.
8
+ * Wraps the Solid.js entry point for framework-agnostic usage.
9
+ */
10
+ export declare function mount(target: HTMLElement, props?: OasisEditorAppProps): OasisMountInstance;
@@ -0,0 +1,3 @@
1
+ import { ShellProps } from '../../DocumentShell.js';
2
+
3
+ export declare function BalloonShell(props: ShellProps): import("solid-js").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { Accessor } from '../../solid-js';
2
+ import { OasisEditorEditorFileHandlers, OasisEditorEditorInputHandlers, OasisEditorEditorLayoutProps, OasisEditorEditorOverlayProps, OasisEditorEditorRefProps, OasisEditorEditorSurfaceHandlers } from '../../../OasisEditorEditor.js';
3
+ import { ToolbarHost } from '../../../components/Toolbar/state/createToolbarApi.js';
4
+ import { ToolbarRegistry } from '../../../components/Toolbar/registry/ToolbarRegistry.js';
5
+ import { EditorLayoutParagraph, EditorState } from '../../../../core/model.js';
6
+
7
+ export interface ShellProps {
8
+ state: EditorState;
9
+ toolbarHost: () => ToolbarHost;
10
+ persistenceStatus: () => string;
11
+ toolbarRegistry: ToolbarRegistry;
12
+ showChrome: boolean;
13
+ showTitleBar: boolean;
14
+ showMenubar: boolean;
15
+ showToolbar: boolean;
16
+ showOutline: boolean;
17
+ isReadOnly: boolean;
18
+ measuredBlockHeights: Accessor<Record<string, number>>;
19
+ measuredParagraphLayouts: Accessor<Record<string, EditorLayoutParagraph>>;
20
+ viewportHeight: Accessor<number | string | undefined>;
21
+ showFloatingTableToolbar: Accessor<boolean>;
22
+ layout: Omit<OasisEditorEditorLayoutProps, "measuredBlockHeights" | "measuredParagraphLayouts" | "viewportHeight" | "readOnly">;
23
+ overlays: Omit<OasisEditorEditorOverlayProps, "toolbarHost" | "persistenceStatus" | "showFloatingTableToolbar">;
24
+ refs: OasisEditorEditorRefProps;
25
+ surfaceHandlers: OasisEditorEditorSurfaceHandlers;
26
+ inputHandlers: OasisEditorEditorInputHandlers;
27
+ fileHandlers: OasisEditorEditorFileHandlers;
28
+ }
29
+ export declare function DocumentShell(props: ShellProps): import("solid-js").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ShellProps } from '../../DocumentShell.js';
2
+
3
+ export declare function InlineShell(props: ShellProps): import("solid-js").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { EditorDocument, EditorState, EditorTableNode } from '../../core/model.js';
2
+
3
+ /**
4
+ * Computes the visual column widths (in CSS pixels) for a table, taking
5
+ * into account `table.gridCols`, the resolved table width, and the number
6
+ * of visual columns derived from colSpan.
7
+ */
8
+ export declare function resolveTableColumnWidthsPx(table: EditorTableNode, pageContentWidthPx: number): number[];
9
+ /**
10
+ * Returns the inner content width (in CSS pixels) of the cell that contains the
11
+ * paragraph with the given id, or null if the paragraph is not inside a table
12
+ * in the active section. The returned width is what's actually available for
13
+ * inline content (subtracts borders and horizontal padding).
14
+ */
15
+ export declare function getTableCellContentWidthForParagraph(document: EditorDocument, paragraphId: string, activeSectionIndex: number): number | null;
16
+ export declare function getTableCellContentWidthForParagraphInState(state: EditorState, paragraphId: string): number | null;
@@ -0,0 +1,5 @@
1
+ import { measureParagraphLayoutFromRects } from '../../layoutProjection/index.js';
2
+
3
+ export declare function resolveClickOffset(event: MouseEvent & {
4
+ currentTarget: HTMLParagraphElement;
5
+ }, layoutParagraph: ReturnType<typeof measureParagraphLayoutFromRects>): number;