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.
- package/README.md +1 -0
- package/dist/__tests__/app/PersistenceService.test.d.ts +1 -0
- package/dist/__tests__/app/footnoteUiCommands.test.d.ts +1 -0
- package/dist/__tests__/commands/text.test.d.ts +1 -0
- package/dist/__tests__/core/editorPluginIntegration.test.d.ts +1 -0
- package/dist/__tests__/core/editorState.test.d.ts +1 -0
- package/dist/__tests__/core/footnotes.test.d.ts +1 -0
- package/dist/__tests__/core/model.test.d.ts +1 -0
- package/dist/__tests__/core/pluginCollection.test.d.ts +1 -0
- package/dist/__tests__/core/tableCommands.test.d.ts +1 -0
- package/dist/__tests__/export/docxExport.test.d.ts +1 -0
- package/dist/__tests__/export/footnotesExport.test.d.ts +1 -0
- package/dist/__tests__/export/pdfWriter.test.d.ts +1 -0
- package/dist/__tests__/export/underlineStyle.test.d.ts +1 -0
- package/dist/__tests__/import/docxComplexSmoke.test.d.ts +1 -0
- package/dist/__tests__/import/docxImport.test.d.ts +1 -0
- package/dist/__tests__/import/footnotesImport.test.d.ts +1 -0
- package/dist/__tests__/integration/documentFlow.test.d.ts +1 -0
- package/dist/__tests__/ui/CanvasTableLayout.test.d.ts +1 -0
- package/dist/__tests__/ui/canvasHitTestService.test.d.ts +1 -0
- package/dist/__tests__/ui/canvasLayoutSnapshot.test.d.ts +1 -0
- package/dist/__tests__/ui/canvasSelectionGeometry.test.d.ts +1 -0
- package/dist/__tests__/ui/canvasTextRendering.test.d.ts +1 -0
- package/dist/__tests__/ui/composeMeasuredParagraphLines.test.d.ts +1 -0
- package/dist/__tests__/ui/dialog.test.d.ts +1 -0
- package/dist/__tests__/ui/fontDialog.test.d.ts +1 -0
- package/dist/__tests__/ui/footnotesLayout.test.d.ts +1 -0
- package/dist/__tests__/ui/layoutIdentity.test.d.ts +1 -0
- package/dist/__tests__/ui/layoutProjection.test.d.ts +1 -0
- package/dist/__tests__/ui/registry.test.d.ts +1 -0
- package/dist/__tests__/ui/tabs.test.d.ts +1 -0
- package/dist/__tests__/ui/textMeasurementAlignment.test.d.ts +1 -0
- package/dist/__tests__/word-parity/fixtures/corpus.d.ts +10 -0
- package/dist/__tests__/word-parity/fixtures/loremFixtures.d.ts +8 -0
- package/dist/__tests__/word-parity/wordLayout.word-parity.d.ts +1 -0
- package/dist/app/bootstrap/createOasisEditorApp.d.ts +6 -0
- package/dist/app/bootstrap/createOasisEditorContainer.d.ts +6 -0
- package/dist/app/clipboard/htmlClipboardParser.d.ts +3 -0
- package/dist/app/controllers/EditorCommandRegistry.d.ts +23 -0
- package/dist/app/controllers/EditorCommandsController.d.ts +53 -0
- package/dist/app/controllers/documentIO/DocumentExporter.d.ts +11 -0
- package/dist/app/controllers/documentIO/DocumentImporter.d.ts +17 -0
- package/dist/app/controllers/documentIO/ImageInsertionService.d.ts +14 -0
- package/dist/app/controllers/documentIO/downloadBlob.d.ts +1 -0
- package/dist/app/controllers/tableOpsCellSpanCommands.d.ts +21 -0
- package/dist/app/controllers/tableOpsGuards.d.ts +19 -0
- package/dist/app/controllers/tableOpsMutationCommands.d.ts +4 -0
- package/dist/app/controllers/tableOpsRowColumnCommands.d.ts +12 -0
- package/dist/app/controllers/tableOpsSelectionAwareCommands.d.ts +20 -0
- package/dist/app/controllers/tableOpsSelectionNavigation.d.ts +7 -0
- package/dist/app/controllers/tableOpsSelectionRanges.d.ts +34 -0
- package/dist/app/controllers/useEditorClipboard.d.ts +28 -0
- package/dist/app/controllers/useEditorDocumentIO.d.ts +31 -0
- package/dist/app/controllers/useEditorFindReplace.d.ts +28 -0
- package/dist/app/controllers/useEditorHistoryActions.d.ts +21 -0
- package/dist/app/controllers/useEditorImageOperations.d.ts +72 -0
- package/dist/app/controllers/useEditorKeyboard.d.ts +50 -0
- package/dist/app/controllers/useEditorLayout.d.ts +42 -0
- package/dist/app/controllers/useEditorNavigation.d.ts +22 -0
- package/dist/app/controllers/useEditorPersistence.d.ts +16 -0
- package/dist/app/controllers/useEditorRevision.d.ts +12 -0
- package/dist/app/controllers/useEditorStyle.d.ts +23 -0
- package/dist/app/controllers/useEditorSurfaceEvents.d.ts +44 -0
- package/dist/app/controllers/useEditorTableDrag.d.ts +29 -0
- package/dist/app/controllers/useEditorTableOperations.d.ts +45 -0
- package/dist/app/controllers/useEditorTableResize.d.ts +32 -0
- package/dist/app/controllers/useEditorTextDrag.d.ts +38 -0
- package/dist/app/controllers/useEditorTextInput.d.ts +27 -0
- package/dist/app/services/FindReplaceService.d.ts +12 -0
- package/dist/app/services/PersistenceService.d.ts +11 -0
- package/dist/assets/Arimo-Bold.ttf +0 -0
- package/dist/assets/Arimo-BoldItalic.ttf +0 -0
- package/dist/assets/Arimo-Italic.ttf +0 -0
- package/dist/assets/Arimo-Regular.ttf +0 -0
- package/dist/assets/Carlito-Bold.ttf +0 -0
- package/dist/assets/Carlito-BoldItalic.ttf +0 -0
- package/dist/assets/Carlito-Italic.ttf +0 -0
- package/dist/assets/Carlito-Regular.ttf +0 -0
- package/dist/assets/Roboto-Italic.ttf +0 -0
- package/dist/assets/Roboto-Medium.ttf +0 -0
- package/dist/assets/Roboto-MediumItalic.ttf +0 -0
- package/dist/assets/Roboto-Regular.ttf +0 -0
- package/dist/assets/Tinos-Bold.ttf +0 -0
- package/dist/assets/Tinos-BoldItalic.ttf +0 -0
- package/dist/assets/Tinos-Italic.ttf +0 -0
- package/dist/assets/Tinos-Regular.ttf +0 -0
- package/dist/assets/importDocxWorker-DIQ28Lka.js +12 -0
- package/dist/core/Editor.d.ts +33 -0
- package/dist/core/cloneState.d.ts +8 -0
- package/dist/core/commands/CommandBus.d.ts +9 -0
- package/dist/core/commands/CommandRef.d.ts +10 -0
- package/dist/core/commands/CommandRegistry.d.ts +10 -0
- package/dist/core/commands/block.d.ts +11 -0
- package/dist/core/commands/clipboard.d.ts +13 -0
- package/dist/core/commands/footnotes.d.ts +27 -0
- package/dist/core/commands/history.d.ts +7 -0
- package/dist/core/commands/image.d.ts +15 -0
- package/dist/core/commands/link.d.ts +4 -0
- package/dist/core/commands/list.d.ts +10 -0
- package/dist/core/commands/misc.d.ts +3 -0
- package/dist/core/commands/selection.d.ts +12 -0
- package/dist/core/commands/table.d.ts +10 -0
- package/dist/core/commands/text.d.ts +12 -0
- package/dist/core/commands/utils.d.ts +69 -0
- package/dist/core/editorCommands.d.ts +14 -0
- package/dist/core/editorState.d.ts +66 -0
- package/dist/core/engine.d.ts +13 -0
- package/dist/core/footnotes.d.ts +42 -0
- package/dist/core/headings.d.ts +9 -0
- package/dist/core/model/queries.d.ts +8 -0
- package/dist/core/model.d.ts +447 -0
- package/dist/core/plugin.d.ts +64 -0
- package/dist/core/plugins/PluginCollection.d.ts +16 -0
- package/dist/core/selection.d.ts +19 -0
- package/dist/core/tableLayout.d.ts +13 -0
- package/dist/core/textStyleMappings.d.ts +8 -0
- package/dist/core/wordBoundaries.d.ts +7 -0
- package/dist/demo/OasisSiteApp.d.ts +1 -0
- package/dist/export/docx/docxTypes.d.ts +66 -0
- package/dist/export/docx/exportEditorDocumentToDocx.d.ts +4 -0
- package/dist/export/docx/footnotesXml.d.ts +40 -0
- package/dist/export/docx/tableXml.d.ts +4 -0
- package/dist/export/docx/textXml.d.ts +6 -0
- package/dist/export/docx/xmlUtils.d.ts +10 -0
- package/dist/export/pdf/OasisPdfWriter.d.ts +93 -0
- package/dist/export/pdf/draw/drawBlockList.d.ts +5 -0
- package/dist/export/pdf/draw/drawFragment.d.ts +7 -0
- package/dist/export/pdf/draw/drawPageBackground.d.ts +3 -0
- package/dist/export/pdf/draw/drawParagraph.d.ts +5 -0
- package/dist/export/pdf/draw/drawTable.d.ts +5 -0
- package/dist/export/pdf/draw/fragmentGeometry.d.ts +12 -0
- package/dist/export/pdf/draw/lists.d.ts +6 -0
- package/dist/export/pdf/exportEditorDocumentToPdf.d.ts +4 -0
- package/dist/export/pdf/fonts/PdfFontRegistry.d.ts +28 -0
- package/dist/export/pdf/fonts/collectPdfFontFamilies.d.ts +3 -0
- package/dist/export/pdf/images.d.ts +4 -0
- package/dist/export/pdf/layout/PdfTextMeasurer.d.ts +24 -0
- package/dist/export/pdf/layout/layoutParagraph.d.ts +37 -0
- package/dist/export/pdf/units.d.ts +6 -0
- package/dist/i18n/index.d.ts +7 -0
- package/dist/i18n/locales/en.d.ts +251 -0
- package/dist/i18n/locales/pt-BR.d.ts +251 -0
- package/dist/import/docx/assetRegistry.d.ts +18 -0
- package/dist/import/docx/footnotes.d.ts +17 -0
- package/dist/import/docx/headerFooter.d.ts +7 -0
- package/dist/import/docx/importDocxInWorker.d.ts +8 -0
- package/dist/import/docx/importDocxToEditorDocument.d.ts +7 -0
- package/dist/import/docx/importDocxWorker.d.ts +1 -0
- package/dist/import/docx/numbering.d.ts +9 -0
- package/dist/import/docx/paragraphs.d.ts +12 -0
- package/dist/import/docx/relationships.d.ts +4 -0
- package/dist/import/docx/runs.d.ts +41 -0
- package/dist/import/docx/sectionProperties.d.ts +16 -0
- package/dist/import/docx/settings.d.ts +4 -0
- package/dist/import/docx/styles.d.ts +24 -0
- package/dist/import/docx/tables.d.ts +8 -0
- package/dist/import/docx/themeFonts.d.ts +12 -0
- package/dist/import/docx/units.d.ts +9 -0
- package/dist/import/docx/xmlHelpers.d.ts +15 -0
- package/dist/index.d.ts +43 -0
- package/dist/layoutProjection/blockHeights.d.ts +1 -0
- package/dist/layoutProjection/blocksPagination.d.ts +18 -0
- package/dist/layoutProjection/constants.d.ts +1 -0
- package/dist/layoutProjection/documentLayout.d.ts +7 -0
- package/dist/layoutProjection/footnotePagination.d.ts +21 -0
- package/dist/layoutProjection/headerFooterFootnotes.d.ts +4 -0
- package/dist/layoutProjection/headerFooterProjection.d.ts +14 -0
- package/dist/layoutProjection/index.d.ts +7 -0
- package/dist/layoutProjection/paragraphPagination.d.ts +20 -0
- package/dist/layoutProjection/paragraphProjection.d.ts +1 -0
- package/dist/layoutProjection/sectionPagination.d.ts +35 -0
- package/dist/layoutProjection/tablePagination.d.ts +14 -0
- package/dist/layoutProjection/tableProjection.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/oasis-editor.css +1 -0
- package/dist/oasis-editor.js +80464 -0
- package/dist/oasis-editor.umd.cjs +24 -0
- package/dist/plugins/internal/createEssentialsPlugin.d.ts +135 -0
- package/dist/plugins/internal/essentialsCommandBuilders.d.ts +10 -0
- package/dist/plugins/internal/essentialsCommandGroups.d.ts +39 -0
- package/dist/testing/wordLayoutParity.d.ts +62 -0
- package/dist/ui/OasisEditorApp.d.ts +4 -0
- package/dist/ui/OasisEditorAppProps.d.ts +49 -0
- package/dist/ui/OasisEditorContainer.d.ts +6 -0
- package/dist/ui/OasisEditorEditor.d.ts +103 -0
- package/dist/ui/app/EditorDialogsLayer.d.ts +26 -0
- package/dist/ui/app/EditorDragLayers.d.ts +20 -0
- package/dist/ui/app/EditorWorkspace.d.ts +37 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +59 -0
- package/dist/ui/app/createEditorEssentialsPlugin.d.ts +42 -0
- package/dist/ui/app/createRuntimeCommandHost.d.ts +29 -0
- package/dist/ui/app/fontOptions.d.ts +5 -0
- package/dist/ui/app/shouldShowCaret.d.ts +9 -0
- package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +16 -0
- package/dist/ui/app/useEditorAppState.d.ts +11 -0
- package/dist/ui/app/useEditorContextMenuClipboard.d.ts +33 -0
- package/dist/ui/app/useEditorDialogs.d.ts +38 -0
- package/dist/ui/app/useEditorFocus.d.ts +11 -0
- package/dist/ui/app/useEditorFontOptions.d.ts +17 -0
- package/dist/ui/app/useEditorInteractionWiring.d.ts +64 -0
- package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +33 -0
- package/dist/ui/app/useEditorRuntimePlugins.d.ts +14 -0
- package/dist/ui/app/useEditorTransactions.d.ts +20 -0
- package/dist/ui/app/useEditorUiOptions.d.ts +24 -0
- package/dist/ui/app/useFontDialogBridge.d.ts +31 -0
- package/dist/ui/canvas/CanvasDebug.d.ts +125 -0
- package/dist/ui/canvas/CanvasGeometry.d.ts +35 -0
- package/dist/ui/canvas/CanvasHitTestService.d.ts +37 -0
- package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +93 -0
- package/dist/ui/canvas/CanvasSelectionGeometry.d.ts +20 -0
- package/dist/ui/canvas/CanvasTableLayout.d.ts +65 -0
- package/dist/ui/canvas/canvasBlockPainter.d.ts +4 -0
- package/dist/ui/canvas/canvasImageCache.d.ts +1 -0
- package/dist/ui/canvas/canvasPageRenderer.d.ts +18 -0
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +12 -0
- package/dist/ui/canvas/canvasTablePainter.d.ts +3 -0
- package/dist/ui/canvas/listNumbering.d.ts +3 -0
- package/dist/ui/caretGeometry.d.ts +30 -0
- package/dist/ui/clipboardImage.d.ts +2 -0
- package/dist/ui/components/CanvasEditorSurface.d.ts +5 -0
- package/dist/ui/components/CaretOverlay.d.ts +9 -0
- package/dist/ui/components/ContextMenu/ContextMenu.d.ts +19 -0
- package/dist/ui/components/Dialogs/Dialog.d.ts +17 -0
- package/dist/ui/components/Dialogs/FontDialog.d.ts +67 -0
- package/dist/ui/components/Dialogs/FontDialogModel.d.ts +15 -0
- package/dist/ui/components/Dialogs/ImageAltDialog.d.ts +8 -0
- package/dist/ui/components/Dialogs/LineSpacingDialog.d.ts +17 -0
- package/dist/ui/components/Dialogs/LinkDialog.d.ts +8 -0
- package/dist/ui/components/DropCaret.d.ts +16 -0
- package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +7 -0
- package/dist/ui/components/FloatingToolbar/FloatingTableToolbar.d.ts +11 -0
- package/dist/ui/components/Menubar/Menubar.d.ts +7 -0
- package/dist/ui/components/Menubar/defaultMenuItems.d.ts +3 -0
- package/dist/ui/components/Menubar/menuRegistry.d.ts +28 -0
- package/dist/ui/components/Outline/OutlinePanel.d.ts +10 -0
- package/dist/ui/components/PageBreak.d.ts +4 -0
- package/dist/ui/components/RevisionOverlay.d.ts +6 -0
- package/dist/ui/components/SelectionOverlay.d.ts +11 -0
- package/dist/ui/components/Tabs/Tabs.d.ts +18 -0
- package/dist/ui/components/TitleBar/TitleBar.d.ts +6 -0
- package/dist/ui/components/Toolbar/LineSpacingButton.d.ts +6 -0
- package/dist/ui/components/Toolbar/Toolbar.d.ts +15 -0
- package/dist/ui/components/Toolbar/ToolbarOverflowManager.d.ts +13 -0
- package/dist/ui/components/Toolbar/controls/ListOptionsControl.d.ts +7 -0
- package/dist/ui/components/Toolbar/controls/UnderlineControl.d.ts +10 -0
- package/dist/ui/components/Toolbar/groups/MetricGroup.d.ts +6 -0
- package/dist/ui/components/Toolbar/groups/SectionGroup.d.ts +6 -0
- package/dist/ui/components/Toolbar/groups/TableGroup.d.ts +6 -0
- package/dist/ui/components/Toolbar/presets/defaultPalette.d.ts +4 -0
- package/dist/ui/components/Toolbar/presets/defaultToolbar.d.ts +9 -0
- package/dist/ui/components/Toolbar/primitives/Button.d.ts +11 -0
- package/dist/ui/components/Toolbar/primitives/ColorPicker.d.ts +22 -0
- package/dist/ui/components/Toolbar/primitives/GridPicker.d.ts +12 -0
- package/dist/ui/components/Toolbar/primitives/Menu.d.ts +20 -0
- package/dist/ui/components/Toolbar/primitives/Popover.d.ts +34 -0
- package/dist/ui/components/Toolbar/primitives/Select.d.ts +12 -0
- package/dist/ui/components/Toolbar/primitives/Separator.d.ts +6 -0
- package/dist/ui/components/Toolbar/primitives/SplitButton.d.ts +30 -0
- package/dist/ui/components/Toolbar/primitives/useDismiss.d.ts +15 -0
- package/dist/ui/components/Toolbar/primitives/usePopoverPosition.d.ts +31 -0
- package/dist/ui/components/Toolbar/registry/ToolbarRegistry.d.ts +23 -0
- package/dist/ui/components/Toolbar/renderers/ToolbarItemRenderer.d.ts +13 -0
- package/dist/ui/components/Toolbar/renderers/renderers.d.ts +14 -0
- package/dist/ui/components/Toolbar/schema/items.d.ts +136 -0
- package/dist/ui/components/Toolbar/schema/palette.d.ts +15 -0
- package/dist/ui/components/Toolbar/state/bindItem.d.ts +28 -0
- package/dist/ui/components/Toolbar/state/createToolbarApi.d.ts +14 -0
- package/dist/ui/components/Toolbar/underlineStyles.d.ts +16 -0
- package/dist/ui/editorHistory.d.ts +25 -0
- package/dist/ui/editorUiTypes.d.ts +65 -0
- package/dist/ui/imageGeometry.d.ts +15 -0
- package/dist/ui/layoutIdentity.d.ts +23 -0
- package/dist/ui/layoutInvalidation.d.ts +9 -0
- package/dist/ui/mount.d.ts +10 -0
- package/dist/ui/shells/BalloonShell.d.ts +3 -0
- package/dist/ui/shells/DocumentShell.d.ts +29 -0
- package/dist/ui/shells/InlineShell.d.ts +3 -0
- package/dist/ui/tableGeometry.d.ts +16 -0
- package/dist/ui/tableUiUtils.d.ts +5 -0
- package/dist/ui/textMeasurement.d.ts +14 -0
- package/dist/ui/toolbarStyleState.d.ts +46 -0
- package/dist/ui/utils/IconManager.d.ts +2 -0
- package/dist/utils/indexeddb.d.ts +12 -0
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/performanceMetrics.d.ts +58 -0
- package/dist/utils/throttle.d.ts +4 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## soon
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface WordParityCorpusEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
fileName: string;
|
|
4
|
+
category: "baseline-lorem" | "header-footer" | "mixed-fonts" | "tables" | "page-breaks";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Canonical Word parity corpus manifest (Milestone 1, text-first).
|
|
8
|
+
* Add production documents here as they are curated.
|
|
9
|
+
*/
|
|
10
|
+
export declare const WORD_PARITY_CORPUS: WordParityCorpusEntry[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorDocument, EditorPageSettings } from '../../../../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare const A4_PAGE_SETTINGS: EditorPageSettings;
|
|
4
|
+
export declare const CALIBRI_11PX = 14.6667;
|
|
5
|
+
export declare const LOREM_PARAGRAPH: string;
|
|
6
|
+
export declare function createA4CalibriLoremSinglePageDocument(): EditorDocument;
|
|
7
|
+
export declare function createA4CalibriLoremMultipageDocument(): EditorDocument;
|
|
8
|
+
export declare function createA4LoremHeaderFooterDocument(): EditorDocument;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OasisEditorContainerProps } from '../../../../ui/OasisEditorContainer.js';
|
|
2
|
+
|
|
3
|
+
export interface OasisEditorContainerInstance {
|
|
4
|
+
dispose: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createOasisEditorContainer(container: HTMLElement, props?: OasisEditorContainerProps): OasisEditorContainerInstance;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditorKeyboardDeps } from '../../useEditorKeyboard.js';
|
|
2
|
+
|
|
3
|
+
export interface EditorCommandExecutor {
|
|
4
|
+
executeCommand: (commandName: string, payload?: unknown) => unknown;
|
|
5
|
+
canExecuteCommand?: (commandName: string, payload?: unknown) => boolean | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface EditorKeyBinding {
|
|
8
|
+
id: string;
|
|
9
|
+
command?: string;
|
|
10
|
+
key: string;
|
|
11
|
+
ctrlOrMeta?: boolean;
|
|
12
|
+
shift?: boolean;
|
|
13
|
+
alt?: boolean;
|
|
14
|
+
execute: (deps: EditorKeyboardDeps, event: KeyboardEvent) => boolean | void;
|
|
15
|
+
}
|
|
16
|
+
export declare class EditorCommandRegistry {
|
|
17
|
+
private bindings;
|
|
18
|
+
register(binding: EditorKeyBinding): void;
|
|
19
|
+
unregister(id: string): void;
|
|
20
|
+
getBindings(): EditorKeyBinding[];
|
|
21
|
+
execute(event: KeyboardEvent, deps: EditorKeyboardDeps, commandExecutor?: EditorCommandExecutor): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const defaultEditorKeyBindings: EditorKeyBinding[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EditorParagraphListStyle, EditorParagraphStyle, EditorSection, EditorState, EditorTextStyle } from '../../../../core/model.js';
|
|
2
|
+
import { EditorTransactionOptions } from '../../../../ui/editorHistory.js';
|
|
3
|
+
import { BooleanStyleKey, ParagraphStyleKey, ToolbarStyleState } from '../../../../ui/toolbarStyleState.js';
|
|
4
|
+
import { EditorLogger } from '../../../../utils/logger.js';
|
|
5
|
+
import { SelectedImageRun } from '../../../../core/commands/image.js';
|
|
6
|
+
|
|
7
|
+
export interface EditorCommandsControllerDeps {
|
|
8
|
+
state: EditorState;
|
|
9
|
+
logger: EditorLogger;
|
|
10
|
+
applyState: (next: EditorState) => void;
|
|
11
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: EditorTransactionOptions) => void;
|
|
12
|
+
applySelectionAwareTextCommand: (command: (current: EditorState) => EditorState) => void;
|
|
13
|
+
applySelectionAwareParagraphCommand: (command: (current: EditorState) => EditorState) => void;
|
|
14
|
+
applyTableAwareParagraphEdit: (current: EditorState, edit: (tempState: EditorState) => EditorState) => EditorState;
|
|
15
|
+
focusInput: () => void;
|
|
16
|
+
clearPreferredColumn: () => void;
|
|
17
|
+
resetTransactionGrouping: () => void;
|
|
18
|
+
toolbarStyleState: () => ToolbarStyleState;
|
|
19
|
+
selectionCollapsed: () => boolean;
|
|
20
|
+
selectedImageRun: () => SelectedImageRun | null;
|
|
21
|
+
openLinkDialog: (initialHref: string) => void;
|
|
22
|
+
openImageAltDialog: (initialAlt: string) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createEditorCommandsController(deps: EditorCommandsControllerDeps): {
|
|
25
|
+
applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
|
|
26
|
+
applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "link" | "underlineStyle">(key: K, value: EditorTextStyle[K] | null) => void;
|
|
27
|
+
applyParagraphStyleCommand: <K extends ParagraphStyleKey>(key: K, value: EditorParagraphStyle[K] | null) => void;
|
|
28
|
+
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext") => void;
|
|
29
|
+
applyParagraphListCommand: (kind: NonNullable<EditorParagraphListStyle["kind"]>) => void;
|
|
30
|
+
handleListFormatChange: (format: EditorParagraphListStyle["format"]) => void;
|
|
31
|
+
handleListStartAtChange: (startAt: number | null) => void;
|
|
32
|
+
applyInsertSectionBreakCommand: (breakType: "nextPage" | "continuous") => void;
|
|
33
|
+
applyInsertPageBreakCommand: () => void;
|
|
34
|
+
canInsertFootnoteCommand: () => boolean;
|
|
35
|
+
applyInsertFootnoteCommand: () => void;
|
|
36
|
+
handleStyleChange: (styleId: string) => void;
|
|
37
|
+
applyUpdateSectionSettingsCommand: (sectionIndex: number, settings: Partial<EditorSection>) => void;
|
|
38
|
+
applyToggleTrackChangesCommand: () => void;
|
|
39
|
+
applyToggleShowMarginsCommand: () => void;
|
|
40
|
+
applyToggleShowParagraphMarksCommand: () => void;
|
|
41
|
+
applyAcceptRevisionsCommand: () => void;
|
|
42
|
+
applyRejectRevisionsCommand: () => void;
|
|
43
|
+
applyLinkCommand: (href: string | null) => void;
|
|
44
|
+
promptForLink: () => void;
|
|
45
|
+
removeLinkCommand: () => void;
|
|
46
|
+
applyImageAltCommand: (alt: string) => void;
|
|
47
|
+
promptForImageAlt: () => void;
|
|
48
|
+
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
49
|
+
handleListEnter: () => boolean;
|
|
50
|
+
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
51
|
+
currentTarget: HTMLTextAreaElement;
|
|
52
|
+
}) => boolean;
|
|
53
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EditorDocument } from '../../../../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export interface DocumentExporterDeps {
|
|
4
|
+
document: () => EditorDocument;
|
|
5
|
+
focusInput: () => void;
|
|
6
|
+
download?: (blob: Blob, filename: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function createDocumentExporter(deps: DocumentExporterDeps): {
|
|
9
|
+
handleExportDocx: () => Promise<void>;
|
|
10
|
+
handleExportPdf: () => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EditorState } from '../../../../../../core/model.js';
|
|
2
|
+
import { EditorLogger } from '../../../../../../utils/logger.js';
|
|
3
|
+
import { ImportProgressPhase } from '../../../../useEditorDocumentIO.js';
|
|
4
|
+
|
|
5
|
+
export interface DocumentImporterDeps {
|
|
6
|
+
applyState: (state: EditorState) => void;
|
|
7
|
+
stabilizeLayoutAfterImport: () => Promise<void>;
|
|
8
|
+
resetEditorChromeState: () => void;
|
|
9
|
+
focusInput: () => void;
|
|
10
|
+
setImportPhase: (phase: ImportProgressPhase, subProgress?: number) => void;
|
|
11
|
+
clearImportProgressSoon: () => void;
|
|
12
|
+
now: () => number;
|
|
13
|
+
logger: EditorLogger;
|
|
14
|
+
}
|
|
15
|
+
export declare function createDocumentImporter(deps: DocumentImporterDeps): {
|
|
16
|
+
handleImportDocx: (file: File | null) => Promise<void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorPosition, EditorState } from '../../../../../../core/model.js';
|
|
2
|
+
import { EditorLogger } from '../../../../../../utils/logger.js';
|
|
3
|
+
|
|
4
|
+
export interface ImageInsertionServiceDeps {
|
|
5
|
+
state: () => EditorState;
|
|
6
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: {
|
|
7
|
+
mergeKey?: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
surfaceRef: () => HTMLDivElement | null;
|
|
10
|
+
logger: EditorLogger;
|
|
11
|
+
}
|
|
12
|
+
export declare function createImageInsertionService(deps: ImageInsertionServiceDeps): {
|
|
13
|
+
insertImageFromFile: (file: File, position?: EditorPosition | null) => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function downloadBlob(blob: Blob, filename: string): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { HorizontalTableCellRange, VerticalTableCellRange } from '../../tableOpsSelectionRanges.js';
|
|
3
|
+
|
|
4
|
+
interface TableCellSpanOperationsDeps {
|
|
5
|
+
getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[];
|
|
6
|
+
resolveHorizontalTableCellRange: (current: EditorState) => HorizontalTableCellRange | null;
|
|
7
|
+
resolveVerticalTableCellRange: (current: EditorState) => VerticalTableCellRange | null;
|
|
8
|
+
canMergeSelectedTableCells: (current: EditorState) => boolean;
|
|
9
|
+
canMergeSelectedTableRows: (current: EditorState) => boolean;
|
|
10
|
+
canSplitSelectedTableCell: (current: EditorState) => boolean;
|
|
11
|
+
canSplitSelectedTableCellVertically: (current: EditorState) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function createTableCellSpanOperations(deps: TableCellSpanOperationsDeps): {
|
|
14
|
+
mergeSelectedTableCells: (current: EditorState) => EditorState;
|
|
15
|
+
mergeSelectedTableRows: (current: EditorState) => EditorState;
|
|
16
|
+
mergeSelectedTable: (current: EditorState) => EditorState;
|
|
17
|
+
splitSelectedTableCellVertically: (current: EditorState) => EditorState;
|
|
18
|
+
splitSelectedTableCell: (current: EditorState) => EditorState;
|
|
19
|
+
splitSelectedTable: (current: EditorState) => EditorState;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { HorizontalTableCellRange, VerticalTableCellRange } from '../../tableOpsSelectionRanges.js';
|
|
3
|
+
|
|
4
|
+
interface TableOpsGuardsDeps {
|
|
5
|
+
getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[];
|
|
6
|
+
resolveHorizontalTableCellRange: (current: EditorState) => HorizontalTableCellRange | null;
|
|
7
|
+
resolveVerticalTableCellRange: (current: EditorState) => VerticalTableCellRange | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function createTableOpsGuards(deps: TableOpsGuardsDeps): {
|
|
10
|
+
canMergeSelectedTableCells: (current: EditorState) => boolean;
|
|
11
|
+
canSplitSelectedTableCell: (current: EditorState) => boolean;
|
|
12
|
+
canMergeSelectedTableRows: (current: EditorState) => boolean;
|
|
13
|
+
canMergeSelectedTable: (current: EditorState) => boolean;
|
|
14
|
+
canSplitSelectedTableCellVertically: (current: EditorState) => boolean;
|
|
15
|
+
canSplitSelectedTable: (current: EditorState) => boolean;
|
|
16
|
+
canEditSelectedTableRow: (current: EditorState) => boolean;
|
|
17
|
+
canEditSelectedTableColumn: (current: EditorState) => boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare const updateBlocksInCurrentSection: (current: EditorState, blocks: EditorBlockNode[], zone?: EditorEditingZone) => EditorState;
|
|
4
|
+
export declare const applyTableAwareParagraphEdit: (current: EditorState, getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[], edit: (tempState: EditorState) => EditorState) => EditorState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
interface TableRowColumnOperationsDeps {
|
|
4
|
+
getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare function createTableRowColumnOperations(deps: TableRowColumnOperationsDeps): {
|
|
7
|
+
insertSelectedTableRow: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
8
|
+
deleteSelectedTableRow: (current: EditorState) => EditorState;
|
|
9
|
+
insertSelectedTableColumn: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
10
|
+
deleteSelectedTableColumn: (current: EditorState) => EditorState;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { EditorLogger } from '../../../../utils/logger.js';
|
|
3
|
+
import { SelectedTableCells } from '../../tableOpsSelectionRanges.js';
|
|
4
|
+
|
|
5
|
+
interface TableSelectionAwareCommandsDeps {
|
|
6
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: {
|
|
7
|
+
mergeKey?: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
applySelectionToStatePreservingStructure: (current: EditorState, nextSelection: EditorState["selection"]) => EditorState;
|
|
10
|
+
getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[];
|
|
11
|
+
resolveTableCellRangeSelection: (current: EditorState) => EditorState["selection"] | null;
|
|
12
|
+
resolveSelectedTableCells: (current: EditorState) => SelectedTableCells | null;
|
|
13
|
+
logger?: EditorLogger;
|
|
14
|
+
}
|
|
15
|
+
export declare function createTableSelectionAwareCommands(deps: TableSelectionAwareCommandsDeps): {
|
|
16
|
+
withExpandedTableCellSelection: (current: EditorState) => EditorState;
|
|
17
|
+
applySelectionAwareTextCommand: (command: (current: EditorState) => EditorState) => void;
|
|
18
|
+
applySelectionAwareParagraphCommand: (command: (current: EditorState) => EditorState) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorDocument, EditorPosition, EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowNode } from '../../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare const getRowVisualWidth: (row: EditorTableRowNode) => number;
|
|
4
|
+
export declare const getTableVisualWidth: (table: EditorTableNode) => number;
|
|
5
|
+
export declare const findCellAtVisualColumn: (row: EditorTableRowNode, visualColumn: number) => EditorTableCellNode | null;
|
|
6
|
+
export declare const findFirstNavigableParagraphInTable: (table: EditorTableNode) => EditorParagraphNode | null;
|
|
7
|
+
export declare const resolveAdjacentTableCellPosition: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => EditorPosition | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorEditingZone, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { TableCellLayoutEntry } from '../../../../core/tableLayout.js';
|
|
3
|
+
import { EditorLogger } from '../../../../utils/logger.js';
|
|
4
|
+
|
|
5
|
+
export interface HorizontalTableCellRange {
|
|
6
|
+
blockIndex: number;
|
|
7
|
+
rowIndex: number;
|
|
8
|
+
startCellIndex: number;
|
|
9
|
+
endCellIndex: number;
|
|
10
|
+
zone: EditorEditingZone;
|
|
11
|
+
}
|
|
12
|
+
export interface VerticalTableCellRange {
|
|
13
|
+
blockIndex: number;
|
|
14
|
+
startRowIndex: number;
|
|
15
|
+
endRowIndex: number;
|
|
16
|
+
cellIndex: number;
|
|
17
|
+
zone: EditorEditingZone;
|
|
18
|
+
}
|
|
19
|
+
export interface SelectedTableCells {
|
|
20
|
+
blockIndex: number;
|
|
21
|
+
cells: TableCellLayoutEntry[];
|
|
22
|
+
zone: EditorEditingZone;
|
|
23
|
+
}
|
|
24
|
+
interface TableSelectionResolversDeps {
|
|
25
|
+
getTargetBlocks: (state: EditorState, zone: EditorEditingZone) => EditorBlockNode[];
|
|
26
|
+
logger?: EditorLogger;
|
|
27
|
+
}
|
|
28
|
+
export declare function createTableSelectionResolvers(deps: TableSelectionResolversDeps): {
|
|
29
|
+
resolveTableCellRangeSelection: (current: EditorState) => EditorState["selection"] | null;
|
|
30
|
+
resolveSelectedTableCells: (current: EditorState) => SelectedTableCells | null;
|
|
31
|
+
resolveHorizontalTableCellRange: (current: EditorState) => HorizontalTableCellRange | null;
|
|
32
|
+
resolveVerticalTableCellRange: (current: EditorState) => VerticalTableCellRange | null;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EditorPosition, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { EditorTransactionOptions } from '../../../../ui/editorHistory.js';
|
|
3
|
+
|
|
4
|
+
export interface EditorClipboardDeps {
|
|
5
|
+
state: () => EditorState;
|
|
6
|
+
isReadOnly: () => boolean;
|
|
7
|
+
forcePlainTextPaste: () => boolean;
|
|
8
|
+
setForcePlainTextPaste: (value: boolean) => void;
|
|
9
|
+
clearPreferredColumn: () => void;
|
|
10
|
+
resetTransactionGrouping: () => void;
|
|
11
|
+
applyTransactionalState: (transform: (state: EditorState) => EditorState, options?: EditorTransactionOptions) => void;
|
|
12
|
+
applyTableAwareParagraphEdit: (state: EditorState, edit: (state: EditorState) => EditorState) => EditorState;
|
|
13
|
+
focusInput: () => void;
|
|
14
|
+
insertImageFromFile: (file: File, position?: EditorPosition | null) => Promise<void>;
|
|
15
|
+
resolvePositionAtSurfacePoint: (clientX: number, clientY: number) => EditorPosition | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function createEditorClipboardController(deps: EditorClipboardDeps): {
|
|
18
|
+
handleCopy: (event: ClipboardEvent & {
|
|
19
|
+
currentTarget: HTMLTextAreaElement;
|
|
20
|
+
}) => void;
|
|
21
|
+
handleCut: (event: ClipboardEvent & {
|
|
22
|
+
currentTarget: HTMLTextAreaElement;
|
|
23
|
+
}) => void;
|
|
24
|
+
handlePaste: (event: ClipboardEvent & {
|
|
25
|
+
currentTarget: HTMLTextAreaElement;
|
|
26
|
+
}) => void;
|
|
27
|
+
handleDrop: (event: DragEvent) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EditorState, EditorPosition } from '../../../../core/model.js';
|
|
2
|
+
import { DocxImportStage } from '../../../../import/docx/importDocxToEditorDocument.js';
|
|
3
|
+
import { EditorLogger } from '../../../../utils/logger.js';
|
|
4
|
+
|
|
5
|
+
export type ImportProgressPhase = "reading-file" | DocxImportStage | "applying-editor-state" | "stabilizing-layout" | "done" | "error";
|
|
6
|
+
export interface ImportProgressState {
|
|
7
|
+
phase: ImportProgressPhase;
|
|
8
|
+
progress: number;
|
|
9
|
+
subProgress?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UseEditorDocumentIOProps {
|
|
12
|
+
state: () => EditorState;
|
|
13
|
+
applyState: (state: EditorState) => void;
|
|
14
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: {
|
|
15
|
+
mergeKey?: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
isReadOnly: () => boolean;
|
|
18
|
+
surfaceRef: () => HTMLDivElement | null;
|
|
19
|
+
stabilizeLayoutAfterImport: () => Promise<void>;
|
|
20
|
+
resetEditorChromeState: () => void;
|
|
21
|
+
focusInput: () => void;
|
|
22
|
+
logger: EditorLogger;
|
|
23
|
+
}
|
|
24
|
+
export declare function createEditorDocumentIO(deps: UseEditorDocumentIOProps): {
|
|
25
|
+
importProgress: import('../../solid-js').Accessor<ImportProgressState | null>;
|
|
26
|
+
handleImportDocx: (file: File | null) => Promise<void>;
|
|
27
|
+
handleExportDocx: () => Promise<void>;
|
|
28
|
+
handleExportPdf: () => Promise<void>;
|
|
29
|
+
insertImageFromFile: (file: File, position?: EditorPosition | null) => Promise<void>;
|
|
30
|
+
handleInsertImage: (file: File | null) => Promise<void>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FindOptions, FindReplaceMatch } from '../../../services/FindReplaceService.js';
|
|
2
|
+
import { EditorState } from '../../../../core/model.js';
|
|
3
|
+
|
|
4
|
+
export interface UseEditorFindReplaceResult {
|
|
5
|
+
searchTerm: () => string;
|
|
6
|
+
setSearchTerm: (term: string) => void;
|
|
7
|
+
replaceTerm: () => string;
|
|
8
|
+
setReplaceTerm: (term: string) => void;
|
|
9
|
+
findOptions: () => FindOptions;
|
|
10
|
+
setFindOptions: (options: FindOptions) => void;
|
|
11
|
+
matches: () => FindReplaceMatch[];
|
|
12
|
+
currentIndex: () => number;
|
|
13
|
+
findNext: () => void;
|
|
14
|
+
findPrevious: () => void;
|
|
15
|
+
replace: () => void;
|
|
16
|
+
replaceAll: () => void;
|
|
17
|
+
isOpen: () => boolean;
|
|
18
|
+
setIsOpen: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface FindReplaceDeps {
|
|
21
|
+
state: EditorState;
|
|
22
|
+
applyState: (next: EditorState) => void;
|
|
23
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: {
|
|
24
|
+
mergeKey?: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
focusInput: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function useEditorFindReplace(deps: FindReplaceDeps): UseEditorFindReplaceResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EditorHistoryState } from '../../../../ui/editorHistory.js';
|
|
2
|
+
import { EditorState } from '../../../../core/model.js';
|
|
3
|
+
import { createEditorImageOperations } from '../../useEditorImageOperations.js';
|
|
4
|
+
|
|
5
|
+
export interface UseEditorHistoryActionsProps {
|
|
6
|
+
state: () => EditorState;
|
|
7
|
+
stateSnapshot: () => EditorState;
|
|
8
|
+
applyHistoryState: (state: EditorState) => void;
|
|
9
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: any) => void;
|
|
10
|
+
focusInput: () => void;
|
|
11
|
+
clearPreferredColumn: () => void;
|
|
12
|
+
imageOps: () => ReturnType<typeof createEditorImageOperations>;
|
|
13
|
+
updateHistoryState: (updater: (current: EditorHistoryState) => EditorHistoryState) => void;
|
|
14
|
+
getHistoryState: () => EditorHistoryState;
|
|
15
|
+
}
|
|
16
|
+
export declare function createEditorHistoryActions(deps: UseEditorHistoryActionsProps): {
|
|
17
|
+
performUndo: () => void;
|
|
18
|
+
performRedo: () => void;
|
|
19
|
+
moveSelectedImageByParagraph: (direction: -1 | 1) => boolean;
|
|
20
|
+
applySelectionPreservingStructure: (nextSelection: EditorState["selection"]) => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { EditorPosition, EditorState } from '../../../../core/model.js';
|
|
2
|
+
import { ImageResizeHandleDirection } from '../../../../ui/editorUiTypes.js';
|
|
3
|
+
import { EditorLogger } from '../../../../utils/logger.js';
|
|
4
|
+
import { EditorHistoryState } from '../../../../ui/editorHistory.js';
|
|
5
|
+
|
|
6
|
+
export interface ActiveImageResize {
|
|
7
|
+
paragraphId: string;
|
|
8
|
+
paragraphOffset: number;
|
|
9
|
+
handleDirection: ImageResizeHandleDirection;
|
|
10
|
+
startClientX: number;
|
|
11
|
+
startClientY: number;
|
|
12
|
+
startWidth: number;
|
|
13
|
+
startHeight: number;
|
|
14
|
+
aspectRatio: number;
|
|
15
|
+
initialState: EditorState;
|
|
16
|
+
}
|
|
17
|
+
export interface ActiveImageDrag {
|
|
18
|
+
paragraphId: string;
|
|
19
|
+
paragraphOffset: number;
|
|
20
|
+
src: string;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
offsetX: number;
|
|
24
|
+
offsetY: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ImagePointerBounds {
|
|
27
|
+
left: number;
|
|
28
|
+
top: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
export interface EditorImageOperationsDeps {
|
|
33
|
+
state: EditorState;
|
|
34
|
+
surfaceRef: () => HTMLDivElement | undefined;
|
|
35
|
+
resolvePositionAtSurfacePoint: (clientX: number, clientY: number) => EditorPosition | null;
|
|
36
|
+
applyState: (next: EditorState) => void;
|
|
37
|
+
applyTransactionalState: (producer: (current: EditorState) => EditorState, options?: {
|
|
38
|
+
mergeKey?: string;
|
|
39
|
+
}) => void;
|
|
40
|
+
updateHistoryState: (updater: (current: EditorHistoryState) => EditorHistoryState) => void;
|
|
41
|
+
focusInput: () => void;
|
|
42
|
+
focusInputAfterPointerSelection: () => void;
|
|
43
|
+
cloneState: (source: EditorState) => EditorState;
|
|
44
|
+
logger: EditorLogger;
|
|
45
|
+
}
|
|
46
|
+
export declare function createEditorImageOperations(deps: EditorImageOperationsDeps): {
|
|
47
|
+
dragging: import('../../solid-js').Accessor<boolean>;
|
|
48
|
+
draggedImageInfo: import('../../solid-js').Accessor<ActiveImageDrag | null>;
|
|
49
|
+
mousePos: import('../../solid-js').Accessor<{
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}>;
|
|
53
|
+
dropTargetPos: import('../../solid-js').Accessor<EditorPosition | null>;
|
|
54
|
+
getSelectedImageInfo: (current: EditorState) => {
|
|
55
|
+
paragraph: import('../../../../core/model.js').EditorParagraphNode;
|
|
56
|
+
run: import('../../../../core/model.js').EditorTextRun;
|
|
57
|
+
startOffset: number;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
src: string;
|
|
61
|
+
} | null;
|
|
62
|
+
startImageDrag: (paragraphId: string, paragraphOffset: number, event: MouseEvent, pointerBounds?: ImagePointerBounds) => void;
|
|
63
|
+
startImageResize: (paragraphId: string, paragraphOffset: number, handleDirection: ImageResizeHandleDirection, event: MouseEvent, initialState: EditorState) => void;
|
|
64
|
+
stopImageDrag: () => void;
|
|
65
|
+
stopImageResize: () => void;
|
|
66
|
+
handleImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
|
|
67
|
+
currentTarget: HTMLElement;
|
|
68
|
+
}) => void;
|
|
69
|
+
handleImageResizeHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ImageResizeHandleDirection, event: MouseEvent & {
|
|
70
|
+
currentTarget: HTMLElement;
|
|
71
|
+
}) => void;
|
|
72
|
+
};
|