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
package/dist/docx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineChartExOptions, statusLayout, watchStatusWidth, compactPageText } from './chunk-II43ALTT.js';
|
|
2
|
-
import { chartExSpaceFormatSource, attachShareDialog, connectedServicesLabels } from './chunk-
|
|
2
|
+
import { effectiveFontDownloads, syncGoogleWebfontStylesheet, prepareWebfonts, prefetchWebfonts, prefetchLinkId, FONT_DOWNLOADS_DEFAULT, chartExSpaceFormatSource, attachShareDialog, fontDownloadLock, connectedServicesLabels } from './chunk-G5CALQUW.js';
|
|
3
3
|
import { syncRibbonAddIns, createHostBackstagePages, withHostMenuItems } from './chunk-ZTLP52FH.js';
|
|
4
4
|
export { RIBBON_ADD_IN_EVENT } from './chunk-ZTLP52FH.js';
|
|
5
5
|
import { defineSmartArt, smartArtColorsGalleryState, smartArtStylesGalleryState, SmartArtTextPaneController, pictureNeedsSvg, pictureSvg, defineSmartArtPicker } from './chunk-6FFZFH73.js';
|
|
@@ -24,12 +24,13 @@ import { PluginKey, TextSelection, Selection, EditorState, Plugin, NodeSelection
|
|
|
24
24
|
import { sanitizeColor, sanitizeUserName, collaborationStateOf, openCollaborationSession, onCollaborationStateChange, SequenceTracker, isValidId, classifyVersion, validateDisplayName } from 'ooxml-core/collab';
|
|
25
25
|
import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
|
|
26
26
|
import { keymap } from 'prosemirror-keymap';
|
|
27
|
-
import { createLayoutSession, layoutDocumentModel, pageNumbers, createFakeMeasurer, ligatureCss, cssFontStack, tokenizeRun, reviewSourceLength, placeTab, cellVerticalOffset, fieldDisplayText, DEFAULT_FONT_SIZE_PT, pageNumberValues, sectionPageCounts, pageStyleRefs, headerFooterSlotForPage, headerFooterForPage, paragraphFloats, floatPosition } from 'ooxml-core/docx/layout';
|
|
27
|
+
import { createLayoutSession, layoutDocumentModel, pageNumbers, collectDocxWebfontRuns, createFakeMeasurer, ligatureCss, cssFontStack, tokenizeRun, reviewSourceLength, placeTab, cellVerticalOffset, fieldDisplayText, DEFAULT_FONT_SIZE_PT, pageNumberValues, sectionPageCounts, pageStyleRefs, headerFooterSlotForPage, headerFooterForPage, paragraphFloats, floatPosition } from 'ooxml-core/docx/layout';
|
|
28
28
|
import { chainCommands, baseKeymap, selectAll, splitBlock } from 'prosemirror-commands';
|
|
29
29
|
import { imageContentType } from 'ooxml-core/drawingml';
|
|
30
30
|
import { applyChartExEditIntent, applyChartEditIntent, applyChartExEditAction, setChartType, setChartLegend, setChartExLegend } from 'ooxml-core/chart';
|
|
31
31
|
import { sendableSteps, getVersion } from 'prosemirror-collab';
|
|
32
32
|
import { isCapabilityEnabled, capabilityHiddenActions, mergeHiddenActions, saveToStorage, documentSaveMeta, fileCommandDetail, withoutHiddenEntries } from 'ooxml-core/embedding';
|
|
33
|
+
import { resolveGoogleFontsCss2Base } from 'ooxml-core/text';
|
|
33
34
|
|
|
34
35
|
// src/docx/locales/split-cells.ts
|
|
35
36
|
var enSplitCells = {
|
|
@@ -65,8 +66,53 @@ var zhSplitCells = fromValues([
|
|
|
65
66
|
"\u884C\u6570",
|
|
66
67
|
"\u5C06\u5355\u5143\u683C\u62C6\u5206\u4E3A\u6B64\u6570\u91CF\u7684\u5217\u548C\u884C\u3002"
|
|
67
68
|
]);
|
|
69
|
+
|
|
70
|
+
// src/docx/locales/trust.ts
|
|
71
|
+
var enTrust = {
|
|
72
|
+
"Help keep your documents safe and secure.": "Help keep your documents safe and secure.",
|
|
73
|
+
"Security settings": "Security settings",
|
|
74
|
+
"These settings help keep the content you open safe. We recommend the defaults.": "These settings help keep the content you open safe. We recommend the defaults.",
|
|
75
|
+
"Download fonts that are not installed or embedded (Google Fonts)": "Download fonts that are not installed or embedded (Google Fonts)",
|
|
76
|
+
"When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.": "When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.",
|
|
77
|
+
"This setting is managed by your organization": "This setting is managed by your organization"
|
|
78
|
+
};
|
|
79
|
+
var frTrust = {
|
|
80
|
+
"Help keep your documents safe and secure.": "Assurez la s\xE9curit\xE9 et la protection de vos documents.",
|
|
81
|
+
"Security settings": "Param\xE8tres de s\xE9curit\xE9",
|
|
82
|
+
"These settings help keep the content you open safe. We recommend the defaults.": "Ces param\xE8tres contribuent \xE0 la s\xE9curit\xE9 du contenu que vous ouvrez. Nous recommandons les valeurs par d\xE9faut.",
|
|
83
|
+
"Download fonts that are not installed or embedded (Google Fonts)": "T\xE9l\xE9charger les polices non install\xE9es ni incorpor\xE9es (Google Fonts)",
|
|
84
|
+
"When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.": "Lorsque cette option est activ\xE9e, votre navigateur contacte fonts.googleapis.com et fonts.gstatic.com (ou le serveur de polices de votre organisation) pour obtenir les polices manquantes. Lorsqu'elle est d\xE9sactiv\xE9e, le texte utilise des polices install\xE9es, incorpor\xE9es ou de substitution, et les sauts de ligne peuvent donc diff\xE9rer de Word.",
|
|
85
|
+
"This setting is managed by your organization": "Ce param\xE8tre est g\xE9r\xE9 par votre organisation"
|
|
86
|
+
};
|
|
87
|
+
var deTrust = {
|
|
88
|
+
"Help keep your documents safe and secure.": "Sorgen Sie f\xFCr die Sicherheit Ihrer Dokumente.",
|
|
89
|
+
"Security settings": "Sicherheitseinstellungen",
|
|
90
|
+
"These settings help keep the content you open safe. We recommend the defaults.": "Diese Einstellungen tragen dazu bei, ge\xF6ffnete Inhalte sicher zu halten. Wir empfehlen die Standardwerte.",
|
|
91
|
+
"Download fonts that are not installed or embedded (Google Fonts)": "Nicht installierte oder eingebettete Schriftarten herunterladen (Google Fonts)",
|
|
92
|
+
"When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.": "Wenn aktiviert, ruft Ihr Browser fehlende Schriftarten von fonts.googleapis.com und fonts.gstatic.com (oder vom Schriftartserver Ihrer Organisation) ab. Wenn deaktiviert, verwendet Text installierte, eingebettete oder Ersatzschriftarten, sodass Zeilenumbr\xFCche von Word abweichen k\xF6nnen.",
|
|
93
|
+
"This setting is managed by your organization": "Diese Einstellung wird von Ihrer Organisation verwaltet"
|
|
94
|
+
};
|
|
95
|
+
var esTrust = {
|
|
96
|
+
"Help keep your documents safe and secure.": "Ayude a mantener sus documentos seguros y protegidos.",
|
|
97
|
+
"Security settings": "Configuraci\xF3n de seguridad",
|
|
98
|
+
"These settings help keep the content you open safe. We recommend the defaults.": "Esta configuraci\xF3n ayuda a mantener seguro el contenido que abre. Recomendamos los valores predeterminados.",
|
|
99
|
+
"Download fonts that are not installed or embedded (Google Fonts)": "Descargar fuentes que no est\xE1n instaladas ni incrustadas (Google Fonts)",
|
|
100
|
+
"When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.": "Cuando est\xE1 activado, el navegador se conecta a fonts.googleapis.com y fonts.gstatic.com (o al servidor de fuentes de su organizaci\xF3n) para obtener las fuentes que faltan. Cuando est\xE1 desactivado, el texto usa fuentes instaladas, incrustadas o sustitutas, por lo que los saltos de l\xEDnea pueden diferir de Word.",
|
|
101
|
+
"This setting is managed by your organization": "Esta configuraci\xF3n la administra su organizaci\xF3n"
|
|
102
|
+
};
|
|
103
|
+
var zhTrust = {
|
|
104
|
+
"Help keep your documents safe and secure.": "\u5E2E\u52A9\u786E\u4FDD\u60A8\u7684\u6587\u6863\u5B89\u5168\u53EF\u9760\u3002",
|
|
105
|
+
"Security settings": "\u5B89\u5168\u8BBE\u7F6E",
|
|
106
|
+
"These settings help keep the content you open safe. We recommend the defaults.": "\u8FD9\u4E9B\u8BBE\u7F6E\u6709\u52A9\u4E8E\u786E\u4FDD\u60A8\u6253\u5F00\u7684\u5185\u5BB9\u5B89\u5168\u3002\u6211\u4EEC\u5EFA\u8BAE\u4F7F\u7528\u9ED8\u8BA4\u503C\u3002",
|
|
107
|
+
"Download fonts that are not installed or embedded (Google Fonts)": "\u4E0B\u8F7D\u672A\u5B89\u88C5\u6216\u672A\u5D4C\u5165\u7684\u5B57\u4F53\uFF08Google Fonts\uFF09",
|
|
108
|
+
"When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.": "\u5F00\u542F\u65F6\uFF0C\u6D4F\u89C8\u5668\u4F1A\u8FDE\u63A5 fonts.googleapis.com \u548C fonts.gstatic.com\uFF08\u6216\u8D35\u7EC4\u7EC7\u8BBE\u7F6E\u7684\u5B57\u4F53\u670D\u52A1\u5668\uFF09\u4EE5\u83B7\u53D6\u7F3A\u5C11\u7684\u5B57\u4F53\u3002\u5173\u95ED\u65F6\uFF0C\u6587\u672C\u4F7F\u7528\u5DF2\u5B89\u88C5\u3001\u5DF2\u5D4C\u5165\u6216\u66FF\u4EE3\u5B57\u4F53\uFF0C\u56E0\u6B64\u6362\u884C\u53EF\u80FD\u4E0E Word \u4E0D\u540C\u3002",
|
|
109
|
+
"This setting is managed by your organization": "\u6B64\u8BBE\u7F6E\u7531\u4F60\u7684\u7EC4\u7EC7\u7BA1\u7406"
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// src/docx/locales/options.ts
|
|
68
113
|
var enOptions = {
|
|
69
114
|
...optionStrings.en,
|
|
115
|
+
...enTrust,
|
|
70
116
|
"Change how document content is displayed on the screen.": "Change how document content is displayed on the screen.",
|
|
71
117
|
"Page display options": "Page display options",
|
|
72
118
|
"Formatting marks": "Formatting marks",
|
|
@@ -74,6 +120,7 @@ var enOptions = {
|
|
|
74
120
|
};
|
|
75
121
|
var frOptions = {
|
|
76
122
|
...optionStrings.fr,
|
|
123
|
+
...frTrust,
|
|
77
124
|
"Change how document content is displayed on the screen.": "Modifiez l\u2019affichage du contenu du document \xE0 l\u2019\xE9cran.",
|
|
78
125
|
"Page display options": "Options d\u2019affichage des pages",
|
|
79
126
|
"Formatting marks": "Marques de mise en forme",
|
|
@@ -81,6 +128,7 @@ var frOptions = {
|
|
|
81
128
|
};
|
|
82
129
|
var deOptions = {
|
|
83
130
|
...optionStrings.de,
|
|
131
|
+
...deTrust,
|
|
84
132
|
"Change how document content is displayed on the screen.": "\xC4ndern Sie, wie der Dokumentinhalt auf dem Bildschirm angezeigt wird.",
|
|
85
133
|
"Page display options": "Seitenanzeigeoptionen",
|
|
86
134
|
"Formatting marks": "Formatierungszeichen",
|
|
@@ -88,6 +136,7 @@ var deOptions = {
|
|
|
88
136
|
};
|
|
89
137
|
var esOptions = {
|
|
90
138
|
...optionStrings.es,
|
|
139
|
+
...esTrust,
|
|
91
140
|
"Change how document content is displayed on the screen.": "Cambie la forma en que se muestra el contenido del documento en pantalla.",
|
|
92
141
|
"Page display options": "Opciones de presentaci\xF3n de p\xE1gina",
|
|
93
142
|
"Formatting marks": "Marcas de formato",
|
|
@@ -95,6 +144,7 @@ var esOptions = {
|
|
|
95
144
|
};
|
|
96
145
|
var zhOptions = {
|
|
97
146
|
...optionStrings["zh-CN"],
|
|
147
|
+
...zhTrust,
|
|
98
148
|
"Change how document content is displayed on the screen.": "\u66F4\u6539\u6587\u6863\u5185\u5BB9\u5728\u5C4F\u5E55\u4E0A\u7684\u663E\u793A\u65B9\u5F0F\u3002",
|
|
99
149
|
"Page display options": "\u9875\u9762\u663E\u793A\u9009\u9879",
|
|
100
150
|
"Formatting marks": "\u683C\u5F0F\u6807\u8BB0",
|
|
@@ -10500,7 +10550,6 @@ function themeFontOf(formatting, theme) {
|
|
|
10500
10550
|
const role = formatting.fontTheme?.ascii ?? formatting.fontTheme?.hAnsi;
|
|
10501
10551
|
return role && theme ? theme.fonts[role]?.latin : void 0;
|
|
10502
10552
|
}
|
|
10503
|
-
var quoteFont = (family) => `"${family.replace(/["\\]/g, "")}"`;
|
|
10504
10553
|
var safeColor = (value) => value && /^#[0-9a-f]{6}$/i.test(value) ? value : void 0;
|
|
10505
10554
|
function runFormattingCss(formatting, theme, direct = {}) {
|
|
10506
10555
|
const css = [];
|
|
@@ -10525,7 +10574,7 @@ function runFormattingCss(formatting, theme, direct = {}) {
|
|
|
10525
10574
|
`vertical-align:${formatting.verticalAlign === "baseline" ? "baseline" : formatting.verticalAlign === "superscript" ? "super" : "sub"}`
|
|
10526
10575
|
);
|
|
10527
10576
|
const family = formatting.fontFamily ?? themeFontOf(formatting, theme);
|
|
10528
|
-
if (family) css.push(`font-family:${
|
|
10577
|
+
if (family) css.push(`font-family:${cssFontStack(family)}`);
|
|
10529
10578
|
const color = safeColor(formatting.color) ?? (formatting.colorTheme && theme ? safeColor(resolveThemeColorReference(formatting.colorTheme, theme)) : void 0);
|
|
10530
10579
|
if (color) css.push(`color:${color}`);
|
|
10531
10580
|
if (formatting.characterSpacingTwips !== void 0)
|
|
@@ -16633,7 +16682,7 @@ function runElement(run, values2) {
|
|
|
16633
16682
|
if (run.italic) span.style.fontStyle = "italic";
|
|
16634
16683
|
if (run.underline) span.style.textDecoration = "underline";
|
|
16635
16684
|
if (run.fontSize) span.style.fontSize = `${run.fontSize}pt`;
|
|
16636
|
-
if (run.fontFamily) span.style.fontFamily =
|
|
16685
|
+
if (run.fontFamily) span.style.fontFamily = cssFontStack(run.fontFamily);
|
|
16637
16686
|
if (run.color && /^#[0-9a-f]{6}$/i.test(run.color)) span.style.color = run.color;
|
|
16638
16687
|
return span;
|
|
16639
16688
|
}
|
|
@@ -16730,7 +16779,7 @@ function watermarkElement(content, page2, reviewDisplayMode = "all") {
|
|
|
16730
16779
|
opacity: spec.semitransparent ? "0.5" : "1",
|
|
16731
16780
|
transform: spec.layout === "diagonal" ? "rotate(-45deg)" : "none",
|
|
16732
16781
|
zIndex: "0",
|
|
16733
|
-
...spec.fontFamily ? { fontFamily:
|
|
16782
|
+
...spec.fontFamily ? { fontFamily: cssFontStack(spec.fontFamily) } : {}
|
|
16734
16783
|
});
|
|
16735
16784
|
return layer;
|
|
16736
16785
|
}
|
|
@@ -22145,6 +22194,111 @@ function applyViewOptions(core) {
|
|
|
22145
22194
|
);
|
|
22146
22195
|
}
|
|
22147
22196
|
|
|
22197
|
+
// src/docx/font-downloads.ts
|
|
22198
|
+
var FONT_DOWNLOADS_KEY = "ooxml.docx.allowFontDownloads";
|
|
22199
|
+
var memory;
|
|
22200
|
+
function readerAllowsFontDownloads() {
|
|
22201
|
+
try {
|
|
22202
|
+
const raw = globalThis.localStorage?.getItem(FONT_DOWNLOADS_KEY);
|
|
22203
|
+
if (raw === "true") return true;
|
|
22204
|
+
if (raw === "false") return false;
|
|
22205
|
+
} catch {
|
|
22206
|
+
}
|
|
22207
|
+
return memory ?? FONT_DOWNLOADS_DEFAULT;
|
|
22208
|
+
}
|
|
22209
|
+
function setReaderAllowsFontDownloads(allow) {
|
|
22210
|
+
memory = allow;
|
|
22211
|
+
try {
|
|
22212
|
+
globalThis.localStorage?.setItem(FONT_DOWNLOADS_KEY, String(allow));
|
|
22213
|
+
} catch {
|
|
22214
|
+
}
|
|
22215
|
+
}
|
|
22216
|
+
|
|
22217
|
+
// src/docx/docx-webfonts.ts
|
|
22218
|
+
var DOCX_WEBFONT_LINK_PREFIX = "docx-editor-webfonts";
|
|
22219
|
+
var OFF = { href: null, families: [], unavailable: [], timedOut: false };
|
|
22220
|
+
function docxGoogleFontsBase(option) {
|
|
22221
|
+
return resolveGoogleFontsCss2Base(option, null, "docx-editor");
|
|
22222
|
+
}
|
|
22223
|
+
function runsOf(model) {
|
|
22224
|
+
try {
|
|
22225
|
+
return collectDocxWebfontRuns(model);
|
|
22226
|
+
} catch {
|
|
22227
|
+
return [];
|
|
22228
|
+
}
|
|
22229
|
+
}
|
|
22230
|
+
var instances = 0;
|
|
22231
|
+
var DocxWebfonts = class {
|
|
22232
|
+
/** The host's `googleFonts` value; unset leaves the choice to the reader. */
|
|
22233
|
+
option;
|
|
22234
|
+
linkId = `${DOCX_WEBFONT_LINK_PREFIX}-${++instances}`;
|
|
22235
|
+
/** The CSS2 base the loader uses: the host's value, else the reader's Trust Center choice. */
|
|
22236
|
+
base() {
|
|
22237
|
+
return docxGoogleFontsBase(effectiveFontDownloads(this.option, readerAllowsFontDownloads()));
|
|
22238
|
+
}
|
|
22239
|
+
/**
|
|
22240
|
+
* Point this editor's `<link>` at the faces `model` needs and wait (bounded) for them; with
|
|
22241
|
+
* the option off the `<link>` is removed and nothing is requested. Never rejects.
|
|
22242
|
+
*/
|
|
22243
|
+
async prepare(doc, model, wait = {}) {
|
|
22244
|
+
if (!doc?.head) return OFF;
|
|
22245
|
+
const base = this.base();
|
|
22246
|
+
if (base === null) {
|
|
22247
|
+
syncGoogleWebfontStylesheet(doc, this.linkId, null);
|
|
22248
|
+
return OFF;
|
|
22249
|
+
}
|
|
22250
|
+
try {
|
|
22251
|
+
return await prepareWebfonts({
|
|
22252
|
+
document: doc,
|
|
22253
|
+
linkId: this.linkId,
|
|
22254
|
+
runs: runsOf(model),
|
|
22255
|
+
embedded: [],
|
|
22256
|
+
base,
|
|
22257
|
+
...wait
|
|
22258
|
+
});
|
|
22259
|
+
} catch {
|
|
22260
|
+
return OFF;
|
|
22261
|
+
}
|
|
22262
|
+
}
|
|
22263
|
+
/**
|
|
22264
|
+
* Start downloading the faces `bytes` declares before it is parsed (see `prefetchWebfonts`),
|
|
22265
|
+
* so they are usually ready when {@link prepare} waits. Never throws.
|
|
22266
|
+
*/
|
|
22267
|
+
prefetch(doc, bytes) {
|
|
22268
|
+
if (!doc?.head) return;
|
|
22269
|
+
prefetchWebfonts({
|
|
22270
|
+
document: doc,
|
|
22271
|
+
linkId: this.linkId,
|
|
22272
|
+
bytes,
|
|
22273
|
+
base: this.base()
|
|
22274
|
+
});
|
|
22275
|
+
}
|
|
22276
|
+
/** Whether this editor's `<link>` (or its early `-prefetch` one) is in `doc`. */
|
|
22277
|
+
linked(doc) {
|
|
22278
|
+
return Boolean(
|
|
22279
|
+
doc?.getElementById(this.linkId) ?? doc?.getElementById(prefetchLinkId(this.linkId))
|
|
22280
|
+
);
|
|
22281
|
+
}
|
|
22282
|
+
};
|
|
22283
|
+
async function refreshDocxWebfonts(host) {
|
|
22284
|
+
const doc = host.element.ownerDocument;
|
|
22285
|
+
const had = host.webfonts.linked(doc);
|
|
22286
|
+
await host.webfonts.prepare(doc, host.model);
|
|
22287
|
+
if (had && !host.webfonts.linked(doc)) host.shell.printLayout?.remeasure();
|
|
22288
|
+
}
|
|
22289
|
+
function fontDownloadOptions(webfonts) {
|
|
22290
|
+
const locked = fontDownloadLock(webfonts.option);
|
|
22291
|
+
return {
|
|
22292
|
+
allowFontDownloads: locked ?? readerAllowsFontDownloads(),
|
|
22293
|
+
fontDownloadsLocked: locked !== void 0
|
|
22294
|
+
};
|
|
22295
|
+
}
|
|
22296
|
+
function setFontDownloads(host, allow) {
|
|
22297
|
+
if (fontDownloadLock(host.webfonts.option) !== void 0) return;
|
|
22298
|
+
setReaderAllowsFontDownloads(allow);
|
|
22299
|
+
void refreshDocxWebfonts(host);
|
|
22300
|
+
}
|
|
22301
|
+
|
|
22148
22302
|
// src/docx/editor-core.ts
|
|
22149
22303
|
var EditorCore = class {
|
|
22150
22304
|
constructor(element) {
|
|
@@ -22353,6 +22507,8 @@ var EditorCore = class {
|
|
|
22353
22507
|
parts;
|
|
22354
22508
|
pages;
|
|
22355
22509
|
viewOptions = new ViewOptions();
|
|
22510
|
+
/** The `googleFonts` option and this editor's webfont `<link>`. */
|
|
22511
|
+
webfonts = new DocxWebfonts();
|
|
22356
22512
|
dirtyState;
|
|
22357
22513
|
pageTracker;
|
|
22358
22514
|
wordText = "";
|
|
@@ -24018,6 +24174,7 @@ function createPrintLayoutController(scrollContainer, onRequestCursor, pictureUr
|
|
|
24018
24174
|
pendingModel = null;
|
|
24019
24175
|
}
|
|
24020
24176
|
},
|
|
24177
|
+
remeasure: onFontsLoaded,
|
|
24021
24178
|
relayoutNow(model) {
|
|
24022
24179
|
if (timer) clearTimeout(timer);
|
|
24023
24180
|
timer = void 0;
|
|
@@ -26142,6 +26299,36 @@ function renderCustomizeRibbon(host, handlers, t) {
|
|
|
26142
26299
|
host.replaceChildren(note, reset, ...sections);
|
|
26143
26300
|
}
|
|
26144
26301
|
|
|
26302
|
+
// src/docx/backstage-trust.ts
|
|
26303
|
+
var FONT_DOWNLOADS_OPTION = "allowFontDownloads";
|
|
26304
|
+
var FONT_DOWNLOADS_INFO = "When on, your browser contacts fonts.googleapis.com and fonts.gstatic.com (or the font server your organisation set up) to get missing fonts. When off, text uses installed, embedded or substitute fonts, so line breaks can differ from Word.";
|
|
26305
|
+
function trustCategory(context2, locked) {
|
|
26306
|
+
const { t } = context2;
|
|
26307
|
+
return {
|
|
26308
|
+
id: "trust",
|
|
26309
|
+
label: t("Trust Center"),
|
|
26310
|
+
description: t("Help keep your documents safe and secure."),
|
|
26311
|
+
sections: [
|
|
26312
|
+
{
|
|
26313
|
+
id: "trustSettings",
|
|
26314
|
+
title: t("Security settings"),
|
|
26315
|
+
description: t(
|
|
26316
|
+
"These settings help keep the content you open safe. We recommend the defaults."
|
|
26317
|
+
),
|
|
26318
|
+
controls: [
|
|
26319
|
+
{
|
|
26320
|
+
kind: "toggle",
|
|
26321
|
+
key: FONT_DOWNLOADS_OPTION,
|
|
26322
|
+
label: t("Download fonts that are not installed or embedded (Google Fonts)"),
|
|
26323
|
+
info: t(FONT_DOWNLOADS_INFO),
|
|
26324
|
+
...locked === void 0 ? {} : { disabled: t("This setting is managed by your organization") }
|
|
26325
|
+
}
|
|
26326
|
+
]
|
|
26327
|
+
}
|
|
26328
|
+
]
|
|
26329
|
+
};
|
|
26330
|
+
}
|
|
26331
|
+
|
|
26145
26332
|
// src/docx/backstage-options.ts
|
|
26146
26333
|
var LANGUAGES = [
|
|
26147
26334
|
["en", "English"],
|
|
@@ -26154,7 +26341,8 @@ var BOOLEAN_KEYS = [
|
|
|
26154
26341
|
"spellCheck",
|
|
26155
26342
|
"showRuler",
|
|
26156
26343
|
"showMarks",
|
|
26157
|
-
"showThumbnails"
|
|
26344
|
+
"showThumbnails",
|
|
26345
|
+
"allowFontDownloads"
|
|
26158
26346
|
];
|
|
26159
26347
|
var KEYS = ["locale", "theme", "author", ...BOOLEAN_KEYS];
|
|
26160
26348
|
function wordCategories(context2, current2) {
|
|
@@ -26244,7 +26432,10 @@ function wordCategories(context2, current2) {
|
|
|
26244
26432
|
},
|
|
26245
26433
|
unavailableCategory(context2, "qat"),
|
|
26246
26434
|
unavailableCategory(context2, "addins"),
|
|
26247
|
-
unavailableCategory(context2, "trust")
|
|
26435
|
+
current2.allowFontDownloads === void 0 ? unavailableCategory(context2, "trust") : trustCategory(
|
|
26436
|
+
context2,
|
|
26437
|
+
current2.fontDownloadsLocked ? current2.allowFontDownloads : void 0
|
|
26438
|
+
)
|
|
26248
26439
|
];
|
|
26249
26440
|
}
|
|
26250
26441
|
function dialogValues(current2) {
|
|
@@ -26278,10 +26469,9 @@ function createWordOptions(handlers, t) {
|
|
|
26278
26469
|
element.defaults = {
|
|
26279
26470
|
theme: "auto",
|
|
26280
26471
|
...Object.fromEntries(
|
|
26281
|
-
BOOLEAN_KEYS.filter(
|
|
26282
|
-
key3
|
|
26283
|
-
|
|
26284
|
-
])
|
|
26472
|
+
BOOLEAN_KEYS.filter(
|
|
26473
|
+
(key3) => current2[key3] !== void 0 && !(key3 === "allowFontDownloads" && current2.fontDownloadsLocked)
|
|
26474
|
+
).map((key3) => [key3, key3 === "spellCheck"])
|
|
26285
26475
|
)
|
|
26286
26476
|
};
|
|
26287
26477
|
};
|
|
@@ -28738,10 +28928,12 @@ function createChrome(core, api) {
|
|
|
28738
28928
|
spellCheck: core.view?.dom.spellcheck !== false,
|
|
28739
28929
|
showRuler: Boolean(shell.canvas?.querySelector(".dve-ruler")),
|
|
28740
28930
|
showMarks: shell.paper?.hasAttribute("data-show-marks") ?? false,
|
|
28741
|
-
showThumbnails: core.viewOptions.showThumbnails
|
|
28931
|
+
showThumbnails: core.viewOptions.showThumbnails,
|
|
28932
|
+
...fontDownloadOptions(core.webfonts)
|
|
28742
28933
|
}),
|
|
28743
28934
|
setOption: (key3, value) => {
|
|
28744
|
-
if (key3 === "
|
|
28935
|
+
if (key3 === "allowFontDownloads") setFontDownloads(core, value === "true");
|
|
28936
|
+
else if (key3 === "spellCheck") {
|
|
28745
28937
|
if (core.view) core.view.dom.spellcheck = value === "true";
|
|
28746
28938
|
core.refreshControls();
|
|
28747
28939
|
} else if (key3 === "showThumbnails")
|
|
@@ -29263,6 +29455,24 @@ var DocxEditorApi = class extends HTMLElementBase {
|
|
|
29263
29455
|
this.core.fileProviders = [...next];
|
|
29264
29456
|
this.core.shell.chrome?.backstage.relocalize();
|
|
29265
29457
|
}
|
|
29458
|
+
/**
|
|
29459
|
+
* Webfonts for the document fonts the reader has neither installed nor embedded. Unset (the
|
|
29460
|
+
* default): the reader decides in File > Options > Trust Center (off until turned on; when on,
|
|
29461
|
+
* Google Fonts). `false`: off, nothing is requested. A set value locks that toggle, which then
|
|
29462
|
+
* shows it read-only. `{ baseUrl }`: such a family that the Google
|
|
29463
|
+
* Fonts catalogue serves, or its metric-compatible clone (Calibri as Carlito), is requested from
|
|
29464
|
+
* that CSS2 endpoint (`https://fonts.googleapis.com/css2`, or a self-hosted mirror) with only
|
|
29465
|
+
* the family names, and `load` waits briefly (150 ms) for the faces before showing the document. An
|
|
29466
|
+
* invalid `baseUrl` warns and stays off. Read when a document loads; changing it re-requests
|
|
29467
|
+
* for the document on screen.
|
|
29468
|
+
*/
|
|
29469
|
+
get googleFonts() {
|
|
29470
|
+
return this.core.webfonts.option;
|
|
29471
|
+
}
|
|
29472
|
+
set googleFonts(value) {
|
|
29473
|
+
this.core.webfonts.option = value;
|
|
29474
|
+
if (this.core.view) void refreshDocxWebfonts(this.core);
|
|
29475
|
+
}
|
|
29266
29476
|
get loading() {
|
|
29267
29477
|
return this.core.loading;
|
|
29268
29478
|
}
|
|
@@ -29523,6 +29733,7 @@ var DocxEditorElement = class extends DocxEditorApi {
|
|
|
29523
29733
|
this.replaceDocument(value || createDocument());
|
|
29524
29734
|
this.core.shell.chrome?.setSaveState("saved");
|
|
29525
29735
|
if (this.isConnected) renderDocument(this.core);
|
|
29736
|
+
void refreshDocxWebfonts(this.core);
|
|
29526
29737
|
this.core.room.resume();
|
|
29527
29738
|
}
|
|
29528
29739
|
get readOnly() {
|
|
@@ -29580,8 +29791,11 @@ var DocxEditorElement = class extends DocxEditorApi {
|
|
|
29580
29791
|
core.loading = true;
|
|
29581
29792
|
core.refreshControls();
|
|
29582
29793
|
try {
|
|
29794
|
+
core.webfonts.prefetch(this.ownerDocument, input);
|
|
29583
29795
|
const session = await loadDocument(input);
|
|
29584
29796
|
if (generation !== core.loadGeneration) return;
|
|
29797
|
+
await core.webfonts.prepare(this.ownerDocument, session.model);
|
|
29798
|
+
if (generation !== core.loadGeneration) return;
|
|
29585
29799
|
core.imageMedia.release();
|
|
29586
29800
|
this.replaceDocument(session.model, session, false);
|
|
29587
29801
|
core.shell.chrome?.setSaveState("saved");
|
|
@@ -29602,6 +29816,7 @@ var DocxEditorElement = class extends DocxEditorApi {
|
|
|
29602
29816
|
this.assertDocumentReplaceable();
|
|
29603
29817
|
this.replaceDocument(session.model, session);
|
|
29604
29818
|
if (this.isConnected) renderDocument(this.core);
|
|
29819
|
+
void refreshDocxWebfonts(this.core);
|
|
29605
29820
|
this.core.room.resume();
|
|
29606
29821
|
}
|
|
29607
29822
|
/** Join only after loading the authority's matching document snapshot and version. */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who decides whether missing fonts are downloaded: the host's `googleFonts` value when it set
|
|
3
|
+
* one, otherwise the reader's Trust Center choice ("Download fonts that are not installed or
|
|
4
|
+
* embedded"). Shared by Word, Excel and Visio, whose Trust Center toggle is off until the reader
|
|
5
|
+
* turns it on (they made no network request before it existed); PowerPoint keeps its own policy
|
|
6
|
+
* (`pptx/render/options/font-download-policy.ts`), whose toggle starts on.
|
|
7
|
+
*
|
|
8
|
+
* @module fonts/font-download-policy
|
|
9
|
+
*/
|
|
10
|
+
import { type GoogleFontsOption } from 'ooxml-core/text';
|
|
11
|
+
/** The Trust Center toggle's default for Word, Excel and Visio. */
|
|
12
|
+
export declare const FONT_DOWNLOADS_DEFAULT = false;
|
|
13
|
+
/**
|
|
14
|
+
* The option the product's webfont loader uses: the host's value when set, else Google Fonts when
|
|
15
|
+
* the reader allowed downloads and `false` when not.
|
|
16
|
+
*/
|
|
17
|
+
export declare function effectiveFontDownloads(host: GoogleFontsOption | undefined, readerAllows: boolean): GoogleFontsOption;
|
|
18
|
+
/**
|
|
19
|
+
* How the host's value locks the Trust Center toggle: `undefined` when the host left it to the
|
|
20
|
+
* reader, otherwise the value the toggle shows read-only (on for a usable server, off for `false`
|
|
21
|
+
* or an invalid `baseUrl`, which fails closed).
|
|
22
|
+
*/
|
|
23
|
+
export declare function fontDownloadLock(host: GoogleFontsOption | undefined): boolean | undefined;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type WebfontFace, type WebfontRun } from 'ooxml-core/text';
|
|
2
|
+
/**
|
|
3
|
+
* How long a loaded document may wait for its webfonts before it is shown with stand-in faces:
|
|
4
|
+
* about the browser's own block period for `font-display: swap`. Cached faces arrive well inside
|
|
5
|
+
* it; a first download on a slow network does not hold the document back, and a face that arrives
|
|
6
|
+
* later is laid out again in place (each product listens for `document.fonts` `loadingdone`).
|
|
7
|
+
* Waiting longer to avoid one reflow keeps the reader looking at a loading screen.
|
|
8
|
+
*/
|
|
9
|
+
export declare const WEBFONT_TIMEOUT_MS = 150;
|
|
10
|
+
/** How long the wait lasts before progress is reported. */
|
|
11
|
+
export declare const WEBFONT_PROGRESS_DELAY_MS = 400;
|
|
12
|
+
/**
|
|
13
|
+
* Best-effort "is this family available without any network fetch?". `document.fonts.check`
|
|
14
|
+
* cannot answer it (Chromium reports any unmatched quoted family as loaded), so a test string is
|
|
15
|
+
* measured on a canvas with `<family>, <fallback>` and with `<fallback>` alone: an installed family
|
|
16
|
+
* differs for at least one fallback class. A false negative only loads a face that was not needed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isFontFamilyInstalledLocally(family: string): boolean;
|
|
19
|
+
/** The id of the early stylesheet {@link prefetchWebfonts} adds beside a product's link. */
|
|
20
|
+
export declare const prefetchLinkId: (linkId: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Point the managed `<link id>` at `href`, untouched when it already does; `null` removes it, and
|
|
23
|
+
* with it the early stylesheet {@link prefetchWebfonts} added for the same product, so turning
|
|
24
|
+
* downloads off leaves nothing behind.
|
|
25
|
+
*/
|
|
26
|
+
export declare function syncGoogleWebfontStylesheet(doc: Document, id: string, href: string | null): HTMLLinkElement | null;
|
|
27
|
+
/** Reset the session cache (test isolation). */
|
|
28
|
+
export declare function resetWebfontSessionCache(): void;
|
|
29
|
+
/** The families to look up: neither embedded nor installed (and not already resolved). */
|
|
30
|
+
export declare function selectWebfontCandidates(families: Iterable<string>, embedded?: Iterable<string>, isLocallyInstalled?: (family: string) => boolean): string[];
|
|
31
|
+
/** The CSS2 fragments for the candidates, recording each match in the session cache. */
|
|
32
|
+
export declare function matchWebfontFragments(candidates: readonly string[]): string[];
|
|
33
|
+
/** The stylesheet href for the candidates, or `null` (also when `base` is `null`: off). */
|
|
34
|
+
export declare function webfontHref(candidates: readonly string[], base: string | null): string | null;
|
|
35
|
+
export interface PrefetchWebfontsOptions {
|
|
36
|
+
document: Document;
|
|
37
|
+
/** The product's managed `<link>` id; the early stylesheet takes `<id>-prefetch`. */
|
|
38
|
+
linkId: string;
|
|
39
|
+
/** The file as it arrived, before parsing. */
|
|
40
|
+
bytes: Uint8Array | ArrayBuffer;
|
|
41
|
+
/** From `resolveGoogleFontsCss2Base`; `null` (off) removes any early stylesheet. */
|
|
42
|
+
base: string | null;
|
|
43
|
+
isLocallyInstalled?: (family: string) => boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Start downloading a file's webfonts before it is parsed. The families its package declares
|
|
47
|
+
* (themes, styles, font table; `ooxml-core/opc` `readDeclaredFonts`) that are neither embedded nor
|
|
48
|
+
* installed, and that the catalogue serves, go into an early stylesheet under its own link id, so
|
|
49
|
+
* the browser fetches the CSS while the parse runs and the faces are usually ready by the time
|
|
50
|
+
* {@link prepareWebfonts} waits for them. The exact stylesheet the product builds afterwards from
|
|
51
|
+
* the runs it draws is a separate link, so neither replaces the other's `@font-face` rules
|
|
52
|
+
* mid-load. Font files are only downloaded for faces the page actually uses. Returns the early
|
|
53
|
+
* href, or `null`. Never throws.
|
|
54
|
+
*/
|
|
55
|
+
export declare function prefetchWebfonts(options: PrefetchWebfontsOptions): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Called once a load has parsed (both {@link prepareWebfonts} and PowerPoint's
|
|
58
|
+
* `prepareDeckWebfonts` do): the early stylesheet stops being pending, so a later
|
|
59
|
+
* `syncGoogleWebfontStylesheet(id, null)` removes it, and with downloads off it goes at once.
|
|
60
|
+
*/
|
|
61
|
+
export declare function settlePrefetchedWebfonts(doc: Document, linkId: string, base: string | null): void;
|
|
62
|
+
/** Progress of the wait, by webfont family (the names the stylesheet serves). */
|
|
63
|
+
export interface WebfontProgress {
|
|
64
|
+
loaded: number;
|
|
65
|
+
total: number;
|
|
66
|
+
families: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
export interface WebfontReadiness {
|
|
69
|
+
/** The stylesheet the managed `<link>` now points at, or `null`. */
|
|
70
|
+
href: string | null;
|
|
71
|
+
/** Webfont families waited for (canonical catalogue names). */
|
|
72
|
+
families: readonly string[];
|
|
73
|
+
/** Referenced families with no installed, embedded or catalogue face. */
|
|
74
|
+
unavailable: readonly string[];
|
|
75
|
+
/** The wait ended at the timeout with faces still downloading. */
|
|
76
|
+
timedOut: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface PrepareWebfontsOptions {
|
|
79
|
+
document: Document;
|
|
80
|
+
/** The product's managed `<link>` id. */
|
|
81
|
+
linkId: string;
|
|
82
|
+
/** The document's text, reduced to runs. */
|
|
83
|
+
runs: readonly WebfontRun[];
|
|
84
|
+
/** Families the document embeds with usable files. */
|
|
85
|
+
embedded?: Iterable<string>;
|
|
86
|
+
/** From `resolveGoogleFontsCss2Base`; `null` turns the fallback and the wait off. */
|
|
87
|
+
base: string | null;
|
|
88
|
+
onProgress?: (progress: WebfontProgress) => void;
|
|
89
|
+
timeoutMs?: number;
|
|
90
|
+
progressDelayMs?: number;
|
|
91
|
+
isLocallyInstalled?: (family: string) => boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Inject the stylesheet for the runs' missing families and wait (bounded) for the faces they
|
|
95
|
+
* draw. Never rejects: the wait ends when every face loaded or failed, the stylesheet failed
|
|
96
|
+
* (offline, blocked by policy) or `timeoutMs` passed. Progress is reported only after
|
|
97
|
+
* `progressDelayMs`, so a fast or cached load shows nothing.
|
|
98
|
+
*/
|
|
99
|
+
export declare function prepareWebfonts(options: PrepareWebfontsOptions): Promise<WebfontReadiness>;
|
|
100
|
+
/**
|
|
101
|
+
* The bounded wait shared with PowerPoint's deck loader.
|
|
102
|
+
*
|
|
103
|
+
* Without `followMs`, a face still downloading when the wait ends reports nothing more (the
|
|
104
|
+
* document is shown and swaps the face in silently). With it, the download keeps being reported
|
|
105
|
+
* after the wait returns, from `progressDelayMs` until every face has loaded or failed, the
|
|
106
|
+
* stylesheet failed, or `followMs` passed; `onProgressEnd` then runs once, when anything was
|
|
107
|
+
* reported, so a host can show the download (a status bar item) and clear it again.
|
|
108
|
+
*/
|
|
109
|
+
export declare function waitForFaces(link: HTMLLinkElement, fontSet: FontFaceSet, faces: ReadonlyMap<string, readonly WebfontFace[]>, families: readonly string[], context: {
|
|
110
|
+
href: string | null;
|
|
111
|
+
unavailable: readonly string[];
|
|
112
|
+
timeoutMs: number;
|
|
113
|
+
progressDelayMs: number;
|
|
114
|
+
onProgress?: (progress: WebfontProgress) => void;
|
|
115
|
+
followMs?: number;
|
|
116
|
+
onProgressEnd?: () => void;
|
|
117
|
+
}): Promise<WebfontReadiness>;
|
|
118
|
+
//# sourceMappingURL=webfonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webfonts.d.ts","sourceRoot":"","sources":["../../src/fonts/webfonts.ts"],"names":[],"mappings":"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"}
|
|
@@ -41,4 +41,3 @@ export declare const OFFICE_COLOR_SWATCHES: readonly OfficeColorSwatch[];
|
|
|
41
41
|
export declare const OFFICE_COLOR_SWATCH_HEXES: readonly string[];
|
|
42
42
|
/** A standard swatch's name in the viewer's locale (English without a translator or a key). */
|
|
43
43
|
export declare function officeColorSwatchLabel(swatch: OfficeColorSwatch, translate?: Translate): string;
|
|
44
|
-
//# sourceMappingURL=color-swatches.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-
|
|
1
|
+
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-J3ROBM74.js';
|
|
2
2
|
export { createRecoveryScheduler } from './chunk-DA57FPSN.js';
|
|
3
3
|
export { HOST_REGION_ATTRIBUTE, HostRegionHost, RIBBON_ADD_IN_EVENT, createHostBackstagePages, defineRibbonAddInElements, syncHostMenuChildren, syncRibbonAddIns, tidyMenuSeparators, withHostMenuItems } from './chunk-ZTLP52FH.js';
|
|
4
4
|
export { OfficeUiSmartArt, OfficeUiSmartArtPicker, OfficeUiSmartArtTextPane, SmartArtTextPaneController, cachedPicturePixels, defineSmartArt, defineSmartArtPicker, defineSmartArtTextPane, needsPicturePixels, picturePaint, pictureSvg, probePicturePixels, renderDiagramDrawing, smartArtColorsGalleryState, smartArtLayoutTileSvg, smartArtStylesGalleryState, smartArtTileSvg } from './chunk-6FFZFH73.js';
|
|
5
|
-
export { EMOJI, OfficeUiActivityFeed, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCalendarAgenda, OfficeUiCalendarView, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiChatSidebar, OfficeUiPeoplePicker, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_CONTRACT, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, activityTime, applyTeamsProps, bindTeams, colorFor, createTeams, dayKind, dayLabel, defineActivityFeed, defineAppRail, defineAvatar, defineCalendarAgenda, defineCalendarView, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, defineChatSidebar, definePeoplePicker, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, formatWhen, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, pickTeamsProps, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-
|
|
5
|
+
export { EMOJI, OfficeUiActivityFeed, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCalendarAgenda, OfficeUiCalendarView, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiChatSidebar, OfficeUiPeoplePicker, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_CONTRACT, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, activityTime, applyTeamsProps, bindTeams, colorFor, createTeams, dayKind, dayLabel, defineActivityFeed, defineAppRail, defineAvatar, defineCalendarAgenda, defineCalendarView, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, defineChatSidebar, definePeoplePicker, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, formatWhen, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, pickTeamsProps, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-MUY444GW.js';
|
|
6
6
|
export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './chunk-4ZSZPUE5.js';
|
|
7
7
|
import './chunk-CDAXY5KC.js';
|
|
8
8
|
import './chunk-NDUD5JJB.js';
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export declare function buildArtisticFilterMarkup(effectName: string, radius: number): string | undefined;
|
|
7
7
|
export declare function buildSimpleArtisticCss(effect: string, radius: number): string;
|
|
8
8
|
export declare const ARTISTIC_PREVIEW_EFFECTS: Set<string>;
|
|
9
|
-
//# sourceMappingURL=picture-artistic-filters.d.ts.map
|