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.
Files changed (87) hide show
  1. package/dist/{chunk-CTPXTRDT.js → chunk-PH7IBZOZ.js} +1 -1
  2. package/dist/docx/columns-dialog.d.ts +1 -1
  3. package/dist/docx/editor-core.d.ts +2 -0
  4. package/dist/docx/page-controller.d.ts +3 -2
  5. package/dist/docx/print-drag-scroll.d.ts +7 -0
  6. package/dist/docx/print-editing-geometry.d.ts +2 -0
  7. package/dist/docx/print-editing-index.d.ts +30 -0
  8. package/dist/docx/print-editing.d.ts +12 -0
  9. package/dist/docx/print-keyboard-navigation.d.ts +18 -0
  10. package/dist/docx/print-layout-view.d.ts +6 -10
  11. package/dist/docx/print-layout.d.ts +2 -2
  12. package/dist/docx/print-picture.d.ts +1 -0
  13. package/dist/docx.js +677 -20
  14. package/dist/index.js +2 -2
  15. package/dist/pptx/{chunk-KMNNTEGF.cjs → chunk-BFZDO2DY.cjs} +429 -194
  16. package/dist/pptx/{chunk-VRFNAF3Q.mjs → chunk-F7BBPOVJ.mjs} +9 -0
  17. package/dist/pptx/{chunk-STXGHV25.cjs → chunk-HWW2UVUP.cjs} +161 -4
  18. package/dist/pptx/{chunk-GHFJ46NS.mjs → chunk-KBCKCW5M.mjs} +371 -161
  19. package/dist/pptx/{chunk-NVYVHNPD.mjs → chunk-MKVKISFW.mjs} +1 -1
  20. package/dist/pptx/{chunk-NKHPE4PS.cjs → chunk-PKDISDDZ.cjs} +2 -2
  21. package/dist/pptx/{chunk-SM3CWDIQ.cjs → chunk-QVYJB7G2.cjs} +9 -0
  22. package/dist/pptx/chunk-SABFKDRM.mjs +286 -0
  23. package/dist/pptx/dom/elements/image.d.ts.map +1 -1
  24. package/dist/pptx/dom/index.cjs +221 -213
  25. package/dist/pptx/dom/index.mjs +24 -16
  26. package/dist/pptx/i18n/index.cjs +6 -6
  27. package/dist/pptx/i18n/index.mjs +1 -1
  28. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  29. package/dist/pptx/index.cjs +2834 -2766
  30. package/dist/pptx/index.mjs +4 -4
  31. package/dist/pptx/render/find-replace.d.ts +1 -1
  32. package/dist/pptx/render/find-replace.d.ts.map +1 -1
  33. package/dist/pptx/render/format-painter.cjs +5 -5
  34. package/dist/pptx/render/format-painter.mjs +2 -2
  35. package/dist/pptx/render/index.d.ts +3 -0
  36. package/dist/pptx/render/index.d.ts.map +1 -1
  37. package/dist/pptx/render/inspector-helpers.cjs +12 -12
  38. package/dist/pptx/render/inspector-helpers.d.ts.map +1 -1
  39. package/dist/pptx/render/inspector-helpers.mjs +1 -1
  40. package/dist/pptx/render/inspector-number.d.ts +15 -0
  41. package/dist/pptx/render/inspector-number.d.ts.map +1 -0
  42. package/dist/pptx/render/picture-frame.d.ts +52 -0
  43. package/dist/pptx/render/picture-frame.d.ts.map +1 -0
  44. package/dist/pptx/render/ribbon-home-commands.d.ts +11 -2
  45. package/dist/pptx/render/ribbon-home-commands.d.ts.map +1 -1
  46. package/dist/pptx/render/share-session.d.ts.map +1 -1
  47. package/dist/pptx/render/slide-operations.d.ts +2 -1
  48. package/dist/pptx/render/slide-operations.d.ts.map +1 -1
  49. package/dist/pptx/render/slide-package-clipboard.d.ts +31 -0
  50. package/dist/pptx/render/slide-package-clipboard.d.ts.map +1 -0
  51. package/dist/pptx/render/slide-sorter-context-menu.d.ts +3 -5
  52. package/dist/pptx/render/slide-sorter-context-menu.d.ts.map +1 -1
  53. package/dist/pptx/render/slide-sorter-state.d.ts +8 -1
  54. package/dist/pptx/render/slide-sorter-state.d.ts.map +1 -1
  55. package/dist/pptx/render/text-advanced.d.ts.map +1 -1
  56. package/dist/pptx/render/text-style-scope.d.ts +41 -1
  57. package/dist/pptx/render/text-style-scope.d.ts.map +1 -1
  58. package/dist/pptx/render/text-style-update.d.ts.map +1 -1
  59. package/dist/pptx/web-components/index.d.ts +2 -0
  60. package/dist/pptx/web-components/index.d.ts.map +1 -1
  61. package/dist/pptx/web-components/slide-clipboard.d.ts +14 -0
  62. package/dist/pptx/web-components/slide-clipboard.d.ts.map +1 -0
  63. package/dist/teams.js +1 -1
  64. package/dist/visio/format-pane-fields.d.ts +2 -0
  65. package/dist/visio/page-setup-action.d.ts +1 -1
  66. package/dist/visio/page-setup-dialog-form.d.ts +1 -1
  67. package/dist/visio/ribbon-action.d.ts +1 -1
  68. package/dist/visio/viewer-accessibility.d.ts +17 -0
  69. package/dist/visio/viewer-insert-dialog.d.ts +2 -1
  70. package/dist/visio/viewer-review.d.ts +2 -0
  71. package/dist/visio.js +304 -14
  72. package/dist/xlsx/commands/pivots.d.ts +2 -0
  73. package/dist/xlsx/commands/sparklines.d.ts +2 -0
  74. package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
  75. package/dist/xlsx/dialogs/page-header.d.ts +4 -0
  76. package/dist/xlsx/dialogs/page-setup-tabs.d.ts +6 -1
  77. package/dist/xlsx/dialogs/pivots.d.ts +2 -0
  78. package/dist/xlsx/dialogs/print-preview.d.ts +2 -0
  79. package/dist/xlsx/dialogs/sparklines.d.ts +4 -0
  80. package/dist/xlsx/print-cell.d.ts +4 -0
  81. package/dist/xlsx/print-header.d.ts +7 -0
  82. package/dist/xlsx/print-pages.d.ts +4 -0
  83. package/dist/xlsx/print.d.ts +4 -12
  84. package/dist/xlsx.js +1078 -287
  85. package/package.json +3 -3
  86. package/dist/pptx/chunk-VD7HRMTA.mjs +0 -137
  87. /package/dist/{chunk-SUHT5S2P.js → chunk-SKYBYVYH.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { textStylePatch } from './chunk-VD7HRMTA.mjs';
1
+ import { textStylePatch } from './chunk-SABFKDRM.mjs';
2
2
  import { hasShapeProperties, hasTextProperties } from 'ooxml-core/pptx';
3
3
 
4
4
  function copyFormatFromElement(element) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkSTXGHV25_cjs = require('./chunk-STXGHV25.cjs');
3
+ var chunkHWW2UVUP_cjs = require('./chunk-HWW2UVUP.cjs');
4
4
  var pptx = require('ooxml-core/pptx');
5
5
 
6
6
  function copyFormatFromElement(element) {
@@ -77,7 +77,7 @@ function applyFormatToElement(element, format) {
77
77
  if (format.textStyle && pptx.hasTextProperties(updated)) {
78
78
  updated = {
79
79
  ...updated,
80
- ...chunkSTXGHV25_cjs.textStylePatch(updated, definedEntries(format.textStyle))
80
+ ...chunkHWW2UVUP_cjs.textStylePatch(updated, definedEntries(format.textStyle))
81
81
  };
82
82
  }
83
83
  return updated;
@@ -691,6 +691,15 @@ var translationsEn = {
691
691
  "pptx.findReplace.findPlaceholder": "Find\u2026",
692
692
  "pptx.findReplace.searchText": "Search text",
693
693
  "pptx.findReplace.matchCase": "Match case",
694
+ "pptx.findReplace.includeNotes": "Include speaker notes",
695
+ "pptx.findReplace.includeChartData": "Include chart series and category labels",
696
+ "pptx.findReplace.readOnlyChartText": "Linked or unsupported chart text can be found, but must be edited in PowerPoint or its source workbook.",
697
+ "pptx.findReplace.includeChartTitles": "Include chart titles",
698
+ "pptx.findReplace.readOnlyChartTitle": "Linked or complex chart titles can be found, but must be edited in PowerPoint or their source workbook.",
699
+ "pptx.slideSorter.systemCopy": "Copy slides to system clipboard",
700
+ "pptx.slideSorter.systemPaste": "Paste slides from system clipboard",
701
+ "pptx.slideSorter.systemCopied": "Slides copied",
702
+ "pptx.slideSorter.systemPasted": "Slides pasted",
694
703
  "pptx.findReplace.toggleMatchCase": "Toggle match case",
695
704
  "pptx.findReplace.previousMatch": "Previous match",
696
705
  "pptx.findReplace.nextMatch": "Next match",
@@ -0,0 +1,286 @@
1
+ import { textFontSizePxToPt } from './chunk-SMSCEGAE.mjs';
2
+ import { updateTextSegmentStyle } from './chunk-CENGE3TZ.mjs';
3
+ import { hasTextProperties, hasShapeProperties } from 'ooxml-core/pptx';
4
+ import { isBulletMarkerSegment } from 'ooxml-core/pptx/editor/render/bullet-toggle';
5
+ export { DEFAULT_AUTONUM_TYPE, DEFAULT_BULLET_CHAR, bulletInfoForKind, elementBulletKind, isBulletMarkerSegment, paragraphBulletKind, paragraphsBulletKind, resolveBulletSegments, setElementBullets, splitBulletParagraphs, toggleElementBullets, toggleParagraphBullet, withoutListType } from 'ooxml-core/pptx/editor/render/bullet-toggle';
6
+
7
+ // src/pptx/render/selection-format-state.ts
8
+ var TEXT_DECORATION_FLAGS = [
9
+ "bold",
10
+ "italic",
11
+ "underline",
12
+ "strikethrough"
13
+ ];
14
+ function isContentSegment(segment) {
15
+ return !segment.isParagraphBreak && segment.text !== "\n" && segment.text.length > 0 && !isBulletMarkerSegment(segment);
16
+ }
17
+ function contentSegmentsInSelection(segments, selection) {
18
+ if (!segments) {
19
+ return [];
20
+ }
21
+ return segments.filter((segment, index) => {
22
+ if (!isContentSegment(segment)) {
23
+ return false;
24
+ }
25
+ if (!selection) {
26
+ return true;
27
+ }
28
+ if (index < selection.startSegIdx || index > selection.endSegIdx) {
29
+ return false;
30
+ }
31
+ if (selection.startSegIdx === selection.endSegIdx && selection.startOffset === selection.endOffset) {
32
+ return true;
33
+ }
34
+ const start = index === selection.startSegIdx ? selection.startOffset : 0;
35
+ const end = index === selection.endSegIdx ? selection.endOffset : segment.text.length;
36
+ return end > start;
37
+ });
38
+ }
39
+ function flagState(values) {
40
+ if (values.every((value) => value)) {
41
+ return "on";
42
+ }
43
+ return values.some((value) => value) ? "mixed" : "off";
44
+ }
45
+ function getSelectionTextStyleFlags(segments, selection, elementTextStyle) {
46
+ const runs = contentSegmentsInSelection(segments, selection);
47
+ const flags = {};
48
+ for (const flag of TEXT_DECORATION_FLAGS) {
49
+ const body = elementTextStyle?.[flag] ?? false;
50
+ flags[flag] = runs.length === 0 ? flagState([body]) : flagState(runs.map((run) => run.style?.[flag] ?? body));
51
+ }
52
+ return flags;
53
+ }
54
+ function nextToggleValue(state) {
55
+ return state !== "on";
56
+ }
57
+ function textStyleFlagsOf(element, selection = null, segments) {
58
+ if (!element || !hasTextProperties(element)) {
59
+ return { bold: "off", italic: "off", underline: "off", strikethrough: "off" };
60
+ }
61
+ return getSelectionTextStyleFlags(segments ?? element.textSegments, selection, element.textStyle);
62
+ }
63
+ var BODY_TEXT_STYLE_KEYS = /* @__PURE__ */ new Set([
64
+ // autofit (`a:normAutofit` / `a:spAutoFit`)
65
+ "autoFit",
66
+ "autoFitMode",
67
+ "autoFitFontScale",
68
+ "autoFitLineSpacingReduction",
69
+ // `a:bodyPr` anchoring, direction, rotation
70
+ "vAlign",
71
+ "anchorCenter",
72
+ "textDirection",
73
+ "textBodyRotation",
74
+ "upright",
75
+ // `a:bodyPr` columns, overflow, wrap
76
+ "columnCount",
77
+ "columnSpacing",
78
+ "rtlColumns",
79
+ "hOverflow",
80
+ "vertOverflow",
81
+ "textWrap",
82
+ // `a:bodyPr` insets
83
+ "bodyInsetLeft",
84
+ "bodyInsetTop",
85
+ "bodyInsetRight",
86
+ "bodyInsetBottom",
87
+ // paragraph geometry the block applies body-wide
88
+ "paragraphMarginLeft",
89
+ "paragraphMarginRight",
90
+ "paragraphIndent",
91
+ "paragraphSpacingBefore",
92
+ "paragraphSpacingAfter",
93
+ "lineSpacing",
94
+ "lineSpacingExactPt",
95
+ "tabStops",
96
+ "defaultTabSize",
97
+ "eaLineBreak",
98
+ "latinLineBreak",
99
+ "fontAlignment",
100
+ "hangingPunctuation",
101
+ // `a:bodyPr` flags
102
+ "spaceFirstLastParagraph",
103
+ "fromWordArt",
104
+ "forceAntiAlias",
105
+ "compatibleLineSpacing",
106
+ // warp and 3D scene on the body
107
+ "textWarpPreset",
108
+ "textWarpAdj",
109
+ "textWarpAdj2",
110
+ "text3d",
111
+ "textBodyScene3d",
112
+ "textBodyScene3dXml",
113
+ "flatText",
114
+ "bodyPropertiesExtLstXml"
115
+ ]);
116
+ function isBodyTextStyleKey(key) {
117
+ return BODY_TEXT_STYLE_KEYS.has(key);
118
+ }
119
+ function splitTextStyleUpdate(updates) {
120
+ const body = {};
121
+ const run = {};
122
+ for (const [key, value] of Object.entries(updates)) {
123
+ (isBodyTextStyleKey(key) ? body : run)[key] = value;
124
+ }
125
+ return { body, run };
126
+ }
127
+ function reconcileDecorationFlags(segments, textStyle, flags) {
128
+ const nextStyle = { ...textStyle ?? {} };
129
+ let nextSegments = [...segments];
130
+ for (const flag of flags) {
131
+ const body = nextStyle[flag] ?? false;
132
+ const content = nextSegments.filter(isContentSegment);
133
+ if (content.length === 0) {
134
+ continue;
135
+ }
136
+ if (content.every((segment) => segment.style?.[flag] ?? body)) {
137
+ nextStyle[flag] = true;
138
+ continue;
139
+ }
140
+ if (!body) {
141
+ continue;
142
+ }
143
+ delete nextStyle[flag];
144
+ nextSegments = nextSegments.map(
145
+ (segment) => isContentSegment(segment) && segment.style?.[flag] === void 0 ? { ...segment, style: { ...segment.style, [flag]: true } } : segment
146
+ );
147
+ }
148
+ return { textStyle: nextStyle, textSegments: nextSegments };
149
+ }
150
+ var LINE_SPACING_TWIN = {
151
+ lineSpacing: "lineSpacingExactPt",
152
+ lineSpacingExactPt: "lineSpacing"
153
+ };
154
+ function withExclusiveLineSpacing(updates) {
155
+ const next = { ...updates };
156
+ for (const key of Object.keys(updates)) {
157
+ const twin = LINE_SPACING_TWIN[key];
158
+ if (twin && updates[key] !== void 0 && !(twin in updates)) {
159
+ next[twin] = void 0;
160
+ }
161
+ }
162
+ return next;
163
+ }
164
+ function overrideParagraphProperties(segments, updates) {
165
+ const keys = Object.keys(updates).filter(isBodyTextStyleKey);
166
+ return segments.map((segment) => {
167
+ const own = segment.paragraphProperties;
168
+ const declared = own ? keys.filter((key) => {
169
+ const twin = LINE_SPACING_TWIN[key];
170
+ return key in own || twin !== void 0 && twin in own;
171
+ }) : [];
172
+ if (!own || declared.length === 0) {
173
+ return segment;
174
+ }
175
+ const next = { ...own };
176
+ for (const key of declared) {
177
+ if (updates[key] === void 0) {
178
+ delete next[key];
179
+ } else {
180
+ Object.assign(next, { [key]: updates[key] });
181
+ }
182
+ }
183
+ return { ...segment, paragraphProperties: next };
184
+ });
185
+ }
186
+ function overrideParagraphIndents(element, updates) {
187
+ const { paragraphMarginLeft, paragraphIndent } = updates;
188
+ if (!hasTextProperties(element) || !element.paragraphIndents || paragraphMarginLeft === void 0 && paragraphIndent === void 0) {
189
+ return {};
190
+ }
191
+ return {
192
+ paragraphIndents: element.paragraphIndents.map((entry) => ({
193
+ ...entry,
194
+ ...paragraphMarginLeft === void 0 ? {} : { marginLeft: paragraphMarginLeft },
195
+ ...paragraphIndent === void 0 ? {} : { indent: paragraphIndent }
196
+ }))
197
+ };
198
+ }
199
+ function paragraphOverridePatch(element, updates) {
200
+ const current = hasTextProperties(element) ? element.textSegments : void 0;
201
+ const overridden = current && overrideParagraphProperties(current, updates);
202
+ const changed = overridden?.some((segment, index) => segment !== current?.[index]);
203
+ return {
204
+ ...changed ? { textSegments: overridden } : {},
205
+ ...overrideParagraphIndents(element, updates)
206
+ };
207
+ }
208
+
209
+ // src/pptx/render/inspector-helpers.ts
210
+ var DEFAULT_FILL = "#ffffff";
211
+ var DEFAULT_STROKE = "#000000";
212
+ var DEFAULT_TEXT_COLOR = "#000000";
213
+ var DEFAULT_FONT_SIZE = 18;
214
+ function fillColorOf(el) {
215
+ if (hasShapeProperties(el)) {
216
+ return el.shapeStyle?.fillColor ?? DEFAULT_FILL;
217
+ }
218
+ return DEFAULT_FILL;
219
+ }
220
+ function strokeColorOf(el) {
221
+ if (hasShapeProperties(el)) {
222
+ return el.shapeStyle?.strokeColor ?? DEFAULT_STROKE;
223
+ }
224
+ return DEFAULT_STROKE;
225
+ }
226
+ function textColorOf(el) {
227
+ if (hasTextProperties(el)) {
228
+ return el.textStyle?.color ?? DEFAULT_TEXT_COLOR;
229
+ }
230
+ return DEFAULT_TEXT_COLOR;
231
+ }
232
+ function fontSizeOf(el, presentationDefault) {
233
+ if (hasTextProperties(el) && el.textStyle?.fontSize !== void 0) {
234
+ return textFontSizePxToPt(el.textStyle.fontSize);
235
+ }
236
+ const deckDefault = presentationDefault?.levelStyles?.[0]?.fontSize;
237
+ return deckDefault === void 0 ? DEFAULT_FONT_SIZE : textFontSizePxToPt(deckDefault);
238
+ }
239
+ function isBold(el) {
240
+ return textStyleFlagsOf(el).bold === "on";
241
+ }
242
+ function isItalic(el) {
243
+ return textStyleFlagsOf(el).italic === "on";
244
+ }
245
+ function isUnderline(el) {
246
+ return textStyleFlagsOf(el).underline === "on";
247
+ }
248
+ function shapeStylePatch(el, changes) {
249
+ const base = hasShapeProperties(el) ? el.shapeStyle ?? {} : {};
250
+ return {
251
+ shapeStyle: {
252
+ ...base,
253
+ ...changes
254
+ }
255
+ };
256
+ }
257
+ function textStylePatch(el, changes) {
258
+ const base = hasTextProperties(el) ? el.textStyle ?? {} : {};
259
+ const exclusive = withExclusiveLineSpacing(changes);
260
+ const paragraphs = paragraphOverridePatch(el, exclusive);
261
+ const segments = paragraphs.textSegments ?? (hasTextProperties(el) ? el.textSegments : void 0);
262
+ return {
263
+ ...paragraphs,
264
+ ...segments?.some((segment) => segment.paragraphInsertionStyle) ? {
265
+ textSegments: segments.map(
266
+ (segment) => updateTextSegmentStyle(segment, exclusive, { updateBodyStyle: false })
267
+ )
268
+ } : {},
269
+ textStyle: {
270
+ ...base,
271
+ ...exclusive
272
+ }
273
+ };
274
+ }
275
+ function textFontSizePatch(el, fontSize) {
276
+ const patch = textStylePatch(el, { fontSize });
277
+ if (!hasTextProperties(el) || !el.textSegments) {
278
+ return patch;
279
+ }
280
+ return {
281
+ ...patch,
282
+ textSegments: el.textSegments.map((segment) => updateTextSegmentStyle(segment, { fontSize }))
283
+ };
284
+ }
285
+
286
+ export { BODY_TEXT_STYLE_KEYS, DEFAULT_FONT_SIZE, TEXT_DECORATION_FLAGS, contentSegmentsInSelection, fillColorOf, fontSizeOf, getSelectionTextStyleFlags, isBodyTextStyleKey, isBold, isContentSegment, isItalic, isUnderline, nextToggleValue, overrideParagraphIndents, overrideParagraphProperties, paragraphOverridePatch, reconcileDecorationFlags, shapeStylePatch, splitTextStyleUpdate, strokeColorOf, textColorOf, textFontSizePatch, textStyleFlagsOf, textStylePatch, withExclusiveLineSpacing };
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/pptx/dom/elements/image.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAqJhC,CAAC"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/pptx/dom/elements/image.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAgKhC,CAAC"}