abstract-image 11.0.14 → 11.0.16
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.
- package/lib/abstract-image-xml/abstract-image-xml.d.ts +6 -0
- package/lib/abstract-image-xml/abstract-image-xml.d.ts.map +1 -0
- package/lib/abstract-image-xml/abstract-image-xml.js +149 -0
- package/lib/abstract-image-xml/abstract-image-xml.js.map +1 -0
- package/lib/abstract-image-xml/abstract-image-xsd.d.ts +2 -0
- package/lib/abstract-image-xml/abstract-image-xsd.d.ts.map +1 -0
- package/lib/abstract-image-xml/abstract-image-xsd.js +188 -0
- package/lib/abstract-image-xml/abstract-image-xsd.js.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/helpers.d.ts +2 -0
- package/lib/abstract-image-xml/handlebars-xml/helpers.d.ts.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/helpers.js +54 -0
- package/lib/abstract-image-xml/handlebars-xml/helpers.js.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/index.d.ts +3 -0
- package/lib/abstract-image-xml/handlebars-xml/index.d.ts.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/index.js +19 -0
- package/lib/abstract-image-xml/handlebars-xml/index.js.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/parse-handlebars-xml.d.ts +14 -0
- package/lib/abstract-image-xml/handlebars-xml/parse-handlebars-xml.d.ts.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/parse-handlebars-xml.js +127 -0
- package/lib/abstract-image-xml/handlebars-xml/parse-handlebars-xml.js.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/validate-handlebars-xml.d.ts +21 -0
- package/lib/abstract-image-xml/handlebars-xml/validate-handlebars-xml.d.ts.map +1 -0
- package/lib/abstract-image-xml/handlebars-xml/validate-handlebars-xml.js +195 -0
- package/lib/abstract-image-xml/handlebars-xml/validate-handlebars-xml.js.map +1 -0
- package/lib/abstract-image-xml/index.d.ts +3 -0
- package/lib/abstract-image-xml/index.d.ts.map +1 -0
- package/lib/abstract-image-xml/index.js +19 -0
- package/lib/abstract-image-xml/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/model/color.d.ts +1 -0
- package/lib/model/color.d.ts.map +1 -1
- package/lib/model/color.js +23 -0
- package/lib/model/color.js.map +1 -1
- package/package.json +4 -3
- package/src/abstract-image-xml/abstract-image-xml.ts +170 -0
- package/src/abstract-image-xml/abstract-image-xsd.ts +184 -0
- package/src/abstract-image-xml/abstract-image-xsd.xml +183 -0
- package/src/abstract-image-xml/handlebars-xml/helpers.ts +59 -0
- package/src/abstract-image-xml/handlebars-xml/index.ts +2 -0
- package/src/abstract-image-xml/handlebars-xml/parse-handlebars-xml.ts +137 -0
- package/src/abstract-image-xml/handlebars-xml/validate-handlebars-xml.ts +272 -0
- package/src/abstract-image-xml/index.ts +2 -0
- package/src/index.ts +1 -0
- package/src/model/color.ts +28 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractImage } from "../model/abstract-image.js";
|
|
2
|
+
import { XmlElement } from "./handlebars-xml/index.js";
|
|
3
|
+
export declare const abstractImageXml: (template: string, data: any) => AbstractImage;
|
|
4
|
+
export declare function abstractImageOfXml(el: XmlElement): unknown;
|
|
5
|
+
export declare const parsedXsd: readonly XmlElement[];
|
|
6
|
+
//# sourceMappingURL=abstract-image-xml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-image-xml.d.ts","sourceRoot":"","sources":["../../src/abstract-image-xml/abstract-image-xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAkB3D,OAAO,EAAgC,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAErF,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,EAAE,MAAM,GAAG,KAAG,aACc,CAAC;AAE9E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CA6H1D;AAED,eAAO,MAAM,SAAS,uBAAgB,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parsedXsd = exports.abstractImageXml = void 0;
|
|
4
|
+
exports.abstractImageOfXml = abstractImageOfXml;
|
|
5
|
+
const color_js_1 = require("../model/color.js");
|
|
6
|
+
const abstract_image_xsd_js_1 = require("./abstract-image-xsd.js");
|
|
7
|
+
const index_js_1 = require("./handlebars-xml/index.js");
|
|
8
|
+
const abstractImageXml = (template, data) => abstractImageOfXml((0, index_js_1.parseHandlebarsXml)(template, data)[0]);
|
|
9
|
+
exports.abstractImageXml = abstractImageXml;
|
|
10
|
+
function abstractImageOfXml(el) {
|
|
11
|
+
const children = Array();
|
|
12
|
+
const childElements = Array();
|
|
13
|
+
for (const child of el.children ?? []) {
|
|
14
|
+
if (child.tagName !== undefined) {
|
|
15
|
+
children.push(abstractImageOfXml(child));
|
|
16
|
+
childElements.push(child);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
switch (el.tagName) {
|
|
20
|
+
case "AbstractImage":
|
|
21
|
+
const size = parsePoint(el.attributes.size);
|
|
22
|
+
return {
|
|
23
|
+
topLeft: parsePoint(el.attributes.topLeft),
|
|
24
|
+
size: { width: size.x, height: size.y },
|
|
25
|
+
backgroundColor: (0, color_js_1.fromString2)(el.attributes.backgroundColor ?? "", color_js_1.transparent),
|
|
26
|
+
components: children,
|
|
27
|
+
};
|
|
28
|
+
case "Group":
|
|
29
|
+
return {
|
|
30
|
+
type: "group",
|
|
31
|
+
name: el.attributes.name ?? "",
|
|
32
|
+
children: children,
|
|
33
|
+
};
|
|
34
|
+
case "Image":
|
|
35
|
+
return {
|
|
36
|
+
type: "binaryimage",
|
|
37
|
+
topLeft: parsePoint(el.attributes.topLeft),
|
|
38
|
+
bottomRight: parsePoint(el.attributes.bottomRight),
|
|
39
|
+
data: { type: "url", url: el.attributes.url },
|
|
40
|
+
id: el.attributes.id,
|
|
41
|
+
format: "png",
|
|
42
|
+
};
|
|
43
|
+
case "Ellipse":
|
|
44
|
+
return {
|
|
45
|
+
type: "ellipse",
|
|
46
|
+
topLeft: parsePoint(el.attributes.topLeft),
|
|
47
|
+
bottomRight: parsePoint(el.attributes.bottomRight),
|
|
48
|
+
fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
|
|
49
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
|
|
50
|
+
id: el.attributes.id,
|
|
51
|
+
strokeDashStyle: {
|
|
52
|
+
dashes: parseNumberArrayString(el.attributes.strokeDashArray),
|
|
53
|
+
offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
|
|
54
|
+
},
|
|
55
|
+
strokeThickness: Number(el.attributes.strokeThickness ?? 1),
|
|
56
|
+
};
|
|
57
|
+
case "Line":
|
|
58
|
+
return {
|
|
59
|
+
type: "line",
|
|
60
|
+
start: parsePoint(el.attributes.start),
|
|
61
|
+
end: parsePoint(el.attributes.end),
|
|
62
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
|
|
63
|
+
id: el.attributes.id,
|
|
64
|
+
strokeDashStyle: {
|
|
65
|
+
dashes: parseNumberArrayString(el.attributes.strokeDashArray),
|
|
66
|
+
offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
|
|
67
|
+
},
|
|
68
|
+
strokeThickness: Number(el.attributes.strokeThickness ?? 1),
|
|
69
|
+
};
|
|
70
|
+
case "PolyLine":
|
|
71
|
+
return {
|
|
72
|
+
type: "polyline",
|
|
73
|
+
points: parsePointsString(el.attributes.points),
|
|
74
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
|
|
75
|
+
id: el.attributes.id,
|
|
76
|
+
strokeDashStyle: {
|
|
77
|
+
dashes: parseNumberArrayString(el.attributes.strokeDashArray),
|
|
78
|
+
offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
|
|
79
|
+
},
|
|
80
|
+
strokeThickness: Number(el.attributes.strokeThickness ?? 1),
|
|
81
|
+
};
|
|
82
|
+
case "Polygon":
|
|
83
|
+
return {
|
|
84
|
+
type: "polygon",
|
|
85
|
+
points: parsePointsString(el.attributes.points),
|
|
86
|
+
fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
|
|
87
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
|
|
88
|
+
id: el.attributes.id,
|
|
89
|
+
strokeDashStyle: {
|
|
90
|
+
dashes: parseNumberArrayString(el.attributes.strokeDashArray),
|
|
91
|
+
offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
|
|
92
|
+
},
|
|
93
|
+
strokeThickness: Number(el.attributes.strokeThickness ?? 1),
|
|
94
|
+
};
|
|
95
|
+
case "Rectangle":
|
|
96
|
+
return {
|
|
97
|
+
type: "rectangle",
|
|
98
|
+
topLeft: parsePoint(el.attributes.topLeft),
|
|
99
|
+
bottomRight: parsePoint(el.attributes.bottomRight),
|
|
100
|
+
fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
|
|
101
|
+
radius: el.attributes.radius ? parsePoint(el.attributes.radius) : undefined,
|
|
102
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
|
|
103
|
+
id: el.attributes.id,
|
|
104
|
+
strokeDashStyle: {
|
|
105
|
+
dashes: parseNumberArrayString(el.attributes.strokeDashArray),
|
|
106
|
+
offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
|
|
107
|
+
},
|
|
108
|
+
strokeThickness: Number(el.attributes.strokeThickness ?? 1),
|
|
109
|
+
};
|
|
110
|
+
case "Text":
|
|
111
|
+
return {
|
|
112
|
+
type: "text",
|
|
113
|
+
position: parsePoint(el.attributes.position),
|
|
114
|
+
clockwiseRotationDegrees: el.attributes.clockwiseRotationDegrees
|
|
115
|
+
? Number(el.attributes.clockwiseRotationDegrees)
|
|
116
|
+
: 0,
|
|
117
|
+
textColor: (0, color_js_1.fromString2)(el.attributes.textColor ?? "", color_js_1.black),
|
|
118
|
+
strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.transparent),
|
|
119
|
+
text: el.attributes.text?.toString() ?? "",
|
|
120
|
+
id: el.attributes.id,
|
|
121
|
+
fontFamily: el.attributes.fontFamily ?? "",
|
|
122
|
+
fontSize: el.attributes.fontSize ? Number(el.attributes.fontSize ?? 1) : 12,
|
|
123
|
+
strokeThickness: el.attributes.strokeThickness ? Number(el.attributes.strokeThickness) : 2,
|
|
124
|
+
textAlignment: el.attributes.textAlignment ?? "center",
|
|
125
|
+
verticalGrowthDirection: el.attributes.verticalGrowthDirection ?? "down",
|
|
126
|
+
fontWeight: el.attributes.fontWeight ?? "normal",
|
|
127
|
+
horizontalGrowthDirection: el.attributes.horizontalGrowthDirection ?? "right",
|
|
128
|
+
italic: Boolean(el.attributes.italic ?? false),
|
|
129
|
+
};
|
|
130
|
+
default:
|
|
131
|
+
throw new Error(`Could not find creator for element with name ${el.tagName}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.parsedXsd = (0, index_js_1.parseXsd)(abstract_image_xsd_js_1.xsd);
|
|
135
|
+
function parsePoint(pointString) {
|
|
136
|
+
const [xString, yString] = pointString?.split(" ") ?? [0, 0];
|
|
137
|
+
const [x, y] = [Number(xString ?? 0), Number(yString ?? 0)];
|
|
138
|
+
return { x: Number.isFinite(x) ? x : 0, y: Number.isFinite(y) ? y : 0 };
|
|
139
|
+
}
|
|
140
|
+
function parsePointsString(numberArrayString) {
|
|
141
|
+
return (numberArrayString?.split(" ").map((tuple) => {
|
|
142
|
+
const [xString, yString] = tuple.split(",");
|
|
143
|
+
return { x: Number(xString ?? 0), y: Number(yString ?? 0) };
|
|
144
|
+
}) ?? []);
|
|
145
|
+
}
|
|
146
|
+
function parseNumberArrayString(numberArrayString) {
|
|
147
|
+
return numberArrayString?.split(",").map(Number) ?? [];
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=abstract-image-xml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-image-xml.js","sourceRoot":"","sources":["../../src/abstract-image-xml/abstract-image-xml.ts"],"names":[],"mappings":";;;AAuBA,gDA6HC;AAnJD,gDAA2E;AAgB3E,mEAA8C;AAC9C,wDAAqF;AAE9E,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,IAAS,EAAiB,EAAE,CAC7E,kBAAkB,CAAC,IAAA,6BAAkB,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAE,CAAkB,CAAC;AADjE,QAAA,gBAAgB,oBACiD;AAE9E,SAAgB,kBAAkB,CAAC,EAAc;IAC/C,MAAM,QAAQ,GAAG,KAAK,EAAa,CAAC;IACpC,MAAM,aAAa,GAAG,KAAK,EAAc,CAAC;IAC1C,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAc,CAAC,CAAC;YACtD,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC;QACnB,KAAK,eAAe;YAClB,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO;gBACL,OAAO,EAAE,UAAU,CAAC,EAAE,CAA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CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED,SAAS,iBAAiB,CAAC,iBAAqC;IAC9D,OAAO,CACL,iBAAiB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAS,EAAE;QACjD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC,CAAC,IAAI,EAAE,CACT,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,iBAAqC;IACnE,OAAO,iBAAiB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const xsd = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n targetNamespace=\"urn:adml\"\n xmlns=\"urn:adml\"\n elementFormDefault=\"qualified\"\n attributeFormDefault=\"unqualified\">\n\n <!-- ========= Root ========= -->\n <xs:element name=\"abstractImage\" type=\"AbstractImage\"/>\n\n <xs:group name=\"Component\">\n <xs:choice>\n <xs:element name=\"image\" type=\"Image\"/>\n <xs:element name=\"ellipse\" type=\"Ellipse\"/>\n <xs:element name=\"line\" type=\"Line\"/>\n <xs:element name=\"polyline\" type=\"PolyLine\"/>\n <xs:element name=\"polygon\" type=\"Polygon\"/>\n <xs:element name=\"rectangle\" type=\"Rectangle\"/>\n <xs:element name=\"text\" type=\"Text\"/>\n <xs:element name=\"group\" type=\"Group\"/>\n </xs:choice>\n </xs:group>\n\n <xs:complexType name=\"AbstractImage\">\n <xs:sequence>\n <xs:element name=\"components\">\n <xs:complexType>\n <xs:sequence>\n <xs:group ref=\"Component\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n </xs:sequence>\n </xs:complexType>\n </xs:element>\n </xs:sequence>\n <xs:attribute name=\"topLeft\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"size\" type=\"SizeString\" use=\"required\"/>\n <xs:attribute name=\"backgroundColor\" type=\"ColorString\" use=\"optional\"/>\n </xs:complexType>\n\n <xs:simpleType name=\"PointString\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n <xs:simpleType name=\"SizeString\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n <xs:simpleType name=\"ColorString\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n <xs:simpleType name=\"PointsString\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n <xs:simpleType name=\"DashArray\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n <xs:simpleType name=\"DashOffset\"><xs:restriction base=\"xs:string\"/></xs:simpleType>\n\n <!-- ========= Components ========= -->\n\n <!-- Group -->\n <xs:complexType name=\"Group\">\n <xs:sequence>\n <xs:element name=\"children\">\n <xs:complexType>\n <xs:sequence>\n <xs:group ref=\"Component\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n </xs:sequence>\n </xs:complexType>\n </xs:element>\n </xs:sequence>\n <xs:attribute name=\"name\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Image -->\n <xs:complexType name=\"Image\">\n <xs:attribute name=\"url\" type=\"xs:anyURI\" use=\"required\"/>\n <xs:attribute name=\"topLeft\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"bottomRight\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Ellipse -->\n <xs:complexType name=\"Ellipse\">\n <xs:attribute name=\"topLeft\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"bottomRight\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeDashArray\" type=\"DashArray\" use=\"optional\"/> \n <xs:attribute name=\"strokeDashOffset\" type=\"DashOffset\" use=\"optional\"/>\n <xs:attribute name=\"fillColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Line -->\n <xs:complexType name=\"Line\">\n <xs:attribute name=\"start\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"end\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeDashArray\" type=\"DashArray\" use=\"optional\"/> \n <xs:attribute name=\"strokeDashOffset\" type=\"DashOffset\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- PolyLine -->\n <xs:complexType name=\"PolyLine\">\n <xs:attribute name=\"points\" type=\"PointsString\" use=\"required\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeDashArray\" type=\"DashArray\" use=\"optional\"/> \n <xs:attribute name=\"strokeDashOffset\" type=\"DashOffset\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Polygon -->\n <xs:complexType name=\"Polygon\">\n <xs:attribute name=\"points\" type=\"PointsString\" use=\"required\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeDashArray\" type=\"DashArray\" use=\"optional\"/> \n <xs:attribute name=\"strokeDashOffset\" type=\"DashOffset\" use=\"optional\"/>\n <xs:attribute name=\"fillColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Rectangle -->\n <xs:complexType name=\"Rectangle\">\n <xs:attribute name=\"topLeft\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"bottomRight\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeDashArray\" type=\"DashArray\" use=\"optional\"/> \n <xs:attribute name=\"strokeDashOffset\" type=\"DashOffset\" use=\"optional\"/>\n <xs:attribute name=\"fillColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n <xs:attribute name=\"radius\" type=\"PointString\" use=\"optional\"/>\n </xs:complexType>\n\n <!-- Text -->\n <xs:complexType name=\"Text\">\n <xs:attribute name=\"position\" type=\"PointString\" use=\"required\"/>\n <xs:attribute name=\"text\" type=\"xs:string\" use=\"required\"/>\n <xs:attribute name=\"fontFamily\" type=\"xs:string\" use=\"optional\"/>\n <xs:attribute name=\"fontSize\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"textColor\" type=\"ColorString\" use=\"optional\"/>\n\t<xs:attribute name=\"fontWeight\" use=\"optional\">\n\t\t<xs:simpleType>\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:enumeration value=\"light\"/>\n\t\t\t<xs:enumeration value=\"normal\"/>\n\t\t\t<xs:enumeration value=\"mediumBold\"/>\n\t\t\t<xs:enumeration value=\"bold\"/>\n\t\t\t<xs:enumeration value=\"extraBold\"/>\n\t\t</xs:restriction>\n\t\t</xs:simpleType>\n\t</xs:attribute>\n\t<xs:attribute name=\"clockwiseRotationDegrees\" type=\"xs:double\" use=\"optional\"/>\n\t<xs:attribute name=\"textAlignment\" use=\"optional\">\n\t\t<xs:simpleType>\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:enumeration value=\"left\"/>\n\t\t\t<xs:enumeration value=\"center\"/>\n\t\t\t<xs:enumeration value=\"right\"/>\n\t\t</xs:restriction>\n\t\t</xs:simpleType>\n\t</xs:attribute>\n\t<xs:attribute name=\"horizontalGrowthDirection\" use=\"optional\">\n\t\t<xs:simpleType>\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:enumeration value=\"up\"/>\n\t\t\t<xs:enumeration value=\"down\"/>\n\t\t\t<xs:enumeration value=\"uniform\"/>\n\t\t\t<xs:enumeration value=\"left\"/>\n\t\t\t<xs:enumeration value=\"right\"/>\n\t\t</xs:restriction>\n\t\t</xs:simpleType>\n\t</xs:attribute>\n\t<xs:attribute name=\"verticalGrowthDirection\" use=\"optional\">\n\t\t<xs:simpleType>\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:enumeration value=\"up\"/>\n\t\t\t<xs:enumeration value=\"down\"/>\n\t\t\t<xs:enumeration value=\"uniform\"/>\n\t\t\t<xs:enumeration value=\"left\"/>\n\t\t\t<xs:enumeration value=\"right\"/>\n\t\t</xs:restriction>\n\t\t</xs:simpleType>\n\t</xs:attribute>\n <xs:attribute name=\"strokeThickness\" type=\"xs:double\" use=\"optional\"/>\n <xs:attribute name=\"strokeColor\" type=\"ColorString\" use=\"optional\"/>\n <xs:attribute name=\"italic\" type=\"xs:boolean\" use=\"optional\"/>\n <xs:attribute name=\"id\" type=\"xs:string\" use=\"optional\"/>\n </xs:complexType>\n\n</xs:schema>\n";
|
|
2
|
+
//# sourceMappingURL=abstract-image-xsd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-image-xsd.d.ts","sourceRoot":"","sources":["../../src/abstract-image-xml/abstract-image-xsd.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,w2QAuLf,CAAA"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.xsd = void 0;
|
|
4
|
+
exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
|
5
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
6
|
+
targetNamespace="urn:adml"
|
|
7
|
+
xmlns="urn:adml"
|
|
8
|
+
elementFormDefault="qualified"
|
|
9
|
+
attributeFormDefault="unqualified">
|
|
10
|
+
|
|
11
|
+
<!-- ========= Root ========= -->
|
|
12
|
+
<xs:element name="abstractImage" type="AbstractImage"/>
|
|
13
|
+
|
|
14
|
+
<xs:group name="Component">
|
|
15
|
+
<xs:choice>
|
|
16
|
+
<xs:element name="image" type="Image"/>
|
|
17
|
+
<xs:element name="ellipse" type="Ellipse"/>
|
|
18
|
+
<xs:element name="line" type="Line"/>
|
|
19
|
+
<xs:element name="polyline" type="PolyLine"/>
|
|
20
|
+
<xs:element name="polygon" type="Polygon"/>
|
|
21
|
+
<xs:element name="rectangle" type="Rectangle"/>
|
|
22
|
+
<xs:element name="text" type="Text"/>
|
|
23
|
+
<xs:element name="group" type="Group"/>
|
|
24
|
+
</xs:choice>
|
|
25
|
+
</xs:group>
|
|
26
|
+
|
|
27
|
+
<xs:complexType name="AbstractImage">
|
|
28
|
+
<xs:sequence>
|
|
29
|
+
<xs:element name="components">
|
|
30
|
+
<xs:complexType>
|
|
31
|
+
<xs:sequence>
|
|
32
|
+
<xs:group ref="Component" minOccurs="0" maxOccurs="unbounded"/>
|
|
33
|
+
</xs:sequence>
|
|
34
|
+
</xs:complexType>
|
|
35
|
+
</xs:element>
|
|
36
|
+
</xs:sequence>
|
|
37
|
+
<xs:attribute name="topLeft" type="PointString" use="required"/>
|
|
38
|
+
<xs:attribute name="size" type="SizeString" use="required"/>
|
|
39
|
+
<xs:attribute name="backgroundColor" type="ColorString" use="optional"/>
|
|
40
|
+
</xs:complexType>
|
|
41
|
+
|
|
42
|
+
<xs:simpleType name="PointString"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
43
|
+
<xs:simpleType name="SizeString"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
44
|
+
<xs:simpleType name="ColorString"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
45
|
+
<xs:simpleType name="PointsString"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
46
|
+
<xs:simpleType name="DashArray"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
47
|
+
<xs:simpleType name="DashOffset"><xs:restriction base="xs:string"/></xs:simpleType>
|
|
48
|
+
|
|
49
|
+
<!-- ========= Components ========= -->
|
|
50
|
+
|
|
51
|
+
<!-- Group -->
|
|
52
|
+
<xs:complexType name="Group">
|
|
53
|
+
<xs:sequence>
|
|
54
|
+
<xs:element name="children">
|
|
55
|
+
<xs:complexType>
|
|
56
|
+
<xs:sequence>
|
|
57
|
+
<xs:group ref="Component" minOccurs="0" maxOccurs="unbounded"/>
|
|
58
|
+
</xs:sequence>
|
|
59
|
+
</xs:complexType>
|
|
60
|
+
</xs:element>
|
|
61
|
+
</xs:sequence>
|
|
62
|
+
<xs:attribute name="name" type="xs:string" use="optional"/>
|
|
63
|
+
</xs:complexType>
|
|
64
|
+
|
|
65
|
+
<!-- Image -->
|
|
66
|
+
<xs:complexType name="Image">
|
|
67
|
+
<xs:attribute name="url" type="xs:anyURI" use="required"/>
|
|
68
|
+
<xs:attribute name="topLeft" type="PointString" use="required"/>
|
|
69
|
+
<xs:attribute name="bottomRight" type="PointString" use="required"/>
|
|
70
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
71
|
+
</xs:complexType>
|
|
72
|
+
|
|
73
|
+
<!-- Ellipse -->
|
|
74
|
+
<xs:complexType name="Ellipse">
|
|
75
|
+
<xs:attribute name="topLeft" type="PointString" use="required"/>
|
|
76
|
+
<xs:attribute name="bottomRight" type="PointString" use="required"/>
|
|
77
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
78
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
79
|
+
<xs:attribute name="strokeDashArray" type="DashArray" use="optional"/>
|
|
80
|
+
<xs:attribute name="strokeDashOffset" type="DashOffset" use="optional"/>
|
|
81
|
+
<xs:attribute name="fillColor" type="ColorString" use="optional"/>
|
|
82
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
83
|
+
</xs:complexType>
|
|
84
|
+
|
|
85
|
+
<!-- Line -->
|
|
86
|
+
<xs:complexType name="Line">
|
|
87
|
+
<xs:attribute name="start" type="PointString" use="required"/>
|
|
88
|
+
<xs:attribute name="end" type="PointString" use="required"/>
|
|
89
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
90
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
91
|
+
<xs:attribute name="strokeDashArray" type="DashArray" use="optional"/>
|
|
92
|
+
<xs:attribute name="strokeDashOffset" type="DashOffset" use="optional"/>
|
|
93
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
94
|
+
</xs:complexType>
|
|
95
|
+
|
|
96
|
+
<!-- PolyLine -->
|
|
97
|
+
<xs:complexType name="PolyLine">
|
|
98
|
+
<xs:attribute name="points" type="PointsString" use="required"/>
|
|
99
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
100
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
101
|
+
<xs:attribute name="strokeDashArray" type="DashArray" use="optional"/>
|
|
102
|
+
<xs:attribute name="strokeDashOffset" type="DashOffset" use="optional"/>
|
|
103
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
104
|
+
</xs:complexType>
|
|
105
|
+
|
|
106
|
+
<!-- Polygon -->
|
|
107
|
+
<xs:complexType name="Polygon">
|
|
108
|
+
<xs:attribute name="points" type="PointsString" use="required"/>
|
|
109
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
110
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
111
|
+
<xs:attribute name="strokeDashArray" type="DashArray" use="optional"/>
|
|
112
|
+
<xs:attribute name="strokeDashOffset" type="DashOffset" use="optional"/>
|
|
113
|
+
<xs:attribute name="fillColor" type="ColorString" use="optional"/>
|
|
114
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
115
|
+
</xs:complexType>
|
|
116
|
+
|
|
117
|
+
<!-- Rectangle -->
|
|
118
|
+
<xs:complexType name="Rectangle">
|
|
119
|
+
<xs:attribute name="topLeft" type="PointString" use="required"/>
|
|
120
|
+
<xs:attribute name="bottomRight" type="PointString" use="required"/>
|
|
121
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
122
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
123
|
+
<xs:attribute name="strokeDashArray" type="DashArray" use="optional"/>
|
|
124
|
+
<xs:attribute name="strokeDashOffset" type="DashOffset" use="optional"/>
|
|
125
|
+
<xs:attribute name="fillColor" type="ColorString" use="optional"/>
|
|
126
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
127
|
+
<xs:attribute name="radius" type="PointString" use="optional"/>
|
|
128
|
+
</xs:complexType>
|
|
129
|
+
|
|
130
|
+
<!-- Text -->
|
|
131
|
+
<xs:complexType name="Text">
|
|
132
|
+
<xs:attribute name="position" type="PointString" use="required"/>
|
|
133
|
+
<xs:attribute name="text" type="xs:string" use="required"/>
|
|
134
|
+
<xs:attribute name="fontFamily" type="xs:string" use="optional"/>
|
|
135
|
+
<xs:attribute name="fontSize" type="xs:double" use="optional"/>
|
|
136
|
+
<xs:attribute name="textColor" type="ColorString" use="optional"/>
|
|
137
|
+
<xs:attribute name="fontWeight" use="optional">
|
|
138
|
+
<xs:simpleType>
|
|
139
|
+
<xs:restriction base="xs:string">
|
|
140
|
+
<xs:enumeration value="light"/>
|
|
141
|
+
<xs:enumeration value="normal"/>
|
|
142
|
+
<xs:enumeration value="mediumBold"/>
|
|
143
|
+
<xs:enumeration value="bold"/>
|
|
144
|
+
<xs:enumeration value="extraBold"/>
|
|
145
|
+
</xs:restriction>
|
|
146
|
+
</xs:simpleType>
|
|
147
|
+
</xs:attribute>
|
|
148
|
+
<xs:attribute name="clockwiseRotationDegrees" type="xs:double" use="optional"/>
|
|
149
|
+
<xs:attribute name="textAlignment" use="optional">
|
|
150
|
+
<xs:simpleType>
|
|
151
|
+
<xs:restriction base="xs:string">
|
|
152
|
+
<xs:enumeration value="left"/>
|
|
153
|
+
<xs:enumeration value="center"/>
|
|
154
|
+
<xs:enumeration value="right"/>
|
|
155
|
+
</xs:restriction>
|
|
156
|
+
</xs:simpleType>
|
|
157
|
+
</xs:attribute>
|
|
158
|
+
<xs:attribute name="horizontalGrowthDirection" use="optional">
|
|
159
|
+
<xs:simpleType>
|
|
160
|
+
<xs:restriction base="xs:string">
|
|
161
|
+
<xs:enumeration value="up"/>
|
|
162
|
+
<xs:enumeration value="down"/>
|
|
163
|
+
<xs:enumeration value="uniform"/>
|
|
164
|
+
<xs:enumeration value="left"/>
|
|
165
|
+
<xs:enumeration value="right"/>
|
|
166
|
+
</xs:restriction>
|
|
167
|
+
</xs:simpleType>
|
|
168
|
+
</xs:attribute>
|
|
169
|
+
<xs:attribute name="verticalGrowthDirection" use="optional">
|
|
170
|
+
<xs:simpleType>
|
|
171
|
+
<xs:restriction base="xs:string">
|
|
172
|
+
<xs:enumeration value="up"/>
|
|
173
|
+
<xs:enumeration value="down"/>
|
|
174
|
+
<xs:enumeration value="uniform"/>
|
|
175
|
+
<xs:enumeration value="left"/>
|
|
176
|
+
<xs:enumeration value="right"/>
|
|
177
|
+
</xs:restriction>
|
|
178
|
+
</xs:simpleType>
|
|
179
|
+
</xs:attribute>
|
|
180
|
+
<xs:attribute name="strokeThickness" type="xs:double" use="optional"/>
|
|
181
|
+
<xs:attribute name="strokeColor" type="ColorString" use="optional"/>
|
|
182
|
+
<xs:attribute name="italic" type="xs:boolean" use="optional"/>
|
|
183
|
+
<xs:attribute name="id" type="xs:string" use="optional"/>
|
|
184
|
+
</xs:complexType>
|
|
185
|
+
|
|
186
|
+
</xs:schema>
|
|
187
|
+
`;
|
|
188
|
+
//# sourceMappingURL=abstract-image-xsd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-image-xsd.js","sourceRoot":"","sources":["../../src/abstract-image-xml/abstract-image-xsd.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuLlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/abstract-image-xml/handlebars-xml/helpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,IAAI,IAAI,CAOtC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerHelpers = registerHelpers;
|
|
7
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
8
|
+
function registerHelpers() {
|
|
9
|
+
sortOnPathHelper();
|
|
10
|
+
equalHelper();
|
|
11
|
+
lessThanHelper();
|
|
12
|
+
greaterThanHelper();
|
|
13
|
+
lessThanOrEqualHelper();
|
|
14
|
+
greaterThanEqualHelper();
|
|
15
|
+
}
|
|
16
|
+
function sortOnPathHelper() {
|
|
17
|
+
handlebars_1.default.registerHelper("sortOnPath", function (array, key) {
|
|
18
|
+
const path = key.split(".");
|
|
19
|
+
const extractPath = (obj, path) => {
|
|
20
|
+
const [first, ...rest] = path;
|
|
21
|
+
if (first === undefined) {
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
return extractPath(obj[first], rest);
|
|
25
|
+
};
|
|
26
|
+
return array.toSorted((a, b) => extractPath(a, path) - extractPath(b, path));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function equalHelper() {
|
|
30
|
+
handlebars_1.default.registerHelper("equal", function (a, b) {
|
|
31
|
+
return a === b;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function lessThanHelper() {
|
|
35
|
+
handlebars_1.default.registerHelper("lessThan", function (a, b) {
|
|
36
|
+
return a < b;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function greaterThanHelper() {
|
|
40
|
+
handlebars_1.default.registerHelper("greaterThan", function (a, b) {
|
|
41
|
+
return a > b;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function lessThanOrEqualHelper() {
|
|
45
|
+
handlebars_1.default.registerHelper("lessThanEqual", function (a, b) {
|
|
46
|
+
return a <= b;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function greaterThanEqualHelper() {
|
|
50
|
+
handlebars_1.default.registerHelper("greaterThanEqual", function (a, b) {
|
|
51
|
+
return a >= b;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/abstract-image-xml/handlebars-xml/helpers.ts"],"names":[],"mappings":";;;;;AAEA,0CAOC;AATD,4DAAoC;AAEpC,SAAgB,eAAe;IAC7B,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC;IACd,cAAc,EAAE,CAAC;IACjB,iBAAiB,EAAE,CAAC;IACpB,qBAAqB,EAAE,CAAC;IACxB,sBAAsB,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,gBAAgB;IACvB,oBAAU,CAAC,cAAc,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,GAAG;QAC1D,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,WAAW,GAAG,CAAC,GAAwB,EAAE,IAA2B,EAAO,EAAE;YACjF,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;YAC9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,GAAG,CAAC;YACb,CAAC;YACD,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,OAAO,KAAK,CAAC,QAAQ,CACnB,CAAC,CAAsB,EAAE,CAAsB,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAChG,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW;IAClB,oBAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;QAC/C,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc;IACrB,oBAAU,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB;IACxB,oBAAU,CAAC,cAAc,CAAC,aAAa,EAAE,UAAU,CAAC,EAAE,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB;IAC5B,oBAAU,CAAC,cAAc,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sBAAsB;IAC7B,oBAAU,CAAC,cAAc,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAAE,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abstract-image-xml/handlebars-xml/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./validate-handlebars-xml.js"), exports);
|
|
18
|
+
__exportStar(require("./parse-handlebars-xml.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstract-image-xml/handlebars-xml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,4DAA0C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { X2jOptions } from "fast-xml-parser";
|
|
2
|
+
export type XmlElement = {
|
|
3
|
+
readonly tagName: string;
|
|
4
|
+
readonly attributes: Record<string, string>;
|
|
5
|
+
readonly children: ReadonlyArray<XmlElement>;
|
|
6
|
+
readonly textContent?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const parseHandlebarsXml: (template: string, data: any) => ReadonlyArray<XmlElement>;
|
|
9
|
+
export declare function parseXmlCustom(text: string, options: Partial<X2jOptions>): ReadonlyArray<XmlElement>;
|
|
10
|
+
export declare const parseXml: (text: string) => ReadonlyArray<XmlElement>;
|
|
11
|
+
export declare const parseXsd: (text: string) => ReadonlyArray<XmlElement>;
|
|
12
|
+
export declare function findElement(elements: ReadonlyArray<XmlElement>, elementName: string | undefined): XmlElement | undefined;
|
|
13
|
+
export declare function getChildren(elements: ReadonlyArray<XmlElement>): ReadonlyArray<XmlElement>;
|
|
14
|
+
//# sourceMappingURL=parse-handlebars-xml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-handlebars-xml.d.ts","sourceRoot":"","sources":["../../../src/abstract-image-xml/handlebars-xml/parse-handlebars-xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAC;AAIxD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,EAAE,MAAM,GAAG,KAAG,aAAa,CAAC,UAAU,CAGxF,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAKpG;AACD,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,aAAa,CAAC,UAAU,CAAwC,CAAC;AACzG,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,aAAa,CAAC,UAAU,CACP,CAAC;AAgC1D,wBAAgB,WAAW,CACzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EACnC,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,UAAU,GAAG,SAAS,CAqBxB;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAc1F"}
|