@openlettermarketing/olc-react-sdk 0.0.8 → 0.0.10

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 (135) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/.eslintrc.yml +47 -0
  4. package/.prettierignore +3 -0
  5. package/.prettierrc.yml +5 -0
  6. package/CHANGELOG.md +4 -0
  7. package/babel.config.json +10 -0
  8. package/build/index.js +2 -2
  9. package/build/index.js.map +1 -1
  10. package/examples/.eslintrc.yml +4 -0
  11. package/index.html +18 -0
  12. package/package.json +6 -6
  13. package/public/vite.svg +1 -0
  14. package/src/App.tsx +76 -0
  15. package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
  16. package/src/assets/images/input/cancel.tsx +20 -0
  17. package/src/assets/images/input/search.tsx +20 -0
  18. package/src/assets/images/modal-icons/cancelIcon.png +0 -0
  19. package/src/assets/images/modal-icons/del.tsx +19 -0
  20. package/src/assets/images/modal-icons/delete.svg +3 -0
  21. package/src/assets/images/modal-icons/modal-cross.tsx +23 -0
  22. package/src/assets/images/modal-icons/save.tsx +23 -0
  23. package/src/assets/images/templates/add-icon.svg +5 -0
  24. package/src/assets/images/templates/back-arrow.tsx +19 -0
  25. package/src/assets/images/templates/back-dialog-icon.png +0 -0
  26. package/src/assets/images/templates/back-dialog-icon.svg +3 -0
  27. package/src/assets/images/templates/barcode.png +0 -0
  28. package/src/assets/images/templates/bi-fold-self-mailers.tsx +28 -0
  29. package/src/assets/images/templates/black-trash-icon.svg +3 -0
  30. package/src/assets/images/templates/cancel.svg +4 -0
  31. package/src/assets/images/templates/cancelIcon.png +0 -0
  32. package/src/assets/images/templates/clipboard.svg +3 -0
  33. package/src/assets/images/templates/contact-search.svg +3 -0
  34. package/src/assets/images/templates/content-copy-icon.tsx +24 -0
  35. package/src/assets/images/templates/cross.svg +3 -0
  36. package/src/assets/images/templates/custom-template-icon-black.svg +3 -0
  37. package/src/assets/images/templates/custom-template-icon.svg +3 -0
  38. package/src/assets/images/templates/custom-template.tsx +23 -0
  39. package/src/assets/images/templates/dummy-template.svg +21 -0
  40. package/src/assets/images/templates/dynamic-field.tsx +119 -0
  41. package/src/assets/images/templates/edit-pencil-icon.tsx +21 -0
  42. package/src/assets/images/templates/filter-2.svg +13 -0
  43. package/src/assets/images/templates/info-icon.svg +12 -0
  44. package/src/assets/images/templates/info-icon.tsx +37 -0
  45. package/src/assets/images/templates/one-barcode.png +0 -0
  46. package/src/assets/images/templates/personal-letter.tsx +53 -0
  47. package/src/assets/images/templates/plus-icon.svg +5 -0
  48. package/src/assets/images/templates/postcard.tsx +32 -0
  49. package/src/assets/images/templates/professional-letter.tsx +53 -0
  50. package/src/assets/images/templates/real-penned-letters.tsx +57 -0
  51. package/src/assets/images/templates/search.svg +3 -0
  52. package/src/assets/images/templates/size-image-lg.tsx +20 -0
  53. package/src/assets/images/templates/size-image-mid.tsx +20 -0
  54. package/src/assets/images/templates/size-image.tsx +20 -0
  55. package/src/assets/images/templates/template-copy.svg +3 -0
  56. package/src/assets/images/templates/template-default-design.tsx +21 -0
  57. package/src/assets/images/templates/template-delete.svg +3 -0
  58. package/src/assets/images/templates/template-edit.svg +4 -0
  59. package/src/assets/images/templates/template-save-icon.svg +3 -0
  60. package/src/assets/images/templates/template-search-2.svg +9 -0
  61. package/src/assets/images/templates/template-search.svg +4 -0
  62. package/src/assets/images/templates/thumbnail.svg +10 -0
  63. package/src/assets/images/templates/trash-icon.svg +13 -0
  64. package/src/assets/images/templates/tri-fold-self-mailers.tsx +93 -0
  65. package/src/components/CreateTemplate/index.tsx +377 -0
  66. package/src/components/CreateTemplate/styles.scss +363 -0
  67. package/src/components/GenericUIBlocks/Button/index.tsx +21 -0
  68. package/src/components/GenericUIBlocks/Button/styles.scss +15 -0
  69. package/src/components/GenericUIBlocks/CircularProgress/index.tsx +18 -0
  70. package/src/components/GenericUIBlocks/CircularProgress/styles.scss +98 -0
  71. package/src/components/GenericUIBlocks/Dialog/index.tsx +127 -0
  72. package/src/components/GenericUIBlocks/Dialog/styles.scss +106 -0
  73. package/src/components/GenericUIBlocks/Divider/index.tsx +12 -0
  74. package/src/components/GenericUIBlocks/Divider/styles.scss +7 -0
  75. package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +86 -0
  76. package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +77 -0
  77. package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +24 -0
  78. package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +9 -0
  79. package/src/components/GenericUIBlocks/GenericSnackbar/index.tsx +53 -0
  80. package/src/components/GenericUIBlocks/GenericSnackbar/styles.scss +34 -0
  81. package/src/components/GenericUIBlocks/Grid/index.tsx +82 -0
  82. package/src/components/GenericUIBlocks/Input/index.tsx +89 -0
  83. package/src/components/GenericUIBlocks/Input/styles.scss +80 -0
  84. package/src/components/GenericUIBlocks/Snackbar/index.tsx +66 -0
  85. package/src/components/GenericUIBlocks/Typography/index.tsx +18 -0
  86. package/src/components/GenericUIBlocks/Typography/styles.scss +27 -0
  87. package/src/components/SidePanel/customFields/customFieldSection.tsx +162 -0
  88. package/src/components/SidePanel/customFields/styles.scss +47 -0
  89. package/src/components/SidePanel/index.tsx +30 -0
  90. package/src/components/SidePanel/templates/customTemplateSection.tsx +505 -0
  91. package/src/components/SidePanel/templates/styles.scss +151 -0
  92. package/src/components/TemplateBuilder/index.tsx +295 -0
  93. package/src/components/TemplateBuilder/styles.scss +66 -0
  94. package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +58 -0
  95. package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +123 -0
  96. package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +98 -0
  97. package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +88 -0
  98. package/src/components/TopNavigation/SaveTemplateModel/index.tsx +60 -0
  99. package/src/components/TopNavigation/SaveTemplateModel/styles.scss +128 -0
  100. package/src/components/TopNavigation/index.tsx +388 -0
  101. package/src/components/TopNavigation/styles.scss +83 -0
  102. package/src/importMeta.d.ts +9 -0
  103. package/src/index.scss +130 -0
  104. package/src/index.tsx +82 -0
  105. package/src/libs/test.ts +7 -0
  106. package/src/redux/actions/action-types.ts +42 -0
  107. package/src/redux/actions/customFieldAction.ts +28 -0
  108. package/src/redux/actions/snackbarActions.ts +16 -0
  109. package/src/redux/actions/templateActions.ts +456 -0
  110. package/src/redux/reducers/customFieldReducer.ts +97 -0
  111. package/src/redux/reducers/index.ts +14 -0
  112. package/src/redux/reducers/snackbarReducer.ts +41 -0
  113. package/src/redux/reducers/templateReducer.ts +353 -0
  114. package/src/redux/store.ts +18 -0
  115. package/src/styles/colors.scss +61 -0
  116. package/src/test/mocks.js +89 -0
  117. package/src/test/setupJest.js +1 -0
  118. package/src/utils/api.ts +36 -0
  119. package/src/utils/constants.ts +40 -0
  120. package/src/utils/customStyles.ts +135 -0
  121. package/src/utils/fetchWrapper.ts +68 -0
  122. package/src/utils/fonts.json +1597 -0
  123. package/src/utils/helper.ts +19 -0
  124. package/src/utils/local-storage.ts +15 -0
  125. package/src/utils/message.ts +71 -0
  126. package/src/utils/template-builder.ts +147 -0
  127. package/src/utils/templateRestrictedArea/biFold.ts +433 -0
  128. package/src/utils/templateRestrictedArea/postCard.ts +439 -0
  129. package/src/utils/templateRestrictedArea/professional.ts +422 -0
  130. package/src/utils/templateRestrictedArea/realPenned.ts +283 -0
  131. package/src/utils/templateRestrictedArea/triFold.ts +434 -0
  132. package/tsconfig.json +29 -0
  133. package/tsconfig.node.json +12 -0
  134. package/vite.config.ts +8 -0
  135. package/webpack.config.js +80 -0
@@ -0,0 +1,422 @@
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: 215,
234
+ height: 12,
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
+ id: 'sequence',
316
+ type: 'text',
317
+ name: '',
318
+ opacity: 1,
319
+ visible: true,
320
+ selectable: false,
321
+ removable: false,
322
+ alwaysOnTop: true,
323
+ showInExport: true,
324
+ x: position1[0] * DPI + 280,
325
+ y: position1[1] * DPI + 64,
326
+ width: 111,
327
+ height: 40,
328
+ rotation: 0,
329
+ animations: [],
330
+ blurEnabled: false,
331
+ blurRadius: 10,
332
+ brightnessEnabled: false,
333
+ brightness: 0,
334
+ sepiaEnabled: false,
335
+ grayscaleEnabled: false,
336
+ shadowEnabled: false,
337
+ shadowBlur: 5,
338
+ shadowOffsetX: 0,
339
+ shadowOffsetY: 0,
340
+ shadowColor: 'black',
341
+ shadowOpacity: 1,
342
+ draggable: false,
343
+ resizable: false,
344
+ contentEditable: false,
345
+ styleEditable: false,
346
+ text: `Sequence`,
347
+ placeholder: '',
348
+ fontSize: 8,
349
+ fontFamily: 'Roboto',
350
+ fontStyle: 'normal',
351
+ fontWeight: 'normal',
352
+ textDecoration: '',
353
+ fill: 'black',
354
+ align: 'center',
355
+ verticalAlign: 'top',
356
+ strokeWidth: 0,
357
+ stroke: 'black',
358
+ lineHeight: 1.2,
359
+ letterSpacing: 0,
360
+ backgroundEnabled: false,
361
+ backgroundColor: '#7ED321',
362
+ backgroundOpacity: 1,
363
+ backgroundCornerRadius: 0.5,
364
+ backgroundPadding: 0.5,
365
+ },
366
+ {
367
+ id: 'contId',
368
+ type: 'text',
369
+ name: '',
370
+ opacity: 1,
371
+ visible: true,
372
+ selectable: false,
373
+ removable: false,
374
+ alwaysOnTop: true,
375
+ showInExport: true,
376
+ x: position1[0] * DPI + 280,
377
+ y: position1[1] * DPI + 74,
378
+ width: 111,
379
+ height: 40,
380
+ rotation: 0,
381
+ animations: [],
382
+ blurEnabled: false,
383
+ blurRadius: 10,
384
+ brightnessEnabled: false,
385
+ brightness: 0,
386
+ sepiaEnabled: false,
387
+ grayscaleEnabled: false,
388
+ shadowEnabled: false,
389
+ shadowBlur: 5,
390
+ shadowOffsetX: 0,
391
+ shadowOffsetY: 0,
392
+ shadowColor: 'black',
393
+ shadowOpacity: 1,
394
+ draggable: false,
395
+ resizable: false,
396
+ contentEditable: false,
397
+ styleEditable: false,
398
+ text: `Cont ID`,
399
+ placeholder: '',
400
+ fontSize: 8,
401
+ fontFamily: 'Roboto',
402
+ fontStyle: 'normal',
403
+ fontWeight: 'normal',
404
+ textDecoration: '',
405
+ fill: 'black',
406
+ align: 'center',
407
+ verticalAlign: 'top',
408
+ strokeWidth: 0,
409
+ stroke: 'black',
410
+ lineHeight: 1.2,
411
+ letterSpacing: 0,
412
+ backgroundEnabled: false,
413
+ backgroundColor: '#7ED321',
414
+ backgroundOpacity: 1,
415
+ backgroundCornerRadius: 0.5,
416
+ backgroundPadding: 0.5,
417
+ }
418
+ ];
419
+
420
+ elements.forEach(element => page.addElement(element));
421
+ store.history.clear();
422
+ };
@@ -0,0 +1,283 @@
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
+ width: number;
76
+ height: number;
77
+ pages: Page[];
78
+ history: {
79
+ clear: () => void;
80
+ };
81
+ }
82
+
83
+ export const addElementsforRealPennedLetters = (store: Store): void => {
84
+ const page = store.pages[0];
85
+
86
+ const elements: Element[] = [
87
+ {
88
+ id: "blocked",
89
+ type: "figure",
90
+ name: "",
91
+ opacity: 1,
92
+ visible: true,
93
+ selectable: false,
94
+ removable: false,
95
+ alwaysOnTop: true,
96
+ showInExport: true,
97
+ x: -1.850472230905276e-12,
98
+ y: -2.9487523534043754e-13,
99
+ width: 528,
100
+ height: 80.739,
101
+ rotation: 0,
102
+ animations: [],
103
+ blurEnabled: false,
104
+ blurRadius: 10,
105
+ brightnessEnabled: false,
106
+ brightness: 0,
107
+ sepiaEnabled: false,
108
+ grayscaleEnabled: false,
109
+ shadowEnabled: false,
110
+ shadowBlur: 5,
111
+ shadowOffsetX: 0,
112
+ shadowOffsetY: 0,
113
+ shadowColor: "black",
114
+ shadowOpacity: 1,
115
+ draggable: false,
116
+ resizable: false,
117
+ contentEditable: false,
118
+ styleEditable: true,
119
+ subType: "rect",
120
+ fill: "rgba(208,0,0,1)",
121
+ dash: [],
122
+ strokeWidth: 0,
123
+ stroke: "#0c0c0c",
124
+ cornerRadius: 0,
125
+ },
126
+ {
127
+ id: 'header',
128
+ type: 'text',
129
+ name: '',
130
+ opacity: 1,
131
+ visible: true,
132
+ selectable: true,
133
+ removable: false,
134
+ alwaysOnTop: true,
135
+ showInExport: true,
136
+ x: 25,
137
+ y: 130,
138
+ width: 300,
139
+ height: 40,
140
+ rotation: 0,
141
+ animations: [],
142
+ blurEnabled: false,
143
+ blurRadius: 10,
144
+ brightnessEnabled: false,
145
+ brightness: 0,
146
+ sepiaEnabled: false,
147
+ grayscaleEnabled: false,
148
+ shadowEnabled: false,
149
+ shadowBlur: 5,
150
+ shadowOffsetX: 0,
151
+ shadowOffsetY: 0,
152
+ shadowColor: 'black',
153
+ shadowOpacity: 1,
154
+ draggable: false,
155
+ resizable: false,
156
+ contentEditable: true,
157
+ styleEditable: false,
158
+ text: "Hi FirstNaame,",
159
+ fontSize: 20,
160
+ fontFamily: 'lexi Regular',
161
+ fontStyle: 'normal',
162
+ fontWeight: 'normal',
163
+ textDecoration: '',
164
+ fill: 'blue',
165
+ align: 'start',
166
+ verticalAlign: 'top',
167
+ strokeWidth: 0,
168
+ stroke: 'black',
169
+ lineHeight: 1.75,
170
+ letterSpacing: 0,
171
+ backgroundEnabled: false,
172
+ backgroundColor: '#7ED321',
173
+ backgroundOpacity: 1,
174
+ backgroundCornerRadius: 0.5,
175
+ backgroundPadding: 0.5,
176
+ },
177
+ {
178
+ id: 'content',
179
+ type: 'text',
180
+ name: '',
181
+ opacity: 1,
182
+ visible: true,
183
+ selectable: true,
184
+ removable: false,
185
+ alwaysOnTop: true,
186
+ showInExport: true,
187
+ x: 25.499999994998234,
188
+ y: 220.60449354986338,
189
+ width: 477,
190
+ height: 400,
191
+ rotation: 0,
192
+ animations: [],
193
+ blurEnabled: false,
194
+ blurRadius: 10,
195
+ brightnessEnabled: false,
196
+ brightness: 0,
197
+ sepiaEnabled: false,
198
+ grayscaleEnabled: false,
199
+ shadowEnabled: false,
200
+ shadowBlur: 5,
201
+ shadowOffsetX: 0,
202
+ shadowOffsetY: 0,
203
+ shadowColor: 'black',
204
+ shadowOpacity: 1,
205
+ draggable: false,
206
+ resizable: false,
207
+ contentEditable: true,
208
+ styleEditable: false,
209
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In recent projects, we've focused heavily on OLC to enhance digital engagement. Real Penned Letters, is a unique initiative.\n\nAs we continue to develop OLC platforms, we remain committed to integrating elements like Real Penned Letters to enhance digital and personal communication. \n",
210
+ fontSize: 20,
211
+ fontFamily: 'lexi Regular',
212
+ fontStyle: 'normal',
213
+ fontWeight: 'normal',
214
+ textDecoration: '',
215
+ fill: 'blue',
216
+ align: 'start',
217
+ verticalAlign: 'top',
218
+ strokeWidth: 0,
219
+ stroke: 'black',
220
+ lineHeight: 1.75,
221
+ letterSpacing: 0,
222
+ backgroundEnabled: false,
223
+ backgroundColor: '#7ED321',
224
+ backgroundOpacity: 1,
225
+ backgroundCornerRadius: 0.5,
226
+ backgroundPadding: 0.5,
227
+ },
228
+ {
229
+ id: 'footer',
230
+ type: 'text',
231
+ name: '',
232
+ opacity: 1,
233
+ visible: true,
234
+ selectable: true,
235
+ removable: false,
236
+ alwaysOnTop: true,
237
+ showInExport: true,
238
+ x: 322.49999999499846,
239
+ y: 651.7346179851188,
240
+ width: 180,
241
+ height: 75,
242
+ rotation: 0,
243
+ animations: [],
244
+ blurEnabled: false,
245
+ blurRadius: 10,
246
+ brightnessEnabled: false,
247
+ brightness: 0,
248
+ sepiaEnabled: false,
249
+ grayscaleEnabled: false,
250
+ shadowEnabled: false,
251
+ shadowBlur: 5,
252
+ shadowOffsetX: 0,
253
+ shadowOffsetY: 0,
254
+ shadowColor: 'black',
255
+ shadowOpacity: 1,
256
+ draggable: false,
257
+ resizable: false,
258
+ contentEditable: true,
259
+ styleEditable: false,
260
+ text: "Regards,\nYour Name",
261
+ fontSize: 20,
262
+ fontFamily: 'lexi Regular',
263
+ fontStyle: 'normal',
264
+ fontWeight: 'normal',
265
+ textDecoration: '',
266
+ fill: 'blue',
267
+ align: 'start',
268
+ verticalAlign: 'top',
269
+ strokeWidth: 0,
270
+ stroke: 'black',
271
+ lineHeight: 1.75,
272
+ letterSpacing: 0,
273
+ backgroundEnabled: false,
274
+ backgroundColor: '#7ED321',
275
+ backgroundOpacity: 1,
276
+ backgroundCornerRadius: 0.5,
277
+ backgroundPadding: 0.5,
278
+ }
279
+ ]
280
+
281
+ elements.forEach(element => page.addElement(element));
282
+ store.history.clear();
283
+ }