abstract-image 13.0.30 → 13.0.31

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 (32) hide show
  1. package/lib/abstract-image-xml/abstract-image-xml.d.ts +29 -0
  2. package/lib/abstract-image-xml/abstract-image-xml.d.ts.map +1 -0
  3. package/lib/abstract-image-xml/abstract-image-xml.js +186 -0
  4. package/lib/abstract-image-xml/abstract-image-xml.js.map +1 -0
  5. package/lib/abstract-image-xml/abstract-image-xsd.d.ts +2 -0
  6. package/lib/abstract-image-xml/abstract-image-xsd.d.ts.map +1 -0
  7. package/lib/abstract-image-xml/abstract-image-xsd.js +188 -0
  8. package/lib/abstract-image-xml/abstract-image-xsd.js.map +1 -0
  9. package/lib/abstract-image-xml/index.d.ts +2 -0
  10. package/lib/abstract-image-xml/index.d.ts.map +1 -0
  11. package/lib/abstract-image-xml/index.js +18 -0
  12. package/lib/abstract-image-xml/index.js.map +1 -0
  13. package/lib/dynamic-image/dynamic-image-xsd.d.ts +2 -0
  14. package/lib/dynamic-image/dynamic-image-xsd.d.ts.map +1 -0
  15. package/lib/dynamic-image/dynamic-image-xsd.js +188 -0
  16. package/lib/dynamic-image/dynamic-image-xsd.js.map +1 -0
  17. package/lib/dynamic-image/dynamic-image.d.ts +7 -4
  18. package/lib/dynamic-image/dynamic-image.d.ts.map +1 -1
  19. package/lib/dynamic-image/dynamic-image.js +31 -10
  20. package/lib/dynamic-image/dynamic-image.js.map +1 -1
  21. package/lib/dynamic-image/schema.d.ts +0 -1
  22. package/lib/dynamic-image/schema.d.ts.map +1 -1
  23. package/lib/dynamic-image/schema.js +0 -1
  24. package/lib/dynamic-image/schema.js.map +1 -1
  25. package/lib/stringify-parse.d.ts +6 -0
  26. package/lib/stringify-parse.d.ts.map +1 -0
  27. package/lib/stringify-parse.js +91 -0
  28. package/lib/stringify-parse.js.map +1 -0
  29. package/package.json +3 -3
  30. package/src/dynamic-image/dynamic-image.ts +42 -19
  31. package/src/dynamic-image/schema.ts +1 -2
  32. package/LICENSE +0 -21
@@ -0,0 +1,29 @@
1
+ import { AbstractImage } from "../model/abstract-image.js";
2
+ import { XmlElement } from "handlebars-xml";
3
+ type Result<TError, TValue> = Ok<TValue> | Err<TError>;
4
+ type Ok<TValue> = {
5
+ readonly type: "Ok";
6
+ readonly value: TValue;
7
+ };
8
+ type Err<TError> = {
9
+ readonly type: "Err";
10
+ readonly error: TError;
11
+ };
12
+ export type AbstractImageXmlError = {
13
+ type: "HANDLEBARS_PARSE_ERROR";
14
+ message: string;
15
+ cause?: unknown;
16
+ } | {
17
+ type: "XML_PARSE_ERROR";
18
+ message: string;
19
+ cause?: unknown;
20
+ } | {
21
+ type: "UNKNOWN_ERROR";
22
+ message: string;
23
+ cause?: unknown;
24
+ };
25
+ export declare function abstractImageXml(template: string, data: unknown): Result<AbstractImageXmlError, AbstractImage>;
26
+ export declare function abstractImageOfXml(el: XmlElement): unknown;
27
+ export declare const parsedXsd: readonly XmlElement[];
28
+ export {};
29
+ //# 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;AAC3D,OAAO,EAAgC,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAmB1E,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACvD,KAAK,EAAE,CAAC,MAAM,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAClE,KAAK,GAAG,CAAC,MAAM,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,wBAAwB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACpE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAMhE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC,CA2B9G;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CA6H1D;AAED,eAAO,MAAM,SAAS,uBAAgB,CAAC"}
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parsedXsd = void 0;
4
+ exports.abstractImageXml = abstractImageXml;
5
+ exports.abstractImageOfXml = abstractImageOfXml;
6
+ const handlebars_xml_1 = require("handlebars-xml");
7
+ const color_js_1 = require("../model/color.js");
8
+ const abstract_image_xsd_js_1 = require("./abstract-image-xsd.js");
9
+ function errorMessage(error) {
10
+ return error instanceof Error ? error.message : String(error);
11
+ }
12
+ function abstractImageXml(template, data) {
13
+ try {
14
+ const [parsedXml] = (0, handlebars_xml_1.parseHandlebarsXml)(template, data, {});
15
+ try {
16
+ const abstractImage = abstractImageOfXml(parsedXml);
17
+ return { type: "Ok", value: abstractImage };
18
+ }
19
+ catch (error) {
20
+ return {
21
+ type: "Err",
22
+ error: {
23
+ type: "XML_PARSE_ERROR",
24
+ message: errorMessage(error),
25
+ cause: error,
26
+ },
27
+ };
28
+ }
29
+ }
30
+ catch (error) {
31
+ return {
32
+ type: "Err",
33
+ error: {
34
+ type: "HANDLEBARS_PARSE_ERROR",
35
+ message: errorMessage(error),
36
+ cause: error,
37
+ },
38
+ };
39
+ }
40
+ }
41
+ function abstractImageOfXml(el) {
42
+ const children = Array();
43
+ const childElements = Array();
44
+ for (const child of el.children ?? []) {
45
+ if (child.tagName !== undefined) {
46
+ children.push(abstractImageOfXml(child));
47
+ childElements.push(child);
48
+ }
49
+ }
50
+ switch (el.tagName) {
51
+ case "AbstractImage":
52
+ const size = parsePoint(el.attributes.size);
53
+ return {
54
+ topLeft: parsePoint(el.attributes.topLeft),
55
+ size: { width: size.x, height: size.y },
56
+ backgroundColor: (0, color_js_1.fromString2)(el.attributes.backgroundColor ?? "", color_js_1.transparent),
57
+ components: children,
58
+ };
59
+ case "Group":
60
+ return {
61
+ type: "group",
62
+ name: el.attributes.name ?? "",
63
+ children: children,
64
+ };
65
+ case "Image":
66
+ return {
67
+ type: "binaryimage",
68
+ topLeft: parsePoint(el.attributes.topLeft),
69
+ bottomRight: parsePoint(el.attributes.bottomRight),
70
+ data: { type: "url", url: el.attributes.url },
71
+ id: el.attributes.id,
72
+ format: "png",
73
+ };
74
+ case "Ellipse":
75
+ return {
76
+ type: "ellipse",
77
+ topLeft: parsePoint(el.attributes.topLeft),
78
+ bottomRight: parsePoint(el.attributes.bottomRight),
79
+ fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
80
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
81
+ id: el.attributes.id,
82
+ strokeDashStyle: {
83
+ dashes: parseNumberArrayString(el.attributes.strokeDashArray),
84
+ offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
85
+ },
86
+ strokeThickness: Number(el.attributes.strokeThickness ?? 1),
87
+ };
88
+ case "Line":
89
+ return {
90
+ type: "line",
91
+ start: parsePoint(el.attributes.start),
92
+ end: parsePoint(el.attributes.end),
93
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
94
+ id: el.attributes.id,
95
+ strokeDashStyle: {
96
+ dashes: parseNumberArrayString(el.attributes.strokeDashArray),
97
+ offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
98
+ },
99
+ strokeThickness: Number(el.attributes.strokeThickness ?? 1),
100
+ };
101
+ case "PolyLine":
102
+ return {
103
+ type: "polyline",
104
+ points: parsePointsString(el.attributes.points),
105
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
106
+ id: el.attributes.id,
107
+ strokeDashStyle: {
108
+ dashes: parseNumberArrayString(el.attributes.strokeDashArray),
109
+ offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
110
+ },
111
+ strokeThickness: Number(el.attributes.strokeThickness ?? 1),
112
+ };
113
+ case "Polygon":
114
+ return {
115
+ type: "polygon",
116
+ points: parsePointsString(el.attributes.points),
117
+ fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
118
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
119
+ id: el.attributes.id,
120
+ strokeDashStyle: {
121
+ dashes: parseNumberArrayString(el.attributes.strokeDashArray),
122
+ offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
123
+ },
124
+ strokeThickness: Number(el.attributes.strokeThickness ?? 1),
125
+ };
126
+ case "Rectangle":
127
+ return {
128
+ type: "rectangle",
129
+ topLeft: parsePoint(el.attributes.topLeft),
130
+ bottomRight: parsePoint(el.attributes.bottomRight),
131
+ fillColor: (0, color_js_1.fromString2)(el.attributes.fillColor ?? "", color_js_1.white),
132
+ radius: el.attributes.radius ? parsePoint(el.attributes.radius) : undefined,
133
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.black),
134
+ id: el.attributes.id,
135
+ strokeDashStyle: {
136
+ dashes: parseNumberArrayString(el.attributes.strokeDashArray),
137
+ offset: el.attributes.strokeDashOffset ? Number(el.attributes.strokeDashOffset) : 0,
138
+ },
139
+ strokeThickness: Number(el.attributes.strokeThickness ?? 1),
140
+ };
141
+ case "Text":
142
+ return {
143
+ type: "text",
144
+ position: parsePoint(el.attributes.position),
145
+ clockwiseRotationDegrees: el.attributes.clockwiseRotationDegrees
146
+ ? Number(el.attributes.clockwiseRotationDegrees)
147
+ : 0,
148
+ textColor: (0, color_js_1.fromString2)(el.attributes.textColor ?? "", color_js_1.black),
149
+ strokeColor: (0, color_js_1.fromString2)(el.attributes.strokeColor ?? "", color_js_1.transparent),
150
+ text: el.attributes.text?.toString() ?? "",
151
+ id: el.attributes.id,
152
+ fontFamily: el.attributes.fontFamily ?? "",
153
+ fontSize: el.attributes.fontSize ? Number(el.attributes.fontSize ?? 1) : 12,
154
+ strokeThickness: el.attributes.strokeThickness ? Number(el.attributes.strokeThickness) : 2,
155
+ textAlignment: el.attributes.textAlignment ?? "center",
156
+ verticalGrowthDirection: el.attributes.verticalGrowthDirection ?? "down",
157
+ fontWeight: el.attributes.fontWeight ?? "normal",
158
+ horizontalGrowthDirection: el.attributes.horizontalGrowthDirection ?? "right",
159
+ italic: Boolean(el.attributes.italic ?? false),
160
+ };
161
+ default:
162
+ throw new Error(`Could not find creator for element with name ${el.tagName}`);
163
+ }
164
+ }
165
+ exports.parsedXsd = (0, handlebars_xml_1.parseXsd)(abstract_image_xsd_js_1.xsd);
166
+ function parsePoint(pointString) {
167
+ const [xString, yString] = (typeof pointString === "number" ? pointString.toString() : pointString)?.split(" ") ?? [
168
+ 0, 0,
169
+ ];
170
+ const [x, y] = [Number(xString ?? 0), Number(yString ?? 0)];
171
+ return { x: Number.isFinite(x) ? x : 0, y: Number.isFinite(y) ? y : 0 };
172
+ }
173
+ function parsePointsString(numberArrayString) {
174
+ return ((typeof numberArrayString === "number" ? numberArrayString.toString() : numberArrayString)
175
+ ?.split(" ")
176
+ .map((tuple) => {
177
+ const [xString, yString] = tuple.split(",");
178
+ return { x: Number(xString ?? 0), y: Number(yString ?? 0) };
179
+ }) ?? []);
180
+ }
181
+ function parseNumberArrayString(numberArrayString) {
182
+ return ((typeof numberArrayString === "number" ? numberArrayString.toString() : numberArrayString)
183
+ ?.split(",")
184
+ .map(Number) ?? []);
185
+ }
186
+ //# 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":";;;AAiCA,4CA2BC;AAED,gDA6HC;AA1LD,mDAA0E;AAC1E,gDAA2E;AAgB3E,mEAA8C;AAW9C,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAgB,gBAAgB,CAAC,QAAgB,EAAE,IAAa;IAC9D,IAAI,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,GAAG,IAAA,mCAAkB,EAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,SAAS,CAAkB,CAAC;YACrE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE;oBACL,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;oBAC5B,KAAK,EAAE,KAAK;iBACb;aACF,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,KAAK;YACX,KAAK,EAAE;gBACL,IAAI,EAAE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AiB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACxF,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,CAAC,KAAK,EAAS,EAAE;QACpB,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,CACX,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,iBAA8C;IAC5E,OAAO,CACL,CAAC,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACxF,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CACrB,CAAC;AACJ,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,2 @@
1
+ export * from "./abstract-image-xml.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abstract-image-xml/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,18 @@
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("./abstract-image-xml.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abstract-image-xml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -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=dynamic-image-xsd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-image-xsd.d.ts","sourceRoot":"","sources":["../../src/dynamic-image/dynamic-image-xsd.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,w2QAuLf,CAAC"}
@@ -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=dynamic-image-xsd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-image-xsd.js","sourceRoot":"","sources":["../../src/dynamic-image/dynamic-image-xsd.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuLlB,CAAC"}
@@ -1,6 +1,5 @@
1
- import { PropertySchema } from "jsxpression";
2
- import { AbstractImage } from "../model/abstract-image.js";
3
- import { FunctionSchema } from "../../../jsxpression/src/schema.js";
1
+ import { type FunctionSchema, type PropertySchema } from "jsxpression";
2
+ import type { AbstractImage } from "../model/abstract-image.js";
4
3
  export type DynamicImageResult = {
5
4
  readonly type: "Ok";
6
5
  readonly image: AbstractImage;
@@ -12,6 +11,10 @@ export type DynamicImageResult = {
12
11
  export type DynamicImageError = {
13
12
  type: "RENDER_ERROR";
14
13
  message: string;
14
+ issues?: ReadonlyArray<{
15
+ code: string;
16
+ message: string;
17
+ }>;
15
18
  cause?: unknown;
16
19
  };
17
20
  export declare function dynamicImage(source: string, data: Record<string, unknown>, dataSchema?: Record<string, PropertySchema>, functions?: Record<string, Function>, funcSchema?: Record<string, FunctionSchema>): DynamicImageResult;
@@ -22,6 +25,6 @@ export type CompileDynamicImageResult = {
22
25
  readonly type: "Err";
23
26
  readonly error: DynamicImageError;
24
27
  };
25
- export declare function compileDynamicImage(source: string, dataSchema?: Record<string, PropertySchema>, functionSchema?: Record<string, FunctionSchema>, tempSkipValidation?: boolean | undefined): CompileDynamicImageResult;
28
+ export declare function compileDynamicImage(source: string, dataSchema?: Record<string, PropertySchema>, functionSchema?: Record<string, FunctionSchema>): CompileDynamicImageResult;
26
29
  export declare function renderDynamicImage(jsString: string, data: Record<string, unknown>, functions?: Record<string, Function>): DynamicImageResult;
27
30
  //# sourceMappingURL=dynamic-image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-image.d.ts","sourceRoot":"","sources":["../../src/dynamic-image/dynamic-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,cAAc,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,C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AC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEhE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EAC3C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAC9C,yBAAyB,CAoB3B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GACnC,kBAAkB,CAsBpB"}
@@ -1,9 +1,11 @@
1
- import { render, compile, evaluate } from "jsxpression";
1
+ import { AnalysisError, evaluate, compile, render } from "jsxpression";
2
2
  import { createComponents } from "./components.js";
3
3
  import { baseSchema } from "./schema.js";
4
- export function dynamicImage(source, data, dataSchema, functions, funcSchema) {
4
+ export function dynamicImage(source, data, dataSchema,
5
+ // biome-ignore lint/complexity/noBannedTypes: It's needed.
6
+ functions, funcSchema) {
5
7
  try {
6
- const imageUrls = Array();
8
+ const imageUrls = [];
7
9
  const schema = dataSchema ? { ...baseSchema, data: dataSchema, functions: funcSchema } : baseSchema;
8
10
  const image = render(source, schema, {
9
11
  data,
@@ -15,37 +17,56 @@ export function dynamicImage(source, data, dataSchema, functions, funcSchema) {
15
17
  catch (error) {
16
18
  return {
17
19
  type: "Err",
18
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
20
+ error: {
21
+ type: "RENDER_ERROR",
22
+ message: error instanceof Error ? error.message : String(error),
23
+ cause: error,
24
+ },
19
25
  };
20
26
  }
21
27
  }
22
- export function compileDynamicImage(source, dataSchema, functionSchema, tempSkipValidation) {
28
+ export function compileDynamicImage(source, dataSchema, functionSchema) {
23
29
  try {
24
30
  return {
25
31
  type: "Ok",
26
- value: compile(source, dataSchema ? { ...baseSchema, data: dataSchema, functions: functionSchema } : baseSchema, undefined, tempSkipValidation),
32
+ value: compile(source, dataSchema ? { ...baseSchema, data: dataSchema, functions: functionSchema } : baseSchema),
27
33
  };
28
34
  }
29
35
  catch (error) {
30
36
  return {
31
37
  type: "Err",
32
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
38
+ error: {
39
+ type: "RENDER_ERROR",
40
+ message: error instanceof Error ? error.message : String(error),
41
+ issues: error instanceof AnalysisError
42
+ ? error.report.issues.map((i) => ({ code: i.code, message: i.message }))
43
+ : undefined,
44
+ cause: error,
45
+ },
33
46
  };
34
47
  }
35
48
  }
36
49
  export function renderDynamicImage(jsString, data, functions) {
37
- const imageUrls = Array();
50
+ const imageUrls = [];
38
51
  try {
39
52
  return {
40
53
  type: "Ok",
41
- image: evaluate(jsString, baseSchema, { data, functions, components: createComponents(imageUrls) }),
54
+ image: evaluate(jsString, baseSchema, {
55
+ data,
56
+ functions,
57
+ components: createComponents(imageUrls),
58
+ }),
42
59
  imageUrls,
43
60
  };
44
61
  }
45
62
  catch (error) {
46
63
  return {
47
64
  type: "Err",
48
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
65
+ error: {
66
+ type: "RENDER_ERROR",
67
+ message: error instanceof Error ? error.message : String(error),
68
+ cause: error,
69
+ },
49
70
  };
50
71
  }
51
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-image.js","sourceRoot":"","sources":["../../src/dynamic-image/dynamic-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,OAAO,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,MAAM,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AC/D,MAAM,EACJ,KAAK,YAAY,aAAa;oBAC5B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;oBACxE,CAAC,CAAC,SAAS;gBACf,KAAK,EAAE,KAAK;aACb;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,IAA6B,EAC7B,SAAoC;IAEpC,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,IAAI,CAAC;QACH,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE;gBACpC,IAAI;gBACJ,SAAS;gBACT,UAAU,EAAE,gBAAgB,CAAC,SAAS,CAAC;aACxC,CAAkB;YACnB,SAAS;SACV,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,KAAK;YACX,KAAK,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC/D,KAAK,EAAE,KAAK;aACb;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -229,7 +229,6 @@ export declare const baseSchema: {
229
229
  readonly description: "Fill color (text color).";
230
230
  };
231
231
  };
232
- readonly allowedChildren: [];
233
232
  };
234
233
  };
235
234
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/dynamic-image/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkPI,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/dynamic-image/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiPI,CAAC"}
@@ -229,7 +229,6 @@ export const baseSchema = {
229
229
  description: "Fill color (text color).",
230
230
  },
231
231
  },
232
- allowedChildren: [],
233
232
  },
234
233
  },
235
234
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/dynamic-image/schema.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,WAAW,EAAE,sEAAsE;YACnF,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,0CAA0C;iBACxD;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,2CAA2C;iBACzD;aACF;YACD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,E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Q,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,sBAAsB;iBACpC;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kCAAkC;iBAChD;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO;oBACf,WAAW,EAAE,0BAA0B;iBACxC;aACF;SACF;KACF;CACwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { AbstractImage } from "./model/abstract-image";
2
+ export declare function stringifyBase64(abstractImage: AbstractImage): string;
3
+ export declare function encodeBase64(abstractImage: AbstractImage): AbstractImage;
4
+ export declare function parseBase64(stringifiedImage: string): AbstractImage;
5
+ export declare function decodeBase64(safeAbstractImage: AbstractImage): AbstractImage;
6
+ //# sourceMappingURL=stringify-parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify-parse.d.ts","sourceRoot":"","sources":["../src/stringify-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAGpE;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAExE;AAED,wBAAgB,WAAW,CAAC,gBAAgB,EAAE,MAAM,GAAG,aAAa,CAGnE;AAED,wBAAgB,YAAY,CAAC,iBAAiB,EAAE,aAAa,GAAG,aAAa,CAE5E"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringifyBase64 = stringifyBase64;
4
+ exports.encodeBase64 = encodeBase64;
5
+ exports.parseBase64 = parseBase64;
6
+ exports.decodeBase64 = decodeBase64;
7
+ function stringifyBase64(abstractImage) {
8
+ const safe = { ...abstractImage, components: abstractImage.components.map(componentToJsonSafe) };
9
+ return JSON.stringify(safe);
10
+ }
11
+ function encodeBase64(abstractImage) {
12
+ return { ...abstractImage, components: abstractImage.components.map(componentToJsonSafe) };
13
+ }
14
+ function parseBase64(stringifiedImage) {
15
+ const obj = JSON.parse(stringifiedImage);
16
+ return { ...obj, components: (obj.components ?? []).map(componentFromJsonSafe) };
17
+ }
18
+ function decodeBase64(safeAbstractImage) {
19
+ return { ...safeAbstractImage, components: (safeAbstractImage.components ?? []).map(componentFromJsonSafe) };
20
+ }
21
+ function componentToJsonSafe(c) {
22
+ switch (c.type) {
23
+ case "binaryimage": {
24
+ const bi = c;
25
+ if (bi.data.type === "bytes") {
26
+ return { ...bi, data: { type: "bytes", bytes: toBase64(bi.data.bytes) } };
27
+ }
28
+ return bi;
29
+ }
30
+ case "group":
31
+ return { ...c, children: c.children.map(componentToJsonSafe) };
32
+ case "subimage":
33
+ return { ...c, image: componentToJsonSafe(c.image) };
34
+ default:
35
+ return c;
36
+ }
37
+ }
38
+ function componentFromJsonSafe(c) {
39
+ if (c?.type === "binaryimage") {
40
+ if (c.data?.type === "bytes") {
41
+ if (typeof c.data.bytes === "string") {
42
+ return { ...c, data: { type: "bytes", bytes: fromBase64(c.data.bytes) } };
43
+ }
44
+ // legacy fallback, will remove
45
+ if (c.data.bytes?.data) {
46
+ return {
47
+ ...c,
48
+ data: { ...c.data, bytes: new Uint8Array(c.data.bytes.data) },
49
+ };
50
+ }
51
+ if (!Array.isArray(c.data?.bytes)) {
52
+ return { ...c, data: { ...c.data, bytes: new Uint8Array(Object.values(c.data.bytes)) } }; // Somtimes Uint8Array is an object instead of an array
53
+ }
54
+ return { ...c, data: { ...c.data, bytes: new Uint8Array(c.data.bytes) } };
55
+ }
56
+ return c;
57
+ }
58
+ if (c?.type === "group") {
59
+ return { ...c, children: Array.isArray(c.children) ? c.children.map(componentFromJsonSafe) : [] };
60
+ }
61
+ if (c?.type === "subimage") {
62
+ return { ...c, image: componentFromJsonSafe(c.image) };
63
+ }
64
+ return c;
65
+ }
66
+ function toBase64(u8) {
67
+ // Node
68
+ if (typeof Buffer !== "undefined") {
69
+ return Buffer.from(u8).toString("base64");
70
+ }
71
+ // Browser
72
+ let bin = "";
73
+ for (const e of u8) {
74
+ bin += String.fromCharCode(e);
75
+ }
76
+ return btoa(bin);
77
+ }
78
+ function fromBase64(b64) {
79
+ // Node
80
+ if (typeof Buffer !== "undefined") {
81
+ return new Uint8Array(Buffer.from(b64, "base64"));
82
+ }
83
+ // Browser
84
+ const bin = atob(b64);
85
+ const out = new Uint8Array(bin.length);
86
+ for (let i = 0; i < bin.length; i++) {
87
+ out[i] = bin.charCodeAt(i);
88
+ }
89
+ return out;
90
+ }
91
+ //# sourceMappingURL=stringify-parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify-parse.js","sourceRoot":"","sources":["../src/stringify-parse.ts"],"names":[],"mappings":";;AAGA,0CAGC;AAED,oCAEC;AAED,kCAGC;AAED,oCAEC;AAhBD,SAAgB,eAAe,CAAC,aAA4B;IAC1D,MAAM,IAAI,GAAG,EAAE,GAAG,aAAa,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACjG,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,YAAY,CAAC,aAA4B;IACvD,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;AAC7F,CAAC;AAED,SAAgB,WAAW,CAAC,gBAAwB;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACzC,OAAO,EAAE,GAAG,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAmB,CAAC;AACpG,CAAC;AAED,SAAgB,YAAY,CAAC,iBAAgC;IAC3D,OAAO,EAAE,GAAG,iBAAi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,EAAc,CAAC;IACrE,CAAC;IACD,OAAO,CAAc,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,EAAc;IAC9B,OAAO;IACP,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,UAAU;IACV,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACnB,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO;IACP,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,UAAU;IACV,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abstract-image",
3
- "version": "13.0.30",
3
+ "version": "13.0.31",
4
4
  "description": "Dynamically create images using code or JSX and render to any format",
5
5
  "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-image",
6
6
  "main": "lib/index.js",
@@ -27,7 +27,7 @@
27
27
  "handlebars": "4.7.8",
28
28
  "handlebars-xml": "^0.4.3",
29
29
  "iconv-lite": "^0.7.2",
30
- "jsxpression": "^0.1.28"
30
+ "jsxpression": "^0.1.29"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=17.0.0 <20.0.0"
@@ -39,5 +39,5 @@
39
39
  "vite": "^6.0.1",
40
40
  "vitest": "^2.1.6"
41
41
  },
42
- "gitHead": "a4ef3ebc986e3dfd4e67fe2014e5c261ae18d6fb"
42
+ "gitHead": "17921b59da5eee6cc446fd37a2134165af4d1901"
43
43
  }
@@ -1,16 +1,20 @@
1
- import { render, Schema, compile, evaluate, PropertySchema } from "jsxpression";
2
- import { AbstractImage } from "../model/abstract-image.js";
1
+ import { AnalysisError, evaluate, compile, render, type FunctionSchema, type PropertySchema, type Schema } from "jsxpression";
2
+ import type { AbstractImage } from "../model/abstract-image.js";
3
3
  import { createComponents } from "./components.js";
4
4
  import { baseSchema } from "./schema.js";
5
- import { FunctionSchema } from "../../../jsxpression/src/schema.js";
6
5
 
7
6
  export type DynamicImageResult =
8
- | { readonly type: "Ok"; readonly image: AbstractImage; readonly imageUrls: ReadonlyArray<string> }
7
+ | {
8
+ readonly type: "Ok";
9
+ readonly image: AbstractImage;
10
+ readonly imageUrls: ReadonlyArray<string>;
11
+ }
9
12
  | { readonly type: "Err"; readonly error: DynamicImageError };
10
13
 
11
14
  export type DynamicImageError = {
12
15
  type: "RENDER_ERROR";
13
16
  message: string;
17
+ issues?: ReadonlyArray<{ code: string; message: string }>;
14
18
  cause?: unknown;
15
19
  };
16
20
 
@@ -18,11 +22,12 @@ export function dynamicImage(
18
22
  source: string,
19
23
  data: Record<string, unknown>,
20
24
  dataSchema?: Record<string, PropertySchema>,
25
+ // biome-ignore lint/complexity/noBannedTypes: It's needed.
21
26
  functions?: Record<string, Function>,
22
27
  funcSchema?: Record<string, FunctionSchema>
23
28
  ): DynamicImageResult {
24
29
  try {
25
- const imageUrls = Array<string>();
30
+ const imageUrls: string[] = [];
26
31
  const schema: Schema = dataSchema ? { ...baseSchema, data: dataSchema, functions: funcSchema } : baseSchema;
27
32
 
28
33
  const image = render<AbstractImage>(source, schema, {
@@ -35,7 +40,11 @@ export function dynamicImage(
35
40
  } catch (error) {
36
41
  return {
37
42
  type: "Err",
38
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
43
+ error: {
44
+ type: "RENDER_ERROR",
45
+ message: error instanceof Error ? error.message : String(error),
46
+ cause: error,
47
+ },
39
48
  };
40
49
  }
41
50
  }
@@ -47,39 +56,53 @@ export type CompileDynamicImageResult =
47
56
  export function compileDynamicImage(
48
57
  source: string,
49
58
  dataSchema?: Record<string, PropertySchema>,
50
- functionSchema?: Record<string, FunctionSchema>,
51
- tempSkipValidation?: boolean | undefined
59
+ functionSchema?: Record<string, FunctionSchema>
52
60
  ): CompileDynamicImageResult {
53
61
  try {
54
62
  return {
55
63
  type: "Ok",
56
- value: compile(
57
- source,
58
- dataSchema ? { ...baseSchema, data: dataSchema, functions: functionSchema } : baseSchema,
59
- undefined,
60
- tempSkipValidation
61
- ),
64
+ value: compile(source, dataSchema ? { ...baseSchema, data: dataSchema, functions: functionSchema } : baseSchema),
62
65
  };
63
66
  } catch (error) {
64
67
  return {
65
68
  type: "Err",
66
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
69
+ error: {
70
+ type: "RENDER_ERROR",
71
+ message: error instanceof Error ? error.message : String(error),
72
+ issues:
73
+ error instanceof AnalysisError
74
+ ? error.report.issues.map((i) => ({ code: i.code, message: i.message }))
75
+ : undefined,
76
+ cause: error,
77
+ },
67
78
  };
68
79
  }
69
80
  }
70
81
 
71
- export function renderDynamicImage(jsString: string, data: Record<string, unknown>, functions?: Record<string, Function>): DynamicImageResult {
72
- const imageUrls = Array<string>();
82
+ export function renderDynamicImage(
83
+ jsString: string,
84
+ data: Record<string, unknown>,
85
+ functions?: Record<string, Function>
86
+ ): DynamicImageResult {
87
+ const imageUrls: string[] = [];
73
88
  try {
74
89
  return {
75
90
  type: "Ok",
76
- image: evaluate(jsString, baseSchema, { data, functions, components: createComponents(imageUrls) }) as AbstractImage,
91
+ image: evaluate(jsString, baseSchema, {
92
+ data,
93
+ functions,
94
+ components: createComponents(imageUrls),
95
+ }) as AbstractImage,
77
96
  imageUrls,
78
97
  };
79
98
  } catch (error) {
80
99
  return {
81
100
  type: "Err",
82
- error: { type: "RENDER_ERROR", message: error instanceof Error ? error.message : String(error), cause: error },
101
+ error: {
102
+ type: "RENDER_ERROR",
103
+ message: error instanceof Error ? error.message : String(error),
104
+ cause: error,
105
+ },
83
106
  };
84
107
  }
85
108
  }
@@ -1,4 +1,4 @@
1
- import { Schema } from "jsxpression";
1
+ import type { Schema } from "jsxpression";
2
2
 
3
3
  export const baseSchema = {
4
4
  elements: {
@@ -239,7 +239,6 @@ export const baseSchema = {
239
239
  description: "Fill color (text color).",
240
240
  },
241
241
  },
242
- allowedChildren: [],
243
242
  },
244
243
  },
245
244
  } as const satisfies Schema;
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Divid AB
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.