@openlettermarketing/olc-react-sdk 0.0.18 → 0.0.20

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