ooxml-ui 1.8.4 → 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-KMNNTEGF.cjs → chunk-BFZDO2DY.cjs} +429 -194
- package/dist/pptx/{chunk-VRFNAF3Q.mjs → chunk-F7BBPOVJ.mjs} +9 -0
- package/dist/pptx/{chunk-STXGHV25.cjs → chunk-HWW2UVUP.cjs} +161 -4
- package/dist/pptx/{chunk-GHFJ46NS.mjs → chunk-KBCKCW5M.mjs} +371 -161
- package/dist/pptx/{chunk-NVYVHNPD.mjs → chunk-MKVKISFW.mjs} +1 -1
- package/dist/pptx/{chunk-NKHPE4PS.cjs → chunk-PKDISDDZ.cjs} +2 -2
- package/dist/pptx/{chunk-SM3CWDIQ.cjs → chunk-QVYJB7G2.cjs} +9 -0
- package/dist/pptx/chunk-SABFKDRM.mjs +286 -0
- package/dist/pptx/dom/elements/image.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +221 -213
- package/dist/pptx/dom/index.mjs +24 -16
- 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 +2834 -2766
- package/dist/pptx/index.mjs +4 -4
- 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/format-painter.cjs +5 -5
- package/dist/pptx/render/format-painter.mjs +2 -2
- package/dist/pptx/render/index.d.ts +3 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector-helpers.cjs +12 -12
- package/dist/pptx/render/inspector-helpers.d.ts.map +1 -1
- package/dist/pptx/render/inspector-helpers.mjs +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/ribbon-home-commands.d.ts +11 -2
- package/dist/pptx/render/ribbon-home-commands.d.ts.map +1 -1
- 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/render/text-advanced.d.ts.map +1 -1
- package/dist/pptx/render/text-style-scope.d.ts +41 -1
- package/dist/pptx/render/text-style-scope.d.ts.map +1 -1
- package/dist/pptx/render/text-style-update.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/pptx/chunk-VD7HRMTA.mjs +0 -137
- /package/dist/{chunk-SUHT5S2P.js → chunk-SKYBYVYH.js} +0 -0
|
@@ -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",
|
|
@@ -61,6 +61,151 @@ function textStyleFlagsOf(element, selection = null, segments) {
|
|
|
61
61
|
}
|
|
62
62
|
return getSelectionTextStyleFlags(segments ?? element.textSegments, selection, element.textStyle);
|
|
63
63
|
}
|
|
64
|
+
var BODY_TEXT_STYLE_KEYS = /* @__PURE__ */ new Set([
|
|
65
|
+
// autofit (`a:normAutofit` / `a:spAutoFit`)
|
|
66
|
+
"autoFit",
|
|
67
|
+
"autoFitMode",
|
|
68
|
+
"autoFitFontScale",
|
|
69
|
+
"autoFitLineSpacingReduction",
|
|
70
|
+
// `a:bodyPr` anchoring, direction, rotation
|
|
71
|
+
"vAlign",
|
|
72
|
+
"anchorCenter",
|
|
73
|
+
"textDirection",
|
|
74
|
+
"textBodyRotation",
|
|
75
|
+
"upright",
|
|
76
|
+
// `a:bodyPr` columns, overflow, wrap
|
|
77
|
+
"columnCount",
|
|
78
|
+
"columnSpacing",
|
|
79
|
+
"rtlColumns",
|
|
80
|
+
"hOverflow",
|
|
81
|
+
"vertOverflow",
|
|
82
|
+
"textWrap",
|
|
83
|
+
// `a:bodyPr` insets
|
|
84
|
+
"bodyInsetLeft",
|
|
85
|
+
"bodyInsetTop",
|
|
86
|
+
"bodyInsetRight",
|
|
87
|
+
"bodyInsetBottom",
|
|
88
|
+
// paragraph geometry the block applies body-wide
|
|
89
|
+
"paragraphMarginLeft",
|
|
90
|
+
"paragraphMarginRight",
|
|
91
|
+
"paragraphIndent",
|
|
92
|
+
"paragraphSpacingBefore",
|
|
93
|
+
"paragraphSpacingAfter",
|
|
94
|
+
"lineSpacing",
|
|
95
|
+
"lineSpacingExactPt",
|
|
96
|
+
"tabStops",
|
|
97
|
+
"defaultTabSize",
|
|
98
|
+
"eaLineBreak",
|
|
99
|
+
"latinLineBreak",
|
|
100
|
+
"fontAlignment",
|
|
101
|
+
"hangingPunctuation",
|
|
102
|
+
// `a:bodyPr` flags
|
|
103
|
+
"spaceFirstLastParagraph",
|
|
104
|
+
"fromWordArt",
|
|
105
|
+
"forceAntiAlias",
|
|
106
|
+
"compatibleLineSpacing",
|
|
107
|
+
// warp and 3D scene on the body
|
|
108
|
+
"textWarpPreset",
|
|
109
|
+
"textWarpAdj",
|
|
110
|
+
"textWarpAdj2",
|
|
111
|
+
"text3d",
|
|
112
|
+
"textBodyScene3d",
|
|
113
|
+
"textBodyScene3dXml",
|
|
114
|
+
"flatText",
|
|
115
|
+
"bodyPropertiesExtLstXml"
|
|
116
|
+
]);
|
|
117
|
+
function isBodyTextStyleKey(key) {
|
|
118
|
+
return BODY_TEXT_STYLE_KEYS.has(key);
|
|
119
|
+
}
|
|
120
|
+
function splitTextStyleUpdate(updates) {
|
|
121
|
+
const body = {};
|
|
122
|
+
const run = {};
|
|
123
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
124
|
+
(isBodyTextStyleKey(key) ? body : run)[key] = value;
|
|
125
|
+
}
|
|
126
|
+
return { body, run };
|
|
127
|
+
}
|
|
128
|
+
function reconcileDecorationFlags(segments, textStyle, flags) {
|
|
129
|
+
const nextStyle = { ...textStyle ?? {} };
|
|
130
|
+
let nextSegments = [...segments];
|
|
131
|
+
for (const flag of flags) {
|
|
132
|
+
const body = nextStyle[flag] ?? false;
|
|
133
|
+
const content = nextSegments.filter(isContentSegment);
|
|
134
|
+
if (content.length === 0) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (content.every((segment) => segment.style?.[flag] ?? body)) {
|
|
138
|
+
nextStyle[flag] = true;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (!body) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
delete nextStyle[flag];
|
|
145
|
+
nextSegments = nextSegments.map(
|
|
146
|
+
(segment) => isContentSegment(segment) && segment.style?.[flag] === void 0 ? { ...segment, style: { ...segment.style, [flag]: true } } : segment
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return { textStyle: nextStyle, textSegments: nextSegments };
|
|
150
|
+
}
|
|
151
|
+
var LINE_SPACING_TWIN = {
|
|
152
|
+
lineSpacing: "lineSpacingExactPt",
|
|
153
|
+
lineSpacingExactPt: "lineSpacing"
|
|
154
|
+
};
|
|
155
|
+
function withExclusiveLineSpacing(updates) {
|
|
156
|
+
const next = { ...updates };
|
|
157
|
+
for (const key of Object.keys(updates)) {
|
|
158
|
+
const twin = LINE_SPACING_TWIN[key];
|
|
159
|
+
if (twin && updates[key] !== void 0 && !(twin in updates)) {
|
|
160
|
+
next[twin] = void 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return next;
|
|
164
|
+
}
|
|
165
|
+
function overrideParagraphProperties(segments, updates) {
|
|
166
|
+
const keys = Object.keys(updates).filter(isBodyTextStyleKey);
|
|
167
|
+
return segments.map((segment) => {
|
|
168
|
+
const own = segment.paragraphProperties;
|
|
169
|
+
const declared = own ? keys.filter((key) => {
|
|
170
|
+
const twin = LINE_SPACING_TWIN[key];
|
|
171
|
+
return key in own || twin !== void 0 && twin in own;
|
|
172
|
+
}) : [];
|
|
173
|
+
if (!own || declared.length === 0) {
|
|
174
|
+
return segment;
|
|
175
|
+
}
|
|
176
|
+
const next = { ...own };
|
|
177
|
+
for (const key of declared) {
|
|
178
|
+
if (updates[key] === void 0) {
|
|
179
|
+
delete next[key];
|
|
180
|
+
} else {
|
|
181
|
+
Object.assign(next, { [key]: updates[key] });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return { ...segment, paragraphProperties: next };
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function overrideParagraphIndents(element, updates) {
|
|
188
|
+
const { paragraphMarginLeft, paragraphIndent } = updates;
|
|
189
|
+
if (!pptx.hasTextProperties(element) || !element.paragraphIndents || paragraphMarginLeft === void 0 && paragraphIndent === void 0) {
|
|
190
|
+
return {};
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
paragraphIndents: element.paragraphIndents.map((entry) => ({
|
|
194
|
+
...entry,
|
|
195
|
+
...paragraphMarginLeft === void 0 ? {} : { marginLeft: paragraphMarginLeft },
|
|
196
|
+
...paragraphIndent === void 0 ? {} : { indent: paragraphIndent }
|
|
197
|
+
}))
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function paragraphOverridePatch(element, updates) {
|
|
201
|
+
const current = pptx.hasTextProperties(element) ? element.textSegments : void 0;
|
|
202
|
+
const overridden = current && overrideParagraphProperties(current, updates);
|
|
203
|
+
const changed = overridden?.some((segment, index) => segment !== current?.[index]);
|
|
204
|
+
return {
|
|
205
|
+
...changed ? { textSegments: overridden } : {},
|
|
206
|
+
...overrideParagraphIndents(element, updates)
|
|
207
|
+
};
|
|
208
|
+
}
|
|
64
209
|
|
|
65
210
|
// src/pptx/render/inspector-helpers.ts
|
|
66
211
|
var DEFAULT_FILL = "#ffffff";
|
|
@@ -112,15 +257,19 @@ function shapeStylePatch(el, changes) {
|
|
|
112
257
|
}
|
|
113
258
|
function textStylePatch(el, changes) {
|
|
114
259
|
const base = pptx.hasTextProperties(el) ? el.textStyle ?? {} : {};
|
|
260
|
+
const exclusive = withExclusiveLineSpacing(changes);
|
|
261
|
+
const paragraphs = paragraphOverridePatch(el, exclusive);
|
|
262
|
+
const segments = paragraphs.textSegments ?? (pptx.hasTextProperties(el) ? el.textSegments : void 0);
|
|
115
263
|
return {
|
|
116
|
-
...
|
|
117
|
-
|
|
118
|
-
|
|
264
|
+
...paragraphs,
|
|
265
|
+
...segments?.some((segment) => segment.paragraphInsertionStyle) ? {
|
|
266
|
+
textSegments: segments.map(
|
|
267
|
+
(segment) => chunkOGJRSAGH_cjs.updateTextSegmentStyle(segment, exclusive, { updateBodyStyle: false })
|
|
119
268
|
)
|
|
120
269
|
} : {},
|
|
121
270
|
textStyle: {
|
|
122
271
|
...base,
|
|
123
|
-
...
|
|
272
|
+
...exclusive
|
|
124
273
|
}
|
|
125
274
|
};
|
|
126
275
|
}
|
|
@@ -187,20 +336,28 @@ Object.defineProperty(exports, "withoutListType", {
|
|
|
187
336
|
enumerable: true,
|
|
188
337
|
get: function () { return bulletToggle.withoutListType; }
|
|
189
338
|
});
|
|
339
|
+
exports.BODY_TEXT_STYLE_KEYS = BODY_TEXT_STYLE_KEYS;
|
|
190
340
|
exports.DEFAULT_FONT_SIZE = DEFAULT_FONT_SIZE;
|
|
191
341
|
exports.TEXT_DECORATION_FLAGS = TEXT_DECORATION_FLAGS;
|
|
192
342
|
exports.contentSegmentsInSelection = contentSegmentsInSelection;
|
|
193
343
|
exports.fillColorOf = fillColorOf;
|
|
194
344
|
exports.fontSizeOf = fontSizeOf;
|
|
195
345
|
exports.getSelectionTextStyleFlags = getSelectionTextStyleFlags;
|
|
346
|
+
exports.isBodyTextStyleKey = isBodyTextStyleKey;
|
|
196
347
|
exports.isBold = isBold;
|
|
197
348
|
exports.isContentSegment = isContentSegment;
|
|
198
349
|
exports.isItalic = isItalic;
|
|
199
350
|
exports.isUnderline = isUnderline;
|
|
200
351
|
exports.nextToggleValue = nextToggleValue;
|
|
352
|
+
exports.overrideParagraphIndents = overrideParagraphIndents;
|
|
353
|
+
exports.overrideParagraphProperties = overrideParagraphProperties;
|
|
354
|
+
exports.paragraphOverridePatch = paragraphOverridePatch;
|
|
355
|
+
exports.reconcileDecorationFlags = reconcileDecorationFlags;
|
|
201
356
|
exports.shapeStylePatch = shapeStylePatch;
|
|
357
|
+
exports.splitTextStyleUpdate = splitTextStyleUpdate;
|
|
202
358
|
exports.strokeColorOf = strokeColorOf;
|
|
203
359
|
exports.textColorOf = textColorOf;
|
|
204
360
|
exports.textFontSizePatch = textFontSizePatch;
|
|
205
361
|
exports.textStyleFlagsOf = textStyleFlagsOf;
|
|
206
362
|
exports.textStylePatch = textStylePatch;
|
|
363
|
+
exports.withExclusiveLineSpacing = withExclusiveLineSpacing;
|