pptx-react-viewer 1.14.0 → 1.15.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 +8 -0
- package/dist/{Model3DScene-DX7S3IM7.mjs → Model3DScene-EF72C34A.mjs} +1 -1
- package/dist/Model3DScene-EF72C34A.mjs.br +0 -0
- package/dist/Model3DScene-EF72C34A.mjs.gz +0 -0
- package/dist/{Model3DScene-2E4HO4RQ.js → Model3DScene-QIE7QZ7M.js} +2 -2
- package/dist/{Model3DScene-2E4HO4RQ.js.br → Model3DScene-QIE7QZ7M.js.br} +0 -0
- package/dist/Model3DScene-QIE7QZ7M.js.gz +0 -0
- package/dist/{PowerPointViewer-DCYB93o0.d.ts → PowerPointViewer-BsaUH3ZT.d.ts} +1 -1
- package/dist/{PowerPointViewer-Crgj0LoS.d.mts → PowerPointViewer-Nxku67uL.d.mts} +1 -1
- package/dist/{SurfaceChart3DScene-327DEJSK.js → SurfaceChart3DScene-CBUOCCEN.js} +2 -2
- package/dist/{SurfaceChart3DScene-327DEJSK.js.br → SurfaceChart3DScene-CBUOCCEN.js.br} +0 -0
- package/dist/SurfaceChart3DScene-CBUOCCEN.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-C3D3F2NN.mjs → SurfaceChart3DScene-JYCQ2DBR.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-C3D3F2NN.mjs.br → SurfaceChart3DScene-JYCQ2DBR.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-JYCQ2DBR.mjs.gz +0 -0
- package/dist/{chunk-FMB2AJD7.js → chunk-BZVYWFHS.js} +418 -573
- package/dist/chunk-BZVYWFHS.js.br +0 -0
- package/dist/chunk-BZVYWFHS.js.gz +0 -0
- package/dist/{chunk-JZP5LYN3.mjs → chunk-FHOZRWAD.mjs} +289 -1
- package/dist/chunk-FHOZRWAD.mjs.br +0 -0
- package/dist/chunk-FHOZRWAD.mjs.gz +0 -0
- package/dist/{chunk-H5KXQEQD.js → chunk-FQXZZBFJ.js} +295 -0
- package/dist/chunk-FQXZZBFJ.js.br +0 -0
- package/dist/chunk-FQXZZBFJ.js.gz +0 -0
- package/dist/{chunk-OSWE3VXS.mjs → chunk-HJQZJ3VE.mjs} +9 -0
- package/dist/chunk-HJQZJ3VE.mjs.br +0 -0
- package/dist/chunk-HJQZJ3VE.mjs.gz +0 -0
- package/dist/{chunk-TQD5XTOT.mjs → chunk-POP5TS5L.mjs} +64 -219
- package/dist/chunk-POP5TS5L.mjs.br +0 -0
- package/dist/chunk-POP5TS5L.mjs.gz +0 -0
- package/dist/{chunk-K74UOJ6P.js → chunk-WGLJ32FW.js} +9 -0
- package/dist/chunk-WGLJ32FW.js.br +0 -0
- package/dist/chunk-WGLJ32FW.js.gz +0 -0
- package/dist/{chunk-45JY7DOB.mjs → chunk-X2UMJTCM.mjs} +38 -18
- package/dist/chunk-X2UMJTCM.mjs.br +0 -0
- package/dist/chunk-X2UMJTCM.mjs.gz +0 -0
- package/dist/{chunk-55OTTA3H.js → chunk-ZDV7QRGB.js} +779 -759
- package/dist/chunk-ZDV7QRGB.js.br +0 -0
- package/dist/chunk-ZDV7QRGB.js.gz +0 -0
- package/dist/hooks-unstable.d.mts +10 -4
- package/dist/hooks-unstable.d.ts +10 -4
- package/dist/hooks-unstable.js +74 -74
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- 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 +1 -1
- 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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -18
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +2 -1
- 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/{types-ui-Bagu4aYj.d.mts → types-ui-NG29h55h.d.mts} +17 -6
- package/dist/{types-ui-Bagu4aYj.d.ts → types-ui-NG29h55h.d.ts} +17 -6
- package/dist/{usePresenterWindow-DxZUXXk_.d.ts → usePresenterWindow-DToCijGy.d.ts} +1 -1
- package/dist/{usePresenterWindow-BarXkdvr.d.mts → usePresenterWindow-DeTm-unp.d.mts} +1 -1
- package/dist/viewer/index.d.mts +5 -5
- package/dist/viewer/index.d.ts +5 -5
- package/dist/viewer/index.js +19 -19
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-2E4HO4RQ.js.gz +0 -0
- package/dist/Model3DScene-DX7S3IM7.mjs.br +0 -0
- package/dist/Model3DScene-DX7S3IM7.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-327DEJSK.js.gz +0 -0
- package/dist/SurfaceChart3DScene-C3D3F2NN.mjs.gz +0 -0
- package/dist/chunk-45JY7DOB.mjs.br +0 -0
- package/dist/chunk-45JY7DOB.mjs.gz +0 -0
- package/dist/chunk-55OTTA3H.js.br +0 -0
- package/dist/chunk-55OTTA3H.js.gz +0 -0
- package/dist/chunk-FMB2AJD7.js.br +0 -0
- package/dist/chunk-FMB2AJD7.js.gz +0 -0
- package/dist/chunk-H5KXQEQD.js.br +0 -0
- package/dist/chunk-H5KXQEQD.js.gz +0 -0
- package/dist/chunk-JZP5LYN3.mjs.br +0 -0
- package/dist/chunk-JZP5LYN3.mjs.gz +0 -0
- package/dist/chunk-K74UOJ6P.js.br +0 -0
- package/dist/chunk-K74UOJ6P.js.gz +0 -0
- package/dist/chunk-OSWE3VXS.mjs.br +0 -0
- package/dist/chunk-OSWE3VXS.mjs.gz +0 -0
- package/dist/chunk-TQD5XTOT.mjs.br +0 -0
- package/dist/chunk-TQD5XTOT.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkFQXZZBFJ_js = require('./chunk-FQXZZBFJ.js');
|
|
4
|
+
var chunkWGLJ32FW_js = require('./chunk-WGLJ32FW.js');
|
|
5
5
|
var chunkOBLHB72P_js = require('./chunk-OBLHB72P.js');
|
|
6
6
|
var React3 = require('react');
|
|
7
7
|
var lu = require('react-icons/lu');
|
|
@@ -20,7 +20,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
20
20
|
|
|
21
21
|
// src/viewer/utils/clone.ts
|
|
22
22
|
function cloneHistorySnapshot2(snapshot) {
|
|
23
|
-
return
|
|
23
|
+
return chunkFQXZZBFJ_js.cloneHistorySnapshot(snapshot);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/viewer/hooks/useEditorHistory.ts
|
|
@@ -68,8 +68,8 @@ function useEditorHistory(input) {
|
|
|
68
68
|
width: canvasSize.width,
|
|
69
69
|
height: canvasSize.height,
|
|
70
70
|
activeSlideIndex,
|
|
71
|
-
slides: slides.map(
|
|
72
|
-
templateElementsBySlideId:
|
|
71
|
+
slides: slides.map(chunkFQXZZBFJ_js.cloneSlide),
|
|
72
|
+
templateElementsBySlideId: chunkFQXZZBFJ_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
73
73
|
...actionLabel ? { actionLabel } : {}
|
|
74
74
|
};
|
|
75
75
|
},
|
|
@@ -82,9 +82,9 @@ function useEditorHistory(input) {
|
|
|
82
82
|
width: snapshot.width,
|
|
83
83
|
height: snapshot.height
|
|
84
84
|
});
|
|
85
|
-
setSlides(snapshot.slides.map(
|
|
85
|
+
setSlides(snapshot.slides.map(chunkFQXZZBFJ_js.cloneSlide));
|
|
86
86
|
setTemplateElementsBySlideId(
|
|
87
|
-
|
|
87
|
+
chunkFQXZZBFJ_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
88
88
|
);
|
|
89
89
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
90
90
|
setSelectedElementIds([]);
|
|
@@ -337,189 +337,26 @@ var ANIMATION_PRESET_OPTIONS = [
|
|
|
337
337
|
{ value: "growShrink", label: "Grow/Shrink", i18nKey: "pptx.animation.preset.growShrink" },
|
|
338
338
|
{ value: "teeter", label: "Teeter", i18nKey: "pptx.animation.preset.teeter" }
|
|
339
339
|
];
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
{
|
|
361
|
-
type: "cylinder",
|
|
362
|
-
label: "Cylinder",
|
|
363
|
-
i18nKey: "pptx.shapePresets.cylinder",
|
|
364
|
-
icon: icon(lu.LuDatabase, "w-3.5 h-3.5")
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
type: "rtArrow",
|
|
368
|
-
label: "Right Arrow",
|
|
369
|
-
i18nKey: "pptx.shapePresets.rightArrow",
|
|
370
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5")
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
type: "leftArrow",
|
|
374
|
-
label: "Left Arrow",
|
|
375
|
-
i18nKey: "pptx.shapePresets.leftArrow",
|
|
376
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5 rotate-180")
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
type: "upArrow",
|
|
380
|
-
label: "Up Arrow",
|
|
381
|
-
i18nKey: "pptx.shapePresets.upArrow",
|
|
382
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5 -rotate-90")
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
type: "downArrow",
|
|
386
|
-
label: "Down Arrow",
|
|
387
|
-
i18nKey: "pptx.shapePresets.downArrow",
|
|
388
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5 rotate-90")
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
type: "triangle",
|
|
392
|
-
label: "Triangle",
|
|
393
|
-
i18nKey: "pptx.editorToolbar.shapeTriangle",
|
|
394
|
-
icon: icon(lu.LuTriangle, "w-3.5 h-3.5")
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
type: "rtTriangle",
|
|
398
|
-
label: "Right Triangle",
|
|
399
|
-
i18nKey: "pptx.shapePresets.rightTriangle",
|
|
400
|
-
icon: icon(lu.LuTriangle, "w-3.5 h-3.5 rotate-90")
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
type: "diamond",
|
|
404
|
-
label: "Diamond",
|
|
405
|
-
i18nKey: "pptx.shapePresets.diamond",
|
|
406
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5")
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
type: "parallelogram",
|
|
410
|
-
label: "Parallelogram",
|
|
411
|
-
i18nKey: "pptx.shapePresets.parallelogram",
|
|
412
|
-
icon: icon(lu.LuSquare, "w-3.5 h-3.5 -skew-x-12")
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
type: "trapezoid",
|
|
416
|
-
label: "Trapezoid",
|
|
417
|
-
i18nKey: "pptx.shapePresets.trapezoid",
|
|
418
|
-
icon: icon(lu.LuSquare, "w-3.5 h-3.5")
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
type: "pentagon",
|
|
422
|
-
label: "Pentagon",
|
|
423
|
-
i18nKey: "pptx.shapePresets.pentagon",
|
|
424
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5")
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
type: "hexagon",
|
|
428
|
-
label: "Hexagon",
|
|
429
|
-
i18nKey: "pptx.shapePresets.hexagon",
|
|
430
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5")
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
type: "octagon",
|
|
434
|
-
label: "Octagon",
|
|
435
|
-
i18nKey: "pptx.shapePresets.octagon",
|
|
436
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
type: "chevron",
|
|
440
|
-
label: "Chevron",
|
|
441
|
-
i18nKey: "pptx.shapePresets.chevron",
|
|
442
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5")
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
type: "star5",
|
|
446
|
-
label: "Star",
|
|
447
|
-
i18nKey: "pptx.shapePresets.star",
|
|
448
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5 rotate-45")
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
type: "star6",
|
|
452
|
-
label: "Star 6",
|
|
453
|
-
i18nKey: "pptx.shapePresets.star6",
|
|
454
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5")
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
type: "star8",
|
|
458
|
-
label: "Star 8",
|
|
459
|
-
i18nKey: "pptx.shapePresets.star8",
|
|
460
|
-
icon: icon(lu.LuDiamond, "w-3.5 h-3.5 rotate-45")
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
type: "plus",
|
|
464
|
-
label: "Plus",
|
|
465
|
-
i18nKey: "pptx.shapePresets.plus",
|
|
466
|
-
icon: icon(lu.LuPlus, "w-3.5 h-3.5")
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
type: "heart",
|
|
470
|
-
label: "Heart",
|
|
471
|
-
i18nKey: "pptx.shapePresets.heart",
|
|
472
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
type: "cloud",
|
|
476
|
-
label: "Cloud",
|
|
477
|
-
i18nKey: "pptx.shapePresets.cloud",
|
|
478
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
type: "sun",
|
|
482
|
-
label: "Sun",
|
|
483
|
-
i18nKey: "pptx.shapePresets.sun",
|
|
484
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
type: "moon",
|
|
488
|
-
label: "Moon",
|
|
489
|
-
i18nKey: "pptx.shapePresets.moon",
|
|
490
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
type: "pie",
|
|
494
|
-
label: "Pie",
|
|
495
|
-
i18nKey: "pptx.shapePresets.pie",
|
|
496
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
type: "plaque",
|
|
500
|
-
label: "Plaque",
|
|
501
|
-
i18nKey: "pptx.shapePresets.plaque",
|
|
502
|
-
icon: icon(lu.LuSquare, "w-3.5 h-3.5")
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
type: "teardrop",
|
|
506
|
-
label: "Teardrop",
|
|
507
|
-
i18nKey: "pptx.shapePresets.teardrop",
|
|
508
|
-
icon: icon(lu.LuCircle, "w-3.5 h-3.5")
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
type: "line",
|
|
512
|
-
label: "Line",
|
|
513
|
-
i18nKey: "pptx.shapePresets.line",
|
|
514
|
-
icon: icon(lu.LuMinus, "w-3.5 h-3.5")
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
type: "connector",
|
|
518
|
-
label: "Connector",
|
|
519
|
-
i18nKey: "pptx.elementType.connector",
|
|
520
|
-
icon: icon(lu.LuMoveRight, "w-3.5 h-3.5")
|
|
521
|
-
}
|
|
522
|
-
];
|
|
340
|
+
var GLYPH_COMPONENTS = {
|
|
341
|
+
square: lu.LuSquare,
|
|
342
|
+
circle: lu.LuCircle,
|
|
343
|
+
database: lu.LuDatabase,
|
|
344
|
+
diamond: lu.LuDiamond,
|
|
345
|
+
minus: lu.LuMinus,
|
|
346
|
+
moveRight: lu.LuMoveRight,
|
|
347
|
+
plus: lu.LuPlus,
|
|
348
|
+
triangle: lu.LuTriangle
|
|
349
|
+
};
|
|
350
|
+
var SHAPE_PRESETS = chunkFQXZZBFJ_js.SHAPE_PRESET_DEFS.map(
|
|
351
|
+
(def) => ({
|
|
352
|
+
type: def.type,
|
|
353
|
+
label: def.label,
|
|
354
|
+
i18nKey: def.i18nKey,
|
|
355
|
+
icon: React3__default.default.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
356
|
+
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
357
|
+
})
|
|
358
|
+
})
|
|
359
|
+
);
|
|
523
360
|
|
|
524
361
|
// src/viewer/hooks/useZoomViewport.ts
|
|
525
362
|
function useZoomViewport({
|
|
@@ -851,19 +688,19 @@ function useAnimationPlayback(input) {
|
|
|
851
688
|
if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
|
|
852
689
|
const el = slide.elements.find((e) => e.id === anim.targetId);
|
|
853
690
|
if (el && chunkOBLHB72P_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
|
|
854
|
-
segmentCounts.set(anim.targetId,
|
|
691
|
+
segmentCounts.set(anim.targetId, chunkFQXZZBFJ_js.countTextSegments(el.textSegments));
|
|
855
692
|
}
|
|
856
693
|
}
|
|
857
694
|
}
|
|
858
|
-
const expandedAnims = segmentCounts.size > 0 ?
|
|
859
|
-
const engine =
|
|
695
|
+
const expandedAnims = segmentCounts.size > 0 ? chunkFQXZZBFJ_js.expandTextBuildAnimations(nativeAnims, segmentCounts) : nativeAnims;
|
|
696
|
+
const engine = chunkFQXZZBFJ_js.TimelineEngine.fromAnimations(expandedAnims);
|
|
860
697
|
timelineEngineRef.current = engine;
|
|
861
698
|
setPresentationKeyframesCss(engine.getTimeline().keyframesCss);
|
|
862
699
|
setInteractiveTriggerShapeIds(engine.getInteractiveTriggerShapeIds());
|
|
863
700
|
setHoverTriggerShapeIds(engine.getHoverTriggerShapeIds());
|
|
864
701
|
const allIds = slide.elements.map((element) => element.id);
|
|
865
702
|
for (const anim of expandedAnims) {
|
|
866
|
-
if (anim.targetId && anim.targetId.includes(
|
|
703
|
+
if (anim.targetId && anim.targetId.includes(chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP)) {
|
|
867
704
|
allIds.push(anim.targetId);
|
|
868
705
|
}
|
|
869
706
|
}
|
|
@@ -1130,7 +967,7 @@ var AUDIENCE_HASH = "#pptx-audience";
|
|
|
1130
967
|
var PRESENTER_MSG_ORIGIN = "pptx-viewer-presenter";
|
|
1131
968
|
var AUDIENCE_NONCE_KEY = "nonce";
|
|
1132
969
|
function generateSessionId() {
|
|
1133
|
-
return
|
|
970
|
+
return chunkFQXZZBFJ_js.secureRandomUuid();
|
|
1134
971
|
}
|
|
1135
972
|
function parseAudienceNonce() {
|
|
1136
973
|
const hash = window.location.hash;
|
|
@@ -1598,7 +1435,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1598
1435
|
return;
|
|
1599
1436
|
}
|
|
1600
1437
|
if (action.url && !actionStr.includes("hlinksldjump")) {
|
|
1601
|
-
if (
|
|
1438
|
+
if (chunkFQXZZBFJ_js.isUrlSafe(action.url)) {
|
|
1602
1439
|
window.open(action.url, "_blank", "noopener,noreferrer");
|
|
1603
1440
|
}
|
|
1604
1441
|
}
|
|
@@ -1608,7 +1445,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1608
1445
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1609
1446
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1610
1447
|
const transition = incomingSlide?.transition;
|
|
1611
|
-
const durationMs = deps.playTransition ?
|
|
1448
|
+
const durationMs = deps.playTransition ? chunkFQXZZBFJ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1612
1449
|
deps.clearPresentationTimers();
|
|
1613
1450
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1614
1451
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -3310,21 +3147,16 @@ function useViewerState(input) {
|
|
|
3310
3147
|
return { ...core, ...ui };
|
|
3311
3148
|
}
|
|
3312
3149
|
|
|
3313
|
-
// src/viewer/utils/generate-id.ts
|
|
3314
|
-
function generateElementId() {
|
|
3315
|
-
return `el-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3316
|
-
}
|
|
3317
|
-
|
|
3318
3150
|
// src/viewer/utils/template-editing.ts
|
|
3319
3151
|
function partitionTemplateElements(slides) {
|
|
3320
3152
|
const templateElementsBySlideId = {};
|
|
3321
3153
|
const nextSlides = slides.map((slide) => {
|
|
3322
|
-
const template = slide.elements.filter((el) =>
|
|
3154
|
+
const template = slide.elements.filter((el) => chunkFQXZZBFJ_js.isTemplateElement(el));
|
|
3323
3155
|
if (template.length === 0) {
|
|
3324
3156
|
return slide;
|
|
3325
3157
|
}
|
|
3326
3158
|
templateElementsBySlideId[slide.id] = template;
|
|
3327
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
3159
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkFQXZZBFJ_js.isTemplateElement(el)) };
|
|
3328
3160
|
});
|
|
3329
3161
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
3330
3162
|
}
|
|
@@ -3337,15 +3169,6 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
3337
3169
|
return { ...slide, elements: [...template, ...slide.elements] };
|
|
3338
3170
|
});
|
|
3339
3171
|
}
|
|
3340
|
-
function makeCloneId(intoTemplate, sourceId) {
|
|
3341
|
-
if (!intoTemplate) {
|
|
3342
|
-
return generateElementId();
|
|
3343
|
-
}
|
|
3344
|
-
if (sourceId.startsWith("master-")) {
|
|
3345
|
-
return `master-${generateElementId()}`;
|
|
3346
|
-
}
|
|
3347
|
-
return `layout-${generateElementId()}`;
|
|
3348
|
-
}
|
|
3349
3172
|
|
|
3350
3173
|
// src/viewer/hooks/useLoadContent.ts
|
|
3351
3174
|
function useLoadContent({
|
|
@@ -3418,7 +3241,7 @@ function useLoadContent({
|
|
|
3418
3241
|
handlerRef.current = null;
|
|
3419
3242
|
const mediaElements = [];
|
|
3420
3243
|
for (const slide of parsed.slides) {
|
|
3421
|
-
|
|
3244
|
+
chunkFQXZZBFJ_js.collectMediaElements(slide.elements, mediaElements);
|
|
3422
3245
|
}
|
|
3423
3246
|
for (const url of mediaDataUrls.values()) {
|
|
3424
3247
|
if (url.startsWith("blob:")) {
|
|
@@ -3459,7 +3282,7 @@ function useLoadContent({
|
|
|
3459
3282
|
}
|
|
3460
3283
|
})
|
|
3461
3284
|
);
|
|
3462
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3285
|
+
const { paths: imagePaths, refs: imageRefs } = chunkFQXZZBFJ_js.collectImagePaths(parsed.slides);
|
|
3463
3286
|
let nextSlides = parsed.slides;
|
|
3464
3287
|
if (imagePaths.size > 0) {
|
|
3465
3288
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3548,7 +3371,7 @@ function useLoadContent({
|
|
|
3548
3371
|
setHasMacros(parsed.hasMacros === true);
|
|
3549
3372
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3550
3373
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3551
|
-
setGuides(
|
|
3374
|
+
setGuides(chunkFQXZZBFJ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3552
3375
|
setActiveSlideIndex(0);
|
|
3553
3376
|
clearSelection();
|
|
3554
3377
|
setIsDirty(false);
|
|
@@ -3632,7 +3455,7 @@ function useAutosave(input) {
|
|
|
3632
3455
|
isSavingRef.current = false;
|
|
3633
3456
|
return;
|
|
3634
3457
|
}
|
|
3635
|
-
await
|
|
3458
|
+
await chunkFQXZZBFJ_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
3636
3459
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3637
3460
|
} catch (err) {
|
|
3638
3461
|
setAutosaveStatus({
|
|
@@ -3670,7 +3493,7 @@ function useAutosave(input) {
|
|
|
3670
3493
|
|
|
3671
3494
|
// src/viewer/utils/animation-effects.ts
|
|
3672
3495
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
3673
|
-
return
|
|
3496
|
+
return chunkFQXZZBFJ_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
3674
3497
|
}
|
|
3675
3498
|
function cn(...inputs) {
|
|
3676
3499
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -3692,20 +3515,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3692
3515
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
3693
3516
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
3694
3517
|
const isRtl = element.textStyle?.rtl === true;
|
|
3695
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
3518
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkFQXZZBFJ_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkFQXZZBFJ_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
3696
3519
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3697
3520
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3698
3521
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3699
3522
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
3700
|
-
const writingMode =
|
|
3701
|
-
const textOrientation =
|
|
3702
|
-
const verticalDirection =
|
|
3523
|
+
const writingMode = chunkFQXZZBFJ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3524
|
+
const textOrientation = chunkFQXZZBFJ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3525
|
+
const verticalDirection = chunkFQXZZBFJ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3703
3526
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
3704
3527
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
3705
3528
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
3706
3529
|
return {
|
|
3707
3530
|
color: resolvedTextColor,
|
|
3708
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
3531
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkFQXZZBFJ_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
3709
3532
|
textAlign: (() => {
|
|
3710
3533
|
const a = element.textStyle?.align;
|
|
3711
3534
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -3721,7 +3544,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3721
3544
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
3722
3545
|
textDecorationStyle,
|
|
3723
3546
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
3724
|
-
lineHeight:
|
|
3547
|
+
lineHeight: chunkFQXZZBFJ_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
3725
3548
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
3726
3549
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
3727
3550
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -3734,7 +3557,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
3734
3557
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
3735
3558
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
3736
3559
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
3737
|
-
...
|
|
3560
|
+
...chunkFQXZZBFJ_js.computeAutoFitTextStyle({
|
|
3738
3561
|
textStyle: element.textStyle,
|
|
3739
3562
|
text: element.text ?? "",
|
|
3740
3563
|
width: element.width,
|
|
@@ -3771,9 +3594,9 @@ function getTextLayoutStyle(element) {
|
|
|
3771
3594
|
return {};
|
|
3772
3595
|
}
|
|
3773
3596
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
3774
|
-
const writingMode =
|
|
3775
|
-
const textOrientation =
|
|
3776
|
-
const verticalDirection =
|
|
3597
|
+
const writingMode = chunkFQXZZBFJ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
3598
|
+
const textOrientation = chunkFQXZZBFJ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
3599
|
+
const verticalDirection = chunkFQXZZBFJ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
3777
3600
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
3778
3601
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
3779
3602
|
const hasColumns = columnCount > 1;
|
|
@@ -3790,7 +3613,7 @@ function getTextLayoutStyle(element) {
|
|
|
3790
3613
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
3791
3614
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
3792
3615
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
3793
|
-
const kinsokuStyles =
|
|
3616
|
+
const kinsokuStyles = chunkFQXZZBFJ_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
3794
3617
|
if (hasColumns) {
|
|
3795
3618
|
return {
|
|
3796
3619
|
display: "block",
|
|
@@ -3833,10 +3656,10 @@ function getTextLayoutStyle(element) {
|
|
|
3833
3656
|
|
|
3834
3657
|
// src/viewer/utils/text-effects.tsx
|
|
3835
3658
|
function buildTextFillCss2(style) {
|
|
3836
|
-
return
|
|
3659
|
+
return chunkFQXZZBFJ_js.buildTextFillCss(style);
|
|
3837
3660
|
}
|
|
3838
3661
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
3839
|
-
return
|
|
3662
|
+
return chunkFQXZZBFJ_js.buildTextBody3DSceneStyle(textStyle);
|
|
3840
3663
|
}
|
|
3841
3664
|
|
|
3842
3665
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -4021,17 +3844,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
4021
3844
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
4022
3845
|
return renderedSegments;
|
|
4023
3846
|
}
|
|
4024
|
-
const paraKey = `${elementId}${
|
|
3847
|
+
const paraKey = `${elementId}${chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
4025
3848
|
const paraState = subElementAnimStates.get(paraKey);
|
|
4026
3849
|
if (paraState) {
|
|
4027
3850
|
const style = buildAnimStyle(paraState);
|
|
4028
3851
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
4029
3852
|
}
|
|
4030
|
-
const firstWordKey = `${elementId}${
|
|
3853
|
+
const firstWordKey = `${elementId}${chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
4031
3854
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
4032
3855
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4033
3856
|
}
|
|
4034
|
-
const firstCharKey = `${elementId}${
|
|
3857
|
+
const firstCharKey = `${elementId}${chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
4035
3858
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
4036
3859
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
4037
3860
|
}
|
|
@@ -4052,7 +3875,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
4052
3875
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
4053
3876
|
continue;
|
|
4054
3877
|
}
|
|
4055
|
-
const key = `${elementId}${
|
|
3878
|
+
const key = `${elementId}${chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
4056
3879
|
const state = states.get(key);
|
|
4057
3880
|
const style = buildAnimStyle(state);
|
|
4058
3881
|
nodes.push(
|
|
@@ -4066,7 +3889,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
4066
3889
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
4067
3890
|
const nodes = [];
|
|
4068
3891
|
for (let i = 0; i < fullText.length; i++) {
|
|
4069
|
-
const key = `${elementId}${
|
|
3892
|
+
const key = `${elementId}${chunkFQXZZBFJ_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
4070
3893
|
const state = states.get(key);
|
|
4071
3894
|
const style = buildAnimStyle(state);
|
|
4072
3895
|
nodes.push(
|
|
@@ -4079,10 +3902,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4079
3902
|
if (!needsScriptFonts || !text) {
|
|
4080
3903
|
return text;
|
|
4081
3904
|
}
|
|
4082
|
-
const runs =
|
|
3905
|
+
const runs = chunkFQXZZBFJ_js.segmentByScript(text);
|
|
4083
3906
|
if (runs.length <= 1) {
|
|
4084
3907
|
if (runs.length === 1) {
|
|
4085
|
-
const font =
|
|
3908
|
+
const font = chunkFQXZZBFJ_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
4086
3909
|
if (font && font !== baseFontFamily) {
|
|
4087
3910
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
4088
3911
|
}
|
|
@@ -4090,7 +3913,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
4090
3913
|
return text;
|
|
4091
3914
|
}
|
|
4092
3915
|
return runs.map((run, i) => {
|
|
4093
|
-
const font =
|
|
3916
|
+
const font = chunkFQXZZBFJ_js.resolveFontForScript(run.script, scriptFonts);
|
|
4094
3917
|
if (!font || font === baseFontFamily) {
|
|
4095
3918
|
return /* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
4096
3919
|
}
|
|
@@ -4164,8 +3987,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
4164
3987
|
);
|
|
4165
3988
|
}
|
|
4166
3989
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
4167
|
-
const mathml =
|
|
4168
|
-
const safeMathml = mathml ?
|
|
3990
|
+
const mathml = chunkFQXZZBFJ_js.convertOmmlToMathMl(equationXml);
|
|
3991
|
+
const safeMathml = mathml ? chunkFQXZZBFJ_js.sanitizeMathMl(mathml) : "";
|
|
4169
3992
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4170
3993
|
"span",
|
|
4171
3994
|
{
|
|
@@ -4175,7 +3998,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
4175
3998
|
},
|
|
4176
3999
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
4177
4000
|
}
|
|
4178
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
4001
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkWGLJ32FW_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
4179
4002
|
if (equationNumber) {
|
|
4180
4003
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4181
4004
|
"span",
|
|
@@ -4228,7 +4051,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4228
4051
|
color: bulletInfo.color || void 0,
|
|
4229
4052
|
fontFamily: bulletInfo.fontFamily || void 0
|
|
4230
4053
|
},
|
|
4231
|
-
"aria-label":
|
|
4054
|
+
"aria-label": chunkWGLJ32FW_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4232
4055
|
children: "\u2022 "
|
|
4233
4056
|
},
|
|
4234
4057
|
`${elementId}-seg-${segmentIndex}-bullet-fallback`
|
|
@@ -4238,7 +4061,7 @@ function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize)
|
|
|
4238
4061
|
"img",
|
|
4239
4062
|
{
|
|
4240
4063
|
src: bulletInfo.imageDataUrl,
|
|
4241
|
-
alt:
|
|
4064
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.textSegment.bulletAria"],
|
|
4242
4065
|
style: {
|
|
4243
4066
|
width: bulletSize,
|
|
4244
4067
|
height: bulletSize,
|
|
@@ -4261,7 +4084,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4261
4084
|
);
|
|
4262
4085
|
}
|
|
4263
4086
|
const segmentStyle = segment.style || {};
|
|
4264
|
-
const textValue =
|
|
4087
|
+
const textValue = chunkFQXZZBFJ_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
4265
4088
|
const lines = textValue.split("\n");
|
|
4266
4089
|
const textDecorationTokens = [];
|
|
4267
4090
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -4271,8 +4094,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4271
4094
|
textDecorationTokens.push("line-through");
|
|
4272
4095
|
}
|
|
4273
4096
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
4274
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
4275
|
-
const underlineDecoration =
|
|
4097
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
4098
|
+
const underlineDecoration = chunkFQXZZBFJ_js.resolveUnderlineDecorationStyle(
|
|
4276
4099
|
Boolean(isDoubleStrike),
|
|
4277
4100
|
segmentStyle.underlineStyle
|
|
4278
4101
|
);
|
|
@@ -4292,7 +4115,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4292
4115
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
4293
4116
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
4294
4117
|
};
|
|
4295
|
-
const needsScriptFonts =
|
|
4118
|
+
const needsScriptFonts = chunkFQXZZBFJ_js.hasDistinctScriptFonts(scriptFonts);
|
|
4296
4119
|
const spanStyle = {
|
|
4297
4120
|
color: resolvedSegmentColor,
|
|
4298
4121
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -4306,15 +4129,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4306
4129
|
verticalAlign: baselineShift,
|
|
4307
4130
|
letterSpacing,
|
|
4308
4131
|
fontKerning,
|
|
4309
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
4132
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
4310
4133
|
...textFillStyles,
|
|
4311
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
4312
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
4134
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
4135
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkFQXZZBFJ_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
4313
4136
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
4314
|
-
textShadow:
|
|
4315
|
-
filter:
|
|
4316
|
-
opacity:
|
|
4317
|
-
WebkitBoxReflect:
|
|
4137
|
+
textShadow: chunkFQXZZBFJ_js.buildTextShadowCss(segmentStyle),
|
|
4138
|
+
filter: chunkFQXZZBFJ_js.buildTextRunFilterChain(segmentStyle),
|
|
4139
|
+
opacity: chunkFQXZZBFJ_js.getTextAlphaOpacity(segmentStyle),
|
|
4140
|
+
WebkitBoxReflect: chunkFQXZZBFJ_js.buildTextReflectionCss(segmentStyle)
|
|
4318
4141
|
};
|
|
4319
4142
|
const runRtl = segmentStyle.rtl;
|
|
4320
4143
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -4334,7 +4157,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4334
4157
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
4335
4158
|
}
|
|
4336
4159
|
if (bulletInfo.color) {
|
|
4337
|
-
spanStyle.color =
|
|
4160
|
+
spanStyle.color = chunkFQXZZBFJ_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
4338
4161
|
}
|
|
4339
4162
|
}
|
|
4340
4163
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -4366,7 +4189,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
4366
4189
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
4367
4190
|
};
|
|
4368
4191
|
if (segment.rubyStyle?.color) {
|
|
4369
|
-
rubyStyle.color =
|
|
4192
|
+
rubyStyle.color = chunkFQXZZBFJ_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
4370
4193
|
}
|
|
4371
4194
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
4372
4195
|
baseContent,
|
|
@@ -4473,14 +4296,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
4473
4296
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
4474
4297
|
});
|
|
4475
4298
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
4476
|
-
const paraRtl =
|
|
4299
|
+
const paraRtl = chunkFQXZZBFJ_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
4477
4300
|
const isRtlParagraph = paraRtl === true;
|
|
4478
|
-
const paraAlign =
|
|
4479
|
-
const cssTextAlign =
|
|
4301
|
+
const paraAlign = chunkFQXZZBFJ_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
4302
|
+
const cssTextAlign = chunkFQXZZBFJ_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
4480
4303
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
4481
4304
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
4482
4305
|
const paraTextIndent = rawTextIndent;
|
|
4483
|
-
const paraKinsokuStyle =
|
|
4306
|
+
const paraKinsokuStyle = chunkFQXZZBFJ_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
4484
4307
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
4485
4308
|
const paraStyle = {
|
|
4486
4309
|
...paraKinsokuStyle
|
|
@@ -4727,8 +4550,8 @@ function buildLineShadowCss(element) {
|
|
|
4727
4550
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
4728
4551
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
4729
4552
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
4730
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
4731
|
-
|
|
4553
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkFQXZZBFJ_js.colorWithOpacity(
|
|
4554
|
+
chunkFQXZZBFJ_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
4732
4555
|
opacity
|
|
4733
4556
|
)}`;
|
|
4734
4557
|
}
|
|
@@ -4742,7 +4565,7 @@ function buildLineGlowFilter(element) {
|
|
|
4742
4565
|
}
|
|
4743
4566
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
4744
4567
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
4745
|
-
const glowCol =
|
|
4568
|
+
const glowCol = chunkFQXZZBFJ_js.colorWithOpacity(chunkFQXZZBFJ_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
4746
4569
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
4747
4570
|
}
|
|
4748
4571
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -4951,7 +4774,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
4951
4774
|
|
|
4952
4775
|
// src/viewer/utils/shape-visual-3d.ts
|
|
4953
4776
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
4954
|
-
return
|
|
4777
|
+
return chunkFQXZZBFJ_js.build3DExtrusionData(
|
|
4955
4778
|
shape3d,
|
|
4956
4779
|
scene3d,
|
|
4957
4780
|
fillColor,
|
|
@@ -4960,7 +4783,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
4960
4783
|
);
|
|
4961
4784
|
}
|
|
4962
4785
|
function apply3dEffects2(base, scene3d, shape3d) {
|
|
4963
|
-
|
|
4786
|
+
chunkFQXZZBFJ_js.apply3dEffects(base, scene3d, shape3d);
|
|
4964
4787
|
}
|
|
4965
4788
|
|
|
4966
4789
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -4969,18 +4792,18 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4969
4792
|
return {};
|
|
4970
4793
|
}
|
|
4971
4794
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
4972
|
-
const clipPath =
|
|
4795
|
+
const clipPath = chunkFQXZZBFJ_js.getResolvedShapeClipPath(element);
|
|
4973
4796
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
4974
4797
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
4975
|
-
const strokeDash =
|
|
4976
|
-
const fillGradient =
|
|
4977
|
-
const shadowCss =
|
|
4978
|
-
const innerShadowCss =
|
|
4979
|
-
const resolvedFillColor =
|
|
4980
|
-
const resolvedStrokeColor =
|
|
4798
|
+
const strokeDash = chunkFQXZZBFJ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
4799
|
+
const fillGradient = chunkFQXZZBFJ_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
4800
|
+
const shadowCss = chunkFQXZZBFJ_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
4801
|
+
const innerShadowCss = chunkFQXZZBFJ_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
4802
|
+
const resolvedFillColor = chunkFQXZZBFJ_js.colorWithOpacity(fillColor, fillOpacity);
|
|
4803
|
+
const resolvedStrokeColor = chunkFQXZZBFJ_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
4981
4804
|
const ss = element.shapeStyle;
|
|
4982
4805
|
const combinedShadowParts = [];
|
|
4983
|
-
const multiLayerShadow =
|
|
4806
|
+
const multiLayerShadow = chunkFQXZZBFJ_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
4984
4807
|
if (multiLayerShadow) {
|
|
4985
4808
|
combinedShadowParts.push(multiLayerShadow);
|
|
4986
4809
|
} else if (shadowCss) {
|
|
@@ -4989,7 +4812,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4989
4812
|
if (innerShadowCss) {
|
|
4990
4813
|
combinedShadowParts.push(innerShadowCss);
|
|
4991
4814
|
}
|
|
4992
|
-
const glowBoxShadow =
|
|
4815
|
+
const glowBoxShadow = chunkFQXZZBFJ_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
4993
4816
|
if (glowBoxShadow) {
|
|
4994
4817
|
combinedShadowParts.push(glowBoxShadow);
|
|
4995
4818
|
}
|
|
@@ -4997,7 +4820,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
4997
4820
|
if (lineShadow) {
|
|
4998
4821
|
combinedShadowParts.push(lineShadow);
|
|
4999
4822
|
}
|
|
5000
|
-
const compoundLineShadow =
|
|
4823
|
+
const compoundLineShadow = chunkFQXZZBFJ_js.getCompoundLineBoxShadow(
|
|
5001
4824
|
element.shapeStyle?.compoundLine,
|
|
5002
4825
|
strokeWidth,
|
|
5003
4826
|
resolvedStrokeColor
|
|
@@ -5010,7 +4833,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5010
4833
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
5011
4834
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
5012
4835
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
5013
|
-
const glowCol =
|
|
4836
|
+
const glowCol = chunkFQXZZBFJ_js.colorWithOpacity(chunkFQXZZBFJ_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
5014
4837
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
5015
4838
|
}
|
|
5016
4839
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
@@ -5023,12 +4846,12 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5023
4846
|
if (lineGlowCss) {
|
|
5024
4847
|
filterParts.push(lineGlowCss);
|
|
5025
4848
|
}
|
|
5026
|
-
const dagFilter =
|
|
4849
|
+
const dagFilter = chunkFQXZZBFJ_js.getEffectDagFilter(ss, element.id);
|
|
5027
4850
|
if (dagFilter) {
|
|
5028
4851
|
filterParts.push(dagFilter);
|
|
5029
4852
|
}
|
|
5030
4853
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : void 0;
|
|
5031
|
-
const patternFill =
|
|
4854
|
+
const patternFill = chunkFQXZZBFJ_js.buildPatternFillCss(element.shapeStyle);
|
|
5032
4855
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
5033
4856
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
5034
4857
|
let reflectCss;
|
|
@@ -5040,7 +4863,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5040
4863
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
5041
4864
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
5042
4865
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
5043
|
-
reflectCss =
|
|
4866
|
+
reflectCss = chunkFQXZZBFJ_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
5044
4867
|
}
|
|
5045
4868
|
}
|
|
5046
4869
|
const base = {
|
|
@@ -5054,9 +4877,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5054
4877
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
5055
4878
|
opacity: typeof ss?.dagAlphaModFix === "number" ? Math.max(0, Math.min(1, ss.dagAlphaModFix / 100)) : void 0,
|
|
5056
4879
|
mixBlendMode: mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
5057
|
-
borderWidth: strokeWidth > 0 ?
|
|
4880
|
+
borderWidth: strokeWidth > 0 ? chunkFQXZZBFJ_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
5058
4881
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
5059
|
-
borderStyle: strokeWidth > 0 ?
|
|
4882
|
+
borderStyle: strokeWidth > 0 ? chunkFQXZZBFJ_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
5060
4883
|
strokeLinejoin: lineJoinCss,
|
|
5061
4884
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : void 0
|
|
5062
4885
|
};
|
|
@@ -5097,7 +4920,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5097
4920
|
borderWidth: 0,
|
|
5098
4921
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
5099
4922
|
borderTopColor: resolvedStrokeColor,
|
|
5100
|
-
borderTopStyle:
|
|
4923
|
+
borderTopStyle: chunkFQXZZBFJ_js.getCssBorderDashStyle(strokeDash)
|
|
5101
4924
|
};
|
|
5102
4925
|
}
|
|
5103
4926
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -5111,13 +4934,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
5111
4934
|
function getConnectorAdjustment(element, key, fallback) {
|
|
5112
4935
|
const direct = element.shapeAdjustments?.[key];
|
|
5113
4936
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
5114
|
-
return
|
|
4937
|
+
return chunkFQXZZBFJ_js.clampUnitInterval(direct / 1e5);
|
|
5115
4938
|
}
|
|
5116
4939
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
5117
4940
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
5118
|
-
return
|
|
4941
|
+
return chunkFQXZZBFJ_js.clampUnitInterval(fallbackKey / 1e5);
|
|
5119
4942
|
}
|
|
5120
|
-
return
|
|
4943
|
+
return chunkFQXZZBFJ_js.clampUnitInterval(fallback);
|
|
5121
4944
|
}
|
|
5122
4945
|
function getConnectorPathGeometry(element) {
|
|
5123
4946
|
const width = Math.max(element.width, 1);
|
|
@@ -5248,10 +5071,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5248
5071
|
return null;
|
|
5249
5072
|
}
|
|
5250
5073
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
5251
|
-
const fillPaint =
|
|
5252
|
-
const strokePaint =
|
|
5253
|
-
const dashType =
|
|
5254
|
-
const dashArray =
|
|
5074
|
+
const fillPaint = chunkFQXZZBFJ_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
5075
|
+
const strokePaint = chunkFQXZZBFJ_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
5076
|
+
const dashType = chunkFQXZZBFJ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
5077
|
+
const dashArray = chunkFQXZZBFJ_js.getSvgStrokeDasharray(
|
|
5255
5078
|
dashType,
|
|
5256
5079
|
Math.max(strokeWidth, 1),
|
|
5257
5080
|
element.shapeStyle?.customDashSegments
|
|
@@ -5410,8 +5233,8 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
5410
5233
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
5411
5234
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
5412
5235
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
5413
|
-
const offsets =
|
|
5414
|
-
const widths =
|
|
5236
|
+
const offsets = chunkFQXZZBFJ_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
5237
|
+
const widths = chunkFQXZZBFJ_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
5415
5238
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5416
5239
|
"svg",
|
|
5417
5240
|
{
|
|
@@ -5474,7 +5297,7 @@ function getImageMaskStyle(element) {
|
|
|
5474
5297
|
}
|
|
5475
5298
|
const normalized = shapeType.toLowerCase();
|
|
5476
5299
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
5477
|
-
const radiusPx =
|
|
5300
|
+
const radiusPx = chunkFQXZZBFJ_js.getRoundRectRadiusPx(element);
|
|
5478
5301
|
if (radiusPx <= 0.01) {
|
|
5479
5302
|
return void 0;
|
|
5480
5303
|
}
|
|
@@ -5486,7 +5309,7 @@ function getImageMaskStyle(element) {
|
|
|
5486
5309
|
if (normalized === "can" || normalized === "cylinder") {
|
|
5487
5310
|
return { borderRadius: "48% / 12%" };
|
|
5488
5311
|
}
|
|
5489
|
-
const clipPath =
|
|
5312
|
+
const clipPath = chunkFQXZZBFJ_js.getResolvedShapeClipPath(element);
|
|
5490
5313
|
if (!clipPath) {
|
|
5491
5314
|
return void 0;
|
|
5492
5315
|
}
|
|
@@ -5502,10 +5325,10 @@ function getImageRenderStyle(element) {
|
|
|
5502
5325
|
objectFit: "cover"
|
|
5503
5326
|
};
|
|
5504
5327
|
}
|
|
5505
|
-
const cropLeft =
|
|
5506
|
-
const cropTop =
|
|
5507
|
-
const cropRight =
|
|
5508
|
-
const cropBottom =
|
|
5328
|
+
const cropLeft = chunkFQXZZBFJ_js.clampCropValue(element.cropLeft);
|
|
5329
|
+
const cropTop = chunkFQXZZBFJ_js.clampCropValue(element.cropTop);
|
|
5330
|
+
const cropRight = chunkFQXZZBFJ_js.clampCropValue(element.cropRight);
|
|
5331
|
+
const cropBottom = chunkFQXZZBFJ_js.clampCropValue(element.cropBottom);
|
|
5509
5332
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
5510
5333
|
if (!hasCrop) {
|
|
5511
5334
|
return {
|
|
@@ -5517,10 +5340,10 @@ function getImageRenderStyle(element) {
|
|
|
5517
5340
|
}
|
|
5518
5341
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
5519
5342
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
5520
|
-
const normalizedLeft =
|
|
5521
|
-
const normalizedRight =
|
|
5522
|
-
const normalizedTop =
|
|
5523
|
-
const normalizedBottom =
|
|
5343
|
+
const normalizedLeft = chunkFQXZZBFJ_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
5344
|
+
const normalizedRight = chunkFQXZZBFJ_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
5345
|
+
const normalizedTop = chunkFQXZZBFJ_js.clampCropValue(cropTop * safeVerticalScale);
|
|
5346
|
+
const normalizedBottom = chunkFQXZZBFJ_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
5524
5347
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
5525
5348
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
5526
5349
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -5660,9 +5483,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
5660
5483
|
}
|
|
5661
5484
|
const parsed = stops.map((gs) => {
|
|
5662
5485
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
5663
|
-
const color =
|
|
5664
|
-
const opacity =
|
|
5665
|
-
return { pos, color:
|
|
5486
|
+
const color = chunkFQXZZBFJ_js.parseDrawingColor(gs) ?? "#888888";
|
|
5487
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(gs);
|
|
5488
|
+
return { pos, color: chunkFQXZZBFJ_js.colorWithOpacity(color, opacity) };
|
|
5666
5489
|
}).sort((a, b) => a.pos - b.pos);
|
|
5667
5490
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
5668
5491
|
const lin = gradFill["a:lin"];
|
|
@@ -5703,8 +5526,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
5703
5526
|
if (!pattFill) {
|
|
5704
5527
|
return void 0;
|
|
5705
5528
|
}
|
|
5706
|
-
const fgColor =
|
|
5707
|
-
const bgColor =
|
|
5529
|
+
const fgColor = chunkFQXZZBFJ_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
5530
|
+
const bgColor = chunkFQXZZBFJ_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
5708
5531
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
5709
5532
|
switch (preset) {
|
|
5710
5533
|
case "ltHorz":
|
|
@@ -5815,11 +5638,11 @@ function parseCellBorders(cellProperties) {
|
|
|
5815
5638
|
const prstDash = ln["a:prstDash"];
|
|
5816
5639
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
5817
5640
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
5818
|
-
const color =
|
|
5641
|
+
const color = chunkFQXZZBFJ_js.parseDrawingColor(ln["a:solidFill"]);
|
|
5819
5642
|
if (color) {
|
|
5820
|
-
const opacity =
|
|
5643
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
5821
5644
|
const key = `${edge.prefix}`;
|
|
5822
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
5645
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkFQXZZBFJ_js.colorWithOpacity(color, opacity)}`;
|
|
5823
5646
|
}
|
|
5824
5647
|
}
|
|
5825
5648
|
return borderStyle;
|
|
@@ -5832,7 +5655,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5832
5655
|
const textShadowParts = [];
|
|
5833
5656
|
const outerShdw = effectLst["a:outerShdw"];
|
|
5834
5657
|
if (outerShdw) {
|
|
5835
|
-
const shdwColor =
|
|
5658
|
+
const shdwColor = chunkFQXZZBFJ_js.parseDrawingColor(outerShdw);
|
|
5836
5659
|
if (shdwColor) {
|
|
5837
5660
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
5838
5661
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -5850,7 +5673,7 @@ function parseCellTextEffects(runProps) {
|
|
|
5850
5673
|
}
|
|
5851
5674
|
const glow = effectLst["a:glow"];
|
|
5852
5675
|
if (glow) {
|
|
5853
|
-
const glowColor =
|
|
5676
|
+
const glowColor = chunkFQXZZBFJ_js.parseDrawingColor(glow);
|
|
5854
5677
|
if (glowColor) {
|
|
5855
5678
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
5856
5679
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -5929,10 +5752,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5929
5752
|
if (runProps?.["@_u"] !== void 0) {
|
|
5930
5753
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
5931
5754
|
}
|
|
5932
|
-
const runColor =
|
|
5755
|
+
const runColor = chunkFQXZZBFJ_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkFQXZZBFJ_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
5933
5756
|
if (runColor) {
|
|
5934
|
-
const opacity =
|
|
5935
|
-
cellStyle.color =
|
|
5757
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
5758
|
+
cellStyle.color = chunkFQXZZBFJ_js.colorWithOpacity(runColor, opacity);
|
|
5936
5759
|
}
|
|
5937
5760
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
5938
5761
|
if (fontFamily) {
|
|
@@ -5942,15 +5765,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5942
5765
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
5943
5766
|
}
|
|
5944
5767
|
const cellProperties = cellXml["a:tcPr"];
|
|
5945
|
-
const cellFill =
|
|
5768
|
+
const cellFill = chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5946
5769
|
cellProperties?.["a:solidFill"],
|
|
5947
5770
|
schemeColorOverrides
|
|
5948
5771
|
);
|
|
5949
5772
|
if (cellFill) {
|
|
5950
|
-
const opacity =
|
|
5773
|
+
const opacity = chunkFQXZZBFJ_js.parseDrawingColorOpacity(
|
|
5951
5774
|
cellProperties?.["a:solidFill"]
|
|
5952
5775
|
);
|
|
5953
|
-
cellStyle.backgroundColor =
|
|
5776
|
+
cellStyle.backgroundColor = chunkFQXZZBFJ_js.colorWithOpacity(cellFill, opacity);
|
|
5954
5777
|
} else {
|
|
5955
5778
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
5956
5779
|
if (gradCss) {
|
|
@@ -5965,16 +5788,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
5965
5788
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
5966
5789
|
Object.assign(cellStyle, edgeBorders);
|
|
5967
5790
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
5968
|
-
const borderColor =
|
|
5791
|
+
const borderColor = chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5969
5792
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
5970
5793
|
schemeColorOverrides
|
|
5971
|
-
) ||
|
|
5794
|
+
) || chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5972
5795
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
5973
5796
|
schemeColorOverrides
|
|
5974
|
-
) ||
|
|
5797
|
+
) || chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5975
5798
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
5976
5799
|
schemeColorOverrides
|
|
5977
|
-
) ||
|
|
5800
|
+
) || chunkFQXZZBFJ_js.parseDrawingColor(
|
|
5978
5801
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
5979
5802
|
schemeColorOverrides
|
|
5980
5803
|
);
|
|
@@ -6053,10 +5876,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
6053
5876
|
}
|
|
6054
5877
|
let color = base;
|
|
6055
5878
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
6056
|
-
color =
|
|
5879
|
+
color = chunkFQXZZBFJ_js.tintColor2(color, fill.tint / 1e5);
|
|
6057
5880
|
}
|
|
6058
5881
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
6059
|
-
color =
|
|
5882
|
+
color = chunkFQXZZBFJ_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
6060
5883
|
}
|
|
6061
5884
|
return color;
|
|
6062
5885
|
}
|
|
@@ -6078,10 +5901,10 @@ function applyTableStyleText(text, colorScheme, style) {
|
|
|
6078
5901
|
if (base) {
|
|
6079
5902
|
let color = base;
|
|
6080
5903
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
6081
|
-
color =
|
|
5904
|
+
color = chunkFQXZZBFJ_js.tintColor2(color, text.fontTint / 1e5);
|
|
6082
5905
|
}
|
|
6083
5906
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
6084
|
-
color =
|
|
5907
|
+
color = chunkFQXZZBFJ_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
6085
5908
|
}
|
|
6086
5909
|
style.color = color;
|
|
6087
5910
|
applied = true;
|
|
@@ -6363,9 +6186,9 @@ function cellStyleToCss(style) {
|
|
|
6363
6186
|
if (style.gradientFillCss) {
|
|
6364
6187
|
css.background = style.gradientFillCss;
|
|
6365
6188
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
6366
|
-
const fg =
|
|
6367
|
-
const bg =
|
|
6368
|
-
const svgPattern =
|
|
6189
|
+
const fg = chunkFQXZZBFJ_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
6190
|
+
const bg = chunkFQXZZBFJ_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
6191
|
+
const svgPattern = chunkFQXZZBFJ_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
6369
6192
|
if (svgPattern) {
|
|
6370
6193
|
const encoded = encodeURIComponent(svgPattern);
|
|
6371
6194
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -6434,7 +6257,7 @@ function cellStyleToCss(style) {
|
|
|
6434
6257
|
if (edge.width || edge.color) {
|
|
6435
6258
|
const w = edge.width ?? 1;
|
|
6436
6259
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
6437
|
-
const s =
|
|
6260
|
+
const s = chunkFQXZZBFJ_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
6438
6261
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
6439
6262
|
}
|
|
6440
6263
|
}
|
|
@@ -6476,7 +6299,7 @@ function TableResizeOverlay({
|
|
|
6476
6299
|
const containerRef = React3.useRef(null);
|
|
6477
6300
|
const [rowBounds, setRowBounds] = React3.useState([]);
|
|
6478
6301
|
const dragRef = React3.useRef(null);
|
|
6479
|
-
const colBoundaries = React3.useMemo(() =>
|
|
6302
|
+
const colBoundaries = React3.useMemo(() => chunkFQXZZBFJ_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
6480
6303
|
const measureRows = React3.useCallback(() => {
|
|
6481
6304
|
const container = containerRef.current;
|
|
6482
6305
|
if (!container) {
|
|
@@ -6523,11 +6346,11 @@ function TableResizeOverlay({
|
|
|
6523
6346
|
const rect = containerRef.current.getBoundingClientRect();
|
|
6524
6347
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
6525
6348
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
6526
|
-
onResizeColumns(
|
|
6349
|
+
onResizeColumns(chunkFQXZZBFJ_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
6527
6350
|
} else if (drag.type === "row" && onResizeRow) {
|
|
6528
6351
|
const deltaY = e.clientY - drag.startPos;
|
|
6529
|
-
const newHeight =
|
|
6530
|
-
drag.initialRowHeight ??
|
|
6352
|
+
const newHeight = chunkFQXZZBFJ_js.computeResizedRowHeight(
|
|
6353
|
+
drag.initialRowHeight ?? chunkFQXZZBFJ_js.DEFAULT_ROW_HEIGHT,
|
|
6531
6354
|
deltaY
|
|
6532
6355
|
);
|
|
6533
6356
|
onResizeRow(drag.index, newHeight);
|
|
@@ -6565,7 +6388,7 @@ function TableResizeOverlay({
|
|
|
6565
6388
|
e.stopPropagation();
|
|
6566
6389
|
const table = containerRef.current?.querySelector("table");
|
|
6567
6390
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
6568
|
-
const actualHeight = tr?.offsetHeight ??
|
|
6391
|
+
const actualHeight = tr?.offsetHeight ?? chunkFQXZZBFJ_js.DEFAULT_ROW_HEIGHT;
|
|
6569
6392
|
document.body.style.cursor = "row-resize";
|
|
6570
6393
|
document.body.style.userSelect = "none";
|
|
6571
6394
|
dragRef.current = {
|
|
@@ -6611,7 +6434,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6611
6434
|
}
|
|
6612
6435
|
const first = selectedCell.selectedCells[0];
|
|
6613
6436
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6614
|
-
return
|
|
6437
|
+
return chunkFQXZZBFJ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
6615
6438
|
})();
|
|
6616
6439
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6617
6440
|
TableResizeOverlay,
|
|
@@ -6644,7 +6467,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6644
6467
|
return null;
|
|
6645
6468
|
}
|
|
6646
6469
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
6647
|
-
const isInMultiSelection =
|
|
6470
|
+
const isInMultiSelection = chunkFQXZZBFJ_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
6648
6471
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
6649
6472
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6650
6473
|
"td",
|
|
@@ -6667,7 +6490,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6667
6490
|
}
|
|
6668
6491
|
event.stopPropagation();
|
|
6669
6492
|
if (event.shiftKey && selectedCell) {
|
|
6670
|
-
const rect =
|
|
6493
|
+
const rect = chunkFQXZZBFJ_js.computeSelectionRect(
|
|
6671
6494
|
selectedCell.rowIndex,
|
|
6672
6495
|
selectedCell.columnIndex,
|
|
6673
6496
|
rowIndex,
|
|
@@ -6677,7 +6500,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
6677
6500
|
options?.onSelectCell?.({
|
|
6678
6501
|
rowIndex: selectedCell.rowIndex,
|
|
6679
6502
|
columnIndex: selectedCell.columnIndex,
|
|
6680
|
-
selectedCells:
|
|
6503
|
+
selectedCells: chunkFQXZZBFJ_js.rectToCells(rect)
|
|
6681
6504
|
});
|
|
6682
6505
|
} else {
|
|
6683
6506
|
options?.onSelectCell?.({
|
|
@@ -6736,7 +6559,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6736
6559
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
6737
6560
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
6738
6561
|
}
|
|
6739
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6562
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.table.title"] });
|
|
6740
6563
|
}
|
|
6741
6564
|
const selectedCell = options?.selectedCell || null;
|
|
6742
6565
|
const isEditable2 = Boolean(options?.editable);
|
|
@@ -6751,7 +6574,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6751
6574
|
}
|
|
6752
6575
|
const first = selectedCell.selectedCells[0];
|
|
6753
6576
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
6754
|
-
return
|
|
6577
|
+
return chunkFQXZZBFJ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
6755
6578
|
})();
|
|
6756
6579
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
6757
6580
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6816,7 +6639,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6816
6639
|
"border px-1 py-0.5 align-top",
|
|
6817
6640
|
isEditable2 && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
6818
6641
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
6819
|
-
|
|
6642
|
+
chunkFQXZZBFJ_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
6820
6643
|
),
|
|
6821
6644
|
colSpan,
|
|
6822
6645
|
rowSpan: rSpan,
|
|
@@ -6827,7 +6650,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6827
6650
|
}
|
|
6828
6651
|
event.stopPropagation();
|
|
6829
6652
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
6830
|
-
const rect =
|
|
6653
|
+
const rect = chunkFQXZZBFJ_js.computeSelectionRect(
|
|
6831
6654
|
selectedCell.rowIndex,
|
|
6832
6655
|
selectedCell.columnIndex,
|
|
6833
6656
|
rowIndex,
|
|
@@ -6837,7 +6660,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6837
6660
|
options?.onSelectCell?.({
|
|
6838
6661
|
rowIndex: selectedCell.rowIndex,
|
|
6839
6662
|
columnIndex: selectedCell.columnIndex,
|
|
6840
|
-
selectedCells:
|
|
6663
|
+
selectedCells: chunkFQXZZBFJ_js.rectToCells(rect)
|
|
6841
6664
|
});
|
|
6842
6665
|
} else {
|
|
6843
6666
|
options?.onSelectCell?.({
|
|
@@ -6889,24 +6712,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
6889
6712
|
}
|
|
6890
6713
|
var LEGEND_ITEM_WIDTH = 80;
|
|
6891
6714
|
function partAttrs(part) {
|
|
6892
|
-
return part ?
|
|
6715
|
+
return part ? chunkFQXZZBFJ_js.chartPartToAttrs(part) : void 0;
|
|
6893
6716
|
}
|
|
6894
6717
|
function resolveReactPalette(chartData) {
|
|
6895
6718
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
6896
6719
|
return chartData.colorPalette;
|
|
6897
6720
|
}
|
|
6898
|
-
return [...
|
|
6721
|
+
return [...chunkFQXZZBFJ_js.getChartStylePalette(chartData.style?.styleId)];
|
|
6899
6722
|
}
|
|
6900
6723
|
function buildReactChartViewModel(element) {
|
|
6901
6724
|
if (element.type !== "chart" || !element.chartData) {
|
|
6902
|
-
return
|
|
6725
|
+
return chunkFQXZZBFJ_js.buildChartViewModel(element);
|
|
6903
6726
|
}
|
|
6904
6727
|
const palette = resolveReactPalette(element.chartData);
|
|
6905
6728
|
const themedElement = {
|
|
6906
6729
|
...element,
|
|
6907
6730
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
6908
6731
|
};
|
|
6909
|
-
return
|
|
6732
|
+
return chunkFQXZZBFJ_js.buildChartViewModel(themedElement);
|
|
6910
6733
|
}
|
|
6911
6734
|
function renderPrimitive(prim, key) {
|
|
6912
6735
|
switch (prim.kind) {
|
|
@@ -7295,7 +7118,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7295
7118
|
const unmatchedRows = [];
|
|
7296
7119
|
categories.forEach((cat, i) => {
|
|
7297
7120
|
const value = values[i] ?? 0;
|
|
7298
|
-
const code =
|
|
7121
|
+
const code = chunkFQXZZBFJ_js.resolveRegionCode(cat);
|
|
7299
7122
|
if (code) {
|
|
7300
7123
|
regionValueMap.set(code, { value, label: cat });
|
|
7301
7124
|
} else {
|
|
@@ -7333,8 +7156,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7333
7156
|
let fill = "#e2e8f0";
|
|
7334
7157
|
let dataLabel = null;
|
|
7335
7158
|
if (entry) {
|
|
7336
|
-
const t =
|
|
7337
|
-
fill =
|
|
7159
|
+
const t = chunkFQXZZBFJ_js.normalizeValue(entry.value, minVal, maxVal);
|
|
7160
|
+
fill = chunkFQXZZBFJ_js.sequentialColorScale(t);
|
|
7338
7161
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7339
7162
|
"text",
|
|
7340
7163
|
{
|
|
@@ -7345,7 +7168,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7345
7168
|
fontWeight: 600,
|
|
7346
7169
|
fill: "#1e293b",
|
|
7347
7170
|
style: { pointerEvents: "none" },
|
|
7348
|
-
children:
|
|
7171
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(entry.value)
|
|
7349
7172
|
},
|
|
7350
7173
|
`${element.id}-map-dl-${region.code}`
|
|
7351
7174
|
);
|
|
@@ -7363,7 +7186,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7363
7186
|
opacity: 0.9,
|
|
7364
7187
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
7365
7188
|
region.name,
|
|
7366
|
-
entry ? `: ${
|
|
7189
|
+
entry ? `: ${chunkFQXZZBFJ_js.formatAxisValue(entry.value)}` : ""
|
|
7367
7190
|
] })
|
|
7368
7191
|
}
|
|
7369
7192
|
),
|
|
@@ -7401,7 +7224,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7401
7224
|
fontSize: 7,
|
|
7402
7225
|
fill: "#64748b",
|
|
7403
7226
|
textAnchor: "middle",
|
|
7404
|
-
children:
|
|
7227
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(minVal)
|
|
7405
7228
|
},
|
|
7406
7229
|
`${element.id}-map-legend-min`
|
|
7407
7230
|
),
|
|
@@ -7413,7 +7236,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7413
7236
|
fontSize: 7,
|
|
7414
7237
|
fill: "#64748b",
|
|
7415
7238
|
textAnchor: "middle",
|
|
7416
|
-
children:
|
|
7239
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(maxVal)
|
|
7417
7240
|
},
|
|
7418
7241
|
`${element.id}-map-legend-max`
|
|
7419
7242
|
)
|
|
@@ -7432,7 +7255,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7432
7255
|
textAnchor: "middle",
|
|
7433
7256
|
fontSize: 7,
|
|
7434
7257
|
fill: "#94a3b8",
|
|
7435
|
-
children:
|
|
7258
|
+
children: chunkWGLJ32FW_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
7436
7259
|
},
|
|
7437
7260
|
`${element.id}-map-ft-hdr`
|
|
7438
7261
|
)
|
|
@@ -7479,7 +7302,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
7479
7302
|
y,
|
|
7480
7303
|
fontSize,
|
|
7481
7304
|
fill: "#475569",
|
|
7482
|
-
children:
|
|
7305
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(row.value)
|
|
7483
7306
|
},
|
|
7484
7307
|
`${element.id}-map-ft-val-${i}`
|
|
7485
7308
|
)
|
|
@@ -7550,7 +7373,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
7550
7373
|
|
|
7551
7374
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
7552
7375
|
function sColor(series, idx) {
|
|
7553
|
-
return
|
|
7376
|
+
return chunkFQXZZBFJ_js.seriesColor(series, idx);
|
|
7554
7377
|
}
|
|
7555
7378
|
function valToY(val, range, topY, bottomY) {
|
|
7556
7379
|
const usable = bottomY - topY;
|
|
@@ -8045,7 +7868,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8045
7868
|
width: 10,
|
|
8046
7869
|
height: 10,
|
|
8047
7870
|
rx: 2,
|
|
8048
|
-
fill:
|
|
7871
|
+
fill: chunkFQXZZBFJ_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8049
7872
|
},
|
|
8050
7873
|
`${id}-leg-r-${i}`
|
|
8051
7874
|
)
|
|
@@ -8069,7 +7892,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
8069
7892
|
width: 10,
|
|
8070
7893
|
height: 10,
|
|
8071
7894
|
rx: 2,
|
|
8072
|
-
fill:
|
|
7895
|
+
fill: chunkFQXZZBFJ_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
8073
7896
|
}
|
|
8074
7897
|
),
|
|
8075
7898
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -8082,9 +7905,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8082
7905
|
}
|
|
8083
7906
|
const lines = [];
|
|
8084
7907
|
if (range.logScale && range.logBase) {
|
|
8085
|
-
const ticks =
|
|
7908
|
+
const ticks = chunkFQXZZBFJ_js.generateLogTicks(range);
|
|
8086
7909
|
ticks.forEach((tickVal, i) => {
|
|
8087
|
-
const y =
|
|
7910
|
+
const y = chunkFQXZZBFJ_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8088
7911
|
lines.push(
|
|
8089
7912
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8090
7913
|
"line",
|
|
@@ -8105,7 +7928,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
8105
7928
|
const steps = 4;
|
|
8106
7929
|
for (let i = 0; i <= steps; i++) {
|
|
8107
7930
|
const val = range.min + range.span * i / steps;
|
|
8108
|
-
const y =
|
|
7931
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8109
7932
|
lines.push(
|
|
8110
7933
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8111
7934
|
"line",
|
|
@@ -8129,9 +7952,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8129
7952
|
const labels = [];
|
|
8130
7953
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8131
7954
|
if (range.logScale && range.logBase) {
|
|
8132
|
-
const ticks =
|
|
7955
|
+
const ticks = chunkFQXZZBFJ_js.generateLogTicks(range);
|
|
8133
7956
|
ticks.forEach((tickVal, i) => {
|
|
8134
|
-
const y =
|
|
7957
|
+
const y = chunkFQXZZBFJ_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
8135
7958
|
labels.push(
|
|
8136
7959
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8137
7960
|
"text",
|
|
@@ -8141,7 +7964,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8141
7964
|
textAnchor: "end",
|
|
8142
7965
|
fontSize: 8,
|
|
8143
7966
|
fill: "#64748b",
|
|
8144
|
-
children: hasDisplayUnits ?
|
|
7967
|
+
children: hasDisplayUnits ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkFQXZZBFJ_js.formatAxisValue(tickVal)
|
|
8145
7968
|
},
|
|
8146
7969
|
`${id}-vaxis-log-${i}`
|
|
8147
7970
|
)
|
|
@@ -8151,7 +7974,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8151
7974
|
const steps = 4;
|
|
8152
7975
|
for (let i = 0; i <= steps; i++) {
|
|
8153
7976
|
const val = range.min + range.span * i / steps;
|
|
8154
|
-
const y =
|
|
7977
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8155
7978
|
labels.push(
|
|
8156
7979
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8157
7980
|
"text",
|
|
@@ -8161,7 +7984,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8161
7984
|
textAnchor: "end",
|
|
8162
7985
|
fontSize: 8,
|
|
8163
7986
|
fill: "#64748b",
|
|
8164
|
-
children: hasDisplayUnits ?
|
|
7987
|
+
children: hasDisplayUnits ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFQXZZBFJ_js.formatAxisValue(val)
|
|
8165
7988
|
},
|
|
8166
7989
|
`${id}-vaxis-${i}`
|
|
8167
7990
|
)
|
|
@@ -8169,7 +7992,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
8169
7992
|
}
|
|
8170
7993
|
}
|
|
8171
7994
|
if (hasDisplayUnits) {
|
|
8172
|
-
const unitLabel =
|
|
7995
|
+
const unitLabel = chunkFQXZZBFJ_js.getDisplayUnitLabel(
|
|
8173
7996
|
axisFormatting.displayUnits,
|
|
8174
7997
|
axisFormatting.displayUnitsLabel
|
|
8175
7998
|
);
|
|
@@ -8244,7 +8067,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
8244
8067
|
if (range.min >= 0) {
|
|
8245
8068
|
return null;
|
|
8246
8069
|
}
|
|
8247
|
-
const y =
|
|
8070
|
+
const y = chunkFQXZZBFJ_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
8248
8071
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8249
8072
|
"line",
|
|
8250
8073
|
{
|
|
@@ -8268,7 +8091,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8268
8091
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
8269
8092
|
for (let i = 0; i <= steps; i++) {
|
|
8270
8093
|
const val = range.min + range.span * i / steps;
|
|
8271
|
-
const y =
|
|
8094
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8272
8095
|
labels.push(
|
|
8273
8096
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8274
8097
|
"text",
|
|
@@ -8280,7 +8103,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8280
8103
|
fontFamily,
|
|
8281
8104
|
fontWeight,
|
|
8282
8105
|
fill: fontColor,
|
|
8283
|
-
children: hasDisplayUnits ?
|
|
8106
|
+
children: hasDisplayUnits ? chunkFQXZZBFJ_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFQXZZBFJ_js.formatAxisValue(val)
|
|
8284
8107
|
},
|
|
8285
8108
|
`${id}-sec-vaxis-${i}`
|
|
8286
8109
|
)
|
|
@@ -8304,7 +8127,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
8304
8127
|
);
|
|
8305
8128
|
}
|
|
8306
8129
|
if (hasDisplayUnits) {
|
|
8307
|
-
const unitLabel =
|
|
8130
|
+
const unitLabel = chunkFQXZZBFJ_js.getDisplayUnitLabel(
|
|
8308
8131
|
axisFormatting.displayUnits,
|
|
8309
8132
|
axisFormatting.displayUnitsLabel
|
|
8310
8133
|
);
|
|
@@ -8335,7 +8158,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
8335
8158
|
const ticks = [];
|
|
8336
8159
|
for (let i = 0; i <= steps; i++) {
|
|
8337
8160
|
const val = range.min + range.span * i / steps;
|
|
8338
|
-
const y =
|
|
8161
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8339
8162
|
ticks.push(
|
|
8340
8163
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8341
8164
|
"line",
|
|
@@ -8362,7 +8185,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
8362
8185
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
8363
8186
|
for (let i = 0; i <= steps; i++) {
|
|
8364
8187
|
const val = range.min + range.span * i / steps;
|
|
8365
|
-
const y =
|
|
8188
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
8366
8189
|
lines.push(
|
|
8367
8190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8368
8191
|
"line",
|
|
@@ -8479,7 +8302,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8479
8302
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8480
8303
|
"th",
|
|
8481
8304
|
{
|
|
8482
|
-
"aria-label":
|
|
8305
|
+
"aria-label": chunkWGLJ32FW_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
8483
8306
|
style: {
|
|
8484
8307
|
padding: "1px 4px",
|
|
8485
8308
|
fontWeight: 400,
|
|
@@ -8523,7 +8346,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8523
8346
|
width: 8,
|
|
8524
8347
|
height: 8,
|
|
8525
8348
|
borderRadius: 2,
|
|
8526
|
-
backgroundColor:
|
|
8349
|
+
backgroundColor: chunkFQXZZBFJ_js.seriesColor(
|
|
8527
8350
|
s,
|
|
8528
8351
|
si,
|
|
8529
8352
|
chartData.style?.styleId,
|
|
@@ -8562,8 +8385,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
8562
8385
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
8563
8386
|
const style = chartData.style;
|
|
8564
8387
|
const legendPos = style?.legendPosition || "b";
|
|
8565
|
-
const range =
|
|
8566
|
-
const layout =
|
|
8388
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8389
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8567
8390
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8568
8391
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
8569
8392
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -8584,10 +8407,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8584
8407
|
const close = closeSeries.values[ci] ?? high;
|
|
8585
8408
|
const isUp = close >= open;
|
|
8586
8409
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
8587
|
-
const highY =
|
|
8588
|
-
const lowY =
|
|
8589
|
-
const openY =
|
|
8590
|
-
const closeY =
|
|
8410
|
+
const highY = chunkFQXZZBFJ_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
8411
|
+
const lowY = chunkFQXZZBFJ_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
8412
|
+
const openY = chunkFQXZZBFJ_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
8413
|
+
const closeY = chunkFQXZZBFJ_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
8591
8414
|
elements.push(
|
|
8592
8415
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8593
8416
|
"line",
|
|
@@ -8630,7 +8453,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
8630
8453
|
textAnchor: "middle",
|
|
8631
8454
|
fontSize: 7,
|
|
8632
8455
|
fill: "#334155",
|
|
8633
|
-
children:
|
|
8456
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(close)
|
|
8634
8457
|
},
|
|
8635
8458
|
`${element.id}-stock-dl-${ci}`
|
|
8636
8459
|
)
|
|
@@ -8672,7 +8495,7 @@ function FailedToLoad() {
|
|
|
8672
8495
|
var LazySurfaceChart3DScene = React3__default.default.lazy(
|
|
8673
8496
|
async () => {
|
|
8674
8497
|
try {
|
|
8675
|
-
return await import('./SurfaceChart3DScene-
|
|
8498
|
+
return await import('./SurfaceChart3DScene-CBUOCCEN.js');
|
|
8676
8499
|
} catch {
|
|
8677
8500
|
return { default: FailedToLoad };
|
|
8678
8501
|
}
|
|
@@ -8696,7 +8519,7 @@ var SurfaceChart3DErrorBoundary = class extends React3__default.default.Componen
|
|
|
8696
8519
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
8697
8520
|
const rows = chartData.series.length;
|
|
8698
8521
|
const cols = Math.max(categoryLabels.length, 1);
|
|
8699
|
-
const range =
|
|
8522
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8700
8523
|
const heightMap = new Float32Array(rows * cols);
|
|
8701
8524
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
8702
8525
|
for (let r = 0; r < rows; r++) {
|
|
@@ -8816,8 +8639,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
8816
8639
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
8817
8640
|
const style = chartData.style;
|
|
8818
8641
|
const legendPos = style?.legendPosition || "b";
|
|
8819
|
-
const layout =
|
|
8820
|
-
const range =
|
|
8642
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8643
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8821
8644
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8822
8645
|
const seriesCount = chartData.series.length;
|
|
8823
8646
|
const cols = catCount - 1;
|
|
@@ -8907,8 +8730,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8907
8730
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
8908
8731
|
const style = chartData.style;
|
|
8909
8732
|
const legendPos = style?.legendPosition || "b";
|
|
8910
|
-
const layout =
|
|
8911
|
-
const range =
|
|
8733
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
8734
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8912
8735
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
8913
8736
|
const seriesCount = chartData.series.length;
|
|
8914
8737
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -8971,7 +8794,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
8971
8794
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
8972
8795
|
const style = chartData.style;
|
|
8973
8796
|
const legendPos = style?.legendPosition || "b";
|
|
8974
|
-
const layout =
|
|
8797
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
8975
8798
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
8976
8799
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
8977
8800
|
const rects = [];
|
|
@@ -8994,7 +8817,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
8994
8817
|
y: curY,
|
|
8995
8818
|
width: Math.max(w - 1, 1),
|
|
8996
8819
|
height: Math.max(h - 1, 1),
|
|
8997
|
-
fill:
|
|
8820
|
+
fill: chunkFQXZZBFJ_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
8998
8821
|
rx: 2,
|
|
8999
8822
|
opacity: 0.85
|
|
9000
8823
|
},
|
|
@@ -9047,8 +8870,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9047
8870
|
const style = chartData.style;
|
|
9048
8871
|
const legendPos = style?.legendPosition || "b";
|
|
9049
8872
|
const values = chartData.series[0]?.values ?? [];
|
|
9050
|
-
const range =
|
|
9051
|
-
const layout =
|
|
8873
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
8874
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
9052
8875
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
9053
8876
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
9054
8877
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -9059,8 +8882,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9059
8882
|
const isLast = i === values.length - 1;
|
|
9060
8883
|
const startVal = isLast ? 0 : runningTotal;
|
|
9061
8884
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
9062
|
-
const barStartY =
|
|
9063
|
-
const barEndY =
|
|
8885
|
+
const barStartY = chunkFQXZZBFJ_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
8886
|
+
const barEndY = chunkFQXZZBFJ_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
9064
8887
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
9065
8888
|
const y = Math.min(barStartY, barEndY);
|
|
9066
8889
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -9089,7 +8912,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9089
8912
|
textAnchor: "middle",
|
|
9090
8913
|
fontSize: 7,
|
|
9091
8914
|
fill: "#334155",
|
|
9092
|
-
children:
|
|
8915
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(isLast ? endVal : val)
|
|
9093
8916
|
},
|
|
9094
8917
|
`${element.id}-wf-dl-${i}`
|
|
9095
8918
|
)
|
|
@@ -9137,18 +8960,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
9137
8960
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
9138
8961
|
const style = chartData.style;
|
|
9139
8962
|
const legendPos = style?.legendPosition || "b";
|
|
9140
|
-
const layoutOpts =
|
|
8963
|
+
const layoutOpts = chunkFQXZZBFJ_js.computeLayoutOptions(
|
|
9141
8964
|
chartData.axes,
|
|
9142
8965
|
chartData.dataTable,
|
|
9143
8966
|
chartData.series.length
|
|
9144
8967
|
);
|
|
9145
|
-
const layout =
|
|
9146
|
-
const { primary, secondary } =
|
|
8968
|
+
const layout = chunkFQXZZBFJ_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
8969
|
+
const { primary, secondary } = chunkFQXZZBFJ_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
9147
8970
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
9148
8971
|
const secondarySeries = secondary.map((e) => e.series);
|
|
9149
|
-
const range =
|
|
9150
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
9151
|
-
const secondaryAxisFmt =
|
|
8972
|
+
const range = chunkFQXZZBFJ_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
8973
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkFQXZZBFJ_js.computeValueRange(secondarySeries) : void 0;
|
|
8974
|
+
const secondaryAxisFmt = chunkFQXZZBFJ_js.getSecondaryValueAxis(chartData.axes);
|
|
9152
8975
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
9153
8976
|
const barSeriesCount = 1;
|
|
9154
8977
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -9164,8 +8987,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9164
8987
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
9165
8988
|
barSeries.values.forEach((val, vi) => {
|
|
9166
8989
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
9167
|
-
const zeroY =
|
|
9168
|
-
const valY =
|
|
8990
|
+
const zeroY = chunkFQXZZBFJ_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
8991
|
+
const valY = chunkFQXZZBFJ_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
9169
8992
|
const y = Math.min(zeroY, valY);
|
|
9170
8993
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
9171
8994
|
barElements.push(
|
|
@@ -9176,7 +8999,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9176
8999
|
y,
|
|
9177
9000
|
width: barWidth,
|
|
9178
9001
|
height: h,
|
|
9179
|
-
fill:
|
|
9002
|
+
fill: chunkFQXZZBFJ_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
9180
9003
|
rx: 1
|
|
9181
9004
|
},
|
|
9182
9005
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -9192,7 +9015,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9192
9015
|
textAnchor: "middle",
|
|
9193
9016
|
fontSize: 7,
|
|
9194
9017
|
fill: "#334155",
|
|
9195
|
-
children:
|
|
9018
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(val)
|
|
9196
9019
|
},
|
|
9197
9020
|
`${element.id}-combo-bar-dl-${vi}`
|
|
9198
9021
|
)
|
|
@@ -9209,10 +9032,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9209
9032
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
9210
9033
|
const points = series.values.map((val, vi) => {
|
|
9211
9034
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
9212
|
-
const y =
|
|
9035
|
+
const y = chunkFQXZZBFJ_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
9213
9036
|
return { x, y, val };
|
|
9214
9037
|
});
|
|
9215
|
-
const c =
|
|
9038
|
+
const c = chunkFQXZZBFJ_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
9216
9039
|
lineElements.push(
|
|
9217
9040
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9218
9041
|
"polyline",
|
|
@@ -9239,7 +9062,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9239
9062
|
textAnchor: "middle",
|
|
9240
9063
|
fontSize: 7,
|
|
9241
9064
|
fill: "#334155",
|
|
9242
|
-
children:
|
|
9065
|
+
children: chunkFQXZZBFJ_js.formatAxisValue(p.val)
|
|
9243
9066
|
},
|
|
9244
9067
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
9245
9068
|
)
|
|
@@ -9277,11 +9100,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
9277
9100
|
}
|
|
9278
9101
|
function renderChartElement(element) {
|
|
9279
9102
|
if (element.type !== "chart") {
|
|
9280
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9103
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.chart.heading"] });
|
|
9281
9104
|
}
|
|
9282
9105
|
const chartData = element.chartData;
|
|
9283
9106
|
if (!chartData || chartData.series.length === 0) {
|
|
9284
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
9107
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.chart.heading"] });
|
|
9285
9108
|
}
|
|
9286
9109
|
const longestSeriesLength = chartData.series.reduce(
|
|
9287
9110
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -10798,7 +10621,7 @@ function PresentationMediaController({
|
|
|
10798
10621
|
}
|
|
10799
10622
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
10800
10623
|
if (element.type !== "media") {
|
|
10801
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
10624
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkWGLJ32FW_js.translationsEn["pptx.media.title"] });
|
|
10802
10625
|
}
|
|
10803
10626
|
const mediaType = element.mediaType;
|
|
10804
10627
|
const mediaPath = element.mediaPath;
|
|
@@ -10828,7 +10651,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10828
10651
|
"img",
|
|
10829
10652
|
{
|
|
10830
10653
|
src: posterUrl,
|
|
10831
|
-
alt:
|
|
10654
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.media.posterAlt"],
|
|
10832
10655
|
className: "w-full h-full object-contain opacity-50"
|
|
10833
10656
|
}
|
|
10834
10657
|
),
|
|
@@ -10849,7 +10672,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10849
10672
|
]
|
|
10850
10673
|
}
|
|
10851
10674
|
),
|
|
10852
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
10675
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkWGLJ32FW_js.translationsEn["pptx.media.notFound"] })
|
|
10853
10676
|
] })
|
|
10854
10677
|
] });
|
|
10855
10678
|
}
|
|
@@ -10890,7 +10713,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
10890
10713
|
"img",
|
|
10891
10714
|
{
|
|
10892
10715
|
src: posterUrl,
|
|
10893
|
-
alt:
|
|
10716
|
+
alt: chunkWGLJ32FW_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
10894
10717
|
className: "w-full h-full object-contain"
|
|
10895
10718
|
}
|
|
10896
10719
|
),
|
|
@@ -10993,14 +10816,14 @@ function buildNotesPdf(pages) {
|
|
|
10993
10816
|
notes: page.notes,
|
|
10994
10817
|
slideNumber: page.slideNumber
|
|
10995
10818
|
}));
|
|
10996
|
-
const bytes =
|
|
10819
|
+
const bytes = chunkFQXZZBFJ_js.buildNotesPdfBytes(images, meta);
|
|
10997
10820
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
10998
10821
|
return URL.createObjectURL(blob);
|
|
10999
10822
|
}
|
|
11000
10823
|
|
|
11001
10824
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
11002
10825
|
function buildPdfFromImageData(images) {
|
|
11003
|
-
const bytes =
|
|
10826
|
+
const bytes = chunkFQXZZBFJ_js.buildSlidesPdfBytes(images);
|
|
11004
10827
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
11005
10828
|
return URL.createObjectURL(blob);
|
|
11006
10829
|
}
|
|
@@ -11009,7 +10832,7 @@ function buildPdfFromImageData(images) {
|
|
|
11009
10832
|
var activePreview = null;
|
|
11010
10833
|
function startPreviewAnimation(elementId, preset, options) {
|
|
11011
10834
|
stopPreviewAnimation();
|
|
11012
|
-
const descriptor =
|
|
10835
|
+
const descriptor = chunkFQXZZBFJ_js.buildPreviewAnimation(preset, options);
|
|
11013
10836
|
if (!descriptor) {
|
|
11014
10837
|
return;
|
|
11015
10838
|
}
|
|
@@ -11447,7 +11270,7 @@ function useElementOperations(input) {
|
|
|
11447
11270
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
11448
11271
|
const updateElementById = React3.useCallback(
|
|
11449
11272
|
(elementId, updates) => {
|
|
11450
|
-
if (
|
|
11273
|
+
if (chunkFQXZZBFJ_js.isTemplateElementId(elementId)) {
|
|
11451
11274
|
const slideId = activeSlide?.id;
|
|
11452
11275
|
if (slideId) {
|
|
11453
11276
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -11501,14 +11324,14 @@ function useElementOperations(input) {
|
|
|
11501
11324
|
if (!selectedElement || !chunkOBLHB72P_js.hasTextProperties(selectedElement)) {
|
|
11502
11325
|
return;
|
|
11503
11326
|
}
|
|
11504
|
-
const inlineSel =
|
|
11327
|
+
const inlineSel = chunkFQXZZBFJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11505
11328
|
if (inlineSel && selectedElement.textSegments) {
|
|
11506
|
-
const { newSegments: newSegments2, newSelection } =
|
|
11329
|
+
const { newSegments: newSegments2, newSelection } = chunkFQXZZBFJ_js.applyStyleToSelectedSegments(
|
|
11507
11330
|
selectedElement.textSegments,
|
|
11508
11331
|
inlineSel,
|
|
11509
11332
|
updates
|
|
11510
11333
|
);
|
|
11511
|
-
|
|
11334
|
+
chunkFQXZZBFJ_js.setPendingSelectionRestore(newSelection);
|
|
11512
11335
|
updateSelectedElement({
|
|
11513
11336
|
textSegments: newSegments2
|
|
11514
11337
|
});
|
|
@@ -11526,6 +11349,36 @@ function useElementOperations(input) {
|
|
|
11526
11349
|
},
|
|
11527
11350
|
[selectedElement, updateSelectedElement]
|
|
11528
11351
|
);
|
|
11352
|
+
const updateSelectedTextCase = React3.useCallback(
|
|
11353
|
+
(mode) => {
|
|
11354
|
+
if (!selectedElement || !chunkOBLHB72P_js.hasTextProperties(selectedElement)) {
|
|
11355
|
+
return;
|
|
11356
|
+
}
|
|
11357
|
+
const inlineSel = chunkFQXZZBFJ_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
11358
|
+
if (inlineSel && selectedElement.textSegments) {
|
|
11359
|
+
const newSegments = chunkFQXZZBFJ_js.applyCaseTransformToSegments(
|
|
11360
|
+
selectedElement.textSegments,
|
|
11361
|
+
inlineSel,
|
|
11362
|
+
mode
|
|
11363
|
+
);
|
|
11364
|
+
updateSelectedElement({ textSegments: newSegments });
|
|
11365
|
+
return;
|
|
11366
|
+
}
|
|
11367
|
+
const updates = {};
|
|
11368
|
+
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
11369
|
+
updates.textSegments = chunkFQXZZBFJ_js.applyCaseTransformToSegments(
|
|
11370
|
+
selectedElement.textSegments,
|
|
11371
|
+
null,
|
|
11372
|
+
mode
|
|
11373
|
+
);
|
|
11374
|
+
}
|
|
11375
|
+
if (typeof selectedElement.text === "string") {
|
|
11376
|
+
updates.text = chunkFQXZZBFJ_js.transformTextCase(selectedElement.text, mode);
|
|
11377
|
+
}
|
|
11378
|
+
updateSelectedElement(updates);
|
|
11379
|
+
},
|
|
11380
|
+
[selectedElement, updateSelectedElement]
|
|
11381
|
+
);
|
|
11529
11382
|
const updateSlides = React3.useCallback(
|
|
11530
11383
|
(updater) => {
|
|
11531
11384
|
setSlides((prev) => updater(prev));
|
|
@@ -11564,6 +11417,7 @@ function useElementOperations(input) {
|
|
|
11564
11417
|
updateSelectedElement,
|
|
11565
11418
|
updateSelectedShapeStyle,
|
|
11566
11419
|
updateSelectedTextStyle,
|
|
11420
|
+
updateSelectedTextCase,
|
|
11567
11421
|
updateSlides,
|
|
11568
11422
|
activeElements,
|
|
11569
11423
|
updateActiveElements,
|
|
@@ -11574,7 +11428,7 @@ function useSectionOperations(input) {
|
|
|
11574
11428
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
11575
11429
|
const addSection2 = React3.useCallback(
|
|
11576
11430
|
(name, afterSlideIndex) => {
|
|
11577
|
-
const result =
|
|
11431
|
+
const result = chunkFQXZZBFJ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
11578
11432
|
setSlides(result.slides);
|
|
11579
11433
|
setSections(result.sections);
|
|
11580
11434
|
markDirty();
|
|
@@ -11583,7 +11437,7 @@ function useSectionOperations(input) {
|
|
|
11583
11437
|
);
|
|
11584
11438
|
const renameSection2 = React3.useCallback(
|
|
11585
11439
|
(sectionId, newName) => {
|
|
11586
|
-
const result =
|
|
11440
|
+
const result = chunkFQXZZBFJ_js.renameSection(sections, slides, sectionId, newName);
|
|
11587
11441
|
setSections(result.sections);
|
|
11588
11442
|
setSlides(result.slides);
|
|
11589
11443
|
markDirty();
|
|
@@ -11592,7 +11446,7 @@ function useSectionOperations(input) {
|
|
|
11592
11446
|
);
|
|
11593
11447
|
const deleteSection2 = React3.useCallback(
|
|
11594
11448
|
(sectionId) => {
|
|
11595
|
-
const result =
|
|
11449
|
+
const result = chunkFQXZZBFJ_js.deleteSection(sections, slides, sectionId);
|
|
11596
11450
|
setSections(result.sections);
|
|
11597
11451
|
setSlides(result.slides);
|
|
11598
11452
|
markDirty();
|
|
@@ -11601,21 +11455,21 @@ function useSectionOperations(input) {
|
|
|
11601
11455
|
);
|
|
11602
11456
|
const moveSectionUp2 = React3.useCallback(
|
|
11603
11457
|
(sectionId) => {
|
|
11604
|
-
setSections(
|
|
11458
|
+
setSections(chunkFQXZZBFJ_js.moveSectionUp(sections, sectionId));
|
|
11605
11459
|
markDirty();
|
|
11606
11460
|
},
|
|
11607
11461
|
[sections, setSections, markDirty]
|
|
11608
11462
|
);
|
|
11609
11463
|
const moveSectionDown2 = React3.useCallback(
|
|
11610
11464
|
(sectionId) => {
|
|
11611
|
-
setSections(
|
|
11465
|
+
setSections(chunkFQXZZBFJ_js.moveSectionDown(sections, sectionId));
|
|
11612
11466
|
markDirty();
|
|
11613
11467
|
},
|
|
11614
11468
|
[sections, setSections, markDirty]
|
|
11615
11469
|
);
|
|
11616
11470
|
const moveSlidesToSection2 = React3.useCallback(
|
|
11617
11471
|
(slideIndexes, targetSectionId) => {
|
|
11618
|
-
const result =
|
|
11472
|
+
const result = chunkFQXZZBFJ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
11619
11473
|
setSlides(result.slides);
|
|
11620
11474
|
setSections(result.sections);
|
|
11621
11475
|
markDirty();
|
|
@@ -11634,7 +11488,7 @@ function useSectionOperations(input) {
|
|
|
11634
11488
|
|
|
11635
11489
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
11636
11490
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
11637
|
-
const resized =
|
|
11491
|
+
const resized = chunkFQXZZBFJ_js.applyResize(
|
|
11638
11492
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
11639
11493
|
handle,
|
|
11640
11494
|
dx,
|
|
@@ -11646,7 +11500,7 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
11646
11500
|
if (!snapToGrid) {
|
|
11647
11501
|
return box;
|
|
11648
11502
|
}
|
|
11649
|
-
return
|
|
11503
|
+
return chunkFQXZZBFJ_js.snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
11650
11504
|
}
|
|
11651
11505
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
11652
11506
|
const range = startWidth || 200;
|
|
@@ -11756,7 +11610,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
11756
11610
|
width: el.width,
|
|
11757
11611
|
height: el.height
|
|
11758
11612
|
}));
|
|
11759
|
-
const snapResult =
|
|
11613
|
+
const snapResult = chunkFQXZZBFJ_js.computeSnapToShape(
|
|
11760
11614
|
targetX,
|
|
11761
11615
|
targetY,
|
|
11762
11616
|
primaryEl.width,
|
|
@@ -11899,13 +11753,13 @@ function processPointerUp(input) {
|
|
|
11899
11753
|
if (i !== activeSlideIndex) {
|
|
11900
11754
|
return s;
|
|
11901
11755
|
}
|
|
11902
|
-
const rerouted =
|
|
11756
|
+
const rerouted = chunkFQXZZBFJ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
11903
11757
|
if (rerouted.length === 0) {
|
|
11904
11758
|
return s;
|
|
11905
11759
|
}
|
|
11906
11760
|
return {
|
|
11907
11761
|
...s,
|
|
11908
|
-
elements:
|
|
11762
|
+
elements: chunkFQXZZBFJ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
11909
11763
|
};
|
|
11910
11764
|
})
|
|
11911
11765
|
);
|
|
@@ -11924,9 +11778,9 @@ function processPointerUp(input) {
|
|
|
11924
11778
|
}
|
|
11925
11779
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
11926
11780
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
11927
|
-
const hitIds =
|
|
11781
|
+
const hitIds = chunkFQXZZBFJ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
11928
11782
|
if (marquee.additive) {
|
|
11929
|
-
const merged =
|
|
11783
|
+
const merged = chunkFQXZZBFJ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
11930
11784
|
if (merged.length > 0) {
|
|
11931
11785
|
applySelection(merged[0], merged);
|
|
11932
11786
|
} else {
|
|
@@ -11949,8 +11803,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
11949
11803
|
}
|
|
11950
11804
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
11951
11805
|
});
|
|
11952
|
-
const rerouted =
|
|
11953
|
-
return
|
|
11806
|
+
const rerouted = chunkFQXZZBFJ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
11807
|
+
return chunkFQXZZBFJ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
11954
11808
|
};
|
|
11955
11809
|
if (editTemplateMode) {
|
|
11956
11810
|
const slideId = activeSlide?.id;
|
|
@@ -12101,7 +11955,7 @@ function useCanvasInteractions(input) {
|
|
|
12101
11955
|
}
|
|
12102
11956
|
const el = elementLookup.get(editId);
|
|
12103
11957
|
if (el && chunkOBLHB72P_js.hasTextProperties(el)) {
|
|
12104
|
-
const newSegments =
|
|
11958
|
+
const newSegments = chunkFQXZZBFJ_js.remapTextToSegments(inlineEditingText, el.textSegments, el.textStyle);
|
|
12105
11959
|
ops.updateElementById(editId, {
|
|
12106
11960
|
text: inlineEditingText,
|
|
12107
11961
|
textSegments: newSegments
|
|
@@ -12347,7 +12201,7 @@ function createFileHandlers(deps) {
|
|
|
12347
12201
|
h = Math.round(h * scale);
|
|
12348
12202
|
}
|
|
12349
12203
|
addElement({
|
|
12350
|
-
id: generateElementId(),
|
|
12204
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12351
12205
|
type: "image",
|
|
12352
12206
|
x: Math.round((canvasSize.width - w) / 2),
|
|
12353
12207
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -12358,7 +12212,7 @@ function createFileHandlers(deps) {
|
|
|
12358
12212
|
};
|
|
12359
12213
|
img.onerror = () => {
|
|
12360
12214
|
addElement({
|
|
12361
|
-
id: generateElementId(),
|
|
12215
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12362
12216
|
type: "image",
|
|
12363
12217
|
x: 100,
|
|
12364
12218
|
y: 100,
|
|
@@ -12384,7 +12238,7 @@ function createFileHandlers(deps) {
|
|
|
12384
12238
|
const elFilePath = file.path;
|
|
12385
12239
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
12386
12240
|
addElement({
|
|
12387
|
-
id: generateElementId(),
|
|
12241
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12388
12242
|
type: "media",
|
|
12389
12243
|
mediaType,
|
|
12390
12244
|
mediaMimeType: file.type || void 0,
|
|
@@ -12559,13 +12413,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
12559
12413
|
return;
|
|
12560
12414
|
}
|
|
12561
12415
|
addElement({
|
|
12562
|
-
id: generateElementId(),
|
|
12416
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12563
12417
|
type: "smartArt",
|
|
12564
12418
|
x: 100,
|
|
12565
12419
|
y: 120,
|
|
12566
12420
|
width: 600,
|
|
12567
12421
|
height: 340,
|
|
12568
|
-
smartArtData:
|
|
12422
|
+
smartArtData: chunkFQXZZBFJ_js.buildSmartArtPresetData(
|
|
12569
12423
|
layout,
|
|
12570
12424
|
defaultItems,
|
|
12571
12425
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -12577,7 +12431,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12577
12431
|
return;
|
|
12578
12432
|
}
|
|
12579
12433
|
addElement({
|
|
12580
|
-
id: generateElementId(),
|
|
12434
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12581
12435
|
type: "shape",
|
|
12582
12436
|
x: 120,
|
|
12583
12437
|
y: 200,
|
|
@@ -12636,7 +12490,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12636
12490
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
12637
12491
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
12638
12492
|
addElement({
|
|
12639
|
-
id: generateElementId(),
|
|
12493
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12640
12494
|
type: "shape",
|
|
12641
12495
|
x: 120,
|
|
12642
12496
|
y: 200,
|
|
@@ -12658,7 +12512,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12658
12512
|
if (!activeSlide) {
|
|
12659
12513
|
return;
|
|
12660
12514
|
}
|
|
12661
|
-
const preset =
|
|
12515
|
+
const preset = chunkFQXZZBFJ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
12662
12516
|
if (!preset) {
|
|
12663
12517
|
return;
|
|
12664
12518
|
}
|
|
@@ -12671,7 +12525,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
12671
12525
|
defaultPptxAction.highlightClick = true;
|
|
12672
12526
|
}
|
|
12673
12527
|
addElement({
|
|
12674
|
-
id: generateElementId(),
|
|
12528
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12675
12529
|
type: "shape",
|
|
12676
12530
|
x: 150,
|
|
12677
12531
|
y: 150,
|
|
@@ -12738,7 +12592,7 @@ function useInsertElements(input) {
|
|
|
12738
12592
|
return;
|
|
12739
12593
|
}
|
|
12740
12594
|
addElement({
|
|
12741
|
-
id: generateElementId(),
|
|
12595
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12742
12596
|
type: "text",
|
|
12743
12597
|
x: 100,
|
|
12744
12598
|
y: 100,
|
|
@@ -12753,7 +12607,7 @@ function useInsertElements(input) {
|
|
|
12753
12607
|
return;
|
|
12754
12608
|
}
|
|
12755
12609
|
addElement({
|
|
12756
|
-
id: generateElementId(),
|
|
12610
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
12757
12611
|
type: "shape",
|
|
12758
12612
|
x: 150,
|
|
12759
12613
|
y: 150,
|
|
@@ -12772,15 +12626,15 @@ function useInsertElements(input) {
|
|
|
12772
12626
|
return;
|
|
12773
12627
|
}
|
|
12774
12628
|
addElement({
|
|
12775
|
-
...
|
|
12776
|
-
id: generateElementId()
|
|
12629
|
+
...chunkFQXZZBFJ_js.newTableElement(DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
12630
|
+
id: chunkFQXZZBFJ_js.generateElementId()
|
|
12777
12631
|
});
|
|
12778
12632
|
};
|
|
12779
12633
|
const handleAddChart = (chartType) => {
|
|
12780
12634
|
if (!activeSlide) {
|
|
12781
12635
|
return;
|
|
12782
12636
|
}
|
|
12783
|
-
addElement(
|
|
12637
|
+
addElement(chunkFQXZZBFJ_js.createDefaultChartElement(chartType));
|
|
12784
12638
|
};
|
|
12785
12639
|
const structured = createStructuredElementHandlers({
|
|
12786
12640
|
activeSlide,
|
|
@@ -12850,10 +12704,7 @@ function useClipboardHandlers(input) {
|
|
|
12850
12704
|
if (!selectedElement) {
|
|
12851
12705
|
return;
|
|
12852
12706
|
}
|
|
12853
|
-
setClipboardPayload(
|
|
12854
|
-
element: structuredClone(selectedElement),
|
|
12855
|
-
isTemplate: editTemplateMode
|
|
12856
|
-
});
|
|
12707
|
+
setClipboardPayload(chunkFQXZZBFJ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
12857
12708
|
};
|
|
12858
12709
|
const handleDelete = () => {
|
|
12859
12710
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -12869,29 +12720,23 @@ function useClipboardHandlers(input) {
|
|
|
12869
12720
|
handleCopy();
|
|
12870
12721
|
handleDelete();
|
|
12871
12722
|
};
|
|
12723
|
+
const insertClone = (source) => {
|
|
12724
|
+
const clone = chunkFQXZZBFJ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
12725
|
+
ops.updateActiveElements((els) => [...els, clone]);
|
|
12726
|
+
ops.applySelection(clone.id);
|
|
12727
|
+
history.markDirty();
|
|
12728
|
+
};
|
|
12872
12729
|
const handlePaste = () => {
|
|
12873
12730
|
if (!clipboardPayload || !activeSlide) {
|
|
12874
12731
|
return;
|
|
12875
12732
|
}
|
|
12876
|
-
|
|
12877
|
-
clone.id = makeCloneId(editTemplateMode, clipboardPayload.element.id);
|
|
12878
|
-
clone.x += 20;
|
|
12879
|
-
clone.y += 20;
|
|
12880
|
-
ops.updateActiveElements((els) => [...els, clone]);
|
|
12881
|
-
ops.applySelection(clone.id);
|
|
12882
|
-
history.markDirty();
|
|
12733
|
+
insertClone(clipboardPayload.element);
|
|
12883
12734
|
};
|
|
12884
12735
|
const handleDuplicate = () => {
|
|
12885
12736
|
if (!selectedElement || !activeSlide) {
|
|
12886
12737
|
return;
|
|
12887
12738
|
}
|
|
12888
|
-
|
|
12889
|
-
clone.id = makeCloneId(editTemplateMode, selectedElement.id);
|
|
12890
|
-
clone.x += 20;
|
|
12891
|
-
clone.y += 20;
|
|
12892
|
-
ops.updateActiveElements((els) => [...els, clone]);
|
|
12893
|
-
ops.applySelection(clone.id);
|
|
12894
|
-
history.markDirty();
|
|
12739
|
+
insertClone(selectedElement);
|
|
12895
12740
|
};
|
|
12896
12741
|
return {
|
|
12897
12742
|
handleCopy,
|
|
@@ -13086,7 +12931,7 @@ function useMergeShapesHandler(input) {
|
|
|
13086
12931
|
bounds.height
|
|
13087
12932
|
);
|
|
13088
12933
|
const newEl = {
|
|
13089
|
-
id: generateElementId(),
|
|
12934
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
13090
12935
|
type: "shape",
|
|
13091
12936
|
x: bounds.x,
|
|
13092
12937
|
y: bounds.y,
|
|
@@ -13145,7 +12990,7 @@ function useMergeShapesHandler(input) {
|
|
|
13145
12990
|
);
|
|
13146
12991
|
const primary = targets[0];
|
|
13147
12992
|
const newEl = {
|
|
13148
|
-
id: generateElementId(),
|
|
12993
|
+
id: chunkFQXZZBFJ_js.generateElementId(),
|
|
13149
12994
|
type: "shape",
|
|
13150
12995
|
x: bounds.x,
|
|
13151
12996
|
y: bounds.y,
|
|
@@ -13208,7 +13053,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13208
13053
|
if (ids.length < 2 || !activeSlide) {
|
|
13209
13054
|
return;
|
|
13210
13055
|
}
|
|
13211
|
-
const { elements, groupId } =
|
|
13056
|
+
const { elements, groupId } = chunkFQXZZBFJ_js.groupElements(ops.activeElements, ids, chunkFQXZZBFJ_js.generateElementId());
|
|
13212
13057
|
if (groupId === null) {
|
|
13213
13058
|
return;
|
|
13214
13059
|
}
|
|
@@ -13221,12 +13066,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13221
13066
|
return;
|
|
13222
13067
|
}
|
|
13223
13068
|
const group = selectedElement;
|
|
13224
|
-
const intoTemplate =
|
|
13069
|
+
const intoTemplate = chunkFQXZZBFJ_js.isTemplateElementId(group.id);
|
|
13225
13070
|
const ungrouped = group.children.map((child) => ({
|
|
13226
13071
|
...structuredClone(child),
|
|
13227
13072
|
// Keep child ids in the same store as the group so later edits route
|
|
13228
13073
|
// correctly: template groups yield template-prefixed child ids.
|
|
13229
|
-
id: intoTemplate ? makeCloneId(true, child.id || group.id) : child.id || generateElementId(),
|
|
13074
|
+
id: intoTemplate ? chunkFQXZZBFJ_js.makeCloneId(true, child.id || group.id) : child.id || chunkFQXZZBFJ_js.generateElementId(),
|
|
13230
13075
|
x: child.x + group.x,
|
|
13231
13076
|
y: child.y + group.y
|
|
13232
13077
|
}));
|
|
@@ -13250,7 +13095,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13250
13095
|
if (!edge) {
|
|
13251
13096
|
return;
|
|
13252
13097
|
}
|
|
13253
|
-
const positions =
|
|
13098
|
+
const positions = chunkFQXZZBFJ_js.alignElements(selectedElements, edge);
|
|
13254
13099
|
for (const [id, pos] of positions) {
|
|
13255
13100
|
const el = elementLookup.get(id);
|
|
13256
13101
|
if (!el) {
|
|
@@ -13268,7 +13113,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13268
13113
|
if (!distAxis) {
|
|
13269
13114
|
return;
|
|
13270
13115
|
}
|
|
13271
|
-
const positions =
|
|
13116
|
+
const positions = chunkFQXZZBFJ_js.distributeElements(selectedElements, distAxis);
|
|
13272
13117
|
for (const [id, pos] of positions) {
|
|
13273
13118
|
const el = elementLookup.get(id);
|
|
13274
13119
|
if (!el) {
|
|
@@ -13285,7 +13130,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13285
13130
|
}
|
|
13286
13131
|
const id = selectedElement.id;
|
|
13287
13132
|
ops.updateActiveElements(
|
|
13288
|
-
(els) => direction === "forward" ?
|
|
13133
|
+
(els) => direction === "forward" ? chunkFQXZZBFJ_js.bringForward(els, id) : direction === "backward" ? chunkFQXZZBFJ_js.sendBackward(els, id) : els
|
|
13289
13134
|
);
|
|
13290
13135
|
history.markDirty();
|
|
13291
13136
|
};
|
|
@@ -13295,7 +13140,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
13295
13140
|
}
|
|
13296
13141
|
const id = selectedElement.id;
|
|
13297
13142
|
ops.updateActiveElements(
|
|
13298
|
-
(els) => direction === "front" ?
|
|
13143
|
+
(els) => direction === "front" ? chunkFQXZZBFJ_js.bringToFront(els, id) : chunkFQXZZBFJ_js.sendToBack(els, id)
|
|
13299
13144
|
);
|
|
13300
13145
|
history.markDirty();
|
|
13301
13146
|
};
|
|
@@ -13417,7 +13262,7 @@ function insertSlideFromLayoutUpdater(slides, activeIndex, draft) {
|
|
|
13417
13262
|
function useSlideManagement(input) {
|
|
13418
13263
|
const { slides, activeSlideIndex, setActiveSlideIndex, ops, history, handlerRef } = input;
|
|
13419
13264
|
const handleAddSlide = () => {
|
|
13420
|
-
const newSlide =
|
|
13265
|
+
const newSlide = chunkFQXZZBFJ_js.createBlankSlide(slides.length + 1);
|
|
13421
13266
|
ops.updateSlides((prev) => {
|
|
13422
13267
|
const next = [...prev];
|
|
13423
13268
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -13480,7 +13325,7 @@ function useSlideManagement(input) {
|
|
|
13480
13325
|
}
|
|
13481
13326
|
const clone = {
|
|
13482
13327
|
...src,
|
|
13483
|
-
id:
|
|
13328
|
+
id: chunkFQXZZBFJ_js.makeSlideId(),
|
|
13484
13329
|
elements: src.elements.map((el) => ({
|
|
13485
13330
|
...el,
|
|
13486
13331
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -13512,7 +13357,7 @@ function useSlideManagement(input) {
|
|
|
13512
13357
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
13513
13358
|
const insertAt = activeSlideIndex + 1;
|
|
13514
13359
|
const draft = {
|
|
13515
|
-
...
|
|
13360
|
+
...chunkFQXZZBFJ_js.createBlankSlide(slides.length + 1),
|
|
13516
13361
|
layoutPath,
|
|
13517
13362
|
...layoutName ? { layoutName } : {}
|
|
13518
13363
|
};
|
|
@@ -13573,7 +13418,7 @@ function createTableMergeHandlers(input) {
|
|
|
13573
13418
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
13574
13419
|
return;
|
|
13575
13420
|
}
|
|
13576
|
-
const newTableData =
|
|
13421
|
+
const newTableData = chunkFQXZZBFJ_js.mergeCells(
|
|
13577
13422
|
[
|
|
13578
13423
|
{ row: rowIndex, col: columnIndex },
|
|
13579
13424
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -13607,7 +13452,7 @@ function createTableMergeHandlers(input) {
|
|
|
13607
13452
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
13608
13453
|
return;
|
|
13609
13454
|
}
|
|
13610
|
-
const newTableData =
|
|
13455
|
+
const newTableData = chunkFQXZZBFJ_js.mergeCells(
|
|
13611
13456
|
[
|
|
13612
13457
|
{ row: rowIndex, col: columnIndex },
|
|
13613
13458
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -13630,7 +13475,7 @@ function createTableMergeHandlers(input) {
|
|
|
13630
13475
|
return;
|
|
13631
13476
|
}
|
|
13632
13477
|
const td = selectedElement.tableData;
|
|
13633
|
-
const newTableData =
|
|
13478
|
+
const newTableData = chunkFQXZZBFJ_js.mergeCells(ts.selectedCells, td);
|
|
13634
13479
|
const updates = { tableData: newTableData };
|
|
13635
13480
|
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13636
13481
|
if (newRawXml) {
|
|
@@ -13649,7 +13494,7 @@ function createTableMergeHandlers(input) {
|
|
|
13649
13494
|
}
|
|
13650
13495
|
const { rowIndex, columnIndex } = ts;
|
|
13651
13496
|
const td = selectedElement.tableData;
|
|
13652
|
-
const newTableData =
|
|
13497
|
+
const newTableData = chunkFQXZZBFJ_js.splitCell(rowIndex, columnIndex, td);
|
|
13653
13498
|
const updates = { tableData: newTableData };
|
|
13654
13499
|
const newRawXml = chunkOBLHB72P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
13655
13500
|
if (newRawXml) {
|
|
@@ -13783,7 +13628,7 @@ function createTableStructHandlers(input) {
|
|
|
13783
13628
|
return;
|
|
13784
13629
|
}
|
|
13785
13630
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13786
|
-
const newTableData =
|
|
13631
|
+
const newTableData = chunkFQXZZBFJ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
13787
13632
|
const updates = { tableData: newTableData };
|
|
13788
13633
|
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13789
13634
|
if (newRawXml) {
|
|
@@ -13798,7 +13643,7 @@ function createTableStructHandlers(input) {
|
|
|
13798
13643
|
}
|
|
13799
13644
|
const td = selectedElement.tableData;
|
|
13800
13645
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
13801
|
-
const newTableData =
|
|
13646
|
+
const newTableData = chunkFQXZZBFJ_js.deleteTableRow(td, rowIdx);
|
|
13802
13647
|
if (newTableData === td) {
|
|
13803
13648
|
return;
|
|
13804
13649
|
}
|
|
@@ -13815,7 +13660,7 @@ function createTableStructHandlers(input) {
|
|
|
13815
13660
|
return;
|
|
13816
13661
|
}
|
|
13817
13662
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13818
|
-
const newTableData =
|
|
13663
|
+
const newTableData = chunkFQXZZBFJ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
13819
13664
|
const updates = { tableData: newTableData };
|
|
13820
13665
|
const newRawXml = chunkOBLHB72P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
13821
13666
|
if (newRawXml) {
|
|
@@ -13830,7 +13675,7 @@ function createTableStructHandlers(input) {
|
|
|
13830
13675
|
}
|
|
13831
13676
|
const td = selectedElement.tableData;
|
|
13832
13677
|
const colIdx = ts?.columnIndex ?? 0;
|
|
13833
|
-
const newTableData =
|
|
13678
|
+
const newTableData = chunkFQXZZBFJ_js.deleteTableColumn(td, colIdx);
|
|
13834
13679
|
if (newTableData === td) {
|
|
13835
13680
|
return;
|
|
13836
13681
|
}
|
|
@@ -13868,8 +13713,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
13868
13713
|
return html2canvasPro__default.default(element, {
|
|
13869
13714
|
...options,
|
|
13870
13715
|
onclone: async (doc, clonedEl) => {
|
|
13871
|
-
await
|
|
13872
|
-
|
|
13716
|
+
await chunkFQXZZBFJ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
13717
|
+
chunkFQXZZBFJ_js.preprocessCssForCapture(clonedEl);
|
|
13873
13718
|
if (typeof userOnClone === "function") {
|
|
13874
13719
|
userOnClone(doc, clonedEl);
|
|
13875
13720
|
}
|
|
@@ -13925,7 +13770,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
13925
13770
|
}
|
|
13926
13771
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
13927
13772
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
13928
|
-
|
|
13773
|
+
chunkFQXZZBFJ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
13929
13774
|
}
|
|
13930
13775
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
13931
13776
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -13947,15 +13792,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
13947
13792
|
continue;
|
|
13948
13793
|
}
|
|
13949
13794
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
13950
|
-
images.push(
|
|
13795
|
+
images.push(chunkFQXZZBFJ_js.canvasToJpegData(canvas));
|
|
13951
13796
|
}
|
|
13952
13797
|
onProgress?.(totalSlides, totalSlides);
|
|
13953
13798
|
setActiveSlide(currentSlideIndex);
|
|
13954
13799
|
if (images.length === 0) {
|
|
13955
|
-
throw new Error(
|
|
13800
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
13956
13801
|
}
|
|
13957
13802
|
const pdfBlobUrl = buildPdfFromImageData(images);
|
|
13958
|
-
|
|
13803
|
+
chunkFQXZZBFJ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
13959
13804
|
}
|
|
13960
13805
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
13961
13806
|
const { scale = 2, onProgress } = options;
|
|
@@ -14001,10 +13846,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
14001
13846
|
onProgress?.(totalSlides, totalSlides);
|
|
14002
13847
|
setActiveSlide(currentSlideIndex);
|
|
14003
13848
|
if (pages.length === 0) {
|
|
14004
|
-
throw new Error(
|
|
13849
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
14005
13850
|
}
|
|
14006
13851
|
const pdfDataUrl = buildNotesPdf(pages);
|
|
14007
|
-
|
|
13852
|
+
chunkFQXZZBFJ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
14008
13853
|
}
|
|
14009
13854
|
|
|
14010
13855
|
// src/viewer/utils/export-video.ts
|
|
@@ -14035,7 +13880,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14035
13880
|
}
|
|
14036
13881
|
setActiveSlide(currentSlideIndex);
|
|
14037
13882
|
if (slideCanvases.length === 0) {
|
|
14038
|
-
throw new Error(
|
|
13883
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
14039
13884
|
}
|
|
14040
13885
|
const firstCanvas = slideCanvases[0];
|
|
14041
13886
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -14043,12 +13888,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14043
13888
|
recordingCanvas.height = firstCanvas.height;
|
|
14044
13889
|
const ctx = recordingCanvas.getContext("2d");
|
|
14045
13890
|
if (!ctx) {
|
|
14046
|
-
throw new Error(
|
|
13891
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
14047
13892
|
}
|
|
14048
13893
|
const fps = 30;
|
|
14049
13894
|
const stream = recordingCanvas.captureStream(fps);
|
|
14050
13895
|
const recorder = new MediaRecorder(stream, {
|
|
14051
|
-
mimeType:
|
|
13896
|
+
mimeType: chunkFQXZZBFJ_js.pickSupportedMimeType([...chunkFQXZZBFJ_js.WEBM_MIME_CANDIDATES]),
|
|
14052
13897
|
videoBitsPerSecond: 5e6
|
|
14053
13898
|
});
|
|
14054
13899
|
const chunks = [];
|
|
@@ -14071,8 +13916,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
14071
13916
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
14072
13917
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
14073
13918
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
14074
|
-
const frameInterval =
|
|
14075
|
-
const framesNeeded =
|
|
13919
|
+
const frameInterval = chunkFQXZZBFJ_js.fpsToFrameIntervalMs(fps);
|
|
13920
|
+
const framesNeeded = chunkFQXZZBFJ_js.segmentFrameCount(duration, fps);
|
|
14076
13921
|
for (let f = 0; f < framesNeeded; f++) {
|
|
14077
13922
|
if (signal?.aborted) {
|
|
14078
13923
|
recorder.stop();
|
|
@@ -14119,9 +13964,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
14119
13964
|
}
|
|
14120
13965
|
setActiveSlide(currentSlideIndex);
|
|
14121
13966
|
if (frames.length === 0) {
|
|
14122
|
-
throw new Error(
|
|
13967
|
+
throw new Error(chunkWGLJ32FW_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
14123
13968
|
}
|
|
14124
|
-
const gifBytes =
|
|
13969
|
+
const gifBytes = chunkFQXZZBFJ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
14125
13970
|
onProgress?.(totalSlides, totalSlides);
|
|
14126
13971
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
14127
13972
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -14263,7 +14108,7 @@ function useExportSaveAs(input) {
|
|
|
14263
14108
|
setExportProgress(95);
|
|
14264
14109
|
setExportStatusMessage("Downloading...");
|
|
14265
14110
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
14266
|
-
|
|
14111
|
+
chunkFQXZZBFJ_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
14267
14112
|
setExportProgress(100);
|
|
14268
14113
|
} catch (err) {
|
|
14269
14114
|
if (err.name !== "AbortError") {
|
|
@@ -14286,7 +14131,7 @@ function useExportSaveAs(input) {
|
|
|
14286
14131
|
const blob = new Blob([data], {
|
|
14287
14132
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
14288
14133
|
});
|
|
14289
|
-
|
|
14134
|
+
chunkFQXZZBFJ_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
14290
14135
|
} catch (err) {
|
|
14291
14136
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
14292
14137
|
}
|
|
@@ -14362,7 +14207,7 @@ function safeConfirm(message) {
|
|
|
14362
14207
|
}
|
|
14363
14208
|
}
|
|
14364
14209
|
function downloadBlob2(blob, filename) {
|
|
14365
|
-
|
|
14210
|
+
chunkFQXZZBFJ_js.downloadBlob(blob, chunkFQXZZBFJ_js.sanitizeDownloadFilename(filename));
|
|
14366
14211
|
}
|
|
14367
14212
|
|
|
14368
14213
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -14461,21 +14306,21 @@ function useExportHandlers(input) {
|
|
|
14461
14306
|
{
|
|
14462
14307
|
scale: 2,
|
|
14463
14308
|
onProgress: (current, total) => {
|
|
14464
|
-
setExportProgress(
|
|
14465
|
-
setExportStatusMessage(
|
|
14309
|
+
setExportProgress(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14310
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Rendering", current, total));
|
|
14466
14311
|
},
|
|
14467
14312
|
signal: abortCtrl.signal
|
|
14468
14313
|
}
|
|
14469
14314
|
);
|
|
14470
|
-
setExportProgress(
|
|
14315
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14471
14316
|
setExportStatusMessage("Building PDF...");
|
|
14472
14317
|
await new Promise((r) => {
|
|
14473
14318
|
setTimeout(r, 100);
|
|
14474
14319
|
});
|
|
14475
|
-
setExportProgress(
|
|
14320
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14476
14321
|
setExportStatusMessage("Done!");
|
|
14477
14322
|
} catch (err) {
|
|
14478
|
-
if (!
|
|
14323
|
+
if (!chunkFQXZZBFJ_js.isExportAbortError(err)) {
|
|
14479
14324
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
14480
14325
|
}
|
|
14481
14326
|
} finally {
|
|
@@ -14505,21 +14350,21 @@ function useExportHandlers(input) {
|
|
|
14505
14350
|
{
|
|
14506
14351
|
scale: 2,
|
|
14507
14352
|
onProgress: (current, total) => {
|
|
14508
|
-
setExportProgress(
|
|
14509
|
-
setExportStatusMessage(
|
|
14353
|
+
setExportProgress(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14354
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Rendering", current, total));
|
|
14510
14355
|
},
|
|
14511
14356
|
signal: abortCtrl.signal
|
|
14512
14357
|
}
|
|
14513
14358
|
);
|
|
14514
|
-
setExportProgress(
|
|
14359
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14515
14360
|
setExportStatusMessage("Building PDF...");
|
|
14516
14361
|
await new Promise((r) => {
|
|
14517
14362
|
setTimeout(r, 100);
|
|
14518
14363
|
});
|
|
14519
|
-
setExportProgress(
|
|
14364
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14520
14365
|
setExportStatusMessage("Done!");
|
|
14521
14366
|
} catch (err) {
|
|
14522
|
-
if (!
|
|
14367
|
+
if (!chunkFQXZZBFJ_js.isExportAbortError(err)) {
|
|
14523
14368
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
14524
14369
|
}
|
|
14525
14370
|
} finally {
|
|
@@ -14560,22 +14405,22 @@ function useExportHandlers(input) {
|
|
|
14560
14405
|
scale: 1,
|
|
14561
14406
|
slideDurationMs: 3e3,
|
|
14562
14407
|
onProgress: (current, total) => {
|
|
14563
|
-
setExportProgress(
|
|
14564
|
-
setExportStatusMessage(
|
|
14408
|
+
setExportProgress(chunkFQXZZBFJ_js.slideProgressPercent(current, total, 45));
|
|
14409
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Capturing", current, total));
|
|
14565
14410
|
},
|
|
14566
14411
|
onRecordProgress: (current, total) => {
|
|
14567
|
-
setExportProgress(
|
|
14568
|
-
setExportStatusMessage(
|
|
14412
|
+
setExportProgress(chunkFQXZZBFJ_js.recordProgressPercent(current, total));
|
|
14413
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Recording", current, total));
|
|
14569
14414
|
},
|
|
14570
14415
|
signal: abortCtrl.signal
|
|
14571
14416
|
}
|
|
14572
14417
|
);
|
|
14573
|
-
setExportProgress(
|
|
14418
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14574
14419
|
setExportStatusMessage("Saving file...");
|
|
14575
14420
|
downloadBlob2(blob, "presentation.webm");
|
|
14576
|
-
setExportProgress(
|
|
14421
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14577
14422
|
} catch (err) {
|
|
14578
|
-
if (!
|
|
14423
|
+
if (!chunkFQXZZBFJ_js.isExportAbortError(err)) {
|
|
14579
14424
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
14580
14425
|
}
|
|
14581
14426
|
} finally {
|
|
@@ -14603,18 +14448,18 @@ function useExportHandlers(input) {
|
|
|
14603
14448
|
scale: 0.5,
|
|
14604
14449
|
slideDurationMs: 2e3,
|
|
14605
14450
|
onProgress: (current, total) => {
|
|
14606
|
-
setExportProgress(
|
|
14607
|
-
setExportStatusMessage(
|
|
14451
|
+
setExportProgress(chunkFQXZZBFJ_js.slideProgressPercent(current, total));
|
|
14452
|
+
setExportStatusMessage(chunkFQXZZBFJ_js.slideStatusLabel("Encoding", current, total));
|
|
14608
14453
|
},
|
|
14609
14454
|
signal: abortCtrl.signal
|
|
14610
14455
|
}
|
|
14611
14456
|
);
|
|
14612
|
-
setExportProgress(
|
|
14457
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
14613
14458
|
setExportStatusMessage("Saving file...");
|
|
14614
14459
|
downloadBlob2(blob, "presentation.gif");
|
|
14615
|
-
setExportProgress(
|
|
14460
|
+
setExportProgress(chunkFQXZZBFJ_js.EXPORT_DONE_PERCENT);
|
|
14616
14461
|
} catch (err) {
|
|
14617
|
-
if (!
|
|
14462
|
+
if (!chunkFQXZZBFJ_js.isExportAbortError(err)) {
|
|
14618
14463
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
14619
14464
|
}
|
|
14620
14465
|
} finally {
|
|
@@ -14654,7 +14499,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
14654
14499
|
}
|
|
14655
14500
|
printWindow.document.open();
|
|
14656
14501
|
printWindow.document.write(
|
|
14657
|
-
|
|
14502
|
+
chunkFQXZZBFJ_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
14658
14503
|
);
|
|
14659
14504
|
printWindow.document.close();
|
|
14660
14505
|
printWindow.focus();
|
|
@@ -14715,7 +14560,7 @@ function usePrintHandlers(input) {
|
|
|
14715
14560
|
if (svgs.length === 0) {
|
|
14716
14561
|
return;
|
|
14717
14562
|
}
|
|
14718
|
-
const printDoc =
|
|
14563
|
+
const printDoc = chunkFQXZZBFJ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
14719
14564
|
title: "Slides (Vector)",
|
|
14720
14565
|
orientation: settings.orientation,
|
|
14721
14566
|
colorFilter
|
|
@@ -14751,7 +14596,7 @@ function usePrintHandlers(input) {
|
|
|
14751
14596
|
if (settings.printWhat === "outline") {
|
|
14752
14597
|
openPrintWindow(
|
|
14753
14598
|
"Outline",
|
|
14754
|
-
`<div class="outline-page">${
|
|
14599
|
+
`<div class="outline-page">${chunkFQXZZBFJ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
14755
14600
|
settings.orientation,
|
|
14756
14601
|
colorFilter,
|
|
14757
14602
|
settings.frameSlides
|
|
@@ -14776,7 +14621,7 @@ function usePrintHandlers(input) {
|
|
|
14776
14621
|
if (settings.printWhat === "slides") {
|
|
14777
14622
|
openPrintWindow(
|
|
14778
14623
|
"Slides",
|
|
14779
|
-
|
|
14624
|
+
chunkFQXZZBFJ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
14780
14625
|
settings.orientation,
|
|
14781
14626
|
colorFilter,
|
|
14782
14627
|
settings.frameSlides
|
|
@@ -14786,7 +14631,7 @@ function usePrintHandlers(input) {
|
|
|
14786
14631
|
if (settings.printWhat === "notes") {
|
|
14787
14632
|
openPrintWindow(
|
|
14788
14633
|
"Notes Pages",
|
|
14789
|
-
|
|
14634
|
+
chunkFQXZZBFJ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
14790
14635
|
"portrait",
|
|
14791
14636
|
colorFilter,
|
|
14792
14637
|
settings.frameSlides
|
|
@@ -14797,7 +14642,7 @@ function usePrintHandlers(input) {
|
|
|
14797
14642
|
const spp = settings.slidesPerPage;
|
|
14798
14643
|
openPrintWindow(
|
|
14799
14644
|
`Handout ${spp} per page`,
|
|
14800
|
-
|
|
14645
|
+
chunkFQXZZBFJ_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
14801
14646
|
"portrait",
|
|
14802
14647
|
colorFilter,
|
|
14803
14648
|
settings.frameSlides
|
|
@@ -15153,7 +14998,7 @@ function usePropertyHandlers(input) {
|
|
|
15153
14998
|
width: canvasSize.width,
|
|
15154
14999
|
height: canvasSize.height
|
|
15155
15000
|
};
|
|
15156
|
-
setCompareResult(
|
|
15001
|
+
setCompareResult(chunkFQXZZBFJ_js.comparePresentation(cur, other));
|
|
15157
15002
|
setIsComparePanelOpen(true);
|
|
15158
15003
|
} catch (err) {
|
|
15159
15004
|
console.warn("Compare failed:", err);
|
|
@@ -15303,7 +15148,7 @@ function useIsMobile(input) {
|
|
|
15303
15148
|
const containerRef = input?.containerRef;
|
|
15304
15149
|
const isTouchDevice = React3.useSyncExternalStore(
|
|
15305
15150
|
subscribeTouchCapability,
|
|
15306
|
-
|
|
15151
|
+
chunkFQXZZBFJ_js.detectTouchDevice,
|
|
15307
15152
|
() => false
|
|
15308
15153
|
// server snapshot
|
|
15309
15154
|
);
|
|
@@ -15319,7 +15164,7 @@ function useIsMobile(input) {
|
|
|
15319
15164
|
}
|
|
15320
15165
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
15321
15166
|
});
|
|
15322
|
-
const [orientation, setOrientation] = React3.useState(
|
|
15167
|
+
const [orientation, setOrientation] = React3.useState(chunkFQXZZBFJ_js.detectOrientation);
|
|
15323
15168
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = React3.useState(false);
|
|
15324
15169
|
const [initialViewportHeight] = React3.useState(
|
|
15325
15170
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -15363,7 +15208,7 @@ function useIsMobile(input) {
|
|
|
15363
15208
|
return;
|
|
15364
15209
|
}
|
|
15365
15210
|
const handleOrientationChange = () => {
|
|
15366
|
-
setOrientation(
|
|
15211
|
+
setOrientation(chunkFQXZZBFJ_js.detectOrientation());
|
|
15367
15212
|
};
|
|
15368
15213
|
if (screen.orientation) {
|
|
15369
15214
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -15393,9 +15238,9 @@ function useIsMobile(input) {
|
|
|
15393
15238
|
window.addEventListener("resize", handleResize);
|
|
15394
15239
|
return () => window.removeEventListener("resize", handleResize);
|
|
15395
15240
|
}, [isTouchDevice, initialViewportHeight]);
|
|
15396
|
-
const isMobile =
|
|
15397
|
-
const isTablet = !isMobile && containerWidth >=
|
|
15398
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
15241
|
+
const isMobile = chunkFQXZZBFJ_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
15242
|
+
const isTablet = !isMobile && containerWidth >= chunkFQXZZBFJ_js.MOBILE_BREAKPOINT && containerWidth < chunkFQXZZBFJ_js.TABLET_BREAKPOINT;
|
|
15243
|
+
const isDesktop = !isMobile && containerWidth >= chunkFQXZZBFJ_js.TABLET_BREAKPOINT;
|
|
15399
15244
|
return {
|
|
15400
15245
|
isMobile,
|
|
15401
15246
|
isTablet,
|
|
@@ -15456,11 +15301,11 @@ function useViewerDialogs(input) {
|
|
|
15456
15301
|
);
|
|
15457
15302
|
const [embedFontsEnabled, setEmbedFontsEnabled] = React3.useState(false);
|
|
15458
15303
|
const [isNarrowViewport, setIsNarrowViewport] = React3.useState(
|
|
15459
|
-
() => typeof window !== "undefined" ?
|
|
15304
|
+
() => typeof window !== "undefined" ? chunkFQXZZBFJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
15460
15305
|
);
|
|
15461
15306
|
React3.useEffect(() => {
|
|
15462
15307
|
const handleWindow = () => setIsNarrowViewport(
|
|
15463
|
-
|
|
15308
|
+
chunkFQXZZBFJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
15464
15309
|
);
|
|
15465
15310
|
let observer = null;
|
|
15466
15311
|
let raf = 0;
|
|
@@ -15474,12 +15319,12 @@ function useViewerDialogs(input) {
|
|
|
15474
15319
|
const entry = entries[0];
|
|
15475
15320
|
if (entry) {
|
|
15476
15321
|
setIsNarrowViewport(
|
|
15477
|
-
|
|
15322
|
+
chunkFQXZZBFJ_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
15478
15323
|
);
|
|
15479
15324
|
}
|
|
15480
15325
|
});
|
|
15481
15326
|
observer.observe(el);
|
|
15482
|
-
setIsNarrowViewport(
|
|
15327
|
+
setIsNarrowViewport(chunkFQXZZBFJ_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
15483
15328
|
};
|
|
15484
15329
|
attach();
|
|
15485
15330
|
window.addEventListener("resize", handleWindow);
|
|
@@ -15920,7 +15765,7 @@ function useSerialize(input) {
|
|
|
15920
15765
|
return {
|
|
15921
15766
|
...el,
|
|
15922
15767
|
text: pendingEditText,
|
|
15923
|
-
textSegments:
|
|
15768
|
+
textSegments: chunkFQXZZBFJ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
15924
15769
|
};
|
|
15925
15770
|
});
|
|
15926
15771
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -16313,7 +16158,7 @@ function useEditorOperations(input) {
|
|
|
16313
16158
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
16314
16159
|
React3.useEffect(() => {
|
|
16315
16160
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
16316
|
-
copiedFormatRef.current =
|
|
16161
|
+
copiedFormatRef.current = chunkFQXZZBFJ_js.copyFormatFromElement(selectedElement);
|
|
16317
16162
|
} else if (!formatPainterActive) {
|
|
16318
16163
|
copiedFormatRef.current = null;
|
|
16319
16164
|
}
|
|
@@ -16339,7 +16184,7 @@ function useEditorOperations(input) {
|
|
|
16339
16184
|
e.stopPropagation();
|
|
16340
16185
|
const element = elementLookup.get(elementId);
|
|
16341
16186
|
if (element) {
|
|
16342
|
-
const updated =
|
|
16187
|
+
const updated = chunkFQXZZBFJ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
16343
16188
|
const updates = {};
|
|
16344
16189
|
if (chunkOBLHB72P_js.hasShapeProperties(updated)) {
|
|
16345
16190
|
updates.shapeStyle = updated.shapeStyle;
|
|
@@ -17285,7 +17130,7 @@ function useYjsProvider({ config }) {
|
|
|
17285
17130
|
syncGraceRef.current = setTimeout(() => {
|
|
17286
17131
|
syncGraceRef.current = null;
|
|
17287
17132
|
setSynced(true);
|
|
17288
|
-
},
|
|
17133
|
+
}, chunkFQXZZBFJ_js.INITIAL_SYNC_GRACE_MS);
|
|
17289
17134
|
}, [clearSyncGrace]);
|
|
17290
17135
|
const teardown = React3.useCallback(() => {
|
|
17291
17136
|
if (timeoutRef.current) {
|
|
@@ -17323,7 +17168,7 @@ function useYjsProvider({ config }) {
|
|
|
17323
17168
|
if (config.authToken) {
|
|
17324
17169
|
opts.password = config.authToken;
|
|
17325
17170
|
}
|
|
17326
|
-
const provider = new WebrtcProvider(
|
|
17171
|
+
const provider = new WebrtcProvider(chunkFQXZZBFJ_js.validateRoomId(config.roomId), yDoc, opts);
|
|
17327
17172
|
setDoc(yDoc);
|
|
17328
17173
|
setAwareness(provider.awareness);
|
|
17329
17174
|
setClientId(provider.awareness.clientID);
|
|
@@ -17360,12 +17205,12 @@ function useYjsProvider({ config }) {
|
|
|
17360
17205
|
if (!config) {
|
|
17361
17206
|
return;
|
|
17362
17207
|
}
|
|
17363
|
-
const roomId =
|
|
17208
|
+
const roomId = chunkFQXZZBFJ_js.validateRoomId(config.roomId);
|
|
17364
17209
|
if (config.transport === "webrtc") {
|
|
17365
17210
|
await initWebrtc();
|
|
17366
17211
|
return;
|
|
17367
17212
|
}
|
|
17368
|
-
if (
|
|
17213
|
+
if (chunkFQXZZBFJ_js.isMixedContentBlocked(config.serverUrl)) {
|
|
17369
17214
|
console.warn(
|
|
17370
17215
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
17371
17216
|
);
|
|
@@ -17422,7 +17267,7 @@ function useYjsProvider({ config }) {
|
|
|
17422
17267
|
cleanupRef.current = null;
|
|
17423
17268
|
setStatus("error");
|
|
17424
17269
|
}
|
|
17425
|
-
},
|
|
17270
|
+
}, chunkFQXZZBFJ_js.CONNECTION_TIMEOUT_MS);
|
|
17426
17271
|
}
|
|
17427
17272
|
setDoc(yDoc);
|
|
17428
17273
|
setAwareness(provider.awareness);
|
|
@@ -17497,7 +17342,7 @@ function usePresenceTracking({
|
|
|
17497
17342
|
awareness.setLocalStateField("presence", state);
|
|
17498
17343
|
lastBroadcastRef.current = Date.now();
|
|
17499
17344
|
};
|
|
17500
|
-
if (elapsed >=
|
|
17345
|
+
if (elapsed >= chunkFQXZZBFJ_js.BROADCAST_THROTTLE_MS) {
|
|
17501
17346
|
if (pendingBroadcastRef.current) {
|
|
17502
17347
|
clearTimeout(pendingBroadcastRef.current);
|
|
17503
17348
|
pendingBroadcastRef.current = null;
|
|
@@ -17507,7 +17352,7 @@ function usePresenceTracking({
|
|
|
17507
17352
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
17508
17353
|
pendingBroadcastRef.current = null;
|
|
17509
17354
|
flush();
|
|
17510
|
-
},
|
|
17355
|
+
}, chunkFQXZZBFJ_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
17511
17356
|
}
|
|
17512
17357
|
},
|
|
17513
17358
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -17532,7 +17377,7 @@ function usePresenceTracking({
|
|
|
17532
17377
|
return;
|
|
17533
17378
|
}
|
|
17534
17379
|
const handleChange = () => {
|
|
17535
|
-
const users =
|
|
17380
|
+
const users = chunkFQXZZBFJ_js.derivePresenceList(
|
|
17536
17381
|
awareness.getStates(),
|
|
17537
17382
|
localClientId,
|
|
17538
17383
|
canvasWidth,
|
|
@@ -17580,7 +17425,7 @@ function useCollaborativeState({
|
|
|
17580
17425
|
canvasWidth,
|
|
17581
17426
|
canvasHeight
|
|
17582
17427
|
}) {
|
|
17583
|
-
const userColor =
|
|
17428
|
+
const userColor = chunkFQXZZBFJ_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
17584
17429
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
17585
17430
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
17586
17431
|
awareness,
|
|
@@ -17686,7 +17531,7 @@ function useYjsDocumentSync({
|
|
|
17686
17531
|
const { PptxHandler: PptxHandler2 } = await import('./dist-MVSQ6PWP.js');
|
|
17687
17532
|
const handler = new PptxHandler2();
|
|
17688
17533
|
await handler.load(sourceBytes.buffer);
|
|
17689
|
-
const currentSlides =
|
|
17534
|
+
const currentSlides = chunkFQXZZBFJ_js.readSlidesFromYDoc(
|
|
17690
17535
|
doc
|
|
17691
17536
|
);
|
|
17692
17537
|
const slidesToSave = buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
@@ -17707,11 +17552,11 @@ function useYjsDocumentSync({
|
|
|
17707
17552
|
lastSyncedRef.current = serialized;
|
|
17708
17553
|
void (async () => {
|
|
17709
17554
|
const factories = await getFactories();
|
|
17710
|
-
|
|
17555
|
+
chunkFQXZZBFJ_js.reconcileSlidesInYDoc(
|
|
17711
17556
|
slides,
|
|
17712
17557
|
doc,
|
|
17713
17558
|
factories,
|
|
17714
|
-
|
|
17559
|
+
chunkFQXZZBFJ_js.LOCAL_SYNC_ORIGIN
|
|
17715
17560
|
);
|
|
17716
17561
|
scheduleWriteBack();
|
|
17717
17562
|
})();
|
|
@@ -17721,10 +17566,10 @@ function useYjsDocumentSync({
|
|
|
17721
17566
|
return;
|
|
17722
17567
|
}
|
|
17723
17568
|
const handleChange = (_events, transaction) => {
|
|
17724
|
-
if (transaction?.origin ===
|
|
17569
|
+
if (transaction?.origin === chunkFQXZZBFJ_js.LOCAL_SYNC_ORIGIN) {
|
|
17725
17570
|
return;
|
|
17726
17571
|
}
|
|
17727
|
-
const remoteSlides =
|
|
17572
|
+
const remoteSlides = chunkFQXZZBFJ_js.readSlidesFromYDoc(
|
|
17728
17573
|
doc
|
|
17729
17574
|
);
|
|
17730
17575
|
if (remoteSlides.length === 0) {
|
|
@@ -17742,7 +17587,7 @@ function useYjsDocumentSync({
|
|
|
17742
17587
|
});
|
|
17743
17588
|
scheduleWriteBack();
|
|
17744
17589
|
};
|
|
17745
|
-
const unobserve =
|
|
17590
|
+
const unobserve = chunkFQXZZBFJ_js.observeYDocSlides(
|
|
17746
17591
|
doc,
|
|
17747
17592
|
handleChange
|
|
17748
17593
|
);
|
|
@@ -17998,7 +17843,7 @@ function useTouchGestures(input) {
|
|
|
17998
17843
|
if (!el || !enabled) {
|
|
17999
17844
|
return;
|
|
18000
17845
|
}
|
|
18001
|
-
const recognizer =
|
|
17846
|
+
const recognizer = chunkFQXZZBFJ_js.createTouchGestureRecognizer({
|
|
18002
17847
|
getScale: () => scaleRef.current,
|
|
18003
17848
|
minScale: MIN_ZOOM_SCALE,
|
|
18004
17849
|
maxScale: MAX_ZOOM_SCALE,
|
|
@@ -18041,7 +17886,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
18041
17886
|
return;
|
|
18042
17887
|
}
|
|
18043
17888
|
const rect = active.getBoundingClientRect();
|
|
18044
|
-
const delta =
|
|
17889
|
+
const delta = chunkFQXZZBFJ_js.computeScrollDelta(
|
|
18045
17890
|
{ top: rect.top, bottom: rect.bottom },
|
|
18046
17891
|
window.innerHeight,
|
|
18047
17892
|
keyboardInset
|
|
@@ -18061,8 +17906,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18061
17906
|
return;
|
|
18062
17907
|
}
|
|
18063
17908
|
const update = () => {
|
|
18064
|
-
const metrics =
|
|
18065
|
-
const inset = metrics ?
|
|
17909
|
+
const metrics = chunkFQXZZBFJ_js.readViewportMetrics(window);
|
|
17910
|
+
const inset = metrics ? chunkFQXZZBFJ_js.computeKeyboardInset(metrics) : 0;
|
|
18066
17911
|
setKeyboardInset(inset);
|
|
18067
17912
|
if (inset > 0) {
|
|
18068
17913
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -18073,8 +17918,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18073
17918
|
vv.addEventListener("scroll", update);
|
|
18074
17919
|
const onFocusIn = () => {
|
|
18075
17920
|
window.requestAnimationFrame(() => {
|
|
18076
|
-
const metrics =
|
|
18077
|
-
const inset = metrics ?
|
|
17921
|
+
const metrics = chunkFQXZZBFJ_js.readViewportMetrics(window);
|
|
17922
|
+
const inset = metrics ? chunkFQXZZBFJ_js.computeKeyboardInset(metrics) : 0;
|
|
18078
17923
|
if (inset > 0) {
|
|
18079
17924
|
scrollFocusedIntoView(inset);
|
|
18080
17925
|
}
|
|
@@ -18087,7 +17932,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
18087
17932
|
document.removeEventListener("focusin", onFocusIn);
|
|
18088
17933
|
};
|
|
18089
17934
|
}, [enabled]);
|
|
18090
|
-
return { keyboardInset, isKeyboardOpen:
|
|
17935
|
+
return { keyboardInset, isKeyboardOpen: chunkFQXZZBFJ_js.isKeyboardOpen(keyboardInset) };
|
|
18091
17936
|
}
|
|
18092
17937
|
var LEFT_MIN = 120;
|
|
18093
17938
|
var LEFT_MAX = 400;
|