ooxml-ui 1.27.0 → 1.27.1
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-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/chart/format-pane-types.d.ts +0 -1
- package/dist/chart/format-pane-view.d.ts +0 -1
- package/dist/pptx/{chunk-43NFRLCD.cjs → chunk-37VJFRCP.cjs} +2 -2
- package/dist/pptx/{chunk-72P6AWRA.mjs → chunk-67L75M6K.mjs} +1 -1
- 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-LAF5W2UR.mjs → chunk-OD6REJDV.mjs} +2 -1
- package/dist/pptx/{chunk-A3JJOLTS.cjs → chunk-TMCN2OVN.cjs} +44 -43
- package/dist/pptx/{chunk-I6ZVSJAR.cjs → chunk-VMDMICQC.cjs} +472 -132
- package/dist/pptx/{chunk-6QLGEV3I.mjs → chunk-XZX7EHX4.mjs} +447 -76
- package/dist/pptx/dom/index.cjs +384 -384
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/index.cjs +3141 -3093
- package/dist/pptx/index.mjs +3 -3
- 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/{smartart-insert-preview-AERZURUO.cjs → smartart-insert-preview-MCDHVWHZ.cjs} +5 -5
- package/dist/pptx/{smartart-insert-preview-CGAZP5JP.mjs → smartart-insert-preview-QQH5ZBSF.mjs} +4 -4
- package/dist/theme-bridge.d.ts +1 -0
- package/package.json +2 -2
|
@@ -35,3 +35,4 @@ export type ChartDataSheetKeyAction = {
|
|
|
35
35
|
};
|
|
36
36
|
/** What a key does in a cell at (`row`, `col`) of a sheet `rows` x `cols` (corner included). */
|
|
37
37
|
export declare function chartDataSheetKeyAction(key: ChartDataSheetKey, mode: ChartDataSheetMode, row: number, col: number, rows: number, cols: number): ChartDataSheetKeyAction;
|
|
38
|
+
//# sourceMappingURL=data-sheet-keys.d.ts.map
|
|
@@ -20,3 +20,4 @@ export declare function hexForInput(color: string | undefined, fallback?: string
|
|
|
20
20
|
export type ChartFormatTranslate = (key: string, params?: Readonly<Record<string, string | number>>, fallback?: string) => string;
|
|
21
21
|
/** Resolves a caption with `tr`, filling `{{name}}` parameters in either result. */
|
|
22
22
|
export declare function translateChartFormatText(value: ChartFormatText, tr: ChartFormatTranslate): string;
|
|
23
|
+
//# sourceMappingURL=format-pane-common.d.ts.map
|
|
@@ -10,3 +10,4 @@ import type { ChartFormatElementView, ChartFormatSource } from './format-pane-vi
|
|
|
10
10
|
export declare const ARROWS: Array<[string, string]>;
|
|
11
11
|
/** The Fill & Line tab's sections. */
|
|
12
12
|
export declare function fillLineSections(view: ChartFormatElementView, target: ChartFormatTarget, source?: Pick<ChartFormatSource, 'patternPresets' | 'slots'>): ChartFormatSection[];
|
|
13
|
+
//# sourceMappingURL=format-pane-fill-line.d.ts.map
|
|
@@ -4,3 +4,4 @@ import type { ChartFormatTextView } from './format-pane-view.js';
|
|
|
4
4
|
export declare function chartTextTabs(): ChartFormatTab[];
|
|
5
5
|
/** The sections of Text Options tab `tab`. */
|
|
6
6
|
export declare function textOptionsSections(text: ChartFormatTextView, tab: 'textFill' | 'textEffects' | 'textBox'): ChartFormatSection[];
|
|
7
|
+
//# sourceMappingURL=format-pane-text.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCWWL7MCL_cjs = require('./chunk-CWWL7MCL.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
|
-
...
|
|
80
|
+
...chunkCWWL7MCL_cjs.textStylePatch(updated, definedEntries(format.textStyle))
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
return updated;
|
|
@@ -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 };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { THREE_VIEW_EVENTS, applyChart3DSelect, applyChart3DDrag, resolveSmartArtThreeViewSpec, elementInLocalFrame, SMARTART_3D_EDIT_LAYER_ATTRIBUTE, stripEditLayerMarkers, routeEditLayerPointerToNodes, measureSvgViewportRect, findSmartArtNodeText, resolvePalette, smartArtConnectorPaint, smartArtNodeLabel, getContainerStyle, buildChromeStyle, buildSmartArtA11y, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, computeSmartArtElementLayout, flattenNodes, computeDrawingViewBox, projectDrawingShapes, styleShadowFilter, resolveRevealedDrawingShapeNodeIds, SMARTART_PREVIEW_ELEMENT_WIDTH, SMARTART_PREVIEW_ELEMENT_HEIGHT, buildSmartArtPreviewElement, isForwardedEditLayerEvent } from './chunk-XZX7EHX4.mjs';
|
|
2
|
+
import { canDrillDown } from './chunk-FUKVYJPM.mjs';
|
|
2
3
|
import { formatAxisValue } from './chunk-34LEUH5R.mjs';
|
|
3
4
|
import { THREE_VIEW_TAG, defineThreeViewElement } from './chunk-AMW2AR7J.mjs';
|
|
4
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVMDMICQC_cjs = require('./chunk-VMDMICQC.cjs');
|
|
4
|
+
var chunkCWWL7MCL_cjs = require('./chunk-CWWL7MCL.cjs');
|
|
4
5
|
var chunk6KLPQQYP_cjs = require('./chunk-6KLPQQYP.cjs');
|
|
5
6
|
var chunkFM4C4MBJ_cjs = require('./chunk-FM4C4MBJ.cjs');
|
|
6
7
|
|
|
@@ -102,7 +103,7 @@ function mountThreeViewInto(doc, wrapper, options) {
|
|
|
102
103
|
return view;
|
|
103
104
|
}
|
|
104
105
|
function isChart3DEditable(element, context) {
|
|
105
|
-
return element.type === "chart" && Boolean(context.interactive) && Boolean(context.onChartPointChange) && Boolean(context.selectedElementIds?.has(element.id)) &&
|
|
106
|
+
return element.type === "chart" && Boolean(context.interactive) && Boolean(context.onChartPointChange) && Boolean(context.selectedElementIds?.has(element.id)) && chunkCWWL7MCL_cjs.canDrillDown(element);
|
|
106
107
|
}
|
|
107
108
|
function selectedChartPartOf(element, context) {
|
|
108
109
|
return context.chartPartSelection?.elementId === element.id ? context.chartPartSelection.part : null;
|
|
@@ -144,13 +145,13 @@ function wireChartThreeViewEvents(view, element, context, badgeHost) {
|
|
|
144
145
|
const listeners = new AbortController();
|
|
145
146
|
chartViewListeners.set(view, listeners);
|
|
146
147
|
view.addEventListener(
|
|
147
|
-
|
|
148
|
-
(event) =>
|
|
148
|
+
chunkVMDMICQC_cjs.THREE_VIEW_EVENTS.select,
|
|
149
|
+
(event) => chunkVMDMICQC_cjs.applyChart3DSelect(bridge, event.detail.part),
|
|
149
150
|
{ signal: listeners.signal }
|
|
150
151
|
);
|
|
151
152
|
view.addEventListener(
|
|
152
|
-
|
|
153
|
-
(event) =>
|
|
153
|
+
chunkVMDMICQC_cjs.THREE_VIEW_EVENTS.drag,
|
|
154
|
+
(event) => chunkVMDMICQC_cjs.applyChart3DDrag(bridge, event.detail),
|
|
154
155
|
{ signal: listeners.signal }
|
|
155
156
|
);
|
|
156
157
|
}
|
|
@@ -164,7 +165,7 @@ function applyThreeViewTextStyle(el, style) {
|
|
|
164
165
|
// src/pptx/dom/elements/smartart-3d.ts
|
|
165
166
|
var renderSmartArt3DElement = (element, zIndex, context) => {
|
|
166
167
|
const wrapper = renderSmartArtSvg(element, zIndex, context);
|
|
167
|
-
const spec = wrapper ?
|
|
168
|
+
const spec = wrapper ? chunkVMDMICQC_cjs.resolveSmartArtThreeViewSpec(element, context.smartArt3D) : null;
|
|
168
169
|
if (!wrapper || !spec) {
|
|
169
170
|
return wrapper;
|
|
170
171
|
}
|
|
@@ -174,18 +175,18 @@ var renderSmartArt3DElement = (element, zIndex, context) => {
|
|
|
174
175
|
textStyle: context.presentationStates?.get(element.id)?.textStyle
|
|
175
176
|
});
|
|
176
177
|
if (context.onSmartArtNodeTextChange && context.interactive && !context.presenting) {
|
|
177
|
-
const layer = renderSmartArtSvg(
|
|
178
|
+
const layer = renderSmartArtSvg(chunkVMDMICQC_cjs.elementInLocalFrame(element), 0, context);
|
|
178
179
|
if (layer) {
|
|
179
180
|
layer.classList.add("pptxv-smartart-3d-edit-layer");
|
|
180
|
-
layer.setAttribute(
|
|
181
|
-
|
|
181
|
+
layer.setAttribute(chunkVMDMICQC_cjs.SMARTART_3D_EDIT_LAYER_ATTRIBUTE, "true");
|
|
182
|
+
chunkVMDMICQC_cjs.stripEditLayerMarkers(layer);
|
|
182
183
|
layer.setAttribute("aria-hidden", "true");
|
|
183
184
|
Object.assign(layer.style, { position: "absolute", inset: "0", zIndex: "1" });
|
|
184
185
|
for (const svg of layer.querySelectorAll("svg")) {
|
|
185
186
|
svg.style.opacity = "0";
|
|
186
187
|
}
|
|
187
188
|
wrapper.appendChild(layer);
|
|
188
|
-
|
|
189
|
+
chunkVMDMICQC_cjs.routeEditLayerPointerToNodes(layer);
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
return wrapper;
|
|
@@ -198,14 +199,14 @@ function nodeTarget(target) {
|
|
|
198
199
|
}
|
|
199
200
|
function enableSmartArtEditing(chrome, element, context) {
|
|
200
201
|
const data = element.smartArtData;
|
|
201
|
-
if (!data || !context.onSmartArtNodeTextChange && !context.onSmartArtNodeFillChange || !
|
|
202
|
+
if (!data || !context.onSmartArtNodeTextChange && !context.onSmartArtNodeFillChange || !chunkCWWL7MCL_cjs.canDrillDown(element)) {
|
|
202
203
|
return;
|
|
203
204
|
}
|
|
204
205
|
let editor = null;
|
|
205
206
|
let swatches = null;
|
|
206
207
|
let hideTimer;
|
|
207
208
|
const cancelHide = () => clearTimeout(hideTimer);
|
|
208
|
-
const ignoredHover = (event) => chrome.closest(`[${
|
|
209
|
+
const ignoredHover = (event) => chrome.closest(`[${chunkVMDMICQC_cjs.SMARTART_3D_EDIT_LAYER_ATTRIBUTE}]`) !== null && !chunkVMDMICQC_cjs.isForwardedEditLayerEvent(event);
|
|
209
210
|
const closeEditor = (input = editor) => {
|
|
210
211
|
if (!input || input !== editor) {
|
|
211
212
|
return;
|
|
@@ -221,8 +222,8 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
221
222
|
}
|
|
222
223
|
event.stopPropagation();
|
|
223
224
|
const textNode = target.querySelector("text");
|
|
224
|
-
const textRect = textNode ?
|
|
225
|
-
const rect = textRect && textRect.width > 0 ? textRect :
|
|
225
|
+
const textRect = textNode ? chunkVMDMICQC_cjs.measureSvgViewportRect(textNode) : null;
|
|
226
|
+
const rect = textRect && textRect.width > 0 ? textRect : chunkVMDMICQC_cjs.measureSvgViewportRect(target);
|
|
226
227
|
if (!rect) {
|
|
227
228
|
return;
|
|
228
229
|
}
|
|
@@ -246,7 +247,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
246
247
|
textAlign: "center"
|
|
247
248
|
});
|
|
248
249
|
editor = input;
|
|
249
|
-
input.value =
|
|
250
|
+
input.value = chunkVMDMICQC_cjs.findSmartArtNodeText(data, nodeId) ?? "";
|
|
250
251
|
const commit = () => {
|
|
251
252
|
if (input !== editor) {
|
|
252
253
|
return;
|
|
@@ -281,7 +282,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
281
282
|
}
|
|
282
283
|
cancelHide();
|
|
283
284
|
swatches?.remove();
|
|
284
|
-
const rect =
|
|
285
|
+
const rect = chunkVMDMICQC_cjs.measureSvgViewportRect(target);
|
|
285
286
|
if (!rect) {
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
@@ -300,7 +301,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
300
301
|
});
|
|
301
302
|
swatches.setAttribute("role", "group");
|
|
302
303
|
swatches.setAttribute("aria-label", context.t("pptx.smartArt.fillColor"));
|
|
303
|
-
for (const color of
|
|
304
|
+
for (const color of chunkVMDMICQC_cjs.resolvePalette(data).slice(0, 6)) {
|
|
304
305
|
const button = createEl(chrome.ownerDocument, "button", "", {
|
|
305
306
|
width: "18px",
|
|
306
307
|
height: "18px",
|
|
@@ -402,7 +403,7 @@ function buildSmartArtFallbackSvg(doc, layout, a11yNodes = [], nodeIds = []) {
|
|
|
402
403
|
svg.setAttribute("class", "pptxv-smartart-svg");
|
|
403
404
|
svg.setAttribute("style", SMARTART_SVG_STYLE);
|
|
404
405
|
for (const conn of layout.connectors) {
|
|
405
|
-
const paint =
|
|
406
|
+
const paint = chunkVMDMICQC_cjs.smartArtConnectorPaint(conn);
|
|
406
407
|
svg.appendChild(
|
|
407
408
|
createSvgEl(doc, "path", {
|
|
408
409
|
d: paint.d,
|
|
@@ -461,7 +462,7 @@ function buildFallbackNode(doc, node, shadowFilter, a11yLabel, nodeId) {
|
|
|
461
462
|
})
|
|
462
463
|
);
|
|
463
464
|
}
|
|
464
|
-
const label =
|
|
465
|
+
const label = chunkVMDMICQC_cjs.smartArtNodeLabel(node);
|
|
465
466
|
if (label.visible) {
|
|
466
467
|
appendSvgTextLines(doc, g, {
|
|
467
468
|
lines: label.lines,
|
|
@@ -497,41 +498,41 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
497
498
|
doc,
|
|
498
499
|
"div",
|
|
499
500
|
"pptxv-element pptxv-smartart",
|
|
500
|
-
|
|
501
|
+
chunkVMDMICQC_cjs.getContainerStyle(element, zIndex)
|
|
501
502
|
);
|
|
502
503
|
wrapper.dataset.elementId = element.id;
|
|
503
504
|
wrapper.dataset.testid = `smartart-${data?.layout ?? "diagram"}`;
|
|
504
|
-
const chrome = createEl(doc, "div", "pptxv-smartart-chrome",
|
|
505
|
+
const chrome = createEl(doc, "div", "pptxv-smartart-chrome", chunkVMDMICQC_cjs.buildChromeStyle(data?.chrome));
|
|
505
506
|
chrome.style.position = "relative";
|
|
506
507
|
wrapper.appendChild(chrome);
|
|
507
508
|
if (data) {
|
|
508
|
-
const a11y =
|
|
509
|
+
const a11y = chunkVMDMICQC_cjs.buildSmartArtA11y(data);
|
|
509
510
|
chrome.setAttribute("role", "img");
|
|
510
511
|
chrome.setAttribute("aria-label", a11y.label);
|
|
511
512
|
}
|
|
512
513
|
const nodes = data?.nodes ?? [];
|
|
513
514
|
const drawingShapes = data?.drawingShapes ?? [];
|
|
514
515
|
const animationState = context.presentationStates?.get(element.id);
|
|
515
|
-
const { nodes: revealedNodesFull } =
|
|
516
|
+
const { nodes: revealedNodesFull } = chunkVMDMICQC_cjs.resolveRevealedSmartArtNodes(
|
|
516
517
|
nodes,
|
|
517
518
|
animationState,
|
|
518
519
|
data?.presLayoutVars
|
|
519
520
|
);
|
|
520
521
|
if (data && drawingShapes.length > 0) {
|
|
521
|
-
const revealedShapes =
|
|
522
|
+
const revealedShapes = chunkVMDMICQC_cjs.resolveRevealedDrawingShapes(drawingShapes, nodes, animationState);
|
|
522
523
|
chrome.appendChild(
|
|
523
|
-
buildDrawingShapesSvg(doc, element.id, data,
|
|
524
|
+
buildDrawingShapesSvg(doc, element.id, data, chunkVMDMICQC_cjs.buildSmartArtA11y(data).nodes, revealedShapes)
|
|
524
525
|
);
|
|
525
526
|
enableSmartArtEditing(chrome, element, context);
|
|
526
527
|
return wrapper;
|
|
527
528
|
}
|
|
528
529
|
if (data && nodes.length > 0) {
|
|
529
530
|
const revealedNodes = revealedNodesFull;
|
|
530
|
-
const layout =
|
|
531
|
+
const layout = chunkVMDMICQC_cjs.computeSmartArtElementLayout(
|
|
531
532
|
data,
|
|
532
533
|
revealedNodes,
|
|
533
534
|
{ width: element.width, height: element.height },
|
|
534
|
-
|
|
535
|
+
chunkVMDMICQC_cjs.resolvePalette(data),
|
|
535
536
|
data.style ?? "flat",
|
|
536
537
|
element.id
|
|
537
538
|
);
|
|
@@ -539,8 +540,8 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
539
540
|
buildSmartArtFallbackSvg(
|
|
540
541
|
doc,
|
|
541
542
|
layout,
|
|
542
|
-
|
|
543
|
-
|
|
543
|
+
chunkVMDMICQC_cjs.buildSmartArtA11y(data).nodes,
|
|
544
|
+
chunkVMDMICQC_cjs.flattenNodes(revealedNodes).map((node) => node.id)
|
|
544
545
|
)
|
|
545
546
|
);
|
|
546
547
|
enableSmartArtEditing(chrome, element, context);
|
|
@@ -563,17 +564,17 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
563
564
|
function buildDrawingShapesSvg(doc, elementId, data, a11yNodes, revealedShapes) {
|
|
564
565
|
const allShapes = data.drawingShapes ?? [];
|
|
565
566
|
const style = data.style ?? "flat";
|
|
566
|
-
const viewBox =
|
|
567
|
-
const rendered =
|
|
567
|
+
const viewBox = chunkVMDMICQC_cjs.computeDrawingViewBox(allShapes);
|
|
568
|
+
const rendered = chunkVMDMICQC_cjs.projectDrawingShapes(
|
|
568
569
|
elementId,
|
|
569
570
|
revealedShapes,
|
|
570
571
|
viewBox,
|
|
571
|
-
|
|
572
|
+
chunkVMDMICQC_cjs.resolvePalette(data),
|
|
572
573
|
style
|
|
573
574
|
);
|
|
574
|
-
const shadow =
|
|
575
|
+
const shadow = chunkVMDMICQC_cjs.styleShadowFilter(style);
|
|
575
576
|
const labelsById = new Map(a11yNodes.map((node) => [node.id, node.label]));
|
|
576
|
-
const nodeIds =
|
|
577
|
+
const nodeIds = chunkVMDMICQC_cjs.resolveRevealedDrawingShapeNodeIds(allShapes, revealedShapes, data.nodes);
|
|
577
578
|
const svg = createSvgEl(doc, "svg", {
|
|
578
579
|
viewBox: `0 0 ${viewBox.width} ${viewBox.height}`,
|
|
579
580
|
preserveAspectRatio: "xMidYMid meet"
|
|
@@ -702,26 +703,26 @@ function createElementRendererRegistry() {
|
|
|
702
703
|
// src/pptx/dom/smartart-insert-preview.ts
|
|
703
704
|
function buildSmartArtInsertPreview(doc, t, layout, size) {
|
|
704
705
|
const scale = Math.min(
|
|
705
|
-
size.width /
|
|
706
|
-
size.height /
|
|
706
|
+
size.width / chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_WIDTH,
|
|
707
|
+
size.height / chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_HEIGHT
|
|
707
708
|
);
|
|
708
709
|
const box = createEl(doc, "div", "pptxv-smartart-option-preview", {
|
|
709
|
-
width: `${Math.round(
|
|
710
|
-
height: `${Math.round(
|
|
710
|
+
width: `${Math.round(chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_WIDTH * scale)}px`,
|
|
711
|
+
height: `${Math.round(chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_HEIGHT * scale)}px`,
|
|
711
712
|
overflow: "hidden",
|
|
712
713
|
pointerEvents: "none",
|
|
713
714
|
position: "relative"
|
|
714
715
|
});
|
|
715
716
|
box.setAttribute("aria-hidden", "true");
|
|
716
717
|
const stage = createEl(doc, "div", void 0, {
|
|
717
|
-
width: `${
|
|
718
|
-
height: `${
|
|
718
|
+
width: `${chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_WIDTH}px`,
|
|
719
|
+
height: `${chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_HEIGHT}px`,
|
|
719
720
|
transform: `scale(${scale})`,
|
|
720
721
|
transformOrigin: "top left",
|
|
721
722
|
position: "relative"
|
|
722
723
|
});
|
|
723
724
|
box.appendChild(stage);
|
|
724
|
-
const element =
|
|
725
|
+
const element = chunkVMDMICQC_cjs.buildSmartArtPreviewElement(layout);
|
|
725
726
|
const slide = {
|
|
726
727
|
id: "smartart-preview",
|
|
727
728
|
rId: "smartart-preview",
|
|
@@ -731,7 +732,7 @@ function buildSmartArtInsertPreview(doc, t, layout, size) {
|
|
|
731
732
|
const context = {
|
|
732
733
|
document: doc,
|
|
733
734
|
slide,
|
|
734
|
-
canvasSize: { width:
|
|
735
|
+
canvasSize: { width: chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_WIDTH, height: chunkVMDMICQC_cjs.SMARTART_PREVIEW_ELEMENT_HEIGHT },
|
|
735
736
|
scale: 1,
|
|
736
737
|
mediaDataUrls: /* @__PURE__ */ new Map(),
|
|
737
738
|
t,
|