@officedk/pptxdk 0.0.0-stage → 0.1.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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -2
  3. package/dist/build.d.ts +94 -0
  4. package/dist/build.js +148 -0
  5. package/dist/capabilities/dist/all.js +32 -0
  6. package/dist/capabilities/dist/box/box-codegen.js +51 -0
  7. package/dist/capabilities/dist/box/box-declaration.js +31 -0
  8. package/dist/capabilities/dist/box/box-elements.js +17 -0
  9. package/dist/capabilities/dist/box/box.js +138 -0
  10. package/dist/capabilities/dist/chart/chart-codegen.js +77 -0
  11. package/dist/capabilities/dist/chart/chart-declaration.js +7 -0
  12. package/dist/capabilities/dist/chart/chart-elements.js +12 -0
  13. package/dist/capabilities/dist/chart/chart-import.js +2272 -0
  14. package/dist/capabilities/dist/chart/chart-labels.js +86 -0
  15. package/dist/capabilities/dist/chart/chart-model.js +9 -0
  16. package/dist/capabilities/dist/chart/chart-schemas.js +1078 -0
  17. package/dist/capabilities/dist/chart/chart-xml.js +788 -0
  18. package/dist/capabilities/dist/chart/chart.js +1124 -0
  19. package/dist/capabilities/dist/chart/preview/axes-and-grid.js +298 -0
  20. package/dist/capabilities/dist/chart/preview/bar-column.js +143 -0
  21. package/dist/capabilities/dist/chart/preview/data-labels.js +334 -0
  22. package/dist/capabilities/dist/chart/preview/error-bars.js +213 -0
  23. package/dist/capabilities/dist/chart/preview/index.js +190 -0
  24. package/dist/capabilities/dist/chart/preview/layout.js +519 -0
  25. package/dist/capabilities/dist/chart/preview/legend.js +273 -0
  26. package/dist/capabilities/dist/chart/preview/line-area.js +404 -0
  27. package/dist/capabilities/dist/chart/preview/markers.js +100 -0
  28. package/dist/capabilities/dist/chart/preview/number-format.js +247 -0
  29. package/dist/capabilities/dist/chart/preview/pie-doughnut.js +159 -0
  30. package/dist/capabilities/dist/chart/preview/scales.js +365 -0
  31. package/dist/capabilities/dist/chart/preview/scatter.js +131 -0
  32. package/dist/capabilities/dist/chart/preview/style.js +48 -0
  33. package/dist/capabilities/dist/chart/preview/text-render.js +116 -0
  34. package/dist/capabilities/dist/chart/preview/trendlines.js +537 -0
  35. package/dist/capabilities/dist/chart/preview/types.js +5 -0
  36. package/dist/capabilities/dist/document.js +148 -0
  37. package/dist/capabilities/dist/font/font-embedding.js +289 -0
  38. package/dist/capabilities/dist/font/font-family.js +10 -0
  39. package/dist/capabilities/dist/font/font-import.js +302 -0
  40. package/dist/capabilities/dist/font/font-subset.js +55 -0
  41. package/dist/capabilities/dist/font/font.js +25 -0
  42. package/dist/capabilities/dist/group/group-codegen.js +51 -0
  43. package/dist/capabilities/dist/group/group-declaration.js +42 -0
  44. package/dist/capabilities/dist/group/group-elements.js +12 -0
  45. package/dist/capabilities/dist/group/group-import.js +319 -0
  46. package/dist/capabilities/dist/group/group-xml.js +7 -0
  47. package/dist/capabilities/dist/group/group.js +211 -0
  48. package/dist/capabilities/dist/image/gif-decoder.js +244 -0
  49. package/dist/capabilities/dist/image/image-codegen.js +94 -0
  50. package/dist/capabilities/dist/image/image-declaration.js +8 -0
  51. package/dist/capabilities/dist/image/image-decode.js +221 -0
  52. package/dist/capabilities/dist/image/image-elements.js +12 -0
  53. package/dist/capabilities/dist/image/image-import.js +778 -0
  54. package/dist/capabilities/dist/image/image-schemas.js +149 -0
  55. package/dist/capabilities/dist/image/image-xml.js +12 -0
  56. package/dist/capabilities/dist/image/image.js +472 -0
  57. package/dist/capabilities/dist/masters/footer-placeholder.js +685 -0
  58. package/dist/capabilities/dist/masters/masters-codegen.js +21 -0
  59. package/dist/capabilities/dist/masters/masters.js +250 -0
  60. package/dist/capabilities/dist/motion/motion-api.js +527 -0
  61. package/dist/capabilities/dist/motion/motion-codegen.js +340 -0
  62. package/dist/capabilities/dist/motion/motion-elements.js +43 -0
  63. package/dist/capabilities/dist/motion/motion-import.js +1033 -0
  64. package/dist/capabilities/dist/motion/motion-plan.js +2189 -0
  65. package/dist/capabilities/dist/motion/motion-query.js +420 -0
  66. package/dist/capabilities/dist/motion/motion-schemas.js +216 -0
  67. package/dist/capabilities/dist/motion/motion.js +1372 -0
  68. package/dist/capabilities/dist/notes/notes-codegen.js +20 -0
  69. package/dist/capabilities/dist/notes/notes-declaration.js +8 -0
  70. package/dist/capabilities/dist/notes/notes-elements.js +12 -0
  71. package/dist/capabilities/dist/notes/notes-import.js +292 -0
  72. package/dist/capabilities/dist/notes/notes-schemas.js +35 -0
  73. package/dist/capabilities/dist/notes/notes-xml.js +38 -0
  74. package/dist/capabilities/dist/notes/notes.js +191 -0
  75. package/dist/capabilities/dist/placeholder/placeholder-codegen.js +23 -0
  76. package/dist/capabilities/dist/placeholder/placeholder-elements.js +12 -0
  77. package/dist/capabilities/dist/placeholder/placeholder.js +292 -0
  78. package/dist/capabilities/dist/shape/shape-codegen.js +166 -0
  79. package/dist/capabilities/dist/shape/shape-declaration.js +57 -0
  80. package/dist/capabilities/dist/shape/shape-elements.js +12 -0
  81. package/dist/capabilities/dist/shape/shape-import.js +579 -0
  82. package/dist/capabilities/dist/shape/shape-xml.js +6 -0
  83. package/dist/capabilities/dist/shape/shape.js +337 -0
  84. package/dist/capabilities/dist/shared/geometry.js +1423 -0
  85. package/dist/capabilities/dist/shared/identity.js +205 -0
  86. package/dist/capabilities/dist/shared/morph-api.js +11 -0
  87. package/dist/capabilities/dist/shared/placeholder-import.js +113 -0
  88. package/dist/capabilities/dist/shared/preset-definitions.js +21390 -0
  89. package/dist/capabilities/dist/shared/style-inheritance.js +166 -0
  90. package/dist/capabilities/dist/shared/style-parse.js +11 -0
  91. package/dist/capabilities/dist/shared/text-schemas.js +216 -0
  92. package/dist/capabilities/dist/shared/text-service.js +1883 -0
  93. package/dist/capabilities/dist/shared/visual.js +918 -0
  94. package/dist/capabilities/dist/slide-background/slide-background-codegen.js +44 -0
  95. package/dist/capabilities/dist/slide-background/slide-background-import.js +161 -0
  96. package/dist/capabilities/dist/slide-background/slide-background-xml.js +21 -0
  97. package/dist/capabilities/dist/slide-background/slide-background.js +221 -0
  98. package/dist/capabilities/dist/table/table-codegen.js +81 -0
  99. package/dist/capabilities/dist/table/table-declaration.js +15 -0
  100. package/dist/capabilities/dist/table/table-elements.js +27 -0
  101. package/dist/capabilities/dist/table/table-import.js +539 -0
  102. package/dist/capabilities/dist/table/table-schemas.js +279 -0
  103. package/dist/capabilities/dist/table/table-xml.js +37 -0
  104. package/dist/capabilities/dist/table/table.js +662 -0
  105. package/dist/capabilities/dist/text/text-codegen.js +129 -0
  106. package/dist/capabilities/dist/text/text-declaration.js +19 -0
  107. package/dist/capabilities/dist/text/text-elements.js +38 -0
  108. package/dist/capabilities/dist/text/text-import.js +1077 -0
  109. package/dist/capabilities/dist/text/text-xml.js +9 -0
  110. package/dist/capabilities/dist/text/text.js +335 -0
  111. package/dist/capabilities/dist/transition/transition-api.js +139 -0
  112. package/dist/capabilities/dist/transition/transition-codegen.js +45 -0
  113. package/dist/capabilities/dist/transition/transition-import.js +477 -0
  114. package/dist/capabilities/dist/transition/transition.js +260 -0
  115. package/dist/capability-D_xeNVIw.d.ts +29496 -0
  116. package/dist/cli.js +20 -0
  117. package/dist/codegen/dist/assets.js +78 -0
  118. package/dist/codegen/dist/codegen.js +611 -0
  119. package/dist/codegen/dist/identifiers.js +193 -0
  120. package/dist/codegen/dist/index.js +3 -0
  121. package/dist/codegen/dist/printer.js +143 -0
  122. package/dist/codegen/dist/types.js +49 -0
  123. package/dist/core/dist/author-ids.js +48 -0
  124. package/dist/core/dist/author-schemas.js +313 -0
  125. package/dist/core/dist/block-flex-layout.js +749 -0
  126. package/dist/core/dist/build.js +4 -0
  127. package/dist/core/dist/capability.js +13 -0
  128. package/dist/core/dist/declaration.js +15 -0
  129. package/dist/core/dist/diagnostics.js +21 -0
  130. package/dist/core/dist/document-internals.js +13 -0
  131. package/dist/core/dist/document.js +408 -0
  132. package/dist/core/dist/geometry-schemas.js +249 -0
  133. package/dist/core/dist/grid-layout.js +445 -0
  134. package/dist/core/dist/host.js +40 -0
  135. package/dist/core/dist/index.js +15 -0
  136. package/dist/core/dist/input-values.js +45 -0
  137. package/dist/core/dist/layout-protocol.js +66 -0
  138. package/dist/core/dist/layout-schemas.js +208 -0
  139. package/dist/core/dist/layout.js +299 -0
  140. package/dist/core/dist/masters.js +169 -0
  141. package/dist/core/dist/morph.js +30 -0
  142. package/dist/core/dist/placeholders.js +213 -0
  143. package/dist/core/dist/query.js +155 -0
  144. package/dist/core/dist/resolution.js +11 -0
  145. package/dist/core/dist/resolve.js +1827 -0
  146. package/dist/core/dist/stage-options.js +67 -0
  147. package/dist/core/dist/theme.js +931 -0
  148. package/dist/document-BHPUODPP.d.ts +27759 -0
  149. package/dist/emit/dist/emit.js +936 -0
  150. package/dist/emit/dist/index.js +5 -0
  151. package/dist/emit/dist/ooxml.js +606 -0
  152. package/dist/emit/dist/shape-tree.js +12 -0
  153. package/dist/import/dist/alternate-content.js +54 -0
  154. package/dist/import/dist/diagnostics.js +153 -0
  155. package/dist/import/dist/fonts.js +250 -0
  156. package/dist/import/dist/import.js +504 -0
  157. package/dist/import/dist/index.js +16 -0
  158. package/dist/import/dist/masters.js +1153 -0
  159. package/dist/import/dist/mechanism.js +10 -0
  160. package/dist/import/dist/namespaces.js +60 -0
  161. package/dist/import/dist/notes-masters.js +300 -0
  162. package/dist/import/dist/opc.js +233 -0
  163. package/dist/import/dist/resources.js +166 -0
  164. package/dist/import/dist/sections.js +139 -0
  165. package/dist/import/dist/themes.js +671 -0
  166. package/dist/import/dist/visual.js +761 -0
  167. package/dist/import/dist/xml-fragments.js +36 -0
  168. package/dist/import/dist/xml-reader.js +267 -0
  169. package/dist/index-B5m3hqjC.d.ts +7 -0
  170. package/dist/index-CCy-Yo8G.d.ts +1208 -0
  171. package/dist/index-DpxcZ4Gs.d.ts +725 -0
  172. package/dist/index.d.ts +7 -0
  173. package/dist/index.js +70 -0
  174. package/dist/node.d.ts +53 -0
  175. package/dist/node.js +194 -0
  176. package/dist/pptxdk/src/cli-commands.js +913 -0
  177. package/dist/pptxdk/src/compose.js +44 -0
  178. package/dist/pptxdk/src/slide.js +9 -0
  179. package/dist/preview/dist/index.js +240 -0
  180. package/dist/preview/dist/options.js +53 -0
  181. package/dist/preview-Cfw0QdMM.d.ts +86 -0
  182. package/dist/preview.d.ts +3 -0
  183. package/dist/preview.js +27 -0
  184. package/dist/react/dist/append.js +66 -0
  185. package/dist/react/dist/document-adapter.js +65 -0
  186. package/dist/react/dist/elements.js +59 -0
  187. package/dist/react/dist/index.js +68 -0
  188. package/dist/react/dist/reconciler.js +290 -0
  189. package/dist/react.d.ts +145 -0
  190. package/dist/react.js +27 -0
  191. package/dist/transition-Cips9wma.d.ts +82 -0
  192. package/dist/vanilla.d.ts +4 -0
  193. package/dist/vanilla.js +14 -0
  194. package/package.json +78 -3
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ // ../import/dist/xml-fragments.js
3
+ const integerStringPattern = /^-?\d+$/u;
4
+ const hexRgbPattern = /^[0-9a-fA-F]{6}$/u;
5
+ /** Parses an OOXML signed integer attribute string into a safe integer. */
6
+ const ooxmlIntSchema = z.string().regex(integerStringPattern).transform((value) => Number(value)).refine((value) => Number.isSafeInteger(value));
7
+ /** Parses an OOXML non-negative integer attribute string into a safe integer. */
8
+ const ooxmlNonNegativeIntSchema = ooxmlIntSchema.refine((value) => value >= 0);
9
+ /** Parses an OOXML positive integer attribute string into a safe integer. */
10
+ const ooxmlPositiveIntSchema = ooxmlIntSchema.refine((value) => value > 0);
11
+ /** Parses OOXML xsd:boolean attribute values ("1" | "0" | "true" | "false"). */
12
+ const ooxmlBoolSchema = z.enum([
13
+ "1",
14
+ "0",
15
+ "true",
16
+ "false"
17
+ ]).transform((value) => value === "1" || value === "true");
18
+ /** Six-digit hex RGB value stored in `<a:srgbClr val="RRGGBB"/>`. */
19
+ const hexRgb6Schema = z.string().regex(hexRgbPattern);
20
+ /** `<a:off x="..." y="..."/>` fragment schema. */
21
+ const offsetEmuFragmentSchema = z.object({
22
+ x: ooxmlIntSchema,
23
+ y: ooxmlIntSchema
24
+ });
25
+ /** `<a:ext cx="..." cy="..."/>` fragment schema. */
26
+ const extentEmuFragmentSchema = z.object({
27
+ cx: ooxmlPositiveIntSchema,
28
+ cy: ooxmlPositiveIntSchema
29
+ });
30
+ /** `<a:xfrm rot="..." flipH="..." flipV="..."/>` attribute fragment schema. */
31
+ const transformAttributesFragmentSchema = z.object({
32
+ rot: ooxmlIntSchema.optional(),
33
+ flipH: ooxmlBoolSchema.optional(),
34
+ flipV: ooxmlBoolSchema.optional()
35
+ });
36
+ export { extentEmuFragmentSchema, hexRgb6Schema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema, transformAttributesFragmentSchema };
@@ -0,0 +1,267 @@
1
+ import { canonicalQName } from "./namespaces.js";
2
+ import { DOMParser } from "@xmldom/xmldom";
3
+ // ../import/dist/xml-reader.js
4
+ var _a;
5
+ /** Error raised when an XML part fails well-formedness or lacks a root element. */
6
+ var MalformedXmlPartError = class extends Error {
7
+ partPath;
8
+ detail;
9
+ constructor(partPath, detail) {
10
+ super(`Malformed XML in ${partPath}: ${detail}`);
11
+ this.name = "MalformedXmlPartError";
12
+ this.partPath = partPath;
13
+ this.detail = detail;
14
+ }
15
+ };
16
+ /** Parses an XML part with `@xmldom/xmldom` without emitting console noise. */
17
+ function parseXmlPart(partPath, xmlText) {
18
+ let parseFailure;
19
+ const parser = new DOMParser({ onError(level, message) {
20
+ if (level === "error" || level === "fatalError") parseFailure ??= message;
21
+ } });
22
+ let doc;
23
+ try {
24
+ doc = parser.parseFromString(xmlText, "application/xml");
25
+ } catch (error) {
26
+ throw new MalformedXmlPartError(partPath, error instanceof Error ? error.message : String(error));
27
+ }
28
+ if (parseFailure !== void 0 || doc.documentElement === null) throw new MalformedXmlPartError(partPath, parseFailure ?? "Missing root element");
29
+ return doc.documentElement;
30
+ }
31
+ function attrKey(namespaceUri, localName) {
32
+ return `${namespaceUri}\u0000${localName}`;
33
+ }
34
+ function isIgnorableDeclarationAttr(namespaceUri, name, prefix, localName) {
35
+ if (namespaceUri === "http://www.w3.org/2000/xmlns/" || name === "xmlns" || prefix === "xmlns") return true;
36
+ return namespaceUri === "http://schemas.openxmlformats.org/markup-compatibility/2006" && localName === "Ignorable";
37
+ }
38
+ function isXmlElement(node) {
39
+ return node.nodeType === 1;
40
+ }
41
+ function elementChildrenOf(element) {
42
+ const result = [];
43
+ for (let child = element.firstChild; child !== null; child = child.nextSibling) if (isXmlElement(child)) result.push(child);
44
+ return result;
45
+ }
46
+ function childXpathFor(parentXpath, siblings, target) {
47
+ const ns = target.namespaceURI ?? "";
48
+ const local = target.localName ?? target.tagName;
49
+ const qname = canonicalQName(ns, local);
50
+ let total = 0;
51
+ let position = 0;
52
+ for (const sibling of siblings) {
53
+ const siblingNs = sibling.namespaceURI ?? "";
54
+ const siblingLocal = sibling.localName ?? sibling.tagName;
55
+ if (siblingNs === ns && siblingLocal === local) {
56
+ total += 1;
57
+ if (sibling === target) position = total;
58
+ }
59
+ }
60
+ return total > 1 ? `${parentXpath}/${qname}[${position}]` : `${parentXpath}/${qname}`;
61
+ }
62
+ /**
63
+ * Namespace-aware XML cursor that tracks consumed attributes and child elements so
64
+ * unconsumed OOXML constructs are surfaced with exact package part and XPath locations.
65
+ */
66
+ var XmlElementCursor = class {
67
+ element;
68
+ part;
69
+ xpath;
70
+ namespaceUri;
71
+ localName;
72
+ #registry;
73
+ #consumedAttrs = /* @__PURE__ */ new Set();
74
+ #consumedChildren = /* @__PURE__ */ new Set();
75
+ #suppressUnconsumed = false;
76
+ #cachedChildren;
77
+ constructor(element, part, xpath, registry) {
78
+ this.element = element;
79
+ this.part = part;
80
+ this.xpath = xpath;
81
+ this.namespaceUri = element.namespaceURI ?? "";
82
+ this.localName = element.localName ?? element.tagName;
83
+ this.#registry = registry;
84
+ this.#registry.byElement.set(element, this);
85
+ this.#registry.ordered.push(this);
86
+ }
87
+ static createRoot(element, part, rootXpath) {
88
+ const registry = {
89
+ byElement: /* @__PURE__ */ new Map(),
90
+ ordered: []
91
+ };
92
+ const ns = element.namespaceURI ?? "";
93
+ const local = element.localName ?? element.tagName;
94
+ return new _a(element, part, rootXpath ?? `/${canonicalQName(ns, local)}`, registry);
95
+ }
96
+ get textContent() {
97
+ return this.element.textContent ?? "";
98
+ }
99
+ #elementChildren() {
100
+ this.#cachedChildren ??= elementChildrenOf(this.element);
101
+ return this.#cachedChildren;
102
+ }
103
+ #cursorFor(child) {
104
+ const existing = this.#registry.byElement.get(child);
105
+ if (existing !== void 0) return existing;
106
+ const xpath = childXpathFor(this.xpath, this.#elementChildren(), child);
107
+ return new _a(child, this.part, xpath, this.#registry);
108
+ }
109
+ /** Reads an attribute by `(namespaceUri, localName)` and marks it consumed if present. */
110
+ attr(localName, namespaceUri = "") {
111
+ const attributes = this.element.attributes;
112
+ for (let i = 0; i < attributes.length; i += 1) {
113
+ const attribute = attributes.item(i);
114
+ if (attribute === null) continue;
115
+ const attrNs = attribute.namespaceURI ?? "";
116
+ const attrLocal = attribute.localName ?? attribute.name;
117
+ if (attrNs === namespaceUri && attrLocal === localName) {
118
+ this.#consumedAttrs.add(attrKey(attrNs, attrLocal));
119
+ return attribute.value;
120
+ }
121
+ }
122
+ }
123
+ /** Reads a set of allowed attributes into a plain record for Zod fragment parsing. */
124
+ attrsObject(allowed, namespaceUri = "") {
125
+ const result = {};
126
+ for (const localName of allowed) {
127
+ const value = this.attr(localName, namespaceUri);
128
+ if (value !== void 0) result[localName] = value;
129
+ }
130
+ return result;
131
+ }
132
+ /** Marks an attribute consumed even if its value is not retained. */
133
+ consumeAttr(localName, namespaceUri = "") {
134
+ return this.attr(localName, namespaceUri) !== void 0;
135
+ }
136
+ /** Returns the first matching child cursor and marks that child element consumed. */
137
+ child(namespaceUri, localName) {
138
+ for (const child of this.#elementChildren()) {
139
+ const childNs = child.namespaceURI ?? "";
140
+ const childLocal = child.localName ?? child.tagName;
141
+ if (childNs === namespaceUri && childLocal === localName) {
142
+ this.#consumedChildren.add(child);
143
+ return this.#cursorFor(child);
144
+ }
145
+ }
146
+ }
147
+ /** Returns all matching child cursors in document order and marks them consumed. */
148
+ children(namespaceUri, localName) {
149
+ const matches = [];
150
+ for (const child of this.#elementChildren()) {
151
+ const childNs = child.namespaceURI ?? "";
152
+ const childLocal = child.localName ?? child.tagName;
153
+ if (childNs === namespaceUri && childLocal === localName) {
154
+ this.#consumedChildren.add(child);
155
+ matches.push(this.#cursorFor(child));
156
+ }
157
+ }
158
+ return matches;
159
+ }
160
+ /** Returns matching direct element children without marking non-matching siblings consumed. */
161
+ matchingChildren(predicate) {
162
+ const matches = [];
163
+ for (const child of this.#elementChildren()) if (predicate(child)) {
164
+ this.#consumedChildren.add(child);
165
+ matches.push(this.#cursorFor(child));
166
+ }
167
+ return matches;
168
+ }
169
+ /** Returns all direct element children as cursors and marks them consumed by the caller. */
170
+ allElementChildren() {
171
+ return this.#elementChildren().map((child) => {
172
+ this.#consumedChildren.add(child);
173
+ return this.#cursorFor(child);
174
+ });
175
+ }
176
+ /** Returns direct element children not yet consumed in document order and marks them consumed. */
177
+ remainingElementChildren() {
178
+ const remaining = [];
179
+ for (const child of this.#elementChildren()) {
180
+ if (this.#consumedChildren.has(child)) continue;
181
+ this.#consumedChildren.add(child);
182
+ remaining.push(this.#cursorFor(child));
183
+ }
184
+ return remaining;
185
+ }
186
+ /** Marks a specific child cursor consumed (useful after inspecting an element child). */
187
+ markChildConsumed(child) {
188
+ this.#consumedChildren.add(child.element);
189
+ }
190
+ /** Marks all direct element children consumed without descending into them. */
191
+ consumeChildrenWithoutVisiting() {
192
+ for (const child of this.#elementChildren()) this.#consumedChildren.add(child);
193
+ }
194
+ /** Suppresses unconsumed-xml diagnostics for this cursor and its remaining children (used when the subtree is already reported as omitted). */
195
+ suppressUnconsumed() {
196
+ this.#suppressUnconsumed = true;
197
+ this.consumeChildrenWithoutVisiting();
198
+ }
199
+ /** Marks an empty schema-boilerplate child element consumed only when it has no attributes or element children. */
200
+ ignoreEmptyChild(namespaceUri, localName) {
201
+ for (const child of this.#elementChildren()) {
202
+ const childNs = child.namespaceURI ?? "";
203
+ const childLocal = child.localName ?? child.tagName;
204
+ if (childNs !== namespaceUri || childLocal !== localName) continue;
205
+ if (hasNonIgnorableAttributes(child) || elementChildrenOf(child).length > 0) {
206
+ this.#consumedChildren.add(child);
207
+ this.#cursorFor(child);
208
+ return false;
209
+ }
210
+ this.#consumedChildren.add(child);
211
+ return true;
212
+ }
213
+ return false;
214
+ }
215
+ /** Collects unconsumed attributes and direct unconsumed child elements across all visited cursors. */
216
+ collectUnconsumed() {
217
+ const items = [];
218
+ for (const cursor of this.#registry.ordered) {
219
+ if (cursor.#suppressUnconsumed) continue;
220
+ const attributes = cursor.element.attributes;
221
+ for (let i = 0; i < attributes.length; i += 1) {
222
+ const attribute = attributes.item(i);
223
+ if (attribute === null) continue;
224
+ const attrNs = attribute.namespaceURI ?? "";
225
+ const attrLocal = attribute.localName ?? attribute.name;
226
+ if (isIgnorableDeclarationAttr(attrNs, attribute.name, attribute.prefix, attrLocal)) continue;
227
+ if (!cursor.#consumedAttrs.has(attrKey(attrNs, attrLocal))) items.push({
228
+ kind: "attribute",
229
+ location: {
230
+ part: cursor.part,
231
+ xpath: `${cursor.xpath}/@${canonicalQName(attrNs, attrLocal)}`
232
+ },
233
+ namespaceUri: attrNs,
234
+ localName: attrLocal
235
+ });
236
+ }
237
+ const siblings = cursor.#elementChildren();
238
+ for (const child of siblings) if (!cursor.#consumedChildren.has(child)) {
239
+ const childNs = child.namespaceURI ?? "";
240
+ const childLocal = child.localName ?? child.tagName;
241
+ items.push({
242
+ kind: "element",
243
+ location: {
244
+ part: cursor.part,
245
+ xpath: childXpathFor(cursor.xpath, siblings, child)
246
+ },
247
+ namespaceUri: childNs,
248
+ localName: childLocal
249
+ });
250
+ }
251
+ }
252
+ return items;
253
+ }
254
+ };
255
+ _a = XmlElementCursor;
256
+ function hasNonIgnorableAttributes(element) {
257
+ const attributes = element.attributes;
258
+ for (let i = 0; i < attributes.length; i += 1) {
259
+ const attribute = attributes.item(i);
260
+ if (attribute === null) continue;
261
+ const attrNs = attribute.namespaceURI ?? "";
262
+ const attrLocal = attribute.localName ?? attribute.name;
263
+ if (!isIgnorableDeclarationAttr(attrNs, attribute.name, attribute.prefix, attrLocal)) return true;
264
+ }
265
+ return false;
266
+ }
267
+ export { MalformedXmlPartError, XmlElementCursor, parseXmlPart };
@@ -0,0 +1,7 @@
1
+ import { L as EmitResult, _t as EmitOptions, tt as Resolution } from "./capability-D_xeNVIw.js";
2
+ import "./index-DpxcZ4Gs.js";
3
+ /**
4
+ * Emits a PPTX archive and BuildReport from an existing Resolution without re-resolving the document.
5
+ */
6
+ declare function emit(resolution: Resolution, options?: EmitOptions): EmitResult;
7
+ export { emit as t };