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/viewer/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, applyThemeToData, THEME_PRESETS } 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, applyThemeToData, THEME_PRESETS } 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
|
}
|
|
@@ -70280,6 +70280,55 @@ var ACTION_BUTTON_PRESETS = [
|
|
|
70280
70280
|
label: "Return",
|
|
70281
70281
|
defaultAction: "prevSlide",
|
|
70282
70282
|
iconPath: "M18 8 L18 14 L6 14 M6 14 L10 10 M6 14 L10 18"
|
|
70283
|
+
},
|
|
70284
|
+
{
|
|
70285
|
+
shapeType: "actionButtonHome",
|
|
70286
|
+
label: "Home",
|
|
70287
|
+
defaultAction: "firstSlide",
|
|
70288
|
+
// House: roof + body
|
|
70289
|
+
iconPath: "M12 4 L20 11 L20 20 L14 20 L14 14 L10 14 L10 20 L4 20 L4 11 Z"
|
|
70290
|
+
},
|
|
70291
|
+
{
|
|
70292
|
+
shapeType: "actionButtonHelp",
|
|
70293
|
+
label: "Help",
|
|
70294
|
+
defaultAction: "none",
|
|
70295
|
+
// Question mark
|
|
70296
|
+
iconPath: "M9 9 a3 3 0 1 1 4 2.8 c-1 0.4 -1 1.2 -1 2 M12 17 v0.5"
|
|
70297
|
+
},
|
|
70298
|
+
{
|
|
70299
|
+
shapeType: "actionButtonInformation",
|
|
70300
|
+
label: "Information",
|
|
70301
|
+
defaultAction: "none",
|
|
70302
|
+
// Lower-case "i": dot + body
|
|
70303
|
+
iconPath: "M12 6 v0.01 M12 10 v8"
|
|
70304
|
+
},
|
|
70305
|
+
{
|
|
70306
|
+
shapeType: "actionButtonDocument",
|
|
70307
|
+
label: "Document",
|
|
70308
|
+
defaultAction: "none",
|
|
70309
|
+
// Document with folded corner
|
|
70310
|
+
iconPath: "M6 4 L14 4 L18 8 L18 20 L6 20 Z M14 4 L14 8 L18 8"
|
|
70311
|
+
},
|
|
70312
|
+
{
|
|
70313
|
+
shapeType: "actionButtonSound",
|
|
70314
|
+
label: "Sound",
|
|
70315
|
+
defaultAction: "none",
|
|
70316
|
+
// Speaker cone + sound waves
|
|
70317
|
+
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"
|
|
70318
|
+
},
|
|
70319
|
+
{
|
|
70320
|
+
shapeType: "actionButtonMovie",
|
|
70321
|
+
label: "Movie",
|
|
70322
|
+
defaultAction: "none",
|
|
70323
|
+
// Film strip with play triangle
|
|
70324
|
+
iconPath: "M4 6 L20 6 L20 18 L4 18 Z M10 9 L15 12 L10 15 Z"
|
|
70325
|
+
},
|
|
70326
|
+
{
|
|
70327
|
+
shapeType: "actionButtonBlank",
|
|
70328
|
+
label: "Custom",
|
|
70329
|
+
defaultAction: "none",
|
|
70330
|
+
// No glyph — empty path. The button still renders as a rounded rect via clip-path.
|
|
70331
|
+
iconPath: ""
|
|
70283
70332
|
}
|
|
70284
70333
|
];
|
|
70285
70334
|
Object.fromEntries(ACTION_BUTTON_PRESETS.map((p3) => [p3.shapeType, p3.defaultAction]));
|
|
@@ -72559,8 +72608,8 @@ function hexToRgb2(hex) {
|
|
|
72559
72608
|
};
|
|
72560
72609
|
}
|
|
72561
72610
|
function rgbToHex(r2, g2, b2) {
|
|
72562
|
-
const
|
|
72563
|
-
return `#${
|
|
72611
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
72612
|
+
return `#${clamp3(r2).toString(16).padStart(2, "0")}${clamp3(g2).toString(16).padStart(2, "0")}${clamp3(b2).toString(16).padStart(2, "0")}`;
|
|
72564
72613
|
}
|
|
72565
72614
|
function rgbToHsl(r2, g2, b2) {
|
|
72566
72615
|
const rn = r2 / 255;
|
|
@@ -74770,6 +74819,11 @@ function getShapeClipPath(shapeType, adjustments, width, height) {
|
|
|
74770
74819
|
}
|
|
74771
74820
|
const normalized = shapeType.toLowerCase();
|
|
74772
74821
|
if (normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
74822
|
+
if (adjustments?.adj !== void 0 && width && height) {
|
|
74823
|
+
const ratio = Math.min(Math.max(adjustments.adj / 1e5, 0), 0.5);
|
|
74824
|
+
const radiusPx = Math.round(Math.min(width, height) * ratio);
|
|
74825
|
+
return `inset(0 round ${radiusPx}px)`;
|
|
74826
|
+
}
|
|
74773
74827
|
return "inset(0 round 18px)";
|
|
74774
74828
|
}
|
|
74775
74829
|
if (normalized === "can" || normalized === "cylinder") {
|
|
@@ -75416,6 +75470,128 @@ function mapDagBlendModeToCss(blend) {
|
|
|
75416
75470
|
return void 0;
|
|
75417
75471
|
}
|
|
75418
75472
|
}
|
|
75473
|
+
function getImageAlphaFilterId(elementId) {
|
|
75474
|
+
return `imgalpha-${elementId}`;
|
|
75475
|
+
}
|
|
75476
|
+
function hasAdvancedImageAlphaEffects(element2) {
|
|
75477
|
+
if (!isImageLikeElement(element2)) {
|
|
75478
|
+
return false;
|
|
75479
|
+
}
|
|
75480
|
+
const e2 = element2.imageEffects;
|
|
75481
|
+
if (!e2) {
|
|
75482
|
+
return false;
|
|
75483
|
+
}
|
|
75484
|
+
return Boolean(
|
|
75485
|
+
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
|
|
75486
|
+
);
|
|
75487
|
+
}
|
|
75488
|
+
function renderImageAlphaSvgFilter(element2) {
|
|
75489
|
+
if (!isImageLikeElement(element2)) {
|
|
75490
|
+
return null;
|
|
75491
|
+
}
|
|
75492
|
+
const e2 = element2.imageEffects;
|
|
75493
|
+
if (!e2 || !hasAdvancedImageAlphaEffects(element2)) {
|
|
75494
|
+
return null;
|
|
75495
|
+
}
|
|
75496
|
+
const filterId = getImageAlphaFilterId(element2.id);
|
|
75497
|
+
const primitives = [];
|
|
75498
|
+
let resultIdx = 0;
|
|
75499
|
+
let inputRef = "SourceGraphic";
|
|
75500
|
+
const next = (jsx229) => {
|
|
75501
|
+
const result = `r${resultIdx++}`;
|
|
75502
|
+
primitives.push(jsx229(inputRef, result));
|
|
75503
|
+
inputRef = result;
|
|
75504
|
+
};
|
|
75505
|
+
if (typeof e2.alphaModFix === "number") {
|
|
75506
|
+
const mul = clamp(e2.alphaModFix / 100, 0, 1);
|
|
75507
|
+
next((inp, out) => /* @__PURE__ */ jsx(
|
|
75508
|
+
"feColorMatrix",
|
|
75509
|
+
{
|
|
75510
|
+
in: inp,
|
|
75511
|
+
result: out,
|
|
75512
|
+
type: "matrix",
|
|
75513
|
+
values: `1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${mul} 0`
|
|
75514
|
+
},
|
|
75515
|
+
out
|
|
75516
|
+
));
|
|
75517
|
+
}
|
|
75518
|
+
if (e2.alphaInv) {
|
|
75519
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "linear", slope: -1, intercept: 1 }) }, out));
|
|
75520
|
+
}
|
|
75521
|
+
if (e2.alphaCeiling) {
|
|
75522
|
+
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));
|
|
75523
|
+
}
|
|
75524
|
+
if (e2.alphaFloor) {
|
|
75525
|
+
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));
|
|
75526
|
+
}
|
|
75527
|
+
if (typeof e2.alphaRepl === "number") {
|
|
75528
|
+
const a2 = clamp(e2.alphaRepl / 100, 0, 1);
|
|
75529
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "linear", slope: 0, intercept: a2 }) }, out));
|
|
75530
|
+
}
|
|
75531
|
+
if (typeof e2.alphaBiLevel === "number") {
|
|
75532
|
+
const t2 = clamp(e2.alphaBiLevel / 100, 0, 1);
|
|
75533
|
+
const table = Array.from({ length: 10 }, (_, i3) => i3 / 10 >= t2 ? "1" : "0").join(" ");
|
|
75534
|
+
next((inp, out) => /* @__PURE__ */ jsx("feComponentTransfer", { in: inp, result: out, children: /* @__PURE__ */ jsx("feFuncA", { type: "discrete", tableValues: table }) }, out));
|
|
75535
|
+
}
|
|
75536
|
+
if (typeof e2.biLevel === "number") {
|
|
75537
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: "0" }, out));
|
|
75538
|
+
const t2 = clamp(e2.biLevel / 100, 0, 1);
|
|
75539
|
+
const tbl = t2 < 0.5 ? "0 1" : "0 1";
|
|
75540
|
+
next((inp, out) => /* @__PURE__ */ jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
75541
|
+
/* @__PURE__ */ jsx("feFuncR", { type: "discrete", tableValues: tbl }),
|
|
75542
|
+
/* @__PURE__ */ jsx("feFuncG", { type: "discrete", tableValues: tbl }),
|
|
75543
|
+
/* @__PURE__ */ jsx("feFuncB", { type: "discrete", tableValues: tbl })
|
|
75544
|
+
] }, out));
|
|
75545
|
+
}
|
|
75546
|
+
if (e2.lum && (typeof e2.lum.bright === "number" || typeof e2.lum.contrast === "number")) {
|
|
75547
|
+
const b2 = (e2.lum.bright ?? 0) / 100;
|
|
75548
|
+
const c2 = 1 + (e2.lum.contrast ?? 0) / 100;
|
|
75549
|
+
const slope = c2;
|
|
75550
|
+
const intercept = b2 + (1 - c2) / 2;
|
|
75551
|
+
next((inp, out) => /* @__PURE__ */ jsxs("feComponentTransfer", { in: inp, result: out, children: [
|
|
75552
|
+
/* @__PURE__ */ jsx("feFuncR", { type: "linear", slope, intercept }),
|
|
75553
|
+
/* @__PURE__ */ jsx("feFuncG", { type: "linear", slope, intercept }),
|
|
75554
|
+
/* @__PURE__ */ jsx("feFuncB", { type: "linear", slope, intercept })
|
|
75555
|
+
] }, out));
|
|
75556
|
+
}
|
|
75557
|
+
if (e2.hsl && typeof e2.hsl.sat === "number") {
|
|
75558
|
+
const v = clamp(1 + e2.hsl.sat / 100, 0, 2);
|
|
75559
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
75560
|
+
}
|
|
75561
|
+
if (e2.tint && typeof e2.tint.amt === "number" && e2.tint.amt < 0) {
|
|
75562
|
+
const v = clamp(1 + e2.tint.amt / 100, 0, 1);
|
|
75563
|
+
next((inp, out) => /* @__PURE__ */ jsx("feColorMatrix", { in: inp, result: out, type: "saturate", values: String(v) }, out));
|
|
75564
|
+
}
|
|
75565
|
+
if (e2.clrRepl) {
|
|
75566
|
+
const c2 = hexToRgbUnit(e2.clrRepl.color);
|
|
75567
|
+
next((inp, out) => /* @__PURE__ */ jsx(
|
|
75568
|
+
"feColorMatrix",
|
|
75569
|
+
{
|
|
75570
|
+
in: inp,
|
|
75571
|
+
result: out,
|
|
75572
|
+
type: "matrix",
|
|
75573
|
+
values: `0 0 0 0 ${c2.r} 0 0 0 0 ${c2.g} 0 0 0 0 ${c2.b} 0 0 0 1 0`
|
|
75574
|
+
},
|
|
75575
|
+
out
|
|
75576
|
+
));
|
|
75577
|
+
}
|
|
75578
|
+
if (primitives.length === 0) {
|
|
75579
|
+
return null;
|
|
75580
|
+
}
|
|
75581
|
+
return /* @__PURE__ */ jsx(
|
|
75582
|
+
"svg",
|
|
75583
|
+
{
|
|
75584
|
+
width: 0,
|
|
75585
|
+
height: 0,
|
|
75586
|
+
style: { position: "absolute", overflow: "hidden" },
|
|
75587
|
+
"aria-hidden": "true",
|
|
75588
|
+
children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("filter", { id: filterId, colorInterpolationFilters: "sRGB", children: primitives }) })
|
|
75589
|
+
}
|
|
75590
|
+
);
|
|
75591
|
+
}
|
|
75592
|
+
function clamp(v, lo, hi) {
|
|
75593
|
+
return v < lo ? lo : v > hi ? hi : v;
|
|
75594
|
+
}
|
|
75419
75595
|
function getDagDuotoneFilterId(elementId) {
|
|
75420
75596
|
return `dag-duotone-${elementId}`;
|
|
75421
75597
|
}
|
|
@@ -75499,6 +75675,9 @@ function getImageEffectsFilter(element2, options) {
|
|
|
75499
75675
|
const filterId = getDuotoneFilterId(element2.id);
|
|
75500
75676
|
filters.push(`url(#${filterId})`);
|
|
75501
75677
|
}
|
|
75678
|
+
if (hasAdvancedImageAlphaEffects(element2)) {
|
|
75679
|
+
filters.push(`url(#${getImageAlphaFilterId(element2.id)})`);
|
|
75680
|
+
}
|
|
75502
75681
|
if (effects.artisticEffect) {
|
|
75503
75682
|
const radius = effects.artisticRadius ?? 5;
|
|
75504
75683
|
if (needsSvgArtisticFilter(effects.artisticEffect)) {
|
|
@@ -75672,6 +75851,39 @@ function getEffectDagCssFilter(style, elementId) {
|
|
|
75672
75851
|
return filters.length > 0 ? filters.join(" ") : void 0;
|
|
75673
75852
|
}
|
|
75674
75853
|
var getEffectDagFilter = getEffectDagCssFilter;
|
|
75854
|
+
function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
|
|
75855
|
+
if (!shapeType) {
|
|
75856
|
+
return void 0;
|
|
75857
|
+
}
|
|
75858
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
75859
|
+
return getShapeClipPath(shapeType, adjustments, width, height);
|
|
75860
|
+
}
|
|
75861
|
+
if (adjustments && Object.keys(adjustments).length > 0) {
|
|
75862
|
+
const adjusted = getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
|
|
75863
|
+
if (adjusted !== void 0) {
|
|
75864
|
+
return adjusted;
|
|
75865
|
+
}
|
|
75866
|
+
}
|
|
75867
|
+
const fromPreset = getShapeClipPathFromPreset(shapeType, width, height, adjustments);
|
|
75868
|
+
if (fromPreset !== void 0) {
|
|
75869
|
+
return fromPreset;
|
|
75870
|
+
}
|
|
75871
|
+
const cloud = getCloudPathForRendering(shapeType, width, height);
|
|
75872
|
+
if (cloud !== void 0) {
|
|
75873
|
+
return cloud;
|
|
75874
|
+
}
|
|
75875
|
+
return getShapeClipPath(shapeType, adjustments, width, height);
|
|
75876
|
+
}
|
|
75877
|
+
function getResolvedShapeClipPath(element2, width, height) {
|
|
75878
|
+
const shapeType = element2.shapeType;
|
|
75879
|
+
if (!shapeType) {
|
|
75880
|
+
return void 0;
|
|
75881
|
+
}
|
|
75882
|
+
const w = element2.width;
|
|
75883
|
+
const h2 = element2.height;
|
|
75884
|
+
const adjustments = element2.shapeAdjustments;
|
|
75885
|
+
return getResolvedShapeClipPathFor(shapeType, w, h2, adjustments);
|
|
75886
|
+
}
|
|
75675
75887
|
|
|
75676
75888
|
// src/viewer/utils/shape-round-rect.ts
|
|
75677
75889
|
function localClampAdjustment(value) {
|
|
@@ -75743,6 +75955,27 @@ var MATERIAL_MAP = {
|
|
|
75743
75955
|
filter: "brightness(1.1) contrast(0.85)",
|
|
75744
75956
|
// Translucent powder: slight translucent glow
|
|
75745
75957
|
backgroundImage: "radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 60%)"
|
|
75958
|
+
},
|
|
75959
|
+
// Legacy materials (PowerPoint 2007 / earlier). Render as muted variants
|
|
75960
|
+
// of the modern equivalents so legacy decks still resemble the originals.
|
|
75961
|
+
legacyMatte: {
|
|
75962
|
+
filter: "brightness(0.92) saturate(0.85)",
|
|
75963
|
+
backgroundImage: "linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 50%, rgba(0,0,0,0.04) 100%)"
|
|
75964
|
+
},
|
|
75965
|
+
legacyPlastic: {
|
|
75966
|
+
filter: "brightness(1.02) contrast(1.03)",
|
|
75967
|
+
boxShadow: "inset -2px -2px 5px rgba(255,255,255,0.3)",
|
|
75968
|
+
backgroundImage: "radial-gradient(ellipse 35% 25% at 25% 20%, rgba(255,255,255,0.15) 0%, transparent 70%)"
|
|
75969
|
+
},
|
|
75970
|
+
legacyMetal: {
|
|
75971
|
+
filter: "brightness(1.05) contrast(1.1) saturate(1.1)",
|
|
75972
|
+
boxShadow: "inset -2px -2px 6px rgba(255,255,255,0.35), inset 1px 1px 3px rgba(255,255,255,0.15)",
|
|
75973
|
+
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%)"
|
|
75974
|
+
},
|
|
75975
|
+
legacyWireframe: {
|
|
75976
|
+
filter: "brightness(1) contrast(1.4) saturate(0.6)",
|
|
75977
|
+
// Wireframe: high contrast outline-emphasising look
|
|
75978
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.4)"
|
|
75746
75979
|
}
|
|
75747
75980
|
};
|
|
75748
75981
|
function getMaterialCssOverrides(material) {
|
|
@@ -76697,8 +76930,7 @@ function getShapeVisualStyle(element2, hasFill, fillColor, strokeWidth, strokeCo
|
|
|
76697
76930
|
return {};
|
|
76698
76931
|
}
|
|
76699
76932
|
const normalizedShapeType = getShapeType(element2.shapeType);
|
|
76700
|
-
const
|
|
76701
|
-
const clipPath = getShapeClipPath(shapeType);
|
|
76933
|
+
const clipPath = getResolvedShapeClipPath(element2);
|
|
76702
76934
|
const fillOpacity = element2.shapeStyle?.fillOpacity;
|
|
76703
76935
|
const strokeOpacity = element2.shapeStyle?.strokeOpacity;
|
|
76704
76936
|
const strokeDash = normalizeStrokeDashType(element2.shapeStyle?.strokeDash);
|
|
@@ -77300,7 +77532,7 @@ function getImageMaskStyle(element2) {
|
|
|
77300
77532
|
if (normalized === "can" || normalized === "cylinder") {
|
|
77301
77533
|
return { borderRadius: "48% / 12%" };
|
|
77302
77534
|
}
|
|
77303
|
-
const clipPath =
|
|
77535
|
+
const clipPath = getResolvedShapeClipPath(element2);
|
|
77304
77536
|
if (!clipPath) {
|
|
77305
77537
|
return void 0;
|
|
77306
77538
|
}
|
|
@@ -77963,8 +78195,8 @@ function hexToRgb3(hex) {
|
|
|
77963
78195
|
};
|
|
77964
78196
|
}
|
|
77965
78197
|
function rgbToHex2(r2, g2, b2) {
|
|
77966
|
-
const
|
|
77967
|
-
return `#${
|
|
78198
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
78199
|
+
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()}`;
|
|
77968
78200
|
}
|
|
77969
78201
|
function tintColor(hex, tintFactor) {
|
|
77970
78202
|
const { r: r2, g: g2, b: b2 } = hexToRgb3(hex);
|
|
@@ -78895,13 +79127,13 @@ function cellStyleToCss(style) {
|
|
|
78895
79127
|
}
|
|
78896
79128
|
if (style.textDirection) {
|
|
78897
79129
|
switch (style.textDirection) {
|
|
78898
|
-
case "
|
|
79130
|
+
case "vert":
|
|
78899
79131
|
case "eaVert":
|
|
78900
79132
|
case "wordArtVert":
|
|
78901
79133
|
case "wordArtVertRtl":
|
|
78902
79134
|
css.writingMode = "vertical-rl";
|
|
78903
79135
|
break;
|
|
78904
|
-
case "
|
|
79136
|
+
case "vert270":
|
|
78905
79137
|
case "mongolianVert":
|
|
78906
79138
|
css.writingMode = "vertical-lr";
|
|
78907
79139
|
break;
|
|
@@ -79428,8 +79660,8 @@ function hexToRgb4(hex) {
|
|
|
79428
79660
|
];
|
|
79429
79661
|
}
|
|
79430
79662
|
function rgbToHex3(r2, g2, b2) {
|
|
79431
|
-
const
|
|
79432
|
-
return `#${
|
|
79663
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
79664
|
+
return `#${clamp3(r2).toString(16).padStart(2, "0")}${clamp3(g2).toString(16).padStart(2, "0")}${clamp3(b2).toString(16).padStart(2, "0")}`;
|
|
79433
79665
|
}
|
|
79434
79666
|
function tint(hex, amount) {
|
|
79435
79667
|
const [r2, g2, b2] = hexToRgb4(hex);
|
|
@@ -81347,7 +81579,7 @@ function resolveRegionCode(label) {
|
|
|
81347
81579
|
return REGION_ALIAS_MAP[normalized];
|
|
81348
81580
|
}
|
|
81349
81581
|
function lerpColor(a2, b2, t2) {
|
|
81350
|
-
const
|
|
81582
|
+
const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v)));
|
|
81351
81583
|
const parse = (hex) => {
|
|
81352
81584
|
const h2 = hex.replace("#", "");
|
|
81353
81585
|
return [
|
|
@@ -81358,9 +81590,9 @@ function lerpColor(a2, b2, t2) {
|
|
|
81358
81590
|
};
|
|
81359
81591
|
const [r1, g1, b1] = parse(a2);
|
|
81360
81592
|
const [r2, g2, b22] = parse(b2);
|
|
81361
|
-
const r3 =
|
|
81362
|
-
const g3 =
|
|
81363
|
-
const bl =
|
|
81593
|
+
const r3 = clamp3(r1 + (r2 - r1) * t2);
|
|
81594
|
+
const g3 = clamp3(g1 + (g2 - g1) * t2);
|
|
81595
|
+
const bl = clamp3(b1 + (b22 - b1) * t2);
|
|
81364
81596
|
return `#${r3.toString(16).padStart(2, "0")}${g3.toString(16).padStart(2, "0")}${bl.toString(16).padStart(2, "0")}`;
|
|
81365
81597
|
}
|
|
81366
81598
|
function sequentialColorScale(t2) {
|
|
@@ -88112,6 +88344,59 @@ function WarpedText({
|
|
|
88112
88344
|
}
|
|
88113
88345
|
);
|
|
88114
88346
|
}
|
|
88347
|
+
var GLYPH_BY_SHAPE = Object.fromEntries(
|
|
88348
|
+
ACTION_BUTTON_PRESETS.map((p3) => [p3.shapeType, p3.iconPath])
|
|
88349
|
+
);
|
|
88350
|
+
GLYPH_BY_SHAPE["actionButtonForwardOrNext"] = GLYPH_BY_SHAPE["actionButtonForwardNext"];
|
|
88351
|
+
GLYPH_BY_SHAPE["actionButtonBackOrPrevious"] = GLYPH_BY_SHAPE["actionButtonBackPrevious"];
|
|
88352
|
+
function isActionButtonShape(shapeType) {
|
|
88353
|
+
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
88354
|
+
}
|
|
88355
|
+
function getActionButtonGlyphPath(shapeType) {
|
|
88356
|
+
if (!shapeType) {
|
|
88357
|
+
return void 0;
|
|
88358
|
+
}
|
|
88359
|
+
const path = GLYPH_BY_SHAPE[shapeType];
|
|
88360
|
+
return path && path.length > 0 ? path : void 0;
|
|
88361
|
+
}
|
|
88362
|
+
function ActionButtonGlyphOverlay({
|
|
88363
|
+
element: element2,
|
|
88364
|
+
color
|
|
88365
|
+
}) {
|
|
88366
|
+
const shapeType = "shapeType" in element2 ? element2.shapeType : void 0;
|
|
88367
|
+
const path = getActionButtonGlyphPath(shapeType);
|
|
88368
|
+
if (!path) {
|
|
88369
|
+
return null;
|
|
88370
|
+
}
|
|
88371
|
+
const stroke = color ?? ("textStyle" in element2 && element2.textStyle?.color || "#ffffff");
|
|
88372
|
+
return /* @__PURE__ */ jsx(
|
|
88373
|
+
"svg",
|
|
88374
|
+
{
|
|
88375
|
+
viewBox: "0 0 24 24",
|
|
88376
|
+
width: "100%",
|
|
88377
|
+
height: "100%",
|
|
88378
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
88379
|
+
style: {
|
|
88380
|
+
position: "absolute",
|
|
88381
|
+
inset: 0,
|
|
88382
|
+
pointerEvents: "none",
|
|
88383
|
+
padding: "20%"
|
|
88384
|
+
},
|
|
88385
|
+
"aria-hidden": "true",
|
|
88386
|
+
children: /* @__PURE__ */ jsx(
|
|
88387
|
+
"path",
|
|
88388
|
+
{
|
|
88389
|
+
d: path,
|
|
88390
|
+
fill: "none",
|
|
88391
|
+
stroke,
|
|
88392
|
+
strokeWidth: 2,
|
|
88393
|
+
strokeLinecap: "round",
|
|
88394
|
+
strokeLinejoin: "round"
|
|
88395
|
+
}
|
|
88396
|
+
)
|
|
88397
|
+
}
|
|
88398
|
+
);
|
|
88399
|
+
}
|
|
88115
88400
|
function ColorChangedImage({
|
|
88116
88401
|
src,
|
|
88117
88402
|
clrChange,
|
|
@@ -88382,6 +88667,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
88382
88667
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88383
88668
|
tileDuotoneColors && renderDuotoneSvgFilter(el.id, tileDuotoneColors.color1, tileDuotoneColors.color2),
|
|
88384
88669
|
renderArtisticEffectSvgFilter(el.id, artisticEffectName, artisticRadius),
|
|
88670
|
+
renderImageAlphaSvgFilter(el),
|
|
88385
88671
|
/* @__PURE__ */ jsx(
|
|
88386
88672
|
"div",
|
|
88387
88673
|
{
|
|
@@ -88403,6 +88689,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
88403
88689
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88404
88690
|
duotoneColors && !useDuotoneCanvas && renderDuotoneSvgFilter(el.id, duotoneColors.color1, duotoneColors.color2),
|
|
88405
88691
|
renderArtisticEffectSvgFilter(el.id, artisticEffectName, artisticRadius),
|
|
88692
|
+
renderImageAlphaSvgFilter(el),
|
|
88406
88693
|
useDuotoneCanvas && duotoneColors ? /* @__PURE__ */ jsx(
|
|
88407
88694
|
DuotoneImage,
|
|
88408
88695
|
{
|
|
@@ -90911,8 +91198,11 @@ function renderBody(el, isImg, isEditing, editText, spellCheck, txtSE, txtS, vec
|
|
|
90911
91198
|
...scene3dStyle.perspective ? { perspective: scene3dStyle.perspective } : {},
|
|
90912
91199
|
...scene3dStyle.transformStyle ? { transformStyle: scene3dStyle.transformStyle } : {}
|
|
90913
91200
|
} : void 0;
|
|
91201
|
+
const shapeTypeForGlyph = "shapeType" in el ? el.shapeType : void 0;
|
|
91202
|
+
const showActionButtonGlyph = isActionButtonShape(shapeTypeForGlyph);
|
|
90914
91203
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
90915
91204
|
vecShape,
|
|
91205
|
+
showActionButtonGlyph && /* @__PURE__ */ jsx(ActionButtonGlyphOverlay, { element: el }),
|
|
90916
91206
|
isTxtEl ? useSvgWarp ? /* @__PURE__ */ jsx(
|
|
90917
91207
|
"div",
|
|
90918
91208
|
{
|