oasis-editor 0.0.128 → 0.0.130

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 (30) hide show
  1. package/dist/{OasisEditorApp-3vvH6KOz.js → OasisEditorApp-BQvsqccA.js} +492 -21
  2. package/dist/app/controllers/useEditorLayout.d.ts +2 -1
  3. package/dist/app/controllers/useEditorTableCornerResize.d.ts +56 -0
  4. package/dist/core/commands/publicCommandTypes.d.ts +10 -0
  5. package/dist/core/commands/table/tableColumnCommands.d.ts +6 -0
  6. package/dist/core/commands/table/tableRowCommands.d.ts +6 -0
  7. package/dist/core/pluginUiTypes.d.ts +8 -1
  8. package/dist/core/transactionMergeKeys.d.ts +3 -0
  9. package/dist/i18n/locales/en.d.ts +19 -0
  10. package/dist/i18n/locales/pt-BR.d.ts +19 -0
  11. package/dist/{index-Ceyv5JS5.js → index-CX5iCo8O.js} +590 -350
  12. package/dist/oasis-editor.css +1 -1
  13. package/dist/oasis-editor.js +1 -1
  14. package/dist/oasis-editor.umd.cjs +4 -4
  15. package/dist/plugins/internal/essentialsCapabilities.d.ts +20 -0
  16. package/dist/ui/OasisEditorEditor.d.ts +3 -1
  17. package/dist/ui/app/EditorDragLayers.d.ts +2 -0
  18. package/dist/ui/app/buildEditorViewProps.d.ts +4 -1
  19. package/dist/ui/app/createEditorDocumentRuntime.d.ts +1 -0
  20. package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -0
  21. package/dist/ui/app/useEditorInteractionWiring.d.ts +2 -0
  22. package/dist/ui/canvas/CanvasSelectionGeometry.d.ts +9 -0
  23. package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +0 -1
  24. package/dist/ui/components/Toolbar/ribbon/RibbonTabs.d.ts +2 -1
  25. package/dist/ui/components/Toolbar/ribbon/ribbonModel.d.ts +10 -2
  26. package/dist/ui/components/Toolbar/schema/items.d.ts +1 -1
  27. package/dist/ui/editorUiTypes.d.ts +9 -0
  28. package/dist/ui/overlays/TableHandlesOverlay.d.ts +22 -0
  29. package/package.json +1 -1
  30. package/dist/ui/components/Toolbar/groups/TableGroup.d.ts +0 -7
@@ -1,6 +1,6 @@
1
1
  import { EditorLayoutParagraph, EditorState, EditorLayoutDocument } from '../../core/model.js';
2
2
  import { CaretBox, CommentHighlightBox, InputBox, SelectionBox } from '../../ui/editorUiTypes.js';
3
- import { SelectedImageSelectionBox, SelectedTextBoxSelectionBox } from '../../ui/canvas/CanvasSelectionGeometry.js';
3
+ import { SelectedImageSelectionBox, SelectedTextBoxSelectionBox, SelectedTableBox } from '../../ui/canvas/CanvasSelectionGeometry.js';
4
4
 
5
5
  interface UseEditorLayoutProps {
6
6
  state: EditorState;
@@ -27,6 +27,7 @@ declare function useEditorLayoutImpl(props: UseEditorLayoutProps): {
27
27
  commentHighlights: import('solid-js').Accessor<CommentHighlightBox[]>;
28
28
  selectedImageBox: import('solid-js').Accessor<SelectedImageSelectionBox | null>;
29
29
  selectedTextBoxBox: import('solid-js').Accessor<SelectedTextBoxSelectionBox | null>;
30
+ selectedTableBox: import('solid-js').Accessor<SelectedTableBox | null>;
30
31
  caretBox: import('solid-js').Accessor<CaretBox>;
31
32
  preferredColumnX: import('solid-js').Accessor<number | null>;
32
33
  setPreferredColumnX: import('solid-js').Setter<number | null>;
@@ -0,0 +1,56 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { EditorLayoutDocument, EditorState } from '../../core/model.js';
3
+ import { CanvasLayoutSnapshotProvider } from '../../ui/canvas/canvasLayoutSnapshotProvider.js';
4
+
5
+ /** Live state of a bottom-right corner drag on a single table. */
6
+ export interface TableCornerResizeState {
7
+ tableId: string;
8
+ /** Table bounding box in client px at gesture start. */
9
+ bounds: {
10
+ left: number;
11
+ top: number;
12
+ width: number;
13
+ height: number;
14
+ };
15
+ startClientX: number;
16
+ startClientY: number;
17
+ currentClientX: number;
18
+ currentClientY: number;
19
+ /** Column widths (pt) and total width (pt) captured at start. */
20
+ widthsPt: Record<number, number>;
21
+ totalWidthPt: number;
22
+ /** Rendered row heights (px) captured at start. */
23
+ rowHeightsPx: number[];
24
+ }
25
+ export interface TableCornerResizeOps {
26
+ resizing: Accessor<TableCornerResizeState | null>;
27
+ /** Preview outline in client/fixed coords while dragging (null otherwise). */
28
+ previewRect: Accessor<{
29
+ left: number;
30
+ top: number;
31
+ width: number;
32
+ height: number;
33
+ } | null>;
34
+ handleMouseDown: (tableId: string, event: MouseEvent) => void;
35
+ }
36
+ /**
37
+ * Proportional width/height scale for the current drag, floored so no column
38
+ * shrinks below `MIN_TABLE_SIZE_PT` (pt) and no row below its px equivalent.
39
+ */
40
+ export declare function computeCornerScales(resize: TableCornerResizeState): {
41
+ scaleX: number;
42
+ scaleY: number;
43
+ };
44
+ /**
45
+ * Pure producer: scale every column width by `scaleX` (preserving the scaled
46
+ * total) and every row height by `scaleY`. Exported for unit testing.
47
+ */
48
+ export declare function applyTableCornerResize(state: EditorState, resize: TableCornerResizeState, scaleX: number, scaleY: number): EditorState;
49
+ export declare function createEditorTableCornerResize(deps: {
50
+ state: () => EditorState;
51
+ applyTransactionalState: (producer: (current: EditorState) => EditorState) => void;
52
+ surfaceRef: () => HTMLElement | undefined;
53
+ documentLayout: Accessor<EditorLayoutDocument>;
54
+ canvasSnapshotProvider: CanvasLayoutSnapshotProvider;
55
+ zoomFactor?: () => number;
56
+ }): TableCornerResizeOps;
@@ -105,6 +105,16 @@ export interface OasisCommandPayloads {
105
105
  tableAlignCenter: undefined;
106
106
  tableAlignRight: undefined;
107
107
  tableSetCellWidth: string | number;
108
+ tableToggleHeaderRow: undefined;
109
+ tableToggleTotalRow: undefined;
110
+ tableToggleBandedRows: undefined;
111
+ tableToggleFirstColumn: undefined;
112
+ tableToggleLastColumn: undefined;
113
+ tableToggleBandedColumns: undefined;
114
+ setTableStyle: string;
115
+ tableToggleAutoFit: undefined;
116
+ tableDistributeColumns: undefined;
117
+ tableDistributeRows: undefined;
108
118
  insertTable: InsertTablePayload;
109
119
  }
110
120
  export interface OasisCommandResults {
@@ -1,3 +1,9 @@
1
1
  import { EditorState } from '../../model.js';
2
2
 
3
3
  export declare function setTableColumnWidths(state: EditorState, tableId: string, columnWidths: Record<number, number | string>, tableWidth?: number | string, tableIndentLeft?: number | string): EditorState;
4
+ /**
5
+ * Equalize the widths of every visual column in the active table (Word's
6
+ * "Distribute Columns"), preserving the table's total width. Merged cells keep
7
+ * their span, so a cell spanning N columns gets N equal shares.
8
+ */
9
+ export declare function distributeSelectedTableColumns(state: EditorState): EditorState;
@@ -3,3 +3,9 @@ import { EditorState, EditorTableRowStyle } from '../../model.js';
3
3
  export declare function setSelectedTableRowStyleValue<K extends keyof EditorTableRowStyle>(state: EditorState, key: K, value: EditorTableRowStyle[K] | null): EditorState;
4
4
  export declare function setSelectedTableRowHeader(state: EditorState, value: boolean | null): EditorState;
5
5
  export declare function setTableRowHeight(state: EditorState, tableId: string, rowIndex: number, height: number | string | null): EditorState;
6
+ /**
7
+ * Equalize the heights of every row in the active table (Word's "Distribute
8
+ * Rows"). Uses the tallest explicit row height as the target (or a default when
9
+ * none is set) with the `atLeast` rule so cell content can still grow.
10
+ */
11
+ export declare function distributeSelectedTableRows(state: EditorState): EditorState;
@@ -1,5 +1,12 @@
1
- export declare const RIBBON_TABS: readonly ["file", "home", "insert", "draw", "layout", "references", "collaboration", "protection", "view", "plugins", "ai"];
1
+ export declare const RIBBON_TABS: readonly ["file", "home", "insert", "draw", "layout", "references", "collaboration", "protection", "view", "tableDesign", "tableLayout", "plugins", "ai"];
2
2
  export type RibbonTabId = (typeof RIBBON_TABS)[number];
3
+ /**
4
+ * Contextual tabs are hidden from the tab strip unless their gating command
5
+ * reports `isActive`. This mirrors Word's contextual ribbons (e.g. table tools
6
+ * that appear only when the caret is inside a table). The mapping is
7
+ * UI-agnostic: the value is the command id whose `isActive` state gates the tab.
8
+ */
9
+ export declare const CONTEXTUAL_TABS: Partial<Record<RibbonTabId, string>>;
3
10
  export type RibbonRow = 1 | 2;
4
11
  export type RibbonSize = "normal" | "large";
5
12
  export type RibbonGroupResizeState = "full" | "compact" | "collapsed";
@@ -29,6 +29,9 @@ export declare const MERGE_KEYS: {
29
29
  readonly tableWidth: "tableWidth";
30
30
  readonly tableAlign: "tableAlign";
31
31
  readonly tableCellWidth: "tableCellWidth";
32
+ readonly tableStyleOptions: "tableStyleOptions";
33
+ readonly tableStyleGallery: "tableStyleGallery";
34
+ readonly tableDistribute: "tableDistribute";
32
35
  readonly layoutWrapPreset: "layoutWrapPreset";
33
36
  readonly layoutFixedPosition: "layoutFixedPosition";
34
37
  };
@@ -235,6 +235,16 @@ export declare const en: {
235
235
  "table.alignLeft": string;
236
236
  "table.alignCenter": string;
237
237
  "table.alignRight": string;
238
+ "table.headerRow": string;
239
+ "table.totalRow": string;
240
+ "table.bandedRows": string;
241
+ "table.firstColumn": string;
242
+ "table.lastColumn": string;
243
+ "table.bandedColumns": string;
244
+ "table.tableStyle": string;
245
+ "table.autoFit": string;
246
+ "table.distributeRows": string;
247
+ "table.distributeColumns": string;
238
248
  "table.cellWidth": string;
239
249
  "table.cellBgColorPrompt": string;
240
250
  "table.cellWidthPrompt": string;
@@ -353,6 +363,8 @@ export declare const en: {
353
363
  "ribbon.tab.collaboration": string;
354
364
  "ribbon.tab.protection": string;
355
365
  "ribbon.tab.view": string;
366
+ "ribbon.tab.tableDesign": string;
367
+ "ribbon.tab.tableLayout": string;
356
368
  "ribbon.tab.plugins": string;
357
369
  "ribbon.tab.ai": string;
358
370
  "ribbon.group.clipboard": string;
@@ -368,6 +380,13 @@ export declare const en: {
368
380
  "ribbon.group.table": string;
369
381
  "ribbon.group.section": string;
370
382
  "ribbon.group.general": string;
383
+ "ribbon.group.tableStyleOptions": string;
384
+ "ribbon.group.tableStyles": string;
385
+ "ribbon.group.borders": string;
386
+ "ribbon.group.rowsColumns": string;
387
+ "ribbon.group.merge": string;
388
+ "ribbon.group.cellSize": string;
389
+ "ribbon.group.alignment": string;
371
390
  "toolbar.exportDocx": string;
372
391
  "toolbar.exportPdf": string;
373
392
  "underline.style.single": string;
@@ -235,6 +235,16 @@ export declare const ptBR: {
235
235
  "table.alignLeft": string;
236
236
  "table.alignCenter": string;
237
237
  "table.alignRight": string;
238
+ "table.headerRow": string;
239
+ "table.totalRow": string;
240
+ "table.bandedRows": string;
241
+ "table.firstColumn": string;
242
+ "table.lastColumn": string;
243
+ "table.bandedColumns": string;
244
+ "table.tableStyle": string;
245
+ "table.autoFit": string;
246
+ "table.distributeRows": string;
247
+ "table.distributeColumns": string;
238
248
  "table.cellWidth": string;
239
249
  "table.cellBgColorPrompt": string;
240
250
  "table.cellWidthPrompt": string;
@@ -353,6 +363,8 @@ export declare const ptBR: {
353
363
  "ribbon.tab.collaboration": string;
354
364
  "ribbon.tab.protection": string;
355
365
  "ribbon.tab.view": string;
366
+ "ribbon.tab.tableDesign": string;
367
+ "ribbon.tab.tableLayout": string;
356
368
  "ribbon.tab.plugins": string;
357
369
  "ribbon.tab.ai": string;
358
370
  "ribbon.group.clipboard": string;
@@ -368,6 +380,13 @@ export declare const ptBR: {
368
380
  "ribbon.group.table": string;
369
381
  "ribbon.group.section": string;
370
382
  "ribbon.group.general": string;
383
+ "ribbon.group.tableStyleOptions": string;
384
+ "ribbon.group.tableStyles": string;
385
+ "ribbon.group.borders": string;
386
+ "ribbon.group.rowsColumns": string;
387
+ "ribbon.group.merge": string;
388
+ "ribbon.group.cellSize": string;
389
+ "ribbon.group.alignment": string;
371
390
  "toolbar.exportDocx": string;
372
391
  "toolbar.exportPdf": string;
373
392
  "underline.style.single": string;