ooxml-ui 1.8.5 → 1.9.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/dist/{chunk-CTPXTRDT.js → chunk-PH7IBZOZ.js} +1 -1
- package/dist/docx/columns-dialog.d.ts +1 -1
- package/dist/docx/editor-core.d.ts +2 -0
- package/dist/docx/page-controller.d.ts +3 -2
- package/dist/docx/print-drag-scroll.d.ts +7 -0
- package/dist/docx/print-editing-geometry.d.ts +2 -0
- package/dist/docx/print-editing-index.d.ts +30 -0
- package/dist/docx/print-editing.d.ts +12 -0
- package/dist/docx/print-keyboard-navigation.d.ts +18 -0
- package/dist/docx/print-layout-view.d.ts +6 -10
- package/dist/docx/print-layout.d.ts +2 -2
- package/dist/docx/print-picture.d.ts +1 -0
- package/dist/docx.js +677 -20
- package/dist/index.js +2 -2
- package/dist/pptx/{chunk-7EMTVQSC.cjs → chunk-BFZDO2DY.cjs} +347 -41
- package/dist/pptx/{chunk-VRFNAF3Q.mjs → chunk-F7BBPOVJ.mjs} +9 -0
- package/dist/pptx/{chunk-W7LT3EOB.mjs → chunk-KBCKCW5M.mjs} +323 -46
- package/dist/pptx/{chunk-SM3CWDIQ.cjs → chunk-QVYJB7G2.cjs} +9 -0
- package/dist/pptx/dom/elements/image.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +219 -211
- package/dist/pptx/dom/index.mjs +22 -14
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +2767 -2715
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/find-replace.d.ts +1 -1
- package/dist/pptx/render/find-replace.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +3 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector-number.d.ts +15 -0
- package/dist/pptx/render/inspector-number.d.ts.map +1 -0
- package/dist/pptx/render/picture-frame.d.ts +52 -0
- package/dist/pptx/render/picture-frame.d.ts.map +1 -0
- package/dist/pptx/render/share-session.d.ts.map +1 -1
- package/dist/pptx/render/slide-operations.d.ts +2 -1
- package/dist/pptx/render/slide-operations.d.ts.map +1 -1
- package/dist/pptx/render/slide-package-clipboard.d.ts +31 -0
- package/dist/pptx/render/slide-package-clipboard.d.ts.map +1 -0
- package/dist/pptx/render/slide-sorter-context-menu.d.ts +3 -5
- package/dist/pptx/render/slide-sorter-context-menu.d.ts.map +1 -1
- package/dist/pptx/render/slide-sorter-state.d.ts +8 -1
- package/dist/pptx/render/slide-sorter-state.d.ts.map +1 -1
- package/dist/pptx/web-components/index.d.ts +2 -0
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/slide-clipboard.d.ts +14 -0
- package/dist/pptx/web-components/slide-clipboard.d.ts.map +1 -0
- package/dist/teams.js +1 -1
- package/dist/visio/format-pane-fields.d.ts +2 -0
- package/dist/visio/page-setup-action.d.ts +1 -1
- package/dist/visio/page-setup-dialog-form.d.ts +1 -1
- package/dist/visio/ribbon-action.d.ts +1 -1
- package/dist/visio/viewer-accessibility.d.ts +17 -0
- package/dist/visio/viewer-insert-dialog.d.ts +2 -1
- package/dist/visio/viewer-review.d.ts +2 -0
- package/dist/visio.js +304 -14
- package/dist/xlsx/commands/pivots.d.ts +2 -0
- package/dist/xlsx/commands/sparklines.d.ts +2 -0
- package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
- package/dist/xlsx/dialogs/page-header.d.ts +4 -0
- package/dist/xlsx/dialogs/page-setup-tabs.d.ts +6 -1
- package/dist/xlsx/dialogs/pivots.d.ts +2 -0
- package/dist/xlsx/dialogs/print-preview.d.ts +2 -0
- package/dist/xlsx/dialogs/sparklines.d.ts +4 -0
- package/dist/xlsx/print-cell.d.ts +4 -0
- package/dist/xlsx/print-header.d.ts +7 -0
- package/dist/xlsx/print-pages.d.ts +4 -0
- package/dist/xlsx/print.d.ts +4 -12
- package/dist/xlsx.js +1078 -287
- package/package.json +3 -3
- /package/dist/{chunk-SUHT5S2P.js → chunk-SKYBYVYH.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-
|
|
1
|
+
export { OFFICE_UI_TAGS, registerOfficeUi } from './chunk-PH7IBZOZ.js';
|
|
2
2
|
export { RIBBON_ADD_IN_EVENT, defineRibbonAddInElements, syncRibbonAddIns } from './chunk-W6AV3GHC.js';
|
|
3
3
|
export { OfficeUiSmartArt, defineSmartArt, renderDiagramDrawing } from './chunk-PXIYHFZ5.js';
|
|
4
|
-
export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-
|
|
4
|
+
export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-SKYBYVYH.js';
|
|
5
5
|
export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './chunk-SNV6YKPC.js';
|
|
6
6
|
export { THEME_CSS, THEME_STYLE_ID, installOfficeUiTheme, shadcnBridge, themeBridge } from './chunk-S6ZXU442.js';
|
|
7
7
|
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, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, createRibbonOverflow, defineAccount, defineBackstage, defineButton, defineCheckbox, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineStatusBar, defineStatusItem, defineSwitch, defineSymbolPicker, defineTabStrip, defineTaskPane, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, fitRibbonGroups, formatCommentTime, glyph, nextEnabledIndex, parseOfficeSymbolCode, parseSvgPreview, profileInitials, readOfficeProfile, registerControls, rulerDivisions, runKeyTips, sanitizeOfficeProfile, typeAheadIndex, writeOfficeProfile } from './chunk-O7APCA5N.js';
|
|
@@ -20,7 +20,8 @@ var chunkX4FNVH7J_cjs = require('./chunk-X4FNVH7J.cjs');
|
|
|
20
20
|
var chunkUPN5FFKP_cjs = require('./chunk-UPN5FFKP.cjs');
|
|
21
21
|
var chunkY4LTLCQP_cjs = require('./chunk-Y4LTLCQP.cjs');
|
|
22
22
|
var chunkUSBRSEJK_cjs = require('./chunk-USBRSEJK.cjs');
|
|
23
|
-
var
|
|
23
|
+
var chunkU47LRWDT_cjs = require('./chunk-U47LRWDT.cjs');
|
|
24
|
+
var chunkQVYJB7G2_cjs = require('./chunk-QVYJB7G2.cjs');
|
|
24
25
|
var chunkOGJRSAGH_cjs = require('./chunk-OGJRSAGH.cjs');
|
|
25
26
|
var chunkEW5DW5KR_cjs = require('./chunk-EW5DW5KR.cjs');
|
|
26
27
|
var pptx = require('ooxml-core/pptx');
|
|
@@ -107,6 +108,123 @@ function _interopNamespace(e) {
|
|
|
107
108
|
|
|
108
109
|
var opentypeModule__namespace = /*#__PURE__*/_interopNamespace(opentypeModule);
|
|
109
110
|
|
|
111
|
+
// src/pptx/web-components/control-styles.ts
|
|
112
|
+
var sheetsByDocument = /* @__PURE__ */ new WeakMap();
|
|
113
|
+
function attachControlStyles(root, css) {
|
|
114
|
+
const doc = root.host.ownerDocument;
|
|
115
|
+
const Sheet = doc.defaultView?.CSSStyleSheet;
|
|
116
|
+
if (Sheet && "adoptedStyleSheets" in root && "replaceSync" in Sheet.prototype) {
|
|
117
|
+
try {
|
|
118
|
+
let sheets = sheetsByDocument.get(doc);
|
|
119
|
+
if (!sheets) {
|
|
120
|
+
sheets = /* @__PURE__ */ new Map();
|
|
121
|
+
sheetsByDocument.set(doc, sheets);
|
|
122
|
+
}
|
|
123
|
+
let sheet = sheets.get(css);
|
|
124
|
+
if (!sheet) {
|
|
125
|
+
sheet = new Sheet();
|
|
126
|
+
sheet.replaceSync(css);
|
|
127
|
+
sheets.set(css, sheet);
|
|
128
|
+
}
|
|
129
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
|
|
130
|
+
return;
|
|
131
|
+
} catch {
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const style = doc.createElement("style");
|
|
135
|
+
style.textContent = css;
|
|
136
|
+
root.append(style);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// src/pptx/web-components/slide-clipboard.ts
|
|
140
|
+
function slideClipboardLabels(t) {
|
|
141
|
+
return {
|
|
142
|
+
copy: t("pptx.slideSorter.systemCopy"),
|
|
143
|
+
paste: t("pptx.slideSorter.systemPaste"),
|
|
144
|
+
copied: t("pptx.slideSorter.systemCopied"),
|
|
145
|
+
pasted: t("pptx.slideSorter.systemPasted")
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function definePptxSlideClipboard(registry2) {
|
|
149
|
+
if (registry2.get("pptx-ui-slide-clipboard")) return;
|
|
150
|
+
class SlideClipboard extends HTMLElement {
|
|
151
|
+
copy;
|
|
152
|
+
paste;
|
|
153
|
+
text = {
|
|
154
|
+
copy: "Copy slides to system clipboard",
|
|
155
|
+
paste: "Paste slides from system clipboard",
|
|
156
|
+
copied: "Slides copied",
|
|
157
|
+
pasted: "Slides pasted"
|
|
158
|
+
};
|
|
159
|
+
busy = false;
|
|
160
|
+
copyButton;
|
|
161
|
+
pasteButton;
|
|
162
|
+
status;
|
|
163
|
+
constructor() {
|
|
164
|
+
super();
|
|
165
|
+
const root = this.attachShadow({ mode: "open" });
|
|
166
|
+
attachControlStyles(
|
|
167
|
+
root,
|
|
168
|
+
":host{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;color:var(--pptx-foreground,var(--foreground,#222))}button{padding:5px 8px;border:1px solid var(--pptx-border,var(--border,#ccc));border-radius:4px;background:var(--pptx-muted,var(--muted,#eee));color:inherit;font:inherit;font-size:12px;cursor:pointer}button:disabled{opacity:.5;cursor:default}[role=status]{max-width:400px;font-size:12px}"
|
|
169
|
+
);
|
|
170
|
+
this.copyButton = document.createElement("button");
|
|
171
|
+
this.copyButton.type = "button";
|
|
172
|
+
this.pasteButton = document.createElement("button");
|
|
173
|
+
this.pasteButton.type = "button";
|
|
174
|
+
this.status = document.createElement("span");
|
|
175
|
+
this.status.setAttribute("role", "status");
|
|
176
|
+
this.status.setAttribute("aria-live", "polite");
|
|
177
|
+
this.copyButton.addEventListener("click", () => void this.run(this.copy, this.text.copied));
|
|
178
|
+
this.pasteButton.addEventListener("click", () => void this.run(this.paste, this.text.pasted));
|
|
179
|
+
root.append(this.copyButton, this.pasteButton, this.status);
|
|
180
|
+
this.sync();
|
|
181
|
+
}
|
|
182
|
+
get copyAction() {
|
|
183
|
+
return this.copy;
|
|
184
|
+
}
|
|
185
|
+
set copyAction(value) {
|
|
186
|
+
this.copy = value;
|
|
187
|
+
this.sync();
|
|
188
|
+
}
|
|
189
|
+
get pasteAction() {
|
|
190
|
+
return this.paste;
|
|
191
|
+
}
|
|
192
|
+
set pasteAction(value) {
|
|
193
|
+
this.paste = value;
|
|
194
|
+
this.sync();
|
|
195
|
+
}
|
|
196
|
+
get labels() {
|
|
197
|
+
return this.text;
|
|
198
|
+
}
|
|
199
|
+
set labels(value) {
|
|
200
|
+
this.text = value;
|
|
201
|
+
this.sync();
|
|
202
|
+
}
|
|
203
|
+
sync() {
|
|
204
|
+
this.copyButton.textContent = this.text.copy;
|
|
205
|
+
this.pasteButton.textContent = this.text.paste;
|
|
206
|
+
this.copyButton.disabled = this.busy || !this.copy;
|
|
207
|
+
this.pasteButton.disabled = this.busy || !this.paste;
|
|
208
|
+
}
|
|
209
|
+
async run(action, success) {
|
|
210
|
+
if (!action || this.busy) return;
|
|
211
|
+
this.busy = true;
|
|
212
|
+
this.status.textContent = "";
|
|
213
|
+
this.sync();
|
|
214
|
+
try {
|
|
215
|
+
await action();
|
|
216
|
+
this.status.textContent = success;
|
|
217
|
+
} catch (error) {
|
|
218
|
+
this.status.textContent = error instanceof Error ? error.message : String(error);
|
|
219
|
+
} finally {
|
|
220
|
+
this.busy = false;
|
|
221
|
+
this.sync();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
registry2.define("pptx-ui-slide-clipboard", SlideClipboard);
|
|
226
|
+
}
|
|
227
|
+
|
|
110
228
|
// src/pptx/web-components/control-tokens.ts
|
|
111
229
|
var CONTROL_TOKENS = {
|
|
112
230
|
// Field (search, select trigger, text inputs)
|
|
@@ -1446,6 +1564,33 @@ function resolveShapeGeometry(element) {
|
|
|
1446
1564
|
}
|
|
1447
1565
|
return { kind: "none" };
|
|
1448
1566
|
}
|
|
1567
|
+
function getPictureShadowFilter(element) {
|
|
1568
|
+
if (!pptx.isImageLikeElement(element) || !pptx.hasShapeProperties(element)) {
|
|
1569
|
+
return void 0;
|
|
1570
|
+
}
|
|
1571
|
+
return getCompositeOuterShadowFilterCss(element.shapeStyle, { rotation: element.rotation });
|
|
1572
|
+
}
|
|
1573
|
+
function hasPictureFrame(element) {
|
|
1574
|
+
if (!pptx.isImageLikeElement(element)) {
|
|
1575
|
+
return false;
|
|
1576
|
+
}
|
|
1577
|
+
return buildStrokeOutline(element) !== void 0 || getPictureShadowFilter(element) !== void 0;
|
|
1578
|
+
}
|
|
1579
|
+
function getPictureFrameLayers(element, clip) {
|
|
1580
|
+
const clipStyle = {
|
|
1581
|
+
overflow: clip.overflow,
|
|
1582
|
+
...clip.borderRadius ? { borderRadius: clip.borderRadius } : {},
|
|
1583
|
+
...clip.clipPath ? { clipPath: clip.clipPath } : {}
|
|
1584
|
+
};
|
|
1585
|
+
if (!hasPictureFrame(element)) {
|
|
1586
|
+
return { box: clipStyle, surface: void 0 };
|
|
1587
|
+
}
|
|
1588
|
+
const shadow = getPictureShadowFilter(element);
|
|
1589
|
+
return {
|
|
1590
|
+
box: { overflow: "visible", ...shadow ? { filter: shadow } : {} },
|
|
1591
|
+
surface: { position: "absolute", inset: "0", ...clipStyle }
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1449
1594
|
var NO_STROKE = {
|
|
1450
1595
|
borderWidth: 0,
|
|
1451
1596
|
cssBorderWidth: "0px",
|
|
@@ -22978,7 +23123,7 @@ function createTemplateContext(options = {}) {
|
|
|
22978
23123
|
const scheme = { ...pptx.DEFAULT_SCHEME_COLOR_MAP, ...options.scheme ?? {} };
|
|
22979
23124
|
let counter = 0;
|
|
22980
23125
|
const idFor = options.idFor ?? ((index) => `template-el-${Date.now()}-${index}`);
|
|
22981
|
-
const dictionary =
|
|
23126
|
+
const dictionary = chunkQVYJB7G2_cjs.translationsEn;
|
|
22982
23127
|
const translate = options.translate ?? ((key) => dictionary[key] ?? key);
|
|
22983
23128
|
return {
|
|
22984
23129
|
scheme,
|
|
@@ -39136,6 +39281,12 @@ function smartArtNodeLabel(node) {
|
|
|
39136
39281
|
fontStyle: node.fontStyle
|
|
39137
39282
|
};
|
|
39138
39283
|
}
|
|
39284
|
+
|
|
39285
|
+
// src/pptx/render/inspector-number.ts
|
|
39286
|
+
function inspectorNumber(value, fallback = 0) {
|
|
39287
|
+
const source = typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
39288
|
+
return Math.round(source * 100) / 100;
|
|
39289
|
+
}
|
|
39139
39290
|
function clamp7(v, lo, hi) {
|
|
39140
39291
|
return Math.max(lo, Math.min(hi, v));
|
|
39141
39292
|
}
|
|
@@ -40386,7 +40537,7 @@ function canJoinCollaborationSession(fields) {
|
|
|
40386
40537
|
return buildJoinCollaborationConfig(fields) !== null;
|
|
40387
40538
|
}
|
|
40388
40539
|
function buildCollaborationShareUrl(config, location) {
|
|
40389
|
-
if (!location) {
|
|
40540
|
+
if (!location || location.origin === "null" || location.origin === "") {
|
|
40390
40541
|
return config.roomId;
|
|
40391
40542
|
}
|
|
40392
40543
|
const url = new URL(location.pathname, location.origin);
|
|
@@ -64355,17 +64506,18 @@ function selectSorterSlide(state, slides, index, modifiers = {}, context = false
|
|
|
64355
64506
|
if (!slide || context && state.selectedIds.includes(slide.id)) {
|
|
64356
64507
|
return state;
|
|
64357
64508
|
}
|
|
64358
|
-
if (!context &&
|
|
64509
|
+
if (!context && modifiers.shiftKey) {
|
|
64510
|
+
const range = slides.slice(Math.min(state.anchor, index), Math.max(state.anchor, index) + 1).map((s) => s.id);
|
|
64359
64511
|
return {
|
|
64360
64512
|
...state,
|
|
64361
|
-
|
|
64362
|
-
selectedIds: state.selectedIds.includes(slide.id) ? state.selectedIds.filter((id) => id !== slide.id) : [...state.selectedIds, slide.id]
|
|
64513
|
+
selectedIds: modifiers.ctrlKey || modifiers.metaKey ? [.../* @__PURE__ */ new Set([...state.selectedIds, ...range])] : range
|
|
64363
64514
|
};
|
|
64364
64515
|
}
|
|
64365
|
-
if (!context && modifiers.
|
|
64516
|
+
if (!context && (modifiers.ctrlKey || modifiers.metaKey)) {
|
|
64366
64517
|
return {
|
|
64367
64518
|
...state,
|
|
64368
|
-
|
|
64519
|
+
anchor: index,
|
|
64520
|
+
selectedIds: state.selectedIds.includes(slide.id) ? state.selectedIds.filter((id) => id !== slide.id) : [...state.selectedIds, slide.id]
|
|
64369
64521
|
};
|
|
64370
64522
|
}
|
|
64371
64523
|
return { ...state, anchor: index, selectedIds: [slide.id] };
|
|
@@ -64377,7 +64529,9 @@ function sorterMenuContext(state, slides) {
|
|
|
64377
64529
|
const indexes = sorterSelectionIndexes(state, slides);
|
|
64378
64530
|
return {
|
|
64379
64531
|
selectedCount: indexes.length,
|
|
64380
|
-
hasClipboard:
|
|
64532
|
+
hasClipboard: Boolean(
|
|
64533
|
+
state.clipboardSlides?.length || slideSorterPasteIndexes(state.clipboardIds, slides).length
|
|
64534
|
+
),
|
|
64381
64535
|
hasHiddenInSelection: indexes.some((i) => slides[i].hidden),
|
|
64382
64536
|
hasVisibleInSelection: indexes.some((i) => !slides[i].hidden),
|
|
64383
64537
|
wouldDeleteAllSlides: indexes.length >= slides.length
|
|
@@ -64386,7 +64540,7 @@ function sorterMenuContext(state, slides) {
|
|
|
64386
64540
|
function sorterGridColumns(zoom) {
|
|
64387
64541
|
return zoom >= 180 ? 2 : zoom >= 140 ? 3 : zoom >= 100 ? 4 : zoom >= 70 ? 5 : 6;
|
|
64388
64542
|
}
|
|
64389
|
-
function applySorterAction(state, slides, action, active2) {
|
|
64543
|
+
function applySorterAction(state, slides, action, active2, clipboardSourceSlides, clipboardTemplates = {}) {
|
|
64390
64544
|
const indexes = sorterSelectionIndexes(state, slides);
|
|
64391
64545
|
switch (action) {
|
|
64392
64546
|
case "close":
|
|
@@ -64399,7 +64553,21 @@ function applySorterAction(state, slides, action, active2) {
|
|
|
64399
64553
|
case "selectAll":
|
|
64400
64554
|
return { state: { ...state, selectedIds: slides.map((s) => s.id) }, indexes: [] };
|
|
64401
64555
|
case "copy":
|
|
64402
|
-
return {
|
|
64556
|
+
return {
|
|
64557
|
+
state: {
|
|
64558
|
+
...state,
|
|
64559
|
+
clipboardIds: indexes.map((i) => slides[i].id),
|
|
64560
|
+
clipboardSlides: slideOperations.captureSlideClipboard(
|
|
64561
|
+
clipboardSourceSlides ?? slides,
|
|
64562
|
+
indexes.map((i) => slides[i].id)
|
|
64563
|
+
),
|
|
64564
|
+
clipboardTemplates: slideOperations.captureSlideClipboardTemplates(
|
|
64565
|
+
clipboardTemplates,
|
|
64566
|
+
indexes.map((i) => slides[i].id)
|
|
64567
|
+
)
|
|
64568
|
+
},
|
|
64569
|
+
indexes: []
|
|
64570
|
+
};
|
|
64403
64571
|
case "zoomIn":
|
|
64404
64572
|
case "zoomOut":
|
|
64405
64573
|
return {
|
|
@@ -64412,11 +64580,16 @@ function applySorterAction(state, slides, action, active2) {
|
|
|
64412
64580
|
indexes: []
|
|
64413
64581
|
};
|
|
64414
64582
|
case "paste":
|
|
64415
|
-
return {
|
|
64416
|
-
|
|
64417
|
-
|
|
64418
|
-
|
|
64419
|
-
|
|
64583
|
+
if (!state.clipboardSlides?.length) return { state, indexes: [] };
|
|
64584
|
+
{
|
|
64585
|
+
const insertAt = sorterPasteInsertAt(indexes, active2, slides.length);
|
|
64586
|
+
const paste = slideOperations.createSlidePaste(state.clipboardSlides, insertAt, state.clipboardTemplates);
|
|
64587
|
+
return {
|
|
64588
|
+
state: { ...state, selectedIds: paste.copies.map((slide) => slide.id), anchor: insertAt },
|
|
64589
|
+
indexes: [],
|
|
64590
|
+
paste
|
|
64591
|
+
};
|
|
64592
|
+
}
|
|
64420
64593
|
case "delete":
|
|
64421
64594
|
return {
|
|
64422
64595
|
state: indexes.length < slides.length ? { ...state, selectedIds: [] } : state,
|
|
@@ -64428,6 +64601,9 @@ function applySorterAction(state, slides, action, active2) {
|
|
|
64428
64601
|
return { state, indexes: indexes.reverse(), operation: action };
|
|
64429
64602
|
}
|
|
64430
64603
|
}
|
|
64604
|
+
function sorterPasteInsertAt(indexes, active2, slideCount) {
|
|
64605
|
+
return Math.min(slideCount, Math.max(0, (indexes.at(-1) ?? active2) + 1));
|
|
64606
|
+
}
|
|
64431
64607
|
|
|
64432
64608
|
// src/pptx/render/viewer-root-options.ts
|
|
64433
64609
|
var VIEWER_ROOT_OPTION_DEFAULTS = Object.freeze({
|
|
@@ -64538,33 +64714,131 @@ function attachViewerHyperlinks(root, navigation) {
|
|
|
64538
64714
|
else root.setAttribute(readOnlyAttr, previousReadOnly);
|
|
64539
64715
|
};
|
|
64540
64716
|
}
|
|
64541
|
-
|
|
64542
|
-
|
|
64543
|
-
|
|
64544
|
-
|
|
64545
|
-
const
|
|
64546
|
-
|
|
64547
|
-
|
|
64548
|
-
|
|
64549
|
-
|
|
64550
|
-
|
|
64551
|
-
|
|
64552
|
-
|
|
64717
|
+
function createSlidePackageClipboard(initialHost) {
|
|
64718
|
+
let host2 = initialHost, disposed = false, pending = false;
|
|
64719
|
+
const retiredHandlers = /* @__PURE__ */ new Set();
|
|
64720
|
+
const mediaUrls = /* @__PURE__ */ new Set();
|
|
64721
|
+
const snapshot = () => {
|
|
64722
|
+
if (disposed) throw new Error("Presentation is closed");
|
|
64723
|
+
if (pending) throw new Error("Another clipboard operation is in progress");
|
|
64724
|
+
const value = host2.getSnapshot();
|
|
64725
|
+
if (!value) throw new Error("Open a presentation first");
|
|
64726
|
+
return value;
|
|
64727
|
+
};
|
|
64728
|
+
return {
|
|
64729
|
+
updateHost(next) {
|
|
64730
|
+
host2 = next;
|
|
64731
|
+
},
|
|
64732
|
+
async copy(indexes) {
|
|
64733
|
+
const before = snapshot();
|
|
64734
|
+
if (!indexes.length) throw new Error("Select slides to copy");
|
|
64735
|
+
const clipboard = globalThis.navigator?.clipboard;
|
|
64736
|
+
if (!clipboard) throw new Error("System clipboard is unavailable in this browser");
|
|
64737
|
+
const slides = templateEditing.buildSaveSlides(before.slides, before.templateElementsBySlideId).map(
|
|
64738
|
+
clone.cloneSlide
|
|
64739
|
+
);
|
|
64740
|
+
pending = true;
|
|
64741
|
+
try {
|
|
64742
|
+
const text3 = before.handler.save(slides).then((bytes) => pptx.createSlideClipboardPackage(bytes, indexes)).then(pptx.serializeSlidePackageClipboard);
|
|
64743
|
+
if (typeof ClipboardItem === "undefined" || !ClipboardItem.supports?.(pptx.SLIDE_PACKAGE_CLIPBOARD_MIME) || !clipboard.write) {
|
|
64744
|
+
await text3;
|
|
64745
|
+
throw new Error("This browser does not support slide packages in the system clipboard");
|
|
64746
|
+
}
|
|
64747
|
+
const preview = indexes.map(
|
|
64748
|
+
(index) => slides[index]?.elements.map(slideSearch.collectElementText).filter(Boolean).join("\n") ?? ""
|
|
64749
|
+
).join("\n\n");
|
|
64750
|
+
const blob = text3.then(
|
|
64751
|
+
(value) => new Blob([value], { type: pptx.SLIDE_PACKAGE_CLIPBOARD_MIME.slice(4) })
|
|
64752
|
+
);
|
|
64753
|
+
const write = clipboard.write([
|
|
64754
|
+
new ClipboardItem({
|
|
64755
|
+
[pptx.SLIDE_PACKAGE_CLIPBOARD_MIME]: blob,
|
|
64756
|
+
"text/plain": new Blob([preview], { type: "text/plain" })
|
|
64757
|
+
})
|
|
64758
|
+
]);
|
|
64759
|
+
const settled = await Promise.allSettled([write, text3]);
|
|
64760
|
+
for (const result of settled) if (result.status === "rejected") throw result.reason;
|
|
64761
|
+
} finally {
|
|
64762
|
+
pending = false;
|
|
64553
64763
|
}
|
|
64554
|
-
|
|
64555
|
-
|
|
64556
|
-
|
|
64557
|
-
|
|
64558
|
-
|
|
64764
|
+
},
|
|
64765
|
+
async paste(insertAt) {
|
|
64766
|
+
const before = snapshot();
|
|
64767
|
+
if (before.editable === false) throw new Error("Presentation is read-only");
|
|
64768
|
+
const clipboard = globalThis.navigator?.clipboard;
|
|
64769
|
+
if (!clipboard?.readText) throw new Error("System clipboard is unavailable in this browser");
|
|
64770
|
+
pending = true;
|
|
64771
|
+
let handler, committed = false;
|
|
64772
|
+
const urls = [];
|
|
64773
|
+
try {
|
|
64774
|
+
const items = clipboard.read ? await clipboard.read() : [];
|
|
64775
|
+
const item4 = items.find((value) => value.types.includes(pptx.SLIDE_PACKAGE_CLIPBOARD_MIME));
|
|
64776
|
+
const text3 = item4 ? await (await item4.getType(pptx.SLIDE_PACKAGE_CLIPBOARD_MIME)).text() : await clipboard.readText();
|
|
64777
|
+
const source = pptx.deserializeSlidePackageClipboard(text3);
|
|
64778
|
+
if (!source) throw new Error("The clipboard does not contain copied PowerPoint slides");
|
|
64779
|
+
const destination = await before.handler.save(
|
|
64780
|
+
templateEditing.buildSaveSlides(before.slides, before.templateElementsBySlideId).map(clone.cloneSlide)
|
|
64781
|
+
);
|
|
64782
|
+
const imported = await pptx.importSlidePackage(destination, source, { insertAt });
|
|
64783
|
+
handler = new pptx.PptxHandler();
|
|
64784
|
+
const data = await handler.load(
|
|
64785
|
+
imported.bytes.buffer.slice(
|
|
64786
|
+
imported.bytes.byteOffset,
|
|
64787
|
+
imported.bytes.byteOffset + imported.bytes.byteLength
|
|
64788
|
+
),
|
|
64789
|
+
{ eagerDecodeImages: true, allowExternalImages: before.allowExternalImages ?? false }
|
|
64790
|
+
);
|
|
64791
|
+
data.slides = await chunkU47LRWDT_cjs.resolveTableCellImageUrls(
|
|
64792
|
+
data.slides,
|
|
64793
|
+
(path) => handler.getImageData(path)
|
|
64794
|
+
);
|
|
64795
|
+
data.slides = await chunkU47LRWDT_cjs.resolveTextFillBlipUrls(
|
|
64796
|
+
data.slides,
|
|
64797
|
+
(path) => handler.getImageData(path)
|
|
64798
|
+
);
|
|
64799
|
+
const importedPaths = new Set(imported.slidePaths);
|
|
64800
|
+
const media = [];
|
|
64801
|
+
for (const slide of data.slides)
|
|
64802
|
+
if (importedPaths.has(slide.id)) chunkU47LRWDT_cjs.collectMediaElements(slide.elements, media);
|
|
64803
|
+
const nextMediaUrls = /* @__PURE__ */ new Map();
|
|
64804
|
+
for (const element of media) {
|
|
64805
|
+
const resolved = await chunkU47LRWDT_cjs.resolveMediaElementSource(element, handler);
|
|
64806
|
+
if (resolved.url && resolved.mediaPath) {
|
|
64807
|
+
nextMediaUrls.set(resolved.mediaPath, resolved.url);
|
|
64808
|
+
if (resolved.isBlobUrl) urls.push(resolved.url);
|
|
64809
|
+
} else element.mediaMissing = true;
|
|
64810
|
+
}
|
|
64811
|
+
const current = host2.getSnapshot();
|
|
64812
|
+
if (disposed || current?.editable === false || current?.handler !== before.handler || current?.templateElementsBySlideId !== before.templateElementsBySlideId || current.slides !== before.slides)
|
|
64813
|
+
throw new Error("Presentation changed while preparing paste. Try again");
|
|
64814
|
+
const partition = templateEditing.partitionTemplateElements(data.slides);
|
|
64815
|
+
host2.commit({
|
|
64816
|
+
handler,
|
|
64817
|
+
data,
|
|
64818
|
+
...partition,
|
|
64819
|
+
mediaUrls: nextMediaUrls,
|
|
64820
|
+
insertAt: Math.min(Math.max(0, insertAt), before.slides.length),
|
|
64821
|
+
count: imported.slidePaths.length
|
|
64822
|
+
});
|
|
64823
|
+
retiredHandlers.add(before.handler);
|
|
64824
|
+
for (const url of urls) mediaUrls.add(url);
|
|
64825
|
+
committed = true;
|
|
64826
|
+
} finally {
|
|
64827
|
+
pending = false;
|
|
64828
|
+
if (!committed) {
|
|
64829
|
+
handler?.dispose();
|
|
64830
|
+
for (const url of urls) URL.revokeObjectURL(url);
|
|
64831
|
+
}
|
|
64559
64832
|
}
|
|
64560
|
-
|
|
64561
|
-
|
|
64562
|
-
|
|
64833
|
+
},
|
|
64834
|
+
dispose() {
|
|
64835
|
+
disposed = true;
|
|
64836
|
+
for (const handler of retiredHandlers) handler.dispose();
|
|
64837
|
+
retiredHandlers.clear();
|
|
64838
|
+
for (const url of mediaUrls) URL.revokeObjectURL(url);
|
|
64839
|
+
mediaUrls.clear();
|
|
64563
64840
|
}
|
|
64564
|
-
}
|
|
64565
|
-
const style = doc.createElement("style");
|
|
64566
|
-
style.textContent = css;
|
|
64567
|
-
root.append(style);
|
|
64841
|
+
};
|
|
64568
64842
|
}
|
|
64569
64843
|
|
|
64570
64844
|
// src/pptx/web-components/mobile-bar-styles.ts
|
|
@@ -74261,7 +74535,8 @@ var controls = [
|
|
|
74261
74535
|
["pptx-ui-context-menu", definePptxContextMenu],
|
|
74262
74536
|
["pptx-ui-subtitle-settings", definePptxSubtitleSettings],
|
|
74263
74537
|
["pptx-ui-theme-editor", definePptxThemeEditor],
|
|
74264
|
-
["pptx-ui-title-bar", definePptxTitleBar]
|
|
74538
|
+
["pptx-ui-title-bar", definePptxTitleBar],
|
|
74539
|
+
["pptx-ui-slide-clipboard", definePptxSlideClipboard]
|
|
74265
74540
|
];
|
|
74266
74541
|
function registerPptxWebControls() {
|
|
74267
74542
|
if (typeof window === "undefined" || !window.customElements) {
|
|
@@ -76836,10 +77111,30 @@ Object.defineProperty(exports, "resolveSlideId", {
|
|
|
76836
77111
|
enumerable: true,
|
|
76837
77112
|
get: function () { return sectionOperations.resolveSlideId; }
|
|
76838
77113
|
});
|
|
77114
|
+
Object.defineProperty(exports, "applySlidePasteTemplates", {
|
|
77115
|
+
enumerable: true,
|
|
77116
|
+
get: function () { return slideOperations.applySlidePasteTemplates; }
|
|
77117
|
+
});
|
|
77118
|
+
Object.defineProperty(exports, "captureSlideClipboard", {
|
|
77119
|
+
enumerable: true,
|
|
77120
|
+
get: function () { return slideOperations.captureSlideClipboard; }
|
|
77121
|
+
});
|
|
77122
|
+
Object.defineProperty(exports, "captureSlideClipboardTemplates", {
|
|
77123
|
+
enumerable: true,
|
|
77124
|
+
get: function () { return slideOperations.captureSlideClipboardTemplates; }
|
|
77125
|
+
});
|
|
76839
77126
|
Object.defineProperty(exports, "createBlankSlide", {
|
|
76840
77127
|
enumerable: true,
|
|
76841
77128
|
get: function () { return slideOperations.createBlankSlide; }
|
|
76842
77129
|
});
|
|
77130
|
+
Object.defineProperty(exports, "createSlidePaste", {
|
|
77131
|
+
enumerable: true,
|
|
77132
|
+
get: function () { return slideOperations.createSlidePaste; }
|
|
77133
|
+
});
|
|
77134
|
+
Object.defineProperty(exports, "insertSlidePaste", {
|
|
77135
|
+
enumerable: true,
|
|
77136
|
+
get: function () { return slideOperations.insertSlidePaste; }
|
|
77137
|
+
});
|
|
76843
77138
|
Object.defineProperty(exports, "makeSlideId", {
|
|
76844
77139
|
enumerable: true,
|
|
76845
77140
|
get: function () { return slideOperations.makeSlideId; }
|
|
@@ -77108,6 +77403,10 @@ Object.defineProperty(exports, "findInSlides", {
|
|
|
77108
77403
|
enumerable: true,
|
|
77109
77404
|
get: function () { return findReplace.findInSlides; }
|
|
77110
77405
|
});
|
|
77406
|
+
Object.defineProperty(exports, "findReplacementAvailability", {
|
|
77407
|
+
enumerable: true,
|
|
77408
|
+
get: function () { return findReplace.findReplacementAvailability; }
|
|
77409
|
+
});
|
|
77111
77410
|
Object.defineProperty(exports, "replaceInSlides", {
|
|
77112
77411
|
enumerable: true,
|
|
77113
77412
|
get: function () { return findReplace.replaceInSlides; }
|
|
@@ -78432,6 +78731,7 @@ exports.createPresenterShowGuard = createPresenterShowGuard;
|
|
|
78432
78731
|
exports.createPresenterTimer = createPresenterTimer;
|
|
78433
78732
|
exports.createRibbonControlIcon = createRibbonControlIcon;
|
|
78434
78733
|
exports.createSheetDismissGesture = createSheetDismissGesture;
|
|
78734
|
+
exports.createSlidePackageClipboard = createSlidePackageClipboard;
|
|
78435
78735
|
exports.createSlideSorterState = createSlideSorterState;
|
|
78436
78736
|
exports.createSyncGate = createSyncGate;
|
|
78437
78737
|
exports.createTouchGestureRecognizer = createTouchGestureRecognizer;
|
|
@@ -78779,6 +79079,8 @@ exports.getOverflowSegments = getOverflowSegments;
|
|
|
78779
79079
|
exports.getP14TransitionAnimations = getP14TransitionAnimations;
|
|
78780
79080
|
exports.getPasswordStrength = getPasswordStrength;
|
|
78781
79081
|
exports.getPendingSelectionRestore = getPendingSelectionRestore;
|
|
79082
|
+
exports.getPictureFrameLayers = getPictureFrameLayers;
|
|
79083
|
+
exports.getPictureShadowFilter = getPictureShadowFilter;
|
|
78782
79084
|
exports.getPlaceholderStyle = getPlaceholderStyle;
|
|
78783
79085
|
exports.getPresentationContextMenuSections = getPresentationContextMenuSections;
|
|
78784
79086
|
exports.getPresetShapeVectorGeometry = getPresetShapeVectorGeometry;
|
|
@@ -78842,6 +79144,7 @@ exports.hasImageOverrides = hasImageOverrides;
|
|
|
78842
79144
|
exports.hasMotionPath = hasMotionPath;
|
|
78843
79145
|
exports.hasMultipleSelectedTableCells = hasMultipleSelectedTableCells;
|
|
78844
79146
|
exports.hasPersistentAudio = hasPersistentAudio;
|
|
79147
|
+
exports.hasPictureFrame = hasPictureFrame;
|
|
78845
79148
|
exports.hasShowSlideAfter = hasShowSlideAfter;
|
|
78846
79149
|
exports.hasStrokePaint = hasStrokePaint;
|
|
78847
79150
|
exports.hasText3dExtrusion = hasText3dExtrusion;
|
|
@@ -78883,6 +79186,7 @@ exports.innerShadowStateOf = innerShadowStateOf;
|
|
|
78883
79186
|
exports.insertCommentMention = insertCommentMention;
|
|
78884
79187
|
exports.insertHyperlinkAtSelection = insertHyperlinkAtSelection;
|
|
78885
79188
|
exports.insertLabel = insertLabel;
|
|
79189
|
+
exports.inspectorNumber = inspectorNumber;
|
|
78886
79190
|
exports.interpolateColor = interpolateColor;
|
|
78887
79191
|
exports.interpolateOutline = interpolateOutline;
|
|
78888
79192
|
exports.interpolatePaths = interpolatePaths;
|
|
@@ -79601,6 +79905,7 @@ exports.simplifyFreeformVertices = simplifyFreeformVertices;
|
|
|
79601
79905
|
exports.simplifyLoop = simplifyLoop;
|
|
79602
79906
|
exports.slideBackgroundClearPatch = slideBackgroundClearPatch;
|
|
79603
79907
|
exports.slideBackgroundClearState = slideBackgroundClearState;
|
|
79908
|
+
exports.slideClipboardLabels = slideClipboardLabels;
|
|
79604
79909
|
exports.slidePaneContextMenuLabelKey = slidePaneContextMenuLabelKey;
|
|
79605
79910
|
exports.slidePaneViewItems = slidePaneViewItems;
|
|
79606
79911
|
exports.slideProgressPercent = slideProgressPercent;
|
|
@@ -79626,6 +79931,7 @@ exports.solveShapeAdjustments = solveShapeAdjustments;
|
|
|
79626
79931
|
exports.sortEntranceAnimations = sortEntranceAnimations;
|
|
79627
79932
|
exports.sorterGridColumns = sorterGridColumns;
|
|
79628
79933
|
exports.sorterMenuContext = sorterMenuContext;
|
|
79934
|
+
exports.sorterPasteInsertAt = sorterPasteInsertAt;
|
|
79629
79935
|
exports.sorterSelectionIndexes = sorterSelectionIndexes;
|
|
79630
79936
|
exports.splitCubic = splitCubic;
|
|
79631
79937
|
exports.splitEastAsianBreaks = splitEastAsianBreaks;
|
|
@@ -689,6 +689,15 @@ var translationsEn = {
|
|
|
689
689
|
"pptx.findReplace.findPlaceholder": "Find\u2026",
|
|
690
690
|
"pptx.findReplace.searchText": "Search text",
|
|
691
691
|
"pptx.findReplace.matchCase": "Match case",
|
|
692
|
+
"pptx.findReplace.includeNotes": "Include speaker notes",
|
|
693
|
+
"pptx.findReplace.includeChartData": "Include chart series and category labels",
|
|
694
|
+
"pptx.findReplace.readOnlyChartText": "Linked or unsupported chart text can be found, but must be edited in PowerPoint or its source workbook.",
|
|
695
|
+
"pptx.findReplace.includeChartTitles": "Include chart titles",
|
|
696
|
+
"pptx.findReplace.readOnlyChartTitle": "Linked or complex chart titles can be found, but must be edited in PowerPoint or their source workbook.",
|
|
697
|
+
"pptx.slideSorter.systemCopy": "Copy slides to system clipboard",
|
|
698
|
+
"pptx.slideSorter.systemPaste": "Paste slides from system clipboard",
|
|
699
|
+
"pptx.slideSorter.systemCopied": "Slides copied",
|
|
700
|
+
"pptx.slideSorter.systemPasted": "Slides pasted",
|
|
692
701
|
"pptx.findReplace.toggleMatchCase": "Toggle match case",
|
|
693
702
|
"pptx.findReplace.previousMatch": "Previous match",
|
|
694
703
|
"pptx.findReplace.nextMatch": "Next match",
|