pptx-react-viewer 1.17.1 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/dist/{Model3DScene-YA4F63DT.js → Model3DScene-GVWQ6SOM.js} +3 -3
- package/dist/Model3DScene-GVWQ6SOM.js.br +0 -0
- package/dist/Model3DScene-GVWQ6SOM.js.gz +0 -0
- package/dist/{Model3DScene-QHDYQXL2.mjs → Model3DScene-JGVLIDLD.mjs} +2 -2
- package/dist/Model3DScene-JGVLIDLD.mjs.br +0 -0
- package/dist/Model3DScene-JGVLIDLD.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GUAS2NWQ.mjs → SurfaceChart3DScene-DBWSDSKI.mjs} +2 -2
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DBWSDSKI.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TGNJHTJQ.js → SurfaceChart3DScene-ZOTOHOIE.js} +3 -3
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.br +0 -0
- package/dist/SurfaceChart3DScene-ZOTOHOIE.js.gz +0 -0
- package/dist/{chunk-WH7YXV3I.js → chunk-73ST7AC6.js} +2153 -1572
- package/dist/chunk-73ST7AC6.js.br +0 -0
- package/dist/chunk-73ST7AC6.js.gz +0 -0
- package/dist/{chunk-IZXN663G.js → chunk-AALZCSY4.js} +7 -0
- package/dist/chunk-AALZCSY4.js.br +0 -0
- package/dist/chunk-AALZCSY4.js.gz +0 -0
- package/dist/{chunk-MGLRKGCH.js → chunk-EXDUEXTO.js} +26101 -15360
- package/dist/chunk-EXDUEXTO.js.br +0 -0
- package/dist/chunk-EXDUEXTO.js.gz +0 -0
- package/dist/{chunk-JWS3RQKN.js → chunk-HBXPK572.js} +584 -144
- package/dist/chunk-HBXPK572.js.br +0 -0
- package/dist/chunk-HBXPK572.js.gz +0 -0
- package/dist/{chunk-G22EWPLH.mjs → chunk-HHTZQHKZ.mjs} +532 -119
- package/dist/chunk-HHTZQHKZ.mjs.br +0 -0
- package/dist/chunk-HHTZQHKZ.mjs.gz +0 -0
- package/dist/{chunk-SXCO5HHN.js → chunk-JDRC3PSY.js} +655 -491
- package/dist/chunk-JDRC3PSY.js.br +0 -0
- package/dist/chunk-JDRC3PSY.js.gz +0 -0
- package/dist/{chunk-PCQH2UBR.mjs → chunk-KMLIWCNL.mjs} +1345 -764
- package/dist/chunk-KMLIWCNL.mjs.br +0 -0
- package/dist/chunk-KMLIWCNL.mjs.gz +0 -0
- package/dist/{chunk-5CD34U2V.mjs → chunk-RIRK64DM.mjs} +7 -0
- package/dist/chunk-RIRK64DM.mjs.br +0 -0
- package/dist/chunk-RIRK64DM.mjs.gz +0 -0
- package/dist/{chunk-XRYREYXC.mjs → chunk-SBNTEQUA.mjs} +26062 -15360
- package/dist/chunk-SBNTEQUA.mjs.br +0 -0
- package/dist/chunk-SBNTEQUA.mjs.gz +0 -0
- package/dist/{chunk-HN7CPQUG.mjs → chunk-Z4MDCPAY.mjs} +223 -59
- package/dist/chunk-Z4MDCPAY.mjs.br +0 -0
- package/dist/chunk-Z4MDCPAY.mjs.gz +0 -0
- package/dist/{dist-2ZAH7U6U.js → dist-KRRXYUGI.js} +663 -507
- package/dist/dist-KRRXYUGI.js.br +0 -0
- package/dist/dist-KRRXYUGI.js.gz +0 -0
- package/dist/dist-N6PAPXK6.mjs +2 -0
- package/dist/dist-N6PAPXK6.mjs.br +0 -0
- package/dist/dist-N6PAPXK6.mjs.gz +0 -0
- package/dist/hooks-unstable.d.ts +484 -117
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +75 -75
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +4 -4
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/i18n.js +3 -3
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/{index-XGt7MZpa.d.ts → index-DmHVR48M.d.ts} +25 -3
- package/dist/index-DmHVR48M.d.ts.map +1 -0
- package/dist/index.d.ts +412 -117
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +438 -121
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +24 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-QHDYQXL2.mjs.br +0 -0
- package/dist/Model3DScene-QHDYQXL2.mjs.gz +0 -0
- package/dist/Model3DScene-YA4F63DT.js.br +0 -0
- package/dist/Model3DScene-YA4F63DT.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TGNJHTJQ.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGNJHTJQ.js.gz +0 -0
- package/dist/chunk-5CD34U2V.mjs.br +0 -0
- package/dist/chunk-5CD34U2V.mjs.gz +0 -0
- package/dist/chunk-G22EWPLH.mjs.br +0 -0
- package/dist/chunk-G22EWPLH.mjs.gz +0 -0
- package/dist/chunk-HN7CPQUG.mjs.br +0 -0
- package/dist/chunk-HN7CPQUG.mjs.gz +0 -0
- package/dist/chunk-IZXN663G.js.br +0 -0
- package/dist/chunk-IZXN663G.js.gz +0 -0
- package/dist/chunk-JWS3RQKN.js.br +0 -0
- package/dist/chunk-JWS3RQKN.js.gz +0 -0
- package/dist/chunk-MGLRKGCH.js.br +0 -0
- package/dist/chunk-MGLRKGCH.js.gz +0 -0
- package/dist/chunk-PCQH2UBR.mjs.br +0 -0
- package/dist/chunk-PCQH2UBR.mjs.gz +0 -0
- package/dist/chunk-SXCO5HHN.js.br +0 -0
- package/dist/chunk-SXCO5HHN.js.gz +0 -0
- package/dist/chunk-WH7YXV3I.js.br +0 -0
- package/dist/chunk-WH7YXV3I.js.gz +0 -0
- package/dist/chunk-XRYREYXC.mjs.br +0 -0
- package/dist/chunk-XRYREYXC.mjs.gz +0 -0
- package/dist/dist-2ZAH7U6U.js.br +0 -0
- package/dist/dist-2ZAH7U6U.js.gz +0 -0
- package/dist/dist-MXDC6YTS.mjs +0 -2
- package/dist/dist-MXDC6YTS.mjs.br +0 -0
- package/dist/dist-MXDC6YTS.mjs.gz +0 -0
- package/dist/index-XGt7MZpa.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MIN_ELEMENT_SIZE, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hasShapeProperties, hasTextProperties, createChartElement, getShapeClipPath, getAdjustmentAwareShapeClipPath, getShapeClipPathFromPreset, getCloudPathForRendering, hslToRgb, PRESET_COLOR_MAP, isImageLikeElement, applyDrawingColorTransforms } from './chunk-
|
|
1
|
+
import { MIN_ELEMENT_SIZE, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hasShapeProperties, hasTextProperties, createChartElement, getShapeClipPath, getAdjustmentAwareShapeClipPath, getShapeClipPathFromPreset, getCloudPathForRendering, hslToRgb, PRESET_COLOR_MAP, isImageLikeElement, applyDrawingColorTransforms } from './chunk-SBNTEQUA.mjs';
|
|
2
2
|
import DOMPurify from 'dompurify';
|
|
3
3
|
|
|
4
4
|
var defaultThemeColors = {
|
|
@@ -3537,9 +3537,15 @@ function getDisplayUnitDivisor(unit, customValue) {
|
|
|
3537
3537
|
return DISPLAY_UNIT_DIVISORS[unit] ?? 1;
|
|
3538
3538
|
}
|
|
3539
3539
|
function getDisplayUnitLabel(unit, customLabel) {
|
|
3540
|
-
if (customLabel) {
|
|
3540
|
+
if (typeof customLabel === "string") {
|
|
3541
3541
|
return customLabel;
|
|
3542
3542
|
}
|
|
3543
|
+
if (customLabel === null) {
|
|
3544
|
+
return "";
|
|
3545
|
+
}
|
|
3546
|
+
if (customLabel?.text) {
|
|
3547
|
+
return customLabel.text;
|
|
3548
|
+
}
|
|
3543
3549
|
if (!unit || unit === "custom") {
|
|
3544
3550
|
return "";
|
|
3545
3551
|
}
|
|
@@ -6231,12 +6237,21 @@ function seriesColor2(series, index, colorPalette) {
|
|
|
6231
6237
|
return series.color ?? paletteColor2(index, colorPalette);
|
|
6232
6238
|
}
|
|
6233
6239
|
function computeValueRange2(series) {
|
|
6234
|
-
|
|
6235
|
-
|
|
6240
|
+
let dataMin = Number.POSITIVE_INFINITY;
|
|
6241
|
+
let dataMax = Number.NEGATIVE_INFINITY;
|
|
6242
|
+
for (const item of series) {
|
|
6243
|
+
for (const value of item.values) {
|
|
6244
|
+
if (value < dataMin) {
|
|
6245
|
+
dataMin = value;
|
|
6246
|
+
}
|
|
6247
|
+
if (value > dataMax) {
|
|
6248
|
+
dataMax = value;
|
|
6249
|
+
}
|
|
6250
|
+
}
|
|
6251
|
+
}
|
|
6252
|
+
if (dataMin === Number.POSITIVE_INFINITY) {
|
|
6236
6253
|
return { min: 0, max: 1, span: 1 };
|
|
6237
6254
|
}
|
|
6238
|
-
const dataMin = Math.min(...all);
|
|
6239
|
-
const dataMax = Math.max(...all);
|
|
6240
6255
|
const min = Math.min(dataMin, 0);
|
|
6241
6256
|
const max = Math.max(dataMax, 0);
|
|
6242
6257
|
const span = Math.max(max - min, 1);
|
|
@@ -10348,6 +10363,111 @@ function getSlideBackgroundStyle(slide) {
|
|
|
10348
10363
|
}
|
|
10349
10364
|
return style;
|
|
10350
10365
|
}
|
|
10366
|
+
var DATETIME_TYPE_FORMATS = {
|
|
10367
|
+
datetime1: "M/d/yyyy",
|
|
10368
|
+
datetime2: "EEEE, MMMM d, yyyy",
|
|
10369
|
+
datetime3: "d MMMM yyyy",
|
|
10370
|
+
datetime4: "MMMM d, yyyy",
|
|
10371
|
+
datetime5: "dd-MMM-yy",
|
|
10372
|
+
datetime6: "MMMM yy",
|
|
10373
|
+
datetime7: "MMM-yy",
|
|
10374
|
+
datetime8: "M/d/yyyy h:mm a",
|
|
10375
|
+
datetime9: "M/d/yyyy h:mm:ss a",
|
|
10376
|
+
datetime10: "H:mm",
|
|
10377
|
+
datetime11: "H:mm:ss",
|
|
10378
|
+
datetime12: "h:mm a",
|
|
10379
|
+
datetime13: "h:mm:ss a"
|
|
10380
|
+
};
|
|
10381
|
+
function formatDateWithPattern(date, pattern) {
|
|
10382
|
+
const months = [
|
|
10383
|
+
"January",
|
|
10384
|
+
"February",
|
|
10385
|
+
"March",
|
|
10386
|
+
"April",
|
|
10387
|
+
"May",
|
|
10388
|
+
"June",
|
|
10389
|
+
"July",
|
|
10390
|
+
"August",
|
|
10391
|
+
"September",
|
|
10392
|
+
"October",
|
|
10393
|
+
"November",
|
|
10394
|
+
"December"
|
|
10395
|
+
];
|
|
10396
|
+
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
10397
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
10398
|
+
const h12 = (h) => h === 0 ? 12 : h > 12 ? h - 12 : h;
|
|
10399
|
+
const hours = date.getHours();
|
|
10400
|
+
let result = pattern;
|
|
10401
|
+
result = result.replace(/yyyy/gu, String(date.getFullYear()));
|
|
10402
|
+
result = result.replace(/EEEE/gu, days[date.getDay()]);
|
|
10403
|
+
result = result.replace(/MMMM/gu, months[date.getMonth()]);
|
|
10404
|
+
result = result.replace(/EEE/gu, days[date.getDay()].slice(0, 3));
|
|
10405
|
+
result = result.replace(/MMM/gu, months[date.getMonth()].slice(0, 3));
|
|
10406
|
+
result = result.replace(/yy/gu, String(date.getFullYear()).slice(2));
|
|
10407
|
+
result = result.replace(/MM/gu, pad(date.getMonth() + 1));
|
|
10408
|
+
result = result.replace(/dd/gu, pad(date.getDate()));
|
|
10409
|
+
result = result.replace(/HH/gu, pad(hours));
|
|
10410
|
+
result = result.replace(/hh/gu, pad(h12(hours)));
|
|
10411
|
+
result = result.replace(/mm/gu, pad(date.getMinutes()));
|
|
10412
|
+
result = result.replace(/ss/gu, pad(date.getSeconds()));
|
|
10413
|
+
result = result.replace(/(?<![A-Za-z])M(?![A-Za-z])/gu, String(date.getMonth() + 1));
|
|
10414
|
+
result = result.replace(/(?<![A-Za-z])d(?![A-Za-z])/gu, String(date.getDate()));
|
|
10415
|
+
result = result.replace(/(?<![A-Za-z])H(?![A-Za-z])/gu, String(hours));
|
|
10416
|
+
result = result.replace(/(?<![A-Za-z])h(?![A-Za-z])/gu, String(h12(hours)));
|
|
10417
|
+
result = result.replace(/\ba\b/gu, hours >= 12 ? "PM" : "AM");
|
|
10418
|
+
return result;
|
|
10419
|
+
}
|
|
10420
|
+
function resolveFieldDateText(fieldType, dateFormat) {
|
|
10421
|
+
const now = /* @__PURE__ */ new Date();
|
|
10422
|
+
if (dateFormat) {
|
|
10423
|
+
return formatDateWithPattern(now, dateFormat);
|
|
10424
|
+
}
|
|
10425
|
+
const knownFormat = DATETIME_TYPE_FORMATS[fieldType.toLowerCase()];
|
|
10426
|
+
if (knownFormat) {
|
|
10427
|
+
return formatDateWithPattern(now, knownFormat);
|
|
10428
|
+
}
|
|
10429
|
+
return now.toLocaleDateString();
|
|
10430
|
+
}
|
|
10431
|
+
function substituteFieldText(segmentText, fieldType, ctx) {
|
|
10432
|
+
if (!fieldType || !ctx) {
|
|
10433
|
+
return segmentText;
|
|
10434
|
+
}
|
|
10435
|
+
const fl = fieldType.toLowerCase();
|
|
10436
|
+
if (fl === "slidenum" && ctx.slideNumber !== void 0) {
|
|
10437
|
+
return String(ctx.slideNumber);
|
|
10438
|
+
}
|
|
10439
|
+
if (fl.startsWith("datetime")) {
|
|
10440
|
+
return resolveFieldDateText(fl, ctx.dateFormat);
|
|
10441
|
+
}
|
|
10442
|
+
if (fl === "footer" && ctx.footerText !== void 0) {
|
|
10443
|
+
return ctx.footerText;
|
|
10444
|
+
}
|
|
10445
|
+
if (fl === "header" && ctx.headerText !== void 0) {
|
|
10446
|
+
return ctx.headerText;
|
|
10447
|
+
}
|
|
10448
|
+
if (fl === "currentdate") {
|
|
10449
|
+
return (/* @__PURE__ */ new Date()).toLocaleDateString(ctx.locale);
|
|
10450
|
+
}
|
|
10451
|
+
if (fl === "currenttime") {
|
|
10452
|
+
return (/* @__PURE__ */ new Date()).toLocaleTimeString(ctx.locale);
|
|
10453
|
+
}
|
|
10454
|
+
if (fl === "slidetitle" && ctx.slideTitle !== void 0) {
|
|
10455
|
+
return ctx.slideTitle;
|
|
10456
|
+
}
|
|
10457
|
+
if (fl.startsWith("docproperty") && ctx.customProperties) {
|
|
10458
|
+
const dotIdx = fieldType.indexOf(".");
|
|
10459
|
+
const propName = dotIdx >= 0 ? fieldType.substring(dotIdx + 1).trim() : "";
|
|
10460
|
+
if (propName) {
|
|
10461
|
+
const prop = ctx.customProperties.find(
|
|
10462
|
+
(p) => p.name.toLowerCase() === propName.toLowerCase()
|
|
10463
|
+
);
|
|
10464
|
+
if (prop) {
|
|
10465
|
+
return prop.value;
|
|
10466
|
+
}
|
|
10467
|
+
}
|
|
10468
|
+
}
|
|
10469
|
+
return segmentText;
|
|
10470
|
+
}
|
|
10351
10471
|
var DEFAULT_X = 100;
|
|
10352
10472
|
var TABLE_WIDTH = 600;
|
|
10353
10473
|
var TABLE_HEIGHT = 250;
|
|
@@ -11049,111 +11169,6 @@ function resolveCssTextAlign(align, isRtl) {
|
|
|
11049
11169
|
}
|
|
11050
11170
|
return isRtl ? "right" : void 0;
|
|
11051
11171
|
}
|
|
11052
|
-
var DATETIME_TYPE_FORMATS = {
|
|
11053
|
-
datetime1: "M/d/yyyy",
|
|
11054
|
-
datetime2: "EEEE, MMMM d, yyyy",
|
|
11055
|
-
datetime3: "d MMMM yyyy",
|
|
11056
|
-
datetime4: "MMMM d, yyyy",
|
|
11057
|
-
datetime5: "dd-MMM-yy",
|
|
11058
|
-
datetime6: "MMMM yy",
|
|
11059
|
-
datetime7: "MMM-yy",
|
|
11060
|
-
datetime8: "M/d/yyyy h:mm a",
|
|
11061
|
-
datetime9: "M/d/yyyy h:mm:ss a",
|
|
11062
|
-
datetime10: "H:mm",
|
|
11063
|
-
datetime11: "H:mm:ss",
|
|
11064
|
-
datetime12: "h:mm a",
|
|
11065
|
-
datetime13: "h:mm:ss a"
|
|
11066
|
-
};
|
|
11067
|
-
function formatDateWithPattern(date, pattern) {
|
|
11068
|
-
const months = [
|
|
11069
|
-
"January",
|
|
11070
|
-
"February",
|
|
11071
|
-
"March",
|
|
11072
|
-
"April",
|
|
11073
|
-
"May",
|
|
11074
|
-
"June",
|
|
11075
|
-
"July",
|
|
11076
|
-
"August",
|
|
11077
|
-
"September",
|
|
11078
|
-
"October",
|
|
11079
|
-
"November",
|
|
11080
|
-
"December"
|
|
11081
|
-
];
|
|
11082
|
-
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
11083
|
-
const pad = (n) => String(n).padStart(2, "0");
|
|
11084
|
-
const h12 = (h) => h === 0 ? 12 : h > 12 ? h - 12 : h;
|
|
11085
|
-
const hours = date.getHours();
|
|
11086
|
-
let result = pattern;
|
|
11087
|
-
result = result.replace(/yyyy/gu, String(date.getFullYear()));
|
|
11088
|
-
result = result.replace(/EEEE/gu, days[date.getDay()]);
|
|
11089
|
-
result = result.replace(/MMMM/gu, months[date.getMonth()]);
|
|
11090
|
-
result = result.replace(/EEE/gu, days[date.getDay()].slice(0, 3));
|
|
11091
|
-
result = result.replace(/MMM/gu, months[date.getMonth()].slice(0, 3));
|
|
11092
|
-
result = result.replace(/yy/gu, String(date.getFullYear()).slice(2));
|
|
11093
|
-
result = result.replace(/MM/gu, pad(date.getMonth() + 1));
|
|
11094
|
-
result = result.replace(/dd/gu, pad(date.getDate()));
|
|
11095
|
-
result = result.replace(/HH/gu, pad(hours));
|
|
11096
|
-
result = result.replace(/hh/gu, pad(h12(hours)));
|
|
11097
|
-
result = result.replace(/mm/gu, pad(date.getMinutes()));
|
|
11098
|
-
result = result.replace(/ss/gu, pad(date.getSeconds()));
|
|
11099
|
-
result = result.replace(/(?<![A-Za-z])M(?![A-Za-z])/gu, String(date.getMonth() + 1));
|
|
11100
|
-
result = result.replace(/(?<![A-Za-z])d(?![A-Za-z])/gu, String(date.getDate()));
|
|
11101
|
-
result = result.replace(/(?<![A-Za-z])H(?![A-Za-z])/gu, String(hours));
|
|
11102
|
-
result = result.replace(/(?<![A-Za-z])h(?![A-Za-z])/gu, String(h12(hours)));
|
|
11103
|
-
result = result.replace(/\ba\b/gu, hours >= 12 ? "PM" : "AM");
|
|
11104
|
-
return result;
|
|
11105
|
-
}
|
|
11106
|
-
function resolveFieldDateText(fieldType, dateFormat) {
|
|
11107
|
-
const now = /* @__PURE__ */ new Date();
|
|
11108
|
-
if (dateFormat) {
|
|
11109
|
-
return formatDateWithPattern(now, dateFormat);
|
|
11110
|
-
}
|
|
11111
|
-
const knownFormat = DATETIME_TYPE_FORMATS[fieldType.toLowerCase()];
|
|
11112
|
-
if (knownFormat) {
|
|
11113
|
-
return formatDateWithPattern(now, knownFormat);
|
|
11114
|
-
}
|
|
11115
|
-
return now.toLocaleDateString();
|
|
11116
|
-
}
|
|
11117
|
-
function substituteFieldText(segmentText, fieldType, ctx) {
|
|
11118
|
-
if (!fieldType || !ctx) {
|
|
11119
|
-
return segmentText;
|
|
11120
|
-
}
|
|
11121
|
-
const fl = fieldType.toLowerCase();
|
|
11122
|
-
if (fl === "slidenum" && ctx.slideNumber !== void 0) {
|
|
11123
|
-
return String(ctx.slideNumber);
|
|
11124
|
-
}
|
|
11125
|
-
if (fl.startsWith("datetime")) {
|
|
11126
|
-
return resolveFieldDateText(fl, ctx.dateFormat);
|
|
11127
|
-
}
|
|
11128
|
-
if (fl === "footer" && ctx.footerText !== void 0) {
|
|
11129
|
-
return ctx.footerText;
|
|
11130
|
-
}
|
|
11131
|
-
if (fl === "header" && ctx.headerText !== void 0) {
|
|
11132
|
-
return ctx.headerText;
|
|
11133
|
-
}
|
|
11134
|
-
if (fl === "currentdate") {
|
|
11135
|
-
return (/* @__PURE__ */ new Date()).toLocaleDateString(ctx.locale);
|
|
11136
|
-
}
|
|
11137
|
-
if (fl === "currenttime") {
|
|
11138
|
-
return (/* @__PURE__ */ new Date()).toLocaleTimeString(ctx.locale);
|
|
11139
|
-
}
|
|
11140
|
-
if (fl === "slidetitle" && ctx.slideTitle !== void 0) {
|
|
11141
|
-
return ctx.slideTitle;
|
|
11142
|
-
}
|
|
11143
|
-
if (fl.startsWith("docproperty") && ctx.customProperties) {
|
|
11144
|
-
const dotIdx = fieldType.indexOf(".");
|
|
11145
|
-
const propName = dotIdx >= 0 ? fieldType.substring(dotIdx + 1).trim() : "";
|
|
11146
|
-
if (propName) {
|
|
11147
|
-
const prop = ctx.customProperties.find(
|
|
11148
|
-
(p) => p.name.toLowerCase() === propName.toLowerCase()
|
|
11149
|
-
);
|
|
11150
|
-
if (prop) {
|
|
11151
|
-
return prop.value;
|
|
11152
|
-
}
|
|
11153
|
-
}
|
|
11154
|
-
}
|
|
11155
|
-
return segmentText;
|
|
11156
|
-
}
|
|
11157
11172
|
function buildTextFillCss(style) {
|
|
11158
11173
|
if (style.textFillGradient) {
|
|
11159
11174
|
return {
|
|
@@ -12895,6 +12910,8 @@ var SCALAR_ELEMENT_KEYS = /* @__PURE__ */ new Set([
|
|
|
12895
12910
|
"mediaType",
|
|
12896
12911
|
"mediaPath",
|
|
12897
12912
|
"mediaMimeType",
|
|
12913
|
+
"mediaReferenceKind",
|
|
12914
|
+
"mediaReferenceName",
|
|
12898
12915
|
"trimStartMs",
|
|
12899
12916
|
"trimEndMs",
|
|
12900
12917
|
"posterFramePath",
|
|
@@ -12958,6 +12975,9 @@ var COMPLEX_ELEMENT_FIELDS = {
|
|
|
12958
12975
|
cropShape: "_cr",
|
|
12959
12976
|
bookmarks: "_mb",
|
|
12960
12977
|
captionTracks: "_ct",
|
|
12978
|
+
audioCdStart: "_acd1",
|
|
12979
|
+
audioCdEnd: "_acd2",
|
|
12980
|
+
rawMediaReferenceXml: "_mrx",
|
|
12961
12981
|
metadata: "_md",
|
|
12962
12982
|
groupFill: "_gf",
|
|
12963
12983
|
inkPointPressures: "_ipp",
|
|
@@ -13010,7 +13030,9 @@ var COMPLEX_SLIDE_FIELDS = {
|
|
|
13010
13030
|
customerData: "_cu",
|
|
13011
13031
|
activeXControls: "_ax",
|
|
13012
13032
|
backgroundPattern: "_bp",
|
|
13013
|
-
|
|
13033
|
+
modernCommentPart: "_mc",
|
|
13034
|
+
headerFooterFlags: "_hff",
|
|
13035
|
+
slideSynchronization: "_sync"
|
|
13014
13036
|
};
|
|
13015
13037
|
var REV_COMPLEX_SLIDE = Object.fromEntries(
|
|
13016
13038
|
Object.entries(COMPLEX_SLIDE_FIELDS).map(([k, v]) => [v, k])
|
|
@@ -15973,6 +15995,72 @@ function buildBroadcastViewerUrl(roomId, serverUrl, location) {
|
|
|
15973
15995
|
const server = encodeURIComponent(trimmed);
|
|
15974
15996
|
return `${location.origin}${location.pathname}?broadcast=${room}&server=${server}`;
|
|
15975
15997
|
}
|
|
15998
|
+
function canCreateCollaborationSession(fields) {
|
|
15999
|
+
return isValidRoomId(fields.roomId.trim()) && fields.userName.trim().length > 0;
|
|
16000
|
+
}
|
|
16001
|
+
function buildCreateCollaborationConfig(fields) {
|
|
16002
|
+
if (!canCreateCollaborationSession(fields)) {
|
|
16003
|
+
return null;
|
|
16004
|
+
}
|
|
16005
|
+
const serverUrl = fields.serverUrl.trim();
|
|
16006
|
+
return {
|
|
16007
|
+
roomId: fields.roomId.trim(),
|
|
16008
|
+
userName: fields.userName.trim(),
|
|
16009
|
+
serverUrl,
|
|
16010
|
+
transport: resolveTransportForServerUrl(serverUrl),
|
|
16011
|
+
role: "collaborator",
|
|
16012
|
+
sessionIntent: "create"
|
|
16013
|
+
};
|
|
16014
|
+
}
|
|
16015
|
+
function parseInvitationUrl(value) {
|
|
16016
|
+
try {
|
|
16017
|
+
return new URL(value);
|
|
16018
|
+
} catch {
|
|
16019
|
+
return null;
|
|
16020
|
+
}
|
|
16021
|
+
}
|
|
16022
|
+
function buildJoinCollaborationConfig(fields) {
|
|
16023
|
+
const invitation = fields.invitation.trim();
|
|
16024
|
+
const userName = fields.userName.trim();
|
|
16025
|
+
if (!invitation || !userName) {
|
|
16026
|
+
return null;
|
|
16027
|
+
}
|
|
16028
|
+
const url = parseInvitationUrl(invitation);
|
|
16029
|
+
const roomId = (url?.searchParams.get("room") ?? (url ? "" : invitation)).trim();
|
|
16030
|
+
if (!isValidRoomId(roomId)) {
|
|
16031
|
+
return null;
|
|
16032
|
+
}
|
|
16033
|
+
const requestedTransport = url?.searchParams.get("transport");
|
|
16034
|
+
const serverUrl = (url?.searchParams.get("server") ?? fields.serverUrl).trim();
|
|
16035
|
+
const transport = requestedTransport === "webrtc" ? "webrtc" : resolveTransportForServerUrl(serverUrl);
|
|
16036
|
+
const signalingValue = url?.searchParams.get("signaling");
|
|
16037
|
+
const signaling = signalingValue?.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
16038
|
+
return {
|
|
16039
|
+
roomId,
|
|
16040
|
+
userName,
|
|
16041
|
+
serverUrl: transport === "webrtc" ? "" : serverUrl,
|
|
16042
|
+
transport,
|
|
16043
|
+
...signaling?.length ? { signaling } : {},
|
|
16044
|
+
role: "collaborator",
|
|
16045
|
+
sessionIntent: "join"
|
|
16046
|
+
};
|
|
16047
|
+
}
|
|
16048
|
+
function buildCollaborationShareUrl(config, location) {
|
|
16049
|
+
if (!location) {
|
|
16050
|
+
return config.roomId;
|
|
16051
|
+
}
|
|
16052
|
+
const url = new URL(location.pathname, location.origin);
|
|
16053
|
+
url.searchParams.set("room", config.roomId);
|
|
16054
|
+
if (config.transport === "webrtc" || !config.serverUrl.trim()) {
|
|
16055
|
+
url.searchParams.set("transport", "webrtc");
|
|
16056
|
+
if (config.signaling?.length) {
|
|
16057
|
+
url.searchParams.set("signaling", config.signaling.join(","));
|
|
16058
|
+
}
|
|
16059
|
+
} else {
|
|
16060
|
+
url.searchParams.set("server", config.serverUrl.trim());
|
|
16061
|
+
}
|
|
16062
|
+
return url.toString();
|
|
16063
|
+
}
|
|
15976
16064
|
var NOTES_FONT_SIZE_MIN = 10;
|
|
15977
16065
|
var NOTES_FONT_SIZE_MAX = 32;
|
|
15978
16066
|
var NOTES_FONT_SIZE_STEP = 2;
|
|
@@ -16027,6 +16115,263 @@ function notesSegmentsToSpans(segments) {
|
|
|
16027
16115
|
return { kind: "text", key: `seg-${index}`, text: segment.text, style };
|
|
16028
16116
|
});
|
|
16029
16117
|
}
|
|
16118
|
+
var PRESENTER_ZOOM_MIN = 1;
|
|
16119
|
+
var PRESENTER_ZOOM_MAX = 4;
|
|
16120
|
+
var PRESENTER_ZOOM_STEP = 0.5;
|
|
16121
|
+
function createPresenterTimer(now = Date.now()) {
|
|
16122
|
+
return { elapsedMs: 0, paused: false, lastStartedAt: now };
|
|
16123
|
+
}
|
|
16124
|
+
function presenterElapsed(timer, now = Date.now()) {
|
|
16125
|
+
return timer.elapsedMs + (timer.paused ? 0 : Math.max(0, now - timer.lastStartedAt));
|
|
16126
|
+
}
|
|
16127
|
+
function togglePresenterTimer(timer, now = Date.now()) {
|
|
16128
|
+
if (timer.paused) {
|
|
16129
|
+
return { ...timer, paused: false, lastStartedAt: now };
|
|
16130
|
+
}
|
|
16131
|
+
return { elapsedMs: presenterElapsed(timer, now), paused: true, lastStartedAt: now };
|
|
16132
|
+
}
|
|
16133
|
+
function resetPresenterTimer(now = Date.now()) {
|
|
16134
|
+
return createPresenterTimer(now);
|
|
16135
|
+
}
|
|
16136
|
+
function clampPresenterZoom(zoom) {
|
|
16137
|
+
return {
|
|
16138
|
+
scale: Math.min(PRESENTER_ZOOM_MAX, Math.max(PRESENTER_ZOOM_MIN, zoom.scale ?? 1)),
|
|
16139
|
+
originX: Math.min(1, Math.max(0, zoom.originX ?? 0.5)),
|
|
16140
|
+
originY: Math.min(1, Math.max(0, zoom.originY ?? 0.5))
|
|
16141
|
+
};
|
|
16142
|
+
}
|
|
16143
|
+
function stepPresenterZoom(zoom, direction) {
|
|
16144
|
+
return clampPresenterZoom({ ...zoom, scale: zoom.scale + direction * PRESENTER_ZOOM_STEP });
|
|
16145
|
+
}
|
|
16146
|
+
function movePresenterPointer(pointer, x, y) {
|
|
16147
|
+
return { ...pointer, x: Math.min(1, Math.max(0, x)), y: Math.min(1, Math.max(0, y)) };
|
|
16148
|
+
}
|
|
16149
|
+
function appendPresentationInkPoint(stroke, point) {
|
|
16150
|
+
const clamped = {
|
|
16151
|
+
x: Math.min(1, Math.max(0, point.x)),
|
|
16152
|
+
y: Math.min(1, Math.max(0, point.y))
|
|
16153
|
+
};
|
|
16154
|
+
return { ...stroke, points: [...stroke.points, clamped] };
|
|
16155
|
+
}
|
|
16156
|
+
function erasePresentationInkAt(strokes, slideIndex, point, radius = 0.035) {
|
|
16157
|
+
const radiusSquared = radius * radius;
|
|
16158
|
+
return strokes.filter(
|
|
16159
|
+
(stroke) => stroke.slideIndex !== slideIndex || !stroke.points.some((candidate) => {
|
|
16160
|
+
const dx = candidate.x - point.x;
|
|
16161
|
+
const dy = candidate.y - point.y;
|
|
16162
|
+
return dx * dx + dy * dy <= radiusSquared;
|
|
16163
|
+
})
|
|
16164
|
+
);
|
|
16165
|
+
}
|
|
16166
|
+
function mergePresentationSnapshot(current, patch) {
|
|
16167
|
+
return {
|
|
16168
|
+
...current,
|
|
16169
|
+
...patch,
|
|
16170
|
+
sequence: Math.max(current.sequence + 1, patch.sequence ?? 0),
|
|
16171
|
+
zoom: patch.zoom ? clampPresenterZoom(patch.zoom) : current.zoom
|
|
16172
|
+
};
|
|
16173
|
+
}
|
|
16174
|
+
function presentationInkPath(points) {
|
|
16175
|
+
if (points.length === 0) {
|
|
16176
|
+
return "";
|
|
16177
|
+
}
|
|
16178
|
+
return points.reduce(
|
|
16179
|
+
(path, point, index) => `${path}${index === 0 ? "M" : " L"} ${point.x * 100} ${point.y * 100}`,
|
|
16180
|
+
""
|
|
16181
|
+
);
|
|
16182
|
+
}
|
|
16183
|
+
var PRESENTATION_CHANNEL_NAME = "pptx-viewer-presenter";
|
|
16184
|
+
var PRESENTATION_HASH = "#pptx-audience";
|
|
16185
|
+
var PRESENTATION_NONCE_KEY = "nonce";
|
|
16186
|
+
var PRESENTATION_MESSAGE_ORIGIN = "pptx-viewer-presenter";
|
|
16187
|
+
var DB_NAME = "pptx-viewer-presentation";
|
|
16188
|
+
var DB_VERSION = 1;
|
|
16189
|
+
var STORE_NAME = "decks";
|
|
16190
|
+
var MAX_DECK_AGE_MS = 5 * 60 * 1e3;
|
|
16191
|
+
function createPresentationSessionId() {
|
|
16192
|
+
return secureRandomUuid();
|
|
16193
|
+
}
|
|
16194
|
+
function createInitialPresentationSnapshot(slideIndex = 0) {
|
|
16195
|
+
return {
|
|
16196
|
+
slideIndex: Math.max(0, Math.trunc(slideIndex)),
|
|
16197
|
+
buildStep: 0,
|
|
16198
|
+
sequence: 0,
|
|
16199
|
+
blackout: "none",
|
|
16200
|
+
paused: false,
|
|
16201
|
+
elapsedMs: 0,
|
|
16202
|
+
zoom: { scale: 1, originX: 0.5, originY: 0.5 },
|
|
16203
|
+
pointer: { tool: "none", x: 0.5, y: 0.5, color: "#ef4444" },
|
|
16204
|
+
inkStrokes: [],
|
|
16205
|
+
caption: "",
|
|
16206
|
+
subtitlesVisible: false
|
|
16207
|
+
};
|
|
16208
|
+
}
|
|
16209
|
+
function buildPresentationAudienceUrl(source, sessionId) {
|
|
16210
|
+
const url = new URL(source);
|
|
16211
|
+
const params = new URLSearchParams();
|
|
16212
|
+
params.set(PRESENTATION_NONCE_KEY, sessionId);
|
|
16213
|
+
url.hash = `${PRESENTATION_HASH}&${params.toString()}`;
|
|
16214
|
+
return url.toString();
|
|
16215
|
+
}
|
|
16216
|
+
function isPresentationSessionMessage(value) {
|
|
16217
|
+
if (!value || typeof value !== "object") {
|
|
16218
|
+
return false;
|
|
16219
|
+
}
|
|
16220
|
+
const message = value;
|
|
16221
|
+
if (message.origin !== PRESENTATION_MESSAGE_ORIGIN || typeof message.sessionId !== "string") {
|
|
16222
|
+
return false;
|
|
16223
|
+
}
|
|
16224
|
+
if (message.type === "audience-ready" || message.type === "presenter-exit") {
|
|
16225
|
+
return true;
|
|
16226
|
+
}
|
|
16227
|
+
if (message.type === "presenter-slide-change") {
|
|
16228
|
+
return typeof message.slideIndex === "number";
|
|
16229
|
+
}
|
|
16230
|
+
if (message.type !== "presenter-state" || !message.snapshot || typeof message.snapshot !== "object") {
|
|
16231
|
+
return false;
|
|
16232
|
+
}
|
|
16233
|
+
const snapshot = message.snapshot;
|
|
16234
|
+
const zoom = snapshot.zoom;
|
|
16235
|
+
const pointer = snapshot.pointer;
|
|
16236
|
+
const inkStrokes = snapshot.inkStrokes;
|
|
16237
|
+
return typeof snapshot.slideIndex === "number" && typeof snapshot.buildStep === "number" && typeof snapshot.sequence === "number" && (snapshot.blackout === "none" || snapshot.blackout === "black" || snapshot.blackout === "white") && typeof snapshot.paused === "boolean" && typeof snapshot.elapsedMs === "number" && (!zoom || typeof zoom.scale === "number" && typeof zoom.originX === "number" && typeof zoom.originY === "number") && (!pointer || typeof pointer.tool === "string" && typeof pointer.x === "number" && typeof pointer.y === "number" && typeof pointer.color === "string") && (inkStrokes === void 0 || Array.isArray(inkStrokes)) && (snapshot.caption === void 0 || typeof snapshot.caption === "string") && (snapshot.subtitlesVisible === void 0 || typeof snapshot.subtitlesVisible === "boolean");
|
|
16238
|
+
}
|
|
16239
|
+
async function resolveAudienceScreenPlacement(sourceWindow = window) {
|
|
16240
|
+
const managedWindow = sourceWindow;
|
|
16241
|
+
if (typeof managedWindow.getScreenDetails !== "function") {
|
|
16242
|
+
return null;
|
|
16243
|
+
}
|
|
16244
|
+
try {
|
|
16245
|
+
const details = await managedWindow.getScreenDetails();
|
|
16246
|
+
const target = details.screens.find((screen2) => screen2 !== details.currentScreen && !screen2.isPrimary) ?? details.screens.find((screen2) => screen2 !== details.currentScreen);
|
|
16247
|
+
if (!target) {
|
|
16248
|
+
return null;
|
|
16249
|
+
}
|
|
16250
|
+
return {
|
|
16251
|
+
left: target.availLeft,
|
|
16252
|
+
top: target.availTop,
|
|
16253
|
+
width: target.availWidth,
|
|
16254
|
+
height: target.availHeight,
|
|
16255
|
+
label: target.label
|
|
16256
|
+
};
|
|
16257
|
+
} catch {
|
|
16258
|
+
return null;
|
|
16259
|
+
}
|
|
16260
|
+
}
|
|
16261
|
+
function placeAudienceWindow(target, placement) {
|
|
16262
|
+
try {
|
|
16263
|
+
target.moveTo(placement.left, placement.top);
|
|
16264
|
+
target.resizeTo(placement.width, placement.height);
|
|
16265
|
+
target.focus();
|
|
16266
|
+
} catch {
|
|
16267
|
+
}
|
|
16268
|
+
}
|
|
16269
|
+
async function swapPresentationWindows(presenter, audience) {
|
|
16270
|
+
const managedWindow = presenter;
|
|
16271
|
+
if (typeof managedWindow.getScreenDetails !== "function") {
|
|
16272
|
+
return false;
|
|
16273
|
+
}
|
|
16274
|
+
try {
|
|
16275
|
+
const details = await managedWindow.getScreenDetails();
|
|
16276
|
+
const contains = (screen2, target) => target.screenX >= screen2.availLeft && target.screenX < screen2.availLeft + screen2.availWidth && target.screenY >= screen2.availTop && target.screenY < screen2.availTop + screen2.availHeight;
|
|
16277
|
+
const presenterScreen = details.screens.find((screen2) => contains(screen2, presenter));
|
|
16278
|
+
const audienceScreen = details.screens.find((screen2) => contains(screen2, audience));
|
|
16279
|
+
if (!presenterScreen || !audienceScreen || presenterScreen === audienceScreen) {
|
|
16280
|
+
return false;
|
|
16281
|
+
}
|
|
16282
|
+
placeAudienceWindow(audience, {
|
|
16283
|
+
left: presenterScreen.availLeft,
|
|
16284
|
+
top: presenterScreen.availTop,
|
|
16285
|
+
width: presenterScreen.availWidth,
|
|
16286
|
+
height: presenterScreen.availHeight
|
|
16287
|
+
});
|
|
16288
|
+
placeAudienceWindow(presenter, {
|
|
16289
|
+
left: audienceScreen.availLeft,
|
|
16290
|
+
top: audienceScreen.availTop,
|
|
16291
|
+
width: audienceScreen.availWidth,
|
|
16292
|
+
height: audienceScreen.availHeight
|
|
16293
|
+
});
|
|
16294
|
+
return true;
|
|
16295
|
+
} catch {
|
|
16296
|
+
return false;
|
|
16297
|
+
}
|
|
16298
|
+
}
|
|
16299
|
+
function openDeckDb() {
|
|
16300
|
+
return new Promise((resolve, reject) => {
|
|
16301
|
+
const request = indexedDB.open(DB_NAME, DB_VERSION);
|
|
16302
|
+
request.onupgradeneeded = () => {
|
|
16303
|
+
const db = request.result;
|
|
16304
|
+
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
16305
|
+
db.createObjectStore(STORE_NAME);
|
|
16306
|
+
}
|
|
16307
|
+
};
|
|
16308
|
+
request.onsuccess = () => resolve(request.result);
|
|
16309
|
+
request.onerror = () => reject(request.error);
|
|
16310
|
+
});
|
|
16311
|
+
}
|
|
16312
|
+
async function storePresentationDeck(sessionId, content) {
|
|
16313
|
+
const db = await openDeckDb();
|
|
16314
|
+
return new Promise((resolve, reject) => {
|
|
16315
|
+
const tx = db.transaction(STORE_NAME, "readwrite");
|
|
16316
|
+
const bytes = content instanceof Uint8Array ? content : new Uint8Array(content);
|
|
16317
|
+
tx.objectStore(STORE_NAME).put(
|
|
16318
|
+
{ bytes, createdAt: Date.now() },
|
|
16319
|
+
sessionId
|
|
16320
|
+
);
|
|
16321
|
+
tx.oncomplete = () => {
|
|
16322
|
+
db.close();
|
|
16323
|
+
resolve();
|
|
16324
|
+
};
|
|
16325
|
+
tx.onerror = () => {
|
|
16326
|
+
db.close();
|
|
16327
|
+
reject(tx.error);
|
|
16328
|
+
};
|
|
16329
|
+
});
|
|
16330
|
+
}
|
|
16331
|
+
async function loadPresentationDeck(sessionId) {
|
|
16332
|
+
try {
|
|
16333
|
+
const db = await openDeckDb();
|
|
16334
|
+
return await new Promise((resolve, reject) => {
|
|
16335
|
+
const request = db.transaction(STORE_NAME, "readonly").objectStore(STORE_NAME).get(sessionId);
|
|
16336
|
+
request.onsuccess = () => {
|
|
16337
|
+
db.close();
|
|
16338
|
+
const record = request.result;
|
|
16339
|
+
if (!record || Date.now() - record.createdAt > MAX_DECK_AGE_MS) {
|
|
16340
|
+
resolve(null);
|
|
16341
|
+
return;
|
|
16342
|
+
}
|
|
16343
|
+
const raw = record.bytes;
|
|
16344
|
+
resolve(
|
|
16345
|
+
raw instanceof Uint8Array ? raw : raw instanceof ArrayBuffer ? new Uint8Array(raw) : null
|
|
16346
|
+
);
|
|
16347
|
+
};
|
|
16348
|
+
request.onerror = () => {
|
|
16349
|
+
db.close();
|
|
16350
|
+
reject(request.error);
|
|
16351
|
+
};
|
|
16352
|
+
});
|
|
16353
|
+
} catch {
|
|
16354
|
+
return null;
|
|
16355
|
+
}
|
|
16356
|
+
}
|
|
16357
|
+
async function clearPresentationDeck(sessionId) {
|
|
16358
|
+
try {
|
|
16359
|
+
const db = await openDeckDb();
|
|
16360
|
+
await new Promise((resolve) => {
|
|
16361
|
+
const tx = db.transaction(STORE_NAME, "readwrite");
|
|
16362
|
+
tx.objectStore(STORE_NAME).delete(sessionId);
|
|
16363
|
+
tx.oncomplete = () => {
|
|
16364
|
+
db.close();
|
|
16365
|
+
resolve();
|
|
16366
|
+
};
|
|
16367
|
+
tx.onerror = () => {
|
|
16368
|
+
db.close();
|
|
16369
|
+
resolve();
|
|
16370
|
+
};
|
|
16371
|
+
});
|
|
16372
|
+
} catch {
|
|
16373
|
+
}
|
|
16374
|
+
}
|
|
16030
16375
|
function formatSlideCounter(currentSlide, totalSlides) {
|
|
16031
16376
|
return `${currentSlide + 1} / ${totalSlides}`;
|
|
16032
16377
|
}
|
|
@@ -16616,7 +16961,10 @@ function getAriaRole(element) {
|
|
|
16616
16961
|
case "picture":
|
|
16617
16962
|
return "img";
|
|
16618
16963
|
case "table":
|
|
16619
|
-
|
|
16964
|
+
case "media":
|
|
16965
|
+
case "text":
|
|
16966
|
+
case "ole":
|
|
16967
|
+
case "contentPart":
|
|
16620
16968
|
case "group":
|
|
16621
16969
|
return "group";
|
|
16622
16970
|
case "chart":
|
|
@@ -16625,17 +16973,13 @@ function getAriaRole(element) {
|
|
|
16625
16973
|
return "img";
|
|
16626
16974
|
case "connector":
|
|
16627
16975
|
return "img";
|
|
16628
|
-
case "media":
|
|
16629
|
-
return "application";
|
|
16630
16976
|
case "ink":
|
|
16631
16977
|
return "img";
|
|
16632
16978
|
case "model3d":
|
|
16633
16979
|
return "img";
|
|
16634
|
-
case "text":
|
|
16635
|
-
return void 0;
|
|
16636
16980
|
case "shape": {
|
|
16637
16981
|
if (hasTextProperties(element) && element.text) {
|
|
16638
|
-
return
|
|
16982
|
+
return "group";
|
|
16639
16983
|
}
|
|
16640
16984
|
return "img";
|
|
16641
16985
|
}
|
|
@@ -16754,6 +17098,75 @@ function getAriaRoleDescription(element) {
|
|
|
16754
17098
|
return void 0;
|
|
16755
17099
|
}
|
|
16756
17100
|
}
|
|
17101
|
+
var MODAL_FOCUSABLE_SELECTOR = [
|
|
17102
|
+
"a[href]",
|
|
17103
|
+
"button:not([disabled])",
|
|
17104
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
17105
|
+
"select:not([disabled])",
|
|
17106
|
+
"textarea:not([disabled])",
|
|
17107
|
+
'[contenteditable="true"]',
|
|
17108
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
17109
|
+
].join(",");
|
|
17110
|
+
function isAvailable(element) {
|
|
17111
|
+
if (element.hidden || element.getAttribute("aria-hidden") === "true") {
|
|
17112
|
+
return false;
|
|
17113
|
+
}
|
|
17114
|
+
const style = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
17115
|
+
return style?.display !== "none" && style?.visibility !== "hidden";
|
|
17116
|
+
}
|
|
17117
|
+
function focusableElements(panel) {
|
|
17118
|
+
return Array.from(panel.querySelectorAll(MODAL_FOCUSABLE_SELECTOR)).filter(
|
|
17119
|
+
isAvailable
|
|
17120
|
+
);
|
|
17121
|
+
}
|
|
17122
|
+
function activateModalFocus(panel, options = {}) {
|
|
17123
|
+
const doc = panel.ownerDocument;
|
|
17124
|
+
const opener = doc.activeElement instanceof HTMLElement ? doc.activeElement : null;
|
|
17125
|
+
const restoreFocus = options.restoreFocus ?? true;
|
|
17126
|
+
function focusInitial() {
|
|
17127
|
+
const candidate = options.initialFocus ?? focusableElements(panel)[0] ?? panel;
|
|
17128
|
+
candidate.focus();
|
|
17129
|
+
}
|
|
17130
|
+
function onKeydown(event) {
|
|
17131
|
+
if (!panel.isConnected) {
|
|
17132
|
+
doc.removeEventListener("keydown", onKeydown, true);
|
|
17133
|
+
return;
|
|
17134
|
+
}
|
|
17135
|
+
if (event.key === "Escape" && options.onEscape) {
|
|
17136
|
+
event.preventDefault();
|
|
17137
|
+
event.stopPropagation();
|
|
17138
|
+
options.onEscape();
|
|
17139
|
+
return;
|
|
17140
|
+
}
|
|
17141
|
+
if (event.key !== "Tab") {
|
|
17142
|
+
return;
|
|
17143
|
+
}
|
|
17144
|
+
const focusable = focusableElements(panel);
|
|
17145
|
+
if (focusable.length === 0) {
|
|
17146
|
+
event.preventDefault();
|
|
17147
|
+
panel.focus();
|
|
17148
|
+
return;
|
|
17149
|
+
}
|
|
17150
|
+
const first = focusable[0];
|
|
17151
|
+
const last = focusable[focusable.length - 1];
|
|
17152
|
+
const active = doc.activeElement;
|
|
17153
|
+
if (event.shiftKey && (active === first || !panel.contains(active))) {
|
|
17154
|
+
event.preventDefault();
|
|
17155
|
+
last.focus();
|
|
17156
|
+
} else if (!event.shiftKey && (active === last || !panel.contains(active))) {
|
|
17157
|
+
event.preventDefault();
|
|
17158
|
+
first.focus();
|
|
17159
|
+
}
|
|
17160
|
+
}
|
|
17161
|
+
doc.addEventListener("keydown", onKeydown, true);
|
|
17162
|
+
queueMicrotask(focusInitial);
|
|
17163
|
+
return () => {
|
|
17164
|
+
doc.removeEventListener("keydown", onKeydown, true);
|
|
17165
|
+
if (restoreFocus && opener?.isConnected) {
|
|
17166
|
+
opener.focus();
|
|
17167
|
+
}
|
|
17168
|
+
};
|
|
17169
|
+
}
|
|
16757
17170
|
function extractPathPoints(d) {
|
|
16758
17171
|
const points = [];
|
|
16759
17172
|
const numberRegex = /-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/giu;
|
|
@@ -19328,4 +19741,4 @@ function segmentFrameCount(durationMs, fps) {
|
|
|
19328
19741
|
return Math.max(1, Math.ceil(durationMs / (1e3 / fps)));
|
|
19329
19742
|
}
|
|
19330
19743
|
|
|
19331
|
-
export { ACTION_BUTTON_PRESETS, ARTISTIC_EFFECTS, BROADCAST_THROTTLE_MS, CATEGORIES, CONNECTION_TIMEOUT_MS, DEFAULT_BROADCAST_SERVER_URL, DEFAULT_COLOR_CHANGE_TOLERANCE, DEFAULT_INSERT_CHART_TYPE, DEFAULT_ROW_HEIGHT, DIRECTIONAL_PRESETS, DUOTONE_PRESETS, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, FILL_MODE_OPTIONS, GRADIENT_TYPE_OPTIONS, HANDOUT_OPTIONS, INK_REPLAY_KEYFRAMES, INSERT_CHART_TYPES, LBL, LOCAL_SYNC_ORIGIN, MOBILE_BREAKPOINT, NOTES_FONT_SIZE_DEFAULT, NOTES_FONT_SIZE_MAX, NOTES_FONT_SIZE_MIN, NOTES_FONT_SIZE_STEP, NUM, PATTERN_OPTIONS, PRESETS, RULER_FONT_SIZE, RULER_THICKNESS, SECTION_HEADING, SEL, SHAPE_PRESET_DEFS, SLIDE_TRANSITION_KEYFRAMES, TABLET_BREAKPOINT, TABLE_STYLE_PRESETS, TAB_ROW_ACTION_CLASSES, TEXT_BUILD_ID_SEP, THEME_COLOR_LABELS, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, TimelineEngine, WEBM_MIME_CANDIDATES, addSection, alignElements, apply3dEffects, applyCaseTransformToSegments, applyColorChange, applyDuotone, applyFormatToElement, applyReroutedConnectors, applyResize, applyStyleToSelectedSegments, bringForward, bringToFront, build3DExtrusionData, buildBroadcastViewerUrl, buildCacheKey, buildChartViewModel, buildCssGradientFromShapeStyle, buildDuotoneCacheKey, buildElementClipboardPayload, buildGlowBoxShadow, buildHandoutsHtml, buildInitialGuides, buildInnerShadowCssFromShapeStyle, buildMultiLayerShadowCss, buildNotesHtml, buildNotesPdfBytes, buildOutlineHtml, buildPatternFillCss, buildPreviewAnimation, buildPrintDocument, buildPrintHtmlDocument, buildReflectionCss, buildShadowCssFromShapeStyle, buildSlidesHtml, buildSlidesPdfBytes, buildSmartArt3DModel, buildSmartArtA11y, buildSmartArtPresetData, buildTextBody3DSceneStyle, buildTextFillCss, buildTextReflectionCss, buildTextRunFilterChain, buildTextShadowCss, buildThemeColorGrid, buildUserFontFaceStyles, canvasToJpegData, chartPartToAttrs, clampCropValue, clampNotesFontSize, clampPercent, clampUnitInterval, cloneElementForPaste, cloneHistorySnapshot, cloneSlide, cloneTemplateElementsBySlideId, collectImagePaths, collectMediaElements, colorWithOpacity, comparePresentation, computeAllNotesPages, computeAutoFitTextStyle, computeColumnBoundaries, computeHandoutLayout, computeInlineEditorRect, computeKeyboardInset, computeLayout, computeLayoutOptions, computeMarqueeHitIds, computeMergeCellDown, computeMergeCellRight, computeResizedColumnWidths, computeResizedRowHeight, computeScrollDelta, computeSelectionRect, computeSmartArtLayout, computeSnapToShape, computeSplitCell, computeValueRange, computeValueRangeForChart, convertLatexToOmml, convertOmmlToLatex, convertOmmlToMathMl, copyFormatFromElement, countTextSegments, createBlankSlide, createDefaultChartElement, createSyncGate, createTouchGestureRecognizer, defaultCssVars, defaultRadius, defaultThemeColors, deleteSection, deleteTableColumn, deleteTableRow, derivePresenceList, detectOrientation, detectTouchDevice, distributeElements, downloadBlob, downloadDataUrl, dragAnchorViewY, dragValueForPart, encodeGif, expandTextBuildAnimations, extractPathPoints, filterCommands, findChartPartTarget, findSmartArtNodeText, formatAxisValue, formatAxisValueWithUnits, formatBytes, formatCommentTimestamp, formatElapsed, formatMobileElapsed, formatRelativeTime, formatSlideCounter, formatTime, formatVersionTimestamp, fpsToFrameIntervalMs, generateBroadcastRoomId, generateElementId, generateLogTicks, generateNoteLineCount, generatePressureCircles, generateTicks, getAnimationInitialStyle, getAriaLabel, getAriaRole, getAriaRoleDescription, getCachedResult, getChartStylePalette, getCommentMarkerPosition, getCompoundLineBorderWidth, getCompoundLineBoxShadow, getCompoundLineOffsets, getCompoundLineWidths, getConnectionSites, getContentPartReplayStyles, getCssBorderDashStyle, getDisplayUnitLabel, getDuotoneCachedResult, getEffectDagFilter, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getImageEffectsFilter, getImageEffectsOpacity, getInkReplayStyles, getInlineEditorSelection, getKinsokuLineBreakStyles, getNotesPrintableArea, getOleBadgeLabel, getOleTypeColor, getOleTypeLabel, getPatternSvg, getPendingSelectionRestore, getPrintableArea, getResolvedShapeClipPath, getRoundRectRadiusPx, getSecondaryValueAxis, getShapeAdjustmentHandleDescriptor, getSlideBackgroundStyle, getSlideTransitionAnimations, getSvgStrokeDasharray, getTextAlphaOpacity, getTextCompensationTransform, getWarpPath, groupElements, groupIntoParagraphs, hasCopyableFormat, hasDistinctScriptFonts, hasPressureVariation, insertTableColumn, insertTableRow, isBrowserOpenableMime, isCellInRect, isEditableTextElement, isExportAbortError, isFirstSlide, isKeyboardOpen, isLastSlide, isMixedContentBlocked, isMobileViewport, isPpactionUrl, isTemplateElement, isTemplateElementId, isUrlSafe, makeCloneId, makeSlideId, mergeAdditiveSelection, mergeCells, mobileElapsedSince, mobileSlideCounter, mountModel3D, mountSurfaceChart3D, moveSectionDown, moveSectionUp, moveSlidesToSection, newTableElement, normalizeColorsForCapture, normalizeHexColor, normalizeStrokeDashType, normalizeValue, notesSegmentsToSpans, observeYDocSlides, ooxmlDashToCssBorderStyle, openPptxFile, openUrlInNewTab, paletteColor, parseDrawingColor, parseDrawingColorOpacity, parsePpactionUrl, pickSupportedMimeType, preprocessCssForCapture, pressuresToWidths, readSlidesFromYDoc, readViewportMetrics, rebuildDrawingShapesIfCleared, reconcileSlidesInYDoc, recordProgressPercent, rectToCells, remapTextToSegments, renameSection, rerouteConnectorsForMovedElements, resolveCssTextAlign, resolveDrawingShapeNodeId, resolveFontForScript, resolveInkColor, resolveInkOpacity, resolveInkWidth, resolveLineHeight, resolveOleType, resolveParagraphAlign, resolveParagraphRtl, resolveRegionCode, resolveTitleBarStatusKey, resolveTransitionDurationMs, resolveTransportForServerUrl, resolveUnderlineDecorationStyle, restoreSegmentSelection, safeOpenUrl, sanitizeColor, sanitizeDownloadFilename, sanitizeMathMl, saveAutosaveSnapshot,
|
|
19744
|
+
export { ACTION_BUTTON_PRESETS, ARTISTIC_EFFECTS, BROADCAST_THROTTLE_MS, CATEGORIES, CONNECTION_TIMEOUT_MS, DEFAULT_BROADCAST_SERVER_URL, DEFAULT_COLOR_CHANGE_TOLERANCE, DEFAULT_INSERT_CHART_TYPE, DEFAULT_ROW_HEIGHT, DIRECTIONAL_PRESETS, DUOTONE_PRESETS, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, FILL_MODE_OPTIONS, GRADIENT_TYPE_OPTIONS, HANDOUT_OPTIONS, INK_REPLAY_KEYFRAMES, INSERT_CHART_TYPES, LBL, LOCAL_SYNC_ORIGIN, MOBILE_BREAKPOINT, NOTES_FONT_SIZE_DEFAULT, NOTES_FONT_SIZE_MAX, NOTES_FONT_SIZE_MIN, NOTES_FONT_SIZE_STEP, NUM, PATTERN_OPTIONS, PRESENTATION_CHANNEL_NAME, PRESENTATION_HASH, PRESENTATION_MESSAGE_ORIGIN, PRESENTATION_NONCE_KEY, PRESETS, RULER_FONT_SIZE, RULER_THICKNESS, SECTION_HEADING, SEL, SHAPE_PRESET_DEFS, SLIDE_TRANSITION_KEYFRAMES, TABLET_BREAKPOINT, TABLE_STYLE_PRESETS, TAB_ROW_ACTION_CLASSES, TEXT_BUILD_ID_SEP, THEME_COLOR_LABELS, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, TimelineEngine, WEBM_MIME_CANDIDATES, activateModalFocus, addSection, alignElements, appendPresentationInkPoint, apply3dEffects, applyCaseTransformToSegments, applyColorChange, applyDuotone, applyFormatToElement, applyReroutedConnectors, applyResize, applyStyleToSelectedSegments, bringForward, bringToFront, build3DExtrusionData, buildBroadcastViewerUrl, buildCacheKey, buildChartViewModel, buildCollaborationShareUrl, buildCreateCollaborationConfig, buildCssGradientFromShapeStyle, buildDuotoneCacheKey, buildElementClipboardPayload, buildGlowBoxShadow, buildHandoutsHtml, buildInitialGuides, buildInnerShadowCssFromShapeStyle, buildJoinCollaborationConfig, buildMultiLayerShadowCss, buildNotesHtml, buildNotesPdfBytes, buildOutlineHtml, buildPatternFillCss, buildPresentationAudienceUrl, buildPreviewAnimation, buildPrintDocument, buildPrintHtmlDocument, buildReflectionCss, buildShadowCssFromShapeStyle, buildSlidesHtml, buildSlidesPdfBytes, buildSmartArt3DModel, buildSmartArtA11y, buildSmartArtPresetData, buildTextBody3DSceneStyle, buildTextFillCss, buildTextReflectionCss, buildTextRunFilterChain, buildTextShadowCss, buildThemeColorGrid, buildUserFontFaceStyles, canvasToJpegData, chartPartToAttrs, clampCropValue, clampNotesFontSize, clampPercent, clampUnitInterval, clearPresentationDeck, cloneElementForPaste, cloneHistorySnapshot, cloneSlide, cloneTemplateElementsBySlideId, collectImagePaths, collectMediaElements, colorWithOpacity, comparePresentation, computeAllNotesPages, computeAutoFitTextStyle, computeColumnBoundaries, computeHandoutLayout, computeInlineEditorRect, computeKeyboardInset, computeLayout, computeLayoutOptions, computeMarqueeHitIds, computeMergeCellDown, computeMergeCellRight, computeResizedColumnWidths, computeResizedRowHeight, computeScrollDelta, computeSelectionRect, computeSmartArtLayout, computeSnapToShape, computeSplitCell, computeValueRange, computeValueRangeForChart, convertLatexToOmml, convertOmmlToLatex, convertOmmlToMathMl, copyFormatFromElement, countTextSegments, createBlankSlide, createDefaultChartElement, createInitialPresentationSnapshot, createPresentationSessionId, createPresenterTimer, createSyncGate, createTouchGestureRecognizer, defaultCssVars, defaultRadius, defaultThemeColors, deleteSection, deleteTableColumn, deleteTableRow, derivePresenceList, detectOrientation, detectTouchDevice, distributeElements, downloadBlob, downloadDataUrl, dragAnchorViewY, dragValueForPart, encodeGif, erasePresentationInkAt, expandTextBuildAnimations, extractPathPoints, filterCommands, findChartPartTarget, findSmartArtNodeText, formatAxisValue, formatAxisValueWithUnits, formatBytes, formatCommentTimestamp, formatElapsed, formatMobileElapsed, formatRelativeTime, formatSlideCounter, formatTime, formatVersionTimestamp, fpsToFrameIntervalMs, generateBroadcastRoomId, generateElementId, generateLogTicks, generateNoteLineCount, generatePressureCircles, generateTicks, getAnimationInitialStyle, getAriaLabel, getAriaRole, getAriaRoleDescription, getCachedResult, getChartStylePalette, getCommentMarkerPosition, getCompoundLineBorderWidth, getCompoundLineBoxShadow, getCompoundLineOffsets, getCompoundLineWidths, getConnectionSites, getContentPartReplayStyles, getCssBorderDashStyle, getDisplayUnitLabel, getDuotoneCachedResult, getEffectDagFilter, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getImageEffectsFilter, getImageEffectsOpacity, getInkReplayStyles, getInlineEditorSelection, getKinsokuLineBreakStyles, getNotesPrintableArea, getOleBadgeLabel, getOleTypeColor, getOleTypeLabel, getPatternSvg, getPendingSelectionRestore, getPrintableArea, getResolvedShapeClipPath, getRoundRectRadiusPx, getSecondaryValueAxis, getShapeAdjustmentHandleDescriptor, getSlideBackgroundStyle, getSlideTransitionAnimations, getSvgStrokeDasharray, getTextAlphaOpacity, getTextCompensationTransform, getWarpPath, groupElements, groupIntoParagraphs, hasCopyableFormat, hasDistinctScriptFonts, hasPressureVariation, insertTableColumn, insertTableRow, isBrowserOpenableMime, isCellInRect, isEditableTextElement, isExportAbortError, isFirstSlide, isKeyboardOpen, isLastSlide, isMixedContentBlocked, isMobileViewport, isPpactionUrl, isPresentationSessionMessage, isTemplateElement, isTemplateElementId, isUrlSafe, loadPresentationDeck, makeCloneId, makeSlideId, mergeAdditiveSelection, mergeCells, mergePresentationSnapshot, mobileElapsedSince, mobileSlideCounter, mountModel3D, mountSurfaceChart3D, movePresenterPointer, moveSectionDown, moveSectionUp, moveSlidesToSection, newTableElement, normalizeColorsForCapture, normalizeHexColor, normalizeStrokeDashType, normalizeValue, notesSegmentsToSpans, observeYDocSlides, ooxmlDashToCssBorderStyle, openPptxFile, openUrlInNewTab, paletteColor, parseDrawingColor, parseDrawingColorOpacity, parsePpactionUrl, pickSupportedMimeType, placeAudienceWindow, preprocessCssForCapture, presentationInkPath, presenterElapsed, pressuresToWidths, readSlidesFromYDoc, readViewportMetrics, rebuildDrawingShapesIfCleared, reconcileSlidesInYDoc, recordProgressPercent, rectToCells, remapTextToSegments, renameSection, rerouteConnectorsForMovedElements, resetPresenterTimer, resolveAudienceScreenPlacement, resolveCssTextAlign, resolveDrawingShapeNodeId, resolveFontForScript, resolveInkColor, resolveInkOpacity, resolveInkWidth, resolveLineHeight, resolveOleType, resolveParagraphAlign, resolveParagraphRtl, resolveRegionCode, resolveTitleBarStatusKey, resolveTransitionDurationMs, resolveTransportForServerUrl, resolveUnderlineDecorationStyle, restoreSegmentSelection, safeOpenUrl, sanitizeColor, sanitizeDownloadFilename, sanitizeMathMl, saveAutosaveSnapshot, segmentByScript, segmentFrameCount, sendBackward, sendToBack, sequentialColorScale, seriesColor, setCachedResult, setDuotoneCachedResult, setPendingSelectionRestore, shadeColor2, shouldCommitSmartArtNodeText, shouldUseSvgWarp, slideProgressPercent, slideStatusLabel, snapBoxToGrid, splitCell, splitSeriesByAxis, stepPresenterZoom, storePresentationDeck, substituteFieldText, svgLineCap, swapPresentationWindows, themeToCssVars, tintColor2, toCssTextOrientation, toCssVerticalDirection, toCssWritingMode, togglePresenterTimer, transformTextCase, validateRoomId, valueToY, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, withChartPointValue, withChartTitle };
|