@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,329 @@
1
+ import { DPI } from "../constants";
2
+
3
+ // Define the type for the element being added
4
+ interface Element {
5
+ id: string;
6
+ type: string;
7
+ name: string;
8
+ opacity: number;
9
+ visible: boolean;
10
+ selectable: boolean;
11
+ removable: boolean;
12
+ alwaysOnTop: boolean;
13
+ showInExport: boolean;
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ rotation: number;
19
+ animations?: any[];
20
+ blurEnabled?: boolean;
21
+ blurRadius?: number;
22
+ brightnessEnabled?: boolean;
23
+ brightness?: number;
24
+ sepiaEnabled?: boolean;
25
+ grayscaleEnabled?: boolean;
26
+ shadowEnabled?: boolean;
27
+ shadowBlur?: number;
28
+ shadowOffsetX?: number;
29
+ shadowOffsetY?: number;
30
+ shadowColor?: string;
31
+ shadowOpacity?: number;
32
+ draggable?: boolean;
33
+ resizable?: boolean;
34
+ contentEditable: boolean;
35
+ styleEditable: boolean;
36
+ subType?: string;
37
+ fill?: string;
38
+ dash?: any[];
39
+ strokeWidth?: number;
40
+ stroke?: string;
41
+ cornerRadius?: number;
42
+ text?: string;
43
+ placeholder?: string;
44
+ fontSize?: number;
45
+ fontFamily?: string;
46
+ fontStyle?: string;
47
+ fontWeight?: string;
48
+ textDecoration?: string;
49
+ align?: string;
50
+ verticalAlign?: string;
51
+ lineHeight?: number;
52
+ letterSpacing?: number;
53
+ backgroundEnabled?: boolean;
54
+ backgroundColor?: string;
55
+ backgroundOpacity?: number;
56
+ backgroundCornerRadius?: number;
57
+ backgroundPadding?: number;
58
+ src?: string;
59
+ cropX?: number;
60
+ cropY?: number;
61
+ cropWidth?: number;
62
+ cropHeight?: number;
63
+ flipX?: boolean;
64
+ flipY?: boolean;
65
+ clipSrc?: string;
66
+ borderSize?: number;
67
+ keepRatio?: boolean;
68
+ }
69
+
70
+ // Define the type for the page
71
+ interface Page {
72
+ addElement: (element: Element) => void;
73
+ }
74
+
75
+ // Define the type for the store
76
+ interface Store {
77
+ width: number;
78
+ height: number;
79
+ pages: Page[];
80
+ history: {
81
+ clear: () => void;
82
+ };
83
+ }
84
+
85
+ export const addRestrictedAreaToBiFold = (store: Store, size: [number, number], barcodeSrc: string) : void => {
86
+ const page = store.pages[0];
87
+
88
+ const elements: Element[] = [
89
+ {
90
+ id: 'figure-1',
91
+ type: 'figure',
92
+ name: '',
93
+ opacity: 1,
94
+ visible: true,
95
+ selectable: false,
96
+ removable: false,
97
+ alwaysOnTop: true,
98
+ showInExport: true,
99
+ x: store.width - size[0] * DPI - 0.15 * DPI - 9 * DPI,
100
+ y: store.height - size[1] * DPI - 0.125 * DPI,
101
+ width: size[0] * DPI,
102
+ height: size[1] * DPI,
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: 'white',
123
+ dash: [],
124
+ strokeWidth: 0,
125
+ stroke: '#0c0c0c',
126
+ cornerRadius: 0,
127
+ },
128
+ {
129
+ id: 'return-address',
130
+ type: 'text',
131
+ name: '',
132
+ opacity: 1,
133
+ visible: true,
134
+ selectable: false,
135
+ removable: false,
136
+ alwaysOnTop: true,
137
+ showInExport: true,
138
+ x: store.width - size[0] * DPI - 0.15 * DPI + 5 - 9 * DPI,
139
+ y: store.height - size[1] * DPI - 0.125 * DPI + 20,
140
+ width: 240,
141
+ height: 20,
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
+ text: 'YOUR RETURN ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
161
+ placeholder: '',
162
+ fontSize: 8,
163
+ fontFamily: 'Roboto',
164
+ fontStyle: 'normal',
165
+ fontWeight: 'normal',
166
+ textDecoration: '',
167
+ fill: 'black',
168
+ align: 'start',
169
+ verticalAlign: 'top',
170
+ strokeWidth: 0,
171
+ stroke: 'black',
172
+ lineHeight: 1.2,
173
+ letterSpacing: 0,
174
+ backgroundEnabled: false,
175
+ backgroundColor: '#7ED321',
176
+ backgroundOpacity: 1,
177
+ backgroundCornerRadius: 0.5,
178
+ backgroundPadding: 0.5,
179
+ },
180
+ {
181
+ id: 'indicia',
182
+ type: 'text',
183
+ name: '',
184
+ opacity: 1,
185
+ visible: true,
186
+ selectable: false,
187
+ removable: false,
188
+ alwaysOnTop: true,
189
+ showInExport: true,
190
+ x: store.width - 111 - 0.15 * DPI - 9 * DPI,
191
+ y: store.height - size[1] * DPI + 10,
192
+ width: 111,
193
+ height: 40,
194
+ rotation: 0,
195
+ animations: [],
196
+ blurEnabled: false,
197
+ blurRadius: 10,
198
+ brightnessEnabled: false,
199
+ brightness: 0,
200
+ sepiaEnabled: false,
201
+ grayscaleEnabled: false,
202
+ shadowEnabled: false,
203
+ shadowBlur: 5,
204
+ shadowOffsetX: 0,
205
+ shadowOffsetY: 0,
206
+ shadowColor: 'black',
207
+ shadowOpacity: 1,
208
+ draggable: false,
209
+ resizable: false,
210
+ contentEditable: false,
211
+ styleEditable: false,
212
+ text: `POSTAGE\nINDICIA`,
213
+ placeholder: '',
214
+ fontSize: 18,
215
+ fontFamily: 'Roboto',
216
+ fontStyle: 'normal',
217
+ fontWeight: 'normal',
218
+ textDecoration: '',
219
+ fill: 'black',
220
+ align: 'center',
221
+ verticalAlign: 'top',
222
+ strokeWidth: 0,
223
+ stroke: 'black',
224
+ lineHeight: 1.2,
225
+ letterSpacing: 0,
226
+ backgroundEnabled: false,
227
+ backgroundColor: '#7ED321',
228
+ backgroundOpacity: 1,
229
+ backgroundCornerRadius: 0.5,
230
+ backgroundPadding: 0.5,
231
+ },
232
+ {
233
+ id: 'barcode',
234
+ type: 'image',
235
+ name: '',
236
+ opacity: 1,
237
+ visible: true,
238
+ selectable: false,
239
+ removable: false,
240
+ alwaysOnTop: true,
241
+ showInExport: true,
242
+ y: store.height - 28 - size[1] * DPI + 100,
243
+ x: store.width - size[0] * DPI - 0.15 * DPI - 9 * DPI + 5,
244
+ width: size[0] * DPI - 23,
245
+ height: 15,
246
+ rotation: 0,
247
+ animations: [],
248
+ blurEnabled: false,
249
+ brightnessEnabled: false,
250
+ brightness: 0,
251
+ sepiaEnabled: false,
252
+ grayscaleEnabled: false,
253
+ shadowEnabled: false,
254
+ shadowOffsetX: 0,
255
+ shadowOffsetY: 0,
256
+ shadowOpacity: 1,
257
+ draggable: false,
258
+ resizable: false,
259
+ contentEditable: false,
260
+ styleEditable: false,
261
+ src: barcodeSrc,
262
+ cropX: 0,
263
+ cropY: 0,
264
+ cropWidth: 1,
265
+ cropHeight: 1,
266
+ cornerRadius: 0,
267
+ flipX: false,
268
+ flipY: false,
269
+ clipSrc: '',
270
+ borderSize: 0,
271
+ keepRatio: false,
272
+ },
273
+ {
274
+ id: 'recipient-address',
275
+ type: 'text',
276
+ name: '',
277
+ opacity: 1,
278
+ visible: true,
279
+ selectable: false,
280
+ removable: false,
281
+ alwaysOnTop: true,
282
+ showInExport: true,
283
+ x: store.width - size[0] * DPI - 0.15 * DPI + 5 - 9 * DPI,
284
+ y: store.height - size[1] * DPI - 0.125 * DPI + 120,
285
+ width: 240,
286
+ height: 20,
287
+ rotation: 0,
288
+ animations: [],
289
+ blurEnabled: false,
290
+ blurRadius: 10,
291
+ brightnessEnabled: false,
292
+ brightness: 0,
293
+ sepiaEnabled: false,
294
+ grayscaleEnabled: false,
295
+ shadowEnabled: false,
296
+ shadowBlur: 5,
297
+ shadowOffsetX: 0,
298
+ shadowOffsetY: 0,
299
+ shadowColor: 'black',
300
+ shadowOpacity: 1,
301
+ draggable: false,
302
+ resizable: false,
303
+ contentEditable: false,
304
+ styleEditable: false,
305
+ text: 'RECIPIENT ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
306
+ placeholder: '',
307
+ fontSize: 13,
308
+ fontFamily: 'Roboto',
309
+ fontStyle: 'normal',
310
+ fontWeight: 'normal',
311
+ textDecoration: '',
312
+ fill: 'black',
313
+ align: 'start',
314
+ verticalAlign: 'top',
315
+ strokeWidth: 0,
316
+ stroke: 'black',
317
+ lineHeight: 1.2,
318
+ letterSpacing: 0,
319
+ backgroundEnabled: false,
320
+ backgroundColor: '#7ED321',
321
+ backgroundOpacity: 1,
322
+ backgroundCornerRadius: 0.5,
323
+ backgroundPadding: 0.5,
324
+ },
325
+ ]
326
+
327
+ elements.forEach(element => page.addElement(element));
328
+ store.history.clear();
329
+ };
@@ -0,0 +1,90 @@
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
+ strokeWidth?: number;
38
+ stroke?: string;
39
+ cornerRadius?: number;
40
+ text?: string;
41
+ placeholder?: string;
42
+ fontSize?: number;
43
+ fontFamily?: string;
44
+ fontStyle?: string;
45
+ fontWeight?: string;
46
+ textDecoration?: string;
47
+ align?: string;
48
+ verticalAlign?: string;
49
+ lineHeight?: number;
50
+ letterSpacing?: number;
51
+ backgroundEnabled?: boolean;
52
+ backgroundColor?: string;
53
+ backgroundOpacity?: number;
54
+ backgroundCornerRadius?: number;
55
+ backgroundPadding?: number;
56
+ src?: string;
57
+ cropX?: number;
58
+ cropY?: number;
59
+ cropWidth?: number;
60
+ cropHeight?: number;
61
+ flipX?: boolean;
62
+ flipY?: boolean;
63
+ clipSrc?: string;
64
+ borderSize?: number;
65
+ keepRatio?: boolean;
66
+ }
67
+
68
+ // Define the type for the page
69
+ interface Page {
70
+ addElement: (element: Element) => void;
71
+ }
72
+
73
+ // Define the type for the store
74
+ interface Store {
75
+ pages: Page[];
76
+ history: {
77
+ clear: () => void;
78
+ };
79
+ }
80
+
81
+
82
+ export const addAreaToNonWindowProfessionalLetters = (store: Store): void => {
83
+ const page = store.pages[0];
84
+
85
+ const elements: Element[] = [
86
+ ];
87
+
88
+ elements.forEach(element => page.addElement(element));
89
+ store.history.clear();
90
+ };
@@ -0,0 +1,90 @@
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
+ strokeWidth?: number;
38
+ stroke?: string;
39
+ cornerRadius?: number;
40
+ text?: string;
41
+ placeholder?: string;
42
+ fontSize?: number;
43
+ fontFamily?: string;
44
+ fontStyle?: string;
45
+ fontWeight?: string;
46
+ textDecoration?: string;
47
+ align?: string;
48
+ verticalAlign?: string;
49
+ lineHeight?: number;
50
+ letterSpacing?: number;
51
+ backgroundEnabled?: boolean;
52
+ backgroundColor?: string;
53
+ backgroundOpacity?: number;
54
+ backgroundCornerRadius?: number;
55
+ backgroundPadding?: number;
56
+ src?: string;
57
+ cropX?: number;
58
+ cropY?: number;
59
+ cropWidth?: number;
60
+ cropHeight?: number;
61
+ flipX?: boolean;
62
+ flipY?: boolean;
63
+ clipSrc?: string;
64
+ borderSize?: number;
65
+ keepRatio?: boolean;
66
+ }
67
+
68
+ // Define the type for the page
69
+ interface Page {
70
+ addElement: (element: Element) => void;
71
+ }
72
+
73
+ // Define the type for the store
74
+ interface Store {
75
+ pages: Page[];
76
+ history: {
77
+ clear: () => void;
78
+ };
79
+ }
80
+
81
+
82
+ export const addAreaToPersonalLetters = (store: Store): void => {
83
+ const page = store.pages[0];
84
+
85
+ const elements: Element[] = [
86
+ ];
87
+
88
+ elements.forEach(element => page.addElement(element));
89
+ store.history.clear();
90
+ };