ooxml-ui 1.30.0 → 1.32.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 +10 -0
- package/custom-elements.json +4 -0
- package/dist/building-block-styles.d.ts +0 -1
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/{chunk-SBBFNAKM.js → chunk-32P252JS.js} +3 -3
- package/dist/{chunk-E4H3Y7M4.js → chunk-6TS7ASDJ.js} +1 -1
- package/dist/{chunk-BKHWBIXP.js → chunk-CALEXPBD.js} +132 -69
- package/dist/{chunk-SXVOXSTE.js → chunk-CDC5MAZS.js} +1 -1
- package/dist/chunk-DA57FPSN.js +54 -0
- package/dist/{chunk-HNREZW5U.js → chunk-KYXSQFDB.js} +484 -1
- package/dist/{chunk-IE6HKH4X.js → chunk-OKEFAQJT.js} +1 -1
- package/dist/controls.d.ts +6 -0
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/dialog/dialog-session.d.ts +19 -0
- package/dist/dialog/dialog-session.d.ts.map +1 -0
- package/dist/docx/smartart-node-view.d.ts +1 -1
- package/dist/docx.js +36 -20
- package/dist/fonts/availability.d.ts +10 -0
- package/dist/fonts/availability.d.ts.map +1 -0
- package/dist/fonts/catalog.d.ts +63 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/custom-fonts.d.ts +75 -0
- package/dist/fonts/custom-fonts.d.ts.map +1 -0
- package/dist/form/color-input/live-color-input.d.ts +93 -0
- package/dist/form/color-input/live-color-input.d.ts.map +1 -0
- package/dist/form/color-input/live-color-leaves.d.ts +34 -0
- package/dist/form/color-input/live-color-leaves.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -5
- package/dist/picture-effects.d.ts +6 -0
- package/dist/pptx/ai/host.cjs +41 -37
- package/dist/pptx/ai/host.d.ts +2 -0
- package/dist/pptx/ai/host.d.ts.map +1 -1
- package/dist/pptx/ai/host.mjs +2 -2
- package/dist/pptx/ai/index.cjs +47 -43
- package/dist/pptx/ai/index.d.ts +2 -0
- package/dist/pptx/ai/index.d.ts.map +1 -1
- package/dist/pptx/ai/index.mjs +3 -3
- package/dist/pptx/{chart-3d-view-scene-ZUGA3DKM.mjs → chart-3d-view-scene-HNL4NWJT.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-N7UQOYFI.cjs → chart-3d-view-scene-OPVBTZL5.cjs} +38 -38
- package/dist/pptx/chunk-3RIGT7H6.cjs +82 -0
- package/dist/pptx/{chunk-D7UYDESZ.mjs → chunk-7DT3UJQB.mjs} +3 -3
- package/dist/pptx/{chunk-KY75GY5O.mjs → chunk-7FXQHSPE.mjs} +6 -24
- package/dist/pptx/{chunk-45OYSCLD.mjs → chunk-CH4Z6H6C.mjs} +581 -230
- package/dist/pptx/{chunk-6KLPQQYP.cjs → chunk-D4LJJ7Z7.cjs} +77 -327
- package/dist/pptx/{chunk-MNSWEXYO.mjs → chunk-DACFW5LO.mjs} +26 -3
- package/dist/pptx/{chunk-IOOI63TH.cjs → chunk-FFWLDANS.cjs} +6 -24
- package/dist/pptx/{chunk-SMMEIEEJ.mjs → chunk-KGDMMWIY.mjs} +1 -1
- package/dist/pptx/{chunk-LXEMMWVI.mjs → chunk-LCCRLB7Q.mjs} +1 -1
- package/dist/pptx/{chunk-BMMTD6PB.cjs → chunk-M55PNMFQ.cjs} +2 -2
- package/dist/pptx/chunk-PM2SOLK3.mjs +79 -0
- package/dist/pptx/{chunk-QX6XPYVA.mjs → chunk-PTIGQSTY.mjs} +31 -14
- package/dist/pptx/{chunk-34LEUH5R.mjs → chunk-RZVEPTLN.mjs} +63 -316
- package/dist/pptx/{chunk-CQYWHRZE.cjs → chunk-S3L5NNCK.cjs} +1 -1
- package/dist/pptx/{chunk-H5IPNKX6.cjs → chunk-S5I64Y55.cjs} +12 -12
- package/dist/pptx/{chunk-WQA3KZRB.mjs → chunk-SPOECCPV.mjs} +1 -1
- package/dist/pptx/{chunk-YMWEU56T.cjs → chunk-TDIJHLS5.cjs} +927 -543
- package/dist/pptx/{chunk-QWF3PGUX.cjs → chunk-VEFFYJGG.cjs} +26 -2
- package/dist/pptx/{chunk-BSGCZ4JZ.cjs → chunk-WBGU7BWD.cjs} +31 -14
- package/dist/pptx/{chunk-2CBK46AW.cjs → chunk-ZS5EVODY.cjs} +48 -48
- package/dist/pptx/dom/index.cjs +431 -430
- package/dist/pptx/dom/index.mjs +15 -14
- package/dist/pptx/export/html2canvas-clone.cjs +6 -6
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/index.cjs +3423 -3355
- package/dist/pptx/index.mjs +8 -8
- package/dist/pptx/render/bullet-toggle-selection.d.ts +8 -4
- package/dist/pptx/render/bullet-toggle-selection.d.ts.map +1 -1
- package/dist/pptx/render/chart-box-whisker.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-data-table-metrics.d.ts +1 -1
- package/dist/pptx/render/chart-data-table-metrics.d.ts.map +1 -1
- package/dist/pptx/render/chart-data-table-render.d.ts.map +1 -1
- package/dist/pptx/render/chart-date-axis.d.ts +1 -1
- package/dist/pptx/render/chart-date-axis.d.ts.map +1 -1
- package/dist/pptx/render/chart-date-format.d.ts +1 -30
- package/dist/pptx/render/chart-date-format.d.ts.map +1 -1
- package/dist/pptx/render/chart-funnel-sunburst.d.ts +1 -1
- package/dist/pptx/render/chart-funnel-sunburst.d.ts.map +1 -1
- package/dist/pptx/render/chart-line-path.d.ts +2 -26
- package/dist/pptx/render/chart-line-path.d.ts.map +1 -1
- package/dist/pptx/render/chart-manual-layout.d.ts +1 -1
- package/dist/pptx/render/chart-manual-layout.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-layout.d.ts.map +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/controller/ai-assistant.d.ts +73 -0
- package/dist/pptx/render/controller/ai-assistant.d.ts.map +1 -0
- package/dist/pptx/render/controller/autosave-controller.d.ts.map +1 -1
- package/dist/pptx/render/controller/collaboration-history.d.ts +25 -0
- package/dist/pptx/render/controller/collaboration-history.d.ts.map +1 -1
- package/dist/pptx/render/controller/history-controller.d.ts +9 -0
- package/dist/pptx/render/controller/history-controller.d.ts.map +1 -1
- package/dist/pptx/render/controller/index.d.ts +4 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/custom-fonts.cjs +9 -5
- package/dist/pptx/render/custom-fonts.d.ts +1 -64
- package/dist/pptx/render/custom-fonts.d.ts.map +1 -1
- package/dist/pptx/render/custom-fonts.mjs +1 -1
- package/dist/pptx/render/editor-geometry.d.ts +3 -15
- package/dist/pptx/render/editor-geometry.d.ts.map +1 -1
- package/dist/pptx/render/font-availability.d.ts +1 -9
- package/dist/pptx/render/font-availability.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.cjs +3 -3
- package/dist/pptx/render/font-catalog.d.ts +3 -61
- package/dist/pptx/render/font-catalog.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.mjs +1 -1
- package/dist/pptx/render/hyperlink-security.cjs +8 -8
- package/dist/pptx/render/hyperlink-security.d.ts +1 -27
- package/dist/pptx/render/hyperlink-security.d.ts.map +1 -1
- package/dist/pptx/render/hyperlink-security.mjs +1 -1
- package/dist/pptx/render/image-effects.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inline-list-style.d.ts +2 -1
- package/dist/pptx/render/inline-list-style.d.ts.map +1 -1
- package/dist/pptx/render/live-color-input.d.ts +2 -92
- package/dist/pptx/render/live-color-input.d.ts.map +1 -1
- package/dist/pptx/render/live-color-leaves.d.ts +2 -33
- package/dist/pptx/render/live-color-leaves.d.ts.map +1 -1
- package/dist/pptx/render/options/autocorrect.d.ts +15 -2
- package/dist/pptx/render/options/autocorrect.d.ts.map +1 -1
- package/dist/pptx/render/picture-crop/crop-geometry.d.ts +2 -20
- package/dist/pptx/render/picture-crop/crop-geometry.d.ts.map +1 -1
- package/dist/pptx/render/slides-pane-model.d.ts +79 -0
- package/dist/pptx/render/slides-pane-model.d.ts.map +1 -0
- package/dist/pptx/render/table-cell-edit.d.ts +1 -1
- package/dist/pptx/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/render/text-list-style-update.d.ts +23 -2
- package/dist/pptx/render/text-list-style-update.d.ts.map +1 -1
- package/dist/pptx/render/text-script-fonts.d.ts +4 -72
- package/dist/pptx/render/text-script-fonts.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts +10 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-curves.d.ts +8 -0
- package/dist/pptx/render/text-warp-envelope-curves.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-layout.d.ts +9 -3
- package/dist/pptx/render/text-warp-envelope-layout.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-map.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts +29 -0
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts +13 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-preset-sampler.d.ts +12 -0
- package/dist/pptx/render/text-warp-preset-sampler.d.ts.map +1 -1
- package/dist/pptx/render/text-warp.d.ts +3 -2
- package/dist/pptx/render/text-warp.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-SKFD7NCQ.mjs → smartart-insert-preview-RQUFRLSV.mjs} +9 -9
- package/dist/pptx/{smartart-insert-preview-7OL7VWEK.cjs → smartart-insert-preview-YKNB37GE.cjs} +10 -10
- package/dist/recovery-scheduler.d.ts +18 -0
- package/dist/recovery-scheduler.d.ts.map +1 -0
- package/dist/smartart/smartart-geometry.d.ts +1 -3
- package/dist/smartart/smartart-paint.d.ts +2 -1
- package/dist/smartart/smartart-picture.d.ts +7 -0
- package/dist/smartart/smartart-svg.d.ts +2 -1
- package/dist/smartart/smartart.d.ts +6 -0
- package/dist/smartart.js +1 -1
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/theme.d.ts +0 -1
- package/dist/visio/controller.d.ts +2 -2
- package/dist/visio/viewer-autorecover.d.ts +0 -1
- package/dist/visio/viewer-commands.d.ts +1 -1
- package/dist/visio/viewer-guides.d.ts +2 -2
- package/dist/visio/viewer-pointer-gestures.d.ts +1 -1
- package/dist/visio/viewer-resize-frame.d.ts +2 -2
- package/dist/visio/viewer-resize-handles.d.ts +1 -1
- package/dist/visio.js +109 -62
- package/dist/xlsx/grid/smartart.d.ts +1 -1
- package/dist/xlsx.js +91 -62
- package/package.json +2 -2
- package/dist/pptx/chunk-WM5SW737.mjs +0 -27
- package/dist/pptx/chunk-Y6DO6SVT.cjs +0 -29
package/dist/docx.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineChartExOptions, chartExSpaceFormatSource, statusLayout, watchStatusWidth, compactPageText } from './chunk-
|
|
2
|
-
import { syncRibbonAddIns, createHostBackstagePages, withHostMenuItems } from './chunk-
|
|
3
|
-
export { RIBBON_ADD_IN_EVENT } from './chunk-
|
|
4
|
-
import { defineSmartArt, smartArtColorsGalleryState, smartArtStylesGalleryState, SmartArtTextPaneController, defineSmartArtPicker } from './chunk-
|
|
1
|
+
import { defineChartExOptions, chartExSpaceFormatSource, statusLayout, watchStatusWidth, compactPageText } from './chunk-6TS7ASDJ.js';
|
|
2
|
+
import { syncRibbonAddIns, createHostBackstagePages, withHostMenuItems } from './chunk-CDC5MAZS.js';
|
|
3
|
+
export { RIBBON_ADD_IN_EVENT } from './chunk-CDC5MAZS.js';
|
|
4
|
+
import { defineSmartArt, smartArtColorsGalleryState, smartArtStylesGalleryState, SmartArtTextPaneController, defineSmartArtPicker } from './chunk-CALEXPBD.js';
|
|
5
5
|
import { legacyThemeAliases, legacyThemeBridge, installOfficeUiThemeFor } from './chunk-T5ARELU2.js';
|
|
6
|
-
import { createRibbonOverflow, defineRibbon, defineChartFormatPane, defineRuler, defineChartDataSheet, defineChartPicker, defineCommentsPane, defineDialog, defineGallery, defineSearchField, defineSwitch, defineTitleBar, defineRibbonActions, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, defineColorGrid, runKeyTips, defineOptionsDialog, assignKeyTips, optionsLabels, userInterfaceSection, personalizeSection, optionText, unavailableCategory } from './chunk-
|
|
6
|
+
import { createRibbonOverflow, defineRibbon, defineChartFormatPane, defineRuler, defineChartDataSheet, defineChartPicker, createDialogSession, defineCommentsPane, defineDialog, buildFontCatalog, defineGallery, defineSearchField, defineSwitch, defineTitleBar, defineRibbonActions, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, defineColorGrid, runKeyTips, defineOptionsDialog, assignKeyTips, optionsLabels, userInterfaceSection, personalizeSection, optionText, unavailableCategory } from './chunk-KYXSQFDB.js';
|
|
7
7
|
import { registerIcon } from './chunk-M6GF5ED2.js';
|
|
8
8
|
import './chunk-4OBMFPGF.js';
|
|
9
9
|
import './chunk-YZH2QS7J.js';
|
|
@@ -25,6 +25,7 @@ import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
|
|
|
25
25
|
import { keymap } from 'prosemirror-keymap';
|
|
26
26
|
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
27
|
import { chainCommands, baseKeymap, selectAll, splitBlock } from 'prosemirror-commands';
|
|
28
|
+
import { imageContentType } from 'ooxml-core/drawingml';
|
|
28
29
|
import { applyChartExEditIntent, applyChartEditIntent, applyChartExEditAction, setChartType, setChartLegend, setChartExLegend } from 'ooxml-core/chart';
|
|
29
30
|
import { sendableSteps, getVersion } from 'prosemirror-collab';
|
|
30
31
|
import { isCapabilityEnabled, capabilityHiddenActions, mergeHiddenActions, saveToStorage, documentSaveMeta, fileCommandDetail, withoutHiddenEntries } from 'ooxml-core/embedding';
|
|
@@ -5727,7 +5728,9 @@ function comboBox(label2, items, parse5, action, options = {}) {
|
|
|
5727
5728
|
input.setAttribute("aria-haspopup", "listbox");
|
|
5728
5729
|
input.autocomplete = "off";
|
|
5729
5730
|
input.spellcheck = false;
|
|
5730
|
-
input.comboItems =
|
|
5731
|
+
input.comboItems = options.preview ? buildFontCatalog({ allFonts: items }).flatMap(
|
|
5732
|
+
(group3) => group3.entries.map((entry) => entry.family)
|
|
5733
|
+
) : [...items];
|
|
5731
5734
|
let committed = "";
|
|
5732
5735
|
const commit = (raw) => {
|
|
5733
5736
|
const value = parse5(raw);
|
|
@@ -8530,7 +8533,7 @@ function placeholder(diagram) {
|
|
|
8530
8533
|
return body;
|
|
8531
8534
|
}
|
|
8532
8535
|
var infoCounter = 0;
|
|
8533
|
-
function smartArtNodeView(node, diagram, theme, locale = "en") {
|
|
8536
|
+
function smartArtNodeView(node, diagram, theme, locale = "en", pictureResolver) {
|
|
8534
8537
|
registerSmartArt();
|
|
8535
8538
|
const dom = box(node, diagram);
|
|
8536
8539
|
const info = document.createElement("button");
|
|
@@ -8591,6 +8594,7 @@ function smartArtNodeView(node, diagram, theme, locale = "en") {
|
|
|
8591
8594
|
...theme?.fonts.major.latin ? { major: theme.fonts.major.latin } : {},
|
|
8592
8595
|
...theme?.fonts.minor.latin ? { minor: theme.fonts.minor.latin } : {}
|
|
8593
8596
|
};
|
|
8597
|
+
if (pictureResolver) element.pictureResolver = pictureResolver;
|
|
8594
8598
|
element.drawing = themed.drawing;
|
|
8595
8599
|
dom.append(element);
|
|
8596
8600
|
} else {
|
|
@@ -12565,7 +12569,14 @@ function imageNodeView(cache, options = {}) {
|
|
|
12565
12569
|
return (node, view, getPos) => {
|
|
12566
12570
|
if (node.attrs.shape) return shapeNodeView(node, view, getPos, () => options.theme?.());
|
|
12567
12571
|
const diagram = parseDiagram(node.attrs.diagram);
|
|
12568
|
-
if (diagram)
|
|
12572
|
+
if (diagram)
|
|
12573
|
+
return smartArtNodeView(
|
|
12574
|
+
node,
|
|
12575
|
+
diagram,
|
|
12576
|
+
options.theme?.(),
|
|
12577
|
+
options.locale?.(),
|
|
12578
|
+
(part) => cache.urlFor(part, imageContentType(part))
|
|
12579
|
+
);
|
|
12569
12580
|
if (node.attrs.chart) return chartNodeView(node, view, getPos, options);
|
|
12570
12581
|
const content = renderSpec(node);
|
|
12571
12582
|
if (content.tagName !== "IMG") return { dom: content, ignoreMutation: () => true };
|
|
@@ -16327,20 +16338,25 @@ function createZoomDialog(host) {
|
|
|
16327
16338
|
const size = value === "custom" ? parseZoomPercent(percent.value) : Number(value);
|
|
16328
16339
|
preview.style.fontSize = `${Math.round((size ?? 100) / 100 * 14)}px`;
|
|
16329
16340
|
};
|
|
16330
|
-
|
|
16341
|
+
let session;
|
|
16342
|
+
const cleanup = () => {
|
|
16331
16343
|
setDialogOpen(element, false);
|
|
16332
16344
|
element.replaceChildren();
|
|
16333
16345
|
host.restoreFocus();
|
|
16334
16346
|
};
|
|
16347
|
+
const hide = () => session?.close();
|
|
16335
16348
|
const submit = () => {
|
|
16336
16349
|
const value = chosen();
|
|
16337
16350
|
if (value === "width" || value === "page" || value === "pages") host.fit(value);
|
|
16338
16351
|
else {
|
|
16339
16352
|
const next = value === "custom" ? parseZoomPercent(percent.value) : Number(value);
|
|
16340
|
-
if (next === null)
|
|
16353
|
+
if (next === null) {
|
|
16354
|
+
percent.focus();
|
|
16355
|
+
return;
|
|
16356
|
+
}
|
|
16341
16357
|
host.setPercent(next);
|
|
16342
16358
|
}
|
|
16343
|
-
|
|
16359
|
+
return true;
|
|
16344
16360
|
};
|
|
16345
16361
|
for (const input of radios.values()) input.addEventListener("change", showPreview);
|
|
16346
16362
|
percent.addEventListener("input", () => {
|
|
@@ -16348,18 +16364,10 @@ function createZoomDialog(host) {
|
|
|
16348
16364
|
if (radio) radio.checked = true;
|
|
16349
16365
|
showPreview();
|
|
16350
16366
|
});
|
|
16351
|
-
cancel.addEventListener("click", hide);
|
|
16352
|
-
confirm2.addEventListener("click", submit);
|
|
16353
|
-
onDialogDismiss(element, hide);
|
|
16354
|
-
element.addEventListener("keydown", (event) => {
|
|
16355
|
-
if (event.key === "Enter" && event.target instanceof HTMLInputElement) {
|
|
16356
|
-
event.preventDefault();
|
|
16357
|
-
submit();
|
|
16358
|
-
}
|
|
16359
|
-
});
|
|
16360
16367
|
return {
|
|
16361
16368
|
element,
|
|
16362
16369
|
open() {
|
|
16370
|
+
session?.dispose();
|
|
16363
16371
|
element.replaceChildren(...content);
|
|
16364
16372
|
localizeDialog(element, locale);
|
|
16365
16373
|
const current2 = host.percent();
|
|
@@ -16368,6 +16376,14 @@ function createZoomDialog(host) {
|
|
|
16368
16376
|
const radio = radios.get(preset ?? "custom");
|
|
16369
16377
|
if (radio) radio.checked = true;
|
|
16370
16378
|
showPreview();
|
|
16379
|
+
session = createDialogSession({
|
|
16380
|
+
element,
|
|
16381
|
+
confirm: confirm2,
|
|
16382
|
+
cancel,
|
|
16383
|
+
submit,
|
|
16384
|
+
finish: cleanup,
|
|
16385
|
+
enter: (event) => event.target?.tagName === "INPUT"
|
|
16386
|
+
});
|
|
16371
16387
|
setDialogOpen(element, true);
|
|
16372
16388
|
(radio ?? percent).focus();
|
|
16373
16389
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Minimal browser FontFaceSet surface used by the viewer bindings. */
|
|
2
|
+
export interface FontAvailabilitySource {
|
|
3
|
+
readonly ready: PromiseLike<unknown>;
|
|
4
|
+
check(font: string): boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Check whether a font family resolves through the browser font set. */
|
|
7
|
+
export declare function isFontFamilyAvailable(family: string, source?: FontAvailabilitySource | undefined): boolean;
|
|
8
|
+
/** Wait for fonts to settle, then return every locally available family. */
|
|
9
|
+
export declare function scanAvailableFontFamilies(families: readonly string[], source?: FontAvailabilitySource | undefined): Promise<Set<string>>;
|
|
10
|
+
//# sourceMappingURL=availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../src/fonts/availability.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAMD,yEAAyE;AACzE,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,sBAAsB,GAAG,SAA+B,GAC9D,OAAO,CAUT;AAED,4EAA4E;AAC5E,wBAAsB,yBAAyB,CAC9C,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,MAAM,GAAE,sBAAsB,GAAG,SAA+B,GAC9D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAUtB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* font-catalog.ts: grouping for the Home-tab font dropdown.
|
|
3
|
+
*
|
|
4
|
+
* PowerPoint splits its font list into headed groups: the two theme fonts
|
|
5
|
+
* first (labelled "Headings" and "Body"), then any fonts embedded in the
|
|
6
|
+
* presentation, then the full alphabetical catalogue. Reproducing that in five
|
|
7
|
+
* bindings means five copies of the same dedup rules, so the grouping decision
|
|
8
|
+
* is made once here and each binding only renders the returned sections.
|
|
9
|
+
*
|
|
10
|
+
* @module render/font-catalog
|
|
11
|
+
*/
|
|
12
|
+
/** Identifies a group so bindings can label and style it. */
|
|
13
|
+
export type FontCatalogGroupId = 'theme' | 'embedded' | 'custom' | 'all';
|
|
14
|
+
/** One selectable font. */
|
|
15
|
+
export interface FontCatalogEntry {
|
|
16
|
+
/** The family name written into the run's `fontFamily`. */
|
|
17
|
+
family: string;
|
|
18
|
+
/**
|
|
19
|
+
* Which theme slot this family fills, for the "(Headings)" / "(Body)" hint
|
|
20
|
+
* PowerPoint shows beside its two theme fonts. Absent for other entries.
|
|
21
|
+
*/
|
|
22
|
+
themeRole?: 'heading' | 'body';
|
|
23
|
+
}
|
|
24
|
+
/** A headed group of fonts. */
|
|
25
|
+
export interface FontCatalogGroup {
|
|
26
|
+
id: FontCatalogGroupId;
|
|
27
|
+
/** i18n key for the group heading. */
|
|
28
|
+
labelKey: string;
|
|
29
|
+
entries: FontCatalogEntry[];
|
|
30
|
+
}
|
|
31
|
+
/** Inputs describing what the current deck and session make available. */
|
|
32
|
+
export interface FontCatalogInput {
|
|
33
|
+
/** `a:fontScheme` major/minor latin faces from the active theme. */
|
|
34
|
+
themeFonts?: {
|
|
35
|
+
heading?: string;
|
|
36
|
+
body?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Families embedded in the presentation via `p:embeddedFontLst`. */
|
|
39
|
+
embeddedFonts?: readonly string[];
|
|
40
|
+
/** Families the user registered this session from a local font file. */
|
|
41
|
+
customFonts?: readonly string[];
|
|
42
|
+
/** The host's catalogue; an omitted list adds no alphabetical group. */
|
|
43
|
+
allFonts?: readonly string[];
|
|
44
|
+
/** Product translations stay with the host rather than the shared grouping rules. */
|
|
45
|
+
labelKeys?: Partial<Record<FontCatalogGroupId, string>>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the grouped font list for the Home-tab dropdown.
|
|
49
|
+
*
|
|
50
|
+
* A family promoted into the theme, embedded or custom group is removed from
|
|
51
|
+
* the alphabetical group, so no family is offered twice and clicking either
|
|
52
|
+
* copy would not produce different results.
|
|
53
|
+
*
|
|
54
|
+
* @returns Only the non-empty groups, in PowerPoint's order.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const groups = buildFontCatalog({ themeFonts: { heading: "Aptos Display" } });
|
|
59
|
+
* // => groups[0].id === "theme"
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildFontCatalog(input?: FontCatalogInput): FontCatalogGroup[];
|
|
63
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/fonts/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzE,2BAA2B;AAC3B,MAAM,WAAW,gBAAgB;IAChC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC/B;AAED,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,kBAAkB,CAAC;IACvB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAChC,oEAAoE;IACpE,UAAU,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,qEAAqE;IACrE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,wEAAwE;IACxE,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,gBAAqB,GAAG,gBAAgB,EAAE,CAyCjF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* custom-fonts.ts: registering a user-supplied font file with the document.
|
|
3
|
+
*
|
|
4
|
+
* Backs the opt-in "Custom fonts" pane under File > Options. The viewer cannot
|
|
5
|
+
* render a family the browser has never heard of, so a deck authored with a
|
|
6
|
+
* corporate face falls back to a substitute; letting the user hand the font
|
|
7
|
+
* file over fixes that for the session.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here is persisted: the registration lives in the page's font set and
|
|
10
|
+
* disappears on reload. That is deliberate, because keeping a licensed font
|
|
11
|
+
* binary in local storage is not ours to decide.
|
|
12
|
+
*
|
|
13
|
+
* @module render/custom-fonts
|
|
14
|
+
*/
|
|
15
|
+
/** Recognised font file extensions, in the order the file input advertises. */
|
|
16
|
+
export declare const CUSTOM_FONT_EXTENSIONS: readonly string[];
|
|
17
|
+
/** `accept` attribute for a font file input. */
|
|
18
|
+
export declare const CUSTOM_FONT_ACCEPT: string;
|
|
19
|
+
/** Style axes recovered from a font file's name. */
|
|
20
|
+
export interface CustomFontDescriptor {
|
|
21
|
+
/** Family name, with the style suffix and separators stripped. */
|
|
22
|
+
family: string;
|
|
23
|
+
/** CSS `font-weight` for the face. */
|
|
24
|
+
weight: string;
|
|
25
|
+
/** CSS `font-style` for the face. */
|
|
26
|
+
style: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Derive a family name, weight and style from a font file's name.
|
|
30
|
+
*
|
|
31
|
+
* Foundries encode the face in the filename (`Inter-SemiBoldItalic.woff2`),
|
|
32
|
+
* and registering every file under its full filename would give the user a
|
|
33
|
+
* dropdown of near-duplicate families that never combine with the bold and
|
|
34
|
+
* italic buttons. Splitting the axes out means the four files of a family all
|
|
35
|
+
* register as one selectable name.
|
|
36
|
+
*
|
|
37
|
+
* @param fileName - The uploaded file's name, extension included.
|
|
38
|
+
* @returns The descriptor; `family` is empty when the name carried nothing but
|
|
39
|
+
* style tokens, which callers should treat as unusable.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* deriveCustomFontDescriptor("Inter-SemiBoldItalic.woff2");
|
|
44
|
+
* // => { family: "Inter", weight: "600", style: "italic" }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function deriveCustomFontDescriptor(fileName: string): CustomFontDescriptor;
|
|
48
|
+
/** Outcome of a registration attempt. */
|
|
49
|
+
export interface CustomFontRegistration {
|
|
50
|
+
family: string;
|
|
51
|
+
descriptor: CustomFontDescriptor;
|
|
52
|
+
}
|
|
53
|
+
/** A new browser registration with an explicit lifetime; the original result shape stays valid. */
|
|
54
|
+
export interface OwnedCustomFontRegistration extends CustomFontRegistration {
|
|
55
|
+
/** Remove this registration only; other documents' faces are untouched. Idempotent. */
|
|
56
|
+
dispose(): void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Load a font file and add it to the document's font set.
|
|
60
|
+
*
|
|
61
|
+
* @param file - The user-selected font file.
|
|
62
|
+
* @param target - Font set to add to; defaults to the ambient `document`.
|
|
63
|
+
* Injectable so tests and non-browser hosts can supply their own.
|
|
64
|
+
* @returns The registered family, or `null` when the environment has no
|
|
65
|
+
* `FontFace` support or the filename yields no usable family.
|
|
66
|
+
* @throws Whatever `FontFace.load` rejects with when the file is not a font,
|
|
67
|
+
* so callers can surface a message instead of silently doing nothing.
|
|
68
|
+
*/
|
|
69
|
+
export declare function registerCustomFont(file: File, target?: FontFaceSet): Promise<OwnedCustomFontRegistration | null>;
|
|
70
|
+
/** Session-owned browser fonts. A registration finishing after disposal is removed immediately. */
|
|
71
|
+
export declare function createFontFaceScope(target?: FontFaceSet): {
|
|
72
|
+
register(file: File): Promise<OwnedCustomFontRegistration | null>;
|
|
73
|
+
dispose(): void;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=custom-fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-fonts.d.ts","sourceRoot":"","sources":["../../src/fonts/custom-fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAwC,CAAC;AAE7F,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,QAMpB,CAAC;AAEZ,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACpC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;CACd;AAwED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CA0BjF;AAED,yCAAyC;AACzC,MAAM,WAAW,sBAAsB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,oBAAoB,CAAC;CACjC;AAED,mGAAmG;AACnG,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;IAC1E,uFAAuF;IACvF,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,IAAI,EACV,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAmB7C;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,WAAW;IAIhD,QAAQ,OAAO,IAAI,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC;IAWvE,OAAO,IAAI,IAAI;EAOhB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live preview for a native colour input (`<input type="color">`), decided once for every
|
|
3
|
+
* binding.
|
|
4
|
+
*
|
|
5
|
+
* The picker fires `input` for every shade a drag passes and `change` once the pick settles
|
|
6
|
+
* (and in some browsers no `change` at all when the pick ends where it started, or on Escape).
|
|
7
|
+
* PowerPoint shows each shade on the slide while the user drags and makes the settled pick ONE
|
|
8
|
+
* undo step and ONE Recent Colors entry. A binding that applied every shade through its normal
|
|
9
|
+
* edit path recorded one undo step per shade; one that applied only on `change` showed nothing
|
|
10
|
+
* until the picker closed. This controller is the rule between the two:
|
|
11
|
+
*
|
|
12
|
+
* - `input`: show the shade live, with no undo step, dirty flag or recent colour;
|
|
13
|
+
* - `change`, or `blur` for a drag no `change` ended: put back what the previews changed, then
|
|
14
|
+
* commit the settled colour through the binding's normal edit path, so its one undo step
|
|
15
|
+
* returns to the colour from before the drag, and add it to the recent colours. A pick that
|
|
16
|
+
* settles where the drag started is no edit at all: the previews are put back (theme ref
|
|
17
|
+
* included) and no undo step is recorded. A `change` there is still the user's pick, so its
|
|
18
|
+
* colour goes into the recent colours like any other; a `blur` there is not a pick (an
|
|
19
|
+
* Escape, a drag back to the start), so it records nothing.
|
|
20
|
+
*
|
|
21
|
+
* The previews own only the leaves they wrote (`shapeStyle.fillColor`, its theme ref, ...),
|
|
22
|
+
* each remembered with the value it had before the drag. Putting a drag back and committing
|
|
23
|
+
* its pick are both rebased on the target as it is NOW: only those leaves go back, and the
|
|
24
|
+
* commit is built on the result, so an edit another hand made to the same element during the
|
|
25
|
+
* drag (a collaborator's line width, an assistant's text) survives, and the undo step returns
|
|
26
|
+
* to a state that existed.
|
|
27
|
+
*
|
|
28
|
+
* A drag belongs to one target (`key`, the element). It carries over to the next event only
|
|
29
|
+
* while the control edits that target and the model still shows the drag's work: the value it
|
|
30
|
+
* last read (a binding that has not re-rendered since), or a colour the drag itself put there.
|
|
31
|
+
* When the control has moved to another target, the drag is put back on its own target as it
|
|
32
|
+
* is then (`lookup`; the binding's writes are addressed by key; nothing is written if the
|
|
33
|
+
* target is gone) and the event that ends it is dropped: a pick made in
|
|
34
|
+
* a picker opened for one element never lands on another. When the target is the same but its
|
|
35
|
+
* colour was changed by another hand (a theme swatch, an undo), the drag is dropped as it is,
|
|
36
|
+
* since putting it back would overwrite that newer colour.
|
|
37
|
+
*
|
|
38
|
+
* @module render/live-color-input
|
|
39
|
+
*/
|
|
40
|
+
/** What a colour control edits at the moment of an event. */
|
|
41
|
+
export interface LiveColorSource<T> {
|
|
42
|
+
/** The edited target's identity (the element id). A drag never crosses targets. */
|
|
43
|
+
readonly key: string;
|
|
44
|
+
/** The colour the control shows now. */
|
|
45
|
+
readonly color: string;
|
|
46
|
+
/** The target as the binding holds it now: the element, or the style a field reads. */
|
|
47
|
+
readonly value: T;
|
|
48
|
+
}
|
|
49
|
+
/** What a binding gives {@link createLiveColorInput}; called afresh on every event. */
|
|
50
|
+
export interface LiveColorInputOptions<T, P extends object> {
|
|
51
|
+
/** The control's target now, or `undefined` when nothing can be edited. */
|
|
52
|
+
read(): LiveColorSource<T> | undefined;
|
|
53
|
+
/** The patch that sets `hex` on `value`; `undefined` when `value` cannot take a colour. */
|
|
54
|
+
patch(value: T, hex: string): P | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The target `key` as the model holds it now (the element by id, or the style a field
|
|
57
|
+
* reads on it), or `undefined` when it is gone: what a drag the control has left is put
|
|
58
|
+
* back on. A drag whose target cannot be found is not put back at all.
|
|
59
|
+
*/
|
|
60
|
+
lookup(key: string): T | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Merge `patch` into the target `key` live: no undo step, dirty flag or recent colour. `key`
|
|
63
|
+
* can name a target the control has left, when the drag started there is put back.
|
|
64
|
+
*/
|
|
65
|
+
preview(patch: P, key: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Merge the settled pick into the current target `key` through the normal edit path: ONE
|
|
68
|
+
* undo step and the dirty flag. The drag is already put back and `patch` is built on it.
|
|
69
|
+
*/
|
|
70
|
+
commit(patch: P, key: string, hex: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Add `hex` to the recent colours: with every commit (just before it), and for a `change`
|
|
73
|
+
* that settles on the colour the drag started from (a pick, though not an edit).
|
|
74
|
+
*/
|
|
75
|
+
remember(hex: string): void;
|
|
76
|
+
}
|
|
77
|
+
/** The native events of one colour input, each with the input's current value. */
|
|
78
|
+
export interface LiveColorInput {
|
|
79
|
+
/** An `input` event: one shade of a drag. */
|
|
80
|
+
input(hex: string): void;
|
|
81
|
+
/** A `change` event: the pick settled. */
|
|
82
|
+
change(hex: string): void;
|
|
83
|
+
/** A `blur` event: settles a drag no `change` ended, at the value the input shows. */
|
|
84
|
+
blur(hex: string): void;
|
|
85
|
+
}
|
|
86
|
+
/** Build the controller for one colour input. */
|
|
87
|
+
export declare function createLiveColorInput<T, P extends object>(options: LiveColorInputOptions<T, P>): LiveColorInput;
|
|
88
|
+
/**
|
|
89
|
+
* Route a native colour input's DOM `input`, `change` or `blur` event to `control`, with the
|
|
90
|
+
* value the input shows. Any other event, or an input without a value, is ignored.
|
|
91
|
+
*/
|
|
92
|
+
export declare function handleLiveColorEvent(control: LiveColorInput, event: Event): void;
|
|
93
|
+
//# sourceMappingURL=live-color-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-color-input.d.ts","sourceRoot":"","sources":["../../../src/form/color-input/live-color-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,6DAA6D;AAC7D,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CAClB;AAED,uFAAuF;AACvF,MAAM,WAAW,qBAAqB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM;IACzD,2EAA2E;IAC3E,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACvC,2FAA2F;IAC3F,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC9B,6CAA6C;IAC7C,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0CAA0C;IAC1C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sFAAsF;IACtF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAgBD,iDAAiD;AACjD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACvD,OAAO,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,GAClC,cAAc,CA8FhB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAahF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The leaves a live colour drag writes, and how they are put back (see `live-color-input.ts`).
|
|
3
|
+
*
|
|
4
|
+
* A colour patch writes whole top-level entries (`{ shapeStyle: { ...style, fillColor } }`),
|
|
5
|
+
* but the drag owns only the leaves inside them that changed. Those are found by a structural
|
|
6
|
+
* diff of plain objects and arrays, each remembered with the value it had before the drag,
|
|
7
|
+
* and put back onto the target as it is at that moment, so everything else in the same entry
|
|
8
|
+
* keeps whatever it holds now. When a preview creates an object the target did not have (a
|
|
9
|
+
* text colour on an element with no `textStyle`), the drag owns the entries it put inside, not
|
|
10
|
+
* the object: putting it back removes those, and the object itself only if nothing else went
|
|
11
|
+
* into it since.
|
|
12
|
+
*
|
|
13
|
+
* @module render/live-color-leaves
|
|
14
|
+
*/
|
|
15
|
+
type LiveColorPath = readonly string[];
|
|
16
|
+
/** One leaf a drag's previews wrote, with what the target held there before the first one. */
|
|
17
|
+
export interface LiveColorLeaf {
|
|
18
|
+
readonly path: LiveColorPath;
|
|
19
|
+
readonly present: boolean;
|
|
20
|
+
readonly value: unknown;
|
|
21
|
+
/** An object the previews created: it goes again once putting the drag back leaves it empty. */
|
|
22
|
+
readonly created?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Note every leaf `patch` writes on `value` that the drag has not written yet. */
|
|
25
|
+
export declare function recordLiveColorLeaves(leaves: Map<string, LiveColorLeaf>, value: unknown, patch: object): void;
|
|
26
|
+
/**
|
|
27
|
+
* The patch that puts every leaf a drag wrote back to what it was before the drag, rebased on
|
|
28
|
+
* `value` (the target now): the top-level entries it names are `value`'s own, with only those
|
|
29
|
+
* leaves changed. An object the drag created goes again if that leaves it empty; a top-level
|
|
30
|
+
* entry the target did not have comes back as `undefined`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function liveColorRevertPatch<P extends object>(value: unknown, leaves: Iterable<LiveColorLeaf>): P;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=live-color-leaves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-color-leaves.d.ts","sourceRoot":"","sources":["../../../src/form/color-input/live-color-leaves.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,KAAK,aAAa,GAAG,SAAS,MAAM,EAAE,CAAC;AAEvC,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gGAAgG;IAChG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC3B;AAqED,mFAAmF;AACnF,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAClC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACX,IAAI,CA6BN;AAyBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EACpD,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC7B,CAAC,CAmCH"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './presence.js';
|
|
|
8
8
|
export * from './smartart.js';
|
|
9
9
|
export * from './teams/index.js';
|
|
10
10
|
export * from './theme.js';
|
|
11
|
+
export * from './recovery-scheduler.js';
|
|
11
12
|
export { CONTRACT_REVISION, type Definer } from './registry.js';
|
|
12
13
|
/** Every ooxml-ui tag this package defines, in registration order. */
|
|
13
14
|
export declare const OFFICE_UI_TAGS: readonly ["office-ui-icon", "office-ui-button", "office-ui-checkbox", "office-ui-switch", "office-ui-select", "office-ui-ribbon-group", "office-ui-ribbon-stack", "office-ui-menu-item", "office-ui-menu-button", "office-ui-menu-separator", "office-ui-context-menu", "office-ui-command-search", "office-ui-toolbar", "office-ui-dialog", "office-ui-status-bar", "office-ui-status-item", "office-ui-zoom-slider", "office-ui-tab-strip", "office-ui-task-pane", "office-ui-options-dialog", "office-ui-account", "office-ui-ribbon", "office-ui-ribbon-actions", "office-ui-find-bar", "office-ui-ruler", "office-ui-backstage", "office-ui-print-preview", "office-ui-radio", "office-ui-search", "office-ui-ribbon-toggle", "office-ui-dialog-footer", "office-ui-toasts", "office-ui-read-only-banner", "office-ui-paste-options", "office-ui-title-bar", "office-ui-ribbon-section", "office-ui-gallery", "office-ui-comments-pane", "office-ui-chart-format-pane", "office-ui-symbol-picker", "office-ui-color-grid", "office-ui-color-custom", "office-ui-chart-picker", "office-ui-chart-data-sheet", "office-ui-progress-dialog", "office-ui-presence", "office-ui-smartart", "office-ui-smartart-picker", "office-ui-smartart-text-pane", "office-ui-avatar", "office-ui-app-rail", "office-ui-activity-feed", "office-ui-channel-list", "office-ui-chat-list", "office-ui-chat-composer", "office-ui-prejoin", "office-ui-call-grid", "office-ui-call-controls", "office-ui-chat-sidebar", "office-ui-people-picker", "office-ui-calendar-view", "office-ui-calendar-agenda"];
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-32P252JS.js';
|
|
2
|
+
export { createRecoveryScheduler } from './chunk-DA57FPSN.js';
|
|
3
|
+
export { HOST_REGION_ATTRIBUTE, HostRegionHost, RIBBON_ADD_IN_EVENT, createHostBackstagePages, defineRibbonAddInElements, syncHostMenuChildren, syncRibbonAddIns, tidyMenuSeparators, withHostMenuItems } from './chunk-CDC5MAZS.js';
|
|
4
|
+
export { OfficeUiSmartArt, OfficeUiSmartArtPicker, OfficeUiSmartArtTextPane, SmartArtTextPaneController, defineSmartArt, defineSmartArtPicker, defineSmartArtTextPane, renderDiagramDrawing, smartArtColorsGalleryState, smartArtLayoutTileSvg, smartArtStylesGalleryState, smartArtTileSvg } from './chunk-CALEXPBD.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-OKEFAQJT.js';
|
|
5
6
|
export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './chunk-WYKMVMX4.js';
|
|
6
7
|
import './chunk-CDAXY5KC.js';
|
|
7
8
|
import './chunk-NDUD5JJB.js';
|
|
8
9
|
import './chunk-KJMAVPQB.js';
|
|
9
10
|
export { BUILDING_BLOCKS_CSS, LEGACY_OFFICE_THEME_TOKENS, THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme, installOfficeUiThemeFor, legacyThemeAliases, legacyThemeBridge, prepareOfficeUiBlock, shadcnBridge, themeBridge } from './chunk-T5ARELU2.js';
|
|
10
|
-
export { CONTROL_DEFINERS, DEFAULT_COMMENTS_LABELS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_SYMBOLS, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, OfficeUiChartFormatPane, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, buildChartFormatModel, chartFormatFieldIntent, chartFormatLocale, chartFormatPaneTitle, chartFormatSourceTabs, chartFormatTargetLabel, chartFormatTargetOptions, chartFormatTranslator, chartSpaceFormatSource, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, createRibbonOverflow, defaultPaneGradient, defineAccount, defineBackstage, defineButton, defineChartDataSheet, defineChartFormatPane, defineChartPicker, defineCheckbox, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineProgressDialog, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineSymbolPicker, defineTabStrip, defineTaskPane, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, drawingColorFromHex, drawingGradientFrom, fitRibbonGroups, formatCommentTime, glyph, hexForInput, nextEnabledIndex, optionText, optionsLabels, parseOfficeSymbolCode, personalizeSection, profileInitials, readOfficeProfile, registerControls, resolveChartFormatSourceTarget, rulerDivisions, runKeyTips, sanitizeOfficeProfile, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, writeOfficeProfile } from './chunk-
|
|
11
|
+
export { CONTROL_DEFINERS, CUSTOM_FONT_ACCEPT, CUSTOM_FONT_EXTENSIONS, DEFAULT_COMMENTS_LABELS, DEFAULT_OFFICE_PROFILE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_SYMBOLS, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, OfficeUiChartFormatPane, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, buildChartFormatModel, buildFontCatalog, chartFormatFieldIntent, chartFormatLocale, chartFormatPaneTitle, chartFormatSourceTabs, chartFormatTargetLabel, chartFormatTargetOptions, chartFormatTranslator, chartSpaceFormatSource, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, createDialogSession, createFontFaceScope, createLiveColorInput, createRibbonOverflow, defaultPaneGradient, defineAccount, defineBackstage, defineButton, defineChartDataSheet, defineChartFormatPane, defineChartPicker, defineCheckbox, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineProgressDialog, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineSymbolPicker, defineTabStrip, defineTaskPane, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, deriveCustomFontDescriptor, drawingColorFromHex, drawingGradientFrom, fitRibbonGroups, formatCommentTime, glyph, handleLiveColorEvent, hexForInput, isFontFamilyAvailable, liveColorRevertPatch, nextEnabledIndex, optionText, optionsLabels, parseOfficeSymbolCode, personalizeSection, profileInitials, readOfficeProfile, recordLiveColorLeaves, registerControls, registerCustomFont, resolveChartFormatSourceTarget, rulerDivisions, runKeyTips, sanitizeOfficeProfile, scanAvailableFontFamilies, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, writeOfficeProfile } from './chunk-KYXSQFDB.js';
|
|
11
12
|
export { createIconSvg, getIcon, listIcons, paintIcon, registerIcon } from './chunk-M6GF5ED2.js';
|
|
12
13
|
export { CHART_FORMAT_LOCALES, CHART_FORMAT_STRINGS, prefixChartFormatStrings } from './chunk-4OBMFPGF.js';
|
|
13
14
|
export { OfficeUiPresence, definePresence, initialsOf, participantsFromAwareness } from './chunk-YZH2QS7J.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DrawingPictureEffect } from 'ooxml-core/drawingml';
|
|
2
|
+
/** Ordered supported picture effects. Unknown operations remain in the model and are reported. */
|
|
3
|
+
export declare function pictureEffectFilter(doc: Document, defs: SVGDefsElement, effects: readonly DrawingPictureEffect[]): {
|
|
4
|
+
filter?: string;
|
|
5
|
+
unapplied: string[];
|
|
6
|
+
};
|