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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorLayoutFragment, EditorLayoutLine, EditorNamedStyle, EditorParagraphNode, EditorTextStyle } from '../../core/model.js';
|
|
2
|
+
import { ITextMeasurer } from '../../core/engine.js';
|
|
3
|
+
|
|
4
|
+
export interface TextMeasureOptions {
|
|
5
|
+
paragraph: EditorParagraphNode;
|
|
6
|
+
fragments: EditorLayoutFragment[];
|
|
7
|
+
styles?: Record<string, EditorNamedStyle>;
|
|
8
|
+
contentWidth?: number;
|
|
9
|
+
layoutMode?: "fast" | "wordParity";
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveRenderedLineHeightPx(styles: EditorTextStyle | undefined, lineHeightMultiple: number): number;
|
|
12
|
+
export declare function measureParagraphMinContentWidthPx(paragraph: EditorParagraphNode, styles?: Record<string, EditorNamedStyle>, layoutMode?: "fast" | "wordParity"): number;
|
|
13
|
+
export declare function composeMeasuredParagraphLines(options: TextMeasureOptions): EditorLayoutLine[];
|
|
14
|
+
export declare const domTextMeasurer: ITextMeasurer;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EditorState } from '../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export type BooleanStyleKey = "bold" | "italic" | "underline" | "strike" | "doubleStrike" | "superscript" | "subscript" | "smallCaps" | "allCaps" | "hidden" | "contextualAlternates";
|
|
4
|
+
export type ValueStyleKey = "fontFamily" | "fontSize" | "color" | "highlight" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
|
|
5
|
+
export type ParagraphStyleKey = "styleId" | "align" | "spacingBefore" | "spacingAfter" | "lineHeight" | "indentLeft" | "indentRight" | "indentFirstLine" | "indentHanging" | "shading" | "tabs" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "pageBreakBefore" | "keepWithNext";
|
|
6
|
+
export interface ToolbarStyleState {
|
|
7
|
+
bold: boolean;
|
|
8
|
+
italic: boolean;
|
|
9
|
+
underline: boolean;
|
|
10
|
+
underlineStyle: string;
|
|
11
|
+
underlineColor: string;
|
|
12
|
+
strike: boolean;
|
|
13
|
+
doubleStrike: boolean;
|
|
14
|
+
superscript: boolean;
|
|
15
|
+
subscript: boolean;
|
|
16
|
+
smallCaps: boolean;
|
|
17
|
+
allCaps: boolean;
|
|
18
|
+
hidden: boolean;
|
|
19
|
+
characterScale: string;
|
|
20
|
+
characterSpacing: string;
|
|
21
|
+
baselineShift: string;
|
|
22
|
+
kerningThreshold: string;
|
|
23
|
+
ligatures: string;
|
|
24
|
+
numberSpacing: string;
|
|
25
|
+
numberForm: string;
|
|
26
|
+
stylisticSet: string;
|
|
27
|
+
contextualAlternates: boolean;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
fontSize: string;
|
|
30
|
+
color: string;
|
|
31
|
+
highlight: string;
|
|
32
|
+
link: string;
|
|
33
|
+
styleId: string;
|
|
34
|
+
align: string;
|
|
35
|
+
lineHeight: string;
|
|
36
|
+
spacingBefore: string;
|
|
37
|
+
spacingAfter: string;
|
|
38
|
+
indentLeft: string;
|
|
39
|
+
indentFirstLine: string;
|
|
40
|
+
indentHanging: string;
|
|
41
|
+
shading: string;
|
|
42
|
+
listKind: string;
|
|
43
|
+
pageBreakBefore: boolean;
|
|
44
|
+
keepWithNext: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function getToolbarStyleState(state: EditorState): ToolbarStyleState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple Promise-based wrapper for IndexedDB operations.
|
|
3
|
+
*/
|
|
4
|
+
export interface IndexedDBOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
version: number;
|
|
7
|
+
onUpgrade: (db: IDBDatabase, oldVersion: number, newVersion: number | null) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function openDB(options: IndexedDBOptions): Promise<IDBDatabase>;
|
|
10
|
+
export declare function putItem<T>(db: IDBDatabase, storeName: string, key: string, value: T): Promise<void>;
|
|
11
|
+
export declare function getItem<T>(db: IDBDatabase, storeName: string, key: string): Promise<T | null>;
|
|
12
|
+
export declare function deleteItem(db: IDBDatabase, storeName: string, key: string): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface DebugControl {
|
|
2
|
+
enable: () => void;
|
|
3
|
+
disable: () => void;
|
|
4
|
+
isEnabled: () => boolean;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
__OASIS_EDITOR_DEBUG__?: boolean;
|
|
9
|
+
__OASIS_EDITOR_DEBUG_CONTROL__?: DebugControl;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare function isEditorDebugEnabled(): boolean;
|
|
13
|
+
export declare function setEditorDebugEnabled(enabled: boolean): void;
|
|
14
|
+
export declare function installEditorDebugControl(): void;
|
|
15
|
+
export type EditorLogger = ReturnType<typeof createEditorLogger>;
|
|
16
|
+
export declare function createEditorLogger(scope: string): {
|
|
17
|
+
debug: (message: string, payload?: unknown) => void;
|
|
18
|
+
info: (message: string, payload?: unknown) => void;
|
|
19
|
+
warn: (message: string, payload?: unknown) => void;
|
|
20
|
+
error: (message: string, payload?: unknown) => void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance metrics infrastructure for oasis-editor.
|
|
3
|
+
*
|
|
4
|
+
* Captures longtasks, marks input-to-layout latency, and exposes
|
|
5
|
+
* a global report via `window.__OASIS_PERF_REPORT()`.
|
|
6
|
+
*/
|
|
7
|
+
interface PerfMark {
|
|
8
|
+
name: string;
|
|
9
|
+
duration: number;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
interface LongTaskEntry {
|
|
13
|
+
duration: number;
|
|
14
|
+
startTime: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function markStart(label: string): void;
|
|
17
|
+
export declare function markEnd(label: string): void;
|
|
18
|
+
export declare function recordDuration(label: string, durationMs: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* Synchronous timing helper. Use to wrap a hot function and record
|
|
21
|
+
* its duration to the perf log:
|
|
22
|
+
*
|
|
23
|
+
* const result = perfTimer("layout:project", () => projectDocumentLayout(...));
|
|
24
|
+
*
|
|
25
|
+
* Records via `recordDuration` only when the duration exceeds
|
|
26
|
+
* `minMs` to avoid log spam. Always returns the inner result.
|
|
27
|
+
*/
|
|
28
|
+
export declare function perfTimer<T>(label: string, fn: () => T, minMs?: number): T;
|
|
29
|
+
/**
|
|
30
|
+
* Walk a surface element and report DOM-size statistics.
|
|
31
|
+
* Call from devtools as `window.__OASIS_DOM_STATS()`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function snapshotEditorDomStats(surface: HTMLElement | null | undefined): {
|
|
34
|
+
totalNodes: number;
|
|
35
|
+
pages: number;
|
|
36
|
+
blocks: number;
|
|
37
|
+
paragraphs: number;
|
|
38
|
+
lines: number;
|
|
39
|
+
charSpans: number;
|
|
40
|
+
segmentSpans: number;
|
|
41
|
+
runSpans: number;
|
|
42
|
+
};
|
|
43
|
+
export declare function registerDomStatsSurface(getSurface: () => HTMLElement | null | undefined): void;
|
|
44
|
+
export declare function getMarks(): ReadonlyArray<PerfMark>;
|
|
45
|
+
export declare function getLongTasks(): ReadonlyArray<LongTaskEntry>;
|
|
46
|
+
export declare function clearAllMetrics(): void;
|
|
47
|
+
export declare function startLongTaskObserver(): void;
|
|
48
|
+
export declare function stopLongTaskObserver(): void;
|
|
49
|
+
export declare function computePercentiles(durations: number[]): {
|
|
50
|
+
p50: number;
|
|
51
|
+
p95: number;
|
|
52
|
+
p99: number;
|
|
53
|
+
max: number;
|
|
54
|
+
count: number;
|
|
55
|
+
};
|
|
56
|
+
export declare function installGlobalReport(): void;
|
|
57
|
+
export declare function uninstallGlobalReport(): void;
|
|
58
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oasis-editor",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/oasis-editor.umd.cjs",
|
|
6
|
+
"module": "./dist/oasis-editor.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/oasis-editor.js",
|
|
12
|
+
"require": "./dist/oasis-editor.umd.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./style.css": "./dist/oasis-editor.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build:lib": "vite build --mode lib",
|
|
22
|
+
"build:app": "vite build",
|
|
23
|
+
"build": "npm run build:lib && npm run build:app",
|
|
24
|
+
"prepack": "npm run build:lib",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"test:perf": "playwright test",
|
|
27
|
+
"wasm:build": "wasm-pack build ./rust-core --target web --out-dir ../public/wasm",
|
|
28
|
+
"dev:rust": "npm run wasm:build && vite",
|
|
29
|
+
"build:all": "npm run wasm:build && npm run build",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:word-parity": "vitest run --config vitest.word-parity.config.js",
|
|
32
|
+
"lint": "eslint src --ext .ts",
|
|
33
|
+
"format": "prettier --write \"src/**/*.ts\""
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@playwright/test": "^1.59.1",
|
|
37
|
+
"@types/jszip": "^3.4.0",
|
|
38
|
+
"@types/node": "^20.0.0",
|
|
39
|
+
"@types/pdfmake": "^0.3.2",
|
|
40
|
+
"@types/web": "^0.0.115",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
42
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
43
|
+
"eslint": "^8.56.0",
|
|
44
|
+
"eslint-config-prettier": "^9.1.0",
|
|
45
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
46
|
+
"fake-indexeddb": "^6.2.5",
|
|
47
|
+
"jsdom": "^29.0.2",
|
|
48
|
+
"prettier": "^3.2.5",
|
|
49
|
+
"terser": "^5.46.1",
|
|
50
|
+
"ts-morph": "^28.0.0",
|
|
51
|
+
"tsx": "^4.22.4",
|
|
52
|
+
"typescript": "^5.3.3",
|
|
53
|
+
"vite": "^5.4.19",
|
|
54
|
+
"vite-plugin-dts": "^3.7.3",
|
|
55
|
+
"vite-plugin-solid": "^2.11.12",
|
|
56
|
+
"vitest": "^1.3.1"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@xmldom/xmldom": "^0.9.10",
|
|
60
|
+
"jszip": "^3.10.1",
|
|
61
|
+
"lucide": "^1.11.0",
|
|
62
|
+
"pdfmake": "^0.3.7",
|
|
63
|
+
"solid-js": "^1.9.12"
|
|
64
|
+
}
|
|
65
|
+
}
|