pptx-react-viewer 4.15.0 → 4.16.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/CHANGELOG.md +17 -0
- package/dist/{AiChatPanel-7OVUGUKW.mjs → AiChatPanel-5Z4BYP7S.mjs} +3 -3
- package/dist/AiChatPanel-5Z4BYP7S.mjs.br +0 -0
- package/dist/AiChatPanel-5Z4BYP7S.mjs.gz +0 -0
- package/dist/{AiChatPanel-CDQWJTWL.js → AiChatPanel-DHLJ6LKF.js} +27 -27
- package/dist/AiChatPanel-DHLJ6LKF.js.br +0 -0
- package/dist/AiChatPanel-DHLJ6LKF.js.gz +0 -0
- package/dist/{Model3DScene-OLGB7Z7Q.js → Model3DScene-AXT5KCUX.js} +2 -2
- package/dist/{Model3DScene-OLGB7Z7Q.js.br → Model3DScene-AXT5KCUX.js.br} +0 -0
- package/dist/Model3DScene-AXT5KCUX.js.gz +0 -0
- package/dist/{Model3DScene-A3CPMFAO.mjs → Model3DScene-N36X5Z2Z.mjs} +1 -1
- package/dist/{Model3DScene-A3CPMFAO.mjs.br → Model3DScene-N36X5Z2Z.mjs.br} +0 -0
- package/dist/Model3DScene-N36X5Z2Z.mjs.gz +0 -0
- package/dist/{chunk-RQCAXUVQ.mjs → chunk-BTTAYCGK.mjs} +568 -856
- package/dist/chunk-BTTAYCGK.mjs.br +0 -0
- package/dist/chunk-BTTAYCGK.mjs.gz +0 -0
- package/dist/{chunk-HGO243GV.js → chunk-BZNYI5U6.js} +854 -810
- package/dist/chunk-BZNYI5U6.js.br +0 -0
- package/dist/chunk-BZNYI5U6.js.gz +0 -0
- package/dist/{chunk-UP6PJEHM.js → chunk-FVLBN45Z.js} +5 -5
- package/dist/chunk-FVLBN45Z.js.br +0 -0
- package/dist/chunk-FVLBN45Z.js.gz +0 -0
- package/dist/{chunk-Q5VQ53R3.mjs → chunk-MFGRRONU.mjs} +1 -1
- package/dist/chunk-MFGRRONU.mjs.br +0 -0
- package/dist/chunk-MFGRRONU.mjs.gz +0 -0
- package/dist/{chunk-AIWEM7VE.mjs → chunk-MJ6LTUJ3.mjs} +1127 -29
- package/dist/chunk-MJ6LTUJ3.mjs.br +0 -0
- package/dist/{chunk-AIWEM7VE.mjs.gz → chunk-MJ6LTUJ3.mjs.gz} +0 -0
- package/dist/{chunk-CNXVOFUW.js → chunk-QAVJDYB2.js} +187 -187
- package/dist/chunk-QAVJDYB2.js.br +0 -0
- package/dist/chunk-QAVJDYB2.js.gz +0 -0
- package/dist/{chunk-DNWIW75I.mjs → chunk-QLUA63T3.mjs} +51 -7
- package/dist/chunk-QLUA63T3.mjs.br +0 -0
- package/dist/chunk-QLUA63T3.mjs.gz +0 -0
- package/dist/{chunk-6ZPXMS64.js → chunk-UVK2WBCU.js} +1726 -2014
- package/dist/chunk-UVK2WBCU.js.br +0 -0
- package/dist/chunk-UVK2WBCU.js.gz +0 -0
- package/dist/{chunk-AHJ4ND7Q.mjs → chunk-WRQ7K3DG.mjs} +1 -1
- package/dist/chunk-WRQ7K3DG.mjs.br +0 -0
- package/dist/chunk-WRQ7K3DG.mjs.gz +0 -0
- package/dist/{chunk-2CSRCH4H.js → chunk-XZUIS3VB.js} +1134 -32
- package/dist/chunk-XZUIS3VB.js.br +0 -0
- package/dist/{chunk-2CSRCH4H.js.gz → chunk-XZUIS3VB.js.gz} +0 -0
- package/dist/i18n/de.cjs +3 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +3 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +3 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +3 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +3 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +3 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +3 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +3 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +38 -1
- package/dist/index.js +61 -61
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +45 -0
- package/dist/internals.js +104 -104
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +35 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-7OVUGUKW.mjs.br +0 -0
- package/dist/AiChatPanel-7OVUGUKW.mjs.gz +0 -0
- package/dist/AiChatPanel-CDQWJTWL.js.br +0 -0
- package/dist/AiChatPanel-CDQWJTWL.js.gz +0 -0
- package/dist/Model3DScene-A3CPMFAO.mjs.gz +0 -0
- package/dist/Model3DScene-OLGB7Z7Q.js.gz +0 -0
- package/dist/chunk-2CSRCH4H.js.br +0 -0
- package/dist/chunk-6ZPXMS64.js.br +0 -0
- package/dist/chunk-6ZPXMS64.js.gz +0 -0
- package/dist/chunk-AHJ4ND7Q.mjs.br +0 -0
- package/dist/chunk-AHJ4ND7Q.mjs.gz +0 -0
- package/dist/chunk-AIWEM7VE.mjs.br +0 -0
- package/dist/chunk-CNXVOFUW.js.br +0 -0
- package/dist/chunk-CNXVOFUW.js.gz +0 -0
- package/dist/chunk-DNWIW75I.mjs.br +0 -0
- package/dist/chunk-DNWIW75I.mjs.gz +0 -0
- package/dist/chunk-HGO243GV.js.br +0 -0
- package/dist/chunk-HGO243GV.js.gz +0 -0
- package/dist/chunk-Q5VQ53R3.mjs.br +0 -0
- package/dist/chunk-Q5VQ53R3.mjs.gz +0 -0
- package/dist/chunk-RQCAXUVQ.mjs.br +0 -0
- package/dist/chunk-RQCAXUVQ.mjs.gz +0 -0
- package/dist/chunk-UP6PJEHM.js.br +0 -0
- package/dist/chunk-UP6PJEHM.js.gz +0 -0
|
@@ -186008,6 +186008,16 @@ function definePptxSearchField(registry) {
|
|
|
186008
186008
|
}
|
|
186009
186009
|
registry.define("pptx-ui-search", PptxSearchField);
|
|
186010
186010
|
}
|
|
186011
|
+
var SELECT_OPTION_ATTRIBUTES = [
|
|
186012
|
+
"value",
|
|
186013
|
+
"disabled",
|
|
186014
|
+
"label",
|
|
186015
|
+
"selected",
|
|
186016
|
+
"hidden",
|
|
186017
|
+
"data-display-label",
|
|
186018
|
+
"data-description",
|
|
186019
|
+
"style"
|
|
186020
|
+
];
|
|
186011
186021
|
function collectSelectChoices(options) {
|
|
186012
186022
|
return options.map((option) => {
|
|
186013
186023
|
const group2 = option.parentElement instanceof HTMLOptGroupElement ? option.parentElement : null;
|
|
@@ -186016,7 +186026,10 @@ function collectSelectChoices(options) {
|
|
|
186016
186026
|
label: option.label || option.textContent?.trim() || "",
|
|
186017
186027
|
disabled: option.disabled || Boolean(group2?.disabled),
|
|
186018
186028
|
hidden: Boolean(option.hidden) || Boolean(group2?.hidden),
|
|
186019
|
-
group: group2?.label ?? ""
|
|
186029
|
+
group: group2?.label ?? "",
|
|
186030
|
+
...option.dataset.displayLabel ? { displayLabel: option.dataset.displayLabel } : {},
|
|
186031
|
+
...option.dataset.description ? { description: option.dataset.description } : {},
|
|
186032
|
+
...option.style.fontFamily ? { fontFamily: option.style.fontFamily } : {}
|
|
186020
186033
|
};
|
|
186021
186034
|
});
|
|
186022
186035
|
}
|
|
@@ -186042,7 +186055,16 @@ function renderSelectMenu(menu, choices2, value) {
|
|
|
186042
186055
|
item3.setAttribute("aria-disabled", String(choice.disabled));
|
|
186043
186056
|
item3.id = `${menu.id}-${index}`;
|
|
186044
186057
|
item3.dataset.index = String(index);
|
|
186045
|
-
item3.textContent = choice.label;
|
|
186058
|
+
item3.textContent = choice.displayLabel ?? choice.label;
|
|
186059
|
+
if (choice.fontFamily) {
|
|
186060
|
+
item3.style.fontFamily = choice.fontFamily;
|
|
186061
|
+
}
|
|
186062
|
+
if (choice.description) {
|
|
186063
|
+
const description = document.createElement("span");
|
|
186064
|
+
description.className = "description";
|
|
186065
|
+
description.textContent = choice.description;
|
|
186066
|
+
item3.append(description);
|
|
186067
|
+
}
|
|
186046
186068
|
menuItems.push(item3);
|
|
186047
186069
|
});
|
|
186048
186070
|
menu.replaceChildren(...menuItems);
|
|
@@ -186056,10 +186078,11 @@ function positionSelectMenu(menu, trigger) {
|
|
|
186056
186078
|
const above = Math.max(0, rect22.top - gap - margin);
|
|
186057
186079
|
menu.style.minWidth = `${Math.min(rect22.width, width)}px`;
|
|
186058
186080
|
menu.style.maxWidth = `${width}px`;
|
|
186059
|
-
|
|
186081
|
+
const heightCap = trigger.getRootNode() instanceof ShadowRoot && trigger.getRootNode().host.getAttribute("data-font-picker") === "family" ? 320 : 240;
|
|
186082
|
+
menu.style.maxHeight = `${heightCap}px`;
|
|
186060
186083
|
const preferredHeight = menu.getBoundingClientRect().height;
|
|
186061
186084
|
const flip = below < preferredHeight && above > below;
|
|
186062
|
-
menu.style.maxHeight = `${Math.min(
|
|
186085
|
+
menu.style.maxHeight = `${Math.min(heightCap, flip ? above : below)}px`;
|
|
186063
186086
|
const { height, width: menuWidth } = menu.getBoundingClientRect();
|
|
186064
186087
|
menu.style.top = `${Math.max(margin, flip ? rect22.top - gap - height : rect22.bottom + gap)}px`;
|
|
186065
186088
|
menu.style.left = `${Math.max(margin, Math.min(rect22.left, window.innerWidth - menuWidth - margin))}px`;
|
|
@@ -186082,6 +186105,50 @@ function nextSelectActive(choices2, active2, step) {
|
|
|
186082
186105
|
}
|
|
186083
186106
|
return active2;
|
|
186084
186107
|
}
|
|
186108
|
+
var SELECT_RIBBON_STYLES = `
|
|
186109
|
+
:host([variant^="ribbon-"][disabled]) { opacity: .4; }
|
|
186110
|
+
:host([variant^="ribbon-"]) button {
|
|
186111
|
+
height: 28px; min-height: 28px; padding: 4px 8px; gap: 4px;
|
|
186112
|
+
border: 1px solid color-mix(in oklab, var(--pptx-border) 60%, transparent);
|
|
186113
|
+
border-radius: 3px; font-size: 12px; line-height: 18px;
|
|
186114
|
+
background: color-mix(in oklab, var(--pptx-background) 60%, transparent);
|
|
186115
|
+
color: var(--pptx-foreground);
|
|
186116
|
+
}
|
|
186117
|
+
:host([variant^="ribbon-"]) .value { flex: 1; min-width: 0; }
|
|
186118
|
+
:host([variant^="ribbon-"]) .chevron {
|
|
186119
|
+
width: 16px; height: 16px; margin: 0; border: 0; transform: none;
|
|
186120
|
+
}
|
|
186121
|
+
:host([variant^="ribbon-"]) .chevron svg { display: block; width: 16px; height: 16px; }
|
|
186122
|
+
:host([variant="ribbon-font"]) .chevron { color: var(--pptx-muted-foreground); }
|
|
186123
|
+
:host([variant="ribbon-font"][data-font-picker="size"]) button { padding-inline: 6px; }
|
|
186124
|
+
:host([variant="ribbon-icon"]) button {
|
|
186125
|
+
width: 36px; gap: 6px; padding: 6px 10px; border: 0; font-size: 12px; line-height: 16px;
|
|
186126
|
+
background: var(--pptx-muted); justify-content: center;
|
|
186127
|
+
}
|
|
186128
|
+
:host([variant="ribbon-icon"]) :is(.value, .chevron) { display: none; }
|
|
186129
|
+
::slotted(svg[slot="icon"]) { display: block; width: 16px; height: 16px; flex: none; }
|
|
186130
|
+
:host([variant^="ribbon-"]) button:hover:not(:disabled) { background: var(--pptx-accent); }
|
|
186131
|
+
:host([variant^="ribbon-"]) .menu {
|
|
186132
|
+
width: 192px; padding: 4px 0; border-radius: 8px; font-size: 12px; line-height: 16px;
|
|
186133
|
+
}
|
|
186134
|
+
:host([data-font-picker="family"]) .menu { width: 256px; }
|
|
186135
|
+
:host([variant^="ribbon-"]) .option {
|
|
186136
|
+
display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 0;
|
|
186137
|
+
}
|
|
186138
|
+
:host([variant^="ribbon-"]) .option[aria-selected="true"] {
|
|
186139
|
+
background: transparent; color: var(--pptx-foreground);
|
|
186140
|
+
}
|
|
186141
|
+
:host([variant^="ribbon-"]) .option:hover,
|
|
186142
|
+
:host([variant^="ribbon-"]) .option[data-active] { background: var(--pptx-muted); filter: none; }
|
|
186143
|
+
:host([variant^="ribbon-"]) .group {
|
|
186144
|
+
padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: .25px;
|
|
186145
|
+
font-size: 10px; line-height: 15px;
|
|
186146
|
+
}
|
|
186147
|
+
@media (max-width: 767px) {
|
|
186148
|
+
:host([variant^="ribbon-"]) button { height: 44px; min-height: 44px; }
|
|
186149
|
+
}
|
|
186150
|
+
.description { flex: none; color: var(--pptx-muted-foreground); font-size: 10px; line-height: 15px; }
|
|
186151
|
+
`;
|
|
186085
186152
|
var SELECT_STYLES = `
|
|
186086
186153
|
:host {
|
|
186087
186154
|
display: inline-block;
|
|
@@ -186131,6 +186198,7 @@ button:disabled { cursor: not-allowed; }
|
|
|
186131
186198
|
text-overflow: ellipsis;
|
|
186132
186199
|
white-space: nowrap;
|
|
186133
186200
|
}
|
|
186201
|
+
.chevron svg { display: none; }
|
|
186134
186202
|
.chevron {
|
|
186135
186203
|
flex: none;
|
|
186136
186204
|
width: 6px;
|
|
@@ -186199,12 +186267,53 @@ button:disabled { cursor: not-allowed; }
|
|
|
186199
186267
|
color: HighlightText;
|
|
186200
186268
|
}
|
|
186201
186269
|
}
|
|
186270
|
+
${SELECT_RIBBON_STYLES}
|
|
186202
186271
|
`;
|
|
186272
|
+
function createSelectTrigger() {
|
|
186273
|
+
const trigger = document.createElement("button");
|
|
186274
|
+
trigger.type = "button";
|
|
186275
|
+
trigger.setAttribute("part", "trigger");
|
|
186276
|
+
trigger.setAttribute("role", "combobox");
|
|
186277
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
186278
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
186279
|
+
const icon = document.createElement("slot");
|
|
186280
|
+
icon.name = "icon";
|
|
186281
|
+
const text22 = document.createElement("span");
|
|
186282
|
+
text22.className = "value";
|
|
186283
|
+
text22.setAttribute("part", "value");
|
|
186284
|
+
const chevron2 = document.createElement("span");
|
|
186285
|
+
chevron2.className = "chevron";
|
|
186286
|
+
chevron2.setAttribute("part", "indicator");
|
|
186287
|
+
chevron2.setAttribute("aria-hidden", "true");
|
|
186288
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
186289
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
186290
|
+
svg.setAttribute("fill", "none");
|
|
186291
|
+
svg.setAttribute("stroke", "currentColor");
|
|
186292
|
+
svg.setAttribute("stroke-width", "2");
|
|
186293
|
+
svg.setAttribute("stroke-linecap", "round");
|
|
186294
|
+
svg.setAttribute("stroke-linejoin", "round");
|
|
186295
|
+
const path = document.createElementNS(svg.namespaceURI, "path");
|
|
186296
|
+
path.setAttribute("d", "m6 9 6 6 6-6");
|
|
186297
|
+
svg.append(path);
|
|
186298
|
+
chevron2.append(svg);
|
|
186299
|
+
trigger.append(icon, text22, chevron2);
|
|
186300
|
+
return { trigger, text: text22 };
|
|
186301
|
+
}
|
|
186302
|
+
function prependSelectCustomSlot(host, menu) {
|
|
186303
|
+
if (host.querySelector('[slot="custom"]')) {
|
|
186304
|
+
const custom = document.createElement("slot");
|
|
186305
|
+
custom.name = "custom";
|
|
186306
|
+
menu.prepend(custom);
|
|
186307
|
+
}
|
|
186308
|
+
}
|
|
186203
186309
|
function createSelectValueElement() {
|
|
186204
186310
|
class SelectValueElement extends HTMLElement {
|
|
186205
186311
|
get value() {
|
|
186206
186312
|
const requested = this.getAttribute("value");
|
|
186207
186313
|
const options = this.options;
|
|
186314
|
+
if (this.getAttribute("variant") === "ribbon-font" && requested !== null) {
|
|
186315
|
+
return requested;
|
|
186316
|
+
}
|
|
186208
186317
|
if (requested !== null && (!options.length || options.some((option) => option.value === requested))) {
|
|
186209
186318
|
return requested;
|
|
186210
186319
|
}
|
|
@@ -186256,18 +186365,7 @@ function definePptxSelect(registry) {
|
|
|
186256
186365
|
}
|
|
186257
186366
|
const root = this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
186258
186367
|
attachControlStyles(root, SELECT_STYLES);
|
|
186259
|
-
this.trigger =
|
|
186260
|
-
this.trigger.type = "button";
|
|
186261
|
-
this.trigger.setAttribute("role", "combobox");
|
|
186262
|
-
this.trigger.setAttribute("aria-haspopup", "listbox");
|
|
186263
|
-
this.trigger.setAttribute("aria-expanded", "false");
|
|
186264
|
-
this.text = document.createElement("span");
|
|
186265
|
-
this.text.className = "value";
|
|
186266
|
-
this.text.setAttribute("part", "value");
|
|
186267
|
-
const chevron2 = document.createElement("span");
|
|
186268
|
-
chevron2.className = "chevron";
|
|
186269
|
-
chevron2.setAttribute("aria-hidden", "true");
|
|
186270
|
-
this.trigger.append(this.text, chevron2);
|
|
186368
|
+
({ trigger: this.trigger, text: this.text } = createSelectTrigger());
|
|
186271
186369
|
this.menu = document.createElement("div");
|
|
186272
186370
|
this.menu.className = "menu";
|
|
186273
186371
|
this.menu.id = `pptx-ui-select-options-${++nextSelectId}`;
|
|
@@ -186278,7 +186376,11 @@ function definePptxSelect(registry) {
|
|
|
186278
186376
|
root.append(this.trigger, this.menu);
|
|
186279
186377
|
this.trigger.addEventListener("click", () => this.open ? this.close() : this.show());
|
|
186280
186378
|
this.trigger.addEventListener("keydown", (event) => this.onKeyDown(event));
|
|
186281
|
-
this.menu.addEventListener("pointerdown", (event) =>
|
|
186379
|
+
this.menu.addEventListener("pointerdown", (event) => {
|
|
186380
|
+
if (event.target.closest("[data-index]")) {
|
|
186381
|
+
event.preventDefault();
|
|
186382
|
+
}
|
|
186383
|
+
});
|
|
186282
186384
|
this.menu.addEventListener("click", (event) => {
|
|
186283
186385
|
const target = event.target.closest("[data-index]");
|
|
186284
186386
|
if (target) {
|
|
@@ -186301,7 +186403,7 @@ function definePptxSelect(registry) {
|
|
|
186301
186403
|
subtree: true,
|
|
186302
186404
|
attributes: true,
|
|
186303
186405
|
characterData: true,
|
|
186304
|
-
attributeFilter:
|
|
186406
|
+
attributeFilter: SELECT_OPTION_ATTRIBUTES
|
|
186305
186407
|
});
|
|
186306
186408
|
this.refresh();
|
|
186307
186409
|
}
|
|
@@ -186341,7 +186443,7 @@ function definePptxSelect(registry) {
|
|
|
186341
186443
|
if (!this.hasAttribute("value") && this.choices.length) {
|
|
186342
186444
|
this.value = options.find((option) => option.selected)?.value ?? this.choices.find((choice) => !choice.disabled && !choice.hidden)?.value ?? this.choices[0].value;
|
|
186343
186445
|
}
|
|
186344
|
-
this.text.textContent = this.choices.find((choice) => choice.value === this.value)?.label ??
|
|
186446
|
+
this.text.textContent = this.choices.find((choice) => choice.value === this.value)?.displayLabel ?? this.choices.find((choice) => choice.value === this.value)?.label ?? this.value;
|
|
186345
186447
|
this.trigger.disabled = this.disabled;
|
|
186346
186448
|
if (this.disabled) {
|
|
186347
186449
|
this.close();
|
|
@@ -186354,6 +186456,7 @@ function definePptxSelect(registry) {
|
|
|
186354
186456
|
}
|
|
186355
186457
|
renderMenu() {
|
|
186356
186458
|
renderSelectMenu(this.menu, this.choices, this.value);
|
|
186459
|
+
prependSelectCustomSlot(this, this.menu);
|
|
186357
186460
|
markSelectActive(this.menu, this.trigger, this.active, this.open);
|
|
186358
186461
|
}
|
|
186359
186462
|
show() {
|
|
@@ -221703,9 +221806,6 @@ function buildThemeColorGrid(colorScheme, translate) {
|
|
|
221703
221806
|
}))
|
|
221704
221807
|
);
|
|
221705
221808
|
}
|
|
221706
|
-
function themeColorLabel(key2, translate) {
|
|
221707
|
-
return translate ? schemaLabel(THEME_COLOR_SLOT_LABEL_KEYS, key2, translate) : THEME_COLOR_LABELS[key2];
|
|
221708
|
-
}
|
|
221709
221809
|
function placeCaretAtEnd(el) {
|
|
221710
221810
|
const doc = el.ownerDocument;
|
|
221711
221811
|
const win = doc.defaultView;
|
|
@@ -239371,7 +239471,7 @@ var PRESET_THEMES = [
|
|
|
239371
239471
|
minorFont: "Gill Sans MT"
|
|
239372
239472
|
}
|
|
239373
239473
|
];
|
|
239374
|
-
PRESET_THEMES[0].colorScheme;
|
|
239474
|
+
var DEFAULT_THEME_COLOR_SCHEME = PRESET_THEMES[0].colorScheme;
|
|
239375
239475
|
var COMMON_FONTS = [
|
|
239376
239476
|
"Arial",
|
|
239377
239477
|
"Calibri",
|
|
@@ -243847,6 +243947,8 @@ function resolveCustomization(customization) {
|
|
|
243847
243947
|
hiddenBackstagePages: pages,
|
|
243848
243948
|
hiddenBackstageCards: cards,
|
|
243849
243949
|
hiddenElementCommands: elementCommands,
|
|
243950
|
+
extraElementCommands: c.contextMenu?.extraElementCommands ?? [],
|
|
243951
|
+
extraCanvasCommands: c.contextMenu?.extraCanvasCommands ?? [],
|
|
243850
243952
|
hiddenCanvasCommands: new Set(c.contextMenu?.hiddenCanvasCommands ?? []),
|
|
243851
243953
|
hiddenEditPointsCommands: new Set(c.contextMenu?.hiddenEditPointsCommands ?? []),
|
|
243852
243954
|
hiddenDrawingTools: new Set(c.hiddenDrawingTools ?? []),
|
|
@@ -243963,6 +244065,38 @@ function createCustomizationController(initial) {
|
|
|
243963
244065
|
subscribe: (listener) => store.subscribe(listener)
|
|
243964
244066
|
};
|
|
243965
244067
|
}
|
|
244068
|
+
function withHostMenuCommands(entries2, commands, context) {
|
|
244069
|
+
const top = [];
|
|
244070
|
+
const bottom = [];
|
|
244071
|
+
const seen = /* @__PURE__ */ new Set();
|
|
244072
|
+
for (const command of commands) {
|
|
244073
|
+
if (!command.id || seen.has(command.id)) {
|
|
244074
|
+
continue;
|
|
244075
|
+
}
|
|
244076
|
+
seen.add(command.id);
|
|
244077
|
+
const disabled = typeof command.disabled === "function" ? command.disabled(context) : command.disabled === true;
|
|
244078
|
+
const entry5 = {
|
|
244079
|
+
id: `host:${command.id}`,
|
|
244080
|
+
host: true,
|
|
244081
|
+
label: command.label,
|
|
244082
|
+
labelKey: "",
|
|
244083
|
+
disabled,
|
|
244084
|
+
onSelect: () => {
|
|
244085
|
+
if (!disabled) {
|
|
244086
|
+
command.onSelect(context);
|
|
244087
|
+
}
|
|
244088
|
+
}
|
|
244089
|
+
};
|
|
244090
|
+
(command.group === "bottom" ? bottom : top).push(entry5);
|
|
244091
|
+
}
|
|
244092
|
+
const middle = entries2.map(
|
|
244093
|
+
(entry5, i2) => i2 === 0 ? { ...entry5, separatorBefore: top.length > 0 } : entry5
|
|
244094
|
+
);
|
|
244095
|
+
if (bottom.length > 0 && top.length + middle.length > 0) {
|
|
244096
|
+
bottom[0].separatorBefore = true;
|
|
244097
|
+
}
|
|
244098
|
+
return [...top, ...middle, ...bottom];
|
|
244099
|
+
}
|
|
243966
244100
|
function optionsSettingIdOf(control) {
|
|
243967
244101
|
return `${control.group}.${control.key}`;
|
|
243968
244102
|
}
|
|
@@ -244020,17 +244154,23 @@ function filterMenuEntries(entries2, hidden) {
|
|
|
244020
244154
|
}
|
|
244021
244155
|
return result;
|
|
244022
244156
|
}
|
|
244023
|
-
function customizeContextMenuEntries(entries2, resolved) {
|
|
244157
|
+
function customizeContextMenuEntries(entries2, resolved, context) {
|
|
244024
244158
|
if (!resolved.elementMenuEnabled) {
|
|
244025
244159
|
return [];
|
|
244026
244160
|
}
|
|
244027
|
-
|
|
244161
|
+
const built = filterMenuEntries(entries2, resolved.hiddenElementCommands);
|
|
244162
|
+
return context ? withHostMenuCommands(
|
|
244163
|
+
built,
|
|
244164
|
+
resolved.extraElementCommands ?? [],
|
|
244165
|
+
Object.freeze({ ...context, elementIds: Object.freeze([...context.elementIds]) })
|
|
244166
|
+
) : built;
|
|
244028
244167
|
}
|
|
244029
|
-
function customizeCanvasContextMenuEntries(entries2, resolved) {
|
|
244168
|
+
function customizeCanvasContextMenuEntries(entries2, resolved, context) {
|
|
244030
244169
|
if (!resolved.canvasMenuEnabled) {
|
|
244031
244170
|
return [];
|
|
244032
244171
|
}
|
|
244033
|
-
|
|
244172
|
+
const built = filterMenuEntries(entries2, resolved.hiddenCanvasCommands);
|
|
244173
|
+
return context ? withHostMenuCommands(built, resolved.extraCanvasCommands ?? [], Object.freeze({ ...context })) : built;
|
|
244034
244174
|
}
|
|
244035
244175
|
function isBackstagePageVisible(resolved, page) {
|
|
244036
244176
|
return !resolved.hiddenBackstagePages.has(page);
|
|
@@ -253386,6 +253526,568 @@ var RECORD_COMMAND_GROUPS = [
|
|
|
253386
253526
|
]
|
|
253387
253527
|
}
|
|
253388
253528
|
];
|
|
253529
|
+
var EDITOR_ARRANGE_CSS = `
|
|
253530
|
+
@media (min-width: 768px) {
|
|
253531
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
|
|
253532
|
+
[data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"],
|
|
253533
|
+
[data-pptx-chrome="flip-controls"], [data-pptx-chrome="group-controls"]
|
|
253534
|
+
) { display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0; background: var(--pptx-muted); border-radius: 3px; }
|
|
253535
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
|
|
253536
|
+
[data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
|
|
253537
|
+
) > button {
|
|
253538
|
+
display: inline-flex; align-items: center; justify-content: center; flex: none;
|
|
253539
|
+
box-sizing: border-box; width: 36px; height: 28px; padding: 6px 10px;
|
|
253540
|
+
border: 0; border-radius: 3px; font-size: 12px; line-height: 16px; gap: 6px;
|
|
253541
|
+
color: var(--pptx-foreground); background: var(--pptx-muted);
|
|
253542
|
+
}
|
|
253543
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="distribute-controls"] > button:first-child { width: 37px; border-right: 1px solid var(--pptx-border); }
|
|
253544
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
|
|
253545
|
+
[data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
|
|
253546
|
+
) > button:disabled { opacity: .4; }
|
|
253547
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
|
|
253548
|
+
[data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
|
|
253549
|
+
) svg { width: 16px; height: 16px; flex: none; }
|
|
253550
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] {
|
|
253551
|
+
display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0;
|
|
253552
|
+
background: var(--pptx-muted); border-radius: 3px;
|
|
253553
|
+
}
|
|
253554
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop"] {
|
|
253555
|
+
box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
|
|
253556
|
+
width: 37px; height: 28px; padding: 6px 10px; margin: 0;
|
|
253557
|
+
border: 0; border-right: 1px solid var(--pptx-border); border-radius: 0; background: transparent;
|
|
253558
|
+
}
|
|
253559
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop-menu"] {
|
|
253560
|
+
box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
|
|
253561
|
+
width: 32px; height: 24px; min-height: 24px; padding: 6px 10px; margin: 0;
|
|
253562
|
+
border: 0; border-radius: 0; background: transparent; color: var(--pptx-foreground);
|
|
253563
|
+
font-size: 12px; line-height: 16px; gap: normal;
|
|
253564
|
+
}
|
|
253565
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop-menu"] svg { width: 12px; height: 12px; }
|
|
253566
|
+
}
|
|
253567
|
+
`;
|
|
253568
|
+
var EDITOR_CLUSTER_CSS = `
|
|
253569
|
+
@media (min-width: 768px) {
|
|
253570
|
+
[data-pptx-editor-chrome] [data-ribbon-group="home.clipboard"] > :first-child,
|
|
253571
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="paragraph-controls"] [data-pptx-chrome="control-cluster"],
|
|
253572
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="editing-controls"] [data-pptx-chrome="control-cluster"],
|
|
253573
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="order-controls"],
|
|
253574
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253575
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253576
|
+
) { background: var(--pptx-muted); border-radius: 3px; }
|
|
253577
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="paragraph-controls"] [data-pptx-chrome="control-cluster"] {
|
|
253578
|
+
display: inline-flex; align-items: center; gap: 0; overflow: hidden;
|
|
253579
|
+
}
|
|
253580
|
+
[data-pptx-editor-chrome] :is([data-pptx-chrome="paragraph-controls"], [data-pptx-chrome="editing-controls"])
|
|
253581
|
+
[data-pptx-chrome="control-cluster"] > button { margin-right: 0; }
|
|
253582
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is(
|
|
253583
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253584
|
+
) [data-pptx-chrome="gallery-caret"] { padding: 0 2px; }
|
|
253585
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="distribute-controls"] > button {
|
|
253586
|
+
border-radius: 0; background: transparent; gap: normal;
|
|
253587
|
+
}
|
|
253588
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"]
|
|
253589
|
+
[data-pptx-ribbon-control="crop"] { gap: normal; }
|
|
253590
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
|
|
253591
|
+
[data-ribbon-control="home.drawing.shapes"], [data-ribbon-control="home.drawing.arrange"]
|
|
253592
|
+
) > button:first-child > svg:first-of-type { order: -1; }
|
|
253593
|
+
}
|
|
253594
|
+
`;
|
|
253595
|
+
var EDITOR_CONTROLS_CSS = `
|
|
253596
|
+
@media (min-width: 768px) {
|
|
253597
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="home-content"] { gap: 0; }
|
|
253598
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-group^="home."] { gap: 2px; }
|
|
253599
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"]
|
|
253600
|
+
[data-ribbon-control^="home."]:not(button, input, select, pptx-ui-select) {
|
|
253601
|
+
display: inline-flex; align-items: center; line-height: 16px;
|
|
253602
|
+
}
|
|
253603
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="home-group"] {
|
|
253604
|
+
gap: 2px; padding: 0 4px 0 0; margin-right: 4px;
|
|
253605
|
+
border-right: 1px solid color-mix(in oklab, var(--pptx-border) 40%, transparent);
|
|
253606
|
+
}
|
|
253607
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253608
|
+
button[data-ribbon-control^="home."],
|
|
253609
|
+
[data-ribbon-control^="home."] > button,
|
|
253610
|
+
[data-ribbon-control^="home."] > span > button
|
|
253611
|
+
) {
|
|
253612
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
253613
|
+
box-sizing: border-box; height: 28px; padding: 6px 10px; min-width: 0; width: auto;
|
|
253614
|
+
border: 0; border-radius: 3px; font-size: 12px; line-height: 16px;
|
|
253615
|
+
color: var(--pptx-foreground); background: var(--pptx-muted); gap: 6px;
|
|
253616
|
+
}
|
|
253617
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253618
|
+
button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
|
|
253619
|
+
):disabled { opacity: 0.4; }
|
|
253620
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253621
|
+
button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
|
|
253622
|
+
):hover:not(:disabled) { background: var(--pptx-accent); }
|
|
253623
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253624
|
+
button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
|
|
253625
|
+
)[aria-pressed="true"] { background: var(--pptx-accent); }
|
|
253626
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253627
|
+
button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
|
|
253628
|
+
) svg { width: 16px; height: 16px; flex: none; }
|
|
253629
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] {
|
|
253630
|
+
display: flex; align-items: center; gap: 4px;
|
|
253631
|
+
}
|
|
253632
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls-fragment"] { display: contents; }
|
|
253633
|
+
[data-pptx-editor-chrome] [data-ribbon-group="home.clipboard"] > :first-child { gap: 0; }
|
|
253634
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slides-controls"] {
|
|
253635
|
+
display: flex; align-items: center; gap: 4px;
|
|
253636
|
+
}
|
|
253637
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slides-controls"] > [data-pptx-chrome="slides-buttons"] { display: contents; }
|
|
253638
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="split-button"] {
|
|
253639
|
+
position: relative; display: inline-flex; align-items: center; gap: 0;
|
|
253640
|
+
padding: 0; border: 0; border-radius: 3px; background: transparent;
|
|
253641
|
+
}
|
|
253642
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="split-segment"] {
|
|
253643
|
+
display: inline-flex; align-items: center; padding: 0; border: 0; border-radius: 0;
|
|
253644
|
+
}
|
|
253645
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-button"]:has([data-pptx-chrome="split-caret"]:not([hidden])) [data-pptx-chrome="split-main"] {
|
|
253646
|
+
border-top-right-radius: 0; border-bottom-right-radius: 0;
|
|
253647
|
+
}
|
|
253648
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-main"] {
|
|
253649
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
253650
|
+
height: 28px; padding: 6px 10px; gap: 6px; border: 0; border-radius: 3px; font-size: 12px; line-height: 16px;
|
|
253651
|
+
background: var(--pptx-muted); color: var(--pptx-foreground);
|
|
253652
|
+
}
|
|
253653
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-caret"] {
|
|
253654
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
253655
|
+
box-sizing: border-box; height: 28px; width: 36px; min-width: 36px; max-width: 36px;
|
|
253656
|
+
padding: 6px 8px; margin: 0; border: 0; border-radius: 0 3px 3px 0;
|
|
253657
|
+
font-size: 12px; line-height: 16px; background: var(--pptx-muted); color: var(--pptx-foreground);
|
|
253658
|
+
border-left: 1px solid color-mix(in oklab, var(--pptx-border) 40%, transparent);
|
|
253659
|
+
}
|
|
253660
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="split-caret"] svg { display: block; flex: none; width: 16px; height: 16px; margin: 0; }
|
|
253661
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is([data-pptx-chrome="split-main"], [data-pptx-chrome="split-caret"]):hover:not(:disabled) {
|
|
253662
|
+
background: var(--pptx-accent);
|
|
253663
|
+
}
|
|
253664
|
+
}
|
|
253665
|
+
`;
|
|
253666
|
+
var EDITOR_FONT_PICKER_CSS = `
|
|
253667
|
+
@media (min-width: 768px) {
|
|
253668
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-groups"] { display: contents; }
|
|
253669
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-picker-controls"] {
|
|
253670
|
+
display: flex; align-items: center; gap: 4px;
|
|
253671
|
+
}
|
|
253672
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="control-cluster"] {
|
|
253673
|
+
display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0;
|
|
253674
|
+
}
|
|
253675
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-pptx-chrome="control-cluster"] {
|
|
253676
|
+
background: var(--pptx-muted); border-radius: 3px; overflow: hidden;
|
|
253677
|
+
}
|
|
253678
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] :is(
|
|
253679
|
+
[data-ribbon-control^="home.font."] > div > button,
|
|
253680
|
+
[data-ribbon-control^="home.font."] > button,
|
|
253681
|
+
button[data-ribbon-control^="home.font."]
|
|
253682
|
+
) { flex: none; box-sizing: border-box; height: 28px; width: 36px; padding: 6px 10px; gap: 6px; }
|
|
253683
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] :is([data-ribbon-control$="Color"] > button:first-child, [data-ribbon-control$="Color"] > div:first-child > button:first-child, [data-ribbon-control$="Color"] > span:first-child > button:first-child) {
|
|
253684
|
+
width: 58px; flex-direction: row;
|
|
253685
|
+
}
|
|
253686
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control$="Color"] [data-pptx-chrome="color-swatch"] {
|
|
253687
|
+
box-sizing: border-box; display: block; width: 16px; height: 4px; margin: -2px 0 0;
|
|
253688
|
+
border: 0; border-radius: 2px; flex: none;
|
|
253689
|
+
}
|
|
253690
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button {
|
|
253691
|
+
display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 3px;
|
|
253692
|
+
font-size: 12px; line-height: 16px; background: var(--pptx-muted); color: var(--pptx-foreground);
|
|
253693
|
+
}
|
|
253694
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button:disabled { opacity: .4; }
|
|
253695
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button svg { width: 16px; height: 16px; }
|
|
253696
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253697
|
+
[data-ribbon-control="home.font.fontFamily"], [data-ribbon-control="home.font.fontSize"]
|
|
253698
|
+
) {
|
|
253699
|
+
--pptx-editor-font-picker-width: 120px;
|
|
253700
|
+
box-sizing: border-box; flex: none; display: inline-flex; align-items: center; height: 28px;
|
|
253701
|
+
width: var(--pptx-editor-font-picker-width);
|
|
253702
|
+
min-width: var(--pptx-editor-font-picker-width);
|
|
253703
|
+
max-width: var(--pptx-editor-font-picker-width);
|
|
253704
|
+
}
|
|
253705
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.font.fontSize"] {
|
|
253706
|
+
--pptx-editor-font-picker-width: 64px;
|
|
253707
|
+
font-variant-numeric: tabular-nums;
|
|
253708
|
+
}
|
|
253709
|
+
}
|
|
253710
|
+
`;
|
|
253711
|
+
var EDITOR_HOME_LAYOUT_CSS = `
|
|
253712
|
+
@media (min-width: 768px) {
|
|
253713
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="control-fragment"] { display: contents; }
|
|
253714
|
+
[data-pptx-editor-chrome] pptx-ui-select[variant="ribbon-icon"] {
|
|
253715
|
+
flex: none; width: 36px; min-width: 36px; max-width: 36px;
|
|
253716
|
+
}
|
|
253717
|
+
[data-pptx-editor-chrome] :is([data-pptx-chrome="paragraph-controls"], [data-pptx-chrome="drawing-controls"], [data-pptx-chrome="arrange-controls"], [data-pptx-chrome="editing-controls"]) {
|
|
253718
|
+
display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
|
|
253719
|
+
}
|
|
253720
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="list-controls"] {
|
|
253721
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
253722
|
+
border: 0; padding: 0; background: transparent;
|
|
253723
|
+
}
|
|
253724
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="paragraph-controls"] :is(
|
|
253725
|
+
[data-ribbon-control="home.paragraph.decreaseIndent"],
|
|
253726
|
+
[data-ribbon-control="home.paragraph.alignLeft"],
|
|
253727
|
+
[data-ribbon-control="home.paragraph.alignCenter"],
|
|
253728
|
+
[data-ribbon-control="home.paragraph.alignRight"]
|
|
253729
|
+
) { margin-right: -4px; }
|
|
253730
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="paragraph-controls"] [data-pptx-chrome="control-cluster"] { display: contents; }
|
|
253731
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253732
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253733
|
+
) { display: inline-flex; align-items: center; gap: 0; }
|
|
253734
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253735
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253736
|
+
) > button:first-child { width: 36px; height: 28px; border-radius: 3px; }
|
|
253737
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is(
|
|
253738
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253739
|
+
) [data-pptx-chrome="gallery-caret"] {
|
|
253740
|
+
box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
|
|
253741
|
+
width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0 2px;
|
|
253742
|
+
border: 0; border-radius: 0; background: transparent; color: var(--pptx-foreground); gap: normal; font-size: 12px; line-height: 16px;
|
|
253743
|
+
}
|
|
253744
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
|
|
253745
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253746
|
+
) [data-pptx-chrome="gallery-caret"] svg { width: 12px; height: 12px; }
|
|
253747
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="home-content"] > .pptx-svelte-hometab-sep {
|
|
253748
|
+
width: 1px; height: 20px; align-self: center; margin: 0 4px;
|
|
253749
|
+
background: color-mix(in oklab, var(--pptx-border) 40%, transparent);
|
|
253750
|
+
}
|
|
253751
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="editing-controls"] [data-pptx-chrome="control-cluster"],
|
|
253752
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="order-controls"] {
|
|
253753
|
+
display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0;
|
|
253754
|
+
}
|
|
253755
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="editing-controls"] > button[data-ribbon-control="home.editing.find"] { margin-right: -4px; }
|
|
253756
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="ribbon-inline-label"] { display: none; }
|
|
253757
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapes"] { order: 1; }
|
|
253758
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.arrange"] { order: 2; }
|
|
253759
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeFill"] { order: 3; }
|
|
253760
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeOutline"] { order: 4; }
|
|
253761
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.quickStyles"] { order: 5; }
|
|
253762
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeEffects"] { order: 6; }
|
|
253763
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="drawing-controls"] :is(
|
|
253764
|
+
[data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
|
|
253765
|
+
) :is(button:first-child, button svg) { flex: none; }
|
|
253766
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
|
|
253767
|
+
[data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
|
|
253768
|
+
) > button:first-child,
|
|
253769
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
|
|
253770
|
+
[data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
|
|
253771
|
+
) > div:first-child > button:first-child {
|
|
253772
|
+
display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px;
|
|
253773
|
+
padding: 6px 10px; border: 0; border-radius: 3px; background: var(--pptx-muted);
|
|
253774
|
+
}
|
|
253775
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="color-swatch"] { display: none; }
|
|
253776
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
|
|
253777
|
+
[data-ribbon-control="home.drawing.shapes"], [data-ribbon-control="home.drawing.arrange"]
|
|
253778
|
+
) > button:first-child > svg:nth-of-type(2) { display: none; }
|
|
253779
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
|
|
253780
|
+
[data-ribbon-control="home.drawing.quickStyles"], [data-ribbon-control="home.drawing.shapeEffects"]
|
|
253781
|
+
) > button > svg:last-child { width: 16px; height: 16px; }
|
|
253782
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] .pptx-rb-sep { display: none; }
|
|
253783
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="arrange-extras"] { display: contents; }
|
|
253784
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-ribbon-control="home.arrange.outlineWidth"] { order: 1; }
|
|
253785
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="order-controls"] { order: 2; }
|
|
253786
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
|
|
253787
|
+
[data-ribbon-control="home.arrange.duplicate"], [data-ribbon-control="home.arrange.delete"]
|
|
253788
|
+
) { order: 3; }
|
|
253789
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] > [data-pptx-chrome="duplicate-controls"] { display: contents; }
|
|
253790
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.outlineWidth"] {
|
|
253791
|
+
box-sizing: border-box; flex: none; width: 52px; height: 26px; padding: 0 4px;
|
|
253792
|
+
border: 1px solid var(--pptx-border); border-radius: 3px; background: var(--pptx-muted);
|
|
253793
|
+
font-size: 11px; line-height: 16px; color: var(--pptx-foreground); text-align: center;
|
|
253794
|
+
}
|
|
253795
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.outlineWidth"]:disabled { opacity: .4; }
|
|
253796
|
+
[data-pptx-editor-chrome] [data-ribbon-group="home.editing"][data-pptx-chrome="home-group"] { padding-right: 0; margin-right: 0; border-right: 0; }
|
|
253797
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="list-controls"] > :is(
|
|
253798
|
+
[data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
|
|
253799
|
+
) > div { border: 0; }
|
|
253800
|
+
}
|
|
253801
|
+
`;
|
|
253802
|
+
var EDITOR_INSPECTOR_CSS = `
|
|
253803
|
+
@media (min-width: 768px) {
|
|
253804
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector"] {
|
|
253805
|
+
background: var(--pptx-background); color: var(--pptx-foreground);
|
|
253806
|
+
font-size: 12px; line-height: 18px; border-left: 1px solid var(--pptx-border);
|
|
253807
|
+
}
|
|
253808
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-header"] {
|
|
253809
|
+
display: flex; align-items: center; gap: 4px;
|
|
253810
|
+
padding: 8px; border-bottom: 1px solid var(--pptx-border);
|
|
253811
|
+
}
|
|
253812
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-tabs"] {
|
|
253813
|
+
display: flex; gap: 2px; padding: 2px; border: 0; border-radius: 4px;
|
|
253814
|
+
background: color-mix(in oklab, var(--pptx-muted) 50%, transparent);
|
|
253815
|
+
flex: 1; min-width: 0;
|
|
253816
|
+
}
|
|
253817
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-tabs"] button {
|
|
253818
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
253819
|
+
gap: 4px; padding: 4px; min-height: 28px; border: 0; border-radius: 2px;
|
|
253820
|
+
font-size: 11px; line-height: 16.5px; font-weight: 500;
|
|
253821
|
+
background: transparent; color: var(--pptx-muted-foreground);
|
|
253822
|
+
}
|
|
253823
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-tabs"] svg { width: 14px; height: 14px; flex: none; }
|
|
253824
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-header"] > button { flex: none; width: 28px; height: 28px; }
|
|
253825
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-tabs"] button[aria-selected="true"] {
|
|
253826
|
+
background: var(--pptx-primary); color: var(--pptx-primary-foreground);
|
|
253827
|
+
}
|
|
253828
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector-body"] { padding: 12px 10px; }
|
|
253829
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="deck-properties"] {
|
|
253830
|
+
display: flex; flex-direction: column; gap: 12px;
|
|
253831
|
+
}
|
|
253832
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="deck-properties"] > * { margin: 0; }
|
|
253833
|
+
[data-pptx-editor-chrome] :is([data-pptx-chrome="inspector-card"], .pptx-editor-card) {
|
|
253834
|
+
border: 1px solid var(--pptx-border); border-radius: 4px;
|
|
253835
|
+
padding: 8px; background: var(--pptx-card); font-size: 12px; line-height: 18px;
|
|
253836
|
+
}
|
|
253837
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="inspector"] [data-pptx-chrome="deck-properties"] :is([data-pptx-chrome="inspector-card"], .pptx-editor-card) {
|
|
253838
|
+
padding: 8px; border: 1px solid var(--pptx-border);
|
|
253839
|
+
}
|
|
253840
|
+
[data-pptx-editor-chrome] :is([data-pptx-chrome="inspector-heading"], .pptx-editor-heading) {
|
|
253841
|
+
margin: 0 0 8px; font-size: 11px; line-height: 16.5px; font-weight: 400;
|
|
253842
|
+
letter-spacing: 0.275px; text-transform: uppercase; color: var(--pptx-muted-foreground);
|
|
253843
|
+
}
|
|
253844
|
+
[data-pptx-editor-chrome] .pptx-editor-presentation-card { display: block; }
|
|
253845
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] {
|
|
253846
|
+
display: grid; gap: 6px; font-size: 11px; line-height: 18px;
|
|
253847
|
+
}
|
|
253848
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] > * {
|
|
253849
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
253850
|
+
gap: 8px; padding: 0; margin: 0; font-size: 11px; line-height: 18px;
|
|
253851
|
+
}
|
|
253852
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] > * > span { flex-shrink: 0; order: 0; }
|
|
253853
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] pptx-ui-checkbox { order: 1; }
|
|
253854
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] pptx-ui-select {
|
|
253855
|
+
flex: none; width: 112px; height: 28px; min-height: 28px;
|
|
253856
|
+
}
|
|
253857
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="presentation-fields"] input[type="number"] {
|
|
253858
|
+
width: 64px; height: 22.5px; min-height: 22.5px;
|
|
253859
|
+
}
|
|
253860
|
+
[data-pptx-editor-chrome] :is([data-pptx-chrome="inspector-card"], .pptx-editor-card) :is(input:not([type="checkbox"]):not([type="color"]), select) {
|
|
253861
|
+
box-sizing: border-box; max-width: 100%; border: 1px solid var(--pptx-border);
|
|
253862
|
+
border-radius: 4px; padding: 2px 6px; font-size: 11px; line-height: 16.5px;
|
|
253863
|
+
background: var(--pptx-muted); color: var(--pptx-foreground);
|
|
253864
|
+
}
|
|
253865
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="theme-editor"] {
|
|
253866
|
+
position: absolute; right: 0; top: 0; z-index: 30; width: 288px; height: 100%;
|
|
253867
|
+
box-sizing: border-box; overflow-y: auto; padding: 10px;
|
|
253868
|
+
background: var(--pptx-card); color: var(--pptx-foreground);
|
|
253869
|
+
border-left: 1px solid var(--pptx-border); box-shadow: -8px 0 24px rgb(0 0 0 / 15%);
|
|
253870
|
+
}
|
|
253871
|
+
}
|
|
253872
|
+
@media (max-width: 767px) {
|
|
253873
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="theme-editor"] {
|
|
253874
|
+
position: absolute; inset: auto 0 0; z-index: 30; width: 100%; max-height: 60%;
|
|
253875
|
+
box-sizing: border-box; overflow-y: auto; padding: 10px;
|
|
253876
|
+
border-top: 1px solid var(--pptx-border); border-radius: 12px 12px 0 0;
|
|
253877
|
+
background: var(--pptx-card); color: var(--pptx-foreground);
|
|
253878
|
+
}
|
|
253879
|
+
}
|
|
253880
|
+
`;
|
|
253881
|
+
var EDITOR_LAYOUT_CSS = `
|
|
253882
|
+
[data-pptx-editor-chrome] [data-pptx-chrome][hidden] { display: none !important; }
|
|
253883
|
+
@media (min-width: 768px) {
|
|
253884
|
+
[data-pptx-editor-chrome] [data-pptx-title-bar] {
|
|
253885
|
+
background: color-mix(in oklab, var(--pptx-secondary) 80%, transparent);
|
|
253886
|
+
border-bottom-color: color-mix(in oklab, var(--pptx-border) 60%, transparent);
|
|
253887
|
+
}
|
|
253888
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="body"] {
|
|
253889
|
+
position: relative; display: flex; flex: 1; min-width: 0; min-height: 0;
|
|
253890
|
+
}
|
|
253891
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="body"] [data-pptx-viewport] {
|
|
253892
|
+
background: var(--pptx-background);
|
|
253893
|
+
}
|
|
253894
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slides"] {
|
|
253895
|
+
flex-shrink: 0; min-width: 0; box-sizing: border-box;
|
|
253896
|
+
background: color-mix(in oklab, var(--pptx-secondary) 30%, transparent);
|
|
253897
|
+
border-right: 1px solid var(--pptx-border);
|
|
253898
|
+
}
|
|
253899
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-footer"] {
|
|
253900
|
+
padding: 6px 8px; border-top: 1px solid color-mix(in oklab, var(--pptx-border) 60%, transparent);
|
|
253901
|
+
}
|
|
253902
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-footer"] > button {
|
|
253903
|
+
width: 100%; display: flex; justify-content: center; align-items: center;
|
|
253904
|
+
gap: 4px; padding: 4px 8px; font-size: 11px; line-height: 16.5px;
|
|
253905
|
+
border: 0; background: transparent; color: var(--pptx-muted-foreground);
|
|
253906
|
+
}
|
|
253907
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="notes"] {
|
|
253908
|
+
flex: none; width: 100%; margin: 0; box-sizing: border-box;
|
|
253909
|
+
border-top: 1px solid color-mix(in oklab, var(--pptx-border) 60%, transparent);
|
|
253910
|
+
background: var(--pptx-background);
|
|
253911
|
+
}
|
|
253912
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="notes-host"] {
|
|
253913
|
+
padding: 0; border: 0; background: transparent;
|
|
253914
|
+
}
|
|
253915
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="notes-header"] {
|
|
253916
|
+
display: flex; align-items: center; gap: 6px; width: 100%;
|
|
253917
|
+
box-sizing: border-box; padding: 4px 12px; min-height: 24.5px;
|
|
253918
|
+
border: 0; background: transparent; color: var(--pptx-muted-foreground);
|
|
253919
|
+
font-size: 11px; line-height: 16.5px; font-weight: 500;
|
|
253920
|
+
}
|
|
253921
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="notes-header"] svg { width: 12px; height: 12px; }
|
|
253922
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="notes-header"]:hover { color: var(--pptx-foreground); }
|
|
253923
|
+
}
|
|
253924
|
+
`;
|
|
253925
|
+
var EDITOR_RIBBON_CSS = `
|
|
253926
|
+
@media (min-width: 768px) {
|
|
253927
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] {
|
|
253928
|
+
background: color-mix(in oklab, var(--pptx-secondary) 50%, transparent);
|
|
253929
|
+
color: var(--pptx-foreground); border-bottom: 1px solid var(--pptx-border);
|
|
253930
|
+
}
|
|
253931
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-primary"] {
|
|
253932
|
+
min-height: 32px; height: 32px; padding: 2px 6px; gap: 2px;
|
|
253933
|
+
border: 0; box-sizing: border-box;
|
|
253934
|
+
}
|
|
253935
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] {
|
|
253936
|
+
display: flex; align-items: center; height: 35px; min-height: 35px;
|
|
253937
|
+
gap: 0; padding: 0 4px; box-sizing: border-box;
|
|
253938
|
+
border-top: 0; border-bottom: 1px solid var(--pptx-border);
|
|
253939
|
+
}
|
|
253940
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] [role="tablist"] {
|
|
253941
|
+
gap: 0; padding: 0; border: 0;
|
|
253942
|
+
}
|
|
253943
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tab-scroll"] {
|
|
253944
|
+
display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
|
|
253945
|
+
height: 35px; align-self: flex-start; align-items: flex-start; margin-bottom: -1px;
|
|
253946
|
+
padding: 0; gap: 0; border: 0; scrollbar-width: none;
|
|
253947
|
+
}
|
|
253948
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"]:has([data-pptx-chrome="ribbon-tab-scroll"]) { overflow: visible; }
|
|
253949
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] [role="tab"] {
|
|
253950
|
+
position: relative; height: 34px; padding: 8px 14px;
|
|
253951
|
+
border: 0; border-radius: 0; font-size: 12px; line-height: 18px;
|
|
253952
|
+
font-weight: 500; white-space: nowrap; background: transparent;
|
|
253953
|
+
color: var(--pptx-muted-foreground);
|
|
253954
|
+
}
|
|
253955
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] [role="tab"][aria-selected="true"] {
|
|
253956
|
+
color: var(--pptx-foreground);
|
|
253957
|
+
}
|
|
253958
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] [role="tab"]::after { content: none; }
|
|
253959
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-tabs"] [role="tab"][aria-selected="true"]::after {
|
|
253960
|
+
content: ""; position: absolute; bottom: -1px; left: 0; right: 0;
|
|
253961
|
+
height: 2.5px; background: var(--pptx-primary);
|
|
253962
|
+
}
|
|
253963
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] {
|
|
253964
|
+
min-height: 82px; padding: 2px 4px; gap: 0; box-sizing: border-box;
|
|
253965
|
+
}
|
|
253966
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-group-label"] {
|
|
253967
|
+
font-size: 9px; line-height: 9px; font-weight: 400;
|
|
253968
|
+
color: var(--pptx-muted-foreground); text-align: center;
|
|
253969
|
+
}
|
|
253970
|
+
}
|
|
253971
|
+
`;
|
|
253972
|
+
var EDITOR_VIEWPORT_FIT = {
|
|
253973
|
+
fitPadding: { horizontal: 4, vertical: 16 },
|
|
253974
|
+
maxFitScale: 1
|
|
253975
|
+
};
|
|
253976
|
+
var EDITOR_SLIDE_RAIL_WIDTH = 180;
|
|
253977
|
+
var EDITOR_THUMBNAIL_WIDTH = 132;
|
|
253978
|
+
var EDITOR_THUMBNAIL_ROW_CHROME = 6;
|
|
253979
|
+
var EDITOR_THUMBNAIL_GAP = 4;
|
|
253980
|
+
var EDITOR_THUMBNAIL_NUMBER_HEIGHT = 15;
|
|
253981
|
+
function editorThumbnailWidth(railWidth = EDITOR_SLIDE_RAIL_WIDTH) {
|
|
253982
|
+
return Math.max(1, railWidth - (EDITOR_SLIDE_RAIL_WIDTH - EDITOR_THUMBNAIL_WIDTH));
|
|
253983
|
+
}
|
|
253984
|
+
function editorThumbnailHeight(canvasWidth, canvasHeight, width = EDITOR_THUMBNAIL_WIDTH) {
|
|
253985
|
+
return Math.max(1, canvasHeight) * (width / Math.max(1, canvasWidth));
|
|
253986
|
+
}
|
|
253987
|
+
function editorThumbnailStep(canvasWidth, canvasHeight, width = EDITOR_THUMBNAIL_WIDTH) {
|
|
253988
|
+
const contentHeight2 = Math.max(
|
|
253989
|
+
editorThumbnailHeight(canvasWidth, canvasHeight, width) + 2,
|
|
253990
|
+
EDITOR_THUMBNAIL_NUMBER_HEIGHT
|
|
253991
|
+
);
|
|
253992
|
+
return contentHeight2 + (EDITOR_THUMBNAIL_ROW_CHROME - 2) + EDITOR_THUMBNAIL_GAP;
|
|
253993
|
+
}
|
|
253994
|
+
var CURRENT_SLIDE = ':is([aria-current="true"], [aria-current="page"])';
|
|
253995
|
+
var EDITOR_THUMBNAIL_CSS = `
|
|
253996
|
+
@media (min-width: 768px) {
|
|
253997
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-list"] {
|
|
253998
|
+
display: block; padding: 0 6px 8px; gap: ${EDITOR_THUMBNAIL_GAP}px;
|
|
253999
|
+
}
|
|
254000
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-window"] {
|
|
254001
|
+
display: flex; flex-direction: column; gap: ${EDITOR_THUMBNAIL_GAP}px;
|
|
254002
|
+
}
|
|
254003
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-wrapper"] {
|
|
254004
|
+
border: 0; padding: 0; border-radius: 0; background: transparent;
|
|
254005
|
+
}
|
|
254006
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-row"] {
|
|
254007
|
+
position: relative; display: flex; width: 100%; align-items: center;
|
|
254008
|
+
gap: 4px; margin: 0; padding: 2px 4px; border: 0; border-radius: 0;
|
|
254009
|
+
box-sizing: border-box; background: transparent; color: var(--pptx-muted-foreground);
|
|
254010
|
+
}
|
|
254011
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-row"]${CURRENT_SLIDE} {
|
|
254012
|
+
background: color-mix(in oklab, var(--pptx-accent) 40%, transparent);
|
|
254013
|
+
}
|
|
254014
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-row"]${CURRENT_SLIDE}::before {
|
|
254015
|
+
content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
|
|
254016
|
+
width: 3px; border-radius: 0 2px 2px 0; background: var(--pptx-primary);
|
|
254017
|
+
}
|
|
254018
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-number"] {
|
|
254019
|
+
flex: 0 0 20px; width: 20px; min-width: 0; padding: 0;
|
|
254020
|
+
font-family: inherit; font-size: 10px; line-height: ${EDITOR_THUMBNAIL_NUMBER_HEIGHT}px; text-align: right;
|
|
254021
|
+
}
|
|
254022
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-frame"] {
|
|
254023
|
+
display: block; flex-shrink: 0; overflow: hidden; box-sizing: content-box;
|
|
254024
|
+
border: 1px solid transparent; border-radius: 0; outline: none; background: white;
|
|
254025
|
+
}
|
|
254026
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-row"]${CURRENT_SLIDE} [data-pptx-chrome="slide-frame"] {
|
|
254027
|
+
border-color: color-mix(in oklab, var(--pptx-primary) 60%, transparent);
|
|
254028
|
+
}
|
|
254029
|
+
[data-pptx-editor-chrome] [data-pptx-chrome="slide-row"]${CURRENT_SLIDE} [data-pptx-chrome="slide-number"] {
|
|
254030
|
+
color: var(--pptx-primary); font-weight: 500;
|
|
254031
|
+
}
|
|
254032
|
+
}
|
|
254033
|
+
`;
|
|
254034
|
+
var EDITOR_CHROME_CSS = EDITOR_LAYOUT_CSS + EDITOR_THUMBNAIL_CSS + EDITOR_RIBBON_CSS + EDITOR_INSPECTOR_CSS + EDITOR_CONTROLS_CSS + EDITOR_FONT_PICKER_CSS + EDITOR_HOME_LAYOUT_CSS + EDITOR_ARRANGE_CSS + EDITOR_CLUSTER_CSS;
|
|
254035
|
+
var THEME_EDITOR_LABEL_KEYS = [
|
|
254036
|
+
"title",
|
|
254037
|
+
"close",
|
|
254038
|
+
"themeName",
|
|
254039
|
+
"themeNamePlaceholder",
|
|
254040
|
+
"presetThemes",
|
|
254041
|
+
"colorScheme",
|
|
254042
|
+
"preview",
|
|
254043
|
+
"headingFont",
|
|
254044
|
+
"bodyFont",
|
|
254045
|
+
"headingSample",
|
|
254046
|
+
"bodySample",
|
|
254047
|
+
"applyToPresentation",
|
|
254048
|
+
"reset",
|
|
254049
|
+
"colorDark1",
|
|
254050
|
+
"colorLight1",
|
|
254051
|
+
"colorDark2",
|
|
254052
|
+
"colorLight2",
|
|
254053
|
+
"colorAccent1",
|
|
254054
|
+
"colorAccent2",
|
|
254055
|
+
"colorAccent3",
|
|
254056
|
+
"colorAccent4",
|
|
254057
|
+
"colorAccent5",
|
|
254058
|
+
"colorAccent6",
|
|
254059
|
+
"colorHyperlink",
|
|
254060
|
+
"colorFollowedLink"
|
|
254061
|
+
];
|
|
254062
|
+
var THEME_EDITOR_COLOR_LABELS = Object.fromEntries(
|
|
254063
|
+
exports.THEME_COLOR_SCHEME_KEYS.map((slot, i2) => [slot, THEME_EDITOR_LABEL_KEYS[13 + i2]])
|
|
254064
|
+
);
|
|
254065
|
+
function themeEditorLabels(t) {
|
|
254066
|
+
return Object.fromEntries([
|
|
254067
|
+
...THEME_EDITOR_LABEL_KEYS.map((key2) => [key2, t(`pptx.themeEditor.${key2}`)]),
|
|
254068
|
+
...Object.values(THEME_COLOR_SLOT_LABEL_KEYS).map((key2) => [key2, t(key2)]),
|
|
254069
|
+
...THEME_COLOR_TINT_ROWS.map(({ labelKey }) => [labelKey, t(labelKey)])
|
|
254070
|
+
]);
|
|
254071
|
+
}
|
|
254072
|
+
function createThemeEditorEdit(theme) {
|
|
254073
|
+
const copyFont = (font, fallback) => ({
|
|
254074
|
+
...font,
|
|
254075
|
+
latin: font?.latin ?? fallback,
|
|
254076
|
+
...font?.byScript ? { byScript: { ...font.byScript } } : {}
|
|
254077
|
+
});
|
|
254078
|
+
return {
|
|
254079
|
+
name: theme?.name ?? "Custom Theme",
|
|
254080
|
+
colorScheme: { ...DEFAULT_THEME_COLOR_SCHEME, ...theme?.colorScheme },
|
|
254081
|
+
fontScheme: {
|
|
254082
|
+
majorFont: copyFont(theme?.fontScheme?.majorFont, "Calibri Light"),
|
|
254083
|
+
minorFont: copyFont(theme?.fontScheme?.minorFont, "Calibri")
|
|
254084
|
+
}
|
|
254085
|
+
};
|
|
254086
|
+
}
|
|
254087
|
+
function themeEditorHex(value) {
|
|
254088
|
+
const hex22 = value?.startsWith("#") ? value : `#${value ?? ""}`;
|
|
254089
|
+
return /^#[\da-f]{6}$/iu.test(hex22) ? hex22 : "#000000";
|
|
254090
|
+
}
|
|
253389
254091
|
var SLIDE_SHOW_OPTIONS_STYLES = `
|
|
253390
254092
|
:host {
|
|
253391
254093
|
display: inline-flex;
|
|
@@ -253658,6 +254360,401 @@ function definePptxSubtitleSettings(registry) {
|
|
|
253658
254360
|
}
|
|
253659
254361
|
registry.define("pptx-ui-subtitle-settings", SubtitleSettingsElement);
|
|
253660
254362
|
}
|
|
254363
|
+
function attachThemeEditorDock(host) {
|
|
254364
|
+
if (host.hasAttribute("inline")) {
|
|
254365
|
+
return () => {
|
|
254366
|
+
};
|
|
254367
|
+
}
|
|
254368
|
+
const body = host.closest("[data-pptx-editor-chrome]")?.querySelector('[data-pptx-chrome="body"]');
|
|
254369
|
+
const position2 = () => {
|
|
254370
|
+
const rect22 = body?.getBoundingClientRect();
|
|
254371
|
+
const top = Math.max(0, rect22?.top ?? 0);
|
|
254372
|
+
const bottom = Math.min(window.innerHeight, rect22?.bottom ?? window.innerHeight);
|
|
254373
|
+
const left = Math.max(0, rect22?.left ?? 0);
|
|
254374
|
+
const right = Math.min(window.innerWidth, rect22?.right ?? window.innerWidth);
|
|
254375
|
+
const narrow = right - left < 768;
|
|
254376
|
+
const width = narrow ? right - left : Math.min(288, right - left);
|
|
254377
|
+
const height = Math.max(0, bottom - top) * (narrow ? 0.6 : 1);
|
|
254378
|
+
Object.assign(host.style, {
|
|
254379
|
+
left: `${right - width}px`,
|
|
254380
|
+
top: `${bottom - height}px`,
|
|
254381
|
+
width: `${width}px`,
|
|
254382
|
+
height: `${height}px`
|
|
254383
|
+
});
|
|
254384
|
+
};
|
|
254385
|
+
position2();
|
|
254386
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(position2);
|
|
254387
|
+
if (body) {
|
|
254388
|
+
observer?.observe(body);
|
|
254389
|
+
}
|
|
254390
|
+
window.addEventListener("resize", position2);
|
|
254391
|
+
window.addEventListener("scroll", position2, true);
|
|
254392
|
+
return () => {
|
|
254393
|
+
observer?.disconnect();
|
|
254394
|
+
window.removeEventListener("resize", position2);
|
|
254395
|
+
window.removeEventListener("scroll", position2, true);
|
|
254396
|
+
};
|
|
254397
|
+
}
|
|
254398
|
+
var THEME_EDITOR_STYLES = `
|
|
254399
|
+
:host { display: block; position: fixed; z-index: 1090; box-sizing: border-box; width: 288px;
|
|
254400
|
+
color: var(--pptx-foreground, #e2e8f0); background: var(--pptx-card, #181c20);
|
|
254401
|
+
border-left: 1px solid var(--pptx-border, #33334d); box-shadow: -8px 0 24px #0002;
|
|
254402
|
+
font: 12px/1.4 var(--pptx-ui-font-family, system-ui, sans-serif); }
|
|
254403
|
+
:host([inline]) { position: static; width: 100%; border: 0; box-shadow: none; }
|
|
254404
|
+
:host([inline]) .close { display: none; }
|
|
254405
|
+
* { box-sizing: border-box; }
|
|
254406
|
+
.panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
254407
|
+
header { display: flex; align-items: center; justify-content: space-between; padding: 10px; flex: none; }
|
|
254408
|
+
h3 { margin: 0; font-size: 13px; font-weight: 600; }
|
|
254409
|
+
.content { display: grid; gap: 10px; padding: 0 10px 10px; overflow-y: auto; min-height: 0; }
|
|
254410
|
+
section { padding: 8px; border: 1px solid var(--pptx-border, #33334d); border-radius: 5px; }
|
|
254411
|
+
h4, label > span { display: block; margin: 0 0 5px; color: var(--pptx-muted-foreground, #94a3b8); font-size: 10px; }
|
|
254412
|
+
h4 { text-transform: uppercase; letter-spacing: .03em; font-weight: 500; }
|
|
254413
|
+
input[type=text], pptx-ui-select { display: block; width: 100%; min-height: 28px; padding: 4px 6px;
|
|
254414
|
+
background: var(--pptx-background, #0e1114); border: 1px solid var(--pptx-border, #33334d);
|
|
254415
|
+
border-radius: 4px; color: inherit; font: inherit; }
|
|
254416
|
+
button { color: inherit; font: inherit; background: var(--pptx-secondary, #20252b);
|
|
254417
|
+
border: 1px solid var(--pptx-border, #33334d); border-radius: 4px; padding: 5px 7px; cursor: pointer; }
|
|
254418
|
+
button:hover { background: var(--pptx-accent, #33334d); }
|
|
254419
|
+
button:disabled, input:disabled { opacity: .45; cursor: default; }
|
|
254420
|
+
button:focus-visible, input:focus-visible, pptx-ui-select:focus-within { outline: 2px solid var(--pptx-ring, #ec6b3d); outline-offset: 2px; }
|
|
254421
|
+
.close { border: 0; background: transparent; min-width: 28px; min-height: 28px; }
|
|
254422
|
+
.presets, .colors { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
|
|
254423
|
+
.preset { text-align: left; font-size: 10px; min-height: 42px; }
|
|
254424
|
+
.preset[aria-pressed=true] { border-color: var(--pptx-primary, #ec6b3d); }
|
|
254425
|
+
.swatches { display: flex; height: 12px; overflow: hidden; border-radius: 2px; margin-bottom: 4px; }
|
|
254426
|
+
.swatches span { flex: 1; }
|
|
254427
|
+
.colors label { min-width: 0; }
|
|
254428
|
+
.colors label > span { font-size: 9px; }
|
|
254429
|
+
.color-row { display: flex; gap: 4px; }
|
|
254430
|
+
input[type=color] { width: 28px; height: 28px; padding: 0; flex: none; border: 1px solid var(--pptx-border, #33334d); background: transparent; }
|
|
254431
|
+
.color-row input[type=text] { min-width: 0; font: 10px monospace; }
|
|
254432
|
+
.font-fields { display: grid; gap: 8px; }
|
|
254433
|
+
.preview { padding: 8px; border-radius: 4px; display: grid; gap: 4px; margin-top: 8px; }
|
|
254434
|
+
.actions { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--pptx-border, #33334d); flex: none; }
|
|
254435
|
+
.apply { flex: 1; background: var(--pptx-primary, #ec6b3d); color: var(--pptx-primary-foreground, #fff); border-color: transparent; }
|
|
254436
|
+
@media (pointer: coarse), (max-width: 767px) { button, input[type=text], pptx-ui-select, .close { min-height: 44px; } }
|
|
254437
|
+
@media (forced-colors: active) { :host, section, button, input { border-color: CanvasText; }
|
|
254438
|
+
button:focus-visible, input:focus-visible { outline-color: Highlight; } }
|
|
254439
|
+
`;
|
|
254440
|
+
function createThemeEditorView(root, actions) {
|
|
254441
|
+
const doc = root.ownerDocument;
|
|
254442
|
+
const panel2 = doc.createElement("div");
|
|
254443
|
+
panel2.className = "panel";
|
|
254444
|
+
panel2.setAttribute("role", "dialog");
|
|
254445
|
+
const texts = /* @__PURE__ */ new Map();
|
|
254446
|
+
function caption(key2, node) {
|
|
254447
|
+
texts.set(key2, [...texts.get(key2) ?? [], node]);
|
|
254448
|
+
}
|
|
254449
|
+
function button(key2, action, className = "") {
|
|
254450
|
+
const node = doc.createElement("button");
|
|
254451
|
+
node.type = "button";
|
|
254452
|
+
node.className = className;
|
|
254453
|
+
caption(key2, node);
|
|
254454
|
+
node.addEventListener("click", action);
|
|
254455
|
+
return node;
|
|
254456
|
+
}
|
|
254457
|
+
const header = doc.createElement("header");
|
|
254458
|
+
const heading = doc.createElement("h3");
|
|
254459
|
+
caption("title", heading);
|
|
254460
|
+
const close = button("close", actions.close, "close");
|
|
254461
|
+
header.append(heading, close);
|
|
254462
|
+
const content = doc.createElement("div");
|
|
254463
|
+
content.className = "content";
|
|
254464
|
+
function section(key2) {
|
|
254465
|
+
const node = doc.createElement("section");
|
|
254466
|
+
const title = doc.createElement("h4");
|
|
254467
|
+
caption(key2, title);
|
|
254468
|
+
node.append(title);
|
|
254469
|
+
content.append(node);
|
|
254470
|
+
return node;
|
|
254471
|
+
}
|
|
254472
|
+
function field(key2) {
|
|
254473
|
+
const label = doc.createElement("label");
|
|
254474
|
+
const span = doc.createElement("span");
|
|
254475
|
+
caption(key2, span);
|
|
254476
|
+
label.append(span);
|
|
254477
|
+
return label;
|
|
254478
|
+
}
|
|
254479
|
+
const name = doc.createElement("input");
|
|
254480
|
+
name.type = "text";
|
|
254481
|
+
name.addEventListener("input", () => actions.edit((draft) => ({ ...draft, name: name.value })));
|
|
254482
|
+
const nameSection = section("themeName");
|
|
254483
|
+
nameSection.append(name);
|
|
254484
|
+
const presets = section("presetThemes");
|
|
254485
|
+
const presetGrid = doc.createElement("div");
|
|
254486
|
+
presetGrid.className = "presets";
|
|
254487
|
+
const presetButtons = PRESET_THEMES.map((preset22) => {
|
|
254488
|
+
const node = doc.createElement("button");
|
|
254489
|
+
node.type = "button";
|
|
254490
|
+
node.className = "preset";
|
|
254491
|
+
node.setAttribute("aria-label", preset22.name);
|
|
254492
|
+
const swatches2 = doc.createElement("span");
|
|
254493
|
+
swatches2.className = "swatches";
|
|
254494
|
+
for (const key2 of ["accent1", "accent2", "accent3", "accent4", "accent5", "accent6"]) {
|
|
254495
|
+
const swatch = doc.createElement("span");
|
|
254496
|
+
swatch.style.backgroundColor = preset22.colorScheme[key2] ?? "";
|
|
254497
|
+
swatches2.append(swatch);
|
|
254498
|
+
}
|
|
254499
|
+
node.append(swatches2, doc.createTextNode(preset22.name));
|
|
254500
|
+
node.addEventListener(
|
|
254501
|
+
"click",
|
|
254502
|
+
() => actions.edit((draft) => ({
|
|
254503
|
+
...draft,
|
|
254504
|
+
name: preset22.name,
|
|
254505
|
+
colorScheme: { ...preset22.colorScheme },
|
|
254506
|
+
fontScheme: {
|
|
254507
|
+
...draft.fontScheme,
|
|
254508
|
+
majorFont: { ...draft.fontScheme.majorFont, latin: preset22.majorFont },
|
|
254509
|
+
minorFont: { ...draft.fontScheme.minorFont, latin: preset22.minorFont }
|
|
254510
|
+
}
|
|
254511
|
+
}))
|
|
254512
|
+
);
|
|
254513
|
+
presetGrid.append(node);
|
|
254514
|
+
return node;
|
|
254515
|
+
});
|
|
254516
|
+
presets.append(presetGrid);
|
|
254517
|
+
const colors = section("colorScheme");
|
|
254518
|
+
const colorGrid = doc.createElement("div");
|
|
254519
|
+
colorGrid.className = "colors";
|
|
254520
|
+
const colorFields = exports.THEME_COLOR_SCHEME_KEYS.map((slot) => {
|
|
254521
|
+
const label = field(THEME_EDITOR_COLOR_LABELS[slot]);
|
|
254522
|
+
const row = doc.createElement("div");
|
|
254523
|
+
row.className = "color-row";
|
|
254524
|
+
const picker = doc.createElement("input");
|
|
254525
|
+
picker.type = "color";
|
|
254526
|
+
const hex22 = doc.createElement("input");
|
|
254527
|
+
hex22.type = "text";
|
|
254528
|
+
hex22.maxLength = 7;
|
|
254529
|
+
const edit = (value) => {
|
|
254530
|
+
if (/^#[\da-f]{6}$/iu.test(value)) {
|
|
254531
|
+
actions.edit((draft) => ({
|
|
254532
|
+
...draft,
|
|
254533
|
+
colorScheme: { ...draft.colorScheme, [slot]: value }
|
|
254534
|
+
}));
|
|
254535
|
+
}
|
|
254536
|
+
};
|
|
254537
|
+
picker.addEventListener("input", () => edit(picker.value));
|
|
254538
|
+
hex22.addEventListener("input", () => edit(hex22.value));
|
|
254539
|
+
row.append(picker, hex22);
|
|
254540
|
+
label.append(row);
|
|
254541
|
+
colorGrid.append(label);
|
|
254542
|
+
return { slot, picker, hex: hex22 };
|
|
254543
|
+
});
|
|
254544
|
+
colors.append(colorGrid);
|
|
254545
|
+
const previewSection = section("preview");
|
|
254546
|
+
const shades = doc.createElement("div");
|
|
254547
|
+
shades.style.cssText = "display:grid;grid-template-columns:repeat(12,1fr);gap:1px";
|
|
254548
|
+
previewSection.append(shades);
|
|
254549
|
+
const fonts = doc.createElement("div");
|
|
254550
|
+
fonts.className = "font-fields";
|
|
254551
|
+
const fontFields = ["majorFont", "minorFont"].map((key2, i2) => {
|
|
254552
|
+
const label = field(i2 === 0 ? "headingFont" : "bodyFont");
|
|
254553
|
+
const select2 = doc.createElement("pptx-ui-select");
|
|
254554
|
+
select2.addEventListener(
|
|
254555
|
+
"change",
|
|
254556
|
+
() => actions.edit((draft) => ({
|
|
254557
|
+
...draft,
|
|
254558
|
+
fontScheme: {
|
|
254559
|
+
...draft.fontScheme,
|
|
254560
|
+
[key2]: { ...draft.fontScheme[key2], latin: select2.value }
|
|
254561
|
+
}
|
|
254562
|
+
}))
|
|
254563
|
+
);
|
|
254564
|
+
label.append(select2);
|
|
254565
|
+
fonts.append(label);
|
|
254566
|
+
return { key: key2, select: select2 };
|
|
254567
|
+
});
|
|
254568
|
+
previewSection.append(fonts);
|
|
254569
|
+
const preview = doc.createElement("div");
|
|
254570
|
+
preview.className = "preview";
|
|
254571
|
+
const previewHeading = doc.createElement("span");
|
|
254572
|
+
const previewBody = doc.createElement("span");
|
|
254573
|
+
caption("headingSample", previewHeading);
|
|
254574
|
+
caption("bodySample", previewBody);
|
|
254575
|
+
preview.append(previewHeading, previewBody);
|
|
254576
|
+
previewSection.append(preview);
|
|
254577
|
+
const footer = doc.createElement("div");
|
|
254578
|
+
footer.className = "actions";
|
|
254579
|
+
footer.append(
|
|
254580
|
+
button("applyToPresentation", actions.apply, "apply"),
|
|
254581
|
+
button("reset", actions.reset)
|
|
254582
|
+
);
|
|
254583
|
+
panel2.append(header, content, footer);
|
|
254584
|
+
root.append(panel2);
|
|
254585
|
+
return {
|
|
254586
|
+
focus: () => name.focus(),
|
|
254587
|
+
paint(draft, labels, disabled) {
|
|
254588
|
+
for (const [key2, nodes] of texts) {
|
|
254589
|
+
for (const node of nodes) {
|
|
254590
|
+
node.textContent = labels[key2] ?? key2;
|
|
254591
|
+
}
|
|
254592
|
+
}
|
|
254593
|
+
panel2.setAttribute("aria-label", labels.title ?? "Edit Theme");
|
|
254594
|
+
close.setAttribute("aria-label", labels.close ?? "Close");
|
|
254595
|
+
name.setAttribute("aria-label", labels.themeName ?? "Theme name");
|
|
254596
|
+
name.placeholder = labels.themeNamePlaceholder ?? "";
|
|
254597
|
+
name.value = draft.name;
|
|
254598
|
+
colorFields.forEach(({ slot, picker, hex: hex22 }) => {
|
|
254599
|
+
const text22 = labels[THEME_EDITOR_COLOR_LABELS[slot]] ?? slot;
|
|
254600
|
+
picker.setAttribute("aria-label", text22);
|
|
254601
|
+
hex22.setAttribute("aria-label", `${text22} hex`);
|
|
254602
|
+
picker.value = themeEditorHex(draft.colorScheme[slot]);
|
|
254603
|
+
hex22.value = draft.colorScheme[slot] ?? "";
|
|
254604
|
+
});
|
|
254605
|
+
fontFields.forEach(({ key: key2, select: select2 }, i2) => {
|
|
254606
|
+
const value = draft.fontScheme[key2]?.latin ?? "";
|
|
254607
|
+
const options = [.../* @__PURE__ */ new Set([value, ...COMMON_FONTS])].filter(Boolean);
|
|
254608
|
+
if (Array.from(select2.options).map((item3) => item3.value).join("|") !== options.join("|")) {
|
|
254609
|
+
select2.replaceChildren(
|
|
254610
|
+
...options.map((font) => {
|
|
254611
|
+
const option = doc.createElement("option");
|
|
254612
|
+
option.value = font;
|
|
254613
|
+
option.textContent = font;
|
|
254614
|
+
return option;
|
|
254615
|
+
})
|
|
254616
|
+
);
|
|
254617
|
+
}
|
|
254618
|
+
select2.value = value;
|
|
254619
|
+
select2.setAttribute("aria-label", labels[i2 === 0 ? "headingFont" : "bodyFont"] ?? key2);
|
|
254620
|
+
select2.disabled = disabled;
|
|
254621
|
+
});
|
|
254622
|
+
presetButtons.forEach(
|
|
254623
|
+
(node, i2) => node.setAttribute("aria-pressed", String(draft.name === PRESET_THEMES[i2].name))
|
|
254624
|
+
);
|
|
254625
|
+
shades.replaceChildren(
|
|
254626
|
+
...(buildThemeColorGrid(draft.colorScheme, (key2) => labels[key2] ?? key2) ?? []).flat().map((cell) => {
|
|
254627
|
+
const swatch = doc.createElement("span");
|
|
254628
|
+
swatch.style.cssText = `height:10px;background:${cell.hex}`;
|
|
254629
|
+
swatch.title = `${cell.colLabel}: ${cell.rowLabel}`;
|
|
254630
|
+
return swatch;
|
|
254631
|
+
})
|
|
254632
|
+
);
|
|
254633
|
+
preview.style.backgroundColor = themeEditorHex(draft.colorScheme.lt1);
|
|
254634
|
+
Object.assign(previewHeading.style, {
|
|
254635
|
+
color: themeEditorHex(draft.colorScheme.dk2),
|
|
254636
|
+
fontFamily: draft.fontScheme.majorFont?.latin
|
|
254637
|
+
});
|
|
254638
|
+
Object.assign(previewBody.style, {
|
|
254639
|
+
color: themeEditorHex(draft.colorScheme.dk1),
|
|
254640
|
+
fontFamily: draft.fontScheme.minorFont?.latin
|
|
254641
|
+
});
|
|
254642
|
+
panel2.querySelectorAll("input, button").forEach((node) => {
|
|
254643
|
+
node.disabled = node !== close && disabled;
|
|
254644
|
+
});
|
|
254645
|
+
}
|
|
254646
|
+
};
|
|
254647
|
+
}
|
|
254648
|
+
function definePptxThemeEditor(registry) {
|
|
254649
|
+
if (registry.get("pptx-ui-theme-editor")) {
|
|
254650
|
+
return;
|
|
254651
|
+
}
|
|
254652
|
+
class ThemeEditorElement extends HTMLElement {
|
|
254653
|
+
current;
|
|
254654
|
+
draft = createThemeEditorEdit();
|
|
254655
|
+
text = {};
|
|
254656
|
+
locked = false;
|
|
254657
|
+
dirty = false;
|
|
254658
|
+
opener;
|
|
254659
|
+
undock;
|
|
254660
|
+
view;
|
|
254661
|
+
constructor() {
|
|
254662
|
+
super();
|
|
254663
|
+
const root = this.attachShadow({ mode: "open" });
|
|
254664
|
+
attachControlStyles(root, THEME_EDITOR_STYLES);
|
|
254665
|
+
this.view = createThemeEditorView(root, {
|
|
254666
|
+
edit: (update) => {
|
|
254667
|
+
if (!this.locked) {
|
|
254668
|
+
this.draft = update(this.draft);
|
|
254669
|
+
this.dirty = true;
|
|
254670
|
+
this.paint();
|
|
254671
|
+
}
|
|
254672
|
+
},
|
|
254673
|
+
apply: () => {
|
|
254674
|
+
if (!this.locked) {
|
|
254675
|
+
this.dispatchEvent(
|
|
254676
|
+
new CustomEvent("theme-editor-apply", {
|
|
254677
|
+
detail: structuredClone(this.draft),
|
|
254678
|
+
bubbles: true,
|
|
254679
|
+
composed: true
|
|
254680
|
+
})
|
|
254681
|
+
);
|
|
254682
|
+
}
|
|
254683
|
+
},
|
|
254684
|
+
reset: () => {
|
|
254685
|
+
if (!this.locked) {
|
|
254686
|
+
this.draft = createThemeEditorEdit(this.current);
|
|
254687
|
+
this.dirty = false;
|
|
254688
|
+
this.paint();
|
|
254689
|
+
}
|
|
254690
|
+
},
|
|
254691
|
+
close: () => this.close()
|
|
254692
|
+
});
|
|
254693
|
+
root.addEventListener("keydown", (event) => {
|
|
254694
|
+
const key2 = event;
|
|
254695
|
+
key2.stopPropagation();
|
|
254696
|
+
if (key2.key === "Escape" && !key2.defaultPrevented) {
|
|
254697
|
+
key2.preventDefault();
|
|
254698
|
+
this.close();
|
|
254699
|
+
}
|
|
254700
|
+
});
|
|
254701
|
+
}
|
|
254702
|
+
get theme() {
|
|
254703
|
+
return this.current;
|
|
254704
|
+
}
|
|
254705
|
+
set theme(value) {
|
|
254706
|
+
this.current = value;
|
|
254707
|
+
if (!this.dirty) {
|
|
254708
|
+
this.draft = createThemeEditorEdit(value);
|
|
254709
|
+
}
|
|
254710
|
+
this.paint();
|
|
254711
|
+
}
|
|
254712
|
+
get labels() {
|
|
254713
|
+
return this.text;
|
|
254714
|
+
}
|
|
254715
|
+
set labels(value) {
|
|
254716
|
+
this.text = { ...value };
|
|
254717
|
+
this.paint();
|
|
254718
|
+
}
|
|
254719
|
+
get disabled() {
|
|
254720
|
+
return this.locked;
|
|
254721
|
+
}
|
|
254722
|
+
set disabled(value) {
|
|
254723
|
+
this.locked = value;
|
|
254724
|
+
this.paint();
|
|
254725
|
+
}
|
|
254726
|
+
connectedCallback() {
|
|
254727
|
+
let active2 = document.activeElement;
|
|
254728
|
+
while (active2?.shadowRoot?.activeElement) {
|
|
254729
|
+
active2 = active2.shadowRoot.activeElement;
|
|
254730
|
+
}
|
|
254731
|
+
this.opener = active2 instanceof HTMLElement ? active2 : void 0;
|
|
254732
|
+
this.undock = attachThemeEditorDock(this);
|
|
254733
|
+
this.paint();
|
|
254734
|
+
if (!this.hasAttribute("inline")) {
|
|
254735
|
+
queueMicrotask(() => {
|
|
254736
|
+
if (this.isConnected) {
|
|
254737
|
+
this.view.focus();
|
|
254738
|
+
}
|
|
254739
|
+
});
|
|
254740
|
+
}
|
|
254741
|
+
}
|
|
254742
|
+
disconnectedCallback() {
|
|
254743
|
+
this.undock?.();
|
|
254744
|
+
if (document.activeElement === this) {
|
|
254745
|
+
this.opener?.focus();
|
|
254746
|
+
}
|
|
254747
|
+
}
|
|
254748
|
+
close() {
|
|
254749
|
+
this.opener?.focus();
|
|
254750
|
+
this.dispatchEvent(new CustomEvent("theme-editor-close", { bubbles: true, composed: true }));
|
|
254751
|
+
}
|
|
254752
|
+
paint() {
|
|
254753
|
+
this.view.paint(this.draft, this.text, this.locked);
|
|
254754
|
+
}
|
|
254755
|
+
}
|
|
254756
|
+
registry.define("pptx-ui-theme-editor", ThemeEditorElement);
|
|
254757
|
+
}
|
|
253661
254758
|
var controls = [
|
|
253662
254759
|
["pptx-ui-search", definePptxSearchField],
|
|
253663
254760
|
["pptx-ui-checkbox", definePptxCheckbox],
|
|
@@ -253666,7 +254763,8 @@ var controls = [
|
|
|
253666
254763
|
["pptx-ui-ribbon-command", definePptxRibbonCommand],
|
|
253667
254764
|
["pptx-ui-ribbon-group", definePptxRibbonGroup],
|
|
253668
254765
|
["pptx-ui-ribbon-toggle", definePptxRibbonToggle],
|
|
253669
|
-
["pptx-ui-subtitle-settings", definePptxSubtitleSettings]
|
|
254766
|
+
["pptx-ui-subtitle-settings", definePptxSubtitleSettings],
|
|
254767
|
+
["pptx-ui-theme-editor", definePptxThemeEditor]
|
|
253670
254768
|
];
|
|
253671
254769
|
function registerPptxWebControls() {
|
|
253672
254770
|
if (typeof window === "undefined" || !window.customElements) {
|
|
@@ -257018,7 +258116,6 @@ exports.CINEMATIC_TRANSITION_KEYFRAMES = CINEMATIC_TRANSITION_KEYFRAMES;
|
|
|
257018
258116
|
exports.COMMENT_MARKER_SIZE = COMMENT_MARKER_SIZE;
|
|
257019
258117
|
exports.COMMENT_MENTION_ATTRIBUTE = COMMENT_MENTION_ATTRIBUTE;
|
|
257020
258118
|
exports.COMMENT_MENTION_CLASS = COMMENT_MENTION_CLASS;
|
|
257021
|
-
exports.COMMON_FONTS = COMMON_FONTS;
|
|
257022
258119
|
exports.COMMON_FONT_SIZES = COMMON_FONT_SIZES;
|
|
257023
258120
|
exports.COMPOUND_LINE_OPTIONS = COMPOUND_LINE_OPTIONS;
|
|
257024
258121
|
exports.CONNECTION_TIMEOUT_MS = CONNECTION_TIMEOUT_MS;
|
|
@@ -257048,7 +258145,10 @@ exports.DEFAULT_VIEWER_PROFILE = DEFAULT_VIEWER_PROFILE;
|
|
|
257048
258145
|
exports.DEFAULT_VIRTUAL_OVERSCAN = DEFAULT_VIRTUAL_OVERSCAN;
|
|
257049
258146
|
exports.DUOTONE_PRESETS = DUOTONE_PRESETS;
|
|
257050
258147
|
exports.EASE = EASE;
|
|
258148
|
+
exports.EDITOR_CHROME_CSS = EDITOR_CHROME_CSS;
|
|
257051
258149
|
exports.EDITOR_SHORTCUT_ACTION_IDS = EDITOR_SHORTCUT_ACTION_IDS;
|
|
258150
|
+
exports.EDITOR_THUMBNAIL_WIDTH = EDITOR_THUMBNAIL_WIDTH;
|
|
258151
|
+
exports.EDITOR_VIEWPORT_FIT = EDITOR_VIEWPORT_FIT;
|
|
257052
258152
|
exports.EDIT_POINTS_STYLE = EDIT_POINTS_STYLE;
|
|
257053
258153
|
exports.EDIT_POINTS_TARGET_ATTR = EDIT_POINTS_TARGET_ATTR;
|
|
257054
258154
|
exports.EFFECT_SOUND_CATALOGUE = EFFECT_SOUND_CATALOGUE;
|
|
@@ -257142,7 +258242,6 @@ exports.PRESENTER_CONSOLE_CONTROLS = PRESENTER_CONSOLE_CONTROLS;
|
|
|
257142
258242
|
exports.PRESENTER_NAVIGATOR_LABEL_KEYS = PRESENTER_NAVIGATOR_LABEL_KEYS;
|
|
257143
258243
|
exports.PRESENT_TOOLBAR_CLASSES = PRESENT_TOOLBAR_CLASSES;
|
|
257144
258244
|
exports.PRESETS = PRESETS;
|
|
257145
|
-
exports.PRESET_THEMES = PRESET_THEMES;
|
|
257146
258245
|
exports.PptxMarkdownConverter = PptxMarkdownConverter;
|
|
257147
258246
|
exports.PresentationAnimationController = PresentationAnimationController;
|
|
257148
258247
|
exports.QUICK_ACCESS_COMMAND_CATALOG = QUICK_ACCESS_COMMAND_CATALOG;
|
|
@@ -257389,7 +258488,6 @@ exports.buildTextBody3DSceneStyle = buildTextBody3DSceneStyle;
|
|
|
257389
258488
|
exports.buildTextBodyLayoutStyle = buildTextBodyLayoutStyle;
|
|
257390
258489
|
exports.buildTextBuildSpec = buildTextBuildSpec;
|
|
257391
258490
|
exports.buildTextStyleOverrideCss = buildTextStyleOverrideCss;
|
|
257392
|
-
exports.buildThemeColorGrid = buildThemeColorGrid;
|
|
257393
258491
|
exports.buildThemeColorMap = buildThemeColorMap;
|
|
257394
258492
|
exports.buildThemeColorSwatchGrid = buildThemeColorSwatchGrid;
|
|
257395
258493
|
exports.buildTiledSlidesPdfBytes = buildTiledSlidesPdfBytes;
|
|
@@ -257557,6 +258655,9 @@ exports.downloadBlob = downloadBlob;
|
|
|
257557
258655
|
exports.downloadDataUrl = downloadDataUrl;
|
|
257558
258656
|
exports.dragCropHandle = dragCropHandle;
|
|
257559
258657
|
exports.editCommentInList = editCommentInList;
|
|
258658
|
+
exports.editorThumbnailHeight = editorThumbnailHeight;
|
|
258659
|
+
exports.editorThumbnailStep = editorThumbnailStep;
|
|
258660
|
+
exports.editorThumbnailWidth = editorThumbnailWidth;
|
|
257560
258661
|
exports.effectiveDirection = effectiveDirection;
|
|
257561
258662
|
exports.effectiveTimingCurve = effectiveTimingCurve;
|
|
257562
258663
|
exports.elementActionToPptxAction = elementActionToPptxAction;
|
|
@@ -257894,6 +258995,7 @@ exports.rasterizeElement = rasterizeElement;
|
|
|
257894
258995
|
exports.rasterizeElementTiledToCanvas = rasterizeElementTiledToCanvas;
|
|
257895
258996
|
exports.rasterizeElementTiles = rasterizeElementTiles;
|
|
257896
258997
|
exports.reResolveElementColors = reResolveElementColors;
|
|
258998
|
+
exports.reResolveElementFonts = reResolveElementFonts;
|
|
257897
258999
|
exports.reResolveSlideColors = reResolveSlideColors;
|
|
257898
259000
|
exports.readBackstageRecentFile = readBackstageRecentFile;
|
|
257899
259001
|
exports.readEditableText = readEditableText;
|
|
@@ -258136,9 +259238,9 @@ exports.text3dPtToEmu = text3dPtToEmu;
|
|
|
258136
259238
|
exports.textBuildSpanStyle = textBuildSpanStyle;
|
|
258137
259239
|
exports.textFontSizePtToPx = textFontSizePtToPx;
|
|
258138
259240
|
exports.textFontSizePxToPt = textFontSizePxToPt;
|
|
258139
|
-
exports.themeColorLabel = themeColorLabel;
|
|
258140
259241
|
exports.themeColorSchemesEqual = themeColorSchemesEqual;
|
|
258141
259242
|
exports.themeColorSwatchRows = themeColorSwatchRows;
|
|
259243
|
+
exports.themeEditorLabels = themeEditorLabels;
|
|
258142
259244
|
exports.themeSwatchCommit = themeSwatchCommit;
|
|
258143
259245
|
exports.themeToCssVars = themeToCssVars;
|
|
258144
259246
|
exports.toCssTextOrientation = toCssTextOrientation;
|