@openlettermarketing/olc-react-sdk 0.0.15 → 0.0.17
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 +4 -4
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +0 -4
- package/src/components/GenericUIBlocks/Button/styles.scss +1 -1
- package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +1 -1
- package/src/components/SidePanel/templates/customTemplateSection.tsx +22 -24
- package/src/components/TemplateBuilder/index.tsx +1 -1
- package/src/index.scss +10 -3
- package/src/index.tsx +12 -13
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import {Routes, Route} from 'react-router-dom';
|
|
|
5
5
|
import {createStore, StoreType} from 'polotno/model/store';
|
|
6
6
|
|
|
7
7
|
// components
|
|
8
|
-
// import GenericSnackbar from './components/GenericUIBlocks/GenericSnackbar';
|
|
9
8
|
import CreateTemplate from './components/CreateTemplate';
|
|
10
9
|
import TemplateBuilder from './components/TemplateBuilder';
|
|
11
10
|
import {createGlobalStyle} from 'styled-components';
|
|
@@ -66,9 +65,6 @@ const App: React.FC<AppProps> = ({secretKey, returnRoute, styles}) => {
|
|
|
66
65
|
element={<TemplateBuilder store={store} returnRoute={returnRoute} />}
|
|
67
66
|
/>
|
|
68
67
|
</Routes>
|
|
69
|
-
|
|
70
|
-
{/* SNACKBAR FOR NOTIFICATIONS */}
|
|
71
|
-
{/* <GenericSnackbar /> */}
|
|
72
68
|
</>
|
|
73
69
|
);
|
|
74
70
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
1
|
+
import React, {useEffect, useState} from 'react';
|
|
2
|
+
import {observer} from 'mobx-react-lite';
|
|
3
|
+
import {SectionTab} from 'polotno/side-panel';
|
|
4
|
+
import {useDispatch, useSelector} from 'react-redux';
|
|
5
|
+
import type {StoreType} from 'polotno/model/store';
|
|
6
|
+
import type {TemplatesSection} from 'polotno/side-panel';
|
|
7
7
|
import {
|
|
8
8
|
clearAllTemplates,
|
|
9
9
|
getOneTemplate,
|
|
10
10
|
getAllTemplateCategories,
|
|
11
11
|
getAllTemplatesByTab,
|
|
12
12
|
} from '../../../../src/redux/actions/templateActions';
|
|
13
|
-
import {
|
|
13
|
+
import {AppDispatch, RootState} from '../../../redux/store';
|
|
14
14
|
// @ts-ignore
|
|
15
|
-
import DesignIcon from '../../../assets/images/templates/template-default-design.tsx'
|
|
15
|
+
import DesignIcon from '../../../assets/images/templates/template-default-design.tsx';
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
import dummyTemplateIcon from
|
|
17
|
+
import dummyTemplateIcon from '../../../assets/images/templates/dummy-template.svg';
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import CustomTemplate from '../../../assets/images/templates/custom-template';
|
|
20
20
|
import Typography from '../../GenericUIBlocks/Typography';
|
|
21
21
|
import './styles.scss';
|
|
22
22
|
import Dialog from '../../GenericUIBlocks/Dialog';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import GeneralSelect from '../../GenericUIBlocks/GeneralSelect'
|
|
26
|
-
import Input from '../../GenericUIBlocks/Input'
|
|
23
|
+
import {multiPageLetters, templateTypes, DPI} from '../../../utils/constants';
|
|
24
|
+
import {drawRestrictedAreaOnPage} from '../../../utils/template-builder';
|
|
25
|
+
import GeneralSelect from '../../GenericUIBlocks/GeneralSelect';
|
|
26
|
+
import Input from '../../GenericUIBlocks/Input';
|
|
27
27
|
import ModalCross from '../../../assets/images/modal-icons/modal-cross';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import {MESSAGES} from '../../../utils/message';
|
|
29
|
+
import {TEMPLATE_LOADING} from '../../../redux/actions/action-types';
|
|
30
30
|
|
|
31
31
|
type SideSection = typeof TemplatesSection;
|
|
32
32
|
|
|
33
33
|
const designDialogStyles = {
|
|
34
|
-
maxWidth:
|
|
35
|
-
minHeight:
|
|
36
|
-
}
|
|
34
|
+
maxWidth: '600px',
|
|
35
|
+
minHeight: '270px',
|
|
36
|
+
};
|
|
37
37
|
|
|
38
38
|
const templateTextStyles: React.CSSProperties = {
|
|
39
39
|
color: `var(--textColor)`,
|
|
@@ -44,7 +44,6 @@ const templateTextStyles: React.CSSProperties = {
|
|
|
44
44
|
marginBottom: `16px`,
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
|
|
48
47
|
export type Payload = {
|
|
49
48
|
tab: string;
|
|
50
49
|
page: number;
|
|
@@ -133,8 +132,8 @@ const customTemplateSection: SideSection = {
|
|
|
133
132
|
currentTemplateType?.id === '1'
|
|
134
133
|
? 'my-templates'
|
|
135
134
|
: currentTemplateType?.id === '2'
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
? 'team-templates'
|
|
136
|
+
: 'olc-templates',
|
|
138
137
|
page: 1,
|
|
139
138
|
pageSize: 500,
|
|
140
139
|
productId: product?.id,
|
|
@@ -326,7 +325,7 @@ const customTemplateSection: SideSection = {
|
|
|
326
325
|
<div className="custom-template-section">
|
|
327
326
|
{isShowDialog.open && isShowDialog.model === 'design-own' && (
|
|
328
327
|
<Dialog
|
|
329
|
-
icon={<ModalCross fill="var(--primaryColor)"/>}
|
|
328
|
+
icon={<ModalCross fill="var(--primaryColor)" />}
|
|
330
329
|
title={MESSAGES.TEMPLATE.DESIGN_YOUR_OWN.TITLE}
|
|
331
330
|
subHeading={MESSAGES.TEMPLATE.DESIGN_YOUR_OWN.HEADING}
|
|
332
331
|
description={MESSAGES.TEMPLATE.DESIGN_YOUR_OWN.PARAGRAPH}
|
|
@@ -413,7 +412,7 @@ const customTemplateSection: SideSection = {
|
|
|
413
412
|
className="default-design"
|
|
414
413
|
onClick={() => handleDialogChange('design-own')}
|
|
415
414
|
>
|
|
416
|
-
<DesignIcon fill="var(--
|
|
415
|
+
<DesignIcon fill="var(--svgColorSecondary)" />
|
|
417
416
|
<Typography style={templateTextStyles}>
|
|
418
417
|
Design Your Own
|
|
419
418
|
</Typography>
|
|
@@ -502,4 +501,3 @@ const customTemplateSection: SideSection = {
|
|
|
502
501
|
};
|
|
503
502
|
|
|
504
503
|
export default customTemplateSection;
|
|
505
|
-
|
package/src/index.scss
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
// primary color
|
|
6
6
|
--primaryColor: #ed5c2f;
|
|
7
7
|
--svgColor: #fdb515;
|
|
8
|
+
--svgColorSecondary: #ed5c2f;
|
|
9
|
+
// main background color
|
|
10
|
+
--mainBackgroundColor: #ffffff;
|
|
8
11
|
// text colors
|
|
9
12
|
--textColor: #000;
|
|
10
13
|
// product Card Background color
|
|
@@ -31,7 +34,7 @@
|
|
|
31
34
|
--selectOptionFocusedTextColor: #000;
|
|
32
35
|
--selectOptionSelectedColor: #fff8ee;
|
|
33
36
|
--selectOptionSelectedTextColor: #000;
|
|
34
|
-
--selectOptionSelectedBg: #
|
|
37
|
+
--selectOptionSelectedBg: #fff8ee;
|
|
35
38
|
// template builder colors
|
|
36
39
|
--topbarBgColor: #fff;
|
|
37
40
|
--sidepanelBgColor: #fff;
|
|
@@ -39,6 +42,7 @@
|
|
|
39
42
|
--sidepanelSVGColor: #303030;
|
|
40
43
|
--sidepanelSVGColorActive: #ed5c2f;
|
|
41
44
|
--sidepanelOptionHoverColor: #fff8ee;
|
|
45
|
+
--sidepanelTextColorHover: #ed5c2f;
|
|
42
46
|
// custom fields colors
|
|
43
47
|
--customFieldBorderColor: #303030;
|
|
44
48
|
--customFieldTextColor: #303030;
|
|
@@ -91,20 +95,23 @@
|
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
.bp5-navbar {
|
|
94
|
-
z-index:
|
|
98
|
+
z-index: 10;
|
|
95
99
|
color: var(--textColor);
|
|
96
100
|
background-color: var(--mainBackgroundColor);
|
|
97
101
|
.bp5-card {
|
|
98
102
|
color: var(--cardTextColor);
|
|
99
103
|
background-color: var(--cardBgColor);
|
|
100
104
|
}
|
|
101
|
-
.bp5-button-text {
|
|
105
|
+
.polotno-close-panel .bp5-button-text {
|
|
102
106
|
color: var(--textColor);
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
.go4160152499,
|
|
107
111
|
.polotno-workspace-inner,
|
|
112
|
+
.polotno-panel-container,
|
|
113
|
+
.polotno-panel-container > div,
|
|
114
|
+
.polotno-panel-container > div > div,
|
|
108
115
|
.polotno-panel-container > div > div > div {
|
|
109
116
|
&::-webkit-scrollbar {
|
|
110
117
|
width: 10px;
|
package/src/index.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import { BrowserRouter as Router } from 'react-router-dom';
|
|
|
5
5
|
import { Provider } from 'react-redux';
|
|
6
6
|
import store from './redux/store';
|
|
7
7
|
import App from './App';
|
|
8
|
-
|
|
9
8
|
import './index.scss';
|
|
10
9
|
|
|
11
10
|
// fonts
|
|
@@ -64,17 +63,17 @@ const TemplateBuilder = ({
|
|
|
64
63
|
|
|
65
64
|
// Example to run the project locally for development. Comment out these lines when building the application
|
|
66
65
|
|
|
67
|
-
const rootElement = document.getElementById('root');
|
|
68
|
-
if (rootElement) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} else {
|
|
77
|
-
|
|
78
|
-
}
|
|
66
|
+
// const rootElement = document.getElementById('root');
|
|
67
|
+
// if (rootElement) {
|
|
68
|
+
// TemplateBuilder({
|
|
69
|
+
// container: rootElement,
|
|
70
|
+
// apiKey: import.meta.env.VITE_APP_ACCESS_TOKEN,
|
|
71
|
+
// mode: 'live',
|
|
72
|
+
// secretKey: import.meta.env.VITE_APP_PLOTNO_API_KEY,
|
|
73
|
+
// styles: {}
|
|
74
|
+
// });
|
|
75
|
+
// } else {
|
|
76
|
+
// console.error("Root element '#root' not found in the document.");
|
|
77
|
+
// }
|
|
79
78
|
|
|
80
79
|
export default TemplateBuilder;
|