@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,330 +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 addRestrictedAreaToTriFold = (store: Store, size: [number, number], barcodeSrc: string): void => {
87
- const page = store.pages[0];
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: store.width - size[0] * DPI - 0.15 * DPI,
101
- y: store.height - size[1] * DPI - 0.125 * DPI - 4 * DPI,
102
- width: size[0] * DPI,
103
- height: size[1] * DPI,
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: store.width - size[0] * DPI - 0.15 * DPI + 5,
140
- y: store.height - size[1] * DPI - 0.125 * DPI + 20 - 4 * DPI,
141
- width: 240,
142
- height: 20,
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: 'indicia',
183
- type: 'text',
184
- name: '',
185
- opacity: 1,
186
- visible: true,
187
- selectable: false,
188
- removable: false,
189
- alwaysOnTop: true,
190
- showInExport: true,
191
- x: store.width - 111 - 0.15 * DPI,
192
- y: store.height - size[1] * DPI + 10 - 4 * DPI,
193
- width: 111,
194
- height: 40,
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
- text: `POSTAGE\nINDICIA`,
214
- placeholder: '',
215
- fontSize: 18,
216
- fontFamily: 'Roboto',
217
- fontStyle: 'normal',
218
- fontWeight: 'normal',
219
- textDecoration: '',
220
- fill: 'black',
221
- align: 'center',
222
- verticalAlign: 'top',
223
- strokeWidth: 0,
224
- stroke: 'black',
225
- lineHeight: 1.2,
226
- letterSpacing: 0,
227
- backgroundEnabled: false,
228
- backgroundColor: '#7ED321',
229
- backgroundOpacity: 1,
230
- backgroundCornerRadius: 0.5,
231
- backgroundPadding: 0.5,
232
- },
233
- {
234
- id: 'barcode',
235
- type: 'image',
236
- name: '',
237
- opacity: 1,
238
- visible: true,
239
- selectable: false,
240
- removable: false,
241
- alwaysOnTop: true,
242
- showInExport: true,
243
- y: store.height - 28 - size[1] * DPI + 100 - 4 * DPI,
244
- x: store.width - size[0] * DPI - 0.15 * DPI + 5,
245
- width: size[0] * DPI - 23,
246
- height: 15,
247
- rotation: 0,
248
- animations: [],
249
- blurEnabled: false,
250
- brightnessEnabled: false,
251
- brightness: 0,
252
- sepiaEnabled: false,
253
- grayscaleEnabled: false,
254
- shadowEnabled: false,
255
- shadowOffsetX: 0,
256
- shadowOffsetY: 0,
257
- shadowOpacity: 1,
258
- draggable: false,
259
- resizable: false,
260
- contentEditable: false,
261
- styleEditable: false,
262
- src: barcodeSrc,
263
- cropX: 0,
264
- cropY: 0,
265
- cropWidth: 1,
266
- cropHeight: 1,
267
- cornerRadius: 0,
268
- flipX: false,
269
- flipY: false,
270
- clipSrc: '',
271
- borderSize: 0,
272
- keepRatio: false,
273
- },
274
- {
275
- id: 'recipient-address',
276
- type: 'text',
277
- name: '',
278
- opacity: 1,
279
- visible: true,
280
- selectable: false,
281
- removable: false,
282
- alwaysOnTop: true,
283
- showInExport: true,
284
- x: store.width - size[0] * DPI - 0.15 * DPI + 5,
285
- y: store.height - size[1] * DPI - 0.125 * DPI + 120 - 4 * DPI,
286
- width: 240,
287
- height: 20,
288
- rotation: 0,
289
- animations: [],
290
- blurEnabled: false,
291
- blurRadius: 10,
292
- brightnessEnabled: false,
293
- brightness: 0,
294
- sepiaEnabled: false,
295
- grayscaleEnabled: false,
296
- shadowEnabled: false,
297
- shadowBlur: 5,
298
- shadowOffsetX: 0,
299
- shadowOffsetY: 0,
300
- shadowColor: 'black',
301
- shadowOpacity: 1,
302
- draggable: false,
303
- resizable: false,
304
- contentEditable: false,
305
- styleEditable: false,
306
- text: 'RECIPIENT ADDRESS \nWILL AUTOMATICALLY \nBE PRINTED IN THIS \nPOSITION',
307
- placeholder: '',
308
- fontSize: 13,
309
- fontFamily: 'Roboto',
310
- fontStyle: 'normal',
311
- fontWeight: 'normal',
312
- textDecoration: '',
313
- fill: 'black',
314
- align: 'start',
315
- verticalAlign: 'top',
316
- strokeWidth: 0,
317
- stroke: 'black',
318
- lineHeight: 1.2,
319
- letterSpacing: 0,
320
- backgroundEnabled: false,
321
- backgroundColor: '#7ED321',
322
- backgroundOpacity: 1,
323
- backgroundCornerRadius: 0.5,
324
- backgroundPadding: 0.5,
325
- },
326
- ];
327
-
328
- elements.forEach(element => page.addElement(element));
329
- store.history.clear();
330
- };
@@ -1,91 +0,0 @@
1
- import { createBorder, createSafetyTextElement } from "../helper";
2
- import { Element, Store } from "./types"
3
-
4
- export const addSafetyBordersToBiFold = (store: Store): void => {
5
- const randomizedId = Math.random().toString(36).substring(2, 7);
6
-
7
- const safetyBordersTextFirst = createSafetyTextElement(
8
- `safety-text-1-${randomizedId}`,
9
- -8.29,
10
- 5.81,
11
- 543,
12
- "Keep important text/images inside the green line. Content beyond this line may be trimmed during production."
13
- );
14
-
15
- const safetyLineTextFirst = createSafetyTextElement(
16
- `safety-line-1-${randomizedId}`,
17
- 880,
18
- -10.5,
19
- 600,
20
- "Fold Line",
21
- 90
22
- );
23
-
24
-
25
- const firstPageBorders: Element = {
26
- id: `safety-border-1-${randomizedId}`,
27
- type: "group",
28
- opacity: 1,
29
- visible: true,
30
- selectable: false,
31
- removable: false,
32
- alwaysOnTop: true,
33
- showInExport: false,
34
- children: [
35
- createBorder(`top-1-${randomizedId}`, 25.96, 24.58, 1676, 2.94, 0),
36
- createBorder(`bottom-1-${randomizedId}`, 25.96, 551.74, 1676, 2.94, 0),
37
- createBorder(`left-1-${randomizedId}`, 24.5, 553.349, 527.167, 2.94, -90),
38
- createBorder(`right-1-${randomizedId}`, 1700.5, 555.22, 528, 2.94, -90),
39
- createBorder(`fold-line-1-${randomizedId}`, 863, 580, 580, 2, -90, 'rgba(208,2,27,1)'),
40
- ],
41
- };
42
-
43
- const safetyBordersTextSecond = createSafetyTextElement(
44
- `safety-text-2-${randomizedId}`,
45
- -8.616,
46
- 5.09,
47
- 543,
48
- "Keep important text/images inside the green line. Content beyond this line may be trimmed during production."
49
- );
50
-
51
- const safetyLineTextSecond = createSafetyTextElement(
52
- `safety-line-2-${randomizedId}`,
53
- 880,
54
- -10.5,
55
- 600,
56
- "Fold Line",
57
- 90
58
- );
59
-
60
- const secondPageBorders: Element = {
61
- id: `safety-border-2-${randomizedId}`,
62
- type: "group",
63
- opacity: 1,
64
- visible: true,
65
- selectable: false,
66
- removable: false,
67
- alwaysOnTop: true,
68
- showInExport: false,
69
- children: [
70
- createBorder(`top-2-${randomizedId}`, 25.96, 24.58, 1676, 2.94, 0),
71
- createBorder(`bottom-2-${randomizedId}`, 25.96, 551.74, 1676, 2.94, 0),
72
- createBorder(`left-2-${randomizedId}`, 24.5, 553.349, 527.167, 2.94, -90),
73
- createBorder(`right-2-${randomizedId}`, 1700.5, 555.22, 528, 2.94, -90),
74
- createBorder(`fold-line-2-${randomizedId}`, 863, 580, 580, 2, -90, 'rgba(208,2,27,1)'),
75
- ],
76
- };
77
-
78
- // Add elements to the pages
79
- store.pages[0]?.addElement(firstPageBorders);
80
- store?.pages[0]?.addElement(safetyBordersTextFirst);
81
- store?.pages[0]?.addElement(safetyLineTextFirst);
82
-
83
- store.pages[1]?.addElement(secondPageBorders);
84
- store.pages[1]?.addElement(safetyBordersTextSecond);
85
- store?.pages[1]?.addElement(safetyLineTextSecond);
86
-
87
- // Clear history
88
- store.history.clear();
89
- };
90
-
91
-
@@ -1,43 +0,0 @@
1
- import { StoreType } from "polotno/model/store";
2
-
3
- // Safety Border Files
4
- import { addSafetyBordersTo4x6PostCard, addSafetyBordersTo6x9PostCard, addSafetyBordersTo6x11PostCard, addSafetyBordersTo12x9PostCard } from './postCards'
5
- import { addSafetyBordersToPersonalLetter } from './personal'
6
- import { addSafetyBordersToNonWindowProfessioanl, addSafetyBordersToWindowProfessioanl } from './professional'
7
- import { addSafetyBordersToBiFold } from './biFold'
8
- import { addSafetyBordersToTriFold } from './triFold'
9
- import { addSafetyBordersToSnapPackMailer } from './snapPack'
10
-
11
-
12
- export const addSafetyBordersForTemplates = (productId: string, store: StoreType) => {
13
-
14
- const jsonData = store?.toJSON();
15
- const page: any = jsonData?.pages?.[0];
16
- const borderExist = page?.children?.some(
17
- (item: any) => item?.id?.includes('safety-border-')
18
- );
19
- if (borderExist || !productId) return;
20
- if (+productId === 13) {
21
- addSafetyBordersTo4x6PostCard(store);
22
- } else if (+productId === 14) {
23
- addSafetyBordersTo6x9PostCard(store);
24
- } else if (+productId === 15) {
25
- addSafetyBordersTo6x11PostCard(store);
26
- } else if (+productId === 5) {
27
- addSafetyBordersToPersonalLetter(store);
28
- } else if (+productId === 4) {
29
- addSafetyBordersToNonWindowProfessioanl(store);
30
- } else if (+productId === 2) {
31
- addSafetyBordersToWindowProfessioanl(store);
32
- } else if (+productId === 9) {
33
- addSafetyBordersToBiFold(store);
34
- } else if (+productId === 11) {
35
- addSafetyBordersToTriFold(store);
36
- } else if (+productId === 18) {
37
- addSafetyBordersToSnapPackMailer(store);
38
- } else if (+productId === 21) {
39
- addSafetyBordersTo12x9PostCard(store);
40
- } else if (+productId === 38) {
41
- addSafetyBordersToNonWindowProfessioanl(store);
42
- }
43
- };
@@ -1,41 +0,0 @@
1
- import { createBorder, createSafetyTextElement } from "../helper";
2
- import { Element, Store } from "./types"
3
-
4
- export const addSafetyBordersToPersonalLetter = (store: Store): void => {
5
- const randomizedId = Math.random().toString(36).substring(2, 7);
6
-
7
- const safetyBordersTextFirst = createSafetyTextElement(
8
- `safety-text-1-${randomizedId}`,
9
- -15,
10
- 5.81,
11
- 543,
12
- "Keep important text/images inside the green line. Content beyond this line may be trimmed during production."
13
- );
14
-
15
- const firstPageBorders: Element = {
16
- id: `safety-border-1-${randomizedId}`,
17
- type: "group",
18
- opacity: 1,
19
- visible: true,
20
- selectable: false,
21
- removable: false,
22
- alwaysOnTop: true,
23
- showInExport: false,
24
- children: [
25
- createBorder(`top-1-${randomizedId}`, 24, 22, 480, 3, 0),
26
- createBorder(`bottom-1-${randomizedId}`, 24, 792, 480, 3, 0),
27
- createBorder(`left-1-${randomizedId}`, 22, 793, 770, 3, -90),
28
- createBorder(`right-1-${randomizedId}`, 503, 793, 770, 3, -90),
29
- ],
30
- };
31
-
32
- // Add elements to the pages
33
- store.pages[0]?.addElement(firstPageBorders);
34
- store?.pages[0]?.addElement(safetyBordersTextFirst);
35
-
36
-
37
- // Clear history
38
- store.history.clear();
39
- };
40
-
41
-