ooxml-ui 1.45.0 → 1.47.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 +1 -1
- package/dist/chart/format-pane-effects.d.ts +0 -1
- package/dist/chart/format-pane-fill-kinds.d.ts +0 -1
- package/dist/chart/format-pane-space.d.ts +0 -1
- package/dist/chart/format-pane-targets.d.ts +0 -1
- package/dist/chunk-G5CALQUW.js +278 -0
- package/dist/{chunk-LPI7LT4B.js → chunk-J3ROBM74.js} +1 -1
- package/dist/docx/backstage-options.d.ts +4 -0
- package/dist/docx/backstage-trust.d.ts +11 -0
- package/dist/docx/docx-webfonts.d.ts +75 -0
- package/dist/docx/editor-core.d.ts +3 -0
- package/dist/docx/element-api.d.ts +14 -0
- package/dist/docx/font-downloads.d.ts +8 -0
- package/dist/docx/locales/en.d.ts +6 -0
- package/dist/docx/locales/options.d.ts +6 -0
- package/dist/docx/locales/trust.d.ts +15 -0
- package/dist/docx/localization-strings.d.ts +6 -0
- package/dist/docx/print-layout-view.d.ts +2 -0
- package/dist/docx.js +229 -14
- package/dist/fonts/font-download-policy.d.ts +23 -0
- package/dist/fonts/webfonts.d.ts +118 -0
- package/dist/fonts/webfonts.d.ts.map +1 -0
- package/dist/form/color-swatches.d.ts +0 -1
- package/dist/index.js +2 -2
- package/dist/picture-artistic-filters.d.ts +0 -1
- package/dist/pptx/{chunk-CWBVJ4DC.cjs → chunk-6XIUBQPL.cjs} +403 -2398
- package/dist/pptx/{chunk-HGT3CA36.mjs → chunk-BV24XNBQ.mjs} +301 -2351
- package/dist/pptx/{chunk-MZCAYJ7H.cjs → chunk-JHI42PNB.cjs} +42 -42
- package/dist/pptx/{chunk-6JTQ7AG6.mjs → chunk-XMAQ23WE.mjs} +1 -1
- package/dist/pptx/dom/index.cjs +372 -371
- package/dist/pptx/dom/index.mjs +6 -5
- package/dist/pptx/dom/load-presentation.d.ts +8 -1
- package/dist/pptx/dom/load-presentation.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3086 -3058
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/render/deck-webfont-readiness.d.ts +24 -10
- package/dist/pptx/render/deck-webfont-readiness.d.ts.map +1 -1
- package/dist/pptx/render/font-weight-names.d.ts +2 -65
- package/dist/pptx/render/font-weight-names.d.ts.map +1 -1
- package/dist/pptx/render/google-fonts-catalogue.d.ts +2 -13
- package/dist/pptx/render/google-fonts-catalogue.d.ts.map +1 -1
- package/dist/pptx/render/google-fonts-lookup.d.ts +2 -6
- package/dist/pptx/render/google-fonts-lookup.d.ts.map +1 -1
- package/dist/pptx/render/google-webfonts-link.d.ts +2 -2
- package/dist/pptx/render/google-webfonts-link.d.ts.map +1 -1
- package/dist/pptx/render/google-webfonts-metric-clones.d.ts +2 -16
- package/dist/pptx/render/google-webfonts-metric-clones.d.ts.map +1 -1
- package/dist/pptx/render/google-webfonts.d.ts +11 -107
- package/dist/pptx/render/google-webfonts.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +3 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inline-list-dom.d.ts.map +1 -1
- package/dist/pptx/render/inline-text-paragraph-marker.d.ts +3 -0
- package/dist/pptx/render/inline-text-paragraph-marker.d.ts.map +1 -0
- package/dist/pptx/render/inline-text-seed.d.ts +25 -0
- package/dist/pptx/render/inline-text-seed.d.ts.map +1 -0
- package/dist/pptx/render/inline-trailing-space.d.ts +14 -0
- package/dist/pptx/render/inline-trailing-space.d.ts.map +1 -0
- package/dist/pptx/render/status-bar-state.d.ts +10 -0
- package/dist/pptx/render/status-bar-state.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-R7USUBIX.cjs → smartart-insert-preview-GE47FXVT.cjs} +3 -3
- package/dist/pptx/{smartart-insert-preview-ZKVFXFSI.mjs → smartart-insert-preview-WY6DHSAJ.mjs} +2 -2
- package/dist/pptx/web-components/status-bar.d.ts.map +1 -1
- package/dist/teams.js +1 -1
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/visio/controller.d.ts +12 -0
- package/dist/visio/font-stack.d.ts +11 -0
- package/dist/visio/locales/trust-center.d.ts +7 -0
- package/dist/visio/viewer-behaviour.d.ts +5 -0
- package/dist/visio/viewer-element.d.ts +16 -0
- package/dist/visio/viewer-options-categories.d.ts +6 -0
- package/dist/visio/viewer-options-trust.d.ts +10 -0
- package/dist/visio/viewer-options.d.ts +6 -0
- package/dist/visio/viewer-webfonts.d.ts +42 -0
- package/dist/visio.js +323 -21
- package/dist/xlsx/backstage/options-trust.d.ts +9 -0
- package/dist/xlsx/backstage/parts.d.ts +4 -0
- package/dist/xlsx/editor-core.d.ts +3 -0
- package/dist/xlsx/element-api.d.ts +15 -0
- package/dist/xlsx/font-downloads.d.ts +8 -0
- package/dist/xlsx/grid/drawings.d.ts +2 -0
- package/dist/xlsx/grid/measure.d.ts +2 -0
- package/dist/xlsx/page-views/page-layout-css.d.ts +1 -1
- package/dist/xlsx/print-cell.d.ts +1 -1
- package/dist/xlsx/webfonts.d.ts +70 -0
- package/dist/xlsx.js +259 -18
- package/package.json +2 -2
- package/dist/chunk-MWDG776V.js +0 -90
- /package/dist/{chunk-2YRHRV4H.js → chunk-MUY444GW.js} +0 -0
|
@@ -9,6 +9,7 @@ import { type FileChrome } from './editor-files.js';
|
|
|
9
9
|
import type { XlsxCollaborationOptions, XlsxCollaborationState } from './collaboration-types.js';
|
|
10
10
|
import { type SpreadsheetToolbarProps } from './building-blocks.js';
|
|
11
11
|
import type { SurfaceHostActions } from './surface-actions.js';
|
|
12
|
+
import type { GoogleFontsOption } from 'ooxml-core/text';
|
|
12
13
|
/** Server rendering has no HTMLElement; the class still has to be definable there. */
|
|
13
14
|
export declare const HTMLElementBase: typeof HTMLElement;
|
|
14
15
|
export declare class XlsxEditorApi extends HTMLElementBase {
|
|
@@ -30,6 +31,20 @@ export declare class XlsxEditorApi extends HTMLElementBase {
|
|
|
30
31
|
*/
|
|
31
32
|
get storage(): DocumentStorage | undefined;
|
|
32
33
|
set storage(value: DocumentStorage | null | undefined);
|
|
34
|
+
/**
|
|
35
|
+
* Webfont fallback for workbook fonts the reader has neither installed nor embedded. Unset (the
|
|
36
|
+
* default): the reader decides with File > Options > Trust Center > "Download fonts that are
|
|
37
|
+
* not installed or embedded", which is off until they turn it on. Set, it is the host's
|
|
38
|
+
* decision and that toggle is shown read-only: `false` is off (no request leaves the page;
|
|
39
|
+
* text uses installed or substitute fonts), `{ baseUrl }` requests the fonts the workbook uses
|
|
40
|
+
* that the bundled Google Fonts catalogue serves (or their metric-compatible clone, such as
|
|
41
|
+
* Carlito for Calibri) from that CSS2 endpoint (`https://fonts.googleapis.com/css2` for Google,
|
|
42
|
+
* or a self-hosted mirror) with one `<link>` in the document head, then the font files it
|
|
43
|
+
* names. Only public catalogue family names are sent, never cell text; an invalid `baseUrl`
|
|
44
|
+
* warns and stays off. Changing it applies to the open workbook.
|
|
45
|
+
*/
|
|
46
|
+
get googleFonts(): GoogleFontsOption | undefined;
|
|
47
|
+
set googleFonts(value: GoogleFontsOption | null | undefined);
|
|
33
48
|
get loading(): boolean;
|
|
34
49
|
subscribeEditorState(listener: () => void): () => void;
|
|
35
50
|
protected readonly core: EditorCore;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The localStorage key of the choice (`"true"` or `"false"`). */
|
|
2
|
+
export declare const FONT_DOWNLOADS_KEY = "ooxml.xlsx.allowFontDownloads";
|
|
3
|
+
/** The reader's choice: the stored value, else the session's, else the default (off). */
|
|
4
|
+
export declare function readerAllowsFontDownloads(): boolean;
|
|
5
|
+
/** Records the reader's choice. */
|
|
6
|
+
export declare function setReaderAllowsFontDownloads(allow: boolean): void;
|
|
7
|
+
/** Forgets the choice (tests, and a reset). */
|
|
8
|
+
export declare function clearReaderFontDownloads(): void;
|
|
@@ -4,6 +4,8 @@ export declare class DrawingLayer {
|
|
|
4
4
|
constructor(view: GridView);
|
|
5
5
|
/** Charts depend on cell values: bump after model changes so they redraw. */
|
|
6
6
|
invalidate(): void;
|
|
7
|
+
/** Redraws every drawing on the next paint (text measured again) without ending a drag. */
|
|
8
|
+
redraw(): void;
|
|
7
9
|
render(): void;
|
|
8
10
|
deselect(): void;
|
|
9
11
|
/** Moves the selected drawing by a few pixels (arrow keys); false when nothing is selected. */
|
|
@@ -9,6 +9,8 @@ export interface TextMeasurer {
|
|
|
9
9
|
ascent: number;
|
|
10
10
|
descent: number;
|
|
11
11
|
} | undefined;
|
|
12
|
+
/** Forgets every cached width and font box (after webfont faces arrived). */
|
|
13
|
+
clear(): void;
|
|
12
14
|
}
|
|
13
15
|
export declare function estimateWidth(text: string, font: string): number;
|
|
14
16
|
export declare function createTextMeasurer(doc: Document | undefined): TextMeasurer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PAGE_LAYOUT_CSS = "\n.xve-grid-host[data-view=\"pageLayout\"]>.xg-root{display:none}\n.xpl-root{position:absolute;inset:0;overflow:auto;background:var(--xve-page-surround, var(--office-surface, #e6e6e6));\n\tfont-family:var(--xve-font,var(--office-font,system-ui,sans-serif));outline:none;color:#000;-webkit-user-select:none;user-select:none}\n.xpl-root[hidden]{display:none}\n.xpl-sizer{display:grid;grid-template-columns:20px 1fr;grid-template-rows:20px 1fr;position:relative}\n.xpl-corner{position:sticky;left:0;top:0;z-index:7;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));border-right:1px solid var(--xve-border,var(--office-border,#c6c6c6));border-bottom:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-h{position:sticky;top:0;z-index:6;height:20px;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));overflow:hidden;border-bottom:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-v{position:sticky;left:0;z-index:6;width:20px;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));overflow:hidden;border-right:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-area{position:absolute;background:var(--office-background,#fff)}\n.xpl-ruler-margin{position:absolute;background:var(--office-selected,#c8c8c8)}\n.xpl-ruler-h .xpl-ruler-area,.xpl-ruler-h .xpl-ruler-margin{top:0;bottom:0}\n.xpl-ruler-v .xpl-ruler-area,.xpl-ruler-v .xpl-ruler-margin{left:0;right:0}\n.xpl-tick{position:absolute;background:var(--office-muted-foreground,#767676)}\n.xpl-ruler-h .xpl-tick{bottom:0;width:1px}\n.xpl-ruler-v .xpl-tick{right:0;height:1px}\n.xpl-ruler-num{position:absolute;font-size:var(--office-font-size-2xs,10px);line-height:1;color:var(--office-foreground,#444)}\n.xpl-ruler-v .xpl-ruler-num{left:2px}\n.xpl-canvas{position:relative;overflow:hidden}\n.xpl-scaled{position:absolute;left:0;top:0;transform-origin:0 0}\n.xpl-page{position:absolute;box-sizing:border-box;background:#fff;box-shadow:0 1px 5px rgba(0,0,0,.3)}\n.xpl-content{position:absolute;overflow:hidden}\n.xpl-inner{position:absolute;left:0;top:0;transform-origin:0 0;font-family
|
|
1
|
+
export declare const PAGE_LAYOUT_CSS = "\n.xve-grid-host[data-view=\"pageLayout\"]>.xg-root{display:none}\n.xpl-root{position:absolute;inset:0;overflow:auto;background:var(--xve-page-surround, var(--office-surface, #e6e6e6));\n\tfont-family:var(--xve-font,var(--office-font,system-ui,sans-serif));outline:none;color:#000;-webkit-user-select:none;user-select:none}\n.xpl-root[hidden]{display:none}\n.xpl-sizer{display:grid;grid-template-columns:20px 1fr;grid-template-rows:20px 1fr;position:relative}\n.xpl-corner{position:sticky;left:0;top:0;z-index:7;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));border-right:1px solid var(--xve-border,var(--office-border,#c6c6c6));border-bottom:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-h{position:sticky;top:0;z-index:6;height:20px;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));overflow:hidden;border-bottom:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-v{position:sticky;left:0;z-index:6;width:20px;background:var(--xve-header-bg, var(--office-surface, #f3f3f3));overflow:hidden;border-right:1px solid var(--xve-border,var(--office-border,#c6c6c6))}\n.xpl-ruler-area{position:absolute;background:var(--office-background,#fff)}\n.xpl-ruler-margin{position:absolute;background:var(--office-selected,#c8c8c8)}\n.xpl-ruler-h .xpl-ruler-area,.xpl-ruler-h .xpl-ruler-margin{top:0;bottom:0}\n.xpl-ruler-v .xpl-ruler-area,.xpl-ruler-v .xpl-ruler-margin{left:0;right:0}\n.xpl-tick{position:absolute;background:var(--office-muted-foreground,#767676)}\n.xpl-ruler-h .xpl-tick{bottom:0;width:1px}\n.xpl-ruler-v .xpl-tick{right:0;height:1px}\n.xpl-ruler-num{position:absolute;font-size:var(--office-font-size-2xs,10px);line-height:1;color:var(--office-foreground,#444)}\n.xpl-ruler-v .xpl-ruler-num{left:2px}\n.xpl-canvas{position:relative;overflow:hidden}\n.xpl-scaled{position:absolute;left:0;top:0;transform-origin:0 0}\n.xpl-page{position:absolute;box-sizing:border-box;background:#fff;box-shadow:0 1px 5px rgba(0,0,0,.3)}\n.xpl-content{position:absolute;overflow:hidden}\n.xpl-inner{position:absolute;left:0;top:0;transform-origin:0 0;font-family:\"Calibri\",\"Carlito\",sans-serif}\n.xpl-inner table{border-collapse:collapse;table-layout:fixed}\n.xpl-inner td{overflow:hidden;padding:0 3px;box-sizing:border-box;line-height:1.2}\n.xpl-colhdr,.xpl-rowhdr{position:absolute;box-sizing:border-box;display:flex;align-items:center;justify-content:center;\n\tfont-size:var(--office-font-size-xs,11px);color:var(--xve-header-fg, var(--office-foreground, #444));background:var(--xve-header-bg, var(--office-surface, #f3f3f3));border:1px solid var(--xve-header-line, var(--office-border, #d4d4d4));overflow:hidden}\n.xpl-blank{position:absolute;inset:0;pointer-events:none;z-index:1;display:flex;align-items:center;justify-content:center;color:#767676;font-size:14px;cursor:cell}\n.xpl-band{position:absolute;display:flex;line-height:1.2;box-sizing:border-box;cursor:text}\n.xpl-section{flex:1 1 0;min-width:0;white-space:pre-wrap;overflow:hidden;padding:0 2px;border:1px solid transparent}\n.xpl-band:hover .xpl-section{border-color:#bbb;border-style:dashed}\n.xpl-placeholder{color:#8a8a8a;text-align:center!important}\n.xpl-band.xpl-editing{background:#fff;z-index:4;box-shadow:0 0 0 1px #217346}\n.xpl-band-input{flex:1 1 0;min-width:0;box-sizing:border-box;font:inherit;font-size:13px;border:1px solid #bbb;padding:1px 3px;margin:0}\n.xpl-sel{position:absolute;left:0;top:0;pointer-events:none;z-index:3}\n.xpl-shade{position:absolute;background:var(--xve-selection, color-mix(in srgb, var(--office-accent, #217346) 12%, transparent))}\n.xpl-active{position:absolute;box-sizing:border-box;border:2px solid var(--xve-selection-border, var(--office-accent, #217346))}\n.xpl-edit{position:absolute;box-sizing:border-box;z-index:5;border:2px solid var(--xve-selection-border, var(--office-accent, #217346));\n\tbackground:#fff;font-family:\"Calibri\",\"Carlito\",sans-serif;padding:0 3px;margin:0;outline:none}\n.xpl-error{padding:24px;color:#a4262c}\n";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The webfont fallback of `<xlsx-editor>` (the `googleFonts` property): for workbook fonts the
|
|
3
|
+
* reader has neither installed nor embedded, one managed `<link>` loads the face the bundled
|
|
4
|
+
* Google Fonts catalogue serves (or its verified metric-compatible clone, which every workbook
|
|
5
|
+
* font stack lists right after the font, see `workbookFontFamily`). Who decides is the shared
|
|
6
|
+
* rule (`fonts/font-download-policy`): the host's value when it set one, otherwise the reader's
|
|
7
|
+
* Trust Center choice (`font-downloads.ts`), which is off until the reader turns it on.
|
|
8
|
+
*
|
|
9
|
+
* A file opened with `load()` waits (bounded, see `prepareWebfonts`) before it is shown, while
|
|
10
|
+
* `loading` is true; a workbook assigned directly is shown at once. Either way, once faces arrive
|
|
11
|
+
* (also later, through `document.fonts` `loadingdone` while connected) the grid measures text
|
|
12
|
+
* again and repaints, keeping the selection, the scroll and an edit in progress.
|
|
13
|
+
*
|
|
14
|
+
* @module xlsx/webfonts
|
|
15
|
+
*/
|
|
16
|
+
import type { Workbook } from 'ooxml-core/xlsx';
|
|
17
|
+
import { type GoogleFontsOption } from 'ooxml-core/text';
|
|
18
|
+
import { type WebfontReadiness } from '../fonts/webfonts.js';
|
|
19
|
+
/** Id of the first editor's managed stylesheet link; later editors add `-2`, `-3`... */
|
|
20
|
+
export declare const XLSX_WEBFONT_LINK_ID = "xlsx-editor-webfonts";
|
|
21
|
+
export interface XlsxWebfontsHost {
|
|
22
|
+
readonly host: HTMLElement;
|
|
23
|
+
/** The workbook on screen. */
|
|
24
|
+
workbook(): Workbook | undefined;
|
|
25
|
+
/** Measures text again and repaints (the grid's `remeasure`). */
|
|
26
|
+
remeasure(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class XlsxWebfonts {
|
|
29
|
+
#private;
|
|
30
|
+
/** The host's `googleFonts` value, as given. */
|
|
31
|
+
option: GoogleFontsOption | undefined;
|
|
32
|
+
/** This editor's managed `<link>` id (one per editor, so two editors never fight over it). */
|
|
33
|
+
readonly linkId: string;
|
|
34
|
+
constructor(owner: XlsxWebfontsHost);
|
|
35
|
+
/** The option the loader uses: the host's value when set, else the reader's choice. */
|
|
36
|
+
effective(): GoogleFontsOption;
|
|
37
|
+
/** The value the Trust Center toggle shows read-only, or `undefined` when the reader decides. */
|
|
38
|
+
lock(): boolean | undefined;
|
|
39
|
+
/** Whether the Trust Center toggle is on: the host's locked value, else the reader's choice. */
|
|
40
|
+
allowed(): boolean;
|
|
41
|
+
/** The reader's Trust Center choice: stored, and applied to the open workbook at once. */
|
|
42
|
+
setReaderAllows(allow: boolean): void;
|
|
43
|
+
/** The CSS2 base the option requests, or `null` when the fallback is off (the default). */
|
|
44
|
+
base(): string | null;
|
|
45
|
+
/**
|
|
46
|
+
* After the host value or the reader's choice changed: on, prepare the open workbook's faces
|
|
47
|
+
* and measure again; off, remove the stylesheets and repaint with installed or substitute fonts.
|
|
48
|
+
*/
|
|
49
|
+
apply(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Start downloading the faces the file declares before it is parsed (see `prefetchWebfonts`),
|
|
52
|
+
* so they are usually ready when {@link prepare} waits. Never throws.
|
|
53
|
+
*/
|
|
54
|
+
prefetch(bytes: Uint8Array | ArrayBuffer): void;
|
|
55
|
+
/**
|
|
56
|
+
* Injects the stylesheet for the workbook's missing fonts and waits (bounded) for their faces.
|
|
57
|
+
* Off, it removes this editor's link. Never rejects; one wait per workbook and base.
|
|
58
|
+
*/
|
|
59
|
+
prepare(workbook: Workbook): Promise<WebfontReadiness>;
|
|
60
|
+
/**
|
|
61
|
+
* A workbook is on screen (opened, assigned, or the option changed): prepare its faces when
|
|
62
|
+
* that has not happened yet, and measure again once they arrive.
|
|
63
|
+
*/
|
|
64
|
+
shown(workbook: Workbook | undefined): void;
|
|
65
|
+
/** Coalesces face arrivals into one remeasure per frame while connected. */
|
|
66
|
+
schedule(): void;
|
|
67
|
+
/** Listens for faces that arrive after the bounded wait (any font the grid draws). */
|
|
68
|
+
connect(): void;
|
|
69
|
+
disconnect(): void;
|
|
70
|
+
}
|