@syncfusion/ej2-office-common 35.1.37

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 (147) hide show
  1. package/.eslintrc.json +263 -0
  2. package/.prettierrc.json +5 -0
  3. package/README.md +167 -0
  4. package/api-extractor.json +35 -0
  5. package/core.js +4 -0
  6. package/dist/ej2-office-common.umd.min.js +11 -0
  7. package/dist/ej2-office-common.umd.min.js.map +1 -0
  8. package/dist/es6/ej2-office-common.es2015.js +6585 -0
  9. package/dist/es6/ej2-office-common.es2015.js.map +1 -0
  10. package/dist/es6/ej2-office-common.es5.js +7955 -0
  11. package/dist/es6/ej2-office-common.es5.js.map +1 -0
  12. package/dist/global/ej2-office-common.min.js +11 -0
  13. package/dist/global/ej2-office-common.min.js.map +1 -0
  14. package/dist/global/index.d.ts +14 -0
  15. package/encryption.js +4 -0
  16. package/features.js +4 -0
  17. package/global.json +6 -0
  18. package/index.js +4 -0
  19. package/license +10 -0
  20. package/nuget.config +7 -0
  21. package/package.json +23 -0
  22. package/src/all.d.ts +41 -0
  23. package/src/all.js +38 -0
  24. package/src/core/index.d.ts +6 -0
  25. package/src/core/index.js +6 -0
  26. package/src/core/xml/index.d.ts +7 -0
  27. package/src/core/xml/index.js +6 -0
  28. package/src/core/xml/model.d.ts +71 -0
  29. package/src/core/xml/model.js +20 -0
  30. package/src/encryption/agile-constants.d.ts +61 -0
  31. package/src/encryption/agile-constants.js +71 -0
  32. package/src/encryption/agile-encryption-info.d.ts +46 -0
  33. package/src/encryption/agile-encryption-info.js +333 -0
  34. package/src/encryption/agile-password.d.ts +8 -0
  35. package/src/encryption/agile-password.js +58 -0
  36. package/src/encryption/cfb-reader.d.ts +11 -0
  37. package/src/encryption/cfb-reader.js +345 -0
  38. package/src/encryption/crypto-primitives.d.ts +74 -0
  39. package/src/encryption/crypto-primitives.js +302 -0
  40. package/src/encryption/decrypt-encrypted-package.d.ts +16 -0
  41. package/src/encryption/decrypt-encrypted-package.js +138 -0
  42. package/src/encryption/encryption-info-xml.d.ts +21 -0
  43. package/src/encryption/encryption-info-xml.js +282 -0
  44. package/src/encryption/errors.d.ts +66 -0
  45. package/src/encryption/errors.js +124 -0
  46. package/src/encryption/index.d.ts +35 -0
  47. package/src/encryption/index.js +100 -0
  48. package/src/features/diagrams/constants.d.ts +83 -0
  49. package/src/features/diagrams/constants.js +101 -0
  50. package/src/features/diagrams/diagram-data-model.d.ts +148 -0
  51. package/src/features/diagrams/diagram-data-model.js +446 -0
  52. package/src/features/diagrams/diagram-parsers.d.ts +28 -0
  53. package/src/features/diagrams/diagram-parsers.js +182 -0
  54. package/src/features/diagrams/diagram-serializers.d.ts +20 -0
  55. package/src/features/diagrams/diagram-serializers.js +110 -0
  56. package/src/features/diagrams/diagram-views.d.ts +60 -0
  57. package/src/features/diagrams/diagram-views.js +213 -0
  58. package/src/features/diagrams/element-tree.d.ts +55 -0
  59. package/src/features/diagrams/element-tree.js +197 -0
  60. package/src/features/diagrams/errors.d.ts +17 -0
  61. package/src/features/diagrams/errors.js +59 -0
  62. package/src/features/diagrams/index.d.ts +17 -0
  63. package/src/features/diagrams/index.js +17 -0
  64. package/src/features/diagrams/smart-art-catalog.d.ts +107 -0
  65. package/src/features/diagrams/smart-art-catalog.js +422 -0
  66. package/src/features/diagrams/smart-art-diagram.d.ts +96 -0
  67. package/src/features/diagrams/smart-art-diagram.js +258 -0
  68. package/src/features/index.d.ts +11 -0
  69. package/src/features/index.js +11 -0
  70. package/src/features/ink/constants.d.ts +54 -0
  71. package/src/features/ink/constants.js +54 -0
  72. package/src/features/ink/index.d.ts +18 -0
  73. package/src/features/ink/index.js +15 -0
  74. package/src/features/ink/ink-effects.d.ts +35 -0
  75. package/src/features/ink/ink-effects.js +45 -0
  76. package/src/features/ink/ink-model.d.ts +237 -0
  77. package/src/features/ink/ink-model.js +406 -0
  78. package/src/features/ink/ink-parser.d.ts +59 -0
  79. package/src/features/ink/ink-parser.js +671 -0
  80. package/src/features/ink/ink-serializer.d.ts +16 -0
  81. package/src/features/ink/ink-serializer.js +281 -0
  82. package/src/features/ink/ink-units.d.ts +33 -0
  83. package/src/features/ink/ink-units.js +92 -0
  84. package/src/features/ink/ink-xml.d.ts +26 -0
  85. package/src/features/ink/ink-xml.js +165 -0
  86. package/src/features/ink/trace-codec.d.ts +127 -0
  87. package/src/features/ink/trace-codec.js +266 -0
  88. package/src/features/mathml/constants.d.ts +47 -0
  89. package/src/features/mathml/constants.js +47 -0
  90. package/src/features/mathml/errors.d.ts +50 -0
  91. package/src/features/mathml/errors.js +69 -0
  92. package/src/features/mathml/index.d.ts +30 -0
  93. package/src/features/mathml/index.js +22 -0
  94. package/src/features/mathml/math-factory.d.ts +26 -0
  95. package/src/features/mathml/math-factory.js +568 -0
  96. package/src/features/mathml/model/controls.d.ts +896 -0
  97. package/src/features/mathml/model/controls.js +1541 -0
  98. package/src/features/mathml/model/enums.d.ts +153 -0
  99. package/src/features/mathml/model/enums.js +133 -0
  100. package/src/features/mathml/model/math-element.d.ts +173 -0
  101. package/src/features/mathml/model/math-element.js +315 -0
  102. package/src/features/mathml/model/roots.d.ts +82 -0
  103. package/src/features/mathml/model/roots.js +177 -0
  104. package/src/features/mathml/openxml.d.ts +56 -0
  105. package/src/features/mathml/openxml.js +87 -0
  106. package/src/features/mathml/parse/math-parser.d.ts +43 -0
  107. package/src/features/mathml/parse/math-parser.js +636 -0
  108. package/src/features/mathml/serialize/math-serializer.d.ts +34 -0
  109. package/src/features/mathml/serialize/math-serializer.js +749 -0
  110. package/src/features/smart-art/diagram-xml.d.ts +63 -0
  111. package/src/features/smart-art/diagram-xml.js +459 -0
  112. package/src/features/smart-art/errors.d.ts +24 -0
  113. package/src/features/smart-art/errors.js +47 -0
  114. package/src/features/smart-art/index.d.ts +26 -0
  115. package/src/features/smart-art/index.js +26 -0
  116. package/src/features/smart-art/minimal-samples.d.ts +18 -0
  117. package/src/features/smart-art/minimal-samples.js +40 -0
  118. package/src/features/smart-art/mutators.d.ts +60 -0
  119. package/src/features/smart-art/mutators.js +566 -0
  120. package/src/features/smart-art/namespaces.d.ts +153 -0
  121. package/src/features/smart-art/namespaces.js +163 -0
  122. package/src/features/smart-art/package-graph.d.ts +61 -0
  123. package/src/features/smart-art/package-graph.js +413 -0
  124. package/src/features/smart-art/parse-colors.d.ts +19 -0
  125. package/src/features/smart-art/parse-colors.js +39 -0
  126. package/src/features/smart-art/parse-data.d.ts +21 -0
  127. package/src/features/smart-art/parse-data.js +121 -0
  128. package/src/features/smart-art/parse-layout.d.ts +20 -0
  129. package/src/features/smart-art/parse-layout.js +40 -0
  130. package/src/features/smart-art/parse-rel-ids.d.ts +71 -0
  131. package/src/features/smart-art/parse-rel-ids.js +233 -0
  132. package/src/features/smart-art/parse-style.d.ts +19 -0
  133. package/src/features/smart-art/parse-style.js +39 -0
  134. package/src/features/smart-art/point-text.d.ts +80 -0
  135. package/src/features/smart-art/point-text.js +424 -0
  136. package/src/features/smart-art/register.d.ts +33 -0
  137. package/src/features/smart-art/register.js +95 -0
  138. package/src/features/smart-art/serialize.d.ts +40 -0
  139. package/src/features/smart-art/serialize.js +48 -0
  140. package/src/features/smart-art/types.d.ts +403 -0
  141. package/src/features/smart-art/types.js +28 -0
  142. package/src/global.js +1 -0
  143. package/src/index.d.ts +21 -0
  144. package/src/index.js +22 -0
  145. package/tsconfig.build.json +13 -0
  146. package/tsconfig.harness.json +32 -0
  147. package/tslint.json +111 -0
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Serializers: diagram models/views → ElementTree (Transitional write).
3
+ * Never invent optional markup beyond model state; emit XSD defaults only
4
+ * when the model holds non-default values or required attributes.
5
+ *
6
+ * Citations: dml-diagram.xsd; ECMA-376 Transitional namespaces.
7
+ */
8
+ var __assign = (this && this.__assign) || function () {
9
+ __assign = Object.assign || function(t) {
10
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
11
+ s = arguments[i];
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13
+ t[p] = s[p];
14
+ }
15
+ return t;
16
+ };
17
+ return __assign.apply(this, arguments);
18
+ };
19
+ import { A_NAMESPACE, DGM_NAMESPACE, DSP_NAMESPACE, } from './constants';
20
+ import { attr, el } from './element-tree';
21
+ import { cloneElement } from './element-tree';
22
+ function pointAttrs(p) {
23
+ var attrs = [attr('modelId', p.modelId)];
24
+ if (p.type !== 'node')
25
+ attrs.push(attr('type', p.type));
26
+ if (p.cxnId !== '0')
27
+ attrs.push(attr('cxnId', p.cxnId));
28
+ return attrs;
29
+ }
30
+ function connectionAttrs(c) {
31
+ var attrs = [
32
+ attr('modelId', c.modelId),
33
+ attr('srcId', c.srcId),
34
+ attr('destId', c.destId),
35
+ attr('srcOrd', String(c.srcOrd)),
36
+ attr('destOrd', String(c.destOrd)),
37
+ ];
38
+ if (c.type !== 'parOf')
39
+ attrs.push(attr('type', c.type));
40
+ if (c.parTransId !== '0')
41
+ attrs.push(attr('parTransId', c.parTransId));
42
+ if (c.sibTransId !== '0')
43
+ attrs.push(attr('sibTransId', c.sibTransId));
44
+ if (c.presId !== '')
45
+ attrs.push(attr('presId', c.presId));
46
+ return attrs;
47
+ }
48
+ function bodyChildren(body) {
49
+ if (!body)
50
+ return [];
51
+ // Synthetic multi-child wrapper from parser.
52
+ if (body.localName === '_body' && body.namespaceUri == null) {
53
+ return body.children.map(function (c) {
54
+ return c.kind === 'text' ? c : cloneElement(c);
55
+ });
56
+ }
57
+ return [cloneElement(body)];
58
+ }
59
+ function serializePoint(p) {
60
+ return el('pt', DGM_NAMESPACE, pointAttrs(p), bodyChildren(p.body), 'dgm');
61
+ }
62
+ function serializeConnection(c) {
63
+ return el('cxn', DGM_NAMESPACE, connectionAttrs(c), bodyChildren(c.body), 'dgm');
64
+ }
65
+ /**
66
+ * Serialize CT_DataModel as `dgm:dataModel` (Transitional NS).
67
+ */
68
+ export function serializeDiagramData(model) {
69
+ var children = [];
70
+ children.push(el('ptLst', DGM_NAMESPACE, [], model.points.map(serializePoint), 'dgm'));
71
+ children.push(el('cxnLst', DGM_NAMESPACE, [], model.connections.map(serializeConnection), 'dgm'));
72
+ if (model.background) {
73
+ var bg = cloneElement(model.background);
74
+ children.push(__assign({}, bg, { namespaceUri: (bg.namespaceUri != null ? bg.namespaceUri : DGM_NAMESPACE), localName: bg.localName || 'bg' }));
75
+ }
76
+ if (model.whole) {
77
+ var w = cloneElement(model.whole);
78
+ children.push(__assign({}, w, { namespaceUri: (w.namespaceUri != null ? w.namespaceUri : DGM_NAMESPACE), localName: w.localName || 'whole' }));
79
+ }
80
+ if (model.extLst) {
81
+ children.push(cloneElement(model.extLst));
82
+ }
83
+ return el('dataModel', DGM_NAMESPACE, [], children, 'dgm');
84
+ }
85
+ export function serializeDiagramLayout(view) {
86
+ var root = cloneElement(view.root);
87
+ // Force Transitional dgm NS on write.
88
+ return __assign({}, root, { namespaceUri: DGM_NAMESPACE, localName: 'layoutDef', prefix: (root.prefix != null ? root.prefix : 'dgm') });
89
+ }
90
+ export function serializeDiagramQuickStyle(view) {
91
+ var root = cloneElement(view.root);
92
+ return __assign({}, root, { namespaceUri: DGM_NAMESPACE, localName: 'styleDef', prefix: (root.prefix != null ? root.prefix : 'dgm') });
93
+ }
94
+ export function serializeDiagramColors(view) {
95
+ var root = cloneElement(view.root);
96
+ return __assign({}, root, { namespaceUri: DGM_NAMESPACE, localName: 'colorsDef', prefix: (root.prefix != null ? root.prefix : 'dgm') });
97
+ }
98
+ export function serializeDiagramDrawing(view) {
99
+ var root = cloneElement(view.root);
100
+ // Prefer dsp NS if root was drawing.
101
+ if (root.localName === 'drawing') {
102
+ return __assign({}, root, { namespaceUri: (root.namespaceUri != null ? root.namespaceUri : DSP_NAMESPACE), prefix: (root.prefix != null ? root.prefix : 'dsp') });
103
+ }
104
+ return root;
105
+ }
106
+ /** Helper: emit a minimal a:extLst shell (for tests / extensions). */
107
+ export function extLst(children) {
108
+ if (children === void 0) { children = []; }
109
+ return el('extLst', A_NAMESPACE, [], children, 'a');
110
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Opaque / structured views for layout, quick style, colors, and MS drawing parts.
3
+ *
4
+ * Layout/style/colors: preserve full element trees for lossless round-trip.
5
+ * Drawing: MS cached drawing ([MS-ODRAWXML]); preserve tree + optional bytes.
6
+ *
7
+ * Citations: dml-diagram.xsd CT_DiagramDefinition, CT_StyleDefinition,
8
+ * CT_ColorTransform; [MS-ODRAWXML] diagramDrawing.
9
+ */
10
+ import { ElementNode } from './element-tree';
11
+ declare const LAYOUT_BRAND: unique symbol;
12
+ declare const STYLE_BRAND: unique symbol;
13
+ declare const COLORS_BRAND: unique symbol;
14
+ declare const DRAWING_BRAND: unique symbol;
15
+ declare abstract class DiagramPartViewBase {
16
+ protected _root: ElementNode;
17
+ protected _dirty: boolean;
18
+ protected _originalBytes: Uint8Array | null;
19
+ constructor(root: ElementNode);
20
+ readonly root: ElementNode;
21
+ /** Replace root tree (marks dirty). */
22
+ setRoot(root: ElementNode): void;
23
+ readonly dirty: boolean;
24
+ markDirty(): void;
25
+ clearDirty(originalBytes?: Uint8Array | null): void;
26
+ readonly originalBytes: Uint8Array | null;
27
+ setOriginalBytes(bytes: Uint8Array | null): void;
28
+ /** Unique name / uniqueId attribute when present on root. */
29
+ readonly uniqueId: string | undefined;
30
+ readonly minVer: string | undefined;
31
+ protected cloneBase(ctor: new (root: ElementNode) => DiagramPartViewBase): DiagramPartViewBase;
32
+ }
33
+ /** CT_DiagramDefinition view (layout part). */
34
+ export declare class DiagramLayout extends DiagramPartViewBase {
35
+ readonly [LAYOUT_BRAND]: true;
36
+ clone(): DiagramLayout;
37
+ }
38
+ /** CT_StyleDefinition view (quick style part). */
39
+ export declare class DiagramQuickStyle extends DiagramPartViewBase {
40
+ readonly [STYLE_BRAND]: true;
41
+ clone(): DiagramQuickStyle;
42
+ }
43
+ /** CT_ColorTransform view (colors part). */
44
+ export declare class DiagramColors extends DiagramPartViewBase {
45
+ readonly [COLORS_BRAND]: true;
46
+ clone(): DiagramColors;
47
+ }
48
+ /**
49
+ * Microsoft diagram drawing (`dsp:drawing`) cached layout art.
50
+ * [MS-ODRAWXML] §2.1.3.
51
+ */
52
+ export declare class DiagramDrawing extends DiagramPartViewBase {
53
+ readonly [DRAWING_BRAND]: true;
54
+ clone(): DiagramDrawing;
55
+ }
56
+ export declare function isDiagramLayout(value: unknown): value is DiagramLayout;
57
+ export declare function isDiagramQuickStyle(value: unknown): value is DiagramQuickStyle;
58
+ export declare function isDiagramColors(value: unknown): value is DiagramColors;
59
+ export declare function isDiagramDrawing(value: unknown): value is DiagramDrawing;
60
+ export {};
@@ -0,0 +1,213 @@
1
+ /**
2
+ * Opaque / structured views for layout, quick style, colors, and MS drawing parts.
3
+ *
4
+ * Layout/style/colors: preserve full element trees for lossless round-trip.
5
+ * Drawing: MS cached drawing ([MS-ODRAWXML]); preserve tree + optional bytes.
6
+ *
7
+ * Citations: dml-diagram.xsd CT_DiagramDefinition, CT_StyleDefinition,
8
+ * CT_ColorTransform; [MS-ODRAWXML] diagramDrawing.
9
+ */
10
+ var __extends = (this && this.__extends) || (function () {
11
+ var extendStatics = function (d, b) {
12
+ extendStatics = Object.setPrototypeOf ||
13
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
14
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
15
+ return extendStatics(d, b);
16
+ };
17
+ return function (d, b) {
18
+ extendStatics(d, b);
19
+ function __() { this.constructor = d; }
20
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21
+ };
22
+ })();
23
+ var __values = (this && this.__values) || function (o) {
24
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
25
+ if (m) return m.call(o);
26
+ return {
27
+ next: function () {
28
+ if (o && i >= o.length) o = void 0;
29
+ return { value: o && o[i++], done: !o };
30
+ }
31
+ };
32
+ };
33
+ var _a, _b, _c, _d;
34
+ import { cloneElement } from './element-tree';
35
+ var LAYOUT_BRAND = Symbol.for('@syncfusion/ej2-office-common.DiagramLayout');
36
+ var STYLE_BRAND = Symbol.for('@syncfusion/ej2-office-common.DiagramQuickStyle');
37
+ var COLORS_BRAND = Symbol.for('@syncfusion/ej2-office-common.DiagramColors');
38
+ var DRAWING_BRAND = Symbol.for('@syncfusion/ej2-office-common.DiagramDrawing');
39
+ var DiagramPartViewBase = /** @class */ (function () {
40
+ function DiagramPartViewBase(root) {
41
+ this._dirty = false;
42
+ this._originalBytes = null;
43
+ this._root = cloneElement(root);
44
+ }
45
+ Object.defineProperty(DiagramPartViewBase.prototype, "root", {
46
+ get: function () {
47
+ return this._root;
48
+ },
49
+ enumerable: true,
50
+ configurable: true
51
+ });
52
+ /** Replace root tree (marks dirty). */
53
+ DiagramPartViewBase.prototype.setRoot = function (root) {
54
+ this._root = cloneElement(root);
55
+ this.markDirty();
56
+ };
57
+ Object.defineProperty(DiagramPartViewBase.prototype, "dirty", {
58
+ get: function () {
59
+ return this._dirty;
60
+ },
61
+ enumerable: true,
62
+ configurable: true
63
+ });
64
+ DiagramPartViewBase.prototype.markDirty = function () {
65
+ this._dirty = true;
66
+ this._originalBytes = null;
67
+ };
68
+ DiagramPartViewBase.prototype.clearDirty = function (originalBytes) {
69
+ this._dirty = false;
70
+ this._originalBytes = (originalBytes != null ? originalBytes : null);
71
+ };
72
+ Object.defineProperty(DiagramPartViewBase.prototype, "originalBytes", {
73
+ get: function () {
74
+ return this._originalBytes;
75
+ },
76
+ enumerable: true,
77
+ configurable: true
78
+ });
79
+ DiagramPartViewBase.prototype.setOriginalBytes = function (bytes) {
80
+ this._originalBytes = bytes;
81
+ };
82
+ Object.defineProperty(DiagramPartViewBase.prototype, "uniqueId", {
83
+ /** Unique name / uniqueId attribute when present on root. */
84
+ get: function () {
85
+ var e_1, _a;
86
+ try {
87
+ for (var _b = __values(this._root.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
88
+ var a = _c.value;
89
+ if (a.name === 'uniqueId')
90
+ return a.value;
91
+ }
92
+ }
93
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
94
+ finally {
95
+ try {
96
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
97
+ }
98
+ finally { if (e_1) throw e_1.error; }
99
+ }
100
+ return undefined;
101
+ },
102
+ enumerable: true,
103
+ configurable: true
104
+ });
105
+ Object.defineProperty(DiagramPartViewBase.prototype, "minVer", {
106
+ get: function () {
107
+ var e_2, _a;
108
+ try {
109
+ for (var _b = __values(this._root.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
110
+ var a = _c.value;
111
+ if (a.name === 'minVer')
112
+ return a.value;
113
+ }
114
+ }
115
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
116
+ finally {
117
+ try {
118
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
119
+ }
120
+ finally { if (e_2) throw e_2.error; }
121
+ }
122
+ return undefined;
123
+ },
124
+ enumerable: true,
125
+ configurable: true
126
+ });
127
+ DiagramPartViewBase.prototype.cloneBase = function (ctor) {
128
+ var v = new ctor(this._root);
129
+ if (this._dirty) {
130
+ v.markDirty();
131
+ }
132
+ else if (this._originalBytes) {
133
+ v.clearDirty(this._originalBytes);
134
+ }
135
+ return v;
136
+ };
137
+ return DiagramPartViewBase;
138
+ }());
139
+ /** CT_DiagramDefinition view (layout part). */
140
+ var DiagramLayout = /** @class */ (function (_super) {
141
+ __extends(DiagramLayout, _super);
142
+ function DiagramLayout() {
143
+ var _this = _super !== null && _super.apply(this, arguments) || this;
144
+ _this[_a] = true;
145
+ return _this;
146
+ }
147
+ DiagramLayout.prototype.clone = function () {
148
+ return this.cloneBase(DiagramLayout);
149
+ };
150
+ return DiagramLayout;
151
+ }(DiagramPartViewBase));
152
+ export { DiagramLayout };
153
+ _a = LAYOUT_BRAND;
154
+ /** CT_StyleDefinition view (quick style part). */
155
+ var DiagramQuickStyle = /** @class */ (function (_super) {
156
+ __extends(DiagramQuickStyle, _super);
157
+ function DiagramQuickStyle() {
158
+ var _this = _super !== null && _super.apply(this, arguments) || this;
159
+ _this[_b] = true;
160
+ return _this;
161
+ }
162
+ DiagramQuickStyle.prototype.clone = function () {
163
+ return this.cloneBase(DiagramQuickStyle);
164
+ };
165
+ return DiagramQuickStyle;
166
+ }(DiagramPartViewBase));
167
+ export { DiagramQuickStyle };
168
+ _b = STYLE_BRAND;
169
+ /** CT_ColorTransform view (colors part). */
170
+ var DiagramColors = /** @class */ (function (_super) {
171
+ __extends(DiagramColors, _super);
172
+ function DiagramColors() {
173
+ var _this = _super !== null && _super.apply(this, arguments) || this;
174
+ _this[_c] = true;
175
+ return _this;
176
+ }
177
+ DiagramColors.prototype.clone = function () {
178
+ return this.cloneBase(DiagramColors);
179
+ };
180
+ return DiagramColors;
181
+ }(DiagramPartViewBase));
182
+ export { DiagramColors };
183
+ _c = COLORS_BRAND;
184
+ /**
185
+ * Microsoft diagram drawing (`dsp:drawing`) cached layout art.
186
+ * [MS-ODRAWXML] §2.1.3.
187
+ */
188
+ var DiagramDrawing = /** @class */ (function (_super) {
189
+ __extends(DiagramDrawing, _super);
190
+ function DiagramDrawing() {
191
+ var _this = _super !== null && _super.apply(this, arguments) || this;
192
+ _this[_d] = true;
193
+ return _this;
194
+ }
195
+ DiagramDrawing.prototype.clone = function () {
196
+ return this.cloneBase(DiagramDrawing);
197
+ };
198
+ return DiagramDrawing;
199
+ }(DiagramPartViewBase));
200
+ export { DiagramDrawing };
201
+ _d = DRAWING_BRAND;
202
+ export function isDiagramLayout(value) {
203
+ return value instanceof DiagramLayout;
204
+ }
205
+ export function isDiagramQuickStyle(value) {
206
+ return value instanceof DiagramQuickStyle;
207
+ }
208
+ export function isDiagramColors(value) {
209
+ return value instanceof DiagramColors;
210
+ }
211
+ export function isDiagramDrawing(value) {
212
+ return value instanceof DiagramDrawing;
213
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Local structural element tree for diagram parsers/serializers.
3
+ *
4
+ * Parsers MUST accept ElementTree only (no raw XML/bytes). A later TASK-9003
5
+ * unification may replace this with a shared core type; the public parse
6
+ * surface stays ElementTree-shaped.
7
+ */
8
+ /** Attribute on an element. Namespace may be null for unnamespaced attrs. */
9
+ export interface ElementAttr {
10
+ readonly name: string;
11
+ readonly value: string;
12
+ readonly namespaceUri?: string | null;
13
+ readonly prefix?: string | null;
14
+ }
15
+ /**
16
+ * Structural element node.
17
+ * `localName` is the unqualified name; `namespaceUri` is the expanded NS.
18
+ */
19
+ export interface ElementNode {
20
+ readonly kind: 'element';
21
+ readonly localName: string;
22
+ readonly namespaceUri: string | null;
23
+ readonly prefix?: string | null;
24
+ readonly attributes: ReadonlyArray<ElementAttr>;
25
+ readonly children: ReadonlyArray<ElementChild>;
26
+ }
27
+ export interface TextNode {
28
+ readonly kind: 'text';
29
+ readonly text: string;
30
+ }
31
+ export declare type ElementChild = ElementNode | TextNode;
32
+ /** Document or fragment root accepted by parsers (single element root preferred). */
33
+ export declare type ElementTree = ElementNode;
34
+ export declare function isElementNode(node: ElementChild | ElementTree): node is ElementNode;
35
+ export declare function isTextNode(node: ElementChild): node is TextNode;
36
+ /** Create an element node. */
37
+ export declare function el(localName: string, namespaceUri: string | null, attributes?: ReadonlyArray<ElementAttr>, children?: ReadonlyArray<ElementChild>, prefix?: string | null): ElementNode;
38
+ /** Create a text node. */
39
+ export declare function text(value: string): TextNode;
40
+ /** Attribute helper. */
41
+ export declare function attr(name: string, value: string, namespaceUri?: string | null, prefix?: string | null): ElementAttr;
42
+ /** Read attribute value by local name (any namespace) — first match. */
43
+ export declare function getAttr(node: ElementNode, localName: string): string | undefined;
44
+ /** Read attribute by local name + namespace URI (null = unnamespaced / any empty). */
45
+ export declare function getAttrNS(node: ElementNode, localName: string, namespaceUri: string | null): string | undefined;
46
+ /** Element children only. */
47
+ export declare function elementChildren(node: ElementNode): ElementNode[];
48
+ /** First element child with localName (+ optional ns predicate). */
49
+ export declare function findChild(node: ElementNode, localName: string, nsPred?: (ns: string | null) => boolean): ElementNode | undefined;
50
+ /** All element children with localName (+ optional ns predicate). */
51
+ export declare function findChildren(node: ElementNode, localName: string, nsPred?: (ns: string | null) => boolean): ElementNode[];
52
+ /** Concatenate descendant text (depth-first). */
53
+ export declare function textContent(node: ElementNode): string;
54
+ /** Deep-clone an element tree (mutable copies). */
55
+ export declare function cloneElement(node: ElementNode): ElementNode;
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Local structural element tree for diagram parsers/serializers.
3
+ *
4
+ * Parsers MUST accept ElementTree only (no raw XML/bytes). A later TASK-9003
5
+ * unification may replace this with a shared core type; the public parse
6
+ * surface stays ElementTree-shaped.
7
+ */
8
+ var __assign = (this && this.__assign) || function () {
9
+ __assign = Object.assign || function(t) {
10
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
11
+ s = arguments[i];
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13
+ t[p] = s[p];
14
+ }
15
+ return t;
16
+ };
17
+ return __assign.apply(this, arguments);
18
+ };
19
+ var __values = (this && this.__values) || function (o) {
20
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
21
+ if (m) return m.call(o);
22
+ return {
23
+ next: function () {
24
+ if (o && i >= o.length) o = void 0;
25
+ return { value: o && o[i++], done: !o };
26
+ }
27
+ };
28
+ };
29
+ export function isElementNode(node) {
30
+ return node.kind === 'element';
31
+ }
32
+ export function isTextNode(node) {
33
+ return node.kind === 'text';
34
+ }
35
+ /** Create an element node. */
36
+ export function el(localName, namespaceUri, attributes, children, prefix) {
37
+ if (attributes === void 0) { attributes = []; }
38
+ if (children === void 0) { children = []; }
39
+ var node = { kind: 'element',
40
+ localName: localName,
41
+ namespaceUri: namespaceUri,
42
+ attributes: attributes,
43
+ children: children,
44
+ };
45
+ if (prefix != null && prefix !== '') {
46
+ return __assign({}, node, { prefix: prefix });
47
+ }
48
+ return node;
49
+ }
50
+ /** Create a text node. */
51
+ export function text(value) {
52
+ return { kind: 'text', text: value };
53
+ }
54
+ /** Attribute helper. */
55
+ export function attr(name, value, namespaceUri, prefix) {
56
+ var a = { name: name, value: value };
57
+ if (namespaceUri !== undefined) {
58
+ return __assign({}, a, { namespaceUri: namespaceUri }, (prefix != null && prefix !== '' ? { prefix: prefix } : {}));
59
+ }
60
+ return a;
61
+ }
62
+ /** Read attribute value by local name (any namespace) — first match. */
63
+ export function getAttr(node, localName) {
64
+ var e_1, _a;
65
+ try {
66
+ for (var _b = __values(node.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
67
+ var a = _c.value;
68
+ if (a.name === localName)
69
+ return a.value;
70
+ }
71
+ }
72
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
73
+ finally {
74
+ try {
75
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
76
+ }
77
+ finally { if (e_1) throw e_1.error; }
78
+ }
79
+ return undefined;
80
+ }
81
+ /** Read attribute by local name + namespace URI (null = unnamespaced / any empty). */
82
+ export function getAttrNS(node, localName, namespaceUri) {
83
+ var e_2, _a;
84
+ try {
85
+ for (var _b = __values(node.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
86
+ var a = _c.value;
87
+ var ans = (a.namespaceUri != null ? a.namespaceUri : null);
88
+ if (a.name === localName && ans === namespaceUri)
89
+ return a.value;
90
+ }
91
+ }
92
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
93
+ finally {
94
+ try {
95
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
96
+ }
97
+ finally { if (e_2) throw e_2.error; }
98
+ }
99
+ return undefined;
100
+ }
101
+ /** Element children only. */
102
+ export function elementChildren(node) {
103
+ var e_3, _a;
104
+ var out = [];
105
+ try {
106
+ for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
107
+ var c = _c.value;
108
+ if (c.kind === 'element')
109
+ out.push(c);
110
+ }
111
+ }
112
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
113
+ finally {
114
+ try {
115
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
116
+ }
117
+ finally { if (e_3) throw e_3.error; }
118
+ }
119
+ return out;
120
+ }
121
+ /** First element child with localName (+ optional ns predicate). */
122
+ export function findChild(node, localName, nsPred) {
123
+ var e_4, _a;
124
+ try {
125
+ for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
126
+ var c = _c.value;
127
+ if (c.kind !== 'element')
128
+ continue;
129
+ if (c.localName !== localName)
130
+ continue;
131
+ if (nsPred && !nsPred(c.namespaceUri))
132
+ continue;
133
+ return c;
134
+ }
135
+ }
136
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
137
+ finally {
138
+ try {
139
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
140
+ }
141
+ finally { if (e_4) throw e_4.error; }
142
+ }
143
+ return undefined;
144
+ }
145
+ /** All element children with localName (+ optional ns predicate). */
146
+ export function findChildren(node, localName, nsPred) {
147
+ var e_5, _a;
148
+ var out = [];
149
+ try {
150
+ for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
151
+ var c = _c.value;
152
+ if (c.kind !== 'element')
153
+ continue;
154
+ if (c.localName !== localName)
155
+ continue;
156
+ if (nsPred && !nsPred(c.namespaceUri))
157
+ continue;
158
+ out.push(c);
159
+ }
160
+ }
161
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
162
+ finally {
163
+ try {
164
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
165
+ }
166
+ finally { if (e_5) throw e_5.error; }
167
+ }
168
+ return out;
169
+ }
170
+ /** Concatenate descendant text (depth-first). */
171
+ export function textContent(node) {
172
+ var e_6, _a;
173
+ var s = '';
174
+ try {
175
+ for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
176
+ var c = _c.value;
177
+ if (c.kind === 'text')
178
+ s += c.text;
179
+ else
180
+ s += textContent(c);
181
+ }
182
+ }
183
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
184
+ finally {
185
+ try {
186
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
187
+ }
188
+ finally { if (e_6) throw e_6.error; }
189
+ }
190
+ return s;
191
+ }
192
+ /** Deep-clone an element tree (mutable copies). */
193
+ export function cloneElement(node) {
194
+ return __assign({ kind: 'element', localName: node.localName, namespaceUri: node.namespaceUri }, (node.prefix != null ? { prefix: node.prefix } : {}), { attributes: node.attributes.map(function (a) { return (__assign({}, a)); }), children: node.children.map(function (c) {
195
+ return c.kind === 'text' ? { kind: 'text', text: c.text } : cloneElement(c);
196
+ }) });
197
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Typed errors for diagram parse / model / catalog operations.
3
+ * Load of recoverable diagram damage MUST NOT throw at package level;
4
+ * parsers of a single part MAY throw DiagramParseError for that part.
5
+ */
6
+ export declare type DiagramErrorCode = 'invalid_root' | 'missing_required' | 'invalid_attribute' | 'limit_exceeded' | 'unknown_point' | 'inconsistent_graph' | 'invalid_rel_ids' | 'not_diagram' | 'catalog_error';
7
+ export declare class DiagramError extends Error {
8
+ readonly code: DiagramErrorCode;
9
+ constructor(code: DiagramErrorCode, message: string);
10
+ }
11
+ export declare class DiagramParseError extends DiagramError {
12
+ constructor(code: DiagramErrorCode, message: string);
13
+ }
14
+ export declare class DiagramModelError extends DiagramError {
15
+ constructor(code: DiagramErrorCode, message: string);
16
+ }
17
+ export declare function isDiagramError(value: unknown): value is DiagramError;