pptx-react-viewer 4.24.2 → 4.24.3

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{AiChatPanel-OCGS4REH.mjs → AiChatPanel-B7LBWZ46.mjs} +3 -3
  3. package/dist/AiChatPanel-B7LBWZ46.mjs.br +0 -0
  4. package/dist/AiChatPanel-B7LBWZ46.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-XRUVUXZV.js → AiChatPanel-XFP4F344.js} +27 -27
  6. package/dist/AiChatPanel-XFP4F344.js.br +0 -0
  7. package/dist/AiChatPanel-XFP4F344.js.gz +0 -0
  8. package/dist/{Model3DScene-UTF7C2I7.mjs → Model3DScene-FLE6KYYG.mjs} +1 -1
  9. package/dist/{Model3DScene-UTF7C2I7.mjs.br → Model3DScene-FLE6KYYG.mjs.br} +0 -0
  10. package/dist/Model3DScene-FLE6KYYG.mjs.gz +0 -0
  11. package/dist/{Model3DScene-VSEMIJP4.js → Model3DScene-XCWVVQRN.js} +2 -2
  12. package/dist/Model3DScene-XCWVVQRN.js.br +0 -0
  13. package/dist/Model3DScene-XCWVVQRN.js.gz +0 -0
  14. package/dist/{chunk-3ARZNYHA.js → chunk-7MPBJ5S4.js} +1130 -1121
  15. package/dist/chunk-7MPBJ5S4.js.br +0 -0
  16. package/dist/chunk-7MPBJ5S4.js.gz +0 -0
  17. package/dist/{chunk-PPGKTRGJ.js → chunk-7YRLWWRY.js} +831 -824
  18. package/dist/chunk-7YRLWWRY.js.br +0 -0
  19. package/dist/chunk-7YRLWWRY.js.gz +0 -0
  20. package/dist/{chunk-G56N6OGG.mjs → chunk-C7SKC34H.mjs} +9 -5
  21. package/dist/chunk-C7SKC34H.mjs.br +0 -0
  22. package/dist/chunk-C7SKC34H.mjs.gz +0 -0
  23. package/dist/{chunk-M243P5KZ.mjs → chunk-HB5Z3SSC.mjs} +15 -8
  24. package/dist/chunk-HB5Z3SSC.mjs.br +0 -0
  25. package/dist/chunk-HB5Z3SSC.mjs.gz +0 -0
  26. package/dist/{chunk-XDX6EEWB.mjs → chunk-HF2JXYZT.mjs} +24 -15
  27. package/dist/chunk-HF2JXYZT.mjs.br +0 -0
  28. package/dist/chunk-HF2JXYZT.mjs.gz +0 -0
  29. package/dist/{chunk-BOW27WFH.js → chunk-HNUSASYH.js} +5 -5
  30. package/dist/chunk-HNUSASYH.js.br +0 -0
  31. package/dist/chunk-HNUSASYH.js.gz +0 -0
  32. package/dist/{chunk-G5F3WAZE.js → chunk-MDVRIMCW.js} +195 -191
  33. package/dist/chunk-MDVRIMCW.js.br +0 -0
  34. package/dist/chunk-MDVRIMCW.js.gz +0 -0
  35. package/dist/{chunk-3DDSCNZX.mjs → chunk-SDSL4ZDQ.mjs} +1 -1
  36. package/dist/chunk-SDSL4ZDQ.mjs.br +0 -0
  37. package/dist/chunk-SDSL4ZDQ.mjs.gz +0 -0
  38. package/dist/{chunk-VFLCUB5I.mjs → chunk-TJG3I5L4.mjs} +226 -144
  39. package/dist/chunk-TJG3I5L4.mjs.br +0 -0
  40. package/dist/{chunk-VFLCUB5I.mjs.gz → chunk-TJG3I5L4.mjs.gz} +0 -0
  41. package/dist/{chunk-WEV3C7IC.js → chunk-XEESKNA6.js} +227 -143
  42. package/dist/chunk-XEESKNA6.js.br +0 -0
  43. package/dist/chunk-XEESKNA6.js.gz +0 -0
  44. package/dist/index.js +61 -61
  45. package/dist/index.js.br +0 -0
  46. package/dist/index.js.gz +0 -0
  47. package/dist/index.mjs +5 -5
  48. package/dist/index.mjs.br +0 -0
  49. package/dist/index.mjs.gz +0 -0
  50. package/dist/internals.js +104 -104
  51. package/dist/internals.js.br +0 -0
  52. package/dist/internals.js.gz +0 -0
  53. package/dist/internals.mjs +3 -3
  54. package/dist/internals.mjs.br +0 -0
  55. package/dist/internals.mjs.gz +0 -0
  56. package/dist/pptx-viewer.css +1 -1
  57. package/dist/pptx-viewer.css.br +0 -0
  58. package/dist/pptx-viewer.css.gz +0 -0
  59. package/dist/viewer/index.js +26 -26
  60. package/dist/viewer/index.js.br +0 -0
  61. package/dist/viewer/index.js.gz +0 -0
  62. package/dist/viewer/index.mjs +5 -5
  63. package/dist/viewer/index.mjs.br +0 -0
  64. package/dist/viewer/index.mjs.gz +0 -0
  65. package/package.json +1 -1
  66. package/dist/AiChatPanel-OCGS4REH.mjs.br +0 -0
  67. package/dist/AiChatPanel-OCGS4REH.mjs.gz +0 -0
  68. package/dist/AiChatPanel-XRUVUXZV.js.br +0 -0
  69. package/dist/AiChatPanel-XRUVUXZV.js.gz +0 -0
  70. package/dist/Model3DScene-UTF7C2I7.mjs.gz +0 -0
  71. package/dist/Model3DScene-VSEMIJP4.js.br +0 -0
  72. package/dist/Model3DScene-VSEMIJP4.js.gz +0 -0
  73. package/dist/chunk-3ARZNYHA.js.br +0 -0
  74. package/dist/chunk-3ARZNYHA.js.gz +0 -0
  75. package/dist/chunk-3DDSCNZX.mjs.br +0 -0
  76. package/dist/chunk-3DDSCNZX.mjs.gz +0 -0
  77. package/dist/chunk-BOW27WFH.js.br +0 -0
  78. package/dist/chunk-BOW27WFH.js.gz +0 -0
  79. package/dist/chunk-G56N6OGG.mjs.br +0 -0
  80. package/dist/chunk-G56N6OGG.mjs.gz +0 -0
  81. package/dist/chunk-G5F3WAZE.js.br +0 -0
  82. package/dist/chunk-G5F3WAZE.js.gz +0 -0
  83. package/dist/chunk-M243P5KZ.mjs.br +0 -0
  84. package/dist/chunk-M243P5KZ.mjs.gz +0 -0
  85. package/dist/chunk-PPGKTRGJ.js.br +0 -0
  86. package/dist/chunk-PPGKTRGJ.js.gz +0 -0
  87. package/dist/chunk-VFLCUB5I.mjs.br +0 -0
  88. package/dist/chunk-WEV3C7IC.js.br +0 -0
  89. package/dist/chunk-WEV3C7IC.js.gz +0 -0
  90. package/dist/chunk-XDX6EEWB.mjs.br +0 -0
  91. package/dist/chunk-XDX6EEWB.mjs.gz +0 -0
@@ -75495,20 +75495,20 @@ function descendantsOf(node, childrenOf) {
75495
75495
  }
75496
75496
  return out;
75497
75497
  }
75498
- function ancestorsOf(node, parentOf) {
75498
+ function ancestorsOf(node, parentOf2) {
75499
75499
  const out = [];
75500
- let current = parentOf.get(node.id);
75500
+ let current = parentOf2.get(node.id);
75501
75501
  while (current) {
75502
75502
  out.push(current);
75503
- current = parentOf.get(current.id);
75503
+ current = parentOf2.get(current.id);
75504
75504
  }
75505
75505
  return out;
75506
75506
  }
75507
- function siblingGroupOf(node, parentOf, childrenOf, roots) {
75508
- const parent = parentOf.get(node.id);
75507
+ function siblingGroupOf(node, parentOf2, childrenOf, roots) {
75508
+ const parent = parentOf2.get(node.id);
75509
75509
  return parent ? childrenOf.get(parent.id) ?? [] : roots;
75510
75510
  }
75511
- function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
75511
+ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf2, roots) {
75512
75512
  const out = [];
75513
75513
  const seen = /* @__PURE__ */ new Set();
75514
75514
  const add7 = (node) => {
@@ -75538,22 +75538,22 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
75538
75538
  addAll2(descendantsOf(node, childrenOf));
75539
75539
  break;
75540
75540
  case "par": {
75541
- const parent = parentOf.get(node.id);
75541
+ const parent = parentOf2.get(node.id);
75542
75542
  if (parent) {
75543
75543
  add7(parent);
75544
75544
  }
75545
75545
  break;
75546
75546
  }
75547
75547
  case "ancst":
75548
- addAll2(ancestorsOf(node, parentOf));
75548
+ addAll2(ancestorsOf(node, parentOf2));
75549
75549
  break;
75550
75550
  case "ancstOrSelf":
75551
75551
  add7(node);
75552
- addAll2(ancestorsOf(node, parentOf));
75552
+ addAll2(ancestorsOf(node, parentOf2));
75553
75553
  break;
75554
75554
  case "followSib":
75555
75555
  case "precedSib": {
75556
- const siblings = siblingGroupOf(node, parentOf, childrenOf, roots);
75556
+ const siblings = siblingGroupOf(node, parentOf2, childrenOf, roots);
75557
75557
  const index = siblings.findIndex((sibling) => sibling.id === node.id);
75558
75558
  addAll2(axis === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index));
75559
75559
  break;
@@ -75565,7 +75565,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
75565
75565
  break;
75566
75566
  }
75567
75567
  const excluded = new Set(
75568
- (axis === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf)).map(
75568
+ (axis === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf2)).map(
75569
75569
  (n) => n.id
75570
75570
  )
75571
75571
  );
@@ -75574,7 +75574,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
75574
75574
  break;
75575
75575
  }
75576
75576
  case "root": {
75577
- const ancestors = ancestorsOf(node, parentOf);
75577
+ const ancestors = ancestorsOf(node, parentOf2);
75578
75578
  add7(ancestors.length > 0 ? ancestors[ancestors.length - 1] : node);
75579
75579
  break;
75580
75580
  }
@@ -75620,11 +75620,11 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
75620
75620
  }
75621
75621
  const byId = new Map(nodes.map((n) => [n.id, n]));
75622
75622
  const childrenOf = /* @__PURE__ */ new Map();
75623
- const parentOf = /* @__PURE__ */ new Map();
75623
+ const parentOf2 = /* @__PURE__ */ new Map();
75624
75624
  for (const node of nodes) {
75625
75625
  const parent = node.parentId ? byId.get(node.parentId) : void 0;
75626
75626
  if (parent) {
75627
- parentOf.set(node.id, parent);
75627
+ parentOf2.set(node.id, parent);
75628
75628
  const list2 = childrenOf.get(parent.id);
75629
75629
  if (list2) {
75630
75630
  list2.push(node);
@@ -75644,7 +75644,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
75644
75644
  nextHop = 1;
75645
75645
  } else if (context !== void 0) {
75646
75646
  current = applyPointTypeAndRange(
75647
- navigateAxisHop(context, axis[0], nodes, childrenOf, parentOf, roots),
75647
+ navigateAxisHop(context, axis[0], nodes, childrenOf, parentOf2, roots),
75648
75648
  pointTypes?.[0],
75649
75649
  start?.[0],
75650
75650
  count?.[0]
@@ -75656,7 +75656,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
75656
75656
  }
75657
75657
  for (let hop = nextHop; hop < axis.length; hop += 1) {
75658
75658
  current = applyPointTypeAndRange(
75659
- navigateAxisHop(current, axis[hop], nodes, childrenOf, parentOf, roots),
75659
+ navigateAxisHop(current, axis[hop], nodes, childrenOf, parentOf2, roots),
75660
75660
  pointTypes?.[hop],
75661
75661
  start?.[hop],
75662
75662
  count?.[hop]
@@ -119499,7 +119499,7 @@ function nestLegacyCommentReplies(comments) {
119499
119499
  byOwnKey.set(`${authorId}:${idx}`, comment);
119500
119500
  }
119501
119501
  }
119502
- const parentOf = /* @__PURE__ */ new Map();
119502
+ const parentOf2 = /* @__PURE__ */ new Map();
119503
119503
  const childrenOf = /* @__PURE__ */ new Map();
119504
119504
  for (const comment of comments) {
119505
119505
  const ref = parseLegacyThreadingParent(comment.rawXml);
@@ -119511,7 +119511,7 @@ function nestLegacyCommentReplies(comments) {
119511
119511
  continue;
119512
119512
  }
119513
119513
  comment.parentId = parent.id;
119514
- parentOf.set(comment.id, parent);
119514
+ parentOf2.set(comment.id, parent);
119515
119515
  const siblings = childrenOf.get(parent.id) ?? [];
119516
119516
  siblings.push(comment);
119517
119517
  childrenOf.set(parent.id, siblings);
@@ -119523,7 +119523,7 @@ function nestLegacyCommentReplies(comments) {
119523
119523
  let current = comment;
119524
119524
  const seen = /* @__PURE__ */ new Set([comment.id]);
119525
119525
  for (; ; ) {
119526
- const parent = parentOf.get(current.id);
119526
+ const parent = parentOf2.get(current.id);
119527
119527
  if (!parent || seen.has(parent.id)) {
119528
119528
  return current;
119529
119529
  }
@@ -119532,7 +119532,7 @@ function nestLegacyCommentReplies(comments) {
119532
119532
  }
119533
119533
  };
119534
119534
  for (const comment of comments) {
119535
- if (parentOf.has(comment.id) || childrenOf.has(comment.id)) {
119535
+ if (parentOf2.has(comment.id) || childrenOf.has(comment.id)) {
119536
119536
  comment.threadId = rootOf4(comment).id;
119537
119537
  }
119538
119538
  }
@@ -119550,7 +119550,7 @@ function nestLegacyCommentReplies(comments) {
119550
119550
  };
119551
119551
  const roots = [];
119552
119552
  for (const comment of comments) {
119553
- if (!parentOf.has(comment.id)) {
119553
+ if (!parentOf2.has(comment.id)) {
119554
119554
  roots.push(nest(comment));
119555
119555
  }
119556
119556
  }
@@ -275982,6 +275982,149 @@ function buildSmartArt3DSpecForElement(element, options2 = {}) {
275982
275982
  });
275983
275983
  return model.meshes.length > 0 ? model : null;
275984
275984
  }
275985
+ function polygonBounds(points4) {
275986
+ const pairs3 = points4.trim().split(/\s+/u);
275987
+ let minX = Infinity;
275988
+ let minY = Infinity;
275989
+ let maxX = -Infinity;
275990
+ let maxY = -Infinity;
275991
+ for (const pair of pairs3) {
275992
+ const comma = pair.indexOf(",");
275993
+ if (comma < 0) {
275994
+ continue;
275995
+ }
275996
+ const x = parseFloat(pair.slice(0, comma));
275997
+ const y = parseFloat(pair.slice(comma + 1));
275998
+ if (!isFinite(x) || !isFinite(y)) {
275999
+ continue;
276000
+ }
276001
+ if (x < minX) {
276002
+ minX = x;
276003
+ }
276004
+ if (x > maxX) {
276005
+ maxX = x;
276006
+ }
276007
+ if (y < minY) {
276008
+ minY = y;
276009
+ }
276010
+ if (y > maxY) {
276011
+ maxY = y;
276012
+ }
276013
+ }
276014
+ if (!isFinite(minX)) {
276015
+ return { x: 0, y: 0, width: 0, height: 0 };
276016
+ }
276017
+ return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
276018
+ }
276019
+ function renderedNodeToShape(rn, nodeId, family2) {
276020
+ const id = `reflow-${family2}-${nodeId}`;
276021
+ const text3 = rn.text || void 0;
276022
+ if (rn.kind === "rect") {
276023
+ return {
276024
+ id,
276025
+ shapeType: rn.rx > 0 ? "roundRect" : "rect",
276026
+ x: rn.x,
276027
+ y: rn.y,
276028
+ width: rn.width,
276029
+ height: rn.height,
276030
+ rotation: 0,
276031
+ fillColor: rn.fill,
276032
+ strokeColor: rn.stroke,
276033
+ strokeWidth: rn.strokeWidth,
276034
+ text: text3,
276035
+ fontSize: rn.fontSize
276036
+ };
276037
+ }
276038
+ if (rn.kind === "circle") {
276039
+ return {
276040
+ id,
276041
+ shapeType: "ellipse",
276042
+ x: rn.cx - rn.r,
276043
+ y: rn.cy - rn.r,
276044
+ width: rn.r * 2,
276045
+ height: rn.r * 2,
276046
+ rotation: 0,
276047
+ fillColor: rn.fill,
276048
+ strokeColor: rn.stroke,
276049
+ strokeWidth: rn.strokeWidth,
276050
+ text: text3,
276051
+ fontSize: rn.fontSize
276052
+ };
276053
+ }
276054
+ const bounds = polygonBounds(rn.points);
276055
+ return {
276056
+ id,
276057
+ shapeType: "chevron",
276058
+ x: bounds.x,
276059
+ y: bounds.y,
276060
+ width: bounds.width,
276061
+ height: bounds.height,
276062
+ rotation: 0,
276063
+ fillColor: rn.fill,
276064
+ strokeColor: rn.stroke,
276065
+ strokeWidth: rn.strokeWidth,
276066
+ text: text3,
276067
+ fontSize: rn.fontSize
276068
+ };
276069
+ }
276070
+ function reflowToDrawingShapes(layoutResult, nodes) {
276071
+ const flat = flattenNodes([...nodes]);
276072
+ const family2 = layoutResult.family;
276073
+ const shapes = [];
276074
+ for (let i2 = 0; i2 < layoutResult.nodes.length; i2++) {
276075
+ const rn = layoutResult.nodes[i2];
276076
+ const sourceNode = flat[i2];
276077
+ const nodeId = sourceNode?.id ?? rn.key;
276078
+ shapes.push(renderedNodeToShape(rn, nodeId, family2));
276079
+ }
276080
+ return shapes;
276081
+ }
276082
+ function rebuildDrawingShapesIfCleared(smartArtData, layout, palette, style, elementId, box) {
276083
+ const shapes = smartArtData.drawingShapes;
276084
+ if (shapes === void 0 || shapes.length > 0 || smartArtData.nodes.length === 0) {
276085
+ return smartArtData;
276086
+ }
276087
+ const layoutResult = computeSmartArtElementLayout(
276088
+ { ...smartArtData, layout },
276089
+ smartArtData.nodes,
276090
+ box,
276091
+ palette,
276092
+ style,
276093
+ elementId
276094
+ );
276095
+ return {
276096
+ ...smartArtData,
276097
+ drawingShapes: reflowToDrawingShapes(layoutResult, smartArtData.nodes)
276098
+ };
276099
+ }
276100
+ function reflowed(element, next) {
276101
+ return rebuildDrawingShapesIfCleared(
276102
+ next,
276103
+ next.layout,
276104
+ resolvePalette(next),
276105
+ next.style ?? "flat",
276106
+ element.id,
276107
+ { width: element.width, height: element.height }
276108
+ );
276109
+ }
276110
+ function commitSmartArtNodeText(element, nodeId, text3) {
276111
+ if (element.type !== "smartArt" || !element.smartArtData) {
276112
+ return null;
276113
+ }
276114
+ const data = element.smartArtData;
276115
+ if (!shouldCommitSmartArtNodeText(data, nodeId, text3)) {
276116
+ return null;
276117
+ }
276118
+ return reflowed(element, updateSmartArtNodeText(data, nodeId, text3));
276119
+ }
276120
+ function commitSmartArtNodeFill(element, nodeId, fill) {
276121
+ if (element.type !== "smartArt" || !element.smartArtData) {
276122
+ return null;
276123
+ }
276124
+ const data = element.smartArtData;
276125
+ const next = setSmartArtNodeStyle(data, nodeId, { fillColor: fill });
276126
+ return next === data ? null : reflowed(element, next);
276127
+ }
275985
276128
  init_chart_3d_oblique_bars();
275986
276129
  init_chart_view_model_chrome();
275987
276130
  var PT = 4 / 3;
@@ -279953,7 +280096,7 @@ function isEditorTextInputTarget(target) {
279953
280096
  return FORM_FIELD_TAGS.test(element.tagName) || element.isContentEditable === true;
279954
280097
  }
279955
280098
  var CANVAS_SELECTOR = "[data-pptx-viewport]";
279956
- var CONTROL_SELECTOR = [
280099
+ var CONTROL_SELECTOR2 = [
279957
280100
  "button",
279958
280101
  "a[href]",
279959
280102
  "summary",
@@ -280003,7 +280146,7 @@ function isEditorControlTarget(target) {
280003
280146
  if (tag2.includes("-")) {
280004
280147
  return true;
280005
280148
  }
280006
- return Boolean(element.closest(CONTROL_SELECTOR));
280149
+ return Boolean(element.closest(CONTROL_SELECTOR2));
280007
280150
  }
280008
280151
  var GUARD_DEFAULTS = {
280009
280152
  canEdit: true,
@@ -283548,121 +283691,6 @@ function createDefaultChartElement(chartKind = DEFAULT_INSERT_CHART_KIND, positi
283548
283691
  }
283549
283692
  );
283550
283693
  }
283551
- function polygonBounds(points4) {
283552
- const pairs3 = points4.trim().split(/\s+/u);
283553
- let minX = Infinity;
283554
- let minY = Infinity;
283555
- let maxX = -Infinity;
283556
- let maxY = -Infinity;
283557
- for (const pair of pairs3) {
283558
- const comma = pair.indexOf(",");
283559
- if (comma < 0) {
283560
- continue;
283561
- }
283562
- const x = parseFloat(pair.slice(0, comma));
283563
- const y = parseFloat(pair.slice(comma + 1));
283564
- if (!isFinite(x) || !isFinite(y)) {
283565
- continue;
283566
- }
283567
- if (x < minX) {
283568
- minX = x;
283569
- }
283570
- if (x > maxX) {
283571
- maxX = x;
283572
- }
283573
- if (y < minY) {
283574
- minY = y;
283575
- }
283576
- if (y > maxY) {
283577
- maxY = y;
283578
- }
283579
- }
283580
- if (!isFinite(minX)) {
283581
- return { x: 0, y: 0, width: 0, height: 0 };
283582
- }
283583
- return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
283584
- }
283585
- function renderedNodeToShape(rn, nodeId, family2) {
283586
- const id = `reflow-${family2}-${nodeId}`;
283587
- const text3 = rn.text || void 0;
283588
- if (rn.kind === "rect") {
283589
- return {
283590
- id,
283591
- shapeType: rn.rx > 0 ? "roundRect" : "rect",
283592
- x: rn.x,
283593
- y: rn.y,
283594
- width: rn.width,
283595
- height: rn.height,
283596
- rotation: 0,
283597
- fillColor: rn.fill,
283598
- strokeColor: rn.stroke,
283599
- strokeWidth: rn.strokeWidth,
283600
- text: text3,
283601
- fontSize: rn.fontSize
283602
- };
283603
- }
283604
- if (rn.kind === "circle") {
283605
- return {
283606
- id,
283607
- shapeType: "ellipse",
283608
- x: rn.cx - rn.r,
283609
- y: rn.cy - rn.r,
283610
- width: rn.r * 2,
283611
- height: rn.r * 2,
283612
- rotation: 0,
283613
- fillColor: rn.fill,
283614
- strokeColor: rn.stroke,
283615
- strokeWidth: rn.strokeWidth,
283616
- text: text3,
283617
- fontSize: rn.fontSize
283618
- };
283619
- }
283620
- const bounds = polygonBounds(rn.points);
283621
- return {
283622
- id,
283623
- shapeType: "chevron",
283624
- x: bounds.x,
283625
- y: bounds.y,
283626
- width: bounds.width,
283627
- height: bounds.height,
283628
- rotation: 0,
283629
- fillColor: rn.fill,
283630
- strokeColor: rn.stroke,
283631
- strokeWidth: rn.strokeWidth,
283632
- text: text3,
283633
- fontSize: rn.fontSize
283634
- };
283635
- }
283636
- function reflowToDrawingShapes(layoutResult, nodes) {
283637
- const flat = flattenNodes([...nodes]);
283638
- const family2 = layoutResult.family;
283639
- const shapes = [];
283640
- for (let i2 = 0; i2 < layoutResult.nodes.length; i2++) {
283641
- const rn = layoutResult.nodes[i2];
283642
- const sourceNode = flat[i2];
283643
- const nodeId = sourceNode?.id ?? rn.key;
283644
- shapes.push(renderedNodeToShape(rn, nodeId, family2));
283645
- }
283646
- return shapes;
283647
- }
283648
- function rebuildDrawingShapesIfCleared(smartArtData, layout, palette, style, elementId, box) {
283649
- const shapes = smartArtData.drawingShapes;
283650
- if (shapes === void 0 || shapes.length > 0 || smartArtData.nodes.length === 0) {
283651
- return smartArtData;
283652
- }
283653
- const layoutResult = computeSmartArtElementLayout(
283654
- { ...smartArtData, layout },
283655
- smartArtData.nodes,
283656
- box,
283657
- palette,
283658
- style,
283659
- elementId
283660
- );
283661
- return {
283662
- ...smartArtData,
283663
- drawingShapes: reflowToDrawingShapes(layoutResult, smartArtData.nodes)
283664
- };
283665
- }
283666
283694
  function mediaPlaybackAttributes(source) {
283667
283695
  return {
283668
283696
  loop: source.loop === true,
@@ -296266,14 +296294,68 @@ function computeThreeViewSize(layoutWidth, layoutHeight, screenWidth, screenHeig
296266
296294
  pixelHeight: clamp12(onScreenH * dpr)
296267
296295
  };
296268
296296
  }
296297
+ var IDENTITY6 = { a: 1, b: 0, c: 0, d: 1 };
296298
+ function compose(outer2, inner2) {
296299
+ return {
296300
+ a: outer2.a * inner2.a + outer2.c * inner2.b,
296301
+ b: outer2.b * inner2.a + outer2.d * inner2.b,
296302
+ c: outer2.a * inner2.c + outer2.c * inner2.d,
296303
+ d: outer2.b * inner2.c + outer2.d * inner2.d
296304
+ };
296305
+ }
296306
+ function parseComputedTransform(value) {
296307
+ const match = /^(matrix3d|matrix)\(([^)]*)\)$/u.exec((value ?? "").trim());
296308
+ if (!match) {
296309
+ return null;
296310
+ }
296311
+ const n = (match[2] ?? "").split(",").map((part) => Number.parseFloat(part));
296312
+ const at3 = match[1] === "matrix3d" ? [0, 1, 4, 5] : [0, 1, 2, 3];
296313
+ const [a, b, c, d] = at3.map((i2) => n[i2]);
296314
+ return [a, b, c, d].every((v) => v !== void 0 && Number.isFinite(v)) ? { a, b, c, d } : null;
296315
+ }
296316
+ function matrixScale(m) {
296317
+ return { x: Math.hypot(m.a, m.b), y: Math.hypot(m.c, m.d) };
296318
+ }
296319
+ function parentOf(node) {
296320
+ if (node.parentElement) {
296321
+ return node.parentElement;
296322
+ }
296323
+ const root = node.getRootNode?.();
296324
+ return root && "host" in root ? root.host ?? null : null;
296325
+ }
296326
+ function measureTransformScale(element) {
296327
+ const win = element.ownerDocument?.defaultView;
296328
+ if (!win) {
296329
+ return { x: 1, y: 1 };
296330
+ }
296331
+ let total = IDENTITY6;
296332
+ for (let node = element; node; node = parentOf(node)) {
296333
+ const style = win.getComputedStyle(node);
296334
+ if (style.scale && style.scale !== "none") {
296335
+ const [sx = "1", sy = sx] = style.scale.split(/\s+/u);
296336
+ const x = Number.parseFloat(sx);
296337
+ const y = Number.parseFloat(sy);
296338
+ if (Number.isFinite(x) && Number.isFinite(y)) {
296339
+ total = compose({ a: x, b: 0, c: 0, d: y }, total);
296340
+ }
296341
+ }
296342
+ const transform6 = parseComputedTransform(style.transform);
296343
+ if (transform6) {
296344
+ total = compose(transform6, total);
296345
+ }
296346
+ }
296347
+ return matrixScale(total);
296348
+ }
296269
296349
  function measureThreeViewSize(element) {
296270
- const rect32 = element.getBoundingClientRect();
296271
296350
  const win = element.ownerDocument?.defaultView;
296351
+ const layoutWidth = element.clientWidth;
296352
+ const layoutHeight = element.clientHeight;
296353
+ const scale2 = measureTransformScale(element);
296272
296354
  return computeThreeViewSize(
296273
- element.clientWidth,
296274
- element.clientHeight,
296275
- rect32.width,
296276
- rect32.height,
296355
+ layoutWidth,
296356
+ layoutHeight,
296357
+ layoutWidth * scale2.x,
296358
+ layoutHeight * scale2.y,
296277
296359
  win?.devicePixelRatio ?? 1
296278
296360
  );
296279
296361
  }
@@ -311872,6 +311954,8 @@ exports.collectUsedFonts = collectUsedFonts;
311872
311954
  exports.colorWithOpacity = colorWithOpacity;
311873
311955
  exports.commentMentionQuery = commentMentionQuery;
311874
311956
  exports.commentTextSegments = commentTextSegments;
311957
+ exports.commitSmartArtNodeFill = commitSmartArtNodeFill;
311958
+ exports.commitSmartArtNodeText = commitSmartArtNodeText;
311875
311959
  exports.comparePresentation = comparePresentation;
311876
311960
  exports.compatibilityWarningToasts = compatibilityWarningToasts;
311877
311961
  exports.compileEquationTemplateMathMl = compileEquationTemplateMathMl;
Binary file
Binary file