oasis-editor 0.0.131 → 0.0.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{OasisEditorApp-Dn2I2b-M.js → OasisEditorApp-DmXn9H33.js} +716 -684
  2. package/dist/adapters/mountController.d.ts +12 -0
  3. package/dist/adapters/vue.d.ts +5 -5
  4. package/dist/app/controllers/EditorCommandRegistry.d.ts +2 -1
  5. package/dist/app/controllers/tableResize/tableResizeUnits.d.ts +3 -1
  6. package/dist/assets/{importDocxWorker-DdpdjbOY.js → importDocxWorker-CCwhxVSR.js} +1 -1
  7. package/dist/core/commands/builtinCommands.d.ts +1 -1
  8. package/dist/core/editorState/defaultStyles.d.ts +3 -0
  9. package/dist/core/editorState/documentFactories.d.ts +8 -0
  10. package/dist/core/editorState/nodeFactories.d.ts +35 -0
  11. package/dist/core/editorState/stateFactories.d.ts +26 -0
  12. package/dist/core/editorState.d.ts +4 -66
  13. package/dist/core/units/parseUnitToPt.d.ts +6 -0
  14. package/dist/export/docx/xmlUtils.d.ts +2 -0
  15. package/dist/import/docx/runs/drawingAnchorLayout.d.ts +12 -0
  16. package/dist/{index-BXo_oqOC.js → index-BOj4-NlJ.js} +2244 -2177
  17. package/dist/layoutProjection/presetGeometry/families/arrows.d.ts +3 -0
  18. package/dist/layoutProjection/presetGeometry/families/banners.d.ts +5 -0
  19. package/dist/layoutProjection/presetGeometry/families/bracesBrackets.d.ts +4 -0
  20. package/dist/layoutProjection/presetGeometry/families/callouts.d.ts +3 -0
  21. package/dist/layoutProjection/presetGeometry/families/connectors.d.ts +3 -0
  22. package/dist/layoutProjection/presetGeometry/families/containers3d.d.ts +11 -0
  23. package/dist/layoutProjection/presetGeometry/families/decorative.d.ts +9 -0
  24. package/dist/layoutProjection/presetGeometry/families/flowchart.d.ts +4 -0
  25. package/dist/layoutProjection/presetGeometry/families/mathSymbols.d.ts +8 -0
  26. package/dist/layoutProjection/presetGeometry/families/rectVariants.d.ts +5 -0
  27. package/dist/mountController-D2srsZ5t.js +15 -0
  28. package/dist/mountController.d.ts +12 -0
  29. package/dist/oasis-editor.css +1 -1
  30. package/dist/oasis-editor.js +54 -54
  31. package/dist/oasis-editor.umd.cjs +4 -4
  32. package/dist/plugins/internal/essentialsCapabilities.d.ts +2 -1
  33. package/dist/plugins/internal/essentialsCommandBuilders.d.ts +8 -7
  34. package/dist/plugins/internal/essentialsCommandGroups/coreFormatting.d.ts +17 -0
  35. package/dist/plugins/internal/essentialsCommandGroups/documentAndBrowser.d.ts +15 -0
  36. package/dist/plugins/internal/essentialsCommandGroups/paragraphAndSection.d.ts +13 -0
  37. package/dist/plugins/internal/essentialsCommandGroups/table.d.ts +11 -0
  38. package/dist/react.js +14 -15
  39. package/dist/text/fontMetricsUtil.d.ts +16 -0
  40. package/dist/text/fonts/opentype/extensionLookup.d.ts +9 -0
  41. package/dist/ui/EditorImportProgressOverlay.d.ts +7 -0
  42. package/dist/ui/EditorStatusBar.d.ts +13 -0
  43. package/dist/ui/OasisEditorEditor.d.ts +3 -117
  44. package/dist/ui/OasisEditorEditorProps.d.ts +118 -0
  45. package/dist/ui/app/createEditorEssentialsPlugin.d.ts +2 -41
  46. package/dist/ui/app/essentials/browser.d.ts +3 -0
  47. package/dist/ui/app/essentials/document.d.ts +4 -0
  48. package/dist/ui/app/essentials/formatting.d.ts +9 -0
  49. package/dist/ui/app/essentials/gate.d.ts +4 -0
  50. package/dist/ui/app/essentials/history.d.ts +4 -0
  51. package/dist/ui/app/essentials/image.d.ts +4 -0
  52. package/dist/ui/app/essentials/link.d.ts +4 -0
  53. package/dist/ui/app/essentials/paragraph.d.ts +4 -0
  54. package/dist/ui/app/essentials/section.d.ts +4 -0
  55. package/dist/ui/app/essentials/selection.d.ts +4 -0
  56. package/dist/ui/app/essentials/style.d.ts +4 -0
  57. package/dist/ui/app/essentials/table.d.ts +4 -0
  58. package/dist/ui/app/essentials/types.d.ts +41 -0
  59. package/dist/ui/canvas/canvasLineSlotLookup.d.ts +8 -0
  60. package/dist/ui/canvas/canvasSnapshotLines.d.ts +22 -0
  61. package/dist/ui/canvas/canvasSnapshotWalkers.d.ts +41 -0
  62. package/dist/ui/canvas/canvasTheme.d.ts +6 -0
  63. package/dist/ui/components/Dialogs/ParagraphDialog.d.ts +2 -69
  64. package/dist/ui/components/Dialogs/paragraph-dialog/ParagraphDialogTypes.d.ts +82 -0
  65. package/dist/ui/components/Dialogs/paragraph-dialog/useParagraphDialogController.d.ts +66 -0
  66. package/dist/ui/components/Dialogs/table-properties/TablePropertiesTypes.d.ts +0 -1
  67. package/dist/ui/components/Toolbar/LineSpacingButton.d.ts +10 -0
  68. package/dist/ui/components/Toolbar/presets/defaultToolbar/buttonSpecs.d.ts +27 -0
  69. package/dist/ui/components/Toolbar/presets/defaultToolbar/optionBuilders.d.ts +10 -0
  70. package/dist/ui/components/Toolbar/presets/defaultToolbar/ribbonPlacements.d.ts +3 -0
  71. package/dist/ui/components/Toolbar/primitives/DropdownChevron.d.ts +20 -0
  72. package/dist/ui/utils/customIcons.d.ts +30 -0
  73. package/dist/utils/parseNumber.d.ts +5 -0
  74. package/dist/vue.d.ts +5 -5
  75. package/dist/vue.js +10 -12
  76. package/package.json +1 -1
  77. package/dist/layoutProjection/presetGeometry/families.d.ts +0 -37
  78. package/dist/plugins/internal/essentialsCommandGroups.d.ts +0 -41
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -0,0 +1,3 @@
1
+ import { EditorNamedStyle } from '../model.js';
2
+
3
+ export declare const DEFAULT_EDITOR_STYLES: Record<string, EditorNamedStyle>;
@@ -0,0 +1,8 @@
1
+ import { EditorAsset, EditorBlockNode, EditorDocument, EditorNamedStyle, EditorPageSettings, EditorSection } from '../model.js';
2
+
3
+ export declare function createEditorDocument(blocks: EditorBlockNode[], pageSettings?: EditorPageSettings, sections?: EditorSection[], styles?: Record<string, EditorNamedStyle>, metadata?: {
4
+ title?: string;
5
+ [key: string]: unknown;
6
+ }, assets?: Record<string, EditorAsset>): EditorDocument;
7
+ export declare function getDocumentCharacterCount(document: EditorDocument): number;
8
+ export declare function getDocumentWordCount(document: EditorDocument): number;
@@ -0,0 +1,35 @@
1
+ import { EditorBlockNode, EditorFootnote, EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun, EditorTextStyle, EditorTextBoxData, EditorImageRunData } from '../model.js';
2
+
3
+ export type EditorNodeKind = "document" | "paragraph" | "run" | "table" | "table-row" | "table-cell" | "footnote" | "bookmark" | "comment" | "sdt";
4
+ /**
5
+ * Single authority for editor node IDs. Stateless and globally unique, so two
6
+ * editors mounted on the same page never share a sequence. The `kind` prefix is
7
+ * kept purely for debuggability; no code parses it for ordering or numbering.
8
+ */
9
+ export declare function createEditorNodeId(kind: EditorNodeKind): string;
10
+ export declare function createEditorBookmarkId(): string;
11
+ export declare function createEditorCommentId(): string;
12
+ export declare function createEditorRun(text?: string): EditorTextRun;
13
+ export declare function createEditorStyledRun(text?: string, styles?: EditorTextStyle, image?: EditorImageRunData, textBox?: EditorTextBoxData): EditorTextRun;
14
+ export declare function createEditorParagraph(text?: string): EditorParagraphNode;
15
+ export declare function createEditorParagraphFromRuns(runs: Array<{
16
+ text: string;
17
+ styles?: EditorTextStyle;
18
+ image?: EditorImageRunData;
19
+ textBox?: EditorTextBoxData;
20
+ }>): EditorParagraphNode;
21
+ export declare function createEditorTableCell(paragraphs: EditorParagraphNode[], colSpan?: number, options?: {
22
+ rowSpan?: number;
23
+ vMerge?: "restart" | "continue";
24
+ }): EditorTableCellNode;
25
+ export declare function createEditorTableRow(cells: EditorTableCellNode[], options?: {
26
+ isHeader?: boolean;
27
+ }): EditorTableRowNode;
28
+ export declare function createEditorTable(rows: EditorTableRowNode[], gridCols?: number[]): EditorTableNode;
29
+ export declare function createEditorFootnoteId(): string;
30
+ export declare function createEditorFootnote(blocks?: EditorBlockNode[]): EditorFootnote;
31
+ export declare function createFootnoteReferenceRun(footnoteId: string, marker: string, options?: {
32
+ customMark?: string;
33
+ styles?: EditorTextStyle;
34
+ }): EditorTextRun;
35
+ export declare function createSectionBoundaryParagraph(zone: "header" | "footer"): EditorParagraphNode;
@@ -0,0 +1,26 @@
1
+ import { EditorDocument, EditorState, EditorTextStyle, EditorImageRunData } from '../model.js';
2
+
3
+ export declare function createEditorStateFromDocument(document: EditorDocument, selection?: {
4
+ paragraphIndex?: number;
5
+ offset?: number;
6
+ }): EditorState;
7
+ export declare function createInitialEditorState(): EditorState;
8
+ type SelectionSpec = {
9
+ anchor?: {
10
+ blockIndex: number;
11
+ offset: number;
12
+ };
13
+ focus?: {
14
+ blockIndex: number;
15
+ offset: number;
16
+ };
17
+ blockIndex?: number;
18
+ offset?: number;
19
+ };
20
+ export declare function createEditorStateFromTexts(texts: string[], selection?: SelectionSpec): EditorState;
21
+ export declare function createEditorStateFromParagraphRuns(paragraphsSpec: Array<Array<{
22
+ text: string;
23
+ styles?: EditorTextStyle;
24
+ image?: EditorImageRunData;
25
+ }>>, selection?: SelectionSpec): EditorState;
26
+ export {};
@@ -1,66 +1,4 @@
1
- import { EditorAsset, EditorBlockNode, EditorDocument, EditorFootnote, EditorPageSettings, EditorParagraphNode, EditorSection, EditorState, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun, EditorTextStyle, EditorTextBoxData, EditorImageRunData, EditorNamedStyle } from './model.js';
2
-
3
- export type EditorNodeKind = "document" | "paragraph" | "run" | "table" | "table-row" | "table-cell" | "footnote" | "bookmark" | "comment" | "sdt";
4
- /**
5
- * Single authority for editor node IDs. Stateless and globally unique, so two
6
- * editors mounted on the same page never share a sequence. The `kind` prefix is
7
- * kept purely for debuggability; no code parses it for ordering or numbering.
8
- */
9
- export declare function createEditorNodeId(kind: EditorNodeKind): string;
10
- export declare function createEditorBookmarkId(): string;
11
- export declare function createEditorCommentId(): string;
12
- export declare function createEditorRun(text?: string): EditorTextRun;
13
- export declare function createEditorStyledRun(text?: string, styles?: EditorTextStyle, image?: EditorImageRunData, textBox?: EditorTextBoxData): EditorTextRun;
14
- export declare function createEditorParagraph(text?: string): EditorParagraphNode;
15
- export declare function createEditorParagraphFromRuns(runs: Array<{
16
- text: string;
17
- styles?: EditorTextStyle;
18
- image?: EditorImageRunData;
19
- textBox?: EditorTextBoxData;
20
- }>): EditorParagraphNode;
21
- export declare function createEditorTableCell(paragraphs: EditorParagraphNode[], colSpan?: number, options?: {
22
- rowSpan?: number;
23
- vMerge?: "restart" | "continue";
24
- }): EditorTableCellNode;
25
- export declare function createEditorTableRow(cells: EditorTableCellNode[], options?: {
26
- isHeader?: boolean;
27
- }): EditorTableRowNode;
28
- export declare function createEditorTable(rows: EditorTableRowNode[], gridCols?: number[]): EditorTableNode;
29
- export declare function createEditorFootnoteId(): string;
30
- export declare function createEditorFootnote(blocks?: EditorBlockNode[]): EditorFootnote;
31
- export declare function createFootnoteReferenceRun(footnoteId: string, marker: string, options?: {
32
- customMark?: string;
33
- styles?: EditorTextStyle;
34
- }): EditorTextRun;
35
- export declare const DEFAULT_EDITOR_STYLES: Record<string, EditorNamedStyle>;
36
- export declare function createEditorDocument(blocks: EditorBlockNode[], pageSettings?: EditorPageSettings, sections?: EditorSection[], styles?: Record<string, EditorNamedStyle>, metadata?: {
37
- title?: string;
38
- [key: string]: unknown;
39
- }, assets?: Record<string, EditorAsset>): EditorDocument;
40
- export declare function getDocumentCharacterCount(document: EditorDocument): number;
41
- export declare function getDocumentWordCount(document: EditorDocument): number;
42
- export declare function createEditorStateFromDocument(document: EditorDocument, selection?: {
43
- paragraphIndex?: number;
44
- offset?: number;
45
- }): EditorState;
46
- export declare function createSectionBoundaryParagraph(zone: "header" | "footer"): EditorParagraphNode;
47
- export declare function createInitialEditorState(): EditorState;
48
- type SelectionSpec = {
49
- anchor?: {
50
- blockIndex: number;
51
- offset: number;
52
- };
53
- focus?: {
54
- blockIndex: number;
55
- offset: number;
56
- };
57
- blockIndex?: number;
58
- offset?: number;
59
- };
60
- export declare function createEditorStateFromTexts(texts: string[], selection?: SelectionSpec): EditorState;
61
- export declare function createEditorStateFromParagraphRuns(paragraphsSpec: Array<Array<{
62
- text: string;
63
- styles?: EditorTextStyle;
64
- image?: EditorImageRunData;
65
- }>>, selection?: SelectionSpec): EditorState;
66
- export {};
1
+ export * from './editorState/nodeFactories.js';
2
+ export * from './editorState/defaultStyles.js';
3
+ export * from './editorState/documentFactories.js';
4
+ export * from './editorState/stateFactories.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Parses a table-size value (a raw number in pt, or a string with an
3
+ * explicit `pt`/`px` suffix, or a bare number string) into points.
4
+ * Percentage values are not a fixed unit and return `null`.
5
+ */
6
+ export declare function parseUnitToPt(value: number | string | undefined): number | null;
@@ -8,3 +8,5 @@ export declare function toTwips(value: number | null | undefined): number | null
8
8
  export declare function toHalfPoints(value: number | null | undefined): number | null;
9
9
  export declare function pointsToTwips(value: number | null | undefined): number | null;
10
10
  export declare function normalizeDocxColor(color: string | undefined, fallback?: string): string;
11
+ /** Serializes a solid-fill `<w:shd>` element (clear pattern, auto color). */
12
+ export declare function serializeShading(fill: string | undefined): string;
@@ -0,0 +1,12 @@
1
+ import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { EditorImageFloatingLayout, EditorImageFloatingPosition } from '../../../core/model.js';
3
+
4
+ /** Shared by `<w:drawing>` images and text boxes: both nest an `inline` or `anchor` element. */
5
+ export declare function findDrawingContainer(drawing: XmlElement): {
6
+ element: XmlElement;
7
+ kind: "inline" | "anchor";
8
+ } | undefined;
9
+ export declare function parseAnchorBoolean(value: string | null | undefined): boolean | undefined;
10
+ export declare function parseAnchorPosition(anchor: XmlElement, localName: "positionH" | "positionV"): EditorImageFloatingPosition | undefined;
11
+ export declare function parseAnchorWrap(anchor: XmlElement): EditorImageFloatingLayout["wrap"];
12
+ export declare function parseFloatingLayout(anchor: XmlElement): EditorImageFloatingLayout | undefined;