@contrail/documents 1.0.107 → 1.0.109

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 (42) hide show
  1. package/README.md +1 -1
  2. package/lib/components/components.d.ts +448 -448
  3. package/lib/components/components.js +143 -143
  4. package/lib/components/index.d.ts +1 -1
  5. package/lib/components/index.js +17 -17
  6. package/lib/document-action.d.ts +25 -7
  7. package/lib/document-action.js +14 -10
  8. package/lib/document-element-component-size-handler.d.ts +4 -4
  9. package/lib/document-element-component-size-handler.js +55 -55
  10. package/lib/document-element-factory.d.ts +18 -12
  11. package/lib/document-element-factory.js +171 -77
  12. package/lib/document-element-property-binding-handler.d.ts +6 -6
  13. package/lib/document-element-property-binding-handler.js +71 -71
  14. package/lib/index.d.ts +8 -8
  15. package/lib/index.js +24 -24
  16. package/lib/types/common.d.ts +84 -84
  17. package/lib/types/common.js +8 -8
  18. package/lib/types/data-object.d.ts +6 -6
  19. package/lib/types/data-object.js +2 -2
  20. package/lib/types/document-change.d.ts +17 -17
  21. package/lib/types/document-change.js +12 -12
  22. package/lib/types/document-element-event.d.ts +24 -24
  23. package/lib/types/document-element-event.js +2 -2
  24. package/lib/types/document-element-holder.d.ts +8 -8
  25. package/lib/types/document-element-holder.js +2 -2
  26. package/lib/types/document-element.d.ts +48 -46
  27. package/lib/types/document-element.js +2 -2
  28. package/lib/types/document-navigation-event.d.ts +5 -5
  29. package/lib/types/document-navigation-event.js +2 -2
  30. package/lib/types/document.d.ts +24 -24
  31. package/lib/types/document.js +2 -2
  32. package/lib/types/element-transformation.d.ts +18 -18
  33. package/lib/types/element-transformation.js +2 -2
  34. package/lib/types/index.d.ts +9 -9
  35. package/lib/types/index.js +25 -25
  36. package/lib/util/dynamic-text/dynamic-text-util.d.ts +14 -14
  37. package/lib/util/dynamic-text/dynamic-text-util.js +58 -58
  38. package/lib/util/measure-text/measure-text.d.ts +5 -5
  39. package/lib/util/measure-text/measure-text.js +53 -53
  40. package/lib/util/measure-text/widths-map.d.ts +1651 -1651
  41. package/lib/util/measure-text/widths-map.js +1654 -1654
  42. package/package.json +47 -46
@@ -1,77 +1,171 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentElementFactory = void 0;
4
- const nanoid_1 = require("nanoid");
5
- const components_1 = require("./components/components");
6
- const document_element_property_binding_handler_1 = require("./document-element-property-binding-handler");
7
- class DocumentElementFactory {
8
- static initNewElement(type) {
9
- const element = {
10
- id: (0, nanoid_1.nanoid)(16),
11
- position: { x: 300, y: 300 },
12
- type,
13
- };
14
- return element;
15
- }
16
- static createTextElement(text, options = {}) {
17
- let element = this.initNewElement('text');
18
- element.text = text;
19
- element.size = { width: 65, height: 20 };
20
- element.style = {
21
- color: '#000000',
22
- };
23
- element = Object.assign(element, options);
24
- return element;
25
- }
26
- static createShapeElement(type, options = {}) {
27
- let element = this.initNewElement(type);
28
- element = Object.assign(element, options);
29
- return element;
30
- }
31
- static createElement(type, options = {}) {
32
- var _a;
33
- let element = this.initNewElement(type);
34
- element = Object.assign(element, options);
35
- if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
36
- element.elements = element.elements.map((e) => {
37
- e.id = (0, nanoid_1.nanoid)(16);
38
- return e;
39
- });
40
- }
41
- return element;
42
- }
43
- static createImageElement(options) {
44
- let element = this.initNewElement('image');
45
- element = Object.assign(element, options);
46
- return element;
47
- }
48
- static createFrameElement(options) {
49
- let element = this.initNewElement('frame');
50
- element = Object.assign(element, options);
51
- return element;
52
- }
53
- static createComponent(componentType, model, modelBindings, options) {
54
- const componentDefinition = components_1.ComponentRegistry.getComponentDefinition(componentType);
55
- return this.createComponentFromComponentDefinition(componentDefinition, model, modelBindings, options);
56
- }
57
- static createComponentFromComponentDefinition(componentDefinition, model, modelBindings, options) {
58
- var _a;
59
- let element = this.initNewElement('component');
60
- if (options) {
61
- element = Object.assign(element, options);
62
- }
63
- const elements = JSON.parse(JSON.stringify(componentDefinition.defaultTemplate.elements));
64
- document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElement(element, model);
65
- document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElements(elements, model);
66
- element.elements = elements;
67
- element.modelBindings = modelBindings;
68
- if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
69
- element.elements = element.elements.map((e) => {
70
- e.id = (0, nanoid_1.nanoid)(16);
71
- return e;
72
- });
73
- }
74
- return element;
75
- }
76
- }
77
- exports.DocumentElementFactory = DocumentElementFactory;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentElementFactory = void 0;
4
+ const util_1 = require("@contrail/util");
5
+ const nanoid_1 = require("nanoid");
6
+ const components_1 = require("./components/components");
7
+ const document_element_property_binding_handler_1 = require("./document-element-property-binding-handler");
8
+ const document_table_1 = require("@contrail/document-table");
9
+ class DocumentElementFactory {
10
+ static initNewElement(type) {
11
+ const element = {
12
+ id: (0, nanoid_1.nanoid)(16),
13
+ position: { x: 300, y: 300 },
14
+ type,
15
+ };
16
+ return element;
17
+ }
18
+ static createTextElement(text, options = {}) {
19
+ let element = this.initNewElement('text');
20
+ element.text = text;
21
+ element.size = { width: 65, height: 20 };
22
+ element.style = {
23
+ color: '#000000',
24
+ };
25
+ element = Object.assign(element, options);
26
+ return element;
27
+ }
28
+ static createShapeElement(type, options = {}) {
29
+ let element = this.initNewElement(type);
30
+ element = Object.assign(element, options);
31
+ return element;
32
+ }
33
+ static createElement(type, options = {}) {
34
+ var _a;
35
+ let element = this.initNewElement(type);
36
+ element = Object.assign(element, options);
37
+ if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
38
+ element.elements = element.elements.map(e => {
39
+ e.id = (0, nanoid_1.nanoid)(16);
40
+ return e;
41
+ });
42
+ }
43
+ return element;
44
+ }
45
+ static createImageElement(options) {
46
+ let element = this.initNewElement('image');
47
+ element = Object.assign(element, options);
48
+ return element;
49
+ }
50
+ static createFrameElement(options) {
51
+ let element = this.initNewElement('frame');
52
+ element = Object.assign(element, options);
53
+ return element;
54
+ }
55
+ static createComponent(componentType, model, modelBindings, options) {
56
+ const componentDefinition = components_1.ComponentRegistry.getComponentDefinition(componentType);
57
+ return this.createComponentFromComponentDefinition(componentDefinition, model, modelBindings, options);
58
+ }
59
+ static createComponentFromComponentDefinition(componentDefinition, model, modelBindings, options) {
60
+ var _a;
61
+ let element = this.initNewElement('component');
62
+ if (options) {
63
+ element = Object.assign(element, options);
64
+ }
65
+ const elements = JSON.parse(JSON.stringify(componentDefinition.defaultTemplate.elements));
66
+ document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElement(element, model);
67
+ document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElements(elements, model);
68
+ element.elements = elements;
69
+ element.modelBindings = modelBindings;
70
+ if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
71
+ element.elements = element.elements.map(e => {
72
+ e.id = (0, nanoid_1.nanoid)(16);
73
+ return e;
74
+ });
75
+ }
76
+ return element;
77
+ }
78
+ static copyElements(elements, commonOptions = {}, documentId, positionOffset, lastFrameNumber) {
79
+ var _a;
80
+ const oldIdToNewId = new Map();
81
+ const newElements = [];
82
+ const groupElements = [];
83
+ const maskElements = [];
84
+ let frameNumber = lastFrameNumber;
85
+ for (const element of elements) {
86
+ if (['row', 'column', 'cell'].indexOf(element.type) !== -1)
87
+ continue;
88
+ let newElement = util_1.ObjectUtil.mergeDeep({}, element, commonOptions);
89
+ if (frameNumber != undefined && newElement.type === 'frame') {
90
+ newElement.name = `Frame ${frameNumber}`;
91
+ frameNumber = frameNumber + 1;
92
+ }
93
+ delete newElement.id;
94
+ delete newElement.specifiedId;
95
+ if (((_a = newElement === null || newElement === void 0 ? void 0 : newElement.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
96
+ for (const e of newElement.elements) {
97
+ delete e.id;
98
+ delete e.specifiedId;
99
+ }
100
+ }
101
+ let newId = (0, nanoid_1.nanoid)(16);
102
+ if (newElement.type === 'table') {
103
+ const oldChildElements = elements.filter(e => e.tableId === element.id && ['cell', 'column', 'row'].indexOf(e.type) !== -1);
104
+ const [newTableElement, ...newChildElements] = document_table_1.TableCopyService.copy(newElement, oldChildElements);
105
+ if (oldChildElements.length !== newChildElements.length) {
106
+ console.log(`Invalid table element to copy`, newElement, oldChildElements, newChildElements);
107
+ continue;
108
+ }
109
+ newElement = newTableElement;
110
+ newId = newTableElement.id;
111
+ newChildElements.forEach(newChildElement => {
112
+ var _a;
113
+ let oldChildId;
114
+ if (newChildElement.type === 'row') {
115
+ oldChildId = element.rowIds[newTableElement.rowIds.indexOf(newChildElement.id)];
116
+ }
117
+ else if (newChildElement.type === 'column') {
118
+ oldChildId = element.columnIds[newTableElement.columnIds.indexOf(newChildElement.id)];
119
+ }
120
+ else if (newChildElement.type === 'cell') {
121
+ const oldRowId = element.rowIds[newTableElement.rowIds.indexOf(newChildElement.rowId)];
122
+ const oldColumnId = element.columnIds[newTableElement.columnIds.indexOf(newChildElement.columnId)];
123
+ oldChildId = (_a = elements.find(e => e.type === 'cell' && e.rowId === oldRowId && e.columnId === oldColumnId)) === null || _a === void 0 ? void 0 : _a.id;
124
+ }
125
+ if (oldChildId) {
126
+ oldIdToNewId[oldChildId] = newChildElement.id;
127
+ newElements.push(newChildElement);
128
+ }
129
+ });
130
+ }
131
+ if (positionOffset) {
132
+ if (newElement.lineDefinition) {
133
+ newElement.lineDefinition.x1 = newElement.lineDefinition.x1 + positionOffset.x;
134
+ newElement.lineDefinition.y1 = newElement.lineDefinition.y1 + positionOffset.y;
135
+ newElement.lineDefinition.x2 = newElement.lineDefinition.x2 + positionOffset.x;
136
+ newElement.lineDefinition.y2 = newElement.lineDefinition.y2 + positionOffset.y;
137
+ }
138
+ else if (newElement.position) {
139
+ newElement.position.x = newElement.position.x + positionOffset.x;
140
+ newElement.position.y = newElement.position.y + positionOffset.y;
141
+ }
142
+ }
143
+ newElement.documentId = documentId;
144
+ newElement.specifiedId = newId;
145
+ oldIdToNewId[element.id] = newId;
146
+ newElement = DocumentElementFactory.createElement(element.type, newElement);
147
+ newElements.push(newElement);
148
+ if (newElement.type === 'group')
149
+ groupElements.push(newElement);
150
+ if (DocumentElementFactory.isMask(newElement))
151
+ maskElements.push(newElement);
152
+ }
153
+ groupElements.forEach(groupElement => {
154
+ groupElement.elementIds = groupElement.elementIds
155
+ .map(oldElementId => oldIdToNewId.get(oldElementId))
156
+ .filter(id => !!id);
157
+ });
158
+ maskElements.forEach(maskElement => {
159
+ const newElementIds = maskElement.elementIds
160
+ .map(oldElementId => oldIdToNewId.get(oldElementId))
161
+ .filter(id => !!id);
162
+ maskElement.elementIds = (newElementIds === null || newElementIds === void 0 ? void 0 : newElementIds.length) > 0 ? newElementIds : null;
163
+ });
164
+ return { oldIdToNewId, newElements };
165
+ }
166
+ static isMask(element) {
167
+ var _a;
168
+ return ['rectangle', 'circle'].indexOf(element === null || element === void 0 ? void 0 : element.type) !== -1 && ((_a = element === null || element === void 0 ? void 0 : element.elementIds) === null || _a === void 0 ? void 0 : _a.length) > 0;
169
+ }
170
+ }
171
+ exports.DocumentElementFactory = DocumentElementFactory;
@@ -1,6 +1,6 @@
1
- import { DocumentElement } from './types/document-element';
2
- export declare class DocumentElementPropertyBindingHandler {
3
- static bindPropertiesToElements(elements: Array<DocumentElement>, model: any): void;
4
- static bindPropertiesToElement(element: DocumentElement, model: any): void;
5
- static isContentTypeWebViewable(contentType: string): boolean;
6
- }
1
+ import { DocumentElement } from './types/document-element';
2
+ export declare class DocumentElementPropertyBindingHandler {
3
+ static bindPropertiesToElements(elements: Array<DocumentElement>, model: any): void;
4
+ static bindPropertiesToElement(element: DocumentElement, model: any): void;
5
+ static isContentTypeWebViewable(contentType: string): boolean;
6
+ }
@@ -1,71 +1,71 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentElementPropertyBindingHandler = void 0;
4
- const util_1 = require("@contrail/util");
5
- class DocumentElementPropertyBindingHandler {
6
- static bindPropertiesToElements(elements, model) {
7
- elements.map((el) => {
8
- this.bindPropertiesToElement(el, model);
9
- });
10
- }
11
- static bindPropertiesToElement(element, model) {
12
- var _a, _b, _c, _d, _e, _f, _g;
13
- const localModel = Object.assign({}, model);
14
- if (!element.propertyBindings) {
15
- return;
16
- }
17
- if (element.modelBindings) {
18
- }
19
- for (const propertyKey of Object.keys(element.propertyBindings)) {
20
- const modelIndex = element.propertyBindings[propertyKey];
21
- let propertyValue = util_1.ObjectUtil.getByPath(localModel, modelIndex);
22
- if (propertyValue === null || propertyValue === undefined) {
23
- propertyValue = '';
24
- }
25
- util_1.ObjectUtil.setByPath(element, propertyKey, propertyValue);
26
- }
27
- const isImage = ['image', 'svg'].includes(element.type);
28
- if (((_b = (_a = element.propertyBindings) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.indexOf('viewable')) !== -1 && isImage) {
29
- element.alternateUrls = {};
30
- let highResUrl = ((_c = model === null || model === void 0 ? void 0 : model.viewable) === null || _c === void 0 ? void 0 : _c.largeViewableDownloadUrl) || ((_d = model === null || model === void 0 ? void 0 : model.viewable) === null || _d === void 0 ? void 0 : _d.largeViewableUrl);
31
- let originalFile;
32
- let viewableObject;
33
- const content = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.content;
34
- if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
35
- const primaryContent = content.find((c) => { var _a; return (c === null || c === void 0 ? void 0 : c.id) === ((_a = model === null || model === void 0 ? void 0 : model.viewable) === null || _a === void 0 ? void 0 : _a.primaryViewableId); });
36
- viewableObject = primaryContent;
37
- }
38
- else {
39
- viewableObject = model === null || model === void 0 ? void 0 : model.viewable;
40
- }
41
- const contentType = viewableObject === null || viewableObject === void 0 ? void 0 : viewableObject.contentType;
42
- const primaryFileUrl = viewableObject === null || viewableObject === void 0 ? void 0 : viewableObject.primaryFileUrl;
43
- if (contentType === 'image/svg+xml') {
44
- highResUrl = primaryFileUrl;
45
- }
46
- if (this.isContentTypeWebViewable(contentType)) {
47
- originalFile = primaryFileUrl;
48
- }
49
- if (highResUrl) {
50
- element.alternateUrls.highResolution = highResUrl;
51
- }
52
- if (originalFile) {
53
- element.alternateUrls.originalFile = originalFile;
54
- }
55
- let lowResUrl = ((_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.smallViewableDownloadUrl) || ((_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.smallViewableUrl);
56
- if (lowResUrl) {
57
- element.alternateUrls.lowResolution = lowResUrl;
58
- }
59
- }
60
- if (element.elements) {
61
- this.bindPropertiesToElements(element.elements, localModel);
62
- }
63
- }
64
- static isContentTypeWebViewable(contentType) {
65
- if (!contentType) {
66
- return false;
67
- }
68
- return (contentType === null || contentType === void 0 ? void 0 : contentType.indexOf('image')) > -1 && (contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase().indexOf('tiff')) < 0;
69
- }
70
- }
71
- exports.DocumentElementPropertyBindingHandler = DocumentElementPropertyBindingHandler;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentElementPropertyBindingHandler = void 0;
4
+ const util_1 = require("@contrail/util");
5
+ class DocumentElementPropertyBindingHandler {
6
+ static bindPropertiesToElements(elements, model) {
7
+ elements.map((el) => {
8
+ this.bindPropertiesToElement(el, model);
9
+ });
10
+ }
11
+ static bindPropertiesToElement(element, model) {
12
+ var _a, _b, _c, _d, _e, _f, _g;
13
+ const localModel = Object.assign({}, model);
14
+ if (!element.propertyBindings) {
15
+ return;
16
+ }
17
+ if (element.modelBindings) {
18
+ }
19
+ for (const propertyKey of Object.keys(element.propertyBindings)) {
20
+ const modelIndex = element.propertyBindings[propertyKey];
21
+ let propertyValue = util_1.ObjectUtil.getByPath(localModel, modelIndex);
22
+ if (propertyValue === null || propertyValue === undefined) {
23
+ propertyValue = '';
24
+ }
25
+ util_1.ObjectUtil.setByPath(element, propertyKey, propertyValue);
26
+ }
27
+ const isImage = ['image', 'svg'].includes(element.type);
28
+ if (((_b = (_a = element.propertyBindings) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.indexOf('viewable')) !== -1 && isImage) {
29
+ element.alternateUrls = {};
30
+ let highResUrl = ((_c = model === null || model === void 0 ? void 0 : model.viewable) === null || _c === void 0 ? void 0 : _c.largeViewableDownloadUrl) || ((_d = model === null || model === void 0 ? void 0 : model.viewable) === null || _d === void 0 ? void 0 : _d.largeViewableUrl);
31
+ let originalFile;
32
+ let viewableObject;
33
+ const content = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.content;
34
+ if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
35
+ const primaryContent = content.find((c) => { var _a; return (c === null || c === void 0 ? void 0 : c.id) === ((_a = model === null || model === void 0 ? void 0 : model.viewable) === null || _a === void 0 ? void 0 : _a.primaryViewableId); });
36
+ viewableObject = primaryContent;
37
+ }
38
+ else {
39
+ viewableObject = model === null || model === void 0 ? void 0 : model.viewable;
40
+ }
41
+ const contentType = viewableObject === null || viewableObject === void 0 ? void 0 : viewableObject.contentType;
42
+ const primaryFileUrl = viewableObject === null || viewableObject === void 0 ? void 0 : viewableObject.primaryFileUrl;
43
+ if (contentType === 'image/svg+xml') {
44
+ highResUrl = primaryFileUrl;
45
+ }
46
+ if (this.isContentTypeWebViewable(contentType)) {
47
+ originalFile = primaryFileUrl;
48
+ }
49
+ if (highResUrl) {
50
+ element.alternateUrls.highResolution = highResUrl;
51
+ }
52
+ if (originalFile) {
53
+ element.alternateUrls.originalFile = originalFile;
54
+ }
55
+ let lowResUrl = ((_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.smallViewableDownloadUrl) || ((_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.smallViewableUrl);
56
+ if (lowResUrl) {
57
+ element.alternateUrls.lowResolution = lowResUrl;
58
+ }
59
+ }
60
+ if (element.elements) {
61
+ this.bindPropertiesToElements(element.elements, localModel);
62
+ }
63
+ }
64
+ static isContentTypeWebViewable(contentType) {
65
+ if (!contentType) {
66
+ return false;
67
+ }
68
+ return (contentType === null || contentType === void 0 ? void 0 : contentType.indexOf('image')) > -1 && (contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase().indexOf('tiff')) < 0;
69
+ }
70
+ }
71
+ exports.DocumentElementPropertyBindingHandler = DocumentElementPropertyBindingHandler;
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from './types';
2
- export * from './components';
3
- export * from './document-element-factory';
4
- export * from './document-element-property-binding-handler';
5
- export * from './document-element-component-size-handler';
6
- export * from './document-action';
7
- export * from './util/measure-text/measure-text';
8
- export * from './util/dynamic-text/dynamic-text-util';
1
+ export * from './types';
2
+ export * from './components';
3
+ export * from './document-element-factory';
4
+ export * from './document-element-property-binding-handler';
5
+ export * from './document-element-component-size-handler';
6
+ export * from './document-action';
7
+ export * from './util/measure-text/measure-text';
8
+ export * from './util/dynamic-text/dynamic-text-util';
package/lib/index.js CHANGED
@@ -1,24 +1,24 @@
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("./types"), exports);
18
- __exportStar(require("./components"), exports);
19
- __exportStar(require("./document-element-factory"), exports);
20
- __exportStar(require("./document-element-property-binding-handler"), exports);
21
- __exportStar(require("./document-element-component-size-handler"), exports);
22
- __exportStar(require("./document-action"), exports);
23
- __exportStar(require("./util/measure-text/measure-text"), exports);
24
- __exportStar(require("./util/dynamic-text/dynamic-text-util"), exports);
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("./types"), exports);
18
+ __exportStar(require("./components"), exports);
19
+ __exportStar(require("./document-element-factory"), exports);
20
+ __exportStar(require("./document-element-property-binding-handler"), exports);
21
+ __exportStar(require("./document-element-component-size-handler"), exports);
22
+ __exportStar(require("./document-action"), exports);
23
+ __exportStar(require("./util/measure-text/measure-text"), exports);
24
+ __exportStar(require("./util/dynamic-text/dynamic-text-util"), exports);
@@ -1,84 +1,84 @@
1
- export interface TextStyleDefinition {
2
- valign?: string;
3
- align?: string;
4
- decoration?: string;
5
- }
6
- export interface FontStyleDefinition {
7
- family?: string;
8
- size?: number;
9
- sizeMode?: 'auto' | 'custom';
10
- weight?: string;
11
- style?: string;
12
- italic?: boolean;
13
- strikethrough?: boolean;
14
- }
15
- export interface BorderStyleDefinition {
16
- style?: string;
17
- color?: string;
18
- width?: number;
19
- radius?: number;
20
- }
21
- export interface BackgroundStyleDefinition {
22
- color?: string;
23
- size?: BackgroundSizeType;
24
- }
25
- export declare enum BackgroundSizeType {
26
- CONTAIN = "CONTAIN",
27
- COVER = "COVER"
28
- }
29
- export interface StyleDefinition {
30
- background?: BackgroundStyleDefinition;
31
- text?: TextStyleDefinition;
32
- font?: FontStyleDefinition;
33
- border?: BorderStyleDefinition;
34
- color?: string;
35
- backgroundColor?: string;
36
- opacity?: number;
37
- }
38
- export interface SizeDefinition {
39
- width?: number;
40
- height?: number;
41
- }
42
- export interface ViewBox {
43
- width?: number;
44
- height?: number;
45
- x?: number;
46
- y?: number;
47
- }
48
- export interface ViewShape {
49
- type?: string;
50
- width?: number;
51
- height?: number;
52
- x?: number;
53
- y?: number;
54
- }
55
- export interface PositionDefinition {
56
- x?: number;
57
- y?: number;
58
- z?: number;
59
- }
60
- export interface RotationDefinition {
61
- angle?: number;
62
- }
63
- export interface LineDefinition {
64
- x1?: number;
65
- x2?: number;
66
- y1?: number;
67
- y2?: number;
68
- markerStart?: string;
69
- markerEnd?: string;
70
- }
71
- export interface CropDefinition {
72
- x1?: number;
73
- x2?: number;
74
- y1?: number;
75
- y2?: number;
76
- width?: number;
77
- height?: number;
78
- x1Percent?: number;
79
- x2Percent?: number;
80
- y1Percent?: number;
81
- y2Percent?: number;
82
- widthPercent?: number;
83
- heightPercent?: number;
84
- }
1
+ export interface TextStyleDefinition {
2
+ valign?: string;
3
+ align?: string;
4
+ decoration?: string;
5
+ }
6
+ export interface FontStyleDefinition {
7
+ family?: string;
8
+ size?: number;
9
+ sizeMode?: 'auto' | 'custom';
10
+ weight?: string;
11
+ style?: string;
12
+ italic?: boolean;
13
+ strikethrough?: boolean;
14
+ }
15
+ export interface BorderStyleDefinition {
16
+ style?: string;
17
+ color?: string;
18
+ width?: number;
19
+ radius?: number;
20
+ }
21
+ export interface BackgroundStyleDefinition {
22
+ color?: string;
23
+ size?: BackgroundSizeType;
24
+ }
25
+ export declare enum BackgroundSizeType {
26
+ CONTAIN = "CONTAIN",
27
+ COVER = "COVER"
28
+ }
29
+ export interface StyleDefinition {
30
+ background?: BackgroundStyleDefinition;
31
+ text?: TextStyleDefinition;
32
+ font?: FontStyleDefinition;
33
+ border?: BorderStyleDefinition;
34
+ color?: string;
35
+ backgroundColor?: string;
36
+ opacity?: number;
37
+ }
38
+ export interface SizeDefinition {
39
+ width?: number;
40
+ height?: number;
41
+ }
42
+ export interface ViewBox {
43
+ width?: number;
44
+ height?: number;
45
+ x?: number;
46
+ y?: number;
47
+ }
48
+ export interface ViewShape {
49
+ type?: string;
50
+ width?: number;
51
+ height?: number;
52
+ x?: number;
53
+ y?: number;
54
+ }
55
+ export interface PositionDefinition {
56
+ x?: number;
57
+ y?: number;
58
+ z?: number;
59
+ }
60
+ export interface RotationDefinition {
61
+ angle?: number;
62
+ }
63
+ export interface LineDefinition {
64
+ x1?: number;
65
+ x2?: number;
66
+ y1?: number;
67
+ y2?: number;
68
+ markerStart?: string;
69
+ markerEnd?: string;
70
+ }
71
+ export interface CropDefinition {
72
+ x1?: number;
73
+ x2?: number;
74
+ y1?: number;
75
+ y2?: number;
76
+ width?: number;
77
+ height?: number;
78
+ x1Percent?: number;
79
+ x2Percent?: number;
80
+ y1Percent?: number;
81
+ y2Percent?: number;
82
+ widthPercent?: number;
83
+ heightPercent?: number;
84
+ }