oasis-editor 0.0.87 → 0.0.89

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 (46) hide show
  1. package/dist/{OasisEditorApp-CE15GH_N.js → OasisEditorApp-cKm4OFIF.js} +1383 -179
  2. package/dist/app/controllers/EditorCommandsController.d.ts +1 -1
  3. package/dist/app/controllers/useEditorStyle.d.ts +1 -1
  4. package/dist/assets/{importDocxWorker-C94l6-O5.js → importDocxWorker-DVDyiqYf.js} +1 -1
  5. package/dist/core/commands/builtinCommands.d.ts +1 -1
  6. package/dist/core/commands/publicCommandTypes.d.ts +1 -0
  7. package/dist/core/commands/table/tableCommandUtils.d.ts +2 -1
  8. package/dist/core/commands/table/tableFloatingCommands.d.ts +5 -0
  9. package/dist/core/commands/table.d.ts +1 -0
  10. package/dist/core/model/index.d.ts +2 -2
  11. package/dist/core/model/types/layout.d.ts +4 -0
  12. package/dist/core/model/types/nodes.d.ts +23 -7
  13. package/dist/core/model/types/primitives.d.ts +17 -0
  14. package/dist/core/model/types/styles.d.ts +51 -6
  15. package/dist/core/model.d.ts +1 -0
  16. package/dist/core/tableStyleResolver.d.ts +20 -0
  17. package/dist/core/textStyle/textStyleKeys.d.ts +1 -1
  18. package/dist/export/docx/tableXml.d.ts +1 -0
  19. package/dist/export/pdf/draw/drawFragment.d.ts +13 -1
  20. package/dist/export/pdf/draw/drawTextBoxShape.d.ts +1 -0
  21. package/dist/i18n/locales/en.d.ts +18 -0
  22. package/dist/i18n/locales/pt-BR.d.ts +18 -0
  23. package/dist/import/docx/tableProperties.d.ts +2 -1
  24. package/dist/import/docx/tables.d.ts +1 -1
  25. package/dist/{index-DFKc0jbc.js → index-BICQTKCZ.js} +1657 -896
  26. package/dist/index.d.ts +3 -1
  27. package/dist/layoutProjection/floatingObjects.d.ts +15 -1
  28. package/dist/layoutProjection/paginationTrack.d.ts +2 -0
  29. package/dist/layoutProjection/paragraphPagination.d.ts +2 -2
  30. package/dist/oasis-editor.css +1 -1
  31. package/dist/oasis-editor.js +50 -49
  32. package/dist/oasis-editor.umd.cjs +4 -4
  33. package/dist/plugins/internal/essentialsCapabilities.d.ts +10 -0
  34. package/dist/ui/app/createAppCommandsController.d.ts +2 -2
  35. package/dist/ui/app/createEditorCommandRuntime.d.ts +1 -1
  36. package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -1
  37. package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +1 -1
  38. package/dist/ui/canvas/CanvasTableLayout.d.ts +7 -1
  39. package/dist/ui/canvas/canvasBorders.d.ts +2 -0
  40. package/dist/ui/canvas/canvasSnapshotTypes.d.ts +12 -0
  41. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +22 -1
  42. package/dist/ui/components/Toolbar/StyleGallery.d.ts +9 -0
  43. package/dist/ui/components/Toolbar/schema/items.d.ts +17 -1
  44. package/dist/ui/editorUiTypes.d.ts +1 -1
  45. package/dist/ui/toolbarStyleState.d.ts +2 -1
  46. package/package.json +1 -1
@@ -54,13 +54,23 @@ export interface EssentialsFormattingCapability {
54
54
  setHighlight: (value: string | null) => boolean;
55
55
  setTextShading: (value: string | null) => boolean;
56
56
  setStyleId: (value: string) => boolean;
57
+ setCharacterStyleId: (value: string) => boolean;
57
58
  setUnderlineStyle: (value: string | null) => void;
58
59
  }
59
60
  export interface EssentialsDocumentStyleDescriptor {
60
61
  id: string;
61
62
  name: string;
63
+ type: "paragraph" | "character" | "table";
64
+ qFormat?: boolean;
65
+ uiPriority?: number;
66
+ semiHidden?: boolean;
67
+ unhideWhenUsed?: boolean;
68
+ isUsed?: boolean;
62
69
  fontFamily?: string;
63
70
  fontSize?: number;
71
+ color?: string;
72
+ bold?: boolean;
73
+ italic?: boolean;
64
74
  }
65
75
  export interface EssentialsDocumentCapability {
66
76
  documentStyles: () => EssentialsDocumentStyleDescriptor[];
@@ -42,7 +42,7 @@ export interface AppCommandsControllerDeps {
42
42
  export declare function createAppCommandsController(deps: AppCommandsControllerDeps): {
43
43
  commandsController: {
44
44
  applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
45
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
45
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
46
46
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
47
47
  applyClearFormattingCommand: () => void;
48
48
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -76,7 +76,7 @@ export declare function createAppCommandsController(deps: AppCommandsControllerD
76
76
  };
77
77
  keyboardCommandsController: {
78
78
  applyBooleanStyleCommand: (style: BooleanStyleKey) => void;
79
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
79
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
80
80
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
81
81
  applyClearFormattingCommand: () => void;
82
82
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -57,7 +57,7 @@ export interface EditorCommandRuntimeDeps {
57
57
  export declare function createEditorCommandRuntime(deps: EditorCommandRuntimeDeps): {
58
58
  commandsController: {
59
59
  applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
60
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
60
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
61
61
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase.js').TextCaseMode) => void;
62
62
  applyClearFormattingCommand: () => void;
63
63
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -130,7 +130,7 @@ export declare function createEditorInteractionRuntime(deps: EditorInteractionRu
130
130
  pendingCaretTextStyle: import('solid-js').Accessor<import('../../core/model.js').EditorTextStyle | undefined>;
131
131
  clearPendingCaretTextStyle: () => void;
132
132
  toolbarStyleState: () => import('../toolbarStyleState.js').ToolbarStyleState;
133
- applyToolbarValueStyleCommand: <K extends "link" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
133
+ applyToolbarValueStyleCommand: <K extends "link" | "styleId" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
134
134
  applyToolbarBooleanStyleCommand: (key: import('../toolbarStyleState.js').BooleanStyleKey) => void;
135
135
  };
136
136
  onEditorMouseDown: (event: MouseEvent) => void;
@@ -1,6 +1,6 @@
1
1
  import { CanvasLayoutSnapshot, BuildCanvasLayoutSnapshotOptions } from './canvasSnapshotTypes.js';
2
2
 
3
- export type { ResolveTextBoxRenderHeight, CanvasSnapshotSlot, CanvasSnapshotLine, CanvasSnapshotTableCellInfo, CanvasSnapshotParagraph, CanvasSnapshotInlineImage, CanvasSnapshotFloatingTextBox, CanvasSnapshotFloatingImage, CanvasSnapshotInlineTextBox, CanvasSnapshotPage, CanvasLayoutSnapshot, BuildCanvasLayoutSnapshotOptions, } from './canvasSnapshotTypes.js';
3
+ export type { ResolveTextBoxRenderHeight, CanvasSnapshotSlot, CanvasSnapshotLine, CanvasSnapshotTableCellInfo, CanvasSnapshotParagraph, CanvasSnapshotInlineImage, CanvasSnapshotFloatingTextBox, CanvasSnapshotFloatingImage, CanvasSnapshotInlineTextBox, CanvasSnapshotFloatingTable, CanvasSnapshotPage, CanvasLayoutSnapshot, BuildCanvasLayoutSnapshotOptions, } from './canvasSnapshotTypes.js';
4
4
  /**
5
5
  * Coordinate contract ("screen-anchored local" space)
6
6
  * ----------------------------------------------------
@@ -1,7 +1,8 @@
1
- import { EditorParagraphNode, EditorPosition, EditorState, EditorTableNode } from '../../core/model.js';
1
+ import { EditorParagraphNode, EditorPosition, EditorState, EditorTableNode, EditorRevisionMetadata } from '../../core/model.js';
2
2
  import { projectParagraphLayout } from '../../layoutProjection/index.js';
3
3
  import { VerticalRenderMode } from './verticalText.js';
4
4
 
5
+ export declare function resolveCanvasTableWidth(table: EditorTableNode, contentWidth: number): number;
5
6
  export type CanvasUnsupportedReason = "unsupported:v-span" | "unsupported:v-merge" | "unsupported:nested-table";
6
7
  export interface CanvasTableBorderSpec {
7
8
  width: number;
@@ -41,10 +42,15 @@ export interface CanvasTableCellLayoutEntry {
41
42
  right: CanvasTableBorderSpec;
42
43
  bottom: CanvasTableBorderSpec;
43
44
  left: CanvasTableBorderSpec;
45
+ topLeftToBottomRight?: CanvasTableBorderSpec;
46
+ topRightToBottomLeft?: CanvasTableBorderSpec;
44
47
  };
45
48
  paragraphs: CanvasTableParagraphLayoutEntry[];
46
49
  /** Vertical text flow inside this cell (`horizontal` when not rotated). */
47
50
  verticalMode: VerticalRenderMode;
51
+ revision?: EditorRevisionMetadata & {
52
+ type: "insert" | "delete" | "merge" | "property";
53
+ };
48
54
  }
49
55
  export interface CanvasTableLayoutResult {
50
56
  tableId: string;
@@ -8,6 +8,8 @@ export interface CanvasBorderBox {
8
8
  right?: CanvasBorderEdge;
9
9
  bottom?: CanvasBorderEdge;
10
10
  left?: CanvasBorderEdge;
11
+ topLeftToBottomRight?: CanvasBorderEdge;
12
+ topRightToBottomLeft?: CanvasBorderEdge;
11
13
  }
12
14
  /**
13
15
  * Strokes the four edges of a rectangular box. Edges left `undefined` are
@@ -25,6 +25,7 @@ export interface CanvasSnapshotTableCellInfo {
25
25
  width: number;
26
26
  height: number;
27
27
  anchorPosition: EditorPosition;
28
+ revisionId?: string;
28
29
  }
29
30
  export interface CanvasSnapshotParagraph {
30
31
  paragraph: EditorParagraphNode;
@@ -109,6 +110,16 @@ export interface CanvasSnapshotInlineTextBox {
109
110
  /** Shape rotation in degrees, when rotated. */
110
111
  rotation?: number;
111
112
  }
113
+ export interface CanvasSnapshotFloatingTable {
114
+ tableId: string;
115
+ zone: EditorEditingZone;
116
+ footnoteId?: string;
117
+ pageIndex: number;
118
+ left: number;
119
+ top: number;
120
+ width: number;
121
+ height: number;
122
+ }
112
123
  export interface CanvasSnapshotPage {
113
124
  index: number;
114
125
  left: number;
@@ -130,6 +141,7 @@ export interface CanvasLayoutSnapshot {
130
141
  floatingImages: CanvasSnapshotFloatingImage[];
131
142
  inlineTextBoxes: CanvasSnapshotInlineTextBox[];
132
143
  floatingTextBoxes: CanvasSnapshotFloatingTextBox[];
144
+ floatingTables: CanvasSnapshotFloatingTable[];
133
145
  unsupportedRegions: Array<{
134
146
  pageIndex: number;
135
147
  zone: EditorEditingZone;
@@ -1,4 +1,4 @@
1
- import { EditorBorderStyle, EditorDocxWidthValue, EditorTableRowHeightRule } from '../../../core/model.js';
1
+ import { EditorBorderStyle, EditorDocxWidthValue, EditorTableRowHeightRule, EditorTableFloatingLayout } from '../../../core/model.js';
2
2
 
3
3
  type TableWidthUnit = "points" | "percent";
4
4
  type BorderStyleValue = "none" | "solid" | "dashed" | "dotted";
@@ -10,6 +10,17 @@ export interface TablePropertiesDialogInitialValues {
10
10
  tableIndentLeft: string;
11
11
  tableWrapping: "none" | "around";
12
12
  floatingSummary: string;
13
+ floatingHorizontalAnchor: "margin" | "page" | "text";
14
+ floatingVerticalAnchor: "margin" | "page" | "text";
15
+ floatingX: string;
16
+ floatingY: string;
17
+ floatingXAlign: "" | "left" | "center" | "right" | "inside" | "outside";
18
+ floatingYAlign: "" | "top" | "center" | "bottom" | "inside" | "outside";
19
+ floatingDistanceTop: string;
20
+ floatingDistanceRight: string;
21
+ floatingDistanceBottom: string;
22
+ floatingDistanceLeft: string;
23
+ floatingOverlap: "overlap" | "never";
13
24
  rowHeight: string;
14
25
  rowHeightRule: EditorTableRowHeightRule | "";
15
26
  repeatHeader: boolean;
@@ -33,6 +44,10 @@ export interface TablePropertiesDialogInitialValues {
33
44
  borderRight: boolean;
34
45
  borderBottom: boolean;
35
46
  borderLeft: boolean;
47
+ borderStart: boolean;
48
+ borderEnd: boolean;
49
+ borderTopLeftToBottomRight: boolean;
50
+ borderTopRightToBottomLeft: boolean;
36
51
  shading: string;
37
52
  altTitle: string;
38
53
  altDescription: string;
@@ -42,11 +57,17 @@ export interface TablePropertiesDialogBorders {
42
57
  right: EditorBorderStyle | null;
43
58
  bottom: EditorBorderStyle | null;
44
59
  left: EditorBorderStyle | null;
60
+ start: EditorBorderStyle | null;
61
+ end: EditorBorderStyle | null;
62
+ topLeftToBottomRight: EditorBorderStyle | null;
63
+ topRightToBottomLeft: EditorBorderStyle | null;
45
64
  }
46
65
  export interface TablePropertiesDialogApplyValues {
47
66
  tableWidth: EditorDocxWidthValue | null;
48
67
  tableAlign: "left" | "center" | "right" | null;
49
68
  tableIndentLeft: EditorDocxWidthValue | null;
69
+ tableFloating: EditorTableFloatingLayout | null;
70
+ tableOverlap: "overlap" | "never" | null;
50
71
  rowHeight: EditorDocxWidthValue | null;
51
72
  rowHeightRule: EditorTableRowHeightRule | null;
52
73
  repeatHeader: boolean;
@@ -0,0 +1,9 @@
1
+ import { JSX } from 'solid-js';
2
+ import { StyleGalleryItem, ToolbarActionApi, ToolbarDocumentStyle } from './schema/items.js';
3
+
4
+ export declare function getQuickStyles(styles: ToolbarDocumentStyle[]): ToolbarDocumentStyle[];
5
+ export interface StyleGalleryProps {
6
+ item: StyleGalleryItem;
7
+ api: ToolbarActionApi;
8
+ }
9
+ export declare function StyleGallery(props: StyleGalleryProps): JSX.Element;
@@ -19,8 +19,17 @@ export interface ToolbarCommandState {
19
19
  export interface ToolbarDocumentStyle {
20
20
  id: string;
21
21
  name: string;
22
+ type: "paragraph" | "character" | "table";
23
+ qFormat?: boolean;
24
+ uiPriority?: number;
25
+ semiHidden?: boolean;
26
+ unhideWhenUsed?: boolean;
27
+ isUsed?: boolean;
22
28
  fontFamily?: string;
23
29
  fontSize?: number;
30
+ color?: string;
31
+ bold?: boolean;
32
+ italic?: boolean;
24
33
  }
25
34
  /**
26
35
  * Narrow surface every toolbar item depends on (DIP/ISP). Items only dispatch
@@ -111,6 +120,13 @@ export interface SelectItem extends ToolbarItemBase {
111
120
  placeholder?: string;
112
121
  width?: "wide" | "small" | "default";
113
122
  }
123
+ export interface StyleGalleryItem extends ToolbarItemBase {
124
+ type: "styleGallery";
125
+ /** Reactive descriptors supplied through the command-state boundary. */
126
+ styles: (api: ToolbarActionApi) => ToolbarDocumentStyle[];
127
+ paragraphCommand: CommandRef;
128
+ characterCommand: CommandRef;
129
+ }
114
130
  export interface ColorPickerItem extends ToolbarItemBase {
115
131
  type: "colorPicker";
116
132
  kind: "color" | "highlight" | "shading";
@@ -143,5 +159,5 @@ export interface CustomItem extends ToolbarItemBase {
143
159
  type: "custom";
144
160
  render: (api: ToolbarActionApi) => JSX.Element;
145
161
  }
146
- export type ToolbarItem = ButtonItem | ToggleItem | SplitItem | MenuItem | SelectItem | ColorPickerItem | GridPickerItem | SeparatorItem | GroupItem | CustomItem;
162
+ export type ToolbarItem = ButtonItem | ToggleItem | SplitItem | MenuItem | SelectItem | StyleGalleryItem | ColorPickerItem | GridPickerItem | SeparatorItem | GroupItem | CustomItem;
147
163
  export type ToolbarItemType = ToolbarItem["type"];
@@ -44,7 +44,7 @@ export interface RevisionBox {
44
44
  revisionId: string;
45
45
  author: string;
46
46
  date: number;
47
- type: "insert" | "delete";
47
+ type: "insert" | "delete" | "merge" | "property" | "grid";
48
48
  left: number;
49
49
  top: number;
50
50
  }
@@ -1,7 +1,7 @@
1
1
  import { EditorState } from '../core/model.js';
2
2
 
3
3
  export type BooleanStyleKey = "bold" | "italic" | "underline" | "strike" | "doubleStrike" | "superscript" | "subscript" | "smallCaps" | "allCaps" | "hidden" | "noProof" | "webHidden" | "specVanish" | "contextualAlternates";
4
- export type ValueStyleKey = "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
4
+ export type ValueStyleKey = "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
5
5
  export type ParagraphStyleKey = "styleId" | "align" | "spacingBefore" | "spacingAfter" | "lineHeight" | "indentLeft" | "indentRight" | "indentFirstLine" | "indentHanging" | "shading" | "tabs" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "pageBreakBefore" | "keepWithNext";
6
6
  export interface ToolbarStyleState {
7
7
  bold: boolean;
@@ -36,6 +36,7 @@ export interface ToolbarStyleState {
36
36
  textEffect: string;
37
37
  link: string;
38
38
  styleId: string;
39
+ characterStyleId: string;
39
40
  align: string;
40
41
  lineHeight: string;
41
42
  spacingBefore: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",