@office-open/core 0.8.1 → 0.9.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 (33) hide show
  1. package/README.md +32 -60
  2. package/dist/chart/index.d.mts +2 -2
  3. package/dist/chart/index.mjs +2 -2
  4. package/dist/chart-DNpai28f.mjs +365 -0
  5. package/dist/descriptor/index.d.mts +2 -0
  6. package/dist/descriptor/index.mjs +2 -0
  7. package/dist/descriptor-DKmR7pw-.mjs +282 -0
  8. package/dist/drawingml/index.d.mts +2 -2
  9. package/dist/drawingml/index.mjs +2 -2
  10. package/dist/index-BI-1SKm5.d.mts +153 -0
  11. package/dist/{index-Cj2Yf5mk.d.mts → index-DByjp6ug.d.mts} +10 -7
  12. package/dist/index-DNH2sizc.d.mts +137 -0
  13. package/dist/{index-DEvpdl1o.d.mts → index-RWXzxibP.d.mts} +1416 -1837
  14. package/dist/{index-D0N5Bw2M.d.mts → index-eu1aFQCm.d.mts} +39 -28
  15. package/dist/index.d.mts +7 -557
  16. package/dist/index.mjs +7 -2091
  17. package/dist/smartart/index.d.mts +2 -2
  18. package/dist/smartart/index.mjs +2 -2
  19. package/dist/{smartart-9ZpWgmIy.mjs → smartart-DCY-Vdv7.mjs} +120 -204
  20. package/dist/src-CU2AFKyt.mjs +7413 -0
  21. package/dist/theme/index.d.mts +2 -2
  22. package/dist/theme/index.mjs +2 -2
  23. package/dist/{theme-FWD_20fH.mjs → theme-CiNzdl-9.mjs} +117 -22
  24. package/dist/{values.d.mts → util/values.d.mts} +1 -1
  25. package/dist/{values.mjs → util/values.mjs} +1 -1
  26. package/dist/{values-BOWpTgBE.mjs → values-CVIZcTRw.mjs} +1 -1
  27. package/dist/{values-COjPGYkS.d.mts → values-Dqj8cbcy.d.mts} +1 -1
  28. package/package.json +12 -7
  29. package/dist/chart-CigYrDhf.mjs +0 -1242
  30. package/dist/drawingml-B-2eEHAF.mjs +0 -7109
  31. package/dist/index-Bh6s66Up.d.mts +0 -381
  32. package/dist/index-CoTp4wVf.d.mts +0 -202
  33. package/dist/xml-components-BuFdDxHN.mjs +0 -322
@@ -1,2 +1,2 @@
1
- import { a as Point, c as DataModel, d as getColorXml, f as getLayoutXml, g as STYLE_CATEGORIES, h as LAYOUT_CATEGORIES, i as SmartArtData, l as Connection, m as COLOR_CATEGORIES, n as createDataModel, o as PointPropertySetOptions, p as getStyleXml, r as SmartArtCollection, s as TransPoint, t as TreeNode, u as DEFAULT_DRAWING_XML } from "../index-D0N5Bw2M.mjs";
2
- export { COLOR_CATEGORIES, Connection, DEFAULT_DRAWING_XML, DataModel, LAYOUT_CATEGORIES, Point, PointPropertySetOptions, STYLE_CATEGORIES, SmartArtCollection, SmartArtData, TransPoint, TreeNode, createDataModel, getColorXml, getLayoutXml, getStyleXml };
1
+ import { a as PointPropertySetOptions, c as stringifyDataModel, d as getColorXml, f as getLayoutXml, g as STYLE_CATEGORIES, h as LAYOUT_CATEGORIES, i as SmartArtData, l as stringifyConnection, m as COLOR_CATEGORIES, n as createDataModel, o as stringifyPoint, p as getStyleXml, r as SmartArtCollection, s as stringifyTransPoint, t as TreeNode, u as DEFAULT_DRAWING_XML } from "../index-eu1aFQCm.mjs";
2
+ export { COLOR_CATEGORIES, DEFAULT_DRAWING_XML, LAYOUT_CATEGORIES, PointPropertySetOptions, STYLE_CATEGORIES, SmartArtCollection, SmartArtData, TreeNode, createDataModel, getColorXml, getLayoutXml, getStyleXml, stringifyConnection, stringifyDataModel, stringifyPoint, stringifyTransPoint };
@@ -1,2 +1,2 @@
1
- import { a as DataModel, c as getColorXml, d as COLOR_CATEGORIES, f as LAYOUT_CATEGORIES, i as TransPoint, l as getLayoutXml, n as SmartArtCollection, o as Connection, p as STYLE_CATEGORIES, r as Point, s as DEFAULT_DRAWING_XML, t as createDataModel, u as getStyleXml } from "../smartart-9ZpWgmIy.mjs";
2
- export { COLOR_CATEGORIES, Connection, DEFAULT_DRAWING_XML, DataModel, LAYOUT_CATEGORIES, Point, STYLE_CATEGORIES, SmartArtCollection, TransPoint, createDataModel, getColorXml, getLayoutXml, getStyleXml };
1
+ import { a as stringifyDataModel, c as getColorXml, d as COLOR_CATEGORIES, f as LAYOUT_CATEGORIES, i as stringifyTransPoint, l as getLayoutXml, n as SmartArtCollection, o as stringifyConnection, p as STYLE_CATEGORIES, r as stringifyPoint, s as DEFAULT_DRAWING_XML, t as createDataModel, u as getStyleXml } from "../smartart-DCY-Vdv7.mjs";
2
+ export { COLOR_CATEGORIES, DEFAULT_DRAWING_XML, LAYOUT_CATEGORIES, STYLE_CATEGORIES, SmartArtCollection, createDataModel, getColorXml, getLayoutXml, getStyleXml, stringifyConnection, stringifyDataModel, stringifyPoint, stringifyTransPoint };
@@ -1,4 +1,4 @@
1
- import { l as chartAttr, y as XmlComponent } from "./xml-components-BuFdDxHN.mjs";
1
+ import { escapeXml } from "@office-open/xml";
2
2
  //#region src/smartart/categories.ts
3
3
  /** Layout ID → OOXML category type */
4
4
  const LAYOUT_CATEGORIES = {
@@ -133,166 +133,103 @@ const DEFAULT_DRAWING_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone
133
133
  //#endregion
134
134
  //#region src/smartart/data-model/connection.ts
135
135
  /**
136
- * dgm:cxn — SmartArt data model connection (edge).
136
+ * dgm:cxn — SmartArt data model connection (edge) XML stringifier.
137
137
  */
138
- var Connection = class extends XmlComponent {
139
- constructor(modelId, srcId, destId, type, srcOrd = 0, destOrd = 0, parTransId, sibTransId, presId) {
140
- super("dgm:cxn");
141
- const attrs = {
142
- modelId,
143
- srcId,
144
- destId,
145
- srcOrd,
146
- destOrd
147
- };
148
- if (type) attrs.type = type;
149
- if (parTransId) attrs.parTransId = parTransId;
150
- if (sibTransId) attrs.sibTransId = sibTransId;
151
- if (presId) attrs.presId = presId;
152
- this.root.push(chartAttr(attrs));
153
- }
154
- };
138
+ function stringifyConnection(opts) {
139
+ const attrs = [
140
+ `modelId="${escapeXml(String(opts.modelId))}"`,
141
+ `srcId="${escapeXml(String(opts.srcId))}"`,
142
+ `destId="${escapeXml(String(opts.destId))}"`,
143
+ `srcOrd="${opts.srcOrd ?? 0}"`,
144
+ `destOrd="${opts.destOrd ?? 0}"`
145
+ ];
146
+ if (opts.type) attrs.push(`type="${escapeXml(opts.type)}"`);
147
+ if (opts.parTransId) attrs.push(`parTransId="${escapeXml(opts.parTransId)}"`);
148
+ if (opts.sibTransId) attrs.push(`sibTransId="${escapeXml(opts.sibTransId)}"`);
149
+ if (opts.presId) attrs.push(`presId="${escapeXml(opts.presId)}"`);
150
+ return `<dgm:cxn ${attrs.join(" ")}/>`;
151
+ }
155
152
  //#endregion
156
153
  //#region src/smartart/data-model/data-model.ts
157
154
  /**
158
- * CT_DataModel — the complete data model for a SmartArt diagram.
159
- */
160
- var DataModel = class extends XmlComponent {
161
- constructor(points, connections) {
162
- super("dgm:dataModel");
163
- this.root.push(chartAttr({
164
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
165
- "xmlns:dgm": "http://schemas.openxmlformats.org/drawingml/2006/diagram"
166
- }));
167
- const ptLst = new class extends XmlComponent {
168
- constructor() {
169
- super("dgm:ptLst");
170
- }
171
- }();
172
- for (const pt of points) ptLst["root"].push(pt);
173
- this.root.push(ptLst);
174
- const cxnLst = new class extends XmlComponent {
175
- constructor() {
176
- super("dgm:cxnLst");
177
- }
178
- }();
179
- for (const cxn of connections) cxnLst["root"].push(cxn);
180
- this.root.push(cxnLst);
181
- this.root.push(new EmptyElement$2("dgm:bg"));
182
- this.root.push(new EmptyElement$2("dgm:whole"));
183
- }
184
- };
185
- var EmptyElement$2 = class extends XmlComponent {
186
- constructor(tag) {
187
- super(tag);
188
- }
189
- };
190
- //#endregion
191
- //#region src/smartart/data-model/point.ts
192
- /**
193
- * dgm:pt — SmartArt data model point (node).
155
+ * CT_DataModel XML stringifier assembles complete SmartArt data model XML.
156
+ *
157
+ * @module
194
158
  */
195
- var Point = class extends XmlComponent {
196
- constructor(modelId, text, type = "node", propertySet) {
197
- super("dgm:pt");
198
- this.root.push(chartAttr({
199
- modelId,
200
- type
201
- }));
202
- if (propertySet) this.root.push(new PropertySet(propertySet));
203
- this.root.push(new PointText(text));
204
- }
205
- };
206
159
  /**
207
- * dgm:prSet Property set for a SmartArt data model point.
160
+ * Build the complete dgm:dataModel XML from pre-serialized point and connection strings.
208
161
  */
209
- var PropertySet = class extends XmlComponent {
210
- constructor(opts) {
211
- super("dgm:prSet");
212
- const attr = {};
213
- if (opts.presentationAssociationId !== void 0) attr.presAssocID = opts.presentationAssociationId;
214
- if (opts.presentationName !== void 0) attr.presName = opts.presentationName;
215
- if (opts.presentationStyleLabel !== void 0) attr.presStyleLbl = opts.presentationStyleLabel;
216
- if (opts.presentationStyleIndex !== void 0) attr.presStyleIdx = opts.presentationStyleIndex;
217
- if (opts.presentationStyleCount !== void 0) attr.presStyleCnt = opts.presentationStyleCount;
218
- if (opts.placeholderText !== void 0) attr.phldrT = opts.placeholderText;
219
- if (opts.placeholder !== void 0) attr.phldr = opts.placeholder ? "1" : "0";
220
- if (opts.customAngle !== void 0) attr.custAng = opts.customAngle;
221
- if (opts.customFlipVertical !== void 0) attr.custFlipVert = opts.customFlipVertical ? "1" : "0";
222
- if (opts.customFlipHorizontal !== void 0) attr.custFlipHor = opts.customFlipHorizontal ? "1" : "0";
223
- if (opts.customSizeX !== void 0) attr.custSzX = opts.customSizeX;
224
- if (opts.customSizeY !== void 0) attr.custSzY = opts.customSizeY;
225
- if (opts.customScaleX !== void 0) attr.custScaleX = opts.customScaleX;
226
- if (opts.customScaleY !== void 0) attr.custScaleY = opts.customScaleY;
227
- if (opts.customText !== void 0) attr.custT = opts.customText ? "1" : "0";
228
- if (opts.customLinearFactorX !== void 0) attr.custLinFactX = opts.customLinearFactorX;
229
- if (opts.customLinearFactorY !== void 0) attr.custLinFactY = opts.customLinearFactorY;
230
- if (opts.customLinearFactorNeighborX !== void 0) attr.custLinFactNeighborX = opts.customLinearFactorNeighborX;
231
- if (opts.customLinearFactorNeighborY !== void 0) attr.custLinFactNeighborY = opts.customLinearFactorNeighborY;
232
- if (opts.customRadialScaleRadius !== void 0) attr.custRadScaleRad = opts.customRadialScaleRadius;
233
- if (opts.customRadialScaleIncrement !== void 0) attr.custRadScaleInc = opts.customRadialScaleIncrement;
234
- if (opts.coherent3DOffset !== void 0) attr.coherent3DOff = opts.coherent3DOffset ? "1" : "0";
235
- if (opts.hideGeometry !== void 0) attr.hideGeom = opts.hideGeometry ? "1" : "0";
236
- if (opts.hideLastTransition !== void 0) attr.hideLastTrans = opts.hideLastTransition ? "1" : "0";
237
- if (opts.lockTextEntry !== void 0) attr.lkTxEntry = opts.lockTextEntry ? "1" : "0";
238
- if (opts.moveWith !== void 0) attr.moveWith = opts.moveWith;
239
- if (opts.useDefault !== void 0) attr.useDef = opts.useDefault ? "1" : "0";
240
- if (opts.zOrderOffset !== void 0) attr.zOrderOff = opts.zOrderOffset;
241
- if (opts.layoutTypeId !== void 0) attr.loTypeId = opts.layoutTypeId;
242
- if (opts.layoutCategoryId !== void 0) attr.loCatId = opts.layoutCategoryId;
243
- if (opts.quickStyleTypeId !== void 0) attr.qsTypeId = opts.quickStyleTypeId;
244
- if (opts.quickStyleCategoryId !== void 0) attr.qsCatId = opts.quickStyleCategoryId;
245
- if (opts.colorStyleTypeId !== void 0) attr.csTypeId = opts.colorStyleTypeId;
246
- if (opts.colorStyleCategoryId !== void 0) attr.csCatId = opts.colorStyleCategoryId;
247
- if (Object.keys(attr).length > 0) this.root.push({ _attr: attr });
248
- }
249
- };
162
+ function stringifyDataModel(points, connections) {
163
+ return [
164
+ "<dgm:dataModel xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:dgm=\"http://schemas.openxmlformats.org/drawingml/2006/diagram\">",
165
+ `<dgm:ptLst>${points.join("")}</dgm:ptLst>`,
166
+ `<dgm:cxnLst>${connections.join("")}</dgm:cxnLst>`,
167
+ "<dgm:bg/>",
168
+ "<dgm:whole/>",
169
+ "</dgm:dataModel>"
170
+ ].join("");
171
+ }
172
+ //#endregion
173
+ //#region src/smartart/data-model/point.ts
250
174
  /**
251
- * Transition point (parTrans or sibTrans) no text body, references a connection.
175
+ * dgm:pt SmartArt data model point (node) XML stringifier.
252
176
  */
253
- var TransPoint = class extends XmlComponent {
254
- constructor(modelId, type, cxnId) {
255
- super("dgm:pt");
256
- this.root.push(chartAttr({
257
- modelId,
258
- type,
259
- cxnId
260
- }));
261
- this.root.push(new EmptyElement$1("dgm:spPr"));
262
- }
263
- };
264
- var EmptyElement$1 = class extends XmlComponent {
265
- constructor(tag) {
266
- super(tag);
267
- }
268
- };
177
+ function stringifyPoint(modelId, text, type = "node", propertySet) {
178
+ const parts = [];
179
+ parts.push(`<dgm:pt modelId="${escapeXml(String(modelId))}" type="${escapeXml(type)}">`);
180
+ if (propertySet) parts.push(stringifyPropertySet(propertySet));
181
+ parts.push(stringifyPointText(text));
182
+ parts.push("</dgm:pt>");
183
+ return parts.join("");
184
+ }
269
185
  /**
270
- * dgm:ttext body within a point.
186
+ * dgm:pttransition point (parTrans or sibTrans) XML stringifier.
271
187
  */
272
- var PointText = class extends XmlComponent {
273
- constructor(text) {
274
- super("dgm:t");
275
- this.root.push(new EmptyElement$1("a:bodyPr"));
276
- this.root.push(new EmptyElement$1("a:lstStyle"));
277
- const p = new EmptyElement$1("a:p");
278
- if (text) {
279
- const t = new class extends XmlComponent {
280
- constructor() {
281
- super("a:t");
282
- }
283
- }();
284
- t["root"].push(text);
285
- const r = new class extends XmlComponent {
286
- constructor() {
287
- super("a:r");
288
- }
289
- }();
290
- r["root"].push(t);
291
- p["root"].push(r);
292
- }
293
- this.root.push(p);
294
- }
295
- };
188
+ function stringifyTransPoint(modelId, type, cxnId) {
189
+ return `<dgm:pt modelId="${escapeXml(modelId)}" type="${escapeXml(type)}" cxnId="${escapeXml(cxnId)}"><dgm:spPr/></dgm:pt>`;
190
+ }
191
+ function stringifyPropertySet(opts) {
192
+ const attr = [];
193
+ if (opts.presentationAssociationId !== void 0) attr.push(`presAssocID="${escapeXml(opts.presentationAssociationId)}"`);
194
+ if (opts.presentationName !== void 0) attr.push(`presName="${escapeXml(opts.presentationName)}"`);
195
+ if (opts.presentationStyleLabel !== void 0) attr.push(`presStyleLbl="${escapeXml(opts.presentationStyleLabel)}"`);
196
+ if (opts.presentationStyleIndex !== void 0) attr.push(`presStyleIdx="${opts.presentationStyleIndex}"`);
197
+ if (opts.presentationStyleCount !== void 0) attr.push(`presStyleCnt="${opts.presentationStyleCount}"`);
198
+ if (opts.placeholderText !== void 0) attr.push(`phldrT="${escapeXml(opts.placeholderText)}"`);
199
+ if (opts.placeholder !== void 0) attr.push(`phldr="${opts.placeholder ? 1 : 0}"`);
200
+ if (opts.customAngle !== void 0) attr.push(`custAng="${opts.customAngle}"`);
201
+ if (opts.customFlipVertical !== void 0) attr.push(`custFlipVert="${opts.customFlipVertical ? 1 : 0}"`);
202
+ if (opts.customFlipHorizontal !== void 0) attr.push(`custFlipHor="${opts.customFlipHorizontal ? 1 : 0}"`);
203
+ if (opts.customSizeX !== void 0) attr.push(`custSzX="${opts.customSizeX}"`);
204
+ if (opts.customSizeY !== void 0) attr.push(`custSzY="${opts.customSizeY}"`);
205
+ if (opts.customScaleX !== void 0) attr.push(`custScaleX="${opts.customScaleX}"`);
206
+ if (opts.customScaleY !== void 0) attr.push(`custScaleY="${opts.customScaleY}"`);
207
+ if (opts.customText !== void 0) attr.push(`custT="${opts.customText ? 1 : 0}"`);
208
+ if (opts.customLinearFactorX !== void 0) attr.push(`custLinFactX="${opts.customLinearFactorX}"`);
209
+ if (opts.customLinearFactorY !== void 0) attr.push(`custLinFactY="${opts.customLinearFactorY}"`);
210
+ if (opts.customLinearFactorNeighborX !== void 0) attr.push(`custLinFactNeighborX="${opts.customLinearFactorNeighborX}"`);
211
+ if (opts.customLinearFactorNeighborY !== void 0) attr.push(`custLinFactNeighborY="${opts.customLinearFactorNeighborY}"`);
212
+ if (opts.customRadialScaleRadius !== void 0) attr.push(`custRadScaleRad="${opts.customRadialScaleRadius}"`);
213
+ if (opts.customRadialScaleIncrement !== void 0) attr.push(`custRadScaleInc="${opts.customRadialScaleIncrement}"`);
214
+ if (opts.coherent3DOffset !== void 0) attr.push(`coherent3DOff="${opts.coherent3DOffset ? 1 : 0}"`);
215
+ if (opts.hideGeometry !== void 0) attr.push(`hideGeom="${opts.hideGeometry ? 1 : 0}"`);
216
+ if (opts.hideLastTransition !== void 0) attr.push(`hideLastTrans="${opts.hideLastTransition ? 1 : 0}"`);
217
+ if (opts.lockTextEntry !== void 0) attr.push(`lkTxEntry="${opts.lockTextEntry ? 1 : 0}"`);
218
+ if (opts.moveWith !== void 0) attr.push(`moveWith="${escapeXml(opts.moveWith)}"`);
219
+ if (opts.useDefault !== void 0) attr.push(`useDef="${opts.useDefault ? 1 : 0}"`);
220
+ if (opts.zOrderOffset !== void 0) attr.push(`zOrderOff="${opts.zOrderOffset}"`);
221
+ if (opts.layoutTypeId !== void 0) attr.push(`loTypeId="${escapeXml(opts.layoutTypeId)}"`);
222
+ if (opts.layoutCategoryId !== void 0) attr.push(`loCatId="${escapeXml(opts.layoutCategoryId)}"`);
223
+ if (opts.quickStyleTypeId !== void 0) attr.push(`qsTypeId="${escapeXml(opts.quickStyleTypeId)}"`);
224
+ if (opts.quickStyleCategoryId !== void 0) attr.push(`qsCatId="${escapeXml(opts.quickStyleCategoryId)}"`);
225
+ if (opts.colorStyleTypeId !== void 0) attr.push(`csTypeId="${escapeXml(opts.colorStyleTypeId)}"`);
226
+ if (opts.colorStyleCategoryId !== void 0) attr.push(`csCatId="${escapeXml(opts.colorStyleCategoryId)}"`);
227
+ if (attr.length === 0) return "";
228
+ return `<dgm:prSet ${attr.join(" ")}/>`;
229
+ }
230
+ function stringifyPointText(text) {
231
+ return `<dgm:t><a:bodyPr/><a:lstStyle/><a:p>${text ? `<a:r><a:t>${escapeXml(text)}</a:t></a:r>` : ""}</a:p></dgm:t>`;
232
+ }
296
233
  //#endregion
297
234
  //#region src/smartart/smartart-collection.ts
298
235
  /**
@@ -312,76 +249,55 @@ var SmartArtCollection = class {
312
249
  };
313
250
  //#endregion
314
251
  //#region src/smartart/tree-to-model.ts
315
- function createDocPoint(layout, style, color) {
316
- const pt = new class extends XmlComponent {
317
- constructor() {
318
- super("dgm:pt");
319
- }
320
- }();
321
- pt["root"].push(chartAttr({
322
- modelId: 0,
323
- type: "doc"
324
- }));
325
- const prSet = new class extends XmlComponent {
326
- constructor() {
327
- super("dgm:prSet");
328
- }
329
- }();
330
- prSet["root"].push(chartAttr({
331
- loTypeId: `urn:microsoft.com/office/officeart/2005/8/layout/${layout}`,
332
- loCatId: LAYOUT_CATEGORIES[layout] ?? "list",
333
- qsTypeId: `urn:microsoft.com/office/officeart/2005/8/quickstyle/${style}`,
334
- qsCatId: STYLE_CATEGORIES[style] ?? "simple",
335
- csTypeId: `urn:microsoft.com/office/officeart/2005/8/colors/${color}`,
336
- csCatId: COLOR_CATEGORIES[color] ?? "accent1",
337
- phldr: "0"
338
- }));
339
- pt["root"].push(prSet);
340
- pt["root"].push(new EmptyElement("dgm:spPr"));
341
- pt["root"].push(createEmptyTextBody());
342
- return pt;
343
- }
344
- function createEmptyTextBody() {
345
- const t = new class extends XmlComponent {
346
- constructor() {
347
- super("dgm:t");
348
- }
349
- }();
350
- t["root"].push(new EmptyElement("a:bodyPr"));
351
- t["root"].push(new EmptyElement("a:lstStyle"));
352
- t["root"].push(new EmptyElement("a:p"));
353
- return t;
252
+ function stringifyDocPoint(layout, style, color) {
253
+ const loTypeId = `urn:microsoft.com/office/officeart/2005/8/layout/${layout}`;
254
+ const loCatId = LAYOUT_CATEGORIES[layout] ?? "list";
255
+ const qsTypeId = `urn:microsoft.com/office/officeart/2005/8/quickstyle/${style}`;
256
+ const qsCatId = STYLE_CATEGORIES[style] ?? "simple";
257
+ const csTypeId = `urn:microsoft.com/office/officeart/2005/8/colors/${color}`;
258
+ const csCatId = COLOR_CATEGORIES[color] ?? "accent1";
259
+ return [
260
+ "<dgm:pt modelId=\"0\" type=\"doc\">",
261
+ `<dgm:prSet loTypeId="${escapeXml(loTypeId)}" loCatId="${escapeXml(loCatId)}" qsTypeId="${escapeXml(qsTypeId)}" qsCatId="${escapeXml(qsCatId)}" csTypeId="${escapeXml(csTypeId)}" csCatId="${escapeXml(csCatId)}" phldr="0"/>`,
262
+ "<dgm:spPr/>",
263
+ "<dgm:t><a:bodyPr/><a:lstStyle/><a:p/></dgm:t>",
264
+ "</dgm:pt>"
265
+ ].join("");
354
266
  }
355
- var EmptyElement = class extends XmlComponent {
356
- constructor(tag) {
357
- super(tag);
358
- }
359
- };
360
267
  function uuid() {
361
268
  return `{${crypto.randomUUID().toUpperCase()}}`;
362
269
  }
363
270
  /**
364
- * Creates a DataModel from tree nodes with layout/style/color settings.
271
+ * Creates SmartArt data model XML from tree nodes with layout/style/color settings.
272
+ * Returns the XML string body (no XML declaration).
365
273
  */
366
274
  const createDataModel = (nodes, layout = "default", style = "simple1", color = "accent1_2") => {
367
- const points = [];
368
- const connections = [];
369
- points.push(createDocPoint(layout, style, color));
275
+ const pointStrs = [];
276
+ const connectionStrs = [];
277
+ pointStrs.push(stringifyDocPoint(layout, style, color));
370
278
  for (let i = 0; i < nodes.length; i++) {
371
279
  const walk = (node, parentUuid, srcOrd) => {
372
280
  const nodeUuid = uuid();
373
281
  const parTransUuid = uuid();
374
282
  const sibTransUuid = uuid();
375
283
  const cxnUuid = uuid();
376
- points.push(new TransPoint(parTransUuid, "parTrans", cxnUuid));
377
- points.push(new TransPoint(sibTransUuid, "sibTrans", cxnUuid));
378
- points.push(new Point(nodeUuid, node.text));
379
- connections.push(new Connection(parTransUuid, parentUuid, nodeUuid, void 0, srcOrd, 0, parTransUuid, sibTransUuid));
284
+ pointStrs.push(stringifyTransPoint(parTransUuid, "parTrans", cxnUuid));
285
+ pointStrs.push(stringifyTransPoint(sibTransUuid, "sibTrans", cxnUuid));
286
+ pointStrs.push(stringifyPoint(nodeUuid, node.text));
287
+ connectionStrs.push(stringifyConnection({
288
+ modelId: parTransUuid,
289
+ srcId: parentUuid,
290
+ destId: nodeUuid,
291
+ srcOrd,
292
+ destOrd: 0,
293
+ parTransId: parTransUuid,
294
+ sibTransId: sibTransUuid
295
+ }));
380
296
  if (node.children) for (let j = 0; j < node.children.length; j++) walk(node.children[j], nodeUuid, j);
381
297
  };
382
298
  walk(nodes[i], "0", i);
383
299
  }
384
- return new DataModel(points, connections);
300
+ return stringifyDataModel(pointStrs, connectionStrs);
385
301
  };
386
302
  //#endregion
387
- export { DataModel as a, getColorXml as c, COLOR_CATEGORIES as d, LAYOUT_CATEGORIES as f, TransPoint as i, getLayoutXml as l, SmartArtCollection as n, Connection as o, STYLE_CATEGORIES as p, Point as r, DEFAULT_DRAWING_XML as s, createDataModel as t, getStyleXml as u };
303
+ export { stringifyDataModel as a, getColorXml as c, COLOR_CATEGORIES as d, LAYOUT_CATEGORIES as f, stringifyTransPoint as i, getLayoutXml as l, SmartArtCollection as n, stringifyConnection as o, STYLE_CATEGORIES as p, stringifyPoint as r, DEFAULT_DRAWING_XML as s, createDataModel as t, getStyleXml as u };