@openlettermarketing/olc-react-sdk 2.1.4 → 2.1.5-beta.2

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 (230) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/.eslintrc.yml +47 -0
  4. package/.github/workflows/publish-beta.yml +154 -0
  5. package/.github/workflows/publish-production.yml +143 -0
  6. package/.prettierignore +3 -0
  7. package/.prettierrc.yml +5 -0
  8. package/CHANGELOG.md +4 -0
  9. package/babel.config.json +10 -0
  10. package/build/index.js +82 -82
  11. package/build/index.js.map +1 -1
  12. package/build/types/version.d.ts +1 -1
  13. package/examples/.eslintrc.yml +4 -0
  14. package/index.html +18 -0
  15. package/package.json +1 -1
  16. package/public/vite.svg +1 -0
  17. package/src/App.tsx +209 -0
  18. package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
  19. package/src/assets/images/create-template/prebuilt.svg +13 -0
  20. package/src/assets/images/create-template/scratch.svg +4 -0
  21. package/src/assets/images/input/cancel.tsx +20 -0
  22. package/src/assets/images/input/search.tsx +20 -0
  23. package/src/assets/images/input/select-cancel.tsx +17 -0
  24. package/src/assets/images/modal-icons/add.tsx +36 -0
  25. package/src/assets/images/modal-icons/cancel-file.tsx +12 -0
  26. package/src/assets/images/modal-icons/cancel-input.tsx +13 -0
  27. package/src/assets/images/modal-icons/cancel.tsx +35 -0
  28. package/src/assets/images/modal-icons/close-new.svg +3 -0
  29. package/src/assets/images/modal-icons/confirm-close-icon.tsx +14 -0
  30. package/src/assets/images/modal-icons/confirm-new.tsx +22 -0
  31. package/src/assets/images/modal-icons/confirm.svg +12 -0
  32. package/src/assets/images/modal-icons/cross.tsx +23 -0
  33. package/src/assets/images/modal-icons/del.tsx +19 -0
  34. package/src/assets/images/modal-icons/design-icon.tsx +22 -0
  35. package/src/assets/images/modal-icons/doc.tsx +43 -0
  36. package/src/assets/images/modal-icons/docx.tsx +43 -0
  37. package/src/assets/images/modal-icons/envelope-icon.tsx +26 -0
  38. package/src/assets/images/modal-icons/info.tsx +19 -0
  39. package/src/assets/images/modal-icons/jpeg.tsx +43 -0
  40. package/src/assets/images/modal-icons/jpg.tsx +43 -0
  41. package/src/assets/images/modal-icons/modal-cros.svg +4 -0
  42. package/src/assets/images/modal-icons/modal-cross.tsx +37 -0
  43. package/src/assets/images/modal-icons/new-cancel.tsx +11 -0
  44. package/src/assets/images/modal-icons/order-download.tsx +42 -0
  45. package/src/assets/images/modal-icons/pdf.tsx +51 -0
  46. package/src/assets/images/modal-icons/png.tsx +43 -0
  47. package/src/assets/images/modal-icons/save.tsx +23 -0
  48. package/src/assets/images/modal-icons/template-copy.tsx +25 -0
  49. package/src/assets/images/modal-icons/tool-cancel.tsx +25 -0
  50. package/src/assets/images/products/bi-new.svg +23 -0
  51. package/src/assets/images/products/left-arrow.svg +17 -0
  52. package/src/assets/images/products/personal-new.tsx +31 -0
  53. package/src/assets/images/products/postcard-new.tsx +27 -0
  54. package/src/assets/images/products/professional-new.tsx +24 -0
  55. package/src/assets/images/products/real-new.tsx +30 -0
  56. package/src/assets/images/products/right-arrow.svg +17 -0
  57. package/src/assets/images/products/snap-new.svg +31 -0
  58. package/src/assets/images/templates/actions.svg +3 -0
  59. package/src/assets/images/templates/address-block-icon.tsx +62 -0
  60. package/src/assets/images/templates/archive.svg +3 -0
  61. package/src/assets/images/templates/arrow-down.tsx +27 -0
  62. package/src/assets/images/templates/back-arrow.tsx +19 -0
  63. package/src/assets/images/templates/bi-fold-self-mailers.tsx +28 -0
  64. package/src/assets/images/templates/check.svg +3 -0
  65. package/src/assets/images/templates/code.svg +10 -0
  66. package/src/assets/images/templates/content-copy-icon.tsx +24 -0
  67. package/src/assets/images/templates/custom-add-on-icon.tsx +18 -0
  68. package/src/assets/images/templates/custom-qr-section-icon.tsx +9 -0
  69. package/src/assets/images/templates/custom-template.tsx +23 -0
  70. package/src/assets/images/templates/designer.tsx +43 -0
  71. package/src/assets/images/templates/dot.tsx +22 -0
  72. package/src/assets/images/templates/download-v2.svg +4 -0
  73. package/src/assets/images/templates/download.svg +4 -0
  74. package/src/assets/images/templates/dummy-template.tsx +76 -0
  75. package/src/assets/images/templates/dynamic-field.tsx +119 -0
  76. package/src/assets/images/templates/edit-pencil-icon.tsx +21 -0
  77. package/src/assets/images/templates/edit.svg +3 -0
  78. package/src/assets/images/templates/epo-icon.tsx +16 -0
  79. package/src/assets/images/templates/field.tsx +29 -0
  80. package/src/assets/images/templates/gsv-icon.tsx +31 -0
  81. package/src/assets/images/templates/info-icon.tsx +37 -0
  82. package/src/assets/images/templates/left-arrow.svg +17 -0
  83. package/src/assets/images/templates/pencil.svg +3 -0
  84. package/src/assets/images/templates/personal-letter.tsx +53 -0
  85. package/src/assets/images/templates/postcard.tsx +32 -0
  86. package/src/assets/images/templates/professional-letter.tsx +53 -0
  87. package/src/assets/images/templates/qr-code.tsx +13 -0
  88. package/src/assets/images/templates/real-penned-letters.tsx +57 -0
  89. package/src/assets/images/templates/right-arrow.svg +17 -0
  90. package/src/assets/images/templates/size-image-lg.tsx +20 -0
  91. package/src/assets/images/templates/size-image-mid.tsx +20 -0
  92. package/src/assets/images/templates/size-image-xl.tsx +20 -0
  93. package/src/assets/images/templates/size-image.tsx +20 -0
  94. package/src/assets/images/templates/snap-pack.tsx +67 -0
  95. package/src/assets/images/templates/template-default-design.tsx +21 -0
  96. package/src/assets/images/templates/trash-upload.svg +3 -0
  97. package/src/assets/images/templates/trash.svg +3 -0
  98. package/src/assets/images/templates/tri-fold-self-mailers.tsx +93 -0
  99. package/src/assets/images/templates/upload-image.svg +10 -0
  100. package/src/assets/images/templates/x.svg +3 -0
  101. package/src/assets/images/thumbnails/one.svg +9 -0
  102. package/src/assets/images/tooltip/tool-arrow.tsx +25 -0
  103. package/src/components/CreateTemplate/V2/index.tsx +525 -0
  104. package/src/components/CreateTemplate/V2/styles.scss +372 -0
  105. package/src/components/CreateTemplate/index.tsx +508 -0
  106. package/src/components/CreateTemplate/styles.scss +404 -0
  107. package/src/components/GenericUIBlocks/Button/index.tsx +54 -0
  108. package/src/components/GenericUIBlocks/Button/styles.scss +43 -0
  109. package/src/components/GenericUIBlocks/CircularProgress/index.tsx +18 -0
  110. package/src/components/GenericUIBlocks/CircularProgress/styles.scss +93 -0
  111. package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +88 -0
  112. package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +19 -0
  113. package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +227 -0
  114. package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +289 -0
  115. package/src/components/GenericUIBlocks/Dialog/index.tsx +185 -0
  116. package/src/components/GenericUIBlocks/Dialog/styles.scss +227 -0
  117. package/src/components/GenericUIBlocks/Divider/index.tsx +12 -0
  118. package/src/components/GenericUIBlocks/Divider/styles.scss +7 -0
  119. package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +114 -0
  120. package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +406 -0
  121. package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +25 -0
  122. package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +20 -0
  123. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +91 -0
  124. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +92 -0
  125. package/src/components/GenericUIBlocks/Grid/index.tsx +82 -0
  126. package/src/components/GenericUIBlocks/Input/index.tsx +269 -0
  127. package/src/components/GenericUIBlocks/Input/styles.scss +332 -0
  128. package/src/components/GenericUIBlocks/Tabs/index.tsx +71 -0
  129. package/src/components/GenericUIBlocks/Tabs/styles.scss +42 -0
  130. package/src/components/GenericUIBlocks/Typography/index.tsx +18 -0
  131. package/src/components/GenericUIBlocks/Typography/styles.scss +27 -0
  132. package/src/components/SidePanel/CustomAddOns/index.tsx +342 -0
  133. package/src/components/SidePanel/CustomAddOns/styles.scss +86 -0
  134. package/src/components/SidePanel/CustomBlockColors/index.tsx +211 -0
  135. package/src/components/SidePanel/CustomBlockColors/styles.scss +80 -0
  136. package/src/components/SidePanel/CustomFields/customFieldSection.tsx +547 -0
  137. package/src/components/SidePanel/CustomFields/styles.scss +64 -0
  138. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +172 -0
  139. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +46 -0
  140. package/src/components/SidePanel/CustomQRCode/index.tsx +1070 -0
  141. package/src/components/SidePanel/CustomQRCode/styles.scss +149 -0
  142. package/src/components/SidePanel/CustomUploads/V2/index.tsx +542 -0
  143. package/src/components/SidePanel/CustomUploads/V2/styles.scss +267 -0
  144. package/src/components/SidePanel/CustomUploads/index.tsx +301 -0
  145. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +424 -0
  146. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +180 -0
  147. package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +235 -0
  148. package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +244 -0
  149. package/src/components/SidePanel/Templates/ModalGallery/index.tsx +231 -0
  150. package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +233 -0
  151. package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +152 -0
  152. package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +149 -0
  153. package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +156 -0
  154. package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +160 -0
  155. package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +98 -0
  156. package/src/components/SidePanel/Templates/customTemplateSection.tsx +793 -0
  157. package/src/components/SidePanel/Templates/styles.scss +244 -0
  158. package/src/components/SidePanel/index.tsx +160 -0
  159. package/src/components/TemplateBuilder/index.tsx +585 -0
  160. package/src/components/TemplateBuilder/styles.scss +100 -0
  161. package/src/components/TemplateTypes/index.tsx +96 -0
  162. package/src/components/TemplateTypes/styles.scss +91 -0
  163. package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +81 -0
  164. package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +123 -0
  165. package/src/components/TopNavigation/DuplicateTemplateModal.tsx +103 -0
  166. package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +71 -0
  167. package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +88 -0
  168. package/src/components/TopNavigation/SaveTemplateModel/index.tsx +201 -0
  169. package/src/components/TopNavigation/SaveTemplateModel/styles.scss +128 -0
  170. package/src/components/TopNavigation/index.tsx +938 -0
  171. package/src/components/TopNavigation/styles.scss +303 -0
  172. package/src/importMeta.d.ts +31 -0
  173. package/src/index.scss +131 -0
  174. package/src/index.tsx +238 -0
  175. package/src/libs/test.ts +7 -0
  176. package/src/redux/actions/action-types.ts +52 -0
  177. package/src/redux/actions/customQRCodeActions.ts +54 -0
  178. package/src/redux/actions/snackbarActions.ts +16 -0
  179. package/src/redux/actions/templateActions.ts +236 -0
  180. package/src/redux/reducers/customFieldReducer.ts +99 -0
  181. package/src/redux/reducers/customQRCodeReducer.ts +58 -0
  182. package/src/redux/reducers/index.ts +15 -0
  183. package/src/redux/reducers/snackbarReducer.ts +40 -0
  184. package/src/redux/reducers/templateReducer.ts +485 -0
  185. package/src/redux/store.ts +18 -0
  186. package/src/styles/colors.scss +61 -0
  187. package/src/test/mocks.js +89 -0
  188. package/src/test/setupJest.js +1 -0
  189. package/src/utils/api.ts +36 -0
  190. package/src/utils/constants.ts +182 -0
  191. package/src/utils/customStyles.ts +45 -0
  192. package/src/utils/fetchWrapper.ts +73 -0
  193. package/src/utils/fonts.json +1597 -0
  194. package/src/utils/helper.ts +205 -0
  195. package/src/utils/local-storage.ts +15 -0
  196. package/src/utils/message.ts +162 -0
  197. package/src/utils/products.ts +186 -0
  198. package/src/utils/template-builder.ts +328 -0
  199. package/src/utils/templateIdentifierArea/biFold.ts +107 -0
  200. package/src/utils/templateIdentifierArea/index.ts +35 -0
  201. package/src/utils/templateIdentifierArea/personal.ts +107 -0
  202. package/src/utils/templateIdentifierArea/postCards.ts +163 -0
  203. package/src/utils/templateIdentifierArea/professional.ts +125 -0
  204. package/src/utils/templateIdentifierArea/snapPack.ts +107 -0
  205. package/src/utils/templateIdentifierArea/triFold.ts +107 -0
  206. package/src/utils/templateRestrictedArea/biFold.ts +329 -0
  207. package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +90 -0
  208. package/src/utils/templateRestrictedArea/personal.ts +90 -0
  209. package/src/utils/templateRestrictedArea/postCard.ts +334 -0
  210. package/src/utils/templateRestrictedArea/postCardJumbo.tsx +408 -0
  211. package/src/utils/templateRestrictedArea/professional.ts +318 -0
  212. package/src/utils/templateRestrictedArea/realPenned.ts +233 -0
  213. package/src/utils/templateRestrictedArea/snapPack.ts +1009 -0
  214. package/src/utils/templateRestrictedArea/triFold.ts +330 -0
  215. package/src/utils/templateSafetyBorders/biFold.ts +91 -0
  216. package/src/utils/templateSafetyBorders/index.ts +43 -0
  217. package/src/utils/templateSafetyBorders/personal.ts +41 -0
  218. package/src/utils/templateSafetyBorders/postCards.ts +259 -0
  219. package/src/utils/templateSafetyBorders/professional.ts +78 -0
  220. package/src/utils/templateSafetyBorders/snapPack.ts +165 -0
  221. package/src/utils/templateSafetyBorders/triFold.ts +114 -0
  222. package/src/utils/templateSafetyBorders/types.d.ts +68 -0
  223. package/src/utils/types.ts +12 -0
  224. package/src/v2Theme.scss +142 -0
  225. package/tsconfig.json +29 -0
  226. package/tsconfig.node.json +12 -0
  227. package/update-version.js +23 -0
  228. package/version.js +1 -0
  229. package/vite.config.ts +8 -0
  230. package/webpack.config.js +80 -0
@@ -0,0 +1,1009 @@
1
+ // Define the type for the element being added
2
+ interface Element {
3
+ id: string;
4
+ type: string;
5
+ name: string;
6
+ opacity: number;
7
+ visible: boolean;
8
+ selectable: boolean;
9
+ removable: boolean;
10
+ alwaysOnTop: boolean;
11
+ showInExport: boolean;
12
+ x: number;
13
+ y: number;
14
+ width: number;
15
+ height: number;
16
+ rotation: number;
17
+ animations?: any[];
18
+ blurEnabled?: boolean;
19
+ blurRadius?: number;
20
+ brightnessEnabled?: boolean;
21
+ brightness?: number;
22
+ sepiaEnabled?: boolean;
23
+ grayscaleEnabled?: boolean;
24
+ shadowEnabled?: boolean;
25
+ shadowBlur?: number;
26
+ shadowOffsetX?: number;
27
+ shadowOffsetY?: number;
28
+ shadowColor?: string;
29
+ shadowOpacity?: number;
30
+ draggable?: boolean;
31
+ resizable?: boolean;
32
+ contentEditable: boolean;
33
+ styleEditable: boolean;
34
+ subType?: string;
35
+ fill?: string;
36
+ dash?: any[];
37
+ custom?: any;
38
+ strokeWidth?: number;
39
+ stroke?: string;
40
+ cornerRadius?: number;
41
+ text?: string;
42
+ placeholder?: string;
43
+ fontSize?: number;
44
+ fontFamily?: string;
45
+ fontStyle?: string;
46
+ fontWeight?: string;
47
+ textDecoration?: string;
48
+ align?: string;
49
+ verticalAlign?: string;
50
+ lineHeight?: number;
51
+ letterSpacing?: number;
52
+ backgroundEnabled?: boolean;
53
+ backgroundColor?: string;
54
+ backgroundOpacity?: number;
55
+ backgroundCornerRadius?: number;
56
+ backgroundPadding?: number;
57
+ src?: string;
58
+ cropX?: number;
59
+ cropY?: number;
60
+ cropWidth?: number;
61
+ cropHeight?: number;
62
+ flipX?: boolean;
63
+ flipY?: boolean;
64
+ clipSrc?: string;
65
+ borderSize?: number;
66
+ keepRatio?: boolean;
67
+ }
68
+
69
+ // Define the type for the page
70
+ interface Page {
71
+ addElement: (element: Element) => void;
72
+ }
73
+
74
+ // Define the type for the store
75
+ interface Store {
76
+ width: number;
77
+ height: number;
78
+ pages: Page[];
79
+ history: {
80
+ clear: () => void;
81
+ };
82
+ }
83
+
84
+ export const addRestrictedAreaToSnapPackMailer = (store: Store, barcodeSrc: string): void => {
85
+ const page = store.pages[0];
86
+ const pageTwo = store.pages[1];
87
+
88
+ const elements: Element[] = [
89
+ {
90
+ id: "left-p1",
91
+ type: "figure",
92
+ name: "left-p1",
93
+ opacity: 1,
94
+ visible: true,
95
+ selectable: false,
96
+ removable: false,
97
+ alwaysOnTop: true,
98
+ showInExport: true,
99
+ x: 2.930e-14,
100
+ y: -1.42e-14,
101
+ width: 23.83,
102
+ height: 1062.31,
103
+ rotation: 0,
104
+ animations: [],
105
+ blurEnabled: false,
106
+ blurRadius: 10,
107
+ brightnessEnabled: false,
108
+ brightness: 0,
109
+ sepiaEnabled: false,
110
+ grayscaleEnabled: false,
111
+ shadowEnabled: false,
112
+ shadowBlur: 5,
113
+ shadowOffsetX: 0,
114
+ shadowOffsetY: 0,
115
+ shadowColor: "black",
116
+ shadowOpacity: 1,
117
+ draggable: false,
118
+ resizable: false,
119
+ contentEditable: false,
120
+ styleEditable: false,
121
+ subType: "rect",
122
+ fill: "rgba(255,255,255,1)",
123
+ dash: [],
124
+ strokeWidth: 0,
125
+ stroke: "#0c0c0c",
126
+ cornerRadius: 0
127
+ },
128
+ {
129
+ id: "right-p1",
130
+ type: "figure",
131
+ name: "right-p1",
132
+ opacity: 1,
133
+ visible: true,
134
+ selectable: false,
135
+ removable: false,
136
+ alwaysOnTop: true,
137
+ showInExport: true,
138
+ x: 792.166,
139
+ y: 11.809,
140
+ width: 23.83,
141
+ height: 1062.31,
142
+ rotation: 0,
143
+ animations: [],
144
+ blurEnabled: false,
145
+ blurRadius: 10,
146
+ brightnessEnabled: false,
147
+ brightness: 0,
148
+ sepiaEnabled: false,
149
+ grayscaleEnabled: false,
150
+ shadowEnabled: false,
151
+ shadowBlur: 5,
152
+ shadowOffsetX: 0,
153
+ shadowOffsetY: 0,
154
+ shadowColor: "black",
155
+ shadowOpacity: 1,
156
+ draggable: false,
157
+ resizable: false,
158
+ contentEditable: false,
159
+ styleEditable: false,
160
+ subType: "rect",
161
+ fill: "rgba(255,255,255,1)",
162
+ dash: [],
163
+ strokeWidth: 0,
164
+ stroke: "#0c0c0c",
165
+ cornerRadius: 0
166
+ },
167
+ {
168
+ id: "top-p1",
169
+ type: "figure",
170
+ name: "top-p1",
171
+ opacity: 1,
172
+ visible: true,
173
+ selectable: false,
174
+ removable: false,
175
+ alwaysOnTop: true,
176
+ showInExport: true,
177
+ x: 938.95,
178
+ y: -0.1065,
179
+ width: 23.833,
180
+ height: 1062.31,
181
+ rotation: 90,
182
+ animations: [],
183
+ blurEnabled: false,
184
+ blurRadius: 10,
185
+ brightnessEnabled: false,
186
+ brightness: 0,
187
+ sepiaEnabled: false,
188
+ grayscaleEnabled: false,
189
+ shadowEnabled: false,
190
+ shadowBlur: 5,
191
+ shadowOffsetX: 0,
192
+ shadowOffsetY: 0,
193
+ shadowColor: "black",
194
+ shadowOpacity: 1,
195
+ draggable: false,
196
+ resizable: false,
197
+ contentEditable: false,
198
+ styleEditable: false,
199
+ subType: "rect",
200
+ fill: "rgba(255,255,255,1)",
201
+ dash: [],
202
+ strokeWidth: 0,
203
+ stroke: "#0c0c0c",
204
+ cornerRadius: 0
205
+ },
206
+ {
207
+ id: "bottom-p1",
208
+ type: "figure",
209
+ name: "bottom-p1",
210
+ opacity: 1,
211
+ visible: true,
212
+ selectable: false,
213
+ removable: false,
214
+ alwaysOnTop: true,
215
+ showInExport: true,
216
+ x: 920.867,
217
+ y: 1031.583,
218
+ width: 23.83,
219
+ height: 1062.31,
220
+ rotation: 90,
221
+ animations: [],
222
+ blurEnabled: false,
223
+ blurRadius: 10,
224
+ brightnessEnabled: false,
225
+ brightness: 0,
226
+ sepiaEnabled: false,
227
+ grayscaleEnabled: false,
228
+ shadowEnabled: false,
229
+ shadowBlur: 5,
230
+ shadowOffsetX: 0,
231
+ shadowOffsetY: 0,
232
+ shadowColor: "black",
233
+ shadowOpacity: 1,
234
+ draggable: false,
235
+ resizable: false,
236
+ contentEditable: false,
237
+ styleEditable: false,
238
+ subType: "rect",
239
+ fill: "rgba(255,255,255,1)",
240
+ dash: [],
241
+ strokeWidth: 0,
242
+ stroke: "#0c0c0c",
243
+ cornerRadius: 0
244
+ },
245
+ {
246
+ id: "mailing-address-window-box-1",
247
+ type: "figure",
248
+ name: "mailing-address-window-box-1",
249
+ opacity: 1,
250
+ visible: true,
251
+ selectable: false,
252
+ removable: false,
253
+ alwaysOnTop: true,
254
+ showInExport: true,
255
+ x: 60,
256
+ y: 375,
257
+ width: 360,
258
+ height: 185,
259
+ rotation: 0,
260
+ animations: [],
261
+ blurEnabled: false,
262
+ blurRadius: 10,
263
+ brightnessEnabled: false,
264
+ brightness: 0,
265
+ sepiaEnabled: false,
266
+ grayscaleEnabled: false,
267
+ shadowEnabled: false,
268
+ shadowBlur: 5,
269
+ shadowOffsetX: 0,
270
+ shadowOffsetY: 0,
271
+ shadowColor: "black",
272
+ shadowOpacity: 1,
273
+ draggable: false,
274
+ resizable: false,
275
+ contentEditable: false,
276
+ styleEditable: false,
277
+ subType: "rect",
278
+ fill: "rgba(233,233,233,1)",
279
+ dash: [],
280
+ strokeWidth: 0,
281
+ stroke: "#0c0c0c",
282
+ cornerRadius: 16,
283
+ custom: {
284
+ replaceBg: true,
285
+ preFill: "rgba(233,233,233,1)",
286
+ postFill: "white"
287
+ },
288
+ },
289
+ {
290
+ id: "mailing-address-window-text-1",
291
+ type: "text",
292
+ name: "mailing-address",
293
+ opacity: 1,
294
+ visible: true,
295
+ selectable: false,
296
+ removable: false,
297
+ alwaysOnTop: true,
298
+ showInExport: false,
299
+ x: 35,
300
+ y: 455,
301
+ width: 408,
302
+ height: 31,
303
+ rotation: 0,
304
+ animations: [],
305
+ blurEnabled: false,
306
+ blurRadius: 10,
307
+ brightnessEnabled: false,
308
+ brightness: 0,
309
+ sepiaEnabled: false,
310
+ grayscaleEnabled: false,
311
+ shadowEnabled: false,
312
+ shadowBlur: 5,
313
+ shadowOffsetX: 0,
314
+ shadowOffsetY: 0,
315
+ shadowColor: "black",
316
+ shadowOpacity: 1,
317
+ draggable: false,
318
+ resizable: false,
319
+ contentEditable: false,
320
+ styleEditable: false,
321
+ text: "Mailing Address Window",
322
+ placeholder: "",
323
+ fontSize: 25,
324
+ fontFamily: "Roboto",
325
+ fontStyle: "italic",
326
+ fontWeight: "normal",
327
+ textDecoration: "",
328
+ fill: "black",
329
+ align: "center",
330
+ verticalAlign: "top",
331
+ strokeWidth: 0,
332
+ stroke: "black",
333
+ lineHeight: 1.2,
334
+ letterSpacing: 0,
335
+ backgroundEnabled: false,
336
+ backgroundColor: "#7ED321",
337
+ backgroundOpacity: 1,
338
+ backgroundCornerRadius: 0.5,
339
+ backgroundPadding: 0.5
340
+ },
341
+ {
342
+ id: "recipient-address-area",
343
+ type: "figure",
344
+ name: "recipient-address-area",
345
+ opacity: 1,
346
+ visible: true,
347
+ selectable: false,
348
+ removable: false,
349
+ alwaysOnTop: true,
350
+ showInExport: true,
351
+ custom: {
352
+ replaceBg: true,
353
+ preFill: 'rgba(193,193,193,1)'
354
+ },
355
+ x: 96.48,
356
+ y: 893.82,
357
+ width: 286.86,
358
+ height: 97.13,
359
+ rotation: 0,
360
+ animations: [],
361
+ blurEnabled: false,
362
+ blurRadius: 10,
363
+ brightnessEnabled: false,
364
+ brightness: 0,
365
+ sepiaEnabled: false,
366
+ grayscaleEnabled: false,
367
+ shadowEnabled: false,
368
+ shadowBlur: 5,
369
+ shadowOffsetX: 0,
370
+ shadowOffsetY: 0,
371
+ shadowColor: "black",
372
+ shadowOpacity: 1,
373
+ draggable: true,
374
+ resizable: true,
375
+ contentEditable: true,
376
+ styleEditable: true,
377
+ subType: "rect",
378
+ fill: "rgba(193,193,193,1)",
379
+ dash: [],
380
+ strokeWidth: 1,
381
+ stroke: "#0c0c0c",
382
+ cornerRadius: 16
383
+ },
384
+ {
385
+ id: 'recipient-address-box',
386
+ type: 'figure',
387
+ name: 'recipient-address-box',
388
+ opacity: 1,
389
+ visible: true,
390
+ selectable: false,
391
+ removable: false,
392
+ alwaysOnTop: true,
393
+ showInExport: true,
394
+ x: 107,
395
+ y: 917,
396
+ width: 255,
397
+ height: 63,
398
+ rotation: 0,
399
+ animations: [],
400
+ blurEnabled: false,
401
+ blurRadius: 10,
402
+ brightnessEnabled: false,
403
+ brightness: 0,
404
+ sepiaEnabled: false,
405
+ grayscaleEnabled: false,
406
+ shadowEnabled: false,
407
+ shadowBlur: 5,
408
+ shadowOffsetX: 0,
409
+ shadowOffsetY: 0,
410
+ shadowColor: 'black',
411
+ shadowOpacity: 1,
412
+ draggable: false,
413
+ resizable: false,
414
+ contentEditable: false,
415
+ styleEditable: false,
416
+ subType: 'rect',
417
+ fill: 'white',
418
+ dash: [],
419
+ strokeWidth: 0,
420
+ stroke: '#0c0c0c',
421
+ cornerRadius: 0,
422
+ },
423
+ {
424
+ id: 'recipient-address',
425
+ type: 'text',
426
+ name: 'recipient-address-text',
427
+ opacity: 1,
428
+ visible: true,
429
+ selectable: false,
430
+ removable: false,
431
+ alwaysOnTop: true,
432
+ showInExport: true,
433
+ x: 112,
434
+ y: 920.08,
435
+ width: 250,
436
+ height: 63,
437
+ rotation: 0,
438
+ animations: [],
439
+ blurEnabled: false,
440
+ blurRadius: 10,
441
+ brightnessEnabled: false,
442
+ brightness: 0,
443
+ sepiaEnabled: false,
444
+ grayscaleEnabled: false,
445
+ shadowEnabled: false,
446
+ shadowBlur: 5,
447
+ shadowOffsetX: 0,
448
+ shadowOffsetY: 0,
449
+ shadowColor: 'black',
450
+ shadowOpacity: 1,
451
+ draggable: false,
452
+ resizable: false,
453
+ contentEditable: true,
454
+ styleEditable: true,
455
+ text: 'RECIPIENT ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
456
+ placeholder: '',
457
+ fontSize: 12,
458
+ fontFamily: 'Roboto',
459
+ fontStyle: 'normal',
460
+ fontWeight: 'normal',
461
+ textDecoration: '',
462
+ fill: 'black',
463
+ align: 'start',
464
+ verticalAlign: 'top',
465
+ strokeWidth: 0,
466
+ stroke: 'black',
467
+ lineHeight: 1.2,
468
+ letterSpacing: 0,
469
+ backgroundEnabled: false,
470
+ backgroundColor: '#FFFFFF',
471
+ backgroundOpacity: 1,
472
+ backgroundCornerRadius: 0.5,
473
+ backgroundPadding: 0.5,
474
+ },
475
+ ];
476
+
477
+ const elementsForSecondPage: Element[] = [
478
+ {
479
+ id: "left-p2",
480
+ type: "figure",
481
+ name: "left-p2",
482
+ opacity: 1,
483
+ visible: true,
484
+ selectable: false,
485
+ removable: false,
486
+ alwaysOnTop: true,
487
+ showInExport: true,
488
+ x: 1,
489
+ y: -6.3,
490
+ width: 21.83,
491
+ height: 1062.31,
492
+ rotation: 0,
493
+ animations: [],
494
+ blurEnabled: false,
495
+ blurRadius: 10,
496
+ brightnessEnabled: false,
497
+ brightness: 0,
498
+ sepiaEnabled: false,
499
+ grayscaleEnabled: false,
500
+ shadowEnabled: false,
501
+ shadowBlur: 5,
502
+ shadowOffsetX: 0,
503
+ shadowOffsetY: 0,
504
+ shadowColor: "black",
505
+ shadowOpacity: 1,
506
+ draggable: false,
507
+ resizable: false,
508
+ contentEditable: false,
509
+ styleEditable: false,
510
+ subType: "rect",
511
+ fill: "rgba(255,255,255,1)",
512
+ dash: [],
513
+ strokeWidth: 0,
514
+ stroke: "#0c0c0c",
515
+ cornerRadius: 0
516
+ },
517
+ {
518
+ id: "right-p2",
519
+ type: "figure",
520
+ name: "right-p2",
521
+ opacity: 1,
522
+ visible: true,
523
+ selectable: false,
524
+ removable: false,
525
+ alwaysOnTop: true,
526
+ showInExport: true,
527
+ x: 792.16,
528
+ y: -1.421e-14,
529
+ width: 23.83,
530
+ height: 1062.31,
531
+ rotation: 0,
532
+ animations: [],
533
+ blurEnabled: false,
534
+ blurRadius: 10,
535
+ brightnessEnabled: false,
536
+ brightness: 0,
537
+ sepiaEnabled: false,
538
+ grayscaleEnabled: false,
539
+ shadowEnabled: false,
540
+ shadowBlur: 5,
541
+ shadowOffsetX: 0,
542
+ shadowOffsetY: 0,
543
+ shadowColor: "black",
544
+ shadowOpacity: 1,
545
+ draggable: false,
546
+ resizable: false,
547
+ contentEditable: false,
548
+ styleEditable: false,
549
+ subType: "rect",
550
+ fill: "rgba(255,255,255,1)",
551
+ dash: [],
552
+ strokeWidth: 0,
553
+ stroke: "#0c0c0c",
554
+ cornerRadius: 0
555
+ },
556
+ {
557
+ id: "top-p2",
558
+ type: "figure",
559
+ name: "top-p2",
560
+ opacity: 1,
561
+ visible: true,
562
+ selectable: false,
563
+ removable: false,
564
+ alwaysOnTop: true,
565
+ showInExport: true,
566
+ x: 913.84,
567
+ y: -0.1065,
568
+ width: 23.83,
569
+ height: 1062.31,
570
+ rotation: 90,
571
+ animations: [],
572
+ blurEnabled: false,
573
+ blurRadius: 10,
574
+ brightnessEnabled: false,
575
+ brightness: 0,
576
+ sepiaEnabled: false,
577
+ grayscaleEnabled: false,
578
+ shadowEnabled: false,
579
+ shadowBlur: 5,
580
+ shadowOffsetX: 0,
581
+ shadowOffsetY: 0,
582
+ shadowColor: "black",
583
+ shadowOpacity: 1,
584
+ draggable: false,
585
+ resizable: false,
586
+ contentEditable: false,
587
+ styleEditable: false,
588
+ subType: "rect",
589
+ fill: "rgba(255,255,255,1)",
590
+ dash: [],
591
+ strokeWidth: 0,
592
+ stroke: "#0c0c0c",
593
+ cornerRadius: 0
594
+ },
595
+ {
596
+ id: "bottom-p2",
597
+ type: "figure",
598
+ name: "bottom-p2",
599
+ opacity: 1,
600
+ visible: true,
601
+ selectable: false,
602
+ removable: false,
603
+ alwaysOnTop: true,
604
+ showInExport: true,
605
+ x: 895.68,
606
+ y: 1030,
607
+ width: 25.99,
608
+ height: 1062.31,
609
+ rotation: 90,
610
+ animations: [],
611
+ blurEnabled: false,
612
+ blurRadius: 10,
613
+ brightnessEnabled: false,
614
+ brightness: 0,
615
+ sepiaEnabled: false,
616
+ grayscaleEnabled: false,
617
+ shadowEnabled: false,
618
+ shadowBlur: 5,
619
+ shadowOffsetX: 0,
620
+ shadowOffsetY: 0,
621
+ shadowColor: "black",
622
+ shadowOpacity: 1,
623
+ draggable: false,
624
+ resizable: false,
625
+ contentEditable: false,
626
+ styleEditable: false,
627
+ subType: "rect",
628
+ fill: "rgba(255,255,255,1)",
629
+ dash: [],
630
+ strokeWidth: 0,
631
+ stroke: "#0c0c0c",
632
+ cornerRadius: 0
633
+ },
634
+ {
635
+ id: "return-address-box",
636
+ type: "figure",
637
+ name: "return-address-box",
638
+ opacity: 1,
639
+ visible: true,
640
+ selectable: false,
641
+ removable: false,
642
+ alwaysOnTop: true,
643
+ showInExport: true,
644
+ custom: {
645
+ replaceBg: true,
646
+ preFill: 'rgba(242,242,242,1)'
647
+ },
648
+ x: 720,
649
+ y: 690,
650
+ width: 284.86,
651
+ height: 76.09,
652
+ rotation: 180,
653
+ animations: [],
654
+ blurEnabled: false,
655
+ blurRadius: 10,
656
+ brightnessEnabled: false,
657
+ brightness: 0,
658
+ sepiaEnabled: false,
659
+ grayscaleEnabled: false,
660
+ shadowEnabled: false,
661
+ shadowBlur: 5,
662
+ shadowOffsetX: 0,
663
+ shadowOffsetY: 0,
664
+ shadowColor: "black",
665
+ shadowOpacity: 1,
666
+ draggable: false,
667
+ resizable: false,
668
+ contentEditable: false,
669
+ styleEditable: false,
670
+ subType: "rect",
671
+ fill: "rgba(242,242,242,1)",
672
+ dash: [],
673
+ strokeWidth: 0,
674
+ stroke: "#0c0c0c",
675
+ cornerRadius: 12
676
+ },
677
+ {
678
+ id: 'return-address',
679
+ type: 'text',
680
+ name: 'return-address',
681
+ opacity: 1,
682
+ visible: true,
683
+ selectable: false,
684
+ removable: false,
685
+ alwaysOnTop: true,
686
+ showInExport: true,
687
+ x: 710,
688
+ y: 680,
689
+ width: 250,
690
+ height: 63,
691
+ rotation: 180,
692
+ animations: [],
693
+ blurEnabled: false,
694
+ blurRadius: 10,
695
+ brightnessEnabled: false,
696
+ brightness: 0,
697
+ sepiaEnabled: false,
698
+ grayscaleEnabled: false,
699
+ shadowEnabled: false,
700
+ shadowBlur: 5,
701
+ shadowOffsetX: 0,
702
+ shadowOffsetY: 0,
703
+ shadowColor: 'black',
704
+ shadowOpacity: 1,
705
+ draggable: false,
706
+ resizable: false,
707
+ contentEditable: false,
708
+ styleEditable: false,
709
+ text: 'YOUR RETURN ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
710
+ placeholder: '',
711
+ fontSize: 10,
712
+ fontFamily: 'Roboto',
713
+ fontStyle: 'normal',
714
+ fontWeight: 'normal',
715
+ textDecoration: '',
716
+ fill: 'black',
717
+ align: 'start',
718
+ verticalAlign: 'top',
719
+ strokeWidth: 0,
720
+ stroke: 'black',
721
+ lineHeight: 1.2,
722
+ letterSpacing: 0,
723
+ backgroundEnabled: false,
724
+ backgroundColor: '#FFFFFF',
725
+ backgroundOpacity: 1,
726
+ backgroundCornerRadius: 0.5,
727
+ backgroundPadding: 0.5,
728
+ },
729
+ {
730
+ id: "postage-indicia-box",
731
+ type: "figure",
732
+ name: "postage-indicia-box",
733
+ opacity: 1,
734
+ visible: true,
735
+ selectable: false,
736
+ removable: false,
737
+ alwaysOnTop: true,
738
+ showInExport: true,
739
+ custom: {
740
+ replaceBg: true,
741
+ preFill: 'rgba(243,243,243,1)'
742
+ },
743
+ x: 192,
744
+ y: 685,
745
+ width: 137,
746
+ height: 74.8,
747
+ rotation: 180,
748
+ animations: [],
749
+ blurEnabled: false,
750
+ blurRadius: 10,
751
+ brightnessEnabled: false,
752
+ brightness: 0,
753
+ sepiaEnabled: false,
754
+ grayscaleEnabled: false,
755
+ shadowEnabled: false,
756
+ shadowBlur: 5,
757
+ shadowOffsetX: 0,
758
+ shadowOffsetY: 0,
759
+ shadowColor: "black",
760
+ shadowOpacity: 1,
761
+ draggable: false,
762
+ resizable: false,
763
+ contentEditable: false,
764
+ styleEditable: false,
765
+ subType: "rect",
766
+ fill: "rgba(243,243,243,1)",
767
+ dash: [],
768
+ strokeWidth: 0,
769
+ stroke: "#0c0c0c",
770
+ cornerRadius: 12
771
+ },
772
+ {
773
+ id: 'indicia',
774
+ type: 'text',
775
+ name: 'indicia',
776
+ opacity: 1,
777
+ visible: true,
778
+ selectable: false,
779
+ removable: false,
780
+ alwaysOnTop: true,
781
+ showInExport: true,
782
+ x: 175,
783
+ y: 668,
784
+ width: 111,
785
+ height: 40,
786
+ rotation: 180,
787
+ animations: [],
788
+ blurEnabled: false,
789
+ blurRadius: 10,
790
+ brightnessEnabled: false,
791
+ brightness: 0,
792
+ sepiaEnabled: false,
793
+ grayscaleEnabled: false,
794
+ shadowEnabled: false,
795
+ shadowBlur: 5,
796
+ shadowOffsetX: 0,
797
+ shadowOffsetY: 0,
798
+ shadowColor: 'black',
799
+ shadowOpacity: 1,
800
+ draggable: false,
801
+ resizable: false,
802
+ contentEditable: false,
803
+ styleEditable: false,
804
+ text: `POSTAGE\nINDICIA`,
805
+ placeholder: '',
806
+ fontSize: 18,
807
+ fontFamily: 'Roboto',
808
+ fontStyle: 'normal',
809
+ fontWeight: 'normal',
810
+ textDecoration: '',
811
+ fill: 'black',
812
+ align: 'center',
813
+ verticalAlign: 'top',
814
+ strokeWidth: 0,
815
+ stroke: 'black',
816
+ lineHeight: 1.2,
817
+ letterSpacing: 0,
818
+ backgroundEnabled: false,
819
+ backgroundColor: '#7ED321',
820
+ backgroundOpacity: 1,
821
+ backgroundCornerRadius: 0.5,
822
+ backgroundPadding: 0.5,
823
+ },
824
+ {
825
+ id: "mailing-address-window-box-2",
826
+ type: "figure",
827
+ name: "mailing-address-window-box-2",
828
+ opacity: 1,
829
+ visible: true,
830
+ selectable: false,
831
+ removable: false,
832
+ alwaysOnTop: true,
833
+ showInExport: true,
834
+ x: 400,
835
+ y: 365,
836
+ width: 360,
837
+ height: 185,
838
+ rotation: 0,
839
+ animations: [],
840
+ blurEnabled: false,
841
+ blurRadius: 10,
842
+ brightnessEnabled: false,
843
+ brightness: 0,
844
+ sepiaEnabled: false,
845
+ grayscaleEnabled: false,
846
+ shadowEnabled: false,
847
+ shadowBlur: 5,
848
+ shadowOffsetX: 0,
849
+ shadowOffsetY: 0,
850
+ shadowColor: "black",
851
+ shadowOpacity: 1,
852
+ draggable: false,
853
+ resizable: false,
854
+ contentEditable: false,
855
+ styleEditable: false,
856
+ subType: "rect",
857
+ fill: "rgba(240,240,240,1)",
858
+ dash: [],
859
+ strokeWidth: 0,
860
+ stroke: "#0c0c0c",
861
+ cornerRadius: 16,
862
+ custom: {
863
+ replaceBg: true,
864
+ preFill: "rgba(233,233,233,1)",
865
+ postFill: "white"
866
+ },
867
+ },
868
+ {
869
+ id: "mailing-address-window-text-2",
870
+ type: "text",
871
+ name: "mailing-address",
872
+ opacity: 1,
873
+ visible: true,
874
+ selectable: false,
875
+ removable: false,
876
+ alwaysOnTop: true,
877
+ showInExport: false,
878
+ x: 780,
879
+ y: 475,
880
+ width: 408,
881
+ height: 31,
882
+ rotation: 180,
883
+ animations: [],
884
+ blurEnabled: false,
885
+ blurRadius: 10,
886
+ brightnessEnabled: false,
887
+ brightness: 0,
888
+ sepiaEnabled: false,
889
+ grayscaleEnabled: false,
890
+ shadowEnabled: false,
891
+ shadowBlur: 5,
892
+ shadowOffsetX: 0,
893
+ shadowOffsetY: 0,
894
+ shadowColor: "black",
895
+ shadowOpacity: 1,
896
+ draggable: false,
897
+ resizable: false,
898
+ contentEditable: false,
899
+ styleEditable: false,
900
+ text: "Mailing Address Window",
901
+ placeholder: "",
902
+ fontSize: 25,
903
+ fontFamily: "Roboto",
904
+ fontStyle: "italic",
905
+ fontWeight: "normal",
906
+ textDecoration: "",
907
+ fill: "black",
908
+ align: "center",
909
+ verticalAlign: "top",
910
+ strokeWidth: 0,
911
+ stroke: "black",
912
+ lineHeight: 1.2,
913
+ letterSpacing: 0,
914
+ backgroundEnabled: false,
915
+ backgroundColor: "#7ED321",
916
+ backgroundOpacity: 1,
917
+ backgroundCornerRadius: 0.5,
918
+ backgroundPadding: 0.5
919
+ },
920
+ {
921
+ id: "barcode-box",
922
+ type: "figure",
923
+ name: "barcode-box",
924
+ opacity: 1,
925
+ visible: true,
926
+ selectable: false,
927
+ removable: false,
928
+ alwaysOnTop: true,
929
+ showInExport: true,
930
+ custom: {
931
+ replaceBg: true,
932
+ preFill: 'rgba(244,244,244,1)'
933
+ },
934
+ x: 375,
935
+ y: 435,
936
+ width: 319,
937
+ height: 65,
938
+ rotation: 180,
939
+ animations: [],
940
+ blurEnabled: false,
941
+ blurRadius: 10,
942
+ brightnessEnabled: false,
943
+ brightness: 0,
944
+ sepiaEnabled: false,
945
+ grayscaleEnabled: false,
946
+ shadowEnabled: false,
947
+ shadowBlur: 5,
948
+ shadowOffsetX: 0,
949
+ shadowOffsetY: 0,
950
+ shadowColor: "black",
951
+ shadowOpacity: 1,
952
+ draggable: false,
953
+ resizable: false,
954
+ contentEditable: false,
955
+ styleEditable: false,
956
+ subType: "rect",
957
+ fill: "rgba(244,244,244,1)",
958
+ dash: [],
959
+ strokeWidth: 0,
960
+ stroke: "#0c0c0c",
961
+ cornerRadius: 12
962
+ },
963
+ {
964
+ id: 'barcode',
965
+ type: 'image',
966
+ name: '',
967
+ opacity: 1,
968
+ visible: true,
969
+ selectable: false,
970
+ removable: false,
971
+ alwaysOnTop: true,
972
+ showInExport: true,
973
+ x: 375,
974
+ y: 410,
975
+ width: 315,
976
+ height: 15,
977
+ rotation: 180,
978
+ animations: [],
979
+ blurEnabled: false,
980
+ brightnessEnabled: false,
981
+ brightness: 0,
982
+ sepiaEnabled: false,
983
+ grayscaleEnabled: false,
984
+ shadowEnabled: false,
985
+ shadowOffsetX: 0,
986
+ shadowOffsetY: 0,
987
+ shadowOpacity: 1,
988
+ draggable: false,
989
+ resizable: false,
990
+ contentEditable: false,
991
+ styleEditable: false,
992
+ src: barcodeSrc,
993
+ cropX: 0,
994
+ cropY: 0,
995
+ cropWidth: 1,
996
+ cropHeight: 1,
997
+ cornerRadius: 0,
998
+ flipX: false,
999
+ flipY: false,
1000
+ clipSrc: '',
1001
+ borderSize: 0,
1002
+ keepRatio: false,
1003
+ },
1004
+ ];
1005
+
1006
+ elements.forEach(element => page.addElement(element));
1007
+ elementsForSecondPage.forEach(element => pageTwo.addElement(element));
1008
+ store.history.clear();
1009
+ };