ooxml-core 1.25.0 → 1.25.1

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 (51) hide show
  1. package/dist/{PptxHandler-AN42B3JR.mjs → PptxHandler-5UO5DD5K.mjs} +1 -1
  2. package/dist/{PptxHandler-UTNNU6PO.mjs → PptxHandler-AUK27AQD.mjs} +2 -2
  3. package/dist/{PptxHandler-O25PF53M.cjs → PptxHandler-QBGEZDCO.cjs} +2 -2
  4. package/dist/{PresentationBuilder-A4XU72IV.cjs → PresentationBuilder-CI45KEHL.cjs} +4 -4
  5. package/dist/{PresentationBuilder-TNMO5MPC.mjs → PresentationBuilder-MEETJGEA.mjs} +2 -2
  6. package/dist/{PresentationBuilder-GTXNYSRI.mjs → PresentationBuilder-RX7D75GZ.mjs} +1 -1
  7. package/dist/automation/index.cjs +19 -15
  8. package/dist/automation/index.mjs +19 -15
  9. package/dist/chart/index.cjs +1 -1
  10. package/dist/chart/index.mjs +1 -1
  11. package/dist/{chunk-QXWRJDVE.mjs → chunk-5F7OB7PA.mjs} +1 -1
  12. package/dist/{chunk-NBSJDA3B.mjs → chunk-635WPRNJ.mjs} +1 -1
  13. package/dist/{chunk-VHGMYNWM.mjs → chunk-E3PRAHL6.mjs} +1 -1
  14. package/dist/{chunk-JE3DVWAJ.cjs → chunk-GMETZZ3V.cjs} +1 -1
  15. package/dist/{chunk-4IYYW3CX.mjs → chunk-HVRFRYYS.mjs} +4 -4
  16. package/dist/{chunk-X7IIABZ6.mjs → chunk-TX2QFS3J.mjs} +2 -2
  17. package/dist/{chunk-YWTKOZMT.mjs → chunk-VGDHSED6.mjs} +1 -1
  18. package/dist/docx/diagram-save.d.ts.map +1 -1
  19. package/dist/docx/embedded.cjs +10 -10
  20. package/dist/docx/embedded.mjs +10 -10
  21. package/dist/docx/index.cjs +10 -10
  22. package/dist/docx/index.mjs +10 -10
  23. package/dist/docx/load/index.cjs +10 -10
  24. package/dist/docx/load/index.mjs +10 -10
  25. package/dist/index.cjs +12 -2
  26. package/dist/index.mjs +12 -2
  27. package/dist/opc/index.cjs +10 -0
  28. package/dist/opc/index.mjs +10 -1
  29. package/dist/opc/package.d.ts +5 -0
  30. package/dist/opc/package.d.ts.map +1 -1
  31. package/dist/pptx/automation/index.cjs +1 -1
  32. package/dist/pptx/automation/index.mjs +5 -5
  33. package/dist/pptx/cli/index.cjs +1 -1
  34. package/dist/pptx/cli/index.mjs +4 -4
  35. package/dist/pptx/converter/index.mjs +2 -2
  36. package/dist/pptx/editor/render/slide-operations.cjs +1 -1
  37. package/dist/pptx/editor/render/slide-operations.mjs +1 -1
  38. package/dist/pptx/index.cjs +1 -1
  39. package/dist/pptx/index.mjs +5 -5
  40. package/dist/text/index.cjs +1 -1
  41. package/dist/text/index.mjs +1 -1
  42. package/dist/xlsx/edit/charts.d.ts.map +1 -1
  43. package/dist/xlsx/edit/context.d.ts +3 -1
  44. package/dist/xlsx/edit/context.d.ts.map +1 -1
  45. package/dist/xlsx/edit/drawings.d.ts.map +1 -1
  46. package/dist/xlsx/edit/smart-art.d.ts.map +1 -1
  47. package/dist/xlsx/index.cjs +9 -5
  48. package/dist/xlsx/index.mjs +9 -5
  49. package/dist/xlsx/ui/index.cjs +9 -5
  50. package/dist/xlsx/ui/index.mjs +9 -5
  51. package/package.json +1 -1
@@ -32851,6 +32851,10 @@ function sheetAt(workbook, index3) {
32851
32851
  if (!sheet) throw new RangeError(`No sheet at index ${index3}`);
32852
32852
  return sheet;
32853
32853
  }
32854
+ function sheetDrawingAt(workbook, s, index3) {
32855
+ const { drawings } = sheetAt(workbook, s);
32856
+ return Number.isInteger(index3) && index3 >= 0 ? drawings.at(index3) : void 0;
32857
+ }
32854
32858
  function baseStyleId(sheet, row2, col) {
32855
32859
  const rowStyle = sheet.rowInfo.get(row2)?.styleId;
32856
32860
  if (rowStyle) return rowStyle;
@@ -38316,7 +38320,7 @@ function deleteTimeline(ctx, name) {
38316
38320
 
38317
38321
  // xlsx/edit/drawings.ts
38318
38322
  function drawingAt(ctx, s, index3) {
38319
- const drawing = sheetAt(ctx.workbook, s).drawings[index3];
38323
+ const drawing = sheetDrawingAt(ctx.workbook, s, index3);
38320
38324
  if (!drawing) throw new RangeError(`No drawing at index ${index3} on sheet ${s}`);
38321
38325
  return drawing;
38322
38326
  }
@@ -39655,13 +39659,13 @@ function addChart(ctx, s, chart) {
39655
39659
  );
39656
39660
  }
39657
39661
  function replaceChart(ctx, s, index3, label2, next) {
39658
- const sheet = sheetAt(ctx.workbook, s);
39662
+ chartAt(ctx, s, index3);
39659
39663
  ctx.run(
39660
39664
  label2,
39661
39665
  "annotations",
39662
39666
  [{ kind: "sheet", sheet: s }],
39663
39667
  () => {
39664
- const live = sheet.drawings[index3];
39668
+ const live = chartAt(ctx, s, index3);
39665
39669
  for (const key of Object.keys(live)) Reflect.deleteProperty(live, key);
39666
39670
  Object.assign(live, structuredClone(next));
39667
39671
  },
@@ -39669,7 +39673,7 @@ function replaceChart(ctx, s, index3, label2, next) {
39669
39673
  );
39670
39674
  }
39671
39675
  function chartAt(ctx, s, index3) {
39672
- const chart = sheetAt(ctx.workbook, s).drawings[index3];
39676
+ const chart = sheetDrawingAt(ctx.workbook, s, index3);
39673
39677
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index3}`);
39674
39678
  return chart;
39675
39679
  }
@@ -39771,7 +39775,7 @@ function addImage(ctx, s, bytes, contentType, anchor, name) {
39771
39775
 
39772
39776
  // xlsx/edit/smart-art.ts
39773
39777
  function smartArtAt(ctx, s, index3) {
39774
- const drawing = sheetAt(ctx.workbook, s).drawings[index3];
39778
+ const drawing = sheetDrawingAt(ctx.workbook, s, index3);
39775
39779
  if (drawing?.kind !== "smartArt")
39776
39780
  throw new RangeError(`No SmartArt graphic at index ${index3} on sheet ${s}`);
39777
39781
  return drawing;
@@ -32845,6 +32845,10 @@ function sheetAt(workbook, index3) {
32845
32845
  if (!sheet) throw new RangeError(`No sheet at index ${index3}`);
32846
32846
  return sheet;
32847
32847
  }
32848
+ function sheetDrawingAt(workbook, s, index3) {
32849
+ const { drawings } = sheetAt(workbook, s);
32850
+ return Number.isInteger(index3) && index3 >= 0 ? drawings.at(index3) : void 0;
32851
+ }
32848
32852
  function baseStyleId(sheet, row2, col) {
32849
32853
  const rowStyle = sheet.rowInfo.get(row2)?.styleId;
32850
32854
  if (rowStyle) return rowStyle;
@@ -38310,7 +38314,7 @@ function deleteTimeline(ctx, name) {
38310
38314
 
38311
38315
  // xlsx/edit/drawings.ts
38312
38316
  function drawingAt(ctx, s, index3) {
38313
- const drawing = sheetAt(ctx.workbook, s).drawings[index3];
38317
+ const drawing = sheetDrawingAt(ctx.workbook, s, index3);
38314
38318
  if (!drawing) throw new RangeError(`No drawing at index ${index3} on sheet ${s}`);
38315
38319
  return drawing;
38316
38320
  }
@@ -39649,13 +39653,13 @@ function addChart(ctx, s, chart) {
39649
39653
  );
39650
39654
  }
39651
39655
  function replaceChart(ctx, s, index3, label2, next) {
39652
- const sheet = sheetAt(ctx.workbook, s);
39656
+ chartAt(ctx, s, index3);
39653
39657
  ctx.run(
39654
39658
  label2,
39655
39659
  "annotations",
39656
39660
  [{ kind: "sheet", sheet: s }],
39657
39661
  () => {
39658
- const live = sheet.drawings[index3];
39662
+ const live = chartAt(ctx, s, index3);
39659
39663
  for (const key of Object.keys(live)) Reflect.deleteProperty(live, key);
39660
39664
  Object.assign(live, structuredClone(next));
39661
39665
  },
@@ -39663,7 +39667,7 @@ function replaceChart(ctx, s, index3, label2, next) {
39663
39667
  );
39664
39668
  }
39665
39669
  function chartAt(ctx, s, index3) {
39666
- const chart = sheetAt(ctx.workbook, s).drawings[index3];
39670
+ const chart = sheetDrawingAt(ctx.workbook, s, index3);
39667
39671
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index3}`);
39668
39672
  return chart;
39669
39673
  }
@@ -39765,7 +39769,7 @@ function addImage(ctx, s, bytes, contentType, anchor, name) {
39765
39769
 
39766
39770
  // xlsx/edit/smart-art.ts
39767
39771
  function smartArtAt(ctx, s, index3) {
39768
- const drawing = sheetAt(ctx.workbook, s).drawings[index3];
39772
+ const drawing = sheetDrawingAt(ctx.workbook, s, index3);
39769
39773
  if (drawing?.kind !== "smartArt")
39770
39774
  throw new RangeError(`No SmartArt graphic at index ${index3} on sheet ${s}`);
39771
39775
  return drawing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-core",
3
- "version": "1.25.0",
3
+ "version": "1.25.1",
4
4
  "description": "Shared OOXML logic for the Word, PowerPoint and Excel viewers: everything except the UI",
5
5
  "keywords": [
6
6
  "charts",