@office-open/core 0.11.0 → 0.12.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.
Files changed (85) hide show
  1. package/dist/chart/index.d.mts +2 -2
  2. package/dist/chart/index.mjs +1 -1
  3. package/dist/{chart-Kf_utasF.mjs → chart-DED4tXC9.mjs} +828 -283
  4. package/dist/chart-DED4tXC9.mjs.map +1 -0
  5. package/dist/data-type-CZMKVaaT.d.mts.map +1 -1
  6. package/dist/descriptor/index.d.mts +1 -1
  7. package/dist/descriptor/index.mjs +1 -1
  8. package/dist/{descriptor-BX8xW8na.mjs → descriptor-BqaNZrrZ.mjs} +38 -10
  9. package/dist/{descriptor-BX8xW8na.mjs.map → descriptor-BqaNZrrZ.mjs.map} +1 -1
  10. package/dist/drawing/index.d.mts +2 -2
  11. package/dist/drawing/index.mjs +2 -2
  12. package/dist/{drawing-FBzd2I0m.mjs → drawing-BCAyrCCw.mjs} +3056 -3130
  13. package/dist/drawing-BCAyrCCw.mjs.map +1 -0
  14. package/dist/{generators-CElPsAhd.mjs → ext-uri-BHBcIrW7.mjs} +599 -343
  15. package/dist/ext-uri-BHBcIrW7.mjs.map +1 -0
  16. package/dist/index-BAxlDUQ1.d.mts +590 -0
  17. package/dist/index-BAxlDUQ1.d.mts.map +1 -0
  18. package/dist/{index-DxwLMnBF.d.mts → index-BP541uS-.d.mts} +136 -31
  19. package/dist/index-BP541uS-.d.mts.map +1 -0
  20. package/dist/{index-CLX7gU9J.d.mts → index-BQLIofaF.d.mts} +3 -2
  21. package/dist/index-BQLIofaF.d.mts.map +1 -0
  22. package/dist/{index-k8WKLXnA.d.mts → index-CaNwM5_e.d.mts} +19 -20
  23. package/dist/index-CaNwM5_e.d.mts.map +1 -0
  24. package/dist/{index-CnjCK-lF.d.mts → index-DPkf_CtG.d.mts} +566 -597
  25. package/dist/index-DPkf_CtG.d.mts.map +1 -0
  26. package/dist/{index-BsTUn4K1.d.mts → index-DcukVskh.d.mts} +9 -6
  27. package/dist/index-DcukVskh.d.mts.map +1 -0
  28. package/dist/{index-Cgz88FU0.d.mts → index-Di6XPdGl.d.mts} +26 -12
  29. package/dist/index-Di6XPdGl.d.mts.map +1 -0
  30. package/dist/{index-C0ClOhmZ.d.mts → index-L6AXewfV.d.mts} +11 -8
  31. package/dist/index-L6AXewfV.d.mts.map +1 -0
  32. package/dist/index.d.mts +140 -29
  33. package/dist/index.d.mts.map +1 -1
  34. package/dist/index.mjs +849 -87
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{output-D_G_JR_8.d.mts → output-yyxdkG0C.d.mts} +2 -3
  37. package/dist/output-yyxdkG0C.d.mts.map +1 -0
  38. package/dist/patch/index.d.mts +2 -2
  39. package/dist/patch/index.mjs +2 -2
  40. package/dist/{patch-3KLx2yEP.mjs → patch-AkQY17CD.mjs} +71 -26
  41. package/dist/patch-AkQY17CD.mjs.map +1 -0
  42. package/dist/smartart/index.d.mts +2 -2
  43. package/dist/smartart/index.mjs +1 -1
  44. package/dist/{smartart-BxnkROOp.mjs → smartart-n1kYJ6Jg.mjs} +27 -26
  45. package/dist/smartart-n1kYJ6Jg.mjs.map +1 -0
  46. package/dist/{style-matrix-DAP6XrLv.mjs → style-matrix-B6jhPAT3.mjs} +4 -4
  47. package/dist/style-matrix-B6jhPAT3.mjs.map +1 -0
  48. package/dist/theme/index.d.mts +4 -4
  49. package/dist/theme/index.mjs +3 -2
  50. package/dist/{theme-OAuRcA9_.mjs → theme-BKnXRmvn.mjs} +37 -71
  51. package/dist/theme-BKnXRmvn.mjs.map +1 -0
  52. package/dist/{theme-options-BbWccl85.d.mts → theme-options-kO89NUEX.d.mts} +17 -17
  53. package/dist/theme-options-kO89NUEX.d.mts.map +1 -0
  54. package/dist/util/index.d.mts +3 -3
  55. package/dist/util/index.mjs +3 -3
  56. package/dist/{util-C94-JKtp.mjs → util-ptE16MEk.mjs} +69 -37
  57. package/dist/util-ptE16MEk.mjs.map +1 -0
  58. package/dist/{values-aVoirbWB.d.mts → values-BECDm4zr.d.mts} +15 -31
  59. package/dist/values-BECDm4zr.d.mts.map +1 -0
  60. package/dist/vector/index.d.mts +2 -2
  61. package/dist/vector/index.mjs +2 -2
  62. package/dist/{vector-TpjW6ZSc.mjs → vector-DhLGZjP5.mjs} +104 -147
  63. package/dist/vector-DhLGZjP5.mjs.map +1 -0
  64. package/package.json +3 -3
  65. package/dist/chart-Kf_utasF.mjs.map +0 -1
  66. package/dist/drawing-FBzd2I0m.mjs.map +0 -1
  67. package/dist/generators-CElPsAhd.mjs.map +0 -1
  68. package/dist/index-BsTUn4K1.d.mts.map +0 -1
  69. package/dist/index-C0ClOhmZ.d.mts.map +0 -1
  70. package/dist/index-CLX7gU9J.d.mts.map +0 -1
  71. package/dist/index-Cgz88FU0.d.mts.map +0 -1
  72. package/dist/index-CnjCK-lF.d.mts.map +0 -1
  73. package/dist/index-DpPeyf5f.d.mts +0 -316
  74. package/dist/index-DpPeyf5f.d.mts.map +0 -1
  75. package/dist/index-DxwLMnBF.d.mts.map +0 -1
  76. package/dist/index-k8WKLXnA.d.mts.map +0 -1
  77. package/dist/output-D_G_JR_8.d.mts.map +0 -1
  78. package/dist/patch-3KLx2yEP.mjs.map +0 -1
  79. package/dist/smartart-BxnkROOp.mjs.map +0 -1
  80. package/dist/style-matrix-DAP6XrLv.mjs.map +0 -1
  81. package/dist/theme-OAuRcA9_.mjs.map +0 -1
  82. package/dist/theme-options-BbWccl85.d.mts.map +0 -1
  83. package/dist/util-C94-JKtp.mjs.map +0 -1
  84. package/dist/values-aVoirbWB.d.mts.map +0 -1
  85. package/dist/vector-TpjW6ZSc.mjs.map +0 -1
@@ -1101,6 +1101,9 @@ const STRING_FIELDS = [
1101
1101
  "FmlaTxbx",
1102
1102
  "CF"
1103
1103
  ];
1104
+ const TRUE_FALSE_BLANK_FIELD_SET = new Set(TRUE_FALSE_BLANK_FIELDS);
1105
+ const INTEGER_FIELD_SET = new Set(INTEGER_FIELDS);
1106
+ const STRING_FIELD_SET = new Set(STRING_FIELDS);
1104
1107
  /** Serialize x:ClientData. */
1105
1108
  function stringifyVmlClientData(opts) {
1106
1109
  const children = [];
@@ -1121,17 +1124,15 @@ function stringifyVmlClientData(opts) {
1121
1124
  /** Parse an x:ClientData element. */
1122
1125
  function parseVmlClientData(el) {
1123
1126
  const out = { objectType: String(el.attributes?.ObjectType ?? "") };
1124
- const tfbFields = new Set(TRUE_FALSE_BLANK_FIELDS);
1125
- const intFields = new Set(INTEGER_FIELDS);
1126
1127
  const extras = {};
1127
1128
  for (const child of el.elements ?? []) {
1128
1129
  if (child.type !== "element") continue;
1129
1130
  const local = child.name?.startsWith("x:") ? child.name.slice(2) : null;
1130
1131
  if (local === null) continue;
1131
1132
  const text = (child.elements ?? []).map((c) => String(c.text ?? "")).join("");
1132
- if (tfbFields.has(local)) extras[local] = parseVmlTrueFalseBlank(text);
1133
- else if (intFields.has(local)) extras[local] = Number(text);
1134
- else if (STRING_FIELDS.includes(local)) extras[local] = text;
1133
+ if (TRUE_FALSE_BLANK_FIELD_SET.has(local)) extras[local] = parseVmlTrueFalseBlank(text);
1134
+ else if (INTEGER_FIELD_SET.has(local)) extras[local] = Number(text);
1135
+ else if (STRING_FIELD_SET.has(local)) extras[local] = text;
1135
1136
  }
1136
1137
  return Object.assign(out, extras);
1137
1138
  }
@@ -1991,9 +1992,7 @@ function parseVmlStroke(el) {
1991
1992
  case "o:bottom":
1992
1993
  out.bottomStroke = parseVmlStrokeChild(child);
1993
1994
  break;
1994
- case "o:column":
1995
- out.columnStroke = parseVmlStrokeChild(child);
1996
- break;
1995
+ case "o:column": out.columnStroke = parseVmlStrokeChild(child);
1997
1996
  }
1998
1997
  }
1999
1998
  return out;
@@ -2054,18 +2053,18 @@ const TEXT_PATH_STYLE_MAP = {
2054
2053
  vTextSpacing: "v-text-spacing",
2055
2054
  vTextSpacingMode: "v-text-spacing-mode"
2056
2055
  };
2056
+ const KEY_TO_TEXT_PATH_FIELD = Object.fromEntries(Object.entries(TEXT_PATH_STYLE_MAP).map(([field, key]) => [key, field]));
2057
2057
  /** Serialize a VmlTextPathStyle to its CSS-stream form. */
2058
2058
  function stringifyVmlTextPathStyle(style) {
2059
2059
  return Object.entries(style).map(([key, value]) => `${TEXT_PATH_STYLE_MAP[key]}:${value}`).join(";");
2060
2060
  }
2061
2061
  /** Parse a CSS stream into a VmlTextPathStyle; unmapped keys drop. */
2062
2062
  function parseVmlTextPathStyle(styleStr) {
2063
- const reverse = Object.fromEntries(Object.entries(TEXT_PATH_STYLE_MAP).map(([field, key]) => [key, field]));
2064
2063
  const style = {};
2065
2064
  for (const part of styleStr.split(";")) {
2066
2065
  const [key, val] = part.split(":").map((s) => s.trim());
2067
2066
  if (!key || !val) continue;
2068
- const field = reverse[key];
2067
+ const field = KEY_TO_TEXT_PATH_FIELD[key];
2069
2068
  if (field) style[field] = val;
2070
2069
  }
2071
2070
  return style;
@@ -2326,9 +2325,19 @@ const ALL_SHAPE_ATTRS = [
2326
2325
  ...VML_SHAPE_ATTRS,
2327
2326
  ...VML_OFFICE_SHAPE_ATTRS
2328
2327
  ];
2328
+ /** The AG_Path attribute — always emitted after the shared vocabulary. */
2329
+ const PATH_ATTR = [{
2330
+ field: "path",
2331
+ attr: "path",
2332
+ kind: "string"
2333
+ }];
2329
2334
  /** Serialize the shared attribute vocabulary (style special-cased) plus extras. */
2330
2335
  function stringifyShapeAttrs(opts, extraSpecs = []) {
2331
- let attrStr = stringifyVmlAttributes(opts, [...ALL_SHAPE_ATTRS, ...extraSpecs]);
2336
+ let attrStr = stringifyVmlAttributes(opts, [
2337
+ ...ALL_SHAPE_ATTRS,
2338
+ ...extraSpecs,
2339
+ ...PATH_ATTR
2340
+ ]);
2332
2341
  const style = opts.style;
2333
2342
  if (style !== void 0) attrStr += ` style="${escapeXml(stringifyVmlStyle(style))}"`;
2334
2343
  return attrStr;
@@ -2359,14 +2368,34 @@ function stringifyShapeElements(opts) {
2359
2368
  if (opts.borderright !== void 0) parts.push(stringifyVmlBorder("w10:borderright", opts.borderright));
2360
2369
  if (opts.clientData !== void 0) parts.push(stringifyVmlClientData(opts.clientData));
2361
2370
  if (opts.textdata !== void 0) parts.push(stringifyVmlTextData(opts.textdata));
2371
+ if (opts.rawChildrenXml) parts.push(opts.rawChildrenXml);
2362
2372
  return parts.join("");
2363
2373
  }
2364
2374
  /** Parse the shared attribute vocabulary plus extras onto `out`. */
2365
2375
  function parseShapeAttrs(el, out, extraSpecs = []) {
2366
- parseVmlAttributes(el, [...ALL_SHAPE_ATTRS, ...extraSpecs], out);
2376
+ parseVmlAttributes(el, [
2377
+ ...ALL_SHAPE_ATTRS,
2378
+ ...extraSpecs,
2379
+ ...PATH_ATTR
2380
+ ], out);
2367
2381
  if (el.attributes?.style !== void 0) out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));
2368
- if (el.attributes?.path !== void 0) out.path = String(el.attributes.path);
2369
2382
  }
2383
+ /** Child shape element names — collected by the group child loop, never by
2384
+ * the EG_ShapeElements switch (their slots are group members, not shared
2385
+ * shape-element children). */
2386
+ const NESTED_SHAPE_NAMES = /* @__PURE__ */ new Set([
2387
+ "v:shape",
2388
+ "v:shapetype",
2389
+ "v:group",
2390
+ "v:rect",
2391
+ "v:roundrect",
2392
+ "v:oval",
2393
+ "v:line",
2394
+ "v:image",
2395
+ "v:arc",
2396
+ "v:curve",
2397
+ "v:polyline"
2398
+ ]);
2370
2399
  /** Parse the EG_ShapeElements children from `el` onto `out`. */
2371
2400
  function parseShapeElements(el, out) {
2372
2401
  for (const child of el.elements ?? []) {
@@ -2444,12 +2473,15 @@ function parseShapeElements(el, out) {
2444
2473
  case "pvml:iscomment":
2445
2474
  out.iscomment = parseVmlIsComment(child);
2446
2475
  break;
2476
+ default:
2477
+ if (child.name === "o:complex" || child.name === "o:ink" || child.name === "o:equationxml" || child.name !== void 0 && NESTED_SHAPE_NAMES.has(child.name)) break;
2478
+ out.rawChildrenXml = (typeof out.rawChildrenXml === "string" ? out.rawChildrenXml : "") + stringifyElement(child);
2447
2479
  }
2448
2480
  }
2449
2481
  }
2450
- /** Generic shape element serializer: tag + shared/extra attrs + @path + children. */
2451
- function stringifyShapeElement(tag, opts, extraSpecs = [], extraAttrStrings = [], childrenXml = "") {
2452
- const attrStr = stringifyShapeAttrs(opts, extraSpecs) + (extraAttrStrings.length > 0 ? " " + extraAttrStrings.join(" ") : "");
2482
+ /** Generic shape element serializer: tag + shared/extra attrs + children. */
2483
+ function stringifyShapeElement(tag, opts, extraSpecs = [], childrenXml = "") {
2484
+ const attrStr = stringifyShapeAttrs(opts, extraSpecs);
2453
2485
  return childrenXml !== "" ? `<${tag}${attrStr}>${childrenXml}</${tag}>` : `<${tag}${attrStr}/>`;
2454
2486
  }
2455
2487
  const SHAPE_EXTRA_ATTRS = [
@@ -2476,12 +2508,11 @@ const SHAPE_EXTRA_ATTRS = [
2476
2508
  ];
2477
2509
  /** Serialize v:shape. */
2478
2510
  function stringifyVmlShape(opts) {
2479
- const extra = opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [];
2480
2511
  let children = stringifyShapeElements(opts);
2481
2512
  if (opts.ink !== void 0) children += stringifyVmlInk(opts.ink);
2482
2513
  if (opts.equationxmlElement !== void 0) children += stringifyVmlEquationXml(opts.equationxmlElement);
2483
2514
  if (opts.iscomment !== void 0) children += stringifyVmlIsComment(opts.iscomment);
2484
- return stringifyShapeElement("v:shape", opts, SHAPE_EXTRA_ATTRS, extra, children);
2515
+ return stringifyShapeElement("v:shape", opts, SHAPE_EXTRA_ATTRS, children);
2485
2516
  }
2486
2517
  /** Parse a v:shape element. */
2487
2518
  function parseVmlShape(el) {
@@ -2506,10 +2537,9 @@ const SHAPETYPE_EXTRA_ATTRS = [{
2506
2537
  }];
2507
2538
  /** Serialize v:shapetype. */
2508
2539
  function stringifyVmlShapetype(opts) {
2509
- const extra = opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [];
2510
2540
  let children = stringifyShapeElements(opts);
2511
2541
  if (opts.complex !== void 0) children += stringifyVmlComplex(opts.complex);
2512
- return stringifyShapeElement("v:shapetype", opts, SHAPETYPE_EXTRA_ATTRS, extra, children);
2542
+ return stringifyShapeElement("v:shapetype", opts, SHAPETYPE_EXTRA_ATTRS, children);
2513
2543
  }
2514
2544
  /** Parse a v:shapetype element. */
2515
2545
  function parseVmlShapetype(el) {
@@ -2522,8 +2552,8 @@ function parseVmlShapetype(el) {
2522
2552
  }
2523
2553
  return out;
2524
2554
  }
2525
- /** Serialize one VmlGroupChild. */
2526
- function stringifyGroupChild(child) {
2555
+ /** Serialize one VmlShapeChild. */
2556
+ function stringifyVmlShapeChild(child) {
2527
2557
  if ("shape" in child) return stringifyVmlShape(child.shape);
2528
2558
  if ("shapetype" in child) return stringifyVmlShapetype(child.shapetype);
2529
2559
  if ("group" in child) return stringifyVmlGroup(child.group);
@@ -2555,13 +2585,32 @@ const GROUP_ATTRS = [
2555
2585
  field: "tablelimits",
2556
2586
  attr: "o:tablelimits",
2557
2587
  kind: "string"
2558
- }
2588
+ },
2589
+ ...PATH_ATTR
2559
2590
  ];
2591
+ /** Parse one shape element into its VmlShapeChild wrapper, or undefined when
2592
+ * the element is not part of the shape vocabulary. */
2593
+ function parseVmlShapeChild(el) {
2594
+ switch (el.name) {
2595
+ case "v:shape": return { shape: parseVmlShape(el) };
2596
+ case "v:shapetype": return { shapetype: parseVmlShapetype(el) };
2597
+ case "v:group": return { group: parseVmlGroup(el) };
2598
+ case "v:arc": return { arc: parseVmlArc(el) };
2599
+ case "v:curve": return { curve: parseVmlCurve(el) };
2600
+ case "v:image": return { image: parseVmlImage(el) };
2601
+ case "v:line": return { line: parseVmlLine(el) };
2602
+ case "v:oval": return { oval: parseVmlOval(el) };
2603
+ case "v:polyline": return { polyline: parseVmlPolyline(el) };
2604
+ case "v:rect": return { rect: parseVmlRect(el) };
2605
+ case "v:roundrect": return { roundrect: parseVmlRoundRect(el) };
2606
+ default: return;
2607
+ }
2608
+ }
2560
2609
  /** Serialize v:group. */
2561
2610
  function stringifyVmlGroup(opts) {
2562
- let children = (opts.children ?? []).map(stringifyGroupChild).join("") + stringifyShapeElements(opts);
2611
+ let children = (opts.children ?? []).map(stringifyVmlShapeChild).join("") + stringifyShapeElements(opts);
2563
2612
  if (opts.diagram !== void 0) children += stringifyVmlDiagram(opts.diagram);
2564
- const attrStr = stringifyVmlAttributes(opts, GROUP_ATTRS) + (opts.path !== void 0 ? ` path="${escapeXml(opts.path)}"` : "");
2613
+ const attrStr = stringifyVmlAttributes(opts, GROUP_ATTRS);
2565
2614
  const style = opts.style;
2566
2615
  const styleStr = style !== void 0 ? ` style="${escapeXml(stringifyVmlStyle(style))}"` : "";
2567
2616
  return children !== "" ? `<v:group${attrStr}${styleStr}>${children}</v:group>` : `<v:group${attrStr}${styleStr}/>`;
@@ -2571,49 +2620,13 @@ function parseVmlGroup(el) {
2571
2620
  const out = {};
2572
2621
  parseVmlAttributes(el, GROUP_ATTRS, out);
2573
2622
  if (el.attributes?.style !== void 0) out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));
2574
- if (el.attributes?.path !== void 0 && out.path === void 0) out.path = String(el.attributes.path);
2575
2623
  parseShapeElements(el, out);
2576
2624
  const children = [];
2577
2625
  for (const child of el.elements ?? []) {
2578
2626
  if (child.type !== "element") continue;
2579
- switch (child.name) {
2580
- case "v:shape":
2581
- children.push({ shape: parseVmlShape(child) });
2582
- break;
2583
- case "v:shapetype":
2584
- children.push({ shapetype: parseVmlShapetype(child) });
2585
- break;
2586
- case "v:group":
2587
- children.push({ group: parseVmlGroup(child) });
2588
- break;
2589
- case "v:arc":
2590
- children.push({ arc: parseVmlArc(child) });
2591
- break;
2592
- case "v:curve":
2593
- children.push({ curve: parseVmlCurve(child) });
2594
- break;
2595
- case "v:image":
2596
- children.push({ image: parseVmlImage(child) });
2597
- break;
2598
- case "v:line":
2599
- children.push({ line: parseVmlLine(child) });
2600
- break;
2601
- case "v:oval":
2602
- children.push({ oval: parseVmlOval(child) });
2603
- break;
2604
- case "v:polyline":
2605
- children.push({ polyline: parseVmlPolyline(child) });
2606
- break;
2607
- case "v:rect":
2608
- children.push({ rect: parseVmlRect(child) });
2609
- break;
2610
- case "v:roundrect":
2611
- children.push({ roundrect: parseVmlRoundRect(child) });
2612
- break;
2613
- case "o:diagram":
2614
- out.diagram = parseVmlDiagram(child);
2615
- break;
2616
- }
2627
+ const shapeChild = parseVmlShapeChild(child);
2628
+ if (shapeChild !== void 0) children.push(shapeChild);
2629
+ else if (child.name === "o:diagram") out.diagram = parseVmlDiagram(child);
2617
2630
  }
2618
2631
  if (children.length > 0) out.children = children;
2619
2632
  return out;
@@ -2673,7 +2686,7 @@ function parseVmlBackground(el) {
2673
2686
  }
2674
2687
  /** Serialize v:arc. */
2675
2688
  function stringifyVmlArc(opts) {
2676
- return stringifyShapeElement("v:arc", opts, ARC_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2689
+ return stringifyShapeElement("v:arc", opts, ARC_ATTRS, stringifyShapeElements(opts));
2677
2690
  }
2678
2691
  /** Parse a v:arc element. */
2679
2692
  function parseVmlArc(el) {
@@ -2684,7 +2697,7 @@ function parseVmlArc(el) {
2684
2697
  }
2685
2698
  /** Serialize v:curve. */
2686
2699
  function stringifyVmlCurve(opts) {
2687
- return stringifyShapeElement("v:curve", opts, CURVE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2700
+ return stringifyShapeElement("v:curve", opts, CURVE_ATTRS, stringifyShapeElements(opts));
2688
2701
  }
2689
2702
  /** Parse a v:curve element. */
2690
2703
  function parseVmlCurve(el) {
@@ -2695,7 +2708,7 @@ function parseVmlCurve(el) {
2695
2708
  }
2696
2709
  /** Serialize v:image. */
2697
2710
  function stringifyVmlImage(opts) {
2698
- return stringifyShapeElement("v:image", opts, IMAGE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2711
+ return stringifyShapeElement("v:image", opts, IMAGE_ATTRS, stringifyShapeElements(opts));
2699
2712
  }
2700
2713
  /** Parse a v:image element. */
2701
2714
  function parseVmlImage(el) {
@@ -2706,7 +2719,7 @@ function parseVmlImage(el) {
2706
2719
  }
2707
2720
  /** Serialize v:line. */
2708
2721
  function stringifyVmlLine(opts) {
2709
- return stringifyShapeElement("v:line", opts, LINE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2722
+ return stringifyShapeElement("v:line", opts, LINE_ATTRS, stringifyShapeElements(opts));
2710
2723
  }
2711
2724
  /** Parse a v:line element. */
2712
2725
  function parseVmlLine(el) {
@@ -2717,7 +2730,7 @@ function parseVmlLine(el) {
2717
2730
  }
2718
2731
  /** Serialize v:oval. */
2719
2732
  function stringifyVmlOval(opts) {
2720
- return stringifyShapeElement("v:oval", opts, [], opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2733
+ return stringifyShapeElement("v:oval", opts, [], stringifyShapeElements(opts));
2721
2734
  }
2722
2735
  /** Parse a v:oval element. */
2723
2736
  function parseVmlOval(el) {
@@ -2729,7 +2742,7 @@ function parseVmlOval(el) {
2729
2742
  /** Serialize v:polyline. */
2730
2743
  function stringifyVmlPolyline(opts) {
2731
2744
  const children = stringifyShapeElements(opts) + (opts.ink !== void 0 ? stringifyVmlInk(opts.ink) : "");
2732
- return stringifyShapeElement("v:polyline", opts, POLYLINE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], children);
2745
+ return stringifyShapeElement("v:polyline", opts, POLYLINE_ATTRS, children);
2733
2746
  }
2734
2747
  /** Parse a v:polyline element. */
2735
2748
  function parseVmlPolyline(el) {
@@ -2744,7 +2757,7 @@ function parseVmlPolyline(el) {
2744
2757
  }
2745
2758
  /** Serialize v:rect. */
2746
2759
  function stringifyVmlRect(opts) {
2747
- return stringifyShapeElement("v:rect", opts, [], opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2760
+ return stringifyShapeElement("v:rect", opts, [], stringifyShapeElements(opts));
2748
2761
  }
2749
2762
  /** Parse a v:rect element. */
2750
2763
  function parseVmlRect(el) {
@@ -2755,7 +2768,7 @@ function parseVmlRect(el) {
2755
2768
  }
2756
2769
  /** Serialize v:roundrect. */
2757
2770
  function stringifyVmlRoundRect(opts) {
2758
- return stringifyShapeElement("v:roundrect", opts, ROUNDRECT_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2771
+ return stringifyShapeElement("v:roundrect", opts, ROUNDRECT_ATTRS, stringifyShapeElements(opts));
2759
2772
  }
2760
2773
  /** Parse a v:roundrect element. */
2761
2774
  function parseVmlRoundRect(el) {
@@ -2767,11 +2780,7 @@ function parseVmlRoundRect(el) {
2767
2780
  //#endregion
2768
2781
  //#region src/vector/office-shape-defaults.ts
2769
2782
  const SHAPEDEFAULTS_ATTRS = [
2770
- {
2771
- field: "ext",
2772
- attr: "v:ext",
2773
- kind: "string"
2774
- },
2783
+ ...EXT_ATTR,
2775
2784
  {
2776
2785
  field: "spidmax",
2777
2786
  attr: "spidmax",
@@ -2858,20 +2867,14 @@ function parseVmlShapeDefaults(el) {
2858
2867
  case "o:colormru":
2859
2868
  out.colormru = parseVmlColorMru(child);
2860
2869
  break;
2861
- case "o:colormenu":
2862
- out.colormenu = parseVmlColorMenu(child);
2863
- break;
2870
+ case "o:colormenu": out.colormenu = parseVmlColorMenu(child);
2864
2871
  }
2865
2872
  }
2866
2873
  return out;
2867
2874
  }
2868
2875
  /** Serialize o:colormru. */
2869
2876
  function stringifyVmlColorMru(opts) {
2870
- return `<o:colormru${stringifyVmlAttributes(opts, [{
2871
- field: "ext",
2872
- attr: "v:ext",
2873
- kind: "string"
2874
- }, {
2877
+ return `<o:colormru${stringifyVmlAttributes(opts, [...EXT_ATTR, {
2875
2878
  field: "colors",
2876
2879
  attr: "colors",
2877
2880
  kind: "string"
@@ -2880,11 +2883,7 @@ function stringifyVmlColorMru(opts) {
2880
2883
  /** Parse an o:colormru element. */
2881
2884
  function parseVmlColorMru(el) {
2882
2885
  const out = {};
2883
- parseVmlAttributes(el, [{
2884
- field: "ext",
2885
- attr: "v:ext",
2886
- kind: "string"
2887
- }, {
2886
+ parseVmlAttributes(el, [...EXT_ATTR, {
2888
2887
  field: "colors",
2889
2888
  attr: "colors",
2890
2889
  kind: "string"
@@ -2892,11 +2891,7 @@ function parseVmlColorMru(el) {
2892
2891
  return out;
2893
2892
  }
2894
2893
  const COLORMENU_ATTRS = [
2895
- {
2896
- field: "ext",
2897
- attr: "v:ext",
2898
- kind: "string"
2899
- },
2894
+ ...EXT_ATTR,
2900
2895
  {
2901
2896
  field: "strokecolor",
2902
2897
  attr: "strokecolor",
@@ -2939,11 +2934,7 @@ const ENTRY_ATTRS = [{
2939
2934
  }];
2940
2935
  /** Serialize an o:idmap. */
2941
2936
  function stringifyVmlIdMap(opts) {
2942
- return `<o:idmap${stringifyVmlAttributes(opts, [{
2943
- field: "ext",
2944
- attr: "v:ext",
2945
- kind: "string"
2946
- }, {
2937
+ return `<o:idmap${stringifyVmlAttributes(opts, [...EXT_ATTR, {
2947
2938
  field: "data",
2948
2939
  attr: "data",
2949
2940
  kind: "string"
@@ -2952,11 +2943,7 @@ function stringifyVmlIdMap(opts) {
2952
2943
  /** Parse an o:idmap element. */
2953
2944
  function parseVmlIdMap(el) {
2954
2945
  const out = {};
2955
- parseVmlAttributes(el, [{
2956
- field: "ext",
2957
- attr: "v:ext",
2958
- kind: "string"
2959
- }, {
2946
+ parseVmlAttributes(el, [...EXT_ATTR, {
2960
2947
  field: "data",
2961
2948
  attr: "data",
2962
2949
  kind: "string"
@@ -2966,20 +2953,12 @@ function parseVmlIdMap(el) {
2966
2953
  /** Serialize an o:regrouptable. */
2967
2954
  function stringifyVmlRegroupTable(opts) {
2968
2955
  const entries = (opts.entries ?? []).map((entry) => `<o:entry${stringifyVmlAttributes(entry, ENTRY_ATTRS)}/>`).join("");
2969
- return `<o:regrouptable${stringifyVmlAttributes(opts, [{
2970
- field: "ext",
2971
- attr: "v:ext",
2972
- kind: "string"
2973
- }])}>${entries}</o:regrouptable>`;
2956
+ return `<o:regrouptable${stringifyVmlAttributes(opts, EXT_ATTR)}>${entries}</o:regrouptable>`;
2974
2957
  }
2975
2958
  /** Parse an o:regrouptable element. */
2976
2959
  function parseVmlRegroupTable(el) {
2977
2960
  const out = {};
2978
- parseVmlAttributes(el, [{
2979
- field: "ext",
2980
- attr: "v:ext",
2981
- kind: "string"
2982
- }], out);
2961
+ parseVmlAttributes(el, EXT_ATTR, out);
2983
2962
  const entries = [];
2984
2963
  for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:entry") {
2985
2964
  const entry = {};
@@ -2992,8 +2971,8 @@ function parseVmlRegroupTable(el) {
2992
2971
  /** Serialize a proxy child inside an o:r. */
2993
2972
  function stringifyVmlRuleProxy(proxy) {
2994
2973
  const attrs = [];
2995
- if (proxy.start !== void 0) attrs.push(`start="${proxy.start === "" ? "" : proxy.start ? "t" : "f"}"`);
2996
- if (proxy.end !== void 0) attrs.push(`end="${proxy.end === "" ? "" : proxy.end ? "t" : "f"}"`);
2974
+ if (proxy.start !== void 0) attrs.push(`start="${stringifyVmlTrueFalseBlank(proxy.start)}"`);
2975
+ if (proxy.end !== void 0) attrs.push(`end="${stringifyVmlTrueFalseBlank(proxy.end)}"`);
2997
2976
  if (proxy.idref !== void 0) attrs.push(`idref="${proxy.idref}"`);
2998
2977
  if (proxy.connectloc !== void 0) attrs.push(`connectloc="${proxy.connectloc}"`);
2999
2978
  return `<o:proxy${attrs.length > 0 ? " " + attrs.join(" ") : ""}/>`;
@@ -3002,14 +2981,8 @@ function stringifyVmlRuleProxy(proxy) {
3002
2981
  function parseVmlRuleProxy(el) {
3003
2982
  const out = {};
3004
2983
  const attrs = el.attributes ?? {};
3005
- if (attrs.start !== void 0) {
3006
- const raw = String(attrs.start);
3007
- out.start = raw === "" ? "" : raw === "t" || raw === "true" || raw === "1";
3008
- }
3009
- if (attrs.end !== void 0) {
3010
- const raw = String(attrs.end);
3011
- out.end = raw === "" ? "" : raw === "t" || raw === "true" || raw === "1";
3012
- }
2984
+ if (attrs.start !== void 0) out.start = parseVmlTrueFalseBlank(String(attrs.start));
2985
+ if (attrs.end !== void 0) out.end = parseVmlTrueFalseBlank(String(attrs.end));
3013
2986
  if (attrs.idref !== void 0) out.idref = String(attrs.idref);
3014
2987
  if (attrs.connectloc !== void 0) out.connectloc = Number(attrs.connectloc);
3015
2988
  return out;
@@ -3038,20 +3011,12 @@ function parseVmlRule(el) {
3038
3011
  /** Serialize an o:rules block. */
3039
3012
  function stringifyVmlRulesBlock(opts) {
3040
3013
  const rules = (opts.rules ?? []).map(stringifyVmlRule).join("");
3041
- return `<o:rules${stringifyVmlAttributes(opts, [{
3042
- field: "ext",
3043
- attr: "v:ext",
3044
- kind: "string"
3045
- }])}>${rules}</o:rules>`;
3014
+ return `<o:rules${stringifyVmlAttributes(opts, EXT_ATTR)}>${rules}</o:rules>`;
3046
3015
  }
3047
3016
  /** Parse an o:rules element. */
3048
3017
  function parseVmlRulesBlock(el) {
3049
3018
  const out = {};
3050
- parseVmlAttributes(el, [{
3051
- field: "ext",
3052
- attr: "v:ext",
3053
- kind: "string"
3054
- }], out);
3019
+ parseVmlAttributes(el, EXT_ATTR, out);
3055
3020
  const rules = [];
3056
3021
  for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:r") rules.push(parseVmlRule(child));
3057
3022
  if (rules.length > 0) out.rules = rules;
@@ -3063,21 +3028,13 @@ function stringifyVmlShapeLayout(opts) {
3063
3028
  if (opts.idmap !== void 0) children.push(stringifyVmlIdMap(opts.idmap));
3064
3029
  if (opts.regrouptable !== void 0) children.push(stringifyVmlRegroupTable(opts.regrouptable));
3065
3030
  if (opts.rules !== void 0) children.push(stringifyVmlRulesBlock(opts.rules));
3066
- const attrStr = stringifyVmlAttributes(opts, [{
3067
- field: "ext",
3068
- attr: "v:ext",
3069
- kind: "string"
3070
- }]);
3031
+ const attrStr = stringifyVmlAttributes(opts, EXT_ATTR);
3071
3032
  return children.length > 0 ? `<o:shapelayout${attrStr}>${children.join("")}</o:shapelayout>` : `<o:shapelayout${attrStr}/>`;
3072
3033
  }
3073
3034
  /** Parse an o:shapelayout element. */
3074
3035
  function parseVmlShapeLayout(el) {
3075
3036
  const out = {};
3076
- parseVmlAttributes(el, [{
3077
- field: "ext",
3078
- attr: "v:ext",
3079
- kind: "string"
3080
- }], out);
3037
+ parseVmlAttributes(el, EXT_ATTR, out);
3081
3038
  for (const child of el.elements ?? []) {
3082
3039
  if (child.type !== "element") continue;
3083
3040
  if (child.name === "o:idmap") out.idmap = parseVmlIdMap(child);
@@ -3087,6 +3044,6 @@ function parseVmlShapeLayout(el) {
3087
3044
  return out;
3088
3045
  }
3089
3046
  //#endregion
3090
- export { parseVmlPath as $, stringifyVmlRect as A, stringifyVmlLock as At, stringifyVmlWrap as B, parseVmlTrueFalse as Bt, stringifyVmlBackground as C, stringifyVmlCallout as Ct, stringifyVmlLine as D, stringifyVmlEquationXml as Dt, stringifyVmlImage as E, stringifyVmlDiagram as Et, parseVmlAnchorLock as F, VML_CORE_ATTRS as Ft, parseVmlStroke as G, parseVmlShapeStyle as Gt, stringifyVmlTextPath as H, stringifyVmlAttributes as Ht, parseVmlBorder as I, VML_OFFICE_CORE_ATTRS as It, stringifyVmlShadow as J, styleToKeyMap as Jt, stringifyVmlStroke as K, parseVmlStyle as Kt, parseVmlWrap as L, VML_OFFICE_SHAPE_ATTRS as Lt, stringifyVmlShape as M, stringifyVmlOleObject as Mt, stringifyVmlShapetype as N, stringifyVmlSignatureLine as Nt, stringifyVmlOval as O, stringifyVmlExtrusion as Ot, VML_BORDER_TAGS as P, stringifyVmlSkew as Pt, stringifyVmlTextData as Q, stringifyVmlAnchorLock as R, VML_SHAPE_ATTRS as Rt, stringifyVmlArc as S, parseVmlSkew as St, stringifyVmlGroup as T, stringifyVmlComplex as Tt, parseVmlTextbox as U, stringifyVmlTrueFalse as Ut, parseVmlTextPath as V, parseVmlTrueFalseBlank as Vt, stringifyVmlTextbox as W, stringifyVmlTrueFalseBlank as Wt, parseVmlTextData as X, parseVmlIsComment as Y, stringifyVmlIsComment as Z, parseVmlPolyline as _, parseVmlInk as _t, stringifyVmlColorMenu as a, parseVmlFormulas as at, parseVmlShape as b, parseVmlOleObject as bt, stringifyVmlShapeLayout as c, stringifyVmlFill as ct, parseVmlBackground as d, parseVmlCallout as dt, stringifyVmlPath as et, parseVmlCurve as f, parseVmlClipPath as ft, parseVmlOval as g, parseVmlExtrusion as gt, parseVmlLine as h, parseVmlEquationXml as ht, parseVmlShapeLayout as i, stringifyVmlHandles as it, stringifyVmlRoundRect as j, stringifyVmlOfficeFill as jt, stringifyVmlPolyline as k, stringifyVmlInk as kt, nextVmlShapeId as l, parseVmlClientData as lt, parseVmlImage as m, parseVmlDiagram as mt, parseVmlColorMru as n, stringifyVmlImageData as nt, stringifyVmlColorMru as o, stringifyVmlFormulas as ot, parseVmlGroup as p, parseVmlComplex as pt, parseVmlShadow as q, stringifyVmlStyle as qt, parseVmlShapeDefaults as r, parseVmlHandles as rt, stringifyVmlShapeDefaults as s, parseVmlFill as st, parseVmlColorMenu as t, parseVmlImageData as tt, parseVmlArc as u, stringifyVmlClientData as ut, parseVmlRect as v, parseVmlLock as vt, stringifyVmlCurve as w, stringifyVmlClipPath as wt, parseVmlShapetype as x, parseVmlSignatureLine as xt, parseVmlRoundRect as y, parseVmlOfficeFill as yt, stringifyVmlBorder as z, parseVmlAttributes as zt };
3047
+ export { stringifyVmlIsComment as $, stringifyVmlPolyline as A, stringifyVmlEquationXml as At, stringifyVmlAnchorLock as B, VML_OFFICE_SHAPE_ATTRS as Bt, stringifyVmlArc as C, parseVmlOleObject as Ct, stringifyVmlImage as D, stringifyVmlClipPath as Dt, stringifyVmlGroup as E, stringifyVmlCallout as Et, stringifyVmlShapetype as F, stringifyVmlOleObject as Ft, parseVmlTextbox as G, stringifyVmlAttributes as Gt, stringifyVmlWrap as H, parseVmlAttributes as Ht, VML_BORDER_TAGS as I, stringifyVmlSignatureLine as It, stringifyVmlStroke as J, parseVmlShapeStyle as Jt, stringifyVmlTextbox as K, stringifyVmlTrueFalse as Kt, parseVmlAnchorLock as L, stringifyVmlSkew as Lt, stringifyVmlRoundRect as M, stringifyVmlInk as Mt, stringifyVmlShape as N, stringifyVmlLock as Nt, stringifyVmlLine as O, stringifyVmlComplex as Ot, stringifyVmlShapeChild as P, stringifyVmlOfficeFill as Pt, parseVmlTextData as Q, parseVmlBorder as R, VML_CORE_ATTRS as Rt, parseVmlShapetype as S, parseVmlOfficeFill as St, stringifyVmlCurve as T, parseVmlSkew as Tt, parseVmlTextPath as U, parseVmlTrueFalse as Ut, stringifyVmlBorder as V, VML_SHAPE_ATTRS as Vt, stringifyVmlTextPath as W, parseVmlTrueFalseBlank as Wt, stringifyVmlShadow as X, stringifyVmlStyle as Xt, parseVmlShadow as Y, parseVmlStyle as Yt, parseVmlIsComment as Z, styleToKeyMap as Zt, parseVmlPolyline as _, parseVmlDiagram as _t, stringifyVmlColorMenu as a, parseVmlHandles as at, parseVmlShape as b, parseVmlInk as bt, stringifyVmlShapeLayout as c, stringifyVmlFormulas as ct, parseVmlBackground as d, parseVmlClientData as dt, stringifyVmlTextData as et, parseVmlCurve as f, stringifyVmlClientData as ft, parseVmlOval as g, parseVmlComplex as gt, parseVmlLine as h, parseVmlClipPath as ht, parseVmlShapeLayout as i, stringifyVmlImageData as it, stringifyVmlRect as j, stringifyVmlExtrusion as jt, stringifyVmlOval as k, stringifyVmlDiagram as kt, nextVmlShapeId as l, parseVmlFill as lt, parseVmlImage as m, parseVmlCallout as mt, parseVmlColorMru as n, stringifyVmlPath as nt, stringifyVmlColorMru as o, stringifyVmlHandles as ot, parseVmlGroup as p, EXT_ATTR as pt, parseVmlStroke as q, stringifyVmlTrueFalseBlank as qt, parseVmlShapeDefaults as r, parseVmlImageData as rt, stringifyVmlShapeDefaults as s, parseVmlFormulas as st, parseVmlColorMenu as t, parseVmlPath as tt, parseVmlArc as u, stringifyVmlFill as ut, parseVmlRect as v, parseVmlEquationXml as vt, stringifyVmlBackground as w, parseVmlSignatureLine as wt, parseVmlShapeChild as x, parseVmlLock as xt, parseVmlRoundRect as y, parseVmlExtrusion as yt, parseVmlWrap as z, VML_OFFICE_CORE_ATTRS as zt };
3091
3048
 
3092
- //# sourceMappingURL=vector-TpjW6ZSc.mjs.map
3049
+ //# sourceMappingURL=vector-DhLGZjP5.mjs.map