@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,135 +0,0 @@
1
- import React from 'react';
2
-
3
- export interface CustomCSSProperties extends React.CSSProperties {
4
- '--sb-track-color'?: string;
5
- '--sb-thumb-color'?: string;
6
- '--primaryColor'?: string;
7
- '--svgColor'?: string;
8
- '--textColor'?: string;
9
- '--productCardBgColor'?: string;
10
- '--productCardBackgroundColorActive'?: string;
11
- '--postCardBgColor'?: string;
12
- '--postCardBackgroundColorActive'?: string;
13
- '--postCardSVGColor'?: string;
14
- '--inputBgColor'?: string;
15
- '--inputTextColor'?: string;
16
- '--inputBorderColor'?: string;
17
- '--inputSearchAppliedBg'?: string;
18
- '--inputSearchIcon'?: string;
19
- '--selectBgColor'?: string;
20
- '--selectTextColor'?: string;
21
- '--selectBorderColor'?: string;
22
- '--selectMenuBgColor'?: string;
23
- '--selectOptionTextColor'?: string;
24
- '--selectOptionBorderColor'?: string;
25
- '--selectOptionFocusedColor'?: string;
26
- '--selectOptionFocusedTextColor'?: string;
27
- '--selectOptionSelectedColor'?: string;
28
- '--selectOptionSelectedTextColor'?: string;
29
- '--selectOptionSelectedBg'?: string;
30
- '--topbarBgColor'?: string;
31
- '--sidepanelBgColor'?: string;
32
- '--sidepanelTextColor'?: string;
33
- '--sidepanelTextColorHover'?: string;
34
- '--sidepanelSVGColor'?: string;
35
- '--sidepanelSVGColorActive'?: string;
36
- '--sidepanelOptionHoverColor'?: string;
37
- '--customFieldBorderColor'?: string;
38
- '--customFieldTextColor'?: string;
39
- '--customFieldCopySVGColor'?: string;
40
- '--cardBgColor'?: string;
41
- '--cardTextColor'?: string;
42
- '--dialogModalBgColor'?: string;
43
- '--dialogModalHeadingColor'?: string;
44
- '--dialogModalTextColor'?: string;
45
- '--dialogModalSVGColor'?: string;
46
- '--borderColor'?: string;
47
- '--secondaryButtonBgColor'?: string;
48
- '--secondaryButtonTextColor'?: string;
49
- '--primaryButtonBgColor'?: string;
50
- '--primaryButtonTextColor'?: string;
51
- '--iconHoverBgColor'?: string;
52
- '--mainBackgroundColor'?: string;
53
- '--footerBgColor'?: string;
54
- '--red'?: string;
55
- }
56
-
57
- export interface Styles {
58
- root: CustomCSSProperties;
59
- }
60
-
61
- export const customStyles: Styles = {
62
- root: {
63
- // scroll bars colors
64
- '--sb-track-color': '#232e33',
65
- '--sb-thumb-color': '#fb8500',
66
- // core colors
67
- '--primaryColor': '#fb8500',
68
- '--svgColor': '#ffb703',
69
- // text colors
70
- '--textColor': '#fff',
71
- // product Card Background colors
72
- '--productCardBgColor': '#2C394B',
73
- '--productCardBackgroundColorActive': '#fff8ee',
74
- // post Card Background colors
75
- '--postCardBgColor': '#2C394B',
76
- '--postCardBackgroundColorActive': '#fff8ee',
77
- '--postCardSVGColor': '#FDECD3',
78
- // input colors
79
- '--inputBgColor': 'transparent',
80
- '--inputTextColor': '#fff',
81
- '--inputBorderColor': '#fff',
82
- '--inputSearchAppliedBg': 'transparent',
83
- '--inputSearchIcon': '#fff8ee',
84
- // select input & option colors
85
- '--selectBgColor': 'transparent',
86
- '--selectTextColor': '#fff',
87
- '--selectBorderColor': '#fff',
88
- '--selectMenuBgColor': '#ffb703',
89
- '--selectOptionTextColor': '#fff',
90
- '--selectOptionBorderColor': '#5454544d',
91
- '--selectOptionFocusedColor': '#ffb703',
92
- '--selectOptionFocusedTextColor': '#023047',
93
- '--selectOptionSelectedColor': '#ffb703',
94
- '--selectOptionSelectedTextColor': '#023047',
95
- '--selectOptionSelectedBg': '#FFF8EE',
96
- // template builder colors
97
- '--topbarBgColor': '#023047',
98
- '--sidepanelBgColor': '#023047',
99
- '--sidepanelTextColor': '#fff',
100
- '--sidepanelTextColorHover': '#fff',
101
- '--sidepanelSVGColor': '#fff',
102
- '--sidepanelSVGColorActive': '#fff',
103
- '--sidepanelOptionHoverColor': '#000',
104
- // custom fields colors
105
- '--customFieldBorderColor': '#fff',
106
- '--customFieldTextColor': '#fff',
107
- '--customFieldCopySVGColor': '#fff',
108
- // builder Layer colors
109
- '--cardBgColor': '#fff',
110
- '--cardTextColor': '#000',
111
- // Dialog Modal colors
112
- '--dialogModalBgColor': '#023047',
113
- '--dialogModalHeadingColor': '#fb8500',
114
- '--dialogModalTextColor': '#fff',
115
- '--dialogModalSVGColor': '#ffb703',
116
- // border colors
117
- '--borderColor': 'rgba(0, 0, 0, 0.5)',
118
- // button colors
119
- '--secondaryButtonBgColor': '#fff',
120
- '--secondaryButtonTextColor': '#000',
121
- '--primaryButtonBgColor': '#fb8500',
122
- '--primaryButtonTextColor': '#fff',
123
- // topbar colors
124
- '--iconHoverBgColor': 'rgba(0, 0, 0, 0.076)',
125
-
126
- // background colors
127
- '--mainBackgroundColor': '#023047',
128
-
129
- // footer bg color
130
- '--footerBgColor': '#023047',
131
-
132
- // red shades
133
- '--red': '#ff0000',
134
- },
135
- };
@@ -1,68 +0,0 @@
1
- import { apiKey, appMode } from './helper'
2
-
3
- const API_BASE_URL = appMode === 'test' ? 'https://stageapi.openletterconnect.com/api/v1' : 'https://stageapi.openletterconnect.com/api/v1';
4
-
5
- const getHeaders = (additionalHeaders: Record<string, string> = {}) => ({
6
- 'Authorization': `Bearer ${apiKey}`,
7
- 'Content-Type': 'application/json',
8
- 'Accept': 'application/json',
9
- ...additionalHeaders,
10
- });
11
-
12
- export interface RequestOptions {
13
- method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
14
- headers?: Record<string, string>;
15
- body?: any;
16
- params?: Record<string, string>;
17
- }
18
-
19
-
20
- const fetchWrapper = async (endpoint: string, options: RequestOptions) => {
21
- const url = new URL(`${API_BASE_URL}/${endpoint}`);
22
- if (options.method === 'GET' && options.params) {
23
- Object.entries(options.params).forEach(([key, value]) => {
24
- url.searchParams.append(key, value);
25
- });
26
- }
27
-
28
- const fetchOptions: RequestInit = {
29
- method: options.method,
30
- headers: getHeaders(options.headers),
31
- };
32
-
33
- if (options.method !== 'GET' && options.body) {
34
- fetchOptions.body = JSON.stringify(options.body);
35
- }
36
-
37
- // Add body to fetchOptions if present
38
- if (options.body) {
39
- if (options.body instanceof FormData) {
40
- fetchOptions.body = options.body;
41
- // @ts-ignore
42
- delete fetchOptions?.headers['Content-Type'];
43
- } else {
44
- fetchOptions.headers = getHeaders(options.headers);
45
- }
46
- }
47
-
48
- try {
49
- const response = await fetch(url.toString(), fetchOptions);
50
-
51
- if (!response.ok) {
52
- const errorData = await response.json();
53
- throw new Error(errorData.message || 'An error occurred');
54
- }
55
-
56
- if (response.status === 204) {
57
- return null;
58
- }
59
-
60
- const data = await response.json();
61
- return { status: response.status, data };
62
-
63
- } catch (error) {
64
- return error
65
- }
66
- };
67
-
68
- export default fetchWrapper;