oasis-editor 0.0.1 → 0.0.2
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 +388 -1
- package/dist/OasisEditorApp-DEnDLTaw.js +45893 -0
- package/dist/app/bootstrap/createOasisEditorApp.d.ts +2 -3
- package/dist/app/bootstrap/createOasisEditorContainer.d.ts +2 -3
- package/dist/app/client/OasisEditorClient.d.ts +97 -0
- package/dist/app/controllers/EditorCommandsController.d.ts +1 -1
- package/dist/app/controllers/createResizeSession.d.ts +43 -0
- package/dist/app/controllers/createRotateSession.d.ts +36 -0
- package/dist/app/controllers/documentIO/DocumentImporter.d.ts +1 -1
- package/dist/app/controllers/tableResize/tableResizeApply.d.ts +5 -0
- package/dist/app/controllers/tableResize/tableResizeConstraints.d.ts +17 -0
- package/dist/app/controllers/tableResize/tableResizeDom.d.ts +9 -0
- package/dist/app/controllers/tableResize/tableResizeGeometry.d.ts +5 -0
- package/dist/app/controllers/tableResize/tableResizeHitTest.d.ts +4 -0
- package/dist/app/controllers/tableResize/tableResizeTypes.d.ts +65 -0
- package/dist/app/controllers/tableResize/tableResizeUnits.d.ts +6 -0
- package/dist/app/controllers/useEditorDocumentIO.d.ts +3 -3
- package/dist/app/controllers/useEditorHistoryActions.d.ts +3 -1
- package/dist/app/controllers/useEditorImageOperations.d.ts +6 -14
- package/dist/app/controllers/useEditorLayout.d.ts +2 -2
- package/dist/app/controllers/useEditorStyle.d.ts +1 -1
- package/dist/app/controllers/useEditorSurfaceEvents.d.ts +1 -0
- package/dist/app/controllers/useEditorTableOperations.d.ts +2 -2
- package/dist/app/controllers/useEditorTableResize.d.ts +2 -24
- package/dist/app/controllers/useEditorTextBoxOperations.d.ts +24 -0
- package/dist/app/services/userPreferences.d.ts +4 -0
- package/dist/assets/importDocxWorker-R5rI6JIO.js +12 -0
- package/dist/branding/apple-touch-icon.png +0 -0
- package/dist/branding/brand-mark.webp +0 -0
- package/dist/branding/favicon-16x16.png +0 -0
- package/dist/branding/favicon-32x32.png +0 -0
- package/dist/branding/favicon.ico +0 -0
- package/dist/branding/github-pages-icon.png +0 -0
- package/dist/branding/icon-192.png +0 -0
- package/dist/branding/icon-512.png +0 -0
- package/dist/branding/logo-full.png +0 -0
- package/dist/branding/logo-mark-square.png +0 -0
- package/dist/branding/social-card.png +0 -0
- package/dist/core/Editor.d.ts +4 -5
- package/dist/core/cloneState.d.ts +3 -1
- package/dist/core/commands/CommandRegistry.d.ts +6 -1
- package/dist/core/commands/block.d.ts +1 -1
- package/dist/core/commands/builtinCommands.d.ts +2 -0
- package/dist/core/commands/floatingLayout.d.ts +29 -0
- package/dist/core/commands/image.d.ts +16 -8
- package/dist/core/commands/list.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +110 -0
- package/dist/core/commands/selectedObjectRun.d.ts +20 -0
- package/dist/core/commands/table/insertTableCommand.d.ts +3 -0
- package/dist/core/commands/table/tableCellStyleCommands.d.ts +5 -0
- package/dist/core/commands/table/tableColumnCommands.d.ts +3 -0
- package/dist/core/commands/table/tableCommandUtils.d.ts +16 -0
- package/dist/core/commands/table/tableRowCommands.d.ts +5 -0
- package/dist/core/commands/table/tableStyleCommands.d.ts +4 -0
- package/dist/core/commands/table.d.ts +5 -10
- package/dist/core/commands/text.d.ts +1 -1
- package/dist/core/commands/textBox.d.ts +21 -0
- package/dist/core/document/blockReplacement.d.ts +7 -0
- package/dist/core/document/bookmarkAnchors.d.ts +8 -0
- package/dist/core/document/clone.d.ts +8 -0
- package/dist/core/document/paragraphRunBuild.d.ts +14 -0
- package/dist/core/document/paragraphRunEdit.d.ts +3 -0
- package/dist/core/document/paragraphRunQuery.d.ts +14 -0
- package/dist/core/document/paragraphRuns.d.ts +3 -0
- package/dist/core/editorCommands.d.ts +2 -0
- package/dist/core/editorState.d.ts +5 -3
- package/dist/core/endnotes.d.ts +41 -0
- package/dist/core/engine.d.ts +18 -3
- package/dist/core/html/htmlBlockWalker.d.ts +17 -0
- package/dist/core/html/htmlEscape.d.ts +1 -0
- package/dist/core/html/htmlStyleParser.d.ts +3 -0
- package/dist/core/html/htmlTextSerializer.d.ts +5 -0
- package/dist/core/html/inlineImageParser.d.ts +3 -0
- package/dist/core/html/inlineStyleParser.d.ts +3 -0
- package/dist/core/html/paragraphStyleParser.d.ts +3 -0
- package/dist/core/html/styleCss.d.ts +5 -0
- package/dist/core/model/assets.d.ts +7 -0
- package/dist/core/model/documentIndex.d.ts +58 -0
- package/dist/core/model/documentSections.d.ts +4 -0
- package/dist/core/model/editingZones.d.ts +26 -0
- package/dist/core/model/editorState.d.ts +18 -0
- package/dist/core/model/index.d.ts +31 -0
- package/dist/core/model/pageGeometry.d.ts +14 -0
- package/dist/core/model/paragraphWalker.d.ts +5 -0
- package/dist/core/model/queries.d.ts +2 -1
- package/dist/core/model/styleDefaults.d.ts +6 -0
- package/dist/core/model/styleResolution.d.ts +44 -0
- package/dist/core/model/types/document.d.ts +86 -0
- package/dist/core/model/types/documentBookmarks.d.ts +49 -0
- package/dist/core/model/types/documentEndnotes.d.ts +8 -0
- package/dist/core/model/types/documentFootnotes.d.ts +8 -0
- package/dist/core/model/types/layout.d.ts +93 -0
- package/dist/core/model/types/nodes.d.ts +192 -0
- package/dist/core/model/types/primitives.d.ts +140 -0
- package/dist/core/model/types/selection.d.ts +14 -0
- package/dist/core/model/types/styles.d.ts +149 -0
- package/dist/core/model.d.ts +7 -444
- package/dist/core/plugin.d.ts +59 -6
- package/dist/core/plugins/PluginCollection.d.ts +1 -0
- package/dist/core/plugins/PluginUiRegistry.d.ts +20 -0
- package/dist/core/selection/navigation.d.ts +5 -0
- package/dist/core/selection/rangeEditing.d.ts +13 -0
- package/dist/core/textStyle/textStyleKeys.d.ts +6 -0
- package/dist/core/textStyle/textStyleMutations.d.ts +8 -0
- package/dist/export/docx/bookmarksXml.d.ts +21 -0
- package/dist/export/docx/borders.d.ts +25 -0
- package/dist/export/docx/docxTypes.d.ts +35 -2
- package/dist/export/docx/endnotesXml.d.ts +24 -0
- package/dist/export/docx/stylesXml.d.ts +3 -0
- package/dist/export/docx/tableXml.d.ts +7 -1
- package/dist/export/docx/text/blocksXml.d.ts +7 -0
- package/dist/export/docx/text/constants.d.ts +6 -0
- package/dist/export/docx/text/drawingContainerXml.d.ts +16 -0
- package/dist/export/docx/text/dropCapXml.d.ts +9 -0
- package/dist/export/docx/text/endnoteRunXml.d.ts +5 -0
- package/dist/export/docx/text/fieldRunXml.d.ts +11 -0
- package/dist/export/docx/text/footnoteRunXml.d.ts +5 -0
- package/dist/export/docx/text/hyperlinkXml.d.ts +3 -0
- package/dist/export/docx/text/imageRunXml.d.ts +3 -0
- package/dist/export/docx/text/paragraphPropertiesXml.d.ts +16 -0
- package/dist/export/docx/text/runPropertiesXml.d.ts +3 -0
- package/dist/export/docx/text/runTextXml.d.ts +1 -0
- package/dist/export/docx/text/runXml.d.ts +5 -0
- package/dist/export/docx/text/styleMaterialization.d.ts +4 -0
- package/dist/export/docx/text/textBoxRunXml.d.ts +4 -0
- package/dist/export/docx/textXml.d.ts +1 -6
- package/dist/export/pdf/OasisPdfWriter.d.ts +1 -0
- package/dist/export/pdf/draw/borderDash.d.ts +11 -0
- package/dist/export/pdf/draw/drawFragment.d.ts +1 -0
- package/dist/export/pdf/draw/drawParagraph.d.ts +8 -1
- package/dist/export/pdf/fonts/TrueTypePdfFontSubsetter.d.ts +5 -0
- package/dist/export/pdf/fonts/officeFontAssets.d.ts +24 -0
- package/dist/export/pdf/units.d.ts +2 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/en.d.ts +108 -0
- package/dist/i18n/locales/pt-BR.d.ts +108 -0
- package/dist/import/DocumentFormatImporter.d.ts +26 -0
- package/dist/import/documentImporterRegistry.d.ts +6 -0
- package/dist/import/docx/bookmarks.d.ts +8 -0
- package/dist/import/docx/borders.d.ts +37 -0
- package/dist/import/docx/docxImporter.d.ts +3 -0
- package/dist/import/docx/dropCap.d.ts +13 -0
- package/dist/import/docx/endnotes.d.ts +17 -0
- package/dist/import/docx/footnotes.d.ts +2 -2
- package/dist/import/docx/headerFooter.d.ts +2 -2
- package/dist/import/docx/nestedBlocks.d.ts +15 -0
- package/dist/import/docx/numbering.d.ts +16 -1
- package/dist/import/docx/{styles.d.ts → paragraphStyle.d.ts} +2 -8
- package/dist/import/docx/paragraphs.d.ts +5 -4
- package/dist/import/docx/runStyle.d.ts +6 -0
- package/dist/import/docx/runs/drawingImage.d.ts +13 -0
- package/dist/import/docx/runs/fields.d.ts +3 -0
- package/dist/import/docx/runs/relationships.d.ts +11 -0
- package/dist/import/docx/runs/textBox.d.ts +6 -0
- package/dist/import/docx/runs/types.d.ts +42 -0
- package/dist/import/docx/runs/units.d.ts +11 -0
- package/dist/import/docx/runs/vmlImage.d.ts +6 -0
- package/dist/import/docx/runs.d.ts +14 -34
- package/dist/import/docx/sectionProperties.d.ts +1 -1
- package/dist/import/docx/settings.d.ts +1 -0
- package/dist/import/docx/styleUtils.d.ts +6 -0
- package/dist/import/docx/stylesXml.d.ts +4 -0
- package/dist/import/docx/tables.d.ts +2 -2
- package/dist/import/docx/theme.d.ts +17 -0
- package/dist/import/docx/themeColors.d.ts +37 -0
- package/dist/import/docx/themeFonts.d.ts +5 -1
- package/dist/import/docx/xmlHelpers.d.ts +3 -1
- package/dist/import/html/htmlImporter.d.ts +3 -0
- package/dist/import/html/importHtmlToEditorDocument.d.ts +8 -0
- package/dist/index-DuS88s1l.js +36810 -0
- package/dist/index.d.ts +39 -14
- package/dist/layoutProjection/blockHeights.d.ts +1 -1
- package/dist/layoutProjection/blocksPagination.d.ts +1 -1
- package/dist/layoutProjection/constants.d.ts +9 -1
- package/dist/layoutProjection/documentLayout.d.ts +0 -1
- package/dist/layoutProjection/dropCapExclusion.d.ts +23 -0
- package/dist/layoutProjection/endnotePagination.d.ts +8 -0
- package/dist/layoutProjection/floatingObjects.d.ts +45 -0
- package/dist/layoutProjection/footnotePagination.d.ts +1 -2
- package/dist/layoutProjection/headerFooterFootnotes.d.ts +1 -1
- package/dist/layoutProjection/headerFooterProjection.d.ts +3 -3
- package/dist/layoutProjection/index.d.ts +9 -7
- package/dist/layoutProjection/paragraphBorders.d.ts +14 -0
- package/dist/layoutProjection/paragraphPagination.d.ts +23 -9
- package/dist/layoutProjection/paragraphProjection.d.ts +1 -1
- package/dist/layoutProjection/sectionPagination.d.ts +3 -2
- package/dist/layoutProjection/tablePagination.d.ts +3 -2
- package/dist/layoutProjection/tableProjection.d.ts +1 -1
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +52 -80462
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/createEssentialsPlugin.d.ts +8 -1
- package/dist/react.d.ts +12 -0
- package/dist/react.js +24 -0
- package/dist/testing/wordLayoutParity.d.ts +0 -3
- package/dist/text/fonts/FontMetricsProvider.d.ts +38 -0
- package/dist/text/fonts/FontProgramFactory.d.ts +6 -0
- package/dist/text/fonts/core/types.d.ts +69 -0
- package/dist/text/fonts/decoders/Brotli.d.ts +4 -0
- package/dist/text/fonts/decoders/FontDecoderRegistry.d.ts +10 -0
- package/dist/text/fonts/decoders/TtfDecoder.d.ts +8 -0
- package/dist/text/fonts/decoders/Woff2Decoder.d.ts +45 -0
- package/dist/text/fonts/layout/SimpleTextLayouter.d.ts +7 -0
- package/dist/text/fonts/preciseFontMetrics.d.ts +16 -0
- package/dist/text/fonts/preciseFontMode.d.ts +7 -0
- package/dist/text/fonts/sfnt/SfntFontProgram.d.ts +29 -0
- package/dist/text/fonts/vendor/woff2/buffer.d.ts +24 -0
- package/dist/text/fonts/vendor/woff2/glyf-reconstructor.d.ts +55 -0
- package/dist/text/fonts/vendor/woff2/hmtx-reconstructor.d.ts +5 -0
- package/dist/text/fonts/vendor/woff2/sfnt-builder.d.ts +7 -0
- package/dist/text/fonts/vendor/woff2/utils.d.ts +12 -0
- package/dist/text/truetype/AdvanceWidthSource.d.ts +19 -0
- package/dist/text/truetype/BinaryReader.d.ts +28 -0
- package/dist/text/truetype/CmapParser.d.ts +15 -0
- package/dist/text/truetype/SfntTableDirectory.d.ts +26 -0
- package/dist/text/truetype/TrueTypeFont.d.ts +36 -0
- package/dist/text/truetype/TrueTypeParseError.d.ts +11 -0
- package/dist/text/truetype/tableParsers.d.ts +45 -0
- package/dist/ui/OasisEditorApp.d.ts +1 -1
- package/dist/ui/OasisEditorAppLazy.d.ts +16 -0
- package/dist/ui/OasisEditorAppProps.d.ts +10 -2
- package/dist/ui/OasisEditorEditor.d.ts +17 -8
- package/dist/ui/OasisEditorLoading.d.ts +25 -0
- package/dist/ui/app/EditorDialogsLayer.d.ts +4 -0
- package/dist/ui/app/EditorWorkspace.d.ts +6 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +7 -3
- package/dist/ui/app/createRuntimeCommandHost.d.ts +2 -1
- package/dist/ui/app/localFontAccess.d.ts +33 -0
- package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +2 -2
- package/dist/ui/app/useEditorContextMenuClipboard.d.ts +18 -0
- package/dist/ui/app/useEditorDialogs.d.ts +18 -0
- package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +3 -0
- package/dist/ui/app/useEditorRuntimePlugins.d.ts +3 -0
- package/dist/ui/app/useEditorUiOptions.d.ts +1 -1
- package/dist/ui/app/useParagraphDialogBridge.d.ts +29 -0
- package/dist/ui/app/useTablePropertiesDialogBridge.d.ts +30 -0
- package/dist/ui/canvas/CanvasHitTestService.d.ts +17 -0
- package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +57 -1
- package/dist/ui/canvas/CanvasSelectionGeometry.d.ts +16 -0
- package/dist/ui/canvas/CanvasTableLayout.d.ts +3 -1
- package/dist/ui/canvas/canvasBlockPainter.d.ts +2 -2
- package/dist/ui/canvas/canvasBorders.d.ts +17 -0
- package/dist/ui/canvas/canvasDropCapPainter.d.ts +16 -0
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +24 -2
- package/dist/ui/canvas/canvasTextBoxPainter.d.ts +24 -0
- package/dist/ui/canvas/imageContour.d.ts +10 -0
- package/dist/ui/canvas/textBoxRenderHeight.d.ts +14 -0
- package/dist/ui/canvas/verticalText.d.ts +104 -0
- package/dist/ui/components/Dialogs/FontDialog.d.ts +2 -65
- package/dist/ui/components/Dialogs/FontDialogModel.d.ts +5 -0
- package/dist/ui/components/Dialogs/ParagraphDialog.d.ts +49 -0
- package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +80 -0
- package/dist/ui/components/Dialogs/font-dialog/AdvancedFontTab.d.ts +6 -0
- package/dist/ui/components/Dialogs/font-dialog/FontDialogController.d.ts +21 -0
- package/dist/ui/components/Dialogs/font-dialog/FontDialogTypes.d.ts +112 -0
- package/dist/ui/components/Dialogs/font-dialog/FontPreview.d.ts +6 -0
- package/dist/ui/components/Dialogs/font-dialog/FontTab.d.ts +6 -0
- package/dist/ui/components/Dialogs/font-dialog/useFontDialogController.d.ts +4 -0
- package/dist/ui/components/FloatingToolbar/FloatingLayoutOptions.d.ts +17 -0
- package/dist/ui/components/Menubar/Menubar.d.ts +2 -1
- package/dist/ui/components/Menubar/builtinMenuIds.d.ts +36 -0
- package/dist/ui/components/OasisBrandMark.d.ts +7 -0
- package/dist/ui/components/PluginUi/PluginUiHost.d.ts +8 -0
- package/dist/ui/components/Ruler/HorizontalRuler.d.ts +11 -0
- package/dist/ui/components/Ruler/rulerGeometry.d.ts +63 -0
- package/dist/ui/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +40 -0
- package/dist/ui/components/Toolbar/primitives/ColorPicker.d.ts +1 -1
- package/dist/ui/components/Toolbar/primitives/Separator.d.ts +4 -3
- package/dist/ui/components/Toolbar/registry/ToolbarRegistry.d.ts +7 -2
- package/dist/ui/components/Toolbar/schema/items.d.ts +1 -1
- package/dist/ui/components/WelcomeOverlay.d.ts +13 -0
- package/dist/ui/editorLayoutConstants.d.ts +12 -0
- package/dist/ui/editorUiTypes.d.ts +35 -4
- package/dist/ui/fontSizeUnits.d.ts +15 -0
- package/dist/ui/mount.d.ts +2 -1
- package/dist/ui/overlays/ResizeHandlesOverlay.d.ts +34 -0
- package/dist/ui/public/Button.d.ts +10 -0
- package/dist/ui/public/Checkbox.d.ts +9 -0
- package/dist/ui/public/DialogFooter.d.ts +6 -0
- package/dist/ui/public/FloatingActionButton.d.ts +8 -0
- package/dist/ui/public/IconButton.d.ts +10 -0
- package/dist/ui/public/SelectField.d.ts +15 -0
- package/dist/ui/public/SidePanel.d.ts +12 -0
- package/dist/ui/public/TextField.d.ts +9 -0
- package/dist/ui/public/index.d.ts +36 -0
- package/dist/ui/resizeGeometry.d.ts +28 -0
- package/dist/ui/shells/DocumentShell.d.ts +6 -0
- package/dist/ui/textMeasurement/alignment.d.ts +3 -0
- package/dist/ui/textMeasurement/characterWidth.d.ts +9 -0
- package/dist/ui/textMeasurement/composer.d.ts +5 -0
- package/dist/ui/textMeasurement/constants.d.ts +4 -0
- package/dist/ui/textMeasurement/fontMetrics.d.ts +12 -0
- package/dist/ui/textMeasurement/indentation.d.ts +12 -0
- package/dist/ui/textMeasurement/layoutLine.d.ts +4 -0
- package/dist/ui/textMeasurement/paragraphLineHeight.d.ts +22 -0
- package/dist/ui/textMeasurement/tabStops.d.ts +4 -0
- package/dist/ui/textMeasurement/tokenizer.d.ts +6 -0
- package/dist/ui/textMeasurement/types.d.ts +27 -0
- package/dist/ui/textMeasurement.d.ts +5 -11
- package/dist/ui/toolbarStyleState.d.ts +15 -2
- package/dist/ui/utils/customIcons.d.ts +20 -0
- package/dist/ui.d.ts +42 -0
- package/dist/ui.js +19 -0
- package/dist/utils/imageFormats.d.ts +14 -0
- package/dist/utils/throttle.d.ts +1 -1
- package/dist/vue.d.ts +9 -0
- package/dist/vue.js +33 -0
- package/package.json +90 -62
- package/dist/__tests__/app/PersistenceService.test.d.ts +0 -1
- package/dist/__tests__/app/footnoteUiCommands.test.d.ts +0 -1
- package/dist/__tests__/commands/text.test.d.ts +0 -1
- package/dist/__tests__/core/editorPluginIntegration.test.d.ts +0 -1
- package/dist/__tests__/core/editorState.test.d.ts +0 -1
- package/dist/__tests__/core/footnotes.test.d.ts +0 -1
- package/dist/__tests__/core/model.test.d.ts +0 -1
- package/dist/__tests__/core/pluginCollection.test.d.ts +0 -1
- package/dist/__tests__/core/tableCommands.test.d.ts +0 -1
- package/dist/__tests__/export/docxExport.test.d.ts +0 -1
- package/dist/__tests__/export/footnotesExport.test.d.ts +0 -1
- package/dist/__tests__/export/pdfWriter.test.d.ts +0 -1
- package/dist/__tests__/export/underlineStyle.test.d.ts +0 -1
- package/dist/__tests__/import/docxComplexSmoke.test.d.ts +0 -1
- package/dist/__tests__/import/docxImport.test.d.ts +0 -1
- package/dist/__tests__/import/footnotesImport.test.d.ts +0 -1
- package/dist/__tests__/integration/documentFlow.test.d.ts +0 -1
- package/dist/__tests__/ui/CanvasTableLayout.test.d.ts +0 -1
- package/dist/__tests__/ui/canvasHitTestService.test.d.ts +0 -1
- package/dist/__tests__/ui/canvasLayoutSnapshot.test.d.ts +0 -1
- package/dist/__tests__/ui/canvasSelectionGeometry.test.d.ts +0 -1
- package/dist/__tests__/ui/canvasTextRendering.test.d.ts +0 -1
- package/dist/__tests__/ui/composeMeasuredParagraphLines.test.d.ts +0 -1
- package/dist/__tests__/ui/dialog.test.d.ts +0 -1
- package/dist/__tests__/ui/fontDialog.test.d.ts +0 -1
- package/dist/__tests__/ui/footnotesLayout.test.d.ts +0 -1
- package/dist/__tests__/ui/layoutIdentity.test.d.ts +0 -1
- package/dist/__tests__/ui/layoutProjection.test.d.ts +0 -1
- package/dist/__tests__/ui/registry.test.d.ts +0 -1
- package/dist/__tests__/ui/tabs.test.d.ts +0 -1
- package/dist/__tests__/ui/textMeasurementAlignment.test.d.ts +0 -1
- package/dist/__tests__/word-parity/fixtures/corpus.d.ts +0 -10
- package/dist/__tests__/word-parity/fixtures/loremFixtures.d.ts +0 -8
- package/dist/__tests__/word-parity/wordLayout.word-parity.d.ts +0 -1
- 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 +0 -12
- package/dist/core/commands/utils.d.ts +0 -69
- package/dist/demo/OasisSiteApp.d.ts +0 -1
- package/dist/main.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1 +1,388 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="branding/generated/logo-full.png" alt="Oasis Editor" width="340" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
A modern, extensible document editor for rich word-processing experiences on the web.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<code>npm install oasis-editor</code>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
# Oasis Editor
|
|
14
|
+
|
|
15
|
+
Oasis Editor is a browser-based document editor built for applications that need
|
|
16
|
+
more than a textarea: paged editing, rich formatting, tables, import/export
|
|
17
|
+
workflows, command-driven UI, and a plugin surface that can grow with your
|
|
18
|
+
product.
|
|
19
|
+
|
|
20
|
+
It ships as a TypeScript package with a vanilla embed API, React and Vue
|
|
21
|
+
adapters, a headless runtime, public command and plugin primitives, and a CSS
|
|
22
|
+
bundle you can import into your app.
|
|
23
|
+
|
|
24
|
+
## Why Oasis
|
|
25
|
+
|
|
26
|
+
- **Embed-first API**: mount the editor into any DOM node and receive a stable
|
|
27
|
+
`OasisEditorClient`.
|
|
28
|
+
- **Command-driven runtime**: execute built-in or plugin commands from your own
|
|
29
|
+
buttons, menus, shortcuts, or app chrome.
|
|
30
|
+
- **Paged document UI**: use a document shell with toolbar, menubar, canvas
|
|
31
|
+
editing, persistence hooks, and import/export flows.
|
|
32
|
+
- **Plugin-ready architecture**: register commands, toolbar items, menubar
|
|
33
|
+
items, keymaps, lifecycle hooks, and dependencies.
|
|
34
|
+
- **Typed package surface**: core document types, editor state, toolbar
|
|
35
|
+
registries, menu registries, command refs, and UI primitives are exported.
|
|
36
|
+
- **Framework-friendly**: use the vanilla API directly or mount through the
|
|
37
|
+
React and Vue adapters.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install oasis-editor
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Import the stylesheet once in your application entry:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import "oasis-editor/style.css";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { createOasisEditor } from "oasis-editor";
|
|
55
|
+
import "oasis-editor/style.css";
|
|
56
|
+
|
|
57
|
+
const root = document.getElementById("editor");
|
|
58
|
+
|
|
59
|
+
if (!root) {
|
|
60
|
+
throw new Error("Missing editor root");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const client = createOasisEditor(root, {
|
|
64
|
+
ui: {
|
|
65
|
+
shell: "document",
|
|
66
|
+
},
|
|
67
|
+
runtime: {
|
|
68
|
+
onReady(editorClient) {
|
|
69
|
+
editorClient.commands.execute("find");
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
await client.ready;
|
|
75
|
+
|
|
76
|
+
client.on("change", (state) => {
|
|
77
|
+
console.log("Document changed", state);
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The returned client is the public integration handle for the mounted editor:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
await client.ready;
|
|
85
|
+
|
|
86
|
+
client.commands.execute("bold");
|
|
87
|
+
client.commands.canExecute("insertTable");
|
|
88
|
+
client.commands.state("bold");
|
|
89
|
+
|
|
90
|
+
const state = client.getState();
|
|
91
|
+
const document = client.getDocument();
|
|
92
|
+
|
|
93
|
+
client.document.update((current) => ({
|
|
94
|
+
...current,
|
|
95
|
+
metadata: { ...current.metadata, title: "Draft" },
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
client.selection.get();
|
|
99
|
+
client.focus.focus();
|
|
100
|
+
client.history.undo();
|
|
101
|
+
await client.export.docx();
|
|
102
|
+
|
|
103
|
+
client.document.markClean();
|
|
104
|
+
client.dispose();
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## React
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import { OasisEditor } from "oasis-editor/react";
|
|
111
|
+
import "oasis-editor/style.css";
|
|
112
|
+
|
|
113
|
+
export function EditorScreen() {
|
|
114
|
+
return (
|
|
115
|
+
<OasisEditor
|
|
116
|
+
ui={{ shell: "document" }}
|
|
117
|
+
onClient={(client) => {
|
|
118
|
+
client.on("change", (state) => {
|
|
119
|
+
console.log(state.document);
|
|
120
|
+
});
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The React adapter is mount-only. If you need to apply a new editor
|
|
128
|
+
configuration, remount the component.
|
|
129
|
+
|
|
130
|
+
## Vue
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<script setup lang="ts">
|
|
134
|
+
import { OasisEditor } from "oasis-editor/vue";
|
|
135
|
+
import "oasis-editor/style.css";
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<template>
|
|
139
|
+
<OasisEditor
|
|
140
|
+
:config="{ ui: { shell: 'document' } }"
|
|
141
|
+
:on-client="(client) => client.commands.execute('find')"
|
|
142
|
+
/>
|
|
143
|
+
</template>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The Vue adapter follows the same mount-only configuration contract as React.
|
|
147
|
+
|
|
148
|
+
## Headless Runtime
|
|
149
|
+
|
|
150
|
+
Use `Editor.create()` when you need the runtime without the full UI shell:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import { Editor } from "oasis-editor";
|
|
154
|
+
|
|
155
|
+
const editor = await Editor.create({
|
|
156
|
+
plugins: [],
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
editor.commands.execute("selectAll");
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
For embedded applications, prefer `createOasisEditor()`. It mounts the UI and
|
|
163
|
+
returns the same command-oriented client surface used by external integrations.
|
|
164
|
+
|
|
165
|
+
## Commands
|
|
166
|
+
|
|
167
|
+
Commands are the integration boundary for Oasis. Built-ins, plugins, toolbar
|
|
168
|
+
items, menubar items, and keymaps all dispatch through command names or command
|
|
169
|
+
refs.
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { OASIS_BUILTIN_COMMANDS, type OasisBuiltinCommand } from "oasis-editor";
|
|
173
|
+
|
|
174
|
+
const command: OasisBuiltinCommand = "insertTable";
|
|
175
|
+
|
|
176
|
+
if (client.commands.canExecute(command)) {
|
|
177
|
+
client.commands.execute(command, { rows: 3, columns: 4 });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
console.log(OASIS_BUILTIN_COMMANDS);
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Common built-in commands include formatting commands such as `bold`, `italic`,
|
|
184
|
+
`underline`, layout commands such as `insertTable`, `setFontSize`,
|
|
185
|
+
`setPageMargins`, and document commands such as `importDocument`, `exportDocx`,
|
|
186
|
+
and `exportPdf`.
|
|
187
|
+
|
|
188
|
+
## Plugins
|
|
189
|
+
|
|
190
|
+
Plugins can register commands, toolbar items, menubar items, keymaps,
|
|
191
|
+
dependencies, and lifecycle hooks.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import type { OasisPlugin } from "oasis-editor";
|
|
195
|
+
|
|
196
|
+
export const TimestampPlugin: OasisPlugin = {
|
|
197
|
+
name: "Timestamp",
|
|
198
|
+
commands: {
|
|
199
|
+
insertTimestamp: {
|
|
200
|
+
execute: () => new Date().toISOString(),
|
|
201
|
+
refresh: () => ({ isEnabled: true }),
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
toolbar: [
|
|
205
|
+
{
|
|
206
|
+
id: "timestamp-toolbar-button",
|
|
207
|
+
command: "insertTimestamp",
|
|
208
|
+
group: "insert",
|
|
209
|
+
icon: "clock-3",
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
menubar: [
|
|
213
|
+
{
|
|
214
|
+
id: "timestamp-menu-item",
|
|
215
|
+
path: "Insert/Timestamp",
|
|
216
|
+
command: "insertTimestamp",
|
|
217
|
+
shortcut: "Ctrl+Alt+T",
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
keymaps: [{ key: "Ctrl+Alt+T", command: "insertTimestamp" }],
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Register plugins when mounting:
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
createOasisEditor(root, {
|
|
228
|
+
runtime: {
|
|
229
|
+
plugins: [TimestampPlugin],
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
See [docs/plugin-api.md](docs/plugin-api.md) for the plugin contract.
|
|
235
|
+
|
|
236
|
+
## Plugin UI
|
|
237
|
+
|
|
238
|
+
Native Oasis plugin UI uses Solid primitives from `oasis-editor/ui`:
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
import { Button, Dialog, DialogFooter, TextField } from "oasis-editor/ui";
|
|
242
|
+
|
|
243
|
+
export function PluginDialog(props: { open: boolean; onClose: () => void }) {
|
|
244
|
+
return (
|
|
245
|
+
<Dialog
|
|
246
|
+
isOpen={props.open}
|
|
247
|
+
title="Plugin"
|
|
248
|
+
onClose={props.onClose}
|
|
249
|
+
footer={
|
|
250
|
+
<DialogFooter>
|
|
251
|
+
<Button variant="primary">Apply</Button>
|
|
252
|
+
</DialogFooter>
|
|
253
|
+
}
|
|
254
|
+
>
|
|
255
|
+
<TextField label="Name" onChange={(value) => console.log(value)} />
|
|
256
|
+
</Dialog>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Toolbar And Menubar Customization
|
|
262
|
+
|
|
263
|
+
Customize the toolbar and menubar after built-ins and plugin contributions are
|
|
264
|
+
registered:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
import { createOasisEditor, OASIS_TOOLBAR_ITEMS } from "oasis-editor";
|
|
268
|
+
|
|
269
|
+
createOasisEditor(root, {
|
|
270
|
+
ui: {
|
|
271
|
+
toolbar: {
|
|
272
|
+
layout: "wrap",
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
runtime: {
|
|
276
|
+
customizeToolbar(registry) {
|
|
277
|
+
registry.remove(OASIS_TOOLBAR_ITEMS.footnote);
|
|
278
|
+
registry.move(OASIS_TOOLBAR_ITEMS.insertTable, {
|
|
279
|
+
before: OASIS_TOOLBAR_ITEMS.link,
|
|
280
|
+
});
|
|
281
|
+
registry.register({
|
|
282
|
+
id: "timestamp-toolbar-button",
|
|
283
|
+
type: "button",
|
|
284
|
+
label: "Insert timestamp",
|
|
285
|
+
command: "insertTimestamp",
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
customizeMenubar(registry) {
|
|
289
|
+
registry.register({
|
|
290
|
+
id: "tools-timestamp",
|
|
291
|
+
path: "Tools/Timestamp",
|
|
292
|
+
command: "insertTimestamp",
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Toolbar registries support `register`, `insertBefore`, `insertAfter`,
|
|
300
|
+
`replace`, `remove`, and `move`.
|
|
301
|
+
|
|
302
|
+
## Package Exports
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
import {
|
|
306
|
+
createOasisEditor,
|
|
307
|
+
Editor,
|
|
308
|
+
OASIS_MENU_ITEMS,
|
|
309
|
+
OASIS_TOOLBAR_ITEMS,
|
|
310
|
+
MenuRegistry,
|
|
311
|
+
createToolbarRegistry,
|
|
312
|
+
type EditorDocument,
|
|
313
|
+
type EditorState,
|
|
314
|
+
type DocumentPersistence,
|
|
315
|
+
type ImportProgressState,
|
|
316
|
+
type OasisEditorClient,
|
|
317
|
+
type OasisPlugin,
|
|
318
|
+
} from "oasis-editor";
|
|
319
|
+
|
|
320
|
+
import "oasis-editor/style.css";
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Published subpaths:
|
|
324
|
+
|
|
325
|
+
- `oasis-editor`: vanilla embed API, headless runtime, public types, plugins,
|
|
326
|
+
commands, and UI primitives.
|
|
327
|
+
- `oasis-editor/style.css`: packaged editor stylesheet.
|
|
328
|
+
- `oasis-editor/ui`: Solid UI primitives for plugin authors.
|
|
329
|
+
- `oasis-editor/react`: React adapter.
|
|
330
|
+
- `oasis-editor/vue`: Vue adapter.
|
|
331
|
+
|
|
332
|
+
## Local Development
|
|
333
|
+
|
|
334
|
+
Install dependencies:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npm install
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Start the Vite development app:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
npm run dev
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Build the package and demo app:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
npm run build
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Build only the library package:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npm run build:lib
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Run tests:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
npm test
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Run type checking:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
npx tsc --noEmit
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Useful focused validation while changing public API, plugins, or package
|
|
371
|
+
exports:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
npx tsc --noEmit
|
|
375
|
+
npm test -- src/__tests__/core/clientApi.test.ts src/__tests__/core/editorPluginIntegration.test.ts src/__tests__/core/pluginCollection.test.ts src/__tests__/ui/registry.test.ts
|
|
376
|
+
npm run build:lib
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Documentation
|
|
380
|
+
|
|
381
|
+
- [Client API](docs/client-api.md)
|
|
382
|
+
- [Plugin API](docs/plugin-api.md)
|
|
383
|
+
|
|
384
|
+
## Status
|
|
385
|
+
|
|
386
|
+
Oasis is under active development. The public client, command, toolbar, menubar,
|
|
387
|
+
plugin, and package surfaces are being stabilized around real embed use cases.
|
|
388
|
+
Prefer documented APIs over internal files under `src/`.
|