pptx-react-viewer 1.1.5 → 1.1.6
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/index.js +353 -63
- package/dist/index.mjs +354 -64
- package/dist/viewer/index.js +353 -63
- package/dist/viewer/index.mjs +354 -64
- package/node_modules/emf-converter/package.json +1 -1
- package/node_modules/mtx-decompressor/package.json +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-BQ4KbRO9.d.mts → SvgExporter-BTkk4oNQ.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-0TxiiorD.d.ts → SvgExporter-CTDG-t_z.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/index.d.mts +867 -49
- package/node_modules/pptx-viewer-core/dist/index.d.ts +867 -49
- package/node_modules/pptx-viewer-core/dist/index.js +29459 -16809
- package/node_modules/pptx-viewer-core/dist/index.mjs +29443 -16809
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.mts → presentation-4fhI3din.d.mts} +835 -26
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.ts → presentation-4fhI3din.d.ts} +835 -26
- package/node_modules/pptx-viewer-core/dist/{text-operations-rhJV-A_W.d.ts → text-operations-B9EwbptL.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{text-operations-CLj-sJyk.d.mts → text-operations-C89Jn6S0.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/package.json +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import * as ReactDOM from 'react-dom/client';
|
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { LuMessageSquare, LuEyeOff, LuSettings, LuX, LuCast, LuShieldCheck, LuPlus, LuPanelLeftClose, LuStickyNote, LuMonitor, LuColumns2, LuPresentation, LuMinus, LuClock, LuDownload, LuTrash2, LuCheck, LuLock, LuEye, LuFileText, LuType, LuLoader, LuShieldAlert, LuSignature, LuInfo, LuTriangleAlert, LuPrinter, LuPenTool, LuWifi, LuWifiOff, LuUsers, LuCopy, LuMonitorOff, LuChevronLeft, LuChevronRight, LuPlay, LuPause, LuPanelLeft, LuUndo, LuRedo, LuSearch, LuShare2, LuPanelRight, LuFolderOpen, LuVideo, LuImage, LuClipboardPaste, LuScissors, LuPaintbrush, LuChevronDown, LuSquare, LuDatabase, LuLayers, LuAArrowUp, LuAArrowDown, LuRemoveFormatting, LuHighlighter, LuList, LuListOrdered, LuIndentDecrease, LuIndentIncrease, LuChevronUp, LuPalette, LuPencil, LuPaintBucket, LuSparkles, LuCaptions, LuSpellCheck, LuGitCompare, LuPipette, LuCaseSensitive, LuReplace, LuTimer, LuMousePointer2, LuEraser, LuGripVertical, LuUpload, LuBold, LuItalic, LuUnderline, LuStrikethrough, LuLink, LuGrid2X2, LuCopyPlus, LuEllipsis, LuCircle, LuMoveRight, LuTriangle, LuDiamond, LuAlignLeft, LuAlignCenter, LuAlignRight, LuAlignJustify, LuSpline, LuSettings2, LuMove, LuRadio, LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuReply, LuRotateCw, LuBookmark } from 'react-icons/lu';
|
|
8
|
-
import { hasShapeProperties, hasTextProperties, SWITCHABLE_LAYOUT_TYPES, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, isInkElement, getLinkedTextBoxSegments, isImageLikeElement, getSubstituteFontFamily, PptxHandler, EncryptedFileError, guidePxToEmu, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hslToRgb, PRESET_COLOR_MAP, elementActionToPptxAction, mergeShapes, SvgExporter, applyDrawingColorTransforms as applyDrawingColorTransforms$1, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, EMU_PER_PX as EMU_PER_PX$1, chartDataChangeType, chartDataUpdatePoint, chartDataAddCategory, chartDataRemoveCategory, chartDataAddSeries, chartDataRemoveSeries, getOleObjectTypeLabel, pptxActionToElementAction, hasNonTrivialOverride, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, addSmartArtNodeAsChild, updateSmartArtNodeText, removeSmartArtNode, switchSmartArtLayout } from 'pptx-viewer-core';
|
|
8
|
+
import { hasShapeProperties, hasTextProperties, SWITCHABLE_LAYOUT_TYPES, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, isInkElement, getLinkedTextBoxSegments, isImageLikeElement, getSubstituteFontFamily, getAdjustmentAwareShapeClipPath, getShapeClipPathFromPreset, getCloudPathForRendering, PptxHandler, EncryptedFileError, guidePxToEmu, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hslToRgb, PRESET_COLOR_MAP, elementActionToPptxAction, mergeShapes, SvgExporter, applyDrawingColorTransforms as applyDrawingColorTransforms$1, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, EMU_PER_PX as EMU_PER_PX$1, chartDataChangeType, chartDataUpdatePoint, chartDataAddCategory, chartDataRemoveCategory, chartDataAddSeries, chartDataRemoveSeries, getOleObjectTypeLabel, pptxActionToElementAction, hasNonTrivialOverride, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, addSmartArtNodeAsChild, updateSmartArtNodeText, removeSmartArtNode, switchSmartArtLayout } from 'pptx-viewer-core';
|
|
9
9
|
import DOMPurify from 'dompurify';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import html2canvasPro from 'html2canvas-pro';
|
|
@@ -171,7 +171,7 @@ function generateUUID() {
|
|
|
171
171
|
const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
|
|
172
172
|
return uuid.toLowerCase();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function clamp2(value, min2, max2) {
|
|
175
175
|
return Math.max(min2, Math.min(max2, value));
|
|
176
176
|
}
|
|
177
177
|
function euclideanModulo(n, m2) {
|
|
@@ -546,7 +546,7 @@ function _generateTables() {
|
|
|
546
546
|
}
|
|
547
547
|
function toHalfFloat(val2) {
|
|
548
548
|
if (Math.abs(val2) > 65504) warn("DataUtils.toHalfFloat(): Value out of range.");
|
|
549
|
-
val2 =
|
|
549
|
+
val2 = clamp2(val2, -65504, 65504);
|
|
550
550
|
_tables.floatView[0] = val2;
|
|
551
551
|
const f = _tables.uint32View[0];
|
|
552
552
|
const e2 = f >> 23 & 511;
|
|
@@ -2035,7 +2035,7 @@ var init_three_core = __esm({
|
|
|
2035
2035
|
* @param {number} max - The max value.
|
|
2036
2036
|
* @return {number} The clamped value.
|
|
2037
2037
|
*/
|
|
2038
|
-
clamp,
|
|
2038
|
+
clamp: clamp2,
|
|
2039
2039
|
/**
|
|
2040
2040
|
* Computes the Euclidean modulo of the given parameters that
|
|
2041
2041
|
* is `( ( n % m ) + m ) % m`.
|
|
@@ -2562,8 +2562,8 @@ var init_three_core = __esm({
|
|
|
2562
2562
|
* @return {Vector2} A reference to this vector.
|
|
2563
2563
|
*/
|
|
2564
2564
|
clamp(min2, max2) {
|
|
2565
|
-
this.x =
|
|
2566
|
-
this.y =
|
|
2565
|
+
this.x = clamp2(this.x, min2.x, max2.x);
|
|
2566
|
+
this.y = clamp2(this.y, min2.y, max2.y);
|
|
2567
2567
|
return this;
|
|
2568
2568
|
}
|
|
2569
2569
|
/**
|
|
@@ -2577,8 +2577,8 @@ var init_three_core = __esm({
|
|
|
2577
2577
|
* @return {Vector2} A reference to this vector.
|
|
2578
2578
|
*/
|
|
2579
2579
|
clampScalar(minVal, maxVal) {
|
|
2580
|
-
this.x =
|
|
2581
|
-
this.y =
|
|
2580
|
+
this.x = clamp2(this.x, minVal, maxVal);
|
|
2581
|
+
this.y = clamp2(this.y, minVal, maxVal);
|
|
2582
2582
|
return this;
|
|
2583
2583
|
}
|
|
2584
2584
|
/**
|
|
@@ -2593,7 +2593,7 @@ var init_three_core = __esm({
|
|
|
2593
2593
|
*/
|
|
2594
2594
|
clampLength(min2, max2) {
|
|
2595
2595
|
const length2 = this.length();
|
|
2596
|
-
return this.divideScalar(length2 || 1).multiplyScalar(
|
|
2596
|
+
return this.divideScalar(length2 || 1).multiplyScalar(clamp2(length2, min2, max2));
|
|
2597
2597
|
}
|
|
2598
2598
|
/**
|
|
2599
2599
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -2718,7 +2718,7 @@ var init_three_core = __esm({
|
|
|
2718
2718
|
const denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
|
|
2719
2719
|
if (denominator === 0) return Math.PI / 2;
|
|
2720
2720
|
const theta = this.dot(v) / denominator;
|
|
2721
|
-
return Math.acos(
|
|
2721
|
+
return Math.acos(clamp2(theta, -1, 1));
|
|
2722
2722
|
}
|
|
2723
2723
|
/**
|
|
2724
2724
|
* Computes the distance from the given vector to this instance.
|
|
@@ -3205,7 +3205,7 @@ var init_three_core = __esm({
|
|
|
3205
3205
|
* @return {number} The angle in radians.
|
|
3206
3206
|
*/
|
|
3207
3207
|
angleTo(q) {
|
|
3208
|
-
return 2 * Math.acos(Math.abs(
|
|
3208
|
+
return 2 * Math.acos(Math.abs(clamp2(this.dot(q), -1, 1)));
|
|
3209
3209
|
}
|
|
3210
3210
|
/**
|
|
3211
3211
|
* Rotates this quaternion by a given angular step to the given quaternion.
|
|
@@ -3911,9 +3911,9 @@ var init_three_core = __esm({
|
|
|
3911
3911
|
* @return {Vector3} A reference to this vector.
|
|
3912
3912
|
*/
|
|
3913
3913
|
clamp(min2, max2) {
|
|
3914
|
-
this.x =
|
|
3915
|
-
this.y =
|
|
3916
|
-
this.z =
|
|
3914
|
+
this.x = clamp2(this.x, min2.x, max2.x);
|
|
3915
|
+
this.y = clamp2(this.y, min2.y, max2.y);
|
|
3916
|
+
this.z = clamp2(this.z, min2.z, max2.z);
|
|
3917
3917
|
return this;
|
|
3918
3918
|
}
|
|
3919
3919
|
/**
|
|
@@ -3927,9 +3927,9 @@ var init_three_core = __esm({
|
|
|
3927
3927
|
* @return {Vector3} A reference to this vector.
|
|
3928
3928
|
*/
|
|
3929
3929
|
clampScalar(minVal, maxVal) {
|
|
3930
|
-
this.x =
|
|
3931
|
-
this.y =
|
|
3932
|
-
this.z =
|
|
3930
|
+
this.x = clamp2(this.x, minVal, maxVal);
|
|
3931
|
+
this.y = clamp2(this.y, minVal, maxVal);
|
|
3932
|
+
this.z = clamp2(this.z, minVal, maxVal);
|
|
3933
3933
|
return this;
|
|
3934
3934
|
}
|
|
3935
3935
|
/**
|
|
@@ -3944,7 +3944,7 @@ var init_three_core = __esm({
|
|
|
3944
3944
|
*/
|
|
3945
3945
|
clampLength(min2, max2) {
|
|
3946
3946
|
const length2 = this.length();
|
|
3947
|
-
return this.divideScalar(length2 || 1).multiplyScalar(
|
|
3947
|
+
return this.divideScalar(length2 || 1).multiplyScalar(clamp2(length2, min2, max2));
|
|
3948
3948
|
}
|
|
3949
3949
|
/**
|
|
3950
3950
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -4154,7 +4154,7 @@ var init_three_core = __esm({
|
|
|
4154
4154
|
const denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
|
|
4155
4155
|
if (denominator === 0) return Math.PI / 2;
|
|
4156
4156
|
const theta = this.dot(v) / denominator;
|
|
4157
|
-
return Math.acos(
|
|
4157
|
+
return Math.acos(clamp2(theta, -1, 1));
|
|
4158
4158
|
}
|
|
4159
4159
|
/**
|
|
4160
4160
|
* Computes the distance from the given vector to this instance.
|
|
@@ -5843,10 +5843,10 @@ var init_three_core = __esm({
|
|
|
5843
5843
|
* @return {Vector4} A reference to this vector.
|
|
5844
5844
|
*/
|
|
5845
5845
|
clamp(min2, max2) {
|
|
5846
|
-
this.x =
|
|
5847
|
-
this.y =
|
|
5848
|
-
this.z =
|
|
5849
|
-
this.w =
|
|
5846
|
+
this.x = clamp2(this.x, min2.x, max2.x);
|
|
5847
|
+
this.y = clamp2(this.y, min2.y, max2.y);
|
|
5848
|
+
this.z = clamp2(this.z, min2.z, max2.z);
|
|
5849
|
+
this.w = clamp2(this.w, min2.w, max2.w);
|
|
5850
5850
|
return this;
|
|
5851
5851
|
}
|
|
5852
5852
|
/**
|
|
@@ -5860,10 +5860,10 @@ var init_three_core = __esm({
|
|
|
5860
5860
|
* @return {Vector4} A reference to this vector.
|
|
5861
5861
|
*/
|
|
5862
5862
|
clampScalar(minVal, maxVal) {
|
|
5863
|
-
this.x =
|
|
5864
|
-
this.y =
|
|
5865
|
-
this.z =
|
|
5866
|
-
this.w =
|
|
5863
|
+
this.x = clamp2(this.x, minVal, maxVal);
|
|
5864
|
+
this.y = clamp2(this.y, minVal, maxVal);
|
|
5865
|
+
this.z = clamp2(this.z, minVal, maxVal);
|
|
5866
|
+
this.w = clamp2(this.w, minVal, maxVal);
|
|
5867
5867
|
return this;
|
|
5868
5868
|
}
|
|
5869
5869
|
/**
|
|
@@ -5878,7 +5878,7 @@ var init_three_core = __esm({
|
|
|
5878
5878
|
*/
|
|
5879
5879
|
clampLength(min2, max2) {
|
|
5880
5880
|
const length2 = this.length();
|
|
5881
|
-
return this.divideScalar(length2 || 1).multiplyScalar(
|
|
5881
|
+
return this.divideScalar(length2 || 1).multiplyScalar(clamp2(length2, min2, max2));
|
|
5882
5882
|
}
|
|
5883
5883
|
/**
|
|
5884
5884
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -7661,7 +7661,7 @@ var init_three_core = __esm({
|
|
|
7661
7661
|
const m31 = te[2], m32 = te[6], m33 = te[10];
|
|
7662
7662
|
switch (order) {
|
|
7663
7663
|
case "XYZ":
|
|
7664
|
-
this._y = Math.asin(
|
|
7664
|
+
this._y = Math.asin(clamp2(m13, -1, 1));
|
|
7665
7665
|
if (Math.abs(m13) < 0.9999999) {
|
|
7666
7666
|
this._x = Math.atan2(-m23, m33);
|
|
7667
7667
|
this._z = Math.atan2(-m12, m11);
|
|
@@ -7671,7 +7671,7 @@ var init_three_core = __esm({
|
|
|
7671
7671
|
}
|
|
7672
7672
|
break;
|
|
7673
7673
|
case "YXZ":
|
|
7674
|
-
this._x = Math.asin(-
|
|
7674
|
+
this._x = Math.asin(-clamp2(m23, -1, 1));
|
|
7675
7675
|
if (Math.abs(m23) < 0.9999999) {
|
|
7676
7676
|
this._y = Math.atan2(m13, m33);
|
|
7677
7677
|
this._z = Math.atan2(m21, m22);
|
|
@@ -7681,7 +7681,7 @@ var init_three_core = __esm({
|
|
|
7681
7681
|
}
|
|
7682
7682
|
break;
|
|
7683
7683
|
case "ZXY":
|
|
7684
|
-
this._x = Math.asin(
|
|
7684
|
+
this._x = Math.asin(clamp2(m32, -1, 1));
|
|
7685
7685
|
if (Math.abs(m32) < 0.9999999) {
|
|
7686
7686
|
this._y = Math.atan2(-m31, m33);
|
|
7687
7687
|
this._z = Math.atan2(-m12, m22);
|
|
@@ -7691,7 +7691,7 @@ var init_three_core = __esm({
|
|
|
7691
7691
|
}
|
|
7692
7692
|
break;
|
|
7693
7693
|
case "ZYX":
|
|
7694
|
-
this._y = Math.asin(-
|
|
7694
|
+
this._y = Math.asin(-clamp2(m31, -1, 1));
|
|
7695
7695
|
if (Math.abs(m31) < 0.9999999) {
|
|
7696
7696
|
this._x = Math.atan2(m32, m33);
|
|
7697
7697
|
this._z = Math.atan2(m21, m11);
|
|
@@ -7701,7 +7701,7 @@ var init_three_core = __esm({
|
|
|
7701
7701
|
}
|
|
7702
7702
|
break;
|
|
7703
7703
|
case "YZX":
|
|
7704
|
-
this._z = Math.asin(
|
|
7704
|
+
this._z = Math.asin(clamp2(m21, -1, 1));
|
|
7705
7705
|
if (Math.abs(m21) < 0.9999999) {
|
|
7706
7706
|
this._x = Math.atan2(-m23, m22);
|
|
7707
7707
|
this._y = Math.atan2(-m31, m11);
|
|
@@ -7711,7 +7711,7 @@ var init_three_core = __esm({
|
|
|
7711
7711
|
}
|
|
7712
7712
|
break;
|
|
7713
7713
|
case "XZY":
|
|
7714
|
-
this._z = Math.asin(-
|
|
7714
|
+
this._z = Math.asin(-clamp2(m12, -1, 1));
|
|
7715
7715
|
if (Math.abs(m12) < 0.9999999) {
|
|
7716
7716
|
this._x = Math.atan2(m32, m22);
|
|
7717
7717
|
this._y = Math.atan2(m13, m11);
|
|
@@ -9335,8 +9335,8 @@ var init_three_core = __esm({
|
|
|
9335
9335
|
*/
|
|
9336
9336
|
setHSL(h2, s, l2, colorSpace = ColorManagement.workingColorSpace) {
|
|
9337
9337
|
h2 = euclideanModulo(h2, 1);
|
|
9338
|
-
s =
|
|
9339
|
-
l2 =
|
|
9338
|
+
s = clamp2(s, 0, 1);
|
|
9339
|
+
l2 = clamp2(l2, 0, 1);
|
|
9340
9340
|
if (s === 0) {
|
|
9341
9341
|
this.r = this.g = this.b = l2;
|
|
9342
9342
|
} else {
|
|
@@ -9522,7 +9522,7 @@ var init_three_core = __esm({
|
|
|
9522
9522
|
*/
|
|
9523
9523
|
getHex(colorSpace = SRGBColorSpace) {
|
|
9524
9524
|
ColorManagement.workingToColorSpace(_color.copy(this), colorSpace);
|
|
9525
|
-
return Math.round(
|
|
9525
|
+
return Math.round(clamp2(_color.r * 255, 0, 255)) * 65536 + Math.round(clamp2(_color.g * 255, 0, 255)) * 256 + Math.round(clamp2(_color.b * 255, 0, 255));
|
|
9526
9526
|
}
|
|
9527
9527
|
/**
|
|
9528
9528
|
* Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
|
|
@@ -18453,13 +18453,13 @@ var init_three_core = __esm({
|
|
|
18453
18453
|
vec.crossVectors(tangents[i3 - 1], tangents[i3]);
|
|
18454
18454
|
if (vec.length() > Number.EPSILON) {
|
|
18455
18455
|
vec.normalize();
|
|
18456
|
-
const theta = Math.acos(
|
|
18456
|
+
const theta = Math.acos(clamp2(tangents[i3 - 1].dot(tangents[i3]), -1, 1));
|
|
18457
18457
|
normals[i3].applyMatrix4(mat.makeRotationAxis(vec, theta));
|
|
18458
18458
|
}
|
|
18459
18459
|
binormals[i3].crossVectors(tangents[i3], normals[i3]);
|
|
18460
18460
|
}
|
|
18461
18461
|
if (closed === true) {
|
|
18462
|
-
let theta = Math.acos(
|
|
18462
|
+
let theta = Math.acos(clamp2(normals[0].dot(normals[segments]), -1, 1));
|
|
18463
18463
|
theta /= segments;
|
|
18464
18464
|
if (tangents[0].dot(vec.crossVectors(normals[0], normals[segments])) > 0) {
|
|
18465
18465
|
theta = -theta;
|
|
@@ -20248,7 +20248,7 @@ var init_three_core = __esm({
|
|
|
20248
20248
|
phiLength
|
|
20249
20249
|
};
|
|
20250
20250
|
segments = Math.floor(segments);
|
|
20251
|
-
phiLength =
|
|
20251
|
+
phiLength = clamp2(phiLength, 0, Math.PI * 2);
|
|
20252
20252
|
const indices = [];
|
|
20253
20253
|
const vertices = [];
|
|
20254
20254
|
const uvs = [];
|
|
@@ -21464,7 +21464,7 @@ var init_three_core = __esm({
|
|
|
21464
21464
|
this.ior = 1.5;
|
|
21465
21465
|
Object.defineProperty(this, "reflectivity", {
|
|
21466
21466
|
get: function() {
|
|
21467
|
-
return
|
|
21467
|
+
return clamp2(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);
|
|
21468
21468
|
},
|
|
21469
21469
|
set: function(reflectivity) {
|
|
21470
21470
|
this.ior = (1 + 0.4 * reflectivity) / (1 - 0.4 * reflectivity);
|
|
@@ -29732,7 +29732,7 @@ var init_three_core = __esm({
|
|
|
29732
29732
|
*/
|
|
29733
29733
|
makeSafe() {
|
|
29734
29734
|
const EPS = 1e-6;
|
|
29735
|
-
this.phi =
|
|
29735
|
+
this.phi = clamp2(this.phi, EPS, Math.PI - EPS);
|
|
29736
29736
|
return this;
|
|
29737
29737
|
}
|
|
29738
29738
|
/**
|
|
@@ -29760,7 +29760,7 @@ var init_three_core = __esm({
|
|
|
29760
29760
|
this.phi = 0;
|
|
29761
29761
|
} else {
|
|
29762
29762
|
this.theta = Math.atan2(x2, z);
|
|
29763
|
-
this.phi = Math.acos(
|
|
29763
|
+
this.phi = Math.acos(clamp2(y / this.radius, -1, 1));
|
|
29764
29764
|
}
|
|
29765
29765
|
return this;
|
|
29766
29766
|
}
|
|
@@ -30275,7 +30275,7 @@ var init_three_core = __esm({
|
|
|
30275
30275
|
const startEnd_startP = _startEnd.dot(_startP);
|
|
30276
30276
|
let t2 = startEnd_startP / startEnd2;
|
|
30277
30277
|
if (clampToLine) {
|
|
30278
|
-
t2 =
|
|
30278
|
+
t2 = clamp2(t2, 0, 1);
|
|
30279
30279
|
}
|
|
30280
30280
|
return t2;
|
|
30281
30281
|
}
|
|
@@ -30321,27 +30321,27 @@ var init_three_core = __esm({
|
|
|
30321
30321
|
if (a2 <= EPSILON) {
|
|
30322
30322
|
s = 0;
|
|
30323
30323
|
t2 = f / e2;
|
|
30324
|
-
t2 =
|
|
30324
|
+
t2 = clamp2(t2, 0, 1);
|
|
30325
30325
|
} else {
|
|
30326
30326
|
const c3 = _d1.dot(_r);
|
|
30327
30327
|
if (e2 <= EPSILON) {
|
|
30328
30328
|
t2 = 0;
|
|
30329
|
-
s =
|
|
30329
|
+
s = clamp2(-c3 / a2, 0, 1);
|
|
30330
30330
|
} else {
|
|
30331
30331
|
const b2 = _d1.dot(_d2);
|
|
30332
30332
|
const denom = a2 * e2 - b2 * b2;
|
|
30333
30333
|
if (denom !== 0) {
|
|
30334
|
-
s =
|
|
30334
|
+
s = clamp2((b2 * f - c3 * e2) / denom, 0, 1);
|
|
30335
30335
|
} else {
|
|
30336
30336
|
s = 0;
|
|
30337
30337
|
}
|
|
30338
30338
|
t2 = (b2 * s + f) / e2;
|
|
30339
30339
|
if (t2 < 0) {
|
|
30340
30340
|
t2 = 0;
|
|
30341
|
-
s =
|
|
30341
|
+
s = clamp2(-c3 / a2, 0, 1);
|
|
30342
30342
|
} else if (t2 > 1) {
|
|
30343
30343
|
t2 = 1;
|
|
30344
|
-
s =
|
|
30344
|
+
s = clamp2((b2 - c3) / a2, 0, 1);
|
|
30345
30345
|
}
|
|
30346
30346
|
}
|
|
30347
30347
|
}
|
|
@@ -70291,6 +70291,55 @@ var ACTION_BUTTON_PRESETS = [
|
|
|
70291
70291
|
label: "Return",
|
|
70292
70292
|
defaultAction: "prevSlide",
|
|
70293
70293
|
iconPath: "M18 8 L18 14 L6 14 M6 14 L10 10 M6 14 L10 18"
|
|
70294
|
+
},
|
|
70295
|
+
{
|
|
70296
|
+
shapeType: "actionButtonHome",
|
|
70297
|
+
label: "Home",
|
|
70298
|
+
defaultAction: "firstSlide",
|
|
70299
|
+
// House: roof + body
|
|
70300
|
+
iconPath: "M12 4 L20 11 L20 20 L14 20 L14 14 L10 14 L10 20 L4 20 L4 11 Z"
|
|
70301
|
+
},
|
|
70302
|
+
{
|
|
70303
|
+
shapeType: "actionButtonHelp",
|
|
70304
|
+
label: "Help",
|
|
70305
|
+
defaultAction: "none",
|
|
70306
|
+
// Question mark
|
|
70307
|
+
iconPath: "M9 9 a3 3 0 1 1 4 2.8 c-1 0.4 -1 1.2 -1 2 M12 17 v0.5"
|
|
70308
|
+
},
|
|
70309
|
+
{
|
|
70310
|
+
shapeType: "actionButtonInformation",
|
|
70311
|
+
label: "Information",
|
|
70312
|
+
defaultAction: "none",
|
|
70313
|
+
// Lower-case "i": dot + body
|
|
70314
|
+
iconPath: "M12 6 v0.01 M12 10 v8"
|
|
70315
|
+
},
|
|
70316
|
+
{
|
|
70317
|
+
shapeType: "actionButtonDocument",
|
|
70318
|
+
label: "Document",
|
|
70319
|
+
defaultAction: "none",
|
|
70320
|
+
// Document with folded corner
|
|
70321
|
+
iconPath: "M6 4 L14 4 L18 8 L18 20 L6 20 Z M14 4 L14 8 L18 8"
|
|
70322
|
+
},
|
|
70323
|
+
{
|
|
70324
|
+
shapeType: "actionButtonSound",
|
|
70325
|
+
label: "Sound",
|
|
70326
|
+
defaultAction: "none",
|
|
70327
|
+
// Speaker cone + sound waves
|
|
70328
|
+
iconPath: "M4 10 L4 14 L8 14 L12 18 L12 6 L8 10 Z M16 9 a4 4 0 0 1 0 6 M18 7 a7 7 0 0 1 0 10"
|
|
70329
|
+
},
|
|
70330
|
+
{
|
|
70331
|
+
shapeType: "actionButtonMovie",
|
|
70332
|
+
label: "Movie",
|
|
70333
|
+
defaultAction: "none",
|
|
70334
|
+
// Film strip with play triangle
|
|
70335
|
+
iconPath: "M4 6 L20 6 L20 18 L4 18 Z M10 9 L15 12 L10 15 Z"
|
|
70336
|
+
},
|
|
70337
|
+
{
|
|
70338
|
+
shapeType: "actionButtonBlank",
|
|
70339
|
+
label: "Custom",
|
|
70340
|
+
defaultAction: "none",
|
|
70341
|
+
// No glyph — empty path. The button still renders as a rounded rect via clip-path.
|
|
70342
|
+
iconPath: ""
|
|
70294
70343
|
}
|
|
70295
70344
|
];
|
|
70296
70345
|
Object.fromEntries(ACTION_BUTTON_PRESETS.map((p3) => [p3.shapeType, p3.defaultAction]));
|
|
@@ -72570,8 +72619,8 @@ function hexToRgb2(hex) {
|
|
|
72570
72619
|
};
|
|
72571
72620
|
}
|
|
72572
72621
|
function rgbToHex(r2, g2, b2) {
|
|
72573
|
-
const
|
|
72574
|
-
return `#${
|
|
72622
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
72623
|
+
return `#${clamp3(r2).toString(16).padStart(2, "0")}${clamp3(g2).toString(16).padStart(2, "0")}${clamp3(b2).toString(16).padStart(2, "0")}`;
|
|
72575
72624
|
}
|
|
72576
72625
|
function rgbToHsl(r2, g2, b2) {
|
|
72577
72626
|
const rn = r2 / 255;
|
|
@@ -74781,6 +74830,11 @@ function getShapeClipPath(shapeType, adjustments, width, height) {
|
|
|
74781
74830
|
}
|
|
74782
74831
|
const normalized = shapeType.toLowerCase();
|
|
74783
74832
|
if (normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
74833
|
+
if (adjustments?.adj !== void 0 && width && height) {
|
|
74834
|
+
const ratio = Math.min(Math.max(adjustments.adj / 1e5, 0), 0.5);
|
|
74835
|
+
const radiusPx = Math.round(Math.min(width, height) * ratio);
|
|
74836
|
+
return `inset(0 round ${radiusPx}px)`;
|
|
74837
|
+
}
|
|
74784
74838
|
return "inset(0 round 18px)";
|
|
74785
74839
|
}
|
|
74786
74840
|
if (normalized === "can" || normalized === "cylinder") {
|
|
@@ -75427,6 +75481,128 @@ function mapDagBlendModeToCss(blend) {
|
|
|
75427
75481
|
return void 0;
|
|
75428
75482
|
}
|
|
75429
75483
|
}
|
|
75484
|
+
function getImageAlphaFilterId(elementId) {
|
|
75485
|
+
return `imgalpha-${elementId}`;
|
|
75486
|
+
}
|
|
75487
|
+
function hasAdvancedImageAlphaEffects(element2) {
|
|
75488
|
+
if (!isImageLikeElement(element2)) {
|
|
75489
|
+
return false;
|
|
75490
|
+
}
|
|
75491
|
+
const e2 = element2.imageEffects;
|
|
75492
|
+
if (!e2) {
|
|
75493
|
+
return false;
|
|
75494
|
+
}
|
|
75495
|
+
return Boolean(
|
|
75496
|
+
typeof e2.alphaModFix === "number" || e2.alphaInv || e2.alphaCeiling || e2.alphaFloor || typeof e2.alphaRepl === "number" || typeof e2.alphaBiLevel === "number" || typeof e2.biLevel === "number" || e2.lum && (typeof e2.lum.bright === "number" || typeof e2.lum.contrast === "number") || e2.hsl && (typeof e2.hsl.sat === "number" || typeof e2.hsl.lum === "number") || e2.tint && typeof e2.tint.amt === "number" || e2.clrRepl
|
|
75497
|
+
);
|
|
75498
|
+
}
|
|
75499
|
+
function renderImageAlphaSvgFilter(element2) {
|
|
75500
|
+
if (!isImageLikeElement(element2)) {
|
|
75501
|
+
return null;
|
|
75502
|
+
}
|
|
75503
|
+
const e2 = element2.imageEffects;
|
|
75504
|
+
if (!e2 || !hasAdvancedImageAlphaEffects(element2)) {
|
|
75505
|
+
return null;
|
|
75506
|
+
}
|
|
75507
|
+
const filterId = getImageAlphaFilterId(element2.id);
|
|
75508
|
+
const primitives = [];
|
|
75509
|
+
let resultIdx = 0;
|
|
75510
|
+
let inputRef = "SourceGraphic";
|
|
75511
|
+
const next = (jsx229) => {
|
|
75512
|
+
const result = `r${resultIdx++}`;
|
|
75513
|
+
primitives.push(jsx229(inputRef, result));
|
|
75514
|
+
inputRef = result;
|
|
75515
|
+
};
|
|
75516
|
+
if (typeof e2.alphaModFix === "number") {
|
|
75517
|
+
const mul = clamp(e2.alphaModFix / 100, 0, 1);
|
|
75518
|
+
next((inp, out) => /* @__PURE__ */ jsx(
|
|
75519
|
+
"feColorMatrix",
|
|
75520
|
+
{
|
|
75521
|
+
in: inp,
|
|
75522
|
+
result: out,
|
|
75523
|
+
type: "matrix",
|
|
75524
|
+
values: `1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${mul} 0`
|
|
75525
|
+
},
|
|
75526
|
+
out
|
|
75527
|
+
));
|
|
75528
|
+
}
|
|
75529
|
+
if (e2.alphaInv) {
|
|
75530
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "linear", slope: -1, intercept: 1 }) }, out));
|
|
75531
|
+
}
|
|
75532
|
+
if (e2.alphaCeiling) {
|
|
75533
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "discrete", tableValues: "0 1 1 1 1 1 1 1 1 1" }) }, out));
|
|
75534
|
+
}
|
|
75535
|
+
if (e2.alphaFloor) {
|
|
75536
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "discrete", tableValues: "0 0 0 0 0 0 0 0 0 1" }) }, out));
|
|
75537
|
+
}
|
|
75538
|
+
if (typeof e2.alphaRepl === "number") {
|
|
75539
|
+
const a2 = clamp(e2.alphaRepl / 100, 0, 1);
|
|
75540
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "linear", slope: 0, intercept: a2 }) }, out));
|
|
75541
|
+
}
|
|
75542
|
+
if (typeof e2.alphaBiLevel === "number") {
|
|
75543
|
+
const t2 = clamp(e2.alphaBiLevel / 100, 0, 1);
|
|
75544
|
+
const table = Array.from({ length: 10 }, (_, i3) => i3 / 10 >= t2 ? "1" : "0").join(" ");
|
|
75545
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "discrete", tableValues: table }) }, out));
|
|
75546
|
+
}
|
|
75547
|
+
if (typeof e2.biLevel === "number") {
|
|
75548
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: "0" }, out));
|
|
75549
|
+
const t2 = clamp(e2.biLevel / 100, 0, 1);
|
|
75550
|
+
const tbl = t2 < 0.5 ? "0 1" : "0 1";
|
|
75551
|
+
next((inp, out) => /* @__PURE__ */ jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
75552
|
+
/* @__PURE__ */ jsx("feFuncR", { type: "discrete", tableValues: tbl }),
|
|
75553
|
+
/* @__PURE__ */ jsx("feFuncG", { type: "discrete", tableValues: tbl }),
|
|
75554
|
+
/* @__PURE__ */ jsx("feFuncB", { type: "discrete", tableValues: tbl })
|
|
75555
|
+
] }, out));
|
|
75556
|
+
}
|
|
75557
|
+
if (e2.lum && (typeof e2.lum.bright === "number" || typeof e2.lum.contrast === "number")) {
|
|
75558
|
+
const b2 = (e2.lum.bright ?? 0) / 100;
|
|
75559
|
+
const c2 = 1 + (e2.lum.contrast ?? 0) / 100;
|
|
75560
|
+
const slope = c2;
|
|
75561
|
+
const intercept = b2 + (1 - c2) / 2;
|
|
75562
|
+
next((inp, out) => /* @__PURE__ */ jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
75563
|
+
/* @__PURE__ */ jsx("feFuncR", { type: "linear", slope, intercept }),
|
|
75564
|
+
/* @__PURE__ */ jsx("feFuncG", { type: "linear", slope, intercept }),
|
|
75565
|
+
/* @__PURE__ */ jsx("feFuncB", { type: "linear", slope, intercept })
|
|
75566
|
+
] }, out));
|
|
75567
|
+
}
|
|
75568
|
+
if (e2.hsl && typeof e2.hsl.sat === "number") {
|
|
75569
|
+
const v = clamp(1 + e2.hsl.sat / 100, 0, 2);
|
|
75570
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
75571
|
+
}
|
|
75572
|
+
if (e2.tint && typeof e2.tint.amt === "number" && e2.tint.amt < 0) {
|
|
75573
|
+
const v = clamp(1 + e2.tint.amt / 100, 0, 1);
|
|
75574
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
75575
|
+
}
|
|
75576
|
+
if (e2.clrRepl) {
|
|
75577
|
+
const c2 = hexToRgbUnit(e2.clrRepl.color);
|
|
75578
|
+
next((inp, out) => /* @__PURE__ */ jsx(
|
|
75579
|
+
"feColorMatrix",
|
|
75580
|
+
{
|
|
75581
|
+
in: inp,
|
|
75582
|
+
result: out,
|
|
75583
|
+
type: "matrix",
|
|
75584
|
+
values: `0 0 0 0 ${c2.r} 0 0 0 0 ${c2.g} 0 0 0 0 ${c2.b} 0 0 0 1 0`
|
|
75585
|
+
},
|
|
75586
|
+
out
|
|
75587
|
+
));
|
|
75588
|
+
}
|
|
75589
|
+
if (primitives.length === 0) {
|
|
75590
|
+
return null;
|
|
75591
|
+
}
|
|
75592
|
+
return /* @__PURE__ */ jsx(
|
|
75593
|
+
"svg",
|
|
75594
|
+
{
|
|
75595
|
+
width: 0,
|
|
75596
|
+
height: 0,
|
|
75597
|
+
style: { position: "absolute", overflow: "hidden" },
|
|
75598
|
+
"aria-hidden": "true",
|
|
75599
|
+
children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("filter", { id: filterId, colorInterpolationFilters: "sRGB", children: primitives }) })
|
|
75600
|
+
}
|
|
75601
|
+
);
|
|
75602
|
+
}
|
|
75603
|
+
function clamp(v, lo, hi) {
|
|
75604
|
+
return v < lo ? lo : v > hi ? hi : v;
|
|
75605
|
+
}
|
|
75430
75606
|
function getDagDuotoneFilterId(elementId) {
|
|
75431
75607
|
return `dag-duotone-${elementId}`;
|
|
75432
75608
|
}
|
|
@@ -75510,6 +75686,9 @@ function getImageEffectsFilter(element2, options) {
|
|
|
75510
75686
|
const filterId = getDuotoneFilterId(element2.id);
|
|
75511
75687
|
filters.push(`url(#${filterId})`);
|
|
75512
75688
|
}
|
|
75689
|
+
if (hasAdvancedImageAlphaEffects(element2)) {
|
|
75690
|
+
filters.push(`url(#${getImageAlphaFilterId(element2.id)})`);
|
|
75691
|
+
}
|
|
75513
75692
|
if (effects.artisticEffect) {
|
|
75514
75693
|
const radius = effects.artisticRadius ?? 5;
|
|
75515
75694
|
if (needsSvgArtisticFilter(effects.artisticEffect)) {
|
|
@@ -75683,6 +75862,39 @@ function getEffectDagCssFilter(style, elementId) {
|
|
|
75683
75862
|
return filters.length > 0 ? filters.join(" ") : void 0;
|
|
75684
75863
|
}
|
|
75685
75864
|
var getEffectDagFilter = getEffectDagCssFilter;
|
|
75865
|
+
function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
|
|
75866
|
+
if (!shapeType) {
|
|
75867
|
+
return void 0;
|
|
75868
|
+
}
|
|
75869
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
75870
|
+
return getShapeClipPath(shapeType, adjustments, width, height);
|
|
75871
|
+
}
|
|
75872
|
+
if (adjustments && Object.keys(adjustments).length > 0) {
|
|
75873
|
+
const adjusted = getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
|
|
75874
|
+
if (adjusted !== void 0) {
|
|
75875
|
+
return adjusted;
|
|
75876
|
+
}
|
|
75877
|
+
}
|
|
75878
|
+
const fromPreset = getShapeClipPathFromPreset(shapeType, width, height, adjustments);
|
|
75879
|
+
if (fromPreset !== void 0) {
|
|
75880
|
+
return fromPreset;
|
|
75881
|
+
}
|
|
75882
|
+
const cloud = getCloudPathForRendering(shapeType, width, height);
|
|
75883
|
+
if (cloud !== void 0) {
|
|
75884
|
+
return cloud;
|
|
75885
|
+
}
|
|
75886
|
+
return getShapeClipPath(shapeType, adjustments, width, height);
|
|
75887
|
+
}
|
|
75888
|
+
function getResolvedShapeClipPath(element2, width, height) {
|
|
75889
|
+
const shapeType = element2.shapeType;
|
|
75890
|
+
if (!shapeType) {
|
|
75891
|
+
return void 0;
|
|
75892
|
+
}
|
|
75893
|
+
const w = element2.width;
|
|
75894
|
+
const h2 = element2.height;
|
|
75895
|
+
const adjustments = element2.shapeAdjustments;
|
|
75896
|
+
return getResolvedShapeClipPathFor(shapeType, w, h2, adjustments);
|
|
75897
|
+
}
|
|
75686
75898
|
|
|
75687
75899
|
// src/viewer/utils/shape-round-rect.ts
|
|
75688
75900
|
function localClampAdjustment(value) {
|
|
@@ -75754,6 +75966,27 @@ var MATERIAL_MAP = {
|
|
|
75754
75966
|
filter: "brightness(1.1) contrast(0.85)",
|
|
75755
75967
|
// Translucent powder: slight translucent glow
|
|
75756
75968
|
backgroundImage: "radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 60%)"
|
|
75969
|
+
},
|
|
75970
|
+
// Legacy materials (PowerPoint 2007 / earlier). Render as muted variants
|
|
75971
|
+
// of the modern equivalents so legacy decks still resemble the originals.
|
|
75972
|
+
legacyMatte: {
|
|
75973
|
+
filter: "brightness(0.92) saturate(0.85)",
|
|
75974
|
+
backgroundImage: "linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 50%, rgba(0,0,0,0.04) 100%)"
|
|
75975
|
+
},
|
|
75976
|
+
legacyPlastic: {
|
|
75977
|
+
filter: "brightness(1.02) contrast(1.03)",
|
|
75978
|
+
boxShadow: "inset -2px -2px 5px rgba(255,255,255,0.3)",
|
|
75979
|
+
backgroundImage: "radial-gradient(ellipse 35% 25% at 25% 20%, rgba(255,255,255,0.15) 0%, transparent 70%)"
|
|
75980
|
+
},
|
|
75981
|
+
legacyMetal: {
|
|
75982
|
+
filter: "brightness(1.05) contrast(1.1) saturate(1.1)",
|
|
75983
|
+
boxShadow: "inset -2px -2px 6px rgba(255,255,255,0.35), inset 1px 1px 3px rgba(255,255,255,0.15)",
|
|
75984
|
+
backgroundImage: "linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 25%, transparent 50%, rgba(0,0,0,0.05) 80%)"
|
|
75985
|
+
},
|
|
75986
|
+
legacyWireframe: {
|
|
75987
|
+
filter: "brightness(1) contrast(1.4) saturate(0.6)",
|
|
75988
|
+
// Wireframe: high contrast outline-emphasising look
|
|
75989
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.4)"
|
|
75757
75990
|
}
|
|
75758
75991
|
};
|
|
75759
75992
|
function getMaterialCssOverrides(material) {
|
|
@@ -76708,8 +76941,7 @@ function getShapeVisualStyle(element2, hasFill, fillColor, strokeWidth, strokeCo
|
|
|
76708
76941
|
return {};
|
|
76709
76942
|
}
|
|
76710
76943
|
const normalizedShapeType = getShapeType(element2.shapeType);
|
|
76711
|
-
const
|
|
76712
|
-
const clipPath = getShapeClipPath(shapeType);
|
|
76944
|
+
const clipPath = getResolvedShapeClipPath(element2);
|
|
76713
76945
|
const fillOpacity = element2.shapeStyle?.fillOpacity;
|
|
76714
76946
|
const strokeOpacity = element2.shapeStyle?.strokeOpacity;
|
|
76715
76947
|
const strokeDash = normalizeStrokeDashType(element2.shapeStyle?.strokeDash);
|
|
@@ -77311,7 +77543,7 @@ function getImageMaskStyle(element2) {
|
|
|
77311
77543
|
if (normalized === "can" || normalized === "cylinder") {
|
|
77312
77544
|
return { borderRadius: "48% / 12%" };
|
|
77313
77545
|
}
|
|
77314
|
-
const clipPath =
|
|
77546
|
+
const clipPath = getResolvedShapeClipPath(element2);
|
|
77315
77547
|
if (!clipPath) {
|
|
77316
77548
|
return void 0;
|
|
77317
77549
|
}
|
|
@@ -77974,8 +78206,8 @@ function hexToRgb3(hex) {
|
|
|
77974
78206
|
};
|
|
77975
78207
|
}
|
|
77976
78208
|
function rgbToHex2(r2, g2, b2) {
|
|
77977
|
-
const
|
|
77978
|
-
return `#${
|
|
78209
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
78210
|
+
return `#${clamp3(r2).toString(16).padStart(2, "0").toUpperCase()}${clamp3(g2).toString(16).padStart(2, "0").toUpperCase()}${clamp3(b2).toString(16).padStart(2, "0").toUpperCase()}`;
|
|
77979
78211
|
}
|
|
77980
78212
|
function tintColor(hex, tintFactor) {
|
|
77981
78213
|
const { r: r2, g: g2, b: b2 } = hexToRgb3(hex);
|
|
@@ -78906,13 +79138,13 @@ function cellStyleToCss(style) {
|
|
|
78906
79138
|
}
|
|
78907
79139
|
if (style.textDirection) {
|
|
78908
79140
|
switch (style.textDirection) {
|
|
78909
|
-
case "
|
|
79141
|
+
case "vert":
|
|
78910
79142
|
case "eaVert":
|
|
78911
79143
|
case "wordArtVert":
|
|
78912
79144
|
case "wordArtVertRtl":
|
|
78913
79145
|
css.writingMode = "vertical-rl";
|
|
78914
79146
|
break;
|
|
78915
|
-
case "
|
|
79147
|
+
case "vert270":
|
|
78916
79148
|
case "mongolianVert":
|
|
78917
79149
|
css.writingMode = "vertical-lr";
|
|
78918
79150
|
break;
|
|
@@ -79439,8 +79671,8 @@ function hexToRgb4(hex) {
|
|
|
79439
79671
|
];
|
|
79440
79672
|
}
|
|
79441
79673
|
function rgbToHex3(r2, g2, b2) {
|
|
79442
|
-
const
|
|
79443
|
-
return `#${
|
|
79674
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
79675
|
+
return `#${clamp3(r2).toString(16).padStart(2, "0")}${clamp3(g2).toString(16).padStart(2, "0")}${clamp3(b2).toString(16).padStart(2, "0")}`;
|
|
79444
79676
|
}
|
|
79445
79677
|
function tint(hex, amount) {
|
|
79446
79678
|
const [r2, g2, b2] = hexToRgb4(hex);
|
|
@@ -81358,7 +81590,7 @@ function resolveRegionCode(label) {
|
|
|
81358
81590
|
return REGION_ALIAS_MAP[normalized];
|
|
81359
81591
|
}
|
|
81360
81592
|
function lerpColor(a2, b2, t2) {
|
|
81361
|
-
const
|
|
81593
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
81362
81594
|
const parse = (hex) => {
|
|
81363
81595
|
const h2 = hex.replace("#", "");
|
|
81364
81596
|
return [
|
|
@@ -81369,9 +81601,9 @@ function lerpColor(a2, b2, t2) {
|
|
|
81369
81601
|
};
|
|
81370
81602
|
const [r1, g1, b1] = parse(a2);
|
|
81371
81603
|
const [r2, g2, b22] = parse(b2);
|
|
81372
|
-
const r3 =
|
|
81373
|
-
const g3 =
|
|
81374
|
-
const bl =
|
|
81604
|
+
const r3 = clamp3(r1 + (r2 - r1) * t2);
|
|
81605
|
+
const g3 = clamp3(g1 + (g2 - g1) * t2);
|
|
81606
|
+
const bl = clamp3(b1 + (b22 - b1) * t2);
|
|
81375
81607
|
return `#${r3.toString(16).padStart(2, "0")}${g3.toString(16).padStart(2, "0")}${bl.toString(16).padStart(2, "0")}`;
|
|
81376
81608
|
}
|
|
81377
81609
|
function sequentialColorScale(t2) {
|
|
@@ -88123,6 +88355,59 @@ function WarpedText({
|
|
|
88123
88355
|
}
|
|
88124
88356
|
);
|
|
88125
88357
|
}
|
|
88358
|
+
var GLYPH_BY_SHAPE = Object.fromEntries(
|
|
88359
|
+
ACTION_BUTTON_PRESETS.map((p3) => [p3.shapeType, p3.iconPath])
|
|
88360
|
+
);
|
|
88361
|
+
GLYPH_BY_SHAPE["actionButtonForwardOrNext"] = GLYPH_BY_SHAPE["actionButtonForwardNext"];
|
|
88362
|
+
GLYPH_BY_SHAPE["actionButtonBackOrPrevious"] = GLYPH_BY_SHAPE["actionButtonBackPrevious"];
|
|
88363
|
+
function isActionButtonShape(shapeType) {
|
|
88364
|
+
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
88365
|
+
}
|
|
88366
|
+
function getActionButtonGlyphPath(shapeType) {
|
|
88367
|
+
if (!shapeType) {
|
|
88368
|
+
return void 0;
|
|
88369
|
+
}
|
|
88370
|
+
const path = GLYPH_BY_SHAPE[shapeType];
|
|
88371
|
+
return path && path.length > 0 ? path : void 0;
|
|
88372
|
+
}
|
|
88373
|
+
function ActionButtonGlyphOverlay({
|
|
88374
|
+
element: element2,
|
|
88375
|
+
color
|
|
88376
|
+
}) {
|
|
88377
|
+
const shapeType = "shapeType" in element2 ? element2.shapeType : void 0;
|
|
88378
|
+
const path = getActionButtonGlyphPath(shapeType);
|
|
88379
|
+
if (!path) {
|
|
88380
|
+
return null;
|
|
88381
|
+
}
|
|
88382
|
+
const stroke = color ?? ("textStyle" in element2 && element2.textStyle?.color || "#ffffff");
|
|
88383
|
+
return /* @__PURE__ */ jsx(
|
|
88384
|
+
"svg",
|
|
88385
|
+
{
|
|
88386
|
+
viewBox: "0 0 24 24",
|
|
88387
|
+
width: "100%",
|
|
88388
|
+
height: "100%",
|
|
88389
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
88390
|
+
style: {
|
|
88391
|
+
position: "absolute",
|
|
88392
|
+
inset: 0,
|
|
88393
|
+
pointerEvents: "none",
|
|
88394
|
+
padding: "20%"
|
|
88395
|
+
},
|
|
88396
|
+
"aria-hidden": "true",
|
|
88397
|
+
children: /* @__PURE__ */ jsx(
|
|
88398
|
+
"path",
|
|
88399
|
+
{
|
|
88400
|
+
d: path,
|
|
88401
|
+
fill: "none",
|
|
88402
|
+
stroke,
|
|
88403
|
+
strokeWidth: 2,
|
|
88404
|
+
strokeLinecap: "round",
|
|
88405
|
+
strokeLinejoin: "round"
|
|
88406
|
+
}
|
|
88407
|
+
)
|
|
88408
|
+
}
|
|
88409
|
+
);
|
|
88410
|
+
}
|
|
88126
88411
|
function ColorChangedImage({
|
|
88127
88412
|
src,
|
|
88128
88413
|
clrChange,
|
|
@@ -88393,6 +88678,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
88393
88678
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88394
88679
|
tileDuotoneColors && renderDuotoneSvgFilter(el.id, tileDuotoneColors.color1, tileDuotoneColors.color2),
|
|
88395
88680
|
renderArtisticEffectSvgFilter(el.id, artisticEffectName, artisticRadius),
|
|
88681
|
+
renderImageAlphaSvgFilter(el),
|
|
88396
88682
|
/* @__PURE__ */ jsx(
|
|
88397
88683
|
"div",
|
|
88398
88684
|
{
|
|
@@ -88414,6 +88700,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
88414
88700
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88415
88701
|
duotoneColors && !useDuotoneCanvas && renderDuotoneSvgFilter(el.id, duotoneColors.color1, duotoneColors.color2),
|
|
88416
88702
|
renderArtisticEffectSvgFilter(el.id, artisticEffectName, artisticRadius),
|
|
88703
|
+
renderImageAlphaSvgFilter(el),
|
|
88417
88704
|
useDuotoneCanvas && duotoneColors ? /* @__PURE__ */ jsx(
|
|
88418
88705
|
DuotoneImage,
|
|
88419
88706
|
{
|
|
@@ -90922,8 +91209,11 @@ function renderBody(el, isImg, isEditing, editText, spellCheck, txtSE, txtS, vec
|
|
|
90922
91209
|
...scene3dStyle.perspective ? { perspective: scene3dStyle.perspective } : {},
|
|
90923
91210
|
...scene3dStyle.transformStyle ? { transformStyle: scene3dStyle.transformStyle } : {}
|
|
90924
91211
|
} : void 0;
|
|
91212
|
+
const shapeTypeForGlyph = "shapeType" in el ? el.shapeType : void 0;
|
|
91213
|
+
const showActionButtonGlyph = isActionButtonShape(shapeTypeForGlyph);
|
|
90925
91214
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
90926
91215
|
vecShape,
|
|
91216
|
+
showActionButtonGlyph && /* @__PURE__ */ jsx(ActionButtonGlyphOverlay, { element: el }),
|
|
90927
91217
|
isTxtEl ? useSvgWarp ? /* @__PURE__ */ jsx(
|
|
90928
91218
|
"div",
|
|
90929
91219
|
{
|