@openlettermarketing/olc-react-sdk 2.1.7 → 2.1.8

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/build/index.js +1 -1
  2. package/build/index.js.map +1 -1
  3. package/build/types/version.d.ts +1 -1
  4. package/package.json +7 -6
  5. package/.eslintignore +0 -1
  6. package/.eslintrc.cjs +0 -18
  7. package/.eslintrc.yml +0 -47
  8. package/.github/workflows/publish-beta.yml +0 -154
  9. package/.github/workflows/publish-production.yml +0 -143
  10. package/.prettierignore +0 -3
  11. package/.prettierrc.yml +0 -5
  12. package/CHANGELOG.md +0 -4
  13. package/babel.config.json +0 -10
  14. package/examples/.eslintrc.yml +0 -4
  15. package/index.html +0 -18
  16. package/public/vite.svg +0 -1
  17. package/src/App.tsx +0 -209
  18. package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
  19. package/src/assets/images/create-template/prebuilt.svg +0 -13
  20. package/src/assets/images/create-template/scratch.svg +0 -4
  21. package/src/assets/images/input/cancel.tsx +0 -20
  22. package/src/assets/images/input/search.tsx +0 -20
  23. package/src/assets/images/input/select-cancel.tsx +0 -17
  24. package/src/assets/images/modal-icons/add.tsx +0 -36
  25. package/src/assets/images/modal-icons/cancel-file.tsx +0 -12
  26. package/src/assets/images/modal-icons/cancel-input.tsx +0 -13
  27. package/src/assets/images/modal-icons/cancel.tsx +0 -35
  28. package/src/assets/images/modal-icons/close-new.svg +0 -3
  29. package/src/assets/images/modal-icons/confirm-close-icon.tsx +0 -14
  30. package/src/assets/images/modal-icons/confirm-new.tsx +0 -22
  31. package/src/assets/images/modal-icons/confirm.svg +0 -12
  32. package/src/assets/images/modal-icons/cross.tsx +0 -23
  33. package/src/assets/images/modal-icons/del.tsx +0 -19
  34. package/src/assets/images/modal-icons/design-icon.tsx +0 -22
  35. package/src/assets/images/modal-icons/doc.tsx +0 -43
  36. package/src/assets/images/modal-icons/docx.tsx +0 -43
  37. package/src/assets/images/modal-icons/envelope-icon.tsx +0 -26
  38. package/src/assets/images/modal-icons/info.tsx +0 -19
  39. package/src/assets/images/modal-icons/jpeg.tsx +0 -43
  40. package/src/assets/images/modal-icons/jpg.tsx +0 -43
  41. package/src/assets/images/modal-icons/modal-cros.svg +0 -4
  42. package/src/assets/images/modal-icons/modal-cross.tsx +0 -37
  43. package/src/assets/images/modal-icons/new-cancel.tsx +0 -11
  44. package/src/assets/images/modal-icons/order-download.tsx +0 -42
  45. package/src/assets/images/modal-icons/pdf.tsx +0 -51
  46. package/src/assets/images/modal-icons/png.tsx +0 -43
  47. package/src/assets/images/modal-icons/save.tsx +0 -23
  48. package/src/assets/images/modal-icons/template-copy.tsx +0 -25
  49. package/src/assets/images/modal-icons/tool-cancel.tsx +0 -25
  50. package/src/assets/images/products/bi-new.svg +0 -23
  51. package/src/assets/images/products/left-arrow.svg +0 -17
  52. package/src/assets/images/products/personal-new.tsx +0 -31
  53. package/src/assets/images/products/postcard-new.tsx +0 -27
  54. package/src/assets/images/products/professional-new.tsx +0 -24
  55. package/src/assets/images/products/real-new.tsx +0 -30
  56. package/src/assets/images/products/right-arrow.svg +0 -17
  57. package/src/assets/images/products/snap-new.svg +0 -31
  58. package/src/assets/images/templates/actions.svg +0 -3
  59. package/src/assets/images/templates/address-block-icon.tsx +0 -62
  60. package/src/assets/images/templates/archive.svg +0 -3
  61. package/src/assets/images/templates/arrow-down.tsx +0 -27
  62. package/src/assets/images/templates/back-arrow.tsx +0 -19
  63. package/src/assets/images/templates/bi-fold-self-mailers.tsx +0 -28
  64. package/src/assets/images/templates/check.svg +0 -3
  65. package/src/assets/images/templates/code.svg +0 -10
  66. package/src/assets/images/templates/content-copy-icon.tsx +0 -24
  67. package/src/assets/images/templates/custom-add-on-icon.tsx +0 -18
  68. package/src/assets/images/templates/custom-qr-section-icon.tsx +0 -9
  69. package/src/assets/images/templates/custom-template.tsx +0 -23
  70. package/src/assets/images/templates/designer.tsx +0 -43
  71. package/src/assets/images/templates/dot.tsx +0 -22
  72. package/src/assets/images/templates/download-v2.svg +0 -4
  73. package/src/assets/images/templates/download.svg +0 -4
  74. package/src/assets/images/templates/dummy-template.tsx +0 -76
  75. package/src/assets/images/templates/dynamic-field.tsx +0 -119
  76. package/src/assets/images/templates/edit-pencil-icon.tsx +0 -21
  77. package/src/assets/images/templates/edit.svg +0 -3
  78. package/src/assets/images/templates/epo-icon.tsx +0 -16
  79. package/src/assets/images/templates/field.tsx +0 -29
  80. package/src/assets/images/templates/gsv-icon.tsx +0 -31
  81. package/src/assets/images/templates/info-icon.tsx +0 -37
  82. package/src/assets/images/templates/left-arrow.svg +0 -17
  83. package/src/assets/images/templates/pencil.svg +0 -3
  84. package/src/assets/images/templates/personal-letter.tsx +0 -53
  85. package/src/assets/images/templates/postcard.tsx +0 -32
  86. package/src/assets/images/templates/professional-letter.tsx +0 -53
  87. package/src/assets/images/templates/qr-code.tsx +0 -13
  88. package/src/assets/images/templates/real-penned-letters.tsx +0 -57
  89. package/src/assets/images/templates/right-arrow.svg +0 -17
  90. package/src/assets/images/templates/size-image-lg.tsx +0 -20
  91. package/src/assets/images/templates/size-image-mid.tsx +0 -20
  92. package/src/assets/images/templates/size-image-xl.tsx +0 -20
  93. package/src/assets/images/templates/size-image.tsx +0 -20
  94. package/src/assets/images/templates/snap-pack.tsx +0 -67
  95. package/src/assets/images/templates/template-default-design.tsx +0 -21
  96. package/src/assets/images/templates/trash-upload.svg +0 -3
  97. package/src/assets/images/templates/trash.svg +0 -3
  98. package/src/assets/images/templates/tri-fold-self-mailers.tsx +0 -93
  99. package/src/assets/images/templates/upload-image.svg +0 -10
  100. package/src/assets/images/templates/x.svg +0 -3
  101. package/src/assets/images/thumbnails/one.svg +0 -9
  102. package/src/assets/images/tooltip/tool-arrow.tsx +0 -25
  103. package/src/components/CreateTemplate/V2/index.tsx +0 -527
  104. package/src/components/CreateTemplate/V2/styles.scss +0 -372
  105. package/src/components/CreateTemplate/index.tsx +0 -508
  106. package/src/components/CreateTemplate/styles.scss +0 -404
  107. package/src/components/GenericUIBlocks/Button/index.tsx +0 -54
  108. package/src/components/GenericUIBlocks/Button/styles.scss +0 -43
  109. package/src/components/GenericUIBlocks/CircularProgress/index.tsx +0 -18
  110. package/src/components/GenericUIBlocks/CircularProgress/styles.scss +0 -93
  111. package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +0 -88
  112. package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +0 -19
  113. package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +0 -227
  114. package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +0 -289
  115. package/src/components/GenericUIBlocks/Dialog/index.tsx +0 -185
  116. package/src/components/GenericUIBlocks/Dialog/styles.scss +0 -227
  117. package/src/components/GenericUIBlocks/Divider/index.tsx +0 -12
  118. package/src/components/GenericUIBlocks/Divider/styles.scss +0 -7
  119. package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +0 -114
  120. package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +0 -406
  121. package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +0 -25
  122. package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +0 -20
  123. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +0 -91
  124. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +0 -92
  125. package/src/components/GenericUIBlocks/Grid/index.tsx +0 -82
  126. package/src/components/GenericUIBlocks/Input/index.tsx +0 -269
  127. package/src/components/GenericUIBlocks/Input/styles.scss +0 -332
  128. package/src/components/GenericUIBlocks/Tabs/index.tsx +0 -71
  129. package/src/components/GenericUIBlocks/Tabs/styles.scss +0 -42
  130. package/src/components/GenericUIBlocks/Typography/index.tsx +0 -18
  131. package/src/components/GenericUIBlocks/Typography/styles.scss +0 -27
  132. package/src/components/SidePanel/CustomAddOns/index.tsx +0 -342
  133. package/src/components/SidePanel/CustomAddOns/styles.scss +0 -86
  134. package/src/components/SidePanel/CustomBlockColors/index.tsx +0 -211
  135. package/src/components/SidePanel/CustomBlockColors/styles.scss +0 -80
  136. package/src/components/SidePanel/CustomFields/customFieldSection.tsx +0 -547
  137. package/src/components/SidePanel/CustomFields/styles.scss +0 -64
  138. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +0 -172
  139. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +0 -46
  140. package/src/components/SidePanel/CustomQRCode/index.tsx +0 -1070
  141. package/src/components/SidePanel/CustomQRCode/styles.scss +0 -149
  142. package/src/components/SidePanel/CustomUploads/V2/index.tsx +0 -542
  143. package/src/components/SidePanel/CustomUploads/V2/styles.scss +0 -267
  144. package/src/components/SidePanel/CustomUploads/index.tsx +0 -301
  145. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +0 -424
  146. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +0 -180
  147. package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +0 -235
  148. package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +0 -244
  149. package/src/components/SidePanel/Templates/ModalGallery/index.tsx +0 -231
  150. package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +0 -233
  151. package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +0 -152
  152. package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +0 -149
  153. package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +0 -156
  154. package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +0 -160
  155. package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +0 -98
  156. package/src/components/SidePanel/Templates/customTemplateSection.tsx +0 -793
  157. package/src/components/SidePanel/Templates/styles.scss +0 -244
  158. package/src/components/SidePanel/index.tsx +0 -160
  159. package/src/components/TemplateBuilder/index.tsx +0 -585
  160. package/src/components/TemplateBuilder/styles.scss +0 -100
  161. package/src/components/TemplateTypes/index.tsx +0 -96
  162. package/src/components/TemplateTypes/styles.scss +0 -91
  163. package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +0 -81
  164. package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +0 -123
  165. package/src/components/TopNavigation/DuplicateTemplateModal.tsx +0 -103
  166. package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +0 -71
  167. package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +0 -88
  168. package/src/components/TopNavigation/SaveTemplateModel/index.tsx +0 -201
  169. package/src/components/TopNavigation/SaveTemplateModel/styles.scss +0 -128
  170. package/src/components/TopNavigation/index.tsx +0 -938
  171. package/src/components/TopNavigation/styles.scss +0 -303
  172. package/src/importMeta.d.ts +0 -31
  173. package/src/index.scss +0 -131
  174. package/src/index.tsx +0 -238
  175. package/src/libs/test.ts +0 -7
  176. package/src/redux/actions/action-types.ts +0 -52
  177. package/src/redux/actions/customQRCodeActions.ts +0 -54
  178. package/src/redux/actions/snackbarActions.ts +0 -16
  179. package/src/redux/actions/templateActions.ts +0 -236
  180. package/src/redux/reducers/customFieldReducer.ts +0 -99
  181. package/src/redux/reducers/customQRCodeReducer.ts +0 -58
  182. package/src/redux/reducers/index.ts +0 -15
  183. package/src/redux/reducers/snackbarReducer.ts +0 -40
  184. package/src/redux/reducers/templateReducer.ts +0 -485
  185. package/src/redux/store.ts +0 -18
  186. package/src/styles/colors.scss +0 -61
  187. package/src/test/mocks.js +0 -89
  188. package/src/test/setupJest.js +0 -1
  189. package/src/utils/api.ts +0 -36
  190. package/src/utils/constants.ts +0 -182
  191. package/src/utils/customStyles.ts +0 -45
  192. package/src/utils/fetchWrapper.ts +0 -73
  193. package/src/utils/fonts.json +0 -1597
  194. package/src/utils/helper.ts +0 -205
  195. package/src/utils/local-storage.ts +0 -15
  196. package/src/utils/message.ts +0 -162
  197. package/src/utils/products.ts +0 -186
  198. package/src/utils/template-builder.ts +0 -328
  199. package/src/utils/templateIdentifierArea/biFold.ts +0 -107
  200. package/src/utils/templateIdentifierArea/index.ts +0 -35
  201. package/src/utils/templateIdentifierArea/personal.ts +0 -107
  202. package/src/utils/templateIdentifierArea/postCards.ts +0 -163
  203. package/src/utils/templateIdentifierArea/professional.ts +0 -125
  204. package/src/utils/templateIdentifierArea/snapPack.ts +0 -107
  205. package/src/utils/templateIdentifierArea/triFold.ts +0 -107
  206. package/src/utils/templateRestrictedArea/biFold.ts +0 -329
  207. package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +0 -90
  208. package/src/utils/templateRestrictedArea/personal.ts +0 -90
  209. package/src/utils/templateRestrictedArea/postCard.ts +0 -334
  210. package/src/utils/templateRestrictedArea/postCardJumbo.tsx +0 -408
  211. package/src/utils/templateRestrictedArea/professional.ts +0 -318
  212. package/src/utils/templateRestrictedArea/realPenned.ts +0 -233
  213. package/src/utils/templateRestrictedArea/snapPack.ts +0 -1009
  214. package/src/utils/templateRestrictedArea/triFold.ts +0 -330
  215. package/src/utils/templateSafetyBorders/biFold.ts +0 -91
  216. package/src/utils/templateSafetyBorders/index.ts +0 -43
  217. package/src/utils/templateSafetyBorders/personal.ts +0 -41
  218. package/src/utils/templateSafetyBorders/postCards.ts +0 -259
  219. package/src/utils/templateSafetyBorders/professional.ts +0 -78
  220. package/src/utils/templateSafetyBorders/snapPack.ts +0 -165
  221. package/src/utils/templateSafetyBorders/triFold.ts +0 -114
  222. package/src/utils/templateSafetyBorders/types.d.ts +0 -68
  223. package/src/utils/types.ts +0 -12
  224. package/src/v2Theme.scss +0 -142
  225. package/tsconfig.json +0 -29
  226. package/tsconfig.node.json +0 -12
  227. package/update-version.js +0 -23
  228. package/version.js +0 -1
  229. package/vite.config.ts +0 -8
  230. package/webpack.config.js +0 -80
@@ -1,408 +0,0 @@
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
-
86
- export const addRestrictedAreaToPostCardJumbo = (store: Store, barcodeSrc: string): void => {
87
- const page = store.pages[1];
88
-
89
- const elements: Element[] = [
90
- {
91
- id: 'figure-1',
92
- type: 'figure',
93
- name: '',
94
- opacity: 1,
95
- visible: true,
96
- selectable: false,
97
- removable: false,
98
- alwaysOnTop: true,
99
- showInExport: true,
100
- x: 40,
101
- y: 50,
102
- width: 180,
103
- height: 75,
104
- rotation: 0,
105
- animations: [],
106
- blurEnabled: false,
107
- blurRadius: 10,
108
- brightnessEnabled: false,
109
- brightness: 0,
110
- sepiaEnabled: false,
111
- grayscaleEnabled: false,
112
- shadowEnabled: false,
113
- shadowBlur: 5,
114
- shadowOffsetX: 0,
115
- shadowOffsetY: 0,
116
- shadowColor: 'black',
117
- shadowOpacity: 1,
118
- draggable: false,
119
- resizable: false,
120
- contentEditable: false,
121
- styleEditable: false,
122
- subType: 'rect',
123
- fill: 'white',
124
- dash: [],
125
- strokeWidth: 0,
126
- stroke: '#0c0c0c',
127
- cornerRadius: 0,
128
- },
129
- {
130
- id: 'return-address',
131
- type: 'text',
132
- name: '',
133
- opacity: 1,
134
- visible: true,
135
- selectable: false,
136
- removable: false,
137
- alwaysOnTop: true,
138
- showInExport: true,
139
- x: 50,
140
- y: 70,
141
- width: 160,
142
- height: 50,
143
- rotation: 0,
144
- animations: [],
145
- blurEnabled: false,
146
- blurRadius: 10,
147
- brightnessEnabled: false,
148
- brightness: 0,
149
- sepiaEnabled: false,
150
- grayscaleEnabled: false,
151
- shadowEnabled: false,
152
- shadowBlur: 5,
153
- shadowOffsetX: 0,
154
- shadowOffsetY: 0,
155
- shadowColor: 'black',
156
- shadowOpacity: 1,
157
- draggable: false,
158
- resizable: false,
159
- contentEditable: false,
160
- styleEditable: false,
161
- text: 'YOUR RETURN ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
162
- placeholder: '',
163
- fontSize: 8,
164
- fontFamily: 'Roboto',
165
- fontStyle: 'normal',
166
- fontWeight: 'normal',
167
- textDecoration: '',
168
- fill: 'black',
169
- align: 'start',
170
- verticalAlign: 'top',
171
- strokeWidth: 0,
172
- stroke: 'black',
173
- lineHeight: 1.2,
174
- letterSpacing: 0,
175
- backgroundEnabled: false,
176
- backgroundColor: '#7ED321',
177
- backgroundOpacity: 1,
178
- backgroundCornerRadius: 0.5,
179
- backgroundPadding: 0.5,
180
- },
181
- {
182
- id: 'figure-2',
183
- type: 'figure',
184
- name: '',
185
- opacity: 1,
186
- visible: true,
187
- selectable: false,
188
- removable: false,
189
- alwaysOnTop: true,
190
- showInExport: true,
191
- x: 695,
192
- y: 52,
193
- width: 135,
194
- height: 75,
195
- rotation: 0,
196
- animations: [],
197
- blurEnabled: false,
198
- blurRadius: 10,
199
- brightnessEnabled: false,
200
- brightness: 0,
201
- sepiaEnabled: false,
202
- grayscaleEnabled: false,
203
- shadowEnabled: false,
204
- shadowBlur: 5,
205
- shadowOffsetX: 0,
206
- shadowOffsetY: 0,
207
- shadowColor: 'black',
208
- shadowOpacity: 1,
209
- draggable: false,
210
- resizable: false,
211
- contentEditable: false,
212
- styleEditable: false,
213
- subType: 'rect',
214
- fill: 'white',
215
- dash: [],
216
- strokeWidth: 0,
217
- stroke: '#0c0c0c',
218
- cornerRadius: 0,
219
- },
220
- {
221
- id: 'indicia',
222
- type: 'text',
223
- name: '',
224
- opacity: 1,
225
- visible: true,
226
- selectable: false,
227
- removable: false,
228
- alwaysOnTop: true,
229
- showInExport: true,
230
- x: 710,
231
- y: 69,
232
- width: 110,
233
- height: 30,
234
- rotation: 0,
235
- animations: [],
236
- blurEnabled: false,
237
- blurRadius: 10,
238
- brightnessEnabled: false,
239
- brightness: 0,
240
- sepiaEnabled: false,
241
- grayscaleEnabled: false,
242
- shadowEnabled: false,
243
- shadowBlur: 5,
244
- shadowOffsetX: 0,
245
- shadowOffsetY: 0,
246
- shadowColor: 'black',
247
- shadowOpacity: 1,
248
- draggable: false,
249
- resizable: false,
250
- contentEditable: false,
251
- styleEditable: false,
252
- text: `POSTAGE\nINDICIA`,
253
- placeholder: '',
254
- fontSize: 18,
255
- fontFamily: 'Roboto',
256
- fontStyle: 'normal',
257
- fontWeight: 'normal',
258
- textDecoration: '',
259
- fill: 'black',
260
- align: 'center',
261
- verticalAlign: 'top',
262
- strokeWidth: 0,
263
- stroke: 'black',
264
- lineHeight: 1.2,
265
- letterSpacing: 0,
266
- backgroundEnabled: false,
267
- backgroundColor: '#7ED321',
268
- backgroundOpacity: 1,
269
- backgroundCornerRadius: 0.5,
270
- backgroundPadding: 0.5,
271
- },
272
- {
273
- id: 'figure-3',
274
- type: 'figure',
275
- name: '',
276
- opacity: 1,
277
- visible: true,
278
- selectable: false,
279
- removable: false,
280
- alwaysOnTop: true,
281
- showInExport: true,
282
- x: 410,
283
- y: 180,
284
- width: 380,
285
- height: 160,
286
- rotation: 0,
287
- animations: [],
288
- blurEnabled: false,
289
- blurRadius: 10,
290
- brightnessEnabled: false,
291
- brightness: 0,
292
- sepiaEnabled: false,
293
- grayscaleEnabled: false,
294
- shadowEnabled: false,
295
- shadowBlur: 5,
296
- shadowOffsetX: 0,
297
- shadowOffsetY: 0,
298
- shadowColor: 'black',
299
- shadowOpacity: 1,
300
- draggable: false,
301
- resizable: false,
302
- contentEditable: false,
303
- styleEditable: false,
304
- subType: 'rect',
305
- fill: 'white',
306
- dash: [],
307
- strokeWidth: 0,
308
- stroke: '#0c0c0c',
309
- cornerRadius: 0,
310
- },
311
- {
312
- id: 'barcode',
313
- type: 'image',
314
- name: '',
315
- opacity: 1,
316
- visible: true,
317
- selectable: false,
318
- removable: false,
319
- alwaysOnTop: true,
320
- showInExport: true,
321
- x: 430,
322
- y: 220,
323
- width: 3.2835 * DPI - 23,
324
- height: 15,
325
- rotation: 0,
326
- animations: [],
327
- blurEnabled: false,
328
- brightnessEnabled: false,
329
- brightness: 0,
330
- sepiaEnabled: false,
331
- grayscaleEnabled: false,
332
- shadowEnabled: false,
333
- shadowOffsetX: 0,
334
- shadowOffsetY: 0,
335
- shadowOpacity: 1,
336
- draggable: false,
337
- resizable: false,
338
- contentEditable: false,
339
- styleEditable: false,
340
- src: barcodeSrc,
341
- cropX: 0,
342
- cropY: 0,
343
- cropWidth: 1,
344
- cropHeight: 1,
345
- cornerRadius: 0,
346
- flipX: false,
347
- flipY: false,
348
- clipSrc: '',
349
- borderSize: 0,
350
- keepRatio: false,
351
- },
352
- {
353
- id: 'recipient-address',
354
- type: 'text',
355
- name: '',
356
- opacity: 1,
357
- visible: true,
358
- selectable: false,
359
- removable: false,
360
- alwaysOnTop: true,
361
- showInExport: true,
362
- x: 430,
363
- y: 250,
364
- width: 240,
365
- height: 65,
366
- rotation: 0,
367
- animations: [],
368
- blurEnabled: false,
369
- blurRadius: 10,
370
- brightnessEnabled: false,
371
- brightness: 0,
372
- sepiaEnabled: false,
373
- grayscaleEnabled: false,
374
- shadowEnabled: false,
375
- shadowBlur: 5,
376
- shadowOffsetX: 0,
377
- shadowOffsetY: 0,
378
- shadowColor: 'black',
379
- shadowOpacity: 1,
380
- draggable: false,
381
- resizable: false,
382
- contentEditable: false,
383
- styleEditable: false,
384
- text: 'RECIPIENT ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
385
- placeholder: '',
386
- fontSize: 13,
387
- fontFamily: 'Roboto',
388
- fontStyle: 'normal',
389
- fontWeight: 'normal',
390
- textDecoration: '',
391
- fill: 'black',
392
- align: 'start',
393
- verticalAlign: 'top',
394
- strokeWidth: 0,
395
- stroke: 'black',
396
- lineHeight: 1.2,
397
- letterSpacing: 0,
398
- backgroundEnabled: false,
399
- backgroundColor: '#7ED321',
400
- backgroundOpacity: 1,
401
- backgroundCornerRadius: 0.5,
402
- backgroundPadding: 0.5,
403
- },
404
- ];
405
-
406
- elements.forEach(element => page.addElement(element));
407
- store.history.clear();
408
- };
@@ -1,318 +0,0 @@
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 addAreaToProfessionalLetters = (store: Store, barcodeSrc: string): void => {
86
- const page = store.pages[0];
87
- const position = [0.6, 0.84];
88
- const position1 = [0.63, 1.71];
89
-
90
- const elements: Element[] = [
91
- {
92
- id: 'figure-2',
93
- type: 'figure',
94
- name: '',
95
- opacity: 1,
96
- visible: true,
97
- selectable: false,
98
- removable: false,
99
- alwaysOnTop: true,
100
- showInExport: true,
101
- x: 0.63 * DPI,
102
- y: 0.5 * DPI,
103
- width: 3.25 * DPI,
104
- height: 0.875 * DPI,
105
- rotation: 0,
106
- animations: [],
107
- blurEnabled: false,
108
- blurRadius: 10,
109
- brightnessEnabled: false,
110
- brightness: 0,
111
- sepiaEnabled: false,
112
- grayscaleEnabled: false,
113
- shadowEnabled: false,
114
- shadowBlur: 5,
115
- shadowOffsetX: 0,
116
- shadowOffsetY: 0,
117
- shadowColor: 'black',
118
- shadowOpacity: 1,
119
- draggable: false,
120
- resizable: false,
121
- contentEditable: false,
122
- styleEditable: false,
123
- subType: 'rect',
124
- fill: 'white',
125
- dash: [],
126
- strokeWidth: 0,
127
- stroke: '#0c0c0c',
128
- cornerRadius: 0,
129
- },
130
- {
131
- id: 'figure-3',
132
- type: 'figure',
133
- name: '',
134
- opacity: 1,
135
- visible: true,
136
- selectable: false,
137
- removable: false,
138
- alwaysOnTop: true,
139
- showInExport: true,
140
- x: 0.63 * DPI,
141
- y: 1.71 * DPI,
142
- width: 4 * DPI,
143
- height: 1 * DPI,
144
- rotation: 0,
145
- animations: [],
146
- blurEnabled: false,
147
- blurRadius: 10,
148
- brightnessEnabled: false,
149
- brightness: 0,
150
- sepiaEnabled: false,
151
- grayscaleEnabled: false,
152
- shadowEnabled: false,
153
- shadowBlur: 5,
154
- shadowOffsetX: 0,
155
- shadowOffsetY: 0,
156
- shadowColor: 'black',
157
- shadowOpacity: 1,
158
- draggable: false,
159
- resizable: false,
160
- contentEditable: false,
161
- styleEditable: false,
162
- subType: 'rect',
163
- fill: 'white',
164
- dash: [],
165
- strokeWidth: 0,
166
- stroke: '#0c0c0c',
167
- cornerRadius: 0,
168
- },
169
- {
170
- id: 'return-address',
171
- type: 'text',
172
- name: '',
173
- opacity: 1,
174
- visible: true,
175
- selectable: false,
176
- removable: false,
177
- alwaysOnTop: true,
178
- showInExport: true,
179
- x: position[0] * DPI + 10,
180
- y: position[1] * DPI - 10,
181
- width: 200,
182
- height: 18,
183
- rotation: 0,
184
- animations: [],
185
- blurEnabled: false,
186
- blurRadius: 10,
187
- brightnessEnabled: false,
188
- brightness: 0,
189
- sepiaEnabled: false,
190
- grayscaleEnabled: false,
191
- shadowEnabled: false,
192
- shadowBlur: 5,
193
- shadowOffsetX: 0,
194
- shadowOffsetY: 0,
195
- shadowColor: 'black',
196
- shadowOpacity: 1,
197
- draggable: false,
198
- resizable: false,
199
- contentEditable: false,
200
- styleEditable: false,
201
- text: 'YOUR RETURN ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
202
- placeholder: '',
203
- fontSize: 12,
204
- fontFamily: 'Roboto',
205
- fontStyle: 'normal',
206
- fontWeight: 'normal',
207
- textDecoration: '',
208
- fill: 'black',
209
- align: 'start',
210
- verticalAlign: 'top',
211
- strokeWidth: 0,
212
- stroke: 'black',
213
- lineHeight: 1.2,
214
- letterSpacing: 0,
215
- backgroundEnabled: false,
216
- backgroundColor: '#7ED321',
217
- backgroundOpacity: 1,
218
- backgroundCornerRadius: 0.5,
219
- backgroundPadding: 0.5,
220
- },
221
- {
222
- id: 'barcode',
223
- type: 'image',
224
- name: '',
225
- opacity: 1,
226
- visible: true,
227
- selectable: false,
228
- removable: false,
229
- alwaysOnTop: true,
230
- showInExport: true,
231
- x: position1[0] * DPI + 10,
232
- y: position1[1] * DPI + 70,
233
- width: 230,
234
- height: 15,
235
- rotation: 0,
236
- animations: [],
237
- blurEnabled: false,
238
- brightnessEnabled: false,
239
- brightness: 0,
240
- sepiaEnabled: false,
241
- grayscaleEnabled: false,
242
- shadowEnabled: false,
243
- shadowOffsetX: 0,
244
- shadowOffsetY: 0,
245
- shadowOpacity: 1,
246
- draggable: false,
247
- resizable: false,
248
- contentEditable: false,
249
- styleEditable: false,
250
- src: barcodeSrc,
251
- cropX: 0,
252
- cropY: 0,
253
- cropWidth: 1,
254
- cropHeight: 1,
255
- cornerRadius: 0,
256
- flipX: false,
257
- flipY: false,
258
- clipSrc: '',
259
- borderSize: 0,
260
- keepRatio: false,
261
- },
262
- {
263
- id: 'recipient-address',
264
- type: 'text',
265
- name: '',
266
- opacity: 1,
267
- visible: true,
268
- selectable: false,
269
- removable: false,
270
- alwaysOnTop: true,
271
- showInExport: true,
272
- x: position1[0] * DPI + 10,
273
- y: position1[1] * DPI + 10,
274
- width: 165,
275
- height: 21,
276
- rotation: 0,
277
- animations: [],
278
- blurEnabled: false,
279
- blurRadius: 10,
280
- brightnessEnabled: false,
281
- brightness: 0,
282
- sepiaEnabled: false,
283
- grayscaleEnabled: false,
284
- shadowEnabled: false,
285
- shadowBlur: 5,
286
- shadowOffsetX: 0,
287
- shadowOffsetY: 0,
288
- shadowColor: 'black',
289
- shadowOpacity: 1,
290
- draggable: false,
291
- resizable: false,
292
- contentEditable: false,
293
- styleEditable: false,
294
- text: 'RECIPIENT ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
295
- placeholder: '',
296
- fontSize: 12,
297
- fontFamily: 'Roboto',
298
- fontStyle: 'normal',
299
- fontWeight: 'normal',
300
- textDecoration: '',
301
- fill: 'black',
302
- align: 'start',
303
- verticalAlign: 'top',
304
- strokeWidth: 0,
305
- stroke: 'black',
306
- lineHeight: 1.2,
307
- letterSpacing: 0,
308
- backgroundEnabled: false,
309
- backgroundColor: '#7ED321',
310
- backgroundOpacity: 1,
311
- backgroundCornerRadius: 0.5,
312
- backgroundPadding: 0.5,
313
- },
314
- ];
315
-
316
- elements.forEach(element => page.addElement(element));
317
- store.history.clear();
318
- };