ooxml-ui 1.7.0 → 1.8.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/README.md +89 -36
- package/custom-elements.json +251 -4
- package/dist/chrome/ruler.d.ts +7 -1
- package/dist/chrome/ruler.d.ts.map +1 -1
- package/dist/chrome/task-pane.d.ts +2 -0
- package/dist/chrome/task-pane.d.ts.map +1 -1
- package/dist/chrome/title-bar.d.ts +2 -1
- package/dist/chrome/title-bar.d.ts.map +1 -1
- package/dist/{chunk-6UPGM3X2.js → chunk-7US5GCXF.js} +158 -153
- package/dist/{chunk-VAR6O7II.js → chunk-KF72ZA6V.js} +4 -2
- package/dist/{chunk-SCWCZSTE.js → chunk-O7APCA5N.js} +612 -69
- package/dist/chunk-W6AV3GHC.js +112 -0
- package/dist/controls.d.ts +8 -2
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/dialog/dialog-footer.d.ts.map +1 -1
- package/dist/dialog/options-dialog.d.ts.map +1 -1
- package/dist/docx/editor-core.d.ts +3 -0
- package/dist/docx/editor-shell.d.ts +2 -0
- package/dist/docx/element-api.d.ts +7 -0
- package/dist/docx/events.d.ts +4 -1
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/ribbon-color-grid.d.ts +3 -4
- package/dist/docx.js +46 -78
- package/dist/edit-worker.js +52 -3
- package/dist/form/color-custom.d.ts +79 -0
- package/dist/form/color-custom.d.ts.map +1 -0
- package/dist/form/color-grid.d.ts +125 -0
- package/dist/form/color-grid.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -3
- package/dist/menu/context-menu.d.ts.map +1 -1
- package/dist/menu/menu-button.d.ts +2 -1
- package/dist/menu/menu-button.d.ts.map +1 -1
- package/dist/notices/paste-options.d.ts.map +1 -1
- package/dist/notices/toasts.d.ts.map +1 -1
- package/dist/pptx/{chart-3d-view-scene-ERX2GRCD.mjs → chart-3d-view-scene-P6MAFEGL.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-55WDENSO.cjs → chart-3d-view-scene-V74F7ZOC.cjs} +38 -38
- package/dist/pptx/{chunk-G2YUKLRX.cjs → chunk-526IHNIH.cjs} +1 -1
- package/dist/pptx/{chunk-SVN6OBG4.mjs → chunk-DPOES4WM.mjs} +26 -11
- package/dist/pptx/{chunk-XGPLA2OY.cjs → chunk-GCS5KBMR.cjs} +481 -605
- package/dist/pptx/{chunk-RPRC2EG5.cjs → chunk-K3S2A64B.cjs} +13 -13
- package/dist/pptx/{chunk-RCTRRS6E.mjs → chunk-MCHPNO42.mjs} +264 -447
- package/dist/pptx/{chunk-AWQRQUPL.mjs → chunk-NAFUYAQP.mjs} +1 -1
- package/dist/pptx/{chunk-LCIXR7WE.cjs → chunk-VFPVEVF4.cjs} +26 -11
- package/dist/pptx/{chunk-TKATCPOK.mjs → chunk-ZAOYPCAM.mjs} +1 -1
- package/dist/pptx/dom/activex-controls-overlay.d.ts.map +1 -1
- package/dist/pptx/dom/elements/image.d.ts.map +1 -1
- package/dist/pptx/dom/elements/media.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-block.d.ts.map +1 -1
- package/dist/pptx/dom/elements/zoom.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +252 -247
- package/dist/pptx/dom/index.mjs +11 -6
- package/dist/pptx/export/html2canvas-clone.cjs +2 -2
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/index.cjs +3059 -3023
- package/dist/pptx/index.mjs +4 -4
- package/dist/pptx/render/chart-combo-series.d.ts.map +1 -1
- package/dist/pptx/render/chart-combo-stock.cjs +3 -3
- package/dist/pptx/render/chart-combo-stock.mjs +1 -1
- package/dist/pptx/render/chart-marker-shape.d.ts.map +1 -1
- package/dist/pptx/render/chart-overlays.cjs +7 -7
- package/dist/pptx/render/chart-overlays.mjs +1 -1
- package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
- package/dist/pptx/render/chart-view-model.cjs +44 -44
- package/dist/pptx/render/chart-view-model.mjs +1 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
- package/dist/pptx/render/connector-router-types.d.ts +4 -52
- package/dist/pptx/render/connector-router-types.d.ts.map +1 -1
- package/dist/pptx/render/connector-router.d.ts +4 -32
- package/dist/pptx/render/connector-router.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-add-ins.d.ts +53 -0
- package/dist/pptx/render/ribbon-add-ins.d.ts.map +1 -0
- package/dist/pptx/web-components/index.d.ts +1 -0
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-add-in.d.ts +20 -0
- package/dist/pptx/web-components/ribbon-add-in.d.ts.map +1 -0
- package/dist/ribbon/add-in-tabs.d.ts +36 -0
- package/dist/ribbon/group-overflow.d.ts +37 -0
- package/dist/ribbon/group-overflow.d.ts.map +1 -0
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/teams/app/index.d.ts +1 -1
- package/dist/teams.js +2 -2
- package/dist/visio/format-pane-fields.d.ts +42 -0
- package/dist/visio/format-pane-view.d.ts +44 -0
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/page-setup-action.d.ts +4 -0
- package/dist/visio/ribbon-action.d.ts +17 -6
- package/dist/visio/ribbon-change-shape.d.ts +17 -6
- package/dist/visio/ribbon-color-menu.d.ts +29 -0
- package/dist/visio/ribbon-inline-galleries.d.ts +20 -0
- package/dist/visio/ribbon-overflow.d.ts +7 -0
- package/dist/visio/ribbon-review.d.ts +5 -2
- package/dist/visio/ribbon-router.d.ts +3 -3
- package/dist/visio/ribbon-shape-styles.d.ts +4 -1
- package/dist/visio/ribbon-style-options.d.ts +4 -3
- package/dist/visio/shapes-document.d.ts +29 -0
- package/dist/visio/shapes-sections.d.ts +19 -5
- package/dist/visio/shapes-storage.d.ts +15 -0
- package/dist/visio/shapes-window.d.ts +7 -0
- package/dist/visio/stencil-catalog.d.ts +4 -0
- package/dist/visio/text-measurer.d.ts +25 -0
- package/dist/visio/viewer-auto-connect-parts.d.ts +12 -0
- package/dist/visio/viewer-auto-connect.d.ts +33 -0
- package/dist/visio/viewer-change-shape.d.ts +8 -4
- package/dist/visio/viewer-chrome.d.ts +3 -2
- package/dist/visio/viewer-color-menus.d.ts +34 -0
- package/dist/visio/viewer-commands.d.ts +4 -3
- package/dist/visio/viewer-connector-tool.d.ts +5 -3
- package/dist/visio/viewer-data-window.d.ts +5 -1
- package/dist/visio/viewer-draw-tool.d.ts +1 -11
- package/dist/visio/viewer-element.d.ts +8 -0
- package/dist/visio/viewer-format-pane.d.ts +26 -0
- package/dist/visio/viewer-guides.d.ts +3 -3
- package/dist/visio/viewer-layout-commands.d.ts +5 -1
- package/dist/visio/viewer-more-colors.d.ts +16 -0
- package/dist/visio/viewer-page-setup.d.ts +6 -0
- package/dist/visio/viewer-ruler-grid.d.ts +25 -0
- package/dist/visio/viewer-ruler.d.ts +11 -3
- package/dist/visio/viewer-snap-glue.d.ts +23 -0
- package/dist/visio/viewer-stencil.d.ts +4 -1
- package/dist/visio.js +6688 -5303
- package/dist/xlsx/component.d.ts +8 -0
- package/dist/xlsx/dialogs/format-cells/color-swatches.d.ts +4 -2
- package/dist/xlsx/dialogs/styles.d.ts +1 -1
- package/dist/xlsx/events.d.ts +4 -1
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/ribbon/color-grid.d.ts +25 -7
- package/dist/xlsx/ribbon/ribbon.d.ts +3 -0
- package/dist/xlsx.js +121 -163
- package/package.json +3 -2
- package/dist/pptx/render/connector-router-astar.d.ts +0 -24
- package/dist/pptx/render/connector-router-astar.d.ts.map +0 -1
- package/dist/pptx/render/connector-router-graph.d.ts +0 -38
- package/dist/pptx/render/connector-router-graph.d.ts.map +0 -1
- package/dist/visio/format-shape-dialog.d.ts +0 -21
- package/dist/visio/viewer-format-shape.d.ts +0 -16
- package/dist/visio/viewer-paint-dialog.d.ts +0 -28
- package/dist/visio/viewer-paint-properties.d.ts +0 -13
package/dist/xlsx/component.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* in editor-core.ts and the DOM in editor-shell.ts.
|
|
4
4
|
*/
|
|
5
5
|
import type { Workbook } from 'ooxml-core/xlsx';
|
|
6
|
+
import type { RibbonAddInTab } from '../ribbon/add-in-tabs.js';
|
|
6
7
|
import { XlsxEditorApi } from './element-api.js';
|
|
7
8
|
import type { XlsxEditorEventMap } from './events.js';
|
|
8
9
|
import type { XlsxCollaborationOptions } from './collaboration-types.js';
|
|
@@ -23,6 +24,7 @@ export interface XlsxEditorElement {
|
|
|
23
24
|
export declare class XlsxEditorElement extends XlsxEditorApi {
|
|
24
25
|
static get observedAttributes(): readonly string[];
|
|
25
26
|
private shell;
|
|
27
|
+
private addIns;
|
|
26
28
|
connectedCallback(): void;
|
|
27
29
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
28
30
|
/** Interface language: `en`, `fr`, `de`, `es`, `zh-CN` (any tag mapping to one). */
|
|
@@ -49,6 +51,12 @@ export declare class XlsxEditorElement extends XlsxEditorApi {
|
|
|
49
51
|
/** Command ids the ribbon, menus, Tell me and shortcuts leave out. */
|
|
50
52
|
get hiddenActions(): string[];
|
|
51
53
|
set hiddenActions(value: readonly string[]);
|
|
54
|
+
/**
|
|
55
|
+
* Tabs a host adds after Excel's own, as an Office add-in does. Each command runs its `run`
|
|
56
|
+
* callback and dispatches `office-ribbon-add-in` (`{ tab, command }`) from the editor.
|
|
57
|
+
*/
|
|
58
|
+
get ribbonAddIns(): readonly RibbonAddInTab[];
|
|
59
|
+
set ribbonAddIns(value: readonly RibbonAddInTab[]);
|
|
52
60
|
/** The open workbook model, or null. Assigning one shows it with a fresh undo history. */
|
|
53
61
|
get workbook(): Workbook | null;
|
|
54
62
|
set workbook(value: Workbook | null);
|
|
@@ -2,9 +2,11 @@ import type { Color } from 'ooxml-core/xlsx';
|
|
|
2
2
|
import type { EditorContext } from 'ooxml-core/xlsx/ui';
|
|
3
3
|
export declare const colorKey: (color: Color | undefined) => string;
|
|
4
4
|
export interface SwatchGrid {
|
|
5
|
-
element:
|
|
5
|
+
element: HTMLElement;
|
|
6
6
|
value(): Color | undefined;
|
|
7
7
|
set(color: Color | undefined): void;
|
|
8
|
+
/** Focus the current choice. */
|
|
9
|
+
focus(): void;
|
|
8
10
|
}
|
|
9
|
-
/** `noneLabel` names the "no colour"
|
|
11
|
+
/** `noneLabel` names the "no colour" command (`Automatic` or `No Color`). */
|
|
10
12
|
export declare function swatchGrid(ctx: EditorContext, label: string, noneLabel: string, initial: Color | undefined, onChange?: (color: Color | undefined) => void): SwatchGrid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DIALOG_CSS = "\n.xve-cmd-dialog { --office-background: var(--xve-popover, var(--xve-background, #fff));\n\t--office-foreground: var(--xve-popover-foreground, var(--xve-foreground, #1f2937));\n\t--office-border: var(--xve-border, #d1d5db); --office-ring: var(--xve-ring, #217346); }\n.xve-dialog-body { display: flex; flex-direction: column; gap: 10px; min-width: min(360px, 86vw);\n\tfont: 13px/1.4 var(--xve-font, system-ui, \"Segoe UI\", sans-serif); color: var(--office-foreground); }\n.xve-cmd-dialog-wide .xve-dialog-body { min-width: min(560px, 90vw); }\n.xve-dialog-footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }\n.xve-btn { min-height: 28px; padding: 3px 14px; border-radius: var(--xve-radius, 4px); cursor: pointer;\n\tborder: 1px solid var(--xve-border, #c8c6c4); background: var(--xve-secondary, #fff); color: inherit; font: inherit; }\n.xve-btn:hover:not(:disabled) { background: var(--xve-accent, #f3f2f1); }\n.xve-btn:focus-visible, .xve-input:focus-visible, .xve-tab:focus-visible, .xve-listbox:focus-visible,\n\t.xve-
|
|
1
|
+
export declare const DIALOG_CSS = "\n.xve-cmd-dialog { --office-background: var(--xve-popover, var(--xve-background, #fff));\n\t--office-foreground: var(--xve-popover-foreground, var(--xve-foreground, #1f2937));\n\t--office-border: var(--xve-border, #d1d5db); --office-ring: var(--xve-ring, #217346); }\n.xve-dialog-body { display: flex; flex-direction: column; gap: 10px; min-width: min(360px, 86vw);\n\tfont: 13px/1.4 var(--xve-font, system-ui, \"Segoe UI\", sans-serif); color: var(--office-foreground); }\n.xve-cmd-dialog-wide .xve-dialog-body { min-width: min(560px, 90vw); }\n.xve-dialog-footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }\n.xve-btn { min-height: 28px; padding: 3px 14px; border-radius: var(--xve-radius, 4px); cursor: pointer;\n\tborder: 1px solid var(--xve-border, #c8c6c4); background: var(--xve-secondary, #fff); color: inherit; font: inherit; }\n.xve-btn:hover:not(:disabled) { background: var(--xve-accent, #f3f2f1); }\n.xve-btn:focus-visible, .xve-input:focus-visible, .xve-tab:focus-visible, .xve-listbox:focus-visible,\n\t.xve-tile:focus-visible { outline: 2px solid var(--xve-ring, #217346); outline-offset: 1px; }\n.xve-btn-primary { background: var(--xve-primary, #217346); color: var(--xve-primary-foreground, #fff);\n\tborder-color: var(--xve-primary, #217346); }\n.xve-btn-primary:hover:not(:disabled) { background: var(--xve-primary, #1b5e38); filter: brightness(.95); }\n.xve-btn:disabled { opacity: .5; cursor: default; }\n.xve-field { display: grid; grid-template-columns: minmax(110px, auto) 1fr; align-items: center; gap: 8px; }\n.xve-field-label { color: var(--xve-muted-foreground, #605e5c); }\n.xve-input { box-sizing: border-box; min-height: 28px; padding: 3px 6px; border-radius: var(--xve-radius, 4px);\n\tborder: 1px solid var(--xve-input, #c8c6c4); background: var(--xve-background, #fff); color: inherit; font: inherit; min-width: 0; }\ntextarea.xve-input { resize: vertical; }\n.xve-input[aria-invalid=\"true\"] { border-color: var(--xve-destructive, #c50f1f); }\n.xve-check { display: flex; align-items: center; gap: 6px; }\n.xve-fieldset { border: 1px solid var(--xve-border, #e1dfdd); border-radius: var(--xve-radius, 4px);\n\tpadding: 8px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.xve-fieldset legend { padding: 0 4px; font-weight: 600; }\n.xve-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }\n.xve-row > * { flex: 1 1 160px; }\n.xve-note { margin: 0; color: var(--xve-muted-foreground, #605e5c); font-size: 12px; }\n.xve-tablist { display: flex; gap: 2px; border-bottom: 1px solid var(--xve-border, #e1dfdd); flex-wrap: wrap; }\n.xve-tab { border: 0; background: transparent; color: inherit; font: inherit; padding: 6px 10px; cursor: pointer;\n\tborder-bottom: 2px solid transparent; }\n.xve-tab[aria-selected=\"true\"] { border-bottom-color: var(--xve-primary, #217346); font-weight: 600; }\n.xve-tabpanel { padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }\n.xve-tabpanel[hidden] { display: none; }\n.xve-listbox { border: 1px solid var(--xve-input, #c8c6c4); border-radius: var(--xve-radius, 4px);\n\tmin-height: 120px; max-height: 220px; overflow: auto; background: var(--xve-background, #fff); }\n.xve-option { padding: 3px 8px; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.xve-option[aria-selected=\"true\"] { background: var(--xve-selection, #cce8d6); color: inherit; }\n.xve-sample { min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 6px;\n\tborder: 1px solid var(--xve-border, #e1dfdd); background: var(--xve-sheet-bg, #fff); color: #000; overflow: hidden; }\n.xve-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }\n.xve-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; cursor: pointer;\n\tborder: 1px solid var(--xve-border, #e1dfdd); border-radius: var(--xve-radius, 4px); background: transparent; color: inherit; font: inherit; }\n.xve-tile[aria-pressed=\"true\"] { border-color: var(--xve-primary, #217346); background: var(--xve-selection, #e6f2ea); }\n.xve-symbols { display: grid; grid-template-columns: repeat(16, 28px); gap: 2px; max-height: 240px; overflow: auto; }\n.xve-symbols button { width: 28px; height: 28px; padding: 0; font-size: 16px; }\n.xve-preview { border: 1px solid var(--xve-border, #e1dfdd); background: #fff; min-height: 160px; display: flex;\n\talign-items: center; justify-content: center; }\n.xve-preview svg { max-width: 100%; height: auto; }\n.xve-results { max-height: 160px; overflow: auto; border: 1px solid var(--xve-border, #e1dfdd); }\n.xve-results table { border-collapse: collapse; width: 100%; font-size: 12px; }\n.xve-results th, .xve-results td { text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--xve-border, #f3f2f1); }\n.xve-results tr[aria-selected=\"true\"] td { background: var(--xve-selection, #cce8d6); }\n.xve-border-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }\n.xve-border-preview { width: 120px; height: 80px; position: relative; background: #fff; border: 1px dashed #c8c6c4; }\n@media (max-width: 600px) { .xve-field { grid-template-columns: 1fr; } .xve-symbols { grid-template-columns: repeat(8, 28px); } }\n";
|
package/dist/xlsx/events.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RibbonAddInCommandDetail } from 'ooxml-core/ribbon';
|
|
1
2
|
import type { Workbook } from 'ooxml-core/xlsx';
|
|
2
3
|
import type { XlsxCollaborationState } from './collaboration-types.js';
|
|
3
4
|
export type FileCommand = 'new' | 'open' | 'save' | 'saveAs' | 'export' | 'exportCsv' | 'print';
|
|
@@ -53,11 +54,13 @@ export interface XlsxEditorEventMap {
|
|
|
53
54
|
};
|
|
54
55
|
/** Sharing started or stopped, the connection changed, or someone joined, left or synced. */
|
|
55
56
|
'collaboration-change': XlsxCollaborationState;
|
|
57
|
+
/** A command of a host tab (`ribbonAddIns`) was chosen. */
|
|
58
|
+
'office-ribbon-add-in': RibbonAddInCommandDetail;
|
|
56
59
|
}
|
|
57
60
|
export type XlsxEditorEventName = keyof XlsxEditorEventMap;
|
|
58
61
|
export type XlsxEditorEventDetail<K extends XlsxEditorEventName> = XlsxEditorEventMap[K];
|
|
59
62
|
/** Runtime list of every event name; the `satisfies` check keeps it a subset of the map. */
|
|
60
|
-
export declare const XLSX_EDITOR_EVENTS: readonly ["workbook-change", "workbook-error", "workbook-warning", "readonly-change", "ribbon-action", "ribbon-customize", "file-command", "selection-change", "sheet-change", "dirty-change", "collaboration-change"];
|
|
63
|
+
export declare const XLSX_EDITOR_EVENTS: readonly ["workbook-change", "workbook-error", "workbook-warning", "readonly-change", "ribbon-action", "ribbon-customize", "file-command", "selection-change", "sheet-change", "dirty-change", "collaboration-change", "office-ribbon-add-in"];
|
|
61
64
|
/**
|
|
62
65
|
* Dispatches a bubbling, composed CustomEvent. Returns false when a cancelable event was canceled
|
|
63
66
|
* (the `EventTarget.dispatchEvent` contract).
|
package/dist/xlsx/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export type { EditorContext, GridController, Selection as EditorSelection, Selec
|
|
|
9
9
|
export type { DialogRegistry } from 'ooxml-core/xlsx/ui';
|
|
10
10
|
export { registerRibbonTabs, type RibbonControl, type RibbonGroup, type RibbonMenuItem, type RibbonTab, } from 'ooxml-core/xlsx/ui';
|
|
11
11
|
export { registerRibbonIcon } from './ribbon/icons.js';
|
|
12
|
+
export { RIBBON_ADD_IN_EVENT, type OfficeRibbonAddInEvent, type RibbonAddInCommand, type RibbonAddInCommandDetail, type RibbonAddInGroup, type RibbonAddInTab, } from '../ribbon/add-in-tabs.js';
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Excel's colour picker
|
|
3
|
-
* five tints
|
|
4
|
-
* input). The choice is a SpreadsheetML `Color` (`{ theme, tint }`
|
|
2
|
+
* Excel's colour picker on the shared `office-ui-color-grid`: Automatic (or No Fill), Theme Colors
|
|
3
|
+
* (ten columns, each a theme slot over five tints of the workbook theme), Standard Colors and More
|
|
4
|
+
* Colors (the browser's colour input). The choice is a SpreadsheetML `Color` (`{ theme, tint }`
|
|
5
|
+
* or `{ rgb }`), or undefined. This module is the thin adapter between that colour model and the
|
|
6
|
+
* grid's swatches.
|
|
5
7
|
*/
|
|
6
8
|
import { type Color, type ThemePalette } from 'ooxml-core/xlsx';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const STANDARD_COLORS: ReadonlyArray<readonly [string, string]>;
|
|
9
|
+
import { type OfficeColorPick, type OfficeUiColorGrid } from '../../controls.js';
|
|
10
|
+
type Translate = (key: string, vars?: Record<string, string | number>) => string;
|
|
10
11
|
export interface ColorGridOptions {
|
|
11
12
|
/** First row: 'Automatic' (font colour) or 'No Fill' (fill colour). */
|
|
12
13
|
automaticLabel?: string;
|
|
13
14
|
theme?: ThemePalette;
|
|
14
|
-
t
|
|
15
|
+
t: Translate;
|
|
15
16
|
}
|
|
16
17
|
/** The CSS colour a `Color` shows in the workbook theme (for swatches and the split bar). */
|
|
17
18
|
export declare function cssColor(color: Color | undefined, theme?: ThemePalette): string;
|
|
19
|
+
/**
|
|
20
|
+
* The shared colour grid showing a workbook theme, with every name translated. `noneLabel` is
|
|
21
|
+
* the first row's command (Automatic, No Fill, No Color): choosing it picks no colour.
|
|
22
|
+
*/
|
|
23
|
+
export declare function excelColorGrid(doc: Document, theme: ThemePalette, t: Translate, options?: {
|
|
24
|
+
noneLabel?: string;
|
|
25
|
+
moreLabel?: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
}): OfficeUiColorGrid;
|
|
28
|
+
/**
|
|
29
|
+
* The SpreadsheetML colour a pick stands for: a theme swatch keeps its slot and tint (so it
|
|
30
|
+
* follows the workbook theme), anything else is its RGB. `alpha` writes `FFRRGGBB`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pickedExcelColor(pick: OfficeColorPick, alpha?: boolean): Color | undefined;
|
|
33
|
+
/** The grid's `value` for a colour: its resolved hex, or the none command. */
|
|
34
|
+
export declare function excelGridValue(color: Color | undefined, theme: ThemePalette): string;
|
|
18
35
|
export declare function openColorGrid(anchor: HTMLElement, choose: (color: Color | undefined) => void, options: ColorGridOptions): void;
|
|
36
|
+
export {};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* tab with labelled groups and dialog launchers, KeyTips, hidden actions and overflow folding. The tab
|
|
4
4
|
* row, File button, collapse and peek belong to the shared `office-ui-ribbon`. Structure and look follow docx-viewer's ribbon.ts.
|
|
5
5
|
*/
|
|
6
|
+
import { type RibbonAddInTab } from '../../ribbon/add-in-tabs.js';
|
|
6
7
|
import type { EditorContext } from 'ooxml-core/xlsx/ui';
|
|
7
8
|
export interface RibbonHandlers {
|
|
8
9
|
openBackstage(): void;
|
|
@@ -15,6 +16,8 @@ export interface Ribbon {
|
|
|
15
16
|
/** Rebuilds all tabs (after a locale change or newly registered tabs). */
|
|
16
17
|
rebuild(): void;
|
|
17
18
|
selectTab(id: string): void;
|
|
19
|
+
/** Tabs a host adds after Excel's own (`ribbonAddIns` of the editor). */
|
|
20
|
+
setAddIns(tabs: readonly RibbonAddInTab[]): void;
|
|
18
21
|
activeTab(): string | undefined;
|
|
19
22
|
/** Alt / F10: focus the selected tab and show the tab KeyTips. */
|
|
20
23
|
showKeyTips(): void;
|