ooxml-ui 1.27.0 → 1.28.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/chart/data-sheet-keys.d.ts +1 -0
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-common.d.ts +1 -0
- package/dist/chart/format-pane-fill-line.d.ts +1 -0
- package/dist/chart/format-pane-text.d.ts +1 -0
- package/dist/pptx/{chunk-43NFRLCD.cjs → chunk-37VJFRCP.cjs} +2 -2
- package/dist/pptx/{chunk-A3JJOLTS.cjs → chunk-3AFB46RL.cjs} +44 -43
- package/dist/pptx/{chunk-72P6AWRA.mjs → chunk-67L75M6K.mjs} +1 -1
- package/dist/pptx/{chunk-LAF5W2UR.mjs → chunk-7OD74VJC.mjs} +2 -1
- package/dist/pptx/{chunk-6QLGEV3I.mjs → chunk-CT7UD6VL.mjs} +547 -83
- package/dist/pptx/{chunk-B4GBGPNL.cjs → chunk-CWWL7MCL.cjs} +99 -0
- package/dist/pptx/{chunk-7DIZOCO4.mjs → chunk-FUKVYJPM.mjs} +59 -2
- package/dist/pptx/{chunk-I6ZVSJAR.cjs → chunk-WBFAVFD4.cjs} +577 -139
- package/dist/pptx/dom/index.cjs +384 -384
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/index.cjs +3161 -3093
- package/dist/pptx/index.mjs +3 -3
- package/dist/pptx/render/customization/customization-controller.d.ts +8 -0
- package/dist/pptx/render/customization/customization-controller.d.ts.map +1 -1
- package/dist/pptx/render/find-replace-session-actions.d.ts +44 -0
- package/dist/pptx/render/find-replace-session-actions.d.ts.map +1 -0
- package/dist/pptx/render/find-replace-session.d.ts +120 -0
- package/dist/pptx/render/find-replace-session.d.ts.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/pptx/render/inspector/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/inspector-color-fields.d.ts +38 -0
- package/dist/pptx/render/inspector/inspector-color-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector-helpers.cjs +21 -13
- package/dist/pptx/render/inspector-helpers.d.ts +10 -1
- package/dist/pptx/render/inspector-helpers.d.ts.map +1 -1
- package/dist/pptx/render/inspector-helpers.mjs +1 -1
- package/dist/pptx/render/live-color-input.d.ts +93 -0
- package/dist/pptx/render/live-color-input.d.ts.map +1 -0
- package/dist/pptx/render/live-color-leaves.d.ts +34 -0
- package/dist/pptx/render/live-color-leaves.d.ts.map +1 -0
- package/dist/pptx/render/options/external-content-policy.d.ts +31 -0
- package/dist/pptx/render/options/external-content-policy.d.ts.map +1 -0
- package/dist/pptx/render/options/index.d.ts +1 -0
- package/dist/pptx/render/options/index.d.ts.map +1 -1
- package/dist/pptx/render/options/viewer-options-constraints.d.ts +15 -1
- package/dist/pptx/render/options/viewer-options-constraints.d.ts.map +1 -1
- package/dist/pptx/render/options/viewer-options-store.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-AERZURUO.cjs → smartart-insert-preview-3BY6HNZL.cjs} +5 -5
- package/dist/pptx/{smartart-insert-preview-CGAZP5JP.mjs → smartart-insert-preview-7CRBDPYF.mjs} +4 -4
- package/dist/theme-bridge.d.ts +1 -0
- package/package.json +2 -2
|
@@ -5,9 +5,59 @@ var chunkPBZWDEXQ_cjs = require('./chunk-PBZWDEXQ.cjs');
|
|
|
5
5
|
var pptx = require('ooxml-core/pptx');
|
|
6
6
|
var textRunsStylePatch = require('ooxml-core/pptx/editor/render/text-runs-style-patch');
|
|
7
7
|
var fontFamilyUpdate = require('ooxml-core/pptx/editor/render/font-family-update');
|
|
8
|
+
var elementLocks = require('ooxml-core/pptx/editor/render/element-locks');
|
|
8
9
|
var textContentStyle = require('ooxml-core/pptx/editor/render/text-content-style');
|
|
9
10
|
var textStyleScope = require('ooxml-core/pptx/editor/render/text-style-scope');
|
|
10
11
|
|
|
12
|
+
// src/pptx/render/arrange-extras.ts
|
|
13
|
+
var DEFAULT_STROKE_WIDTH = 1;
|
|
14
|
+
function canGroupSelection(canEdit, selectedCount, selectionGroupable = true) {
|
|
15
|
+
return canEdit && selectedCount >= 2 && selectionGroupable;
|
|
16
|
+
}
|
|
17
|
+
function canUngroupSelection(canEdit, element) {
|
|
18
|
+
return canEdit && element?.type === "group" && elementLocks.canInteractWithElement(element, "group");
|
|
19
|
+
}
|
|
20
|
+
function canSetStrokeWidth(canEdit, element) {
|
|
21
|
+
return canEdit && element !== null && pptx.hasShapeProperties(element);
|
|
22
|
+
}
|
|
23
|
+
function strokeWidthOf(element) {
|
|
24
|
+
if (element === null || !pptx.hasShapeProperties(element)) {
|
|
25
|
+
return DEFAULT_STROKE_WIDTH;
|
|
26
|
+
}
|
|
27
|
+
return element.shapeStyle?.strokeWidth ?? DEFAULT_STROKE_WIDTH;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/pptx/render/ribbon-home-commands.ts
|
|
31
|
+
function resetSlideLayoutPath(slide) {
|
|
32
|
+
const path = slide?.layoutPath;
|
|
33
|
+
return typeof path === "string" && path !== "" ? path : void 0;
|
|
34
|
+
}
|
|
35
|
+
function shapeFillChange(hex, ref) {
|
|
36
|
+
return { fillColor: hex, fillColorRef: ref, fillMode: "solid" };
|
|
37
|
+
}
|
|
38
|
+
function shapeOutlineChange(hex, ref, current) {
|
|
39
|
+
const change = { strokeColor: hex, strokeColorRef: ref };
|
|
40
|
+
const lineShows = (current?.strokeWidth ?? 0) > 0;
|
|
41
|
+
if (current && !lineShows) {
|
|
42
|
+
change.strokeWidth = DEFAULT_STROKE_WIDTH;
|
|
43
|
+
change.strokeFillMode = "solid";
|
|
44
|
+
}
|
|
45
|
+
return change;
|
|
46
|
+
}
|
|
47
|
+
var RIBBON_SHAPE_SWATCHES = [
|
|
48
|
+
"#ffffff",
|
|
49
|
+
"#000000",
|
|
50
|
+
"#c00000",
|
|
51
|
+
"#ff0000",
|
|
52
|
+
"#ffc000",
|
|
53
|
+
"#ffff00",
|
|
54
|
+
"#92d050",
|
|
55
|
+
"#00b050",
|
|
56
|
+
"#00b0f0",
|
|
57
|
+
"#0070c0",
|
|
58
|
+
"#002060",
|
|
59
|
+
"#7030a0"
|
|
60
|
+
];
|
|
11
61
|
function contentSegmentsInSelection(segments, selection) {
|
|
12
62
|
if (!segments) {
|
|
13
63
|
return [];
|
|
@@ -103,6 +153,12 @@ function shapeStylePatch(el, changes) {
|
|
|
103
153
|
}
|
|
104
154
|
};
|
|
105
155
|
}
|
|
156
|
+
function strokeColorChange(el, hex, ref) {
|
|
157
|
+
return shapeOutlineChange(hex, ref, pptx.hasShapeProperties(el) ? el.shapeStyle ?? {} : {});
|
|
158
|
+
}
|
|
159
|
+
function strokeColorPatch(el, hex, ref) {
|
|
160
|
+
return shapeStylePatch(el, strokeColorChange(el, hex, ref));
|
|
161
|
+
}
|
|
106
162
|
function textStylePatch(el, changes) {
|
|
107
163
|
const base = pptx.hasTextProperties(el) ? el.textStyle ?? {} : {};
|
|
108
164
|
const exclusive = textStyleScope.withExclusiveLineSpacing(changes);
|
|
@@ -147,6 +203,38 @@ Object.defineProperty(exports, "mergeTextStyleUpdate", {
|
|
|
147
203
|
enumerable: true,
|
|
148
204
|
get: function () { return fontFamilyUpdate.mergeTextStyleUpdate; }
|
|
149
205
|
});
|
|
206
|
+
Object.defineProperty(exports, "canDrillDown", {
|
|
207
|
+
enumerable: true,
|
|
208
|
+
get: function () { return elementLocks.canDrillDown; }
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "canInteractWithElement", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () { return elementLocks.canInteractWithElement; }
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(exports, "elementLockTogglePatch", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function () { return elementLocks.elementLockTogglePatch; }
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(exports, "filterInteractableIds", {
|
|
219
|
+
enumerable: true,
|
|
220
|
+
get: function () { return elementLocks.filterInteractableIds; }
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "getElementLocks", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () { return elementLocks.getElementLocks; }
|
|
225
|
+
});
|
|
226
|
+
Object.defineProperty(exports, "isElementInteractionLocked", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: function () { return elementLocks.isElementInteractionLocked; }
|
|
229
|
+
});
|
|
230
|
+
Object.defineProperty(exports, "isElementLocked", {
|
|
231
|
+
enumerable: true,
|
|
232
|
+
get: function () { return elementLocks.isElementLocked; }
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "resolveElementInteractivity", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () { return elementLocks.resolveElementInteractivity; }
|
|
237
|
+
});
|
|
150
238
|
Object.defineProperty(exports, "TEXT_DECORATION_FLAGS", {
|
|
151
239
|
enumerable: true,
|
|
152
240
|
get: function () { return textContentStyle.TEXT_DECORATION_FLAGS; }
|
|
@@ -188,6 +276,11 @@ Object.defineProperty(exports, "withExclusiveLineSpacing", {
|
|
|
188
276
|
get: function () { return textStyleScope.withExclusiveLineSpacing; }
|
|
189
277
|
});
|
|
190
278
|
exports.DEFAULT_FONT_SIZE = DEFAULT_FONT_SIZE;
|
|
279
|
+
exports.DEFAULT_STROKE_WIDTH = DEFAULT_STROKE_WIDTH;
|
|
280
|
+
exports.RIBBON_SHAPE_SWATCHES = RIBBON_SHAPE_SWATCHES;
|
|
281
|
+
exports.canGroupSelection = canGroupSelection;
|
|
282
|
+
exports.canSetStrokeWidth = canSetStrokeWidth;
|
|
283
|
+
exports.canUngroupSelection = canUngroupSelection;
|
|
191
284
|
exports.contentSegmentsInSelection = contentSegmentsInSelection;
|
|
192
285
|
exports.fillColorOf = fillColorOf;
|
|
193
286
|
exports.fontSizeOf = fontSizeOf;
|
|
@@ -196,8 +289,14 @@ exports.isBold = isBold;
|
|
|
196
289
|
exports.isItalic = isItalic;
|
|
197
290
|
exports.isUnderline = isUnderline;
|
|
198
291
|
exports.nextToggleValue = nextToggleValue;
|
|
292
|
+
exports.resetSlideLayoutPath = resetSlideLayoutPath;
|
|
293
|
+
exports.shapeFillChange = shapeFillChange;
|
|
294
|
+
exports.shapeOutlineChange = shapeOutlineChange;
|
|
199
295
|
exports.shapeStylePatch = shapeStylePatch;
|
|
296
|
+
exports.strokeColorChange = strokeColorChange;
|
|
200
297
|
exports.strokeColorOf = strokeColorOf;
|
|
298
|
+
exports.strokeColorPatch = strokeColorPatch;
|
|
299
|
+
exports.strokeWidthOf = strokeWidthOf;
|
|
201
300
|
exports.textColorOf = textColorOf;
|
|
202
301
|
exports.textFontFamilyPatch = textFontFamilyPatch;
|
|
203
302
|
exports.textFontSizePatch = textFontSizePatch;
|
|
@@ -1,14 +1,65 @@
|
|
|
1
1
|
import { textFontSizePxToPt } from './chunk-SMSCEGAE.mjs';
|
|
2
2
|
import { updateTextSegmentStyle } from './chunk-PEDGPFLR.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { hasShapeProperties, hasTextProperties } from 'ooxml-core/pptx';
|
|
4
4
|
import { textRunsStylePatch } from 'ooxml-core/pptx/editor/render/text-runs-style-patch';
|
|
5
5
|
import { mergeTextStyleUpdate } from 'ooxml-core/pptx/editor/render/font-family-update';
|
|
6
6
|
export { fontFamilyStyleUpdates, mergeTextStyleUpdate } from 'ooxml-core/pptx/editor/render/font-family-update';
|
|
7
|
+
import { canInteractWithElement } from 'ooxml-core/pptx/editor/render/element-locks';
|
|
8
|
+
export { canDrillDown, canInteractWithElement, elementLockTogglePatch, filterInteractableIds, getElementLocks, isElementInteractionLocked, isElementLocked, resolveElementInteractivity } from 'ooxml-core/pptx/editor/render/element-locks';
|
|
7
9
|
import { isContentSegment, TEXT_DECORATION_FLAGS } from 'ooxml-core/pptx/editor/render/text-content-style';
|
|
8
10
|
export { TEXT_DECORATION_FLAGS, isContentSegment } from 'ooxml-core/pptx/editor/render/text-content-style';
|
|
9
11
|
import { withExclusiveLineSpacing, paragraphOverridePatch } from 'ooxml-core/pptx/editor/render/text-style-scope';
|
|
10
12
|
export { BODY_TEXT_STYLE_KEYS, isBodyTextStyleKey, overrideParagraphIndents, overrideParagraphProperties, paragraphOverridePatch, reconcileDecorationFlags, splitTextStyleUpdate, withExclusiveLineSpacing } from 'ooxml-core/pptx/editor/render/text-style-scope';
|
|
11
13
|
|
|
14
|
+
// src/pptx/render/arrange-extras.ts
|
|
15
|
+
var DEFAULT_STROKE_WIDTH = 1;
|
|
16
|
+
function canGroupSelection(canEdit, selectedCount, selectionGroupable = true) {
|
|
17
|
+
return canEdit && selectedCount >= 2 && selectionGroupable;
|
|
18
|
+
}
|
|
19
|
+
function canUngroupSelection(canEdit, element) {
|
|
20
|
+
return canEdit && element?.type === "group" && canInteractWithElement(element, "group");
|
|
21
|
+
}
|
|
22
|
+
function canSetStrokeWidth(canEdit, element) {
|
|
23
|
+
return canEdit && element !== null && hasShapeProperties(element);
|
|
24
|
+
}
|
|
25
|
+
function strokeWidthOf(element) {
|
|
26
|
+
if (element === null || !hasShapeProperties(element)) {
|
|
27
|
+
return DEFAULT_STROKE_WIDTH;
|
|
28
|
+
}
|
|
29
|
+
return element.shapeStyle?.strokeWidth ?? DEFAULT_STROKE_WIDTH;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/pptx/render/ribbon-home-commands.ts
|
|
33
|
+
function resetSlideLayoutPath(slide) {
|
|
34
|
+
const path = slide?.layoutPath;
|
|
35
|
+
return typeof path === "string" && path !== "" ? path : void 0;
|
|
36
|
+
}
|
|
37
|
+
function shapeFillChange(hex, ref) {
|
|
38
|
+
return { fillColor: hex, fillColorRef: ref, fillMode: "solid" };
|
|
39
|
+
}
|
|
40
|
+
function shapeOutlineChange(hex, ref, current) {
|
|
41
|
+
const change = { strokeColor: hex, strokeColorRef: ref };
|
|
42
|
+
const lineShows = (current?.strokeWidth ?? 0) > 0;
|
|
43
|
+
if (current && !lineShows) {
|
|
44
|
+
change.strokeWidth = DEFAULT_STROKE_WIDTH;
|
|
45
|
+
change.strokeFillMode = "solid";
|
|
46
|
+
}
|
|
47
|
+
return change;
|
|
48
|
+
}
|
|
49
|
+
var RIBBON_SHAPE_SWATCHES = [
|
|
50
|
+
"#ffffff",
|
|
51
|
+
"#000000",
|
|
52
|
+
"#c00000",
|
|
53
|
+
"#ff0000",
|
|
54
|
+
"#ffc000",
|
|
55
|
+
"#ffff00",
|
|
56
|
+
"#92d050",
|
|
57
|
+
"#00b050",
|
|
58
|
+
"#00b0f0",
|
|
59
|
+
"#0070c0",
|
|
60
|
+
"#002060",
|
|
61
|
+
"#7030a0"
|
|
62
|
+
];
|
|
12
63
|
function contentSegmentsInSelection(segments, selection) {
|
|
13
64
|
if (!segments) {
|
|
14
65
|
return [];
|
|
@@ -104,6 +155,12 @@ function shapeStylePatch(el, changes) {
|
|
|
104
155
|
}
|
|
105
156
|
};
|
|
106
157
|
}
|
|
158
|
+
function strokeColorChange(el, hex, ref) {
|
|
159
|
+
return shapeOutlineChange(hex, ref, hasShapeProperties(el) ? el.shapeStyle ?? {} : {});
|
|
160
|
+
}
|
|
161
|
+
function strokeColorPatch(el, hex, ref) {
|
|
162
|
+
return shapeStylePatch(el, strokeColorChange(el, hex, ref));
|
|
163
|
+
}
|
|
107
164
|
function textStylePatch(el, changes) {
|
|
108
165
|
const base = hasTextProperties(el) ? el.textStyle ?? {} : {};
|
|
109
166
|
const exclusive = withExclusiveLineSpacing(changes);
|
|
@@ -140,4 +197,4 @@ function textFontFamilyPatch(el, fontFamily) {
|
|
|
140
197
|
return textRunsPatch(el, { fontFamily });
|
|
141
198
|
}
|
|
142
199
|
|
|
143
|
-
export { DEFAULT_FONT_SIZE, contentSegmentsInSelection, fillColorOf, fontSizeOf, getSelectionTextStyleFlags, isBold, isItalic, isUnderline, nextToggleValue, shapeStylePatch, strokeColorOf, textColorOf, textFontFamilyPatch, textFontSizePatch, textStyleFlagsOf, textStylePatch };
|
|
200
|
+
export { DEFAULT_FONT_SIZE, DEFAULT_STROKE_WIDTH, RIBBON_SHAPE_SWATCHES, canGroupSelection, canSetStrokeWidth, canUngroupSelection, contentSegmentsInSelection, fillColorOf, fontSizeOf, getSelectionTextStyleFlags, isBold, isItalic, isUnderline, nextToggleValue, resetSlideLayoutPath, shapeFillChange, shapeOutlineChange, shapeStylePatch, strokeColorChange, strokeColorOf, strokeColorPatch, strokeWidthOf, textColorOf, textFontFamilyPatch, textFontSizePatch, textStyleFlagsOf, textStylePatch };
|