@openlettermarketing/olc-react-sdk 0.0.19 → 0.0.21
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.
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/.eslintignore +0 -1
- package/.eslintrc.cjs +0 -18
- package/.eslintrc.yml +0 -47
- package/.prettierignore +0 -3
- package/.prettierrc.yml +0 -5
- package/CHANGELOG.md +0 -4
- package/babel.config.json +0 -10
- package/examples/.eslintrc.yml +0 -4
- package/index.html +0 -18
- package/public/vite.svg +0 -1
- package/src/App.tsx +0 -72
- package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
- package/src/assets/images/input/cancel.tsx +0 -20
- package/src/assets/images/input/search.tsx +0 -20
- package/src/assets/images/modal-icons/cancelIcon.png +0 -0
- package/src/assets/images/modal-icons/del.tsx +0 -19
- package/src/assets/images/modal-icons/delete.svg +0 -3
- package/src/assets/images/modal-icons/modal-cross.tsx +0 -23
- package/src/assets/images/modal-icons/save.tsx +0 -23
- package/src/assets/images/templates/add-icon.svg +0 -5
- package/src/assets/images/templates/back-arrow.tsx +0 -19
- package/src/assets/images/templates/back-dialog-icon.png +0 -0
- package/src/assets/images/templates/back-dialog-icon.svg +0 -3
- package/src/assets/images/templates/barcode.png +0 -0
- package/src/assets/images/templates/bi-fold-self-mailers.tsx +0 -28
- package/src/assets/images/templates/black-trash-icon.svg +0 -3
- package/src/assets/images/templates/cancel.svg +0 -4
- package/src/assets/images/templates/cancelIcon.png +0 -0
- package/src/assets/images/templates/clipboard.svg +0 -3
- package/src/assets/images/templates/contact-search.svg +0 -3
- package/src/assets/images/templates/content-copy-icon.tsx +0 -24
- package/src/assets/images/templates/cross.svg +0 -3
- package/src/assets/images/templates/custom-template-icon-black.svg +0 -3
- package/src/assets/images/templates/custom-template-icon.svg +0 -3
- package/src/assets/images/templates/custom-template.tsx +0 -23
- package/src/assets/images/templates/dummy-template.svg +0 -21
- package/src/assets/images/templates/dynamic-field.tsx +0 -119
- package/src/assets/images/templates/edit-pencil-icon.tsx +0 -21
- package/src/assets/images/templates/filter-2.svg +0 -13
- package/src/assets/images/templates/info-icon.svg +0 -12
- package/src/assets/images/templates/info-icon.tsx +0 -37
- package/src/assets/images/templates/one-barcode.png +0 -0
- package/src/assets/images/templates/personal-letter.tsx +0 -53
- package/src/assets/images/templates/plus-icon.svg +0 -5
- package/src/assets/images/templates/postcard.tsx +0 -32
- package/src/assets/images/templates/professional-letter.tsx +0 -53
- package/src/assets/images/templates/real-penned-letters.tsx +0 -57
- package/src/assets/images/templates/search.svg +0 -3
- package/src/assets/images/templates/size-image-lg.tsx +0 -20
- package/src/assets/images/templates/size-image-mid.tsx +0 -20
- package/src/assets/images/templates/size-image.tsx +0 -20
- package/src/assets/images/templates/template-copy.svg +0 -3
- package/src/assets/images/templates/template-default-design.tsx +0 -21
- package/src/assets/images/templates/template-delete.svg +0 -3
- package/src/assets/images/templates/template-edit.svg +0 -4
- package/src/assets/images/templates/template-save-icon.svg +0 -3
- package/src/assets/images/templates/template-search-2.svg +0 -9
- package/src/assets/images/templates/template-search.svg +0 -4
- package/src/assets/images/templates/thumbnail.svg +0 -10
- package/src/assets/images/templates/trash-icon.svg +0 -13
- package/src/assets/images/templates/tri-fold-self-mailers.tsx +0 -93
- package/src/components/CreateTemplate/index.tsx +0 -381
- package/src/components/CreateTemplate/styles.scss +0 -363
- package/src/components/GenericUIBlocks/Button/index.tsx +0 -21
- package/src/components/GenericUIBlocks/Button/styles.scss +0 -15
- package/src/components/GenericUIBlocks/CircularProgress/index.tsx +0 -18
- package/src/components/GenericUIBlocks/CircularProgress/styles.scss +0 -98
- package/src/components/GenericUIBlocks/Dialog/index.tsx +0 -127
- package/src/components/GenericUIBlocks/Dialog/styles.scss +0 -106
- package/src/components/GenericUIBlocks/Divider/index.tsx +0 -12
- package/src/components/GenericUIBlocks/Divider/styles.scss +0 -7
- package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +0 -86
- package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +0 -77
- package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +0 -24
- package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +0 -9
- package/src/components/GenericUIBlocks/GenericSnackbar/index.tsx +0 -53
- package/src/components/GenericUIBlocks/GenericSnackbar/styles.scss +0 -34
- package/src/components/GenericUIBlocks/Grid/index.tsx +0 -82
- package/src/components/GenericUIBlocks/Input/index.tsx +0 -89
- package/src/components/GenericUIBlocks/Input/styles.scss +0 -80
- package/src/components/GenericUIBlocks/Typography/index.tsx +0 -18
- package/src/components/GenericUIBlocks/Typography/styles.scss +0 -27
- package/src/components/SidePanel/customFields/customFieldSection.tsx +0 -173
- package/src/components/SidePanel/customFields/styles.scss +0 -47
- package/src/components/SidePanel/index.tsx +0 -42
- package/src/components/SidePanel/templates/customTemplateSection.tsx +0 -503
- package/src/components/SidePanel/templates/styles.scss +0 -151
- package/src/components/TemplateBuilder/index.tsx +0 -301
- package/src/components/TemplateBuilder/styles.scss +0 -66
- package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +0 -58
- package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +0 -123
- package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +0 -98
- package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +0 -88
- package/src/components/TopNavigation/SaveTemplateModel/index.tsx +0 -60
- package/src/components/TopNavigation/SaveTemplateModel/styles.scss +0 -128
- package/src/components/TopNavigation/index.tsx +0 -406
- package/src/components/TopNavigation/styles.scss +0 -83
- package/src/importMeta.d.ts +0 -9
- package/src/index.scss +0 -137
- package/src/index.tsx +0 -79
- package/src/libs/test.ts +0 -7
- package/src/redux/actions/action-types.ts +0 -42
- package/src/redux/actions/customFieldAction.ts +0 -28
- package/src/redux/actions/snackbarActions.ts +0 -16
- package/src/redux/actions/templateActions.ts +0 -456
- package/src/redux/reducers/customFieldReducer.ts +0 -97
- package/src/redux/reducers/index.ts +0 -14
- package/src/redux/reducers/snackbarReducer.ts +0 -41
- package/src/redux/reducers/templateReducer.ts +0 -353
- package/src/redux/store.ts +0 -18
- package/src/styles/colors.scss +0 -61
- package/src/test/mocks.js +0 -89
- package/src/test/setupJest.js +0 -1
- package/src/utils/api.ts +0 -36
- package/src/utils/constants.ts +0 -40
- package/src/utils/customStyles.ts +0 -135
- package/src/utils/fetchWrapper.ts +0 -68
- package/src/utils/fonts.json +0 -1597
- package/src/utils/helper.ts +0 -19
- package/src/utils/local-storage.ts +0 -15
- package/src/utils/message.ts +0 -71
- package/src/utils/template-builder.ts +0 -147
- package/src/utils/templateRestrictedArea/biFold.ts +0 -433
- package/src/utils/templateRestrictedArea/postCard.ts +0 -439
- package/src/utils/templateRestrictedArea/professional.ts +0 -422
- package/src/utils/templateRestrictedArea/realPenned.ts +0 -244
- package/src/utils/templateRestrictedArea/triFold.ts +0 -434
- package/tsconfig.json +0 -29
- package/tsconfig.node.json +0 -12
- package/vite.config.ts +0 -8
- 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;
|