@contrail/document-generation 2.0.28 → 2.0.30

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/board-document-generator.d.ts +23 -23
  3. package/lib/board-document-generator.js +206 -206
  4. package/lib/components/component-generator.d.ts +6 -6
  5. package/lib/components/component-generator.js +55 -52
  6. package/lib/components/component-grid-generator.d.ts +7 -7
  7. package/lib/components/component-grid-generator.js +80 -80
  8. package/lib/components/component-util.d.ts +5 -5
  9. package/lib/components/component-util.js +43 -43
  10. package/lib/document-generator.d.ts +6 -6
  11. package/lib/document-generator.js +12 -12
  12. package/lib/frames/frame-generator.d.ts +12 -12
  13. package/lib/frames/frame-generator.js +128 -128
  14. package/lib/frames/frame.d.ts +16 -16
  15. package/lib/frames/frame.js +67 -67
  16. package/lib/frames/index.d.ts +2 -2
  17. package/lib/frames/index.js +18 -18
  18. package/lib/index.d.ts +6 -6
  19. package/lib/index.js +22 -22
  20. package/lib/info-panel/info-panel-generator.d.ts +6 -6
  21. package/lib/info-panel/info-panel-generator.js +52 -52
  22. package/lib/interfaces.d.ts +72 -72
  23. package/lib/interfaces.js +8 -8
  24. package/lib/scripts/test-board.d.ts +1 -1
  25. package/lib/scripts/test-board.js +219 -219
  26. package/lib/scripts/test-showcase.d.ts +1 -1
  27. package/lib/scripts/test-showcase.js +243 -243
  28. package/lib/showcase-frame-generator.d.ts +8 -8
  29. package/lib/showcase-frame-generator.js +45 -45
  30. package/lib/test-data.d.ts +72 -72
  31. package/lib/test-data.js +176 -176
  32. package/lib/util/document-property-util.d.ts +9 -9
  33. package/lib/util/document-property-util.js +98 -96
  34. package/lib/util/document-text-element-util.d.ts +10 -10
  35. package/lib/util/document-text-element-util.js +124 -124
  36. package/lib/util/document-util.d.ts +8 -8
  37. package/lib/util/document-util.js +24 -24
  38. package/lib/util/index.d.ts +2 -2
  39. package/lib/util/index.js +18 -18
  40. package/lib/util/text-util.d.ts +4 -4
  41. package/lib/util/text-util.js +28 -28
  42. package/package.json +50 -50
@@ -1,72 +1,72 @@
1
- import { DataGroupStructure } from "@contrail/data-grouping";
2
- import { ComponentGridTemplate, DocumentTemplate } from "./interfaces";
3
- export declare const TEST_ITEM_MODEL: {
4
- item: {
5
- id: string;
6
- name: string;
7
- optionName: string;
8
- gender: string;
9
- mediumViewableDownloadUrl: string;
10
- };
11
- projectItem: {
12
- id: string;
13
- retailPrice: number;
14
- };
15
- assortmentItem: {
16
- id: string;
17
- targetVolume: number;
18
- };
19
- };
20
- export declare const TEST_GROUP: {
21
- name: string;
22
- data: {
23
- item: {
24
- id: string;
25
- name: string;
26
- optionName: string;
27
- gender: string;
28
- mediumViewableDownloadUrl: string;
29
- };
30
- projectItem: {
31
- id: string;
32
- retailPrice: number;
33
- };
34
- assortmentItem: {
35
- id: string;
36
- targetVolume: number;
37
- };
38
- }[];
39
- propertyValues: {
40
- gender: string;
41
- };
42
- subGroups: any[];
43
- };
44
- export declare const TEST_GROUP_2: {
45
- name: string;
46
- data: {
47
- item: {
48
- id: string;
49
- name: string;
50
- optionName: string;
51
- gender: string;
52
- mediumViewableDownloadUrl: string;
53
- };
54
- projectItem: {
55
- id: string;
56
- retailPrice: number;
57
- };
58
- assortmentItem: {
59
- id: string;
60
- targetVolume: number;
61
- };
62
- }[];
63
- propertyValues: {
64
- gender: string;
65
- };
66
- subGroups: any[];
67
- };
68
- export declare const TEST_ROOT_GROUP: DataGroupStructure;
69
- export declare const TEST_TWO_LEVEL_ROOT_GROUP: DataGroupStructure;
70
- export declare const COMPONENT_GRID_TEMPLATE: ComponentGridTemplate;
71
- export declare const HORIZONTAL_DOCUMENT_TEMPLATE: DocumentTemplate;
72
- export declare const VERTICAL_DOCUMENT_TEMPLATE: DocumentTemplate;
1
+ import { DataGroupStructure } from "@contrail/data-grouping";
2
+ import { ComponentGridTemplate, DocumentTemplate } from "./interfaces";
3
+ export declare const TEST_ITEM_MODEL: {
4
+ item: {
5
+ id: string;
6
+ name: string;
7
+ optionName: string;
8
+ gender: string;
9
+ mediumViewableDownloadUrl: string;
10
+ };
11
+ projectItem: {
12
+ id: string;
13
+ retailPrice: number;
14
+ };
15
+ assortmentItem: {
16
+ id: string;
17
+ targetVolume: number;
18
+ };
19
+ };
20
+ export declare const TEST_GROUP: {
21
+ name: string;
22
+ data: {
23
+ item: {
24
+ id: string;
25
+ name: string;
26
+ optionName: string;
27
+ gender: string;
28
+ mediumViewableDownloadUrl: string;
29
+ };
30
+ projectItem: {
31
+ id: string;
32
+ retailPrice: number;
33
+ };
34
+ assortmentItem: {
35
+ id: string;
36
+ targetVolume: number;
37
+ };
38
+ }[];
39
+ propertyValues: {
40
+ gender: string;
41
+ };
42
+ subGroups: any[];
43
+ };
44
+ export declare const TEST_GROUP_2: {
45
+ name: string;
46
+ data: {
47
+ item: {
48
+ id: string;
49
+ name: string;
50
+ optionName: string;
51
+ gender: string;
52
+ mediumViewableDownloadUrl: string;
53
+ };
54
+ projectItem: {
55
+ id: string;
56
+ retailPrice: number;
57
+ };
58
+ assortmentItem: {
59
+ id: string;
60
+ targetVolume: number;
61
+ };
62
+ }[];
63
+ propertyValues: {
64
+ gender: string;
65
+ };
66
+ subGroups: any[];
67
+ };
68
+ export declare const TEST_ROOT_GROUP: DataGroupStructure;
69
+ export declare const TEST_TWO_LEVEL_ROOT_GROUP: DataGroupStructure;
70
+ export declare const COMPONENT_GRID_TEMPLATE: ComponentGridTemplate;
71
+ export declare const HORIZONTAL_DOCUMENT_TEMPLATE: DocumentTemplate;
72
+ export declare const VERTICAL_DOCUMENT_TEMPLATE: DocumentTemplate;
package/lib/test-data.js CHANGED
@@ -1,176 +1,176 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERTICAL_DOCUMENT_TEMPLATE = exports.HORIZONTAL_DOCUMENT_TEMPLATE = exports.COMPONENT_GRID_TEMPLATE = exports.TEST_TWO_LEVEL_ROOT_GROUP = exports.TEST_ROOT_GROUP = exports.TEST_GROUP_2 = exports.TEST_GROUP = exports.TEST_ITEM_MODEL = void 0;
4
- const types_1 = require("@contrail/types");
5
- const interfaces_1 = require("./interfaces");
6
- const sdk_1 = require("@contrail/sdk");
7
- exports.TEST_ITEM_MODEL = {
8
- item: {
9
- id: 'item-1001',
10
- name: 'Shirt 1',
11
- optionName: 'Red',
12
- gender: 'mens',
13
- mediumViewableDownloadUrl: 'https://api.vibeiq.com/dev/api/files/downloadUrl/-VMrLJrt3clDKPi0%2Fcontent:m3Bd4u-QLci1XiOl%2F2b72d48a-6b19-4ba8-9d54-813745fb8dd4.png',
14
- },
15
- projectItem: {
16
- id: 'projectItem-1001',
17
- retailPrice: 45.00
18
- },
19
- assortmentItem: {
20
- id: 'assortmentItem-1001',
21
- targetVolume: 1000
22
- },
23
- };
24
- exports.TEST_GROUP = {
25
- name: "Mens",
26
- data: [exports.TEST_ITEM_MODEL,
27
- exports.TEST_ITEM_MODEL,
28
- exports.TEST_ITEM_MODEL,
29
- exports.TEST_ITEM_MODEL,
30
- exports.TEST_ITEM_MODEL,
31
- exports.TEST_ITEM_MODEL,
32
- exports.TEST_ITEM_MODEL,
33
- exports.TEST_ITEM_MODEL,
34
- exports.TEST_ITEM_MODEL,
35
- exports.TEST_ITEM_MODEL],
36
- propertyValues: {
37
- gender: 'mens'
38
- },
39
- subGroups: [],
40
- };
41
- exports.TEST_GROUP_2 = {
42
- name: "Womens",
43
- data: [exports.TEST_ITEM_MODEL,
44
- exports.TEST_ITEM_MODEL,
45
- exports.TEST_ITEM_MODEL,
46
- exports.TEST_ITEM_MODEL,
47
- exports.TEST_ITEM_MODEL,
48
- exports.TEST_ITEM_MODEL,
49
- exports.TEST_ITEM_MODEL],
50
- propertyValues: {
51
- gender: 'womens'
52
- },
53
- subGroups: [],
54
- };
55
- exports.TEST_ROOT_GROUP = {
56
- depth: 1,
57
- groupingProperties: [{
58
- propertyDefinition: {
59
- slug: 'gender',
60
- propertyType: types_1.PropertyType.SingleSelect,
61
- label: "Gender",
62
- },
63
- sort: sdk_1.SortOrderOptions.ASC,
64
- typeRootSlug: 'item',
65
- values: null,
66
- }],
67
- rootGroup: {
68
- data: [],
69
- subGroups: [exports.TEST_GROUP, exports.TEST_GROUP, exports.TEST_GROUP],
70
- name: "Root",
71
- propertyValues: {},
72
- }
73
- };
74
- exports.TEST_TWO_LEVEL_ROOT_GROUP = {
75
- depth: 2,
76
- groupingProperties: [{
77
- propertyDefinition: {
78
- slug: 'gender',
79
- propertyType: types_1.PropertyType.SingleSelect,
80
- label: "Gender",
81
- },
82
- sort: sdk_1.SortOrderOptions.ASC,
83
- typeRootSlug: 'item',
84
- values: null,
85
- }],
86
- rootGroup: {
87
- data: [],
88
- subGroups: [{
89
- name: 'Mens',
90
- subGroups: [exports.TEST_GROUP, exports.TEST_GROUP],
91
- propertyValues: {
92
- gender: 'mens'
93
- },
94
- data: [],
95
- }, {
96
- name: 'Womens',
97
- subGroups: [exports.TEST_GROUP_2, exports.TEST_GROUP_2, exports.TEST_GROUP_2, exports.TEST_GROUP_2],
98
- propertyValues: {
99
- gender: 'mens'
100
- },
101
- data: [],
102
- }],
103
- name: "Root",
104
- propertyValues: {},
105
- }
106
- };
107
- exports.COMPONENT_GRID_TEMPLATE = {
108
- gridDimensions: { cols: 7, rows: 3 },
109
- componentTemplate: {
110
- propertyTemplate: {
111
- properties: [],
112
- imageLocation: 'top',
113
- }
114
- },
115
- componentPadding: 20
116
- };
117
- exports.HORIZONTAL_DOCUMENT_TEMPLATE = {
118
- frameOrientation: interfaces_1.Orientation.HORIZONTAL,
119
- frameSize: { width: 1200, height: 675 },
120
- framePadding: 30,
121
- frameHeaderTemplate: {
122
- style: {
123
- color: '#000000',
124
- font: {
125
- size: 20
126
- },
127
- backgroundColor: '#FFFFFF',
128
- },
129
- size: {
130
- height: 60,
131
- }
132
- },
133
- frameGroupHeaderTemplate: {
134
- style: {
135
- color: '#ffffff',
136
- font: {
137
- size: 20
138
- },
139
- backgroundColor: 'black',
140
- },
141
- size: {
142
- height: 60,
143
- }
144
- },
145
- componentGridTemplate: exports.COMPONENT_GRID_TEMPLATE,
146
- };
147
- exports.VERTICAL_DOCUMENT_TEMPLATE = {
148
- frameOrientation: interfaces_1.Orientation.VERTICAL,
149
- frameSize: { width: 1200, height: 675 },
150
- framePadding: 30,
151
- frameHeaderTemplate: {
152
- style: {
153
- color: '#000000',
154
- font: {
155
- size: 20
156
- },
157
- backgroundColor: '#FFFFFF',
158
- },
159
- size: {
160
- height: 60,
161
- }
162
- },
163
- frameGroupHeaderTemplate: {
164
- style: {
165
- color: '#ffffff',
166
- font: {
167
- size: 20
168
- },
169
- backgroundColor: 'black',
170
- },
171
- size: {
172
- height: 60,
173
- }
174
- },
175
- componentGridTemplate: exports.COMPONENT_GRID_TEMPLATE,
176
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VERTICAL_DOCUMENT_TEMPLATE = exports.HORIZONTAL_DOCUMENT_TEMPLATE = exports.COMPONENT_GRID_TEMPLATE = exports.TEST_TWO_LEVEL_ROOT_GROUP = exports.TEST_ROOT_GROUP = exports.TEST_GROUP_2 = exports.TEST_GROUP = exports.TEST_ITEM_MODEL = void 0;
4
+ const types_1 = require("@contrail/types");
5
+ const interfaces_1 = require("./interfaces");
6
+ const sdk_1 = require("@contrail/sdk");
7
+ exports.TEST_ITEM_MODEL = {
8
+ item: {
9
+ id: 'item-1001',
10
+ name: 'Shirt 1',
11
+ optionName: 'Red',
12
+ gender: 'mens',
13
+ mediumViewableDownloadUrl: 'https://api.vibeiq.com/dev/api/files/downloadUrl/-VMrLJrt3clDKPi0%2Fcontent:m3Bd4u-QLci1XiOl%2F2b72d48a-6b19-4ba8-9d54-813745fb8dd4.png',
14
+ },
15
+ projectItem: {
16
+ id: 'projectItem-1001',
17
+ retailPrice: 45.00
18
+ },
19
+ assortmentItem: {
20
+ id: 'assortmentItem-1001',
21
+ targetVolume: 1000
22
+ },
23
+ };
24
+ exports.TEST_GROUP = {
25
+ name: "Mens",
26
+ data: [exports.TEST_ITEM_MODEL,
27
+ exports.TEST_ITEM_MODEL,
28
+ exports.TEST_ITEM_MODEL,
29
+ exports.TEST_ITEM_MODEL,
30
+ exports.TEST_ITEM_MODEL,
31
+ exports.TEST_ITEM_MODEL,
32
+ exports.TEST_ITEM_MODEL,
33
+ exports.TEST_ITEM_MODEL,
34
+ exports.TEST_ITEM_MODEL,
35
+ exports.TEST_ITEM_MODEL],
36
+ propertyValues: {
37
+ gender: 'mens'
38
+ },
39
+ subGroups: [],
40
+ };
41
+ exports.TEST_GROUP_2 = {
42
+ name: "Womens",
43
+ data: [exports.TEST_ITEM_MODEL,
44
+ exports.TEST_ITEM_MODEL,
45
+ exports.TEST_ITEM_MODEL,
46
+ exports.TEST_ITEM_MODEL,
47
+ exports.TEST_ITEM_MODEL,
48
+ exports.TEST_ITEM_MODEL,
49
+ exports.TEST_ITEM_MODEL],
50
+ propertyValues: {
51
+ gender: 'womens'
52
+ },
53
+ subGroups: [],
54
+ };
55
+ exports.TEST_ROOT_GROUP = {
56
+ depth: 1,
57
+ groupingProperties: [{
58
+ propertyDefinition: {
59
+ slug: 'gender',
60
+ propertyType: types_1.PropertyType.SingleSelect,
61
+ label: "Gender",
62
+ },
63
+ sort: sdk_1.SortOrderOptions.ASC,
64
+ typeRootSlug: 'item',
65
+ values: null,
66
+ }],
67
+ rootGroup: {
68
+ data: [],
69
+ subGroups: [exports.TEST_GROUP, exports.TEST_GROUP, exports.TEST_GROUP],
70
+ name: "Root",
71
+ propertyValues: {},
72
+ }
73
+ };
74
+ exports.TEST_TWO_LEVEL_ROOT_GROUP = {
75
+ depth: 2,
76
+ groupingProperties: [{
77
+ propertyDefinition: {
78
+ slug: 'gender',
79
+ propertyType: types_1.PropertyType.SingleSelect,
80
+ label: "Gender",
81
+ },
82
+ sort: sdk_1.SortOrderOptions.ASC,
83
+ typeRootSlug: 'item',
84
+ values: null,
85
+ }],
86
+ rootGroup: {
87
+ data: [],
88
+ subGroups: [{
89
+ name: 'Mens',
90
+ subGroups: [exports.TEST_GROUP, exports.TEST_GROUP],
91
+ propertyValues: {
92
+ gender: 'mens'
93
+ },
94
+ data: [],
95
+ }, {
96
+ name: 'Womens',
97
+ subGroups: [exports.TEST_GROUP_2, exports.TEST_GROUP_2, exports.TEST_GROUP_2, exports.TEST_GROUP_2],
98
+ propertyValues: {
99
+ gender: 'mens'
100
+ },
101
+ data: [],
102
+ }],
103
+ name: "Root",
104
+ propertyValues: {},
105
+ }
106
+ };
107
+ exports.COMPONENT_GRID_TEMPLATE = {
108
+ gridDimensions: { cols: 7, rows: 3 },
109
+ componentTemplate: {
110
+ propertyTemplate: {
111
+ properties: [],
112
+ imageLocation: 'top',
113
+ }
114
+ },
115
+ componentPadding: 20
116
+ };
117
+ exports.HORIZONTAL_DOCUMENT_TEMPLATE = {
118
+ frameOrientation: interfaces_1.Orientation.HORIZONTAL,
119
+ frameSize: { width: 1200, height: 675 },
120
+ framePadding: 30,
121
+ frameHeaderTemplate: {
122
+ style: {
123
+ color: '#000000',
124
+ font: {
125
+ size: 20
126
+ },
127
+ backgroundColor: '#FFFFFF',
128
+ },
129
+ size: {
130
+ height: 60,
131
+ }
132
+ },
133
+ frameGroupHeaderTemplate: {
134
+ style: {
135
+ color: '#ffffff',
136
+ font: {
137
+ size: 20
138
+ },
139
+ backgroundColor: 'black',
140
+ },
141
+ size: {
142
+ height: 60,
143
+ }
144
+ },
145
+ componentGridTemplate: exports.COMPONENT_GRID_TEMPLATE,
146
+ };
147
+ exports.VERTICAL_DOCUMENT_TEMPLATE = {
148
+ frameOrientation: interfaces_1.Orientation.VERTICAL,
149
+ frameSize: { width: 1200, height: 675 },
150
+ framePadding: 30,
151
+ frameHeaderTemplate: {
152
+ style: {
153
+ color: '#000000',
154
+ font: {
155
+ size: 20
156
+ },
157
+ backgroundColor: '#FFFFFF',
158
+ },
159
+ size: {
160
+ height: 60,
161
+ }
162
+ },
163
+ frameGroupHeaderTemplate: {
164
+ style: {
165
+ color: '#ffffff',
166
+ font: {
167
+ size: 20
168
+ },
169
+ backgroundColor: 'black',
170
+ },
171
+ size: {
172
+ height: 60,
173
+ }
174
+ },
175
+ componentGridTemplate: exports.COMPONENT_GRID_TEMPLATE,
176
+ };
@@ -1,9 +1,9 @@
1
- import { DocumentPropertyDefinition } from "../interfaces";
2
- import { DocumentElement, PositionDefinition, SizeDefinition } from "@contrail/documents";
3
- import { PropertyValueFormatter } from "@contrail/types";
4
- export declare class DocumentPropertyUtil {
5
- static generatePropertyElements(data: any, properties: Array<DocumentPropertyDefinition>, options: DocumentElement, startingPosition: PositionDefinition, imageDimension: SizeDefinition, isComponent?: boolean): Array<DocumentElement>;
6
- static generatePropertyTextElement(model: any, property: DocumentPropertyDefinition, options: DocumentElement, formatter: PropertyValueFormatter, position: PositionDefinition, isComponent?: boolean): DocumentElement;
7
- static generatePropertyAnnotationElement(data: any, property: DocumentPropertyDefinition, size: SizeDefinition, position: PositionDefinition): DocumentElement;
8
- static generatePropertyImageElement(data: any, property: DocumentPropertyDefinition, imageDimension: SizeDefinition, position: PositionDefinition): DocumentElement;
9
- }
1
+ import { DocumentPropertyDefinition } from "../interfaces";
2
+ import { DocumentElement, PositionDefinition, SizeDefinition } from "@contrail/documents";
3
+ import { PropertyValueFormatter } from "@contrail/types";
4
+ export declare class DocumentPropertyUtil {
5
+ static generatePropertyElements(data: any, properties: Array<DocumentPropertyDefinition>, options: DocumentElement, startingPosition: PositionDefinition, imageDimension: SizeDefinition, isComponent?: boolean): Array<DocumentElement>;
6
+ static generatePropertyTextElement(model: any, property: DocumentPropertyDefinition, options: DocumentElement, formatter: PropertyValueFormatter, position: PositionDefinition, isComponent?: boolean): DocumentElement;
7
+ static generatePropertyAnnotationElement(data: any, property: DocumentPropertyDefinition, size: SizeDefinition, position: PositionDefinition): DocumentElement;
8
+ static generatePropertyImageElement(data: any, property: DocumentPropertyDefinition, imageDimension: SizeDefinition, position: PositionDefinition): DocumentElement;
9
+ }