ooxml-ui 1.32.0 → 1.33.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-32P252JS.js → chunk-QK5DQR6L.js} +1 -1
- package/dist/{chunk-WYKMVMX4.js → chunk-VSHQNHDG.js} +40 -0
- package/dist/{chunk-OKEFAQJT.js → chunk-XPUXFZNB.js} +71 -18
- 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-DKJC6TUJ.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 +8 -0
- package/dist/teams/i18n/locales/en/chat.d.ts +2 -0
- package/dist/teams/i18n/locales/en/shell.d.ts +6 -0
- package/dist/teams/i18n/locales/en.d.ts +8 -0
- package/dist/teams/i18n/locales/es.d.ts +8 -0
- package/dist/teams/i18n/locales/fr.d.ts +8 -0
- package/dist/teams/i18n/locales/zh-CN.d.ts +8 -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
|
@@ -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;
|