ooxml-ui 1.32.0 → 1.34.0
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/custom-elements.json +10 -0
- package/dist/building-block-styles.d.ts +1 -0
- package/dist/chart/format-pane-3d.d.ts +1 -0
- package/dist/chart/format-pane-analysis.d.ts +1 -0
- package/dist/chart/format-pane-fill-line.d.ts +1 -0
- package/dist/chart/format-pane-text.d.ts +1 -0
- package/dist/{chunk-OKEFAQJT.js → chunk-3AOIYE3R.js} +87 -20
- package/dist/{chunk-WYKMVMX4.js → chunk-BOTLS2PR.js} +45 -0
- package/dist/{chunk-32P252JS.js → chunk-SWDVBUBW.js} +1 -1
- package/dist/docx/editor-attributes.d.ts +7 -0
- package/dist/docx/format-dialogs.d.ts +1 -1
- package/dist/docx/locales/en.d.ts +4 -0
- package/dist/docx/locales/split-cells.d.ts +10 -0
- package/dist/docx/localization-strings.d.ts +4 -0
- package/dist/docx/ribbon-icons.d.ts +2 -0
- package/dist/docx/split-cells-dialog.d.ts +4 -0
- package/dist/docx/table-commands.d.ts +9 -3
- package/dist/docx/table-model-adapter.d.ts +5 -0
- package/dist/docx/table-restructure-commands.d.ts +36 -0
- package/dist/docx/table-restructure-convert.d.ts +10 -0
- package/dist/docx/table-restructure.d.ts +22 -0
- package/dist/docx.js +652 -46
- package/dist/index.js +3 -3
- package/dist/{presentation-preview-XGJMARKI.js → presentation-preview-ZVJNGOJO.js} +1 -1
- package/dist/teams/app/chat-people-dialog.d.ts +5 -0
- package/dist/teams/app/teams-app.d.ts +3 -0
- package/dist/teams/chat-list.d.ts +5 -0
- package/dist/teams/i18n/locales/de.d.ts +9 -0
- package/dist/teams/i18n/locales/en/chat.d.ts +2 -0
- package/dist/teams/i18n/locales/en/shell.d.ts +7 -0
- package/dist/teams/i18n/locales/en.d.ts +9 -0
- package/dist/teams/i18n/locales/es.d.ts +9 -0
- package/dist/teams/i18n/locales/fr.d.ts +9 -0
- package/dist/teams/i18n/locales/zh-CN.d.ts +9 -0
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/xlsx/dialogs/custom-views.d.ts +2 -0
- package/dist/xlsx/dialogs/forecast-sheet.d.ts +2 -0
- package/dist/xlsx/dialogs/scenario-extras.d.ts +8 -0
- package/dist/xlsx/grid/shapes.d.ts +21 -0
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx/header-image.d.ts +8 -0
- package/dist/xlsx.js +656 -126
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ import { type PageSetupHost } from './page-setup-dialog.js';
|
|
|
8
8
|
import { type ZoomHost } from './zoom-dialog.js';
|
|
9
9
|
import { type LineNumberHost } from './line-number-dialog.js';
|
|
10
10
|
import { type ColumnsHost } from './columns-dialog.js';
|
|
11
|
-
export type FormatDialogKind = 'font' | 'paragraph' | 'bookmark' | 'pageSetup' | 'caption' | 'crossReference' | 'zoom' | 'borders' | 'tableProperties' | 'lineNumbers' | 'textBox' | 'contentControl' | 'equation' | 'shapeText' | 'pageBorders' | 'watermark' | 'dropCap' | 'columns' | 'multilevelList' | 'tracking' | 'insertChart' | 'changeChartType' | 'chartData';
|
|
11
|
+
export type FormatDialogKind = 'font' | 'paragraph' | 'bookmark' | 'pageSetup' | 'caption' | 'crossReference' | 'zoom' | 'borders' | 'tableProperties' | 'splitCells' | 'lineNumbers' | 'textBox' | 'contentControl' | 'equation' | 'shapeText' | 'pageBorders' | 'watermark' | 'dropCap' | 'columns' | 'multilevelList' | 'tracking' | 'insertChart' | 'changeChartType' | 'chartData';
|
|
12
12
|
export interface FormatDialogsHost {
|
|
13
13
|
view(): EditorView | undefined;
|
|
14
14
|
/** Header/footer edits use the main document's history; notes use their own. */
|
|
@@ -89,6 +89,10 @@ export declare const en: {
|
|
|
89
89
|
readonly 'smartart.layout.basicPyramid': 'Basic Pyramid';
|
|
90
90
|
readonly 'smartart.layout.invertedPyramid': 'Inverted Pyramid';
|
|
91
91
|
readonly 'smartart.layout.basicFunnel': 'Funnel';
|
|
92
|
+
readonly 'Merge cells': 'Merge cells';
|
|
93
|
+
readonly 'Split cells': 'Split cells';
|
|
94
|
+
readonly 'Number of rows': 'Number of rows';
|
|
95
|
+
readonly 'Split the cell into this many columns and rows.': 'Split the cell into this many columns and rows.';
|
|
92
96
|
readonly 'Change how document content is displayed on the screen.': string;
|
|
93
97
|
readonly 'Page display options': string;
|
|
94
98
|
readonly 'Formatting marks': string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const enSplitCells: {
|
|
2
|
+
readonly 'Merge cells': 'Merge cells';
|
|
3
|
+
readonly 'Split cells': 'Split cells';
|
|
4
|
+
readonly 'Number of rows': 'Number of rows';
|
|
5
|
+
readonly 'Split the cell into this many columns and rows.': 'Split the cell into this many columns and rows.';
|
|
6
|
+
};
|
|
7
|
+
export declare const frSplitCells: Record<"Merge cells" | "Number of rows" | "Split cells" | "Split the cell into this many columns and rows.", string>;
|
|
8
|
+
export declare const deSplitCells: Record<"Merge cells" | "Number of rows" | "Split cells" | "Split the cell into this many columns and rows.", string>;
|
|
9
|
+
export declare const esSplitCells: Record<"Merge cells" | "Number of rows" | "Split cells" | "Split the cell into this many columns and rows.", string>;
|
|
10
|
+
export declare const zhSplitCells: Record<"Merge cells" | "Number of rows" | "Split cells" | "Split the cell into this many columns and rows.", string>;
|
|
@@ -86,6 +86,10 @@ export declare const strings: {
|
|
|
86
86
|
readonly 'smartart.layout.basicPyramid': 'Basic Pyramid';
|
|
87
87
|
readonly 'smartart.layout.invertedPyramid': 'Inverted Pyramid';
|
|
88
88
|
readonly 'smartart.layout.basicFunnel': 'Funnel';
|
|
89
|
+
readonly 'Merge cells': 'Merge cells';
|
|
90
|
+
readonly 'Split cells': 'Split cells';
|
|
91
|
+
readonly 'Number of rows': 'Number of rows';
|
|
92
|
+
readonly 'Split the cell into this many columns and rows.': 'Split the cell into this many columns and rows.';
|
|
89
93
|
readonly 'Change how document content is displayed on the screen.': string;
|
|
90
94
|
readonly 'Page display options': string;
|
|
91
95
|
readonly 'Formatting marks': string;
|
|
@@ -75,6 +75,8 @@ declare const paths: {
|
|
|
75
75
|
readonly columnLeft: 'M10 4h10v16H10z M15 4v16 M3 12h4 M5 10v4';
|
|
76
76
|
readonly columnRight: 'M4 4h10v16H4z M9 4v16 M17 12h4 M19 10v4';
|
|
77
77
|
readonly deleteColumn: 'M6 4h9v16H6z M10.5 4v16 M19 8v8';
|
|
78
|
+
readonly mergeCells: 'M4 5h16v14H4z M4 12h4 M16 12h4 M10 9l-3 3 3 3 M14 9l3 3-3 3';
|
|
79
|
+
readonly splitCell: 'M4 5h16v14H4z M12 5v14 M8 9l-3 3 3 3 M16 9l3 3-3 3';
|
|
78
80
|
readonly deleteTable: 'M4 5h16v14H4z M4 10h16 M10 5v14 M14 13l5 5 M19 13l-5 5';
|
|
79
81
|
readonly margins: 'M5 3h14v18H5z M8 6h8v12H8z';
|
|
80
82
|
readonly orientation: 'M6 3h9l3 3v15H6z M12 9v6 M9 12h6';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorView } from 'prosemirror-view';
|
|
2
|
+
import type { FormatDialog } from './font-dialog.js';
|
|
3
|
+
/** The Split Cells dialog; OK splits the cell around the selection into the chosen grid. */
|
|
4
|
+
export declare function createSplitCellsDialog(viewOf: () => EditorView | undefined): FormatDialog;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { EditorView } from 'prosemirror-view';
|
|
2
|
-
|
|
2
|
+
import { type Split } from './table-restructure-commands.js';
|
|
3
|
+
export type TableCommand = 'rowBefore' | 'rowAfter' | 'deleteRow' | 'columnBefore' | 'columnAfter' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'deleteTable';
|
|
4
|
+
export declare function paragraphIdFactory(view: EditorView): () => string;
|
|
3
5
|
/** Reports whether the current selection can receive the requested table edit. */
|
|
4
6
|
export declare function canExecuteTableCommand(view: EditorView, action: TableCommand): boolean;
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Applies a structural command to the table containing the selection: rows and columns of a
|
|
9
|
+
* rectangular table directly, merged and nested tables, and merge and split, through the
|
|
10
|
+
* merge-aware editor. `split` sizes Split Cells (it defaults to two columns).
|
|
11
|
+
*/
|
|
12
|
+
export declare function executeTableCommand(view: EditorView, action: TableCommand, split?: Split): boolean;
|
|
@@ -15,3 +15,8 @@ export declare function convertSimpleTable(node: ProseMirrorNode, convertParagra
|
|
|
15
15
|
* identity, leaving row/cell layout, merges and descriptive properties exactly as they were.
|
|
16
16
|
*/
|
|
17
17
|
export declare function convertMergedTable(node: ProseMirrorNode, prior: Table, convertParagraph: (paragraph: ProseMirrorNode) => Paragraph): Table;
|
|
18
|
+
/**
|
|
19
|
+
* A merged or nested table back to the model: rebuilt from the node when its cells, merges or
|
|
20
|
+
* grid were edited, otherwise patched by cell identity so its structure stays as authored.
|
|
21
|
+
*/
|
|
22
|
+
export declare function convertStructuredTable(node: ProseMirrorNode, prior: Table, convertParagraph: (paragraph: ProseMirrorNode) => Paragraph): Table;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type GridRect, type IdFactory } from 'ooxml-core/docx/ui';
|
|
2
|
+
import type { Table } from 'ooxml-core/docx';
|
|
3
|
+
import type { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
4
|
+
import type { EditorView } from 'prosemirror-view';
|
|
5
|
+
import { type Slot } from './table-restructure.js';
|
|
6
|
+
export type RestructureCommand = 'rowBefore' | 'rowAfter' | 'deleteRow' | 'columnBefore' | 'columnAfter' | 'deleteColumn' | 'mergeCells' | 'splitCell';
|
|
7
|
+
interface Context {
|
|
8
|
+
table: ProseMirrorNode;
|
|
9
|
+
tablePos: number;
|
|
10
|
+
nested: boolean;
|
|
11
|
+
skeleton: Table;
|
|
12
|
+
/** The cells the selection touches, with their row and position in the row. */
|
|
13
|
+
selected: {
|
|
14
|
+
slot: Slot;
|
|
15
|
+
index: number;
|
|
16
|
+
}[];
|
|
17
|
+
rect: GridRect;
|
|
18
|
+
}
|
|
19
|
+
/** The innermost table around the selection, when the structure commands can edit it. */
|
|
20
|
+
export declare function restructureContext(view: EditorView): Context | undefined;
|
|
21
|
+
/** Whether the merged-table commands (not the rectangular-table ones) own this table. */
|
|
22
|
+
export declare function usesRestructure(ctx: Context | undefined, action: string): boolean;
|
|
23
|
+
export interface Split {
|
|
24
|
+
rows: number;
|
|
25
|
+
columns: number;
|
|
26
|
+
}
|
|
27
|
+
/** Whether `action` applies to the table around the selection (a dry run of the edit). */
|
|
28
|
+
export declare function canRestructure(ctx: Context, action: RestructureCommand): boolean;
|
|
29
|
+
/** The size of the cell the Split Cells dialog starts from, or undefined when none can be split. */
|
|
30
|
+
export declare function splitTarget(view: EditorView): {
|
|
31
|
+
rows: number;
|
|
32
|
+
span: number;
|
|
33
|
+
} | undefined;
|
|
34
|
+
/** Applies `action` to the table around the selection; false when it cannot be applied. */
|
|
35
|
+
export declare function executeRestructure(view: EditorView, action: RestructureCommand, newId: IdFactory, split?: Split): boolean;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContentControl, Paragraph, Table, TableCell } from 'ooxml-core/docx';
|
|
2
|
+
import type { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
/** Whether the node's cells, spans, merges, widths or grid differ from the model's. */
|
|
4
|
+
export declare function structureChanged(node: ProseMirrorNode, prior: Table): boolean;
|
|
5
|
+
export type NestedConverter = (node: ProseMirrorNode, prior: Table) => Table;
|
|
6
|
+
/**
|
|
7
|
+
* Rebuilds `prior` from the edited `node`: rows, cells and merges as the node holds them, each
|
|
8
|
+
* surviving cell cloned from its source cell by first-paragraph id.
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertRestructuredTable(node: ProseMirrorNode, prior: Table, convertParagraph: (paragraph: ProseMirrorNode) => Paragraph, convertNested: NestedConverter, heldControl: (cell: ProseMirrorNode, prior: ContentControl | undefined) => Partial<TableCell>): Table;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Table } from 'ooxml-core/docx';
|
|
2
|
+
import type { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
/** One position of a row: a cell node, or a cell the vertical merge above it continues through. */
|
|
4
|
+
export interface Slot {
|
|
5
|
+
row: number;
|
|
6
|
+
col: number;
|
|
7
|
+
span: number;
|
|
8
|
+
/** The cell node (the merge start, for a continuation). */
|
|
9
|
+
cell: ProseMirrorNode;
|
|
10
|
+
/** 0 for the cell itself, k for its k-th continuation row. */
|
|
11
|
+
offset: number;
|
|
12
|
+
/** First paragraph id of the source cell this slot stands for. */
|
|
13
|
+
key: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const keysOf: (cell: ProseMirrorNode) => string[];
|
|
16
|
+
export declare const gridOf: (table: ProseMirrorNode) => number[] | undefined;
|
|
17
|
+
/** The slots of each row of a table node, left to right. */
|
|
18
|
+
export declare function slotsOf(table: ProseMirrorNode): Slot[][];
|
|
19
|
+
/** The core model of a table node: cell ids, spans, merges, widths and the formatting new cells copy. */
|
|
20
|
+
export declare function skeletonOf(table: ProseMirrorNode): Table;
|
|
21
|
+
/** A table node for `result`, a structure edit of `old`'s skeleton; surviving cells keep their content. */
|
|
22
|
+
export declare function nodeFromResult(old: ProseMirrorNode, result: Table): ProseMirrorNode | undefined;
|