@openlettermarketing/olc-react-sdk 2.1.4 → 2.1.5-beta.2
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/.eslintignore +1 -0
- package/.eslintrc.cjs +18 -0
- package/.eslintrc.yml +47 -0
- package/.github/workflows/publish-beta.yml +154 -0
- package/.github/workflows/publish-production.yml +143 -0
- package/.prettierignore +3 -0
- package/.prettierrc.yml +5 -0
- package/CHANGELOG.md +4 -0
- package/babel.config.json +10 -0
- package/build/index.js +82 -82
- package/build/index.js.map +1 -1
- package/build/types/version.d.ts +1 -1
- package/examples/.eslintrc.yml +4 -0
- package/index.html +18 -0
- package/package.json +1 -1
- package/public/vite.svg +1 -0
- package/src/App.tsx +209 -0
- package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
- package/src/assets/images/create-template/prebuilt.svg +13 -0
- package/src/assets/images/create-template/scratch.svg +4 -0
- package/src/assets/images/input/cancel.tsx +20 -0
- package/src/assets/images/input/search.tsx +20 -0
- package/src/assets/images/input/select-cancel.tsx +17 -0
- package/src/assets/images/modal-icons/add.tsx +36 -0
- package/src/assets/images/modal-icons/cancel-file.tsx +12 -0
- package/src/assets/images/modal-icons/cancel-input.tsx +13 -0
- package/src/assets/images/modal-icons/cancel.tsx +35 -0
- package/src/assets/images/modal-icons/close-new.svg +3 -0
- package/src/assets/images/modal-icons/confirm-close-icon.tsx +14 -0
- package/src/assets/images/modal-icons/confirm-new.tsx +22 -0
- package/src/assets/images/modal-icons/confirm.svg +12 -0
- package/src/assets/images/modal-icons/cross.tsx +23 -0
- package/src/assets/images/modal-icons/del.tsx +19 -0
- package/src/assets/images/modal-icons/design-icon.tsx +22 -0
- package/src/assets/images/modal-icons/doc.tsx +43 -0
- package/src/assets/images/modal-icons/docx.tsx +43 -0
- package/src/assets/images/modal-icons/envelope-icon.tsx +26 -0
- package/src/assets/images/modal-icons/info.tsx +19 -0
- package/src/assets/images/modal-icons/jpeg.tsx +43 -0
- package/src/assets/images/modal-icons/jpg.tsx +43 -0
- package/src/assets/images/modal-icons/modal-cros.svg +4 -0
- package/src/assets/images/modal-icons/modal-cross.tsx +37 -0
- package/src/assets/images/modal-icons/new-cancel.tsx +11 -0
- package/src/assets/images/modal-icons/order-download.tsx +42 -0
- package/src/assets/images/modal-icons/pdf.tsx +51 -0
- package/src/assets/images/modal-icons/png.tsx +43 -0
- package/src/assets/images/modal-icons/save.tsx +23 -0
- package/src/assets/images/modal-icons/template-copy.tsx +25 -0
- package/src/assets/images/modal-icons/tool-cancel.tsx +25 -0
- package/src/assets/images/products/bi-new.svg +23 -0
- package/src/assets/images/products/left-arrow.svg +17 -0
- package/src/assets/images/products/personal-new.tsx +31 -0
- package/src/assets/images/products/postcard-new.tsx +27 -0
- package/src/assets/images/products/professional-new.tsx +24 -0
- package/src/assets/images/products/real-new.tsx +30 -0
- package/src/assets/images/products/right-arrow.svg +17 -0
- package/src/assets/images/products/snap-new.svg +31 -0
- package/src/assets/images/templates/actions.svg +3 -0
- package/src/assets/images/templates/address-block-icon.tsx +62 -0
- package/src/assets/images/templates/archive.svg +3 -0
- package/src/assets/images/templates/arrow-down.tsx +27 -0
- package/src/assets/images/templates/back-arrow.tsx +19 -0
- package/src/assets/images/templates/bi-fold-self-mailers.tsx +28 -0
- package/src/assets/images/templates/check.svg +3 -0
- package/src/assets/images/templates/code.svg +10 -0
- package/src/assets/images/templates/content-copy-icon.tsx +24 -0
- package/src/assets/images/templates/custom-add-on-icon.tsx +18 -0
- package/src/assets/images/templates/custom-qr-section-icon.tsx +9 -0
- package/src/assets/images/templates/custom-template.tsx +23 -0
- package/src/assets/images/templates/designer.tsx +43 -0
- package/src/assets/images/templates/dot.tsx +22 -0
- package/src/assets/images/templates/download-v2.svg +4 -0
- package/src/assets/images/templates/download.svg +4 -0
- package/src/assets/images/templates/dummy-template.tsx +76 -0
- package/src/assets/images/templates/dynamic-field.tsx +119 -0
- package/src/assets/images/templates/edit-pencil-icon.tsx +21 -0
- package/src/assets/images/templates/edit.svg +3 -0
- package/src/assets/images/templates/epo-icon.tsx +16 -0
- package/src/assets/images/templates/field.tsx +29 -0
- package/src/assets/images/templates/gsv-icon.tsx +31 -0
- package/src/assets/images/templates/info-icon.tsx +37 -0
- package/src/assets/images/templates/left-arrow.svg +17 -0
- package/src/assets/images/templates/pencil.svg +3 -0
- package/src/assets/images/templates/personal-letter.tsx +53 -0
- package/src/assets/images/templates/postcard.tsx +32 -0
- package/src/assets/images/templates/professional-letter.tsx +53 -0
- package/src/assets/images/templates/qr-code.tsx +13 -0
- package/src/assets/images/templates/real-penned-letters.tsx +57 -0
- package/src/assets/images/templates/right-arrow.svg +17 -0
- package/src/assets/images/templates/size-image-lg.tsx +20 -0
- package/src/assets/images/templates/size-image-mid.tsx +20 -0
- package/src/assets/images/templates/size-image-xl.tsx +20 -0
- package/src/assets/images/templates/size-image.tsx +20 -0
- package/src/assets/images/templates/snap-pack.tsx +67 -0
- package/src/assets/images/templates/template-default-design.tsx +21 -0
- package/src/assets/images/templates/trash-upload.svg +3 -0
- package/src/assets/images/templates/trash.svg +3 -0
- package/src/assets/images/templates/tri-fold-self-mailers.tsx +93 -0
- package/src/assets/images/templates/upload-image.svg +10 -0
- package/src/assets/images/templates/x.svg +3 -0
- package/src/assets/images/thumbnails/one.svg +9 -0
- package/src/assets/images/tooltip/tool-arrow.tsx +25 -0
- package/src/components/CreateTemplate/V2/index.tsx +525 -0
- package/src/components/CreateTemplate/V2/styles.scss +372 -0
- package/src/components/CreateTemplate/index.tsx +508 -0
- package/src/components/CreateTemplate/styles.scss +404 -0
- package/src/components/GenericUIBlocks/Button/index.tsx +54 -0
- package/src/components/GenericUIBlocks/Button/styles.scss +43 -0
- package/src/components/GenericUIBlocks/CircularProgress/index.tsx +18 -0
- package/src/components/GenericUIBlocks/CircularProgress/styles.scss +93 -0
- package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +88 -0
- package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +19 -0
- package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +227 -0
- package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +289 -0
- package/src/components/GenericUIBlocks/Dialog/index.tsx +185 -0
- package/src/components/GenericUIBlocks/Dialog/styles.scss +227 -0
- package/src/components/GenericUIBlocks/Divider/index.tsx +12 -0
- package/src/components/GenericUIBlocks/Divider/styles.scss +7 -0
- package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +114 -0
- package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +406 -0
- package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +25 -0
- package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +20 -0
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +91 -0
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +92 -0
- package/src/components/GenericUIBlocks/Grid/index.tsx +82 -0
- package/src/components/GenericUIBlocks/Input/index.tsx +269 -0
- package/src/components/GenericUIBlocks/Input/styles.scss +332 -0
- package/src/components/GenericUIBlocks/Tabs/index.tsx +71 -0
- package/src/components/GenericUIBlocks/Tabs/styles.scss +42 -0
- package/src/components/GenericUIBlocks/Typography/index.tsx +18 -0
- package/src/components/GenericUIBlocks/Typography/styles.scss +27 -0
- package/src/components/SidePanel/CustomAddOns/index.tsx +342 -0
- package/src/components/SidePanel/CustomAddOns/styles.scss +86 -0
- package/src/components/SidePanel/CustomBlockColors/index.tsx +211 -0
- package/src/components/SidePanel/CustomBlockColors/styles.scss +80 -0
- package/src/components/SidePanel/CustomFields/customFieldSection.tsx +547 -0
- package/src/components/SidePanel/CustomFields/styles.scss +64 -0
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +172 -0
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +46 -0
- package/src/components/SidePanel/CustomQRCode/index.tsx +1070 -0
- package/src/components/SidePanel/CustomQRCode/styles.scss +149 -0
- package/src/components/SidePanel/CustomUploads/V2/index.tsx +542 -0
- package/src/components/SidePanel/CustomUploads/V2/styles.scss +267 -0
- package/src/components/SidePanel/CustomUploads/index.tsx +301 -0
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +424 -0
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +180 -0
- package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +235 -0
- package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +244 -0
- package/src/components/SidePanel/Templates/ModalGallery/index.tsx +231 -0
- package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +233 -0
- package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +152 -0
- package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +149 -0
- package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +156 -0
- package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +160 -0
- package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +98 -0
- package/src/components/SidePanel/Templates/customTemplateSection.tsx +793 -0
- package/src/components/SidePanel/Templates/styles.scss +244 -0
- package/src/components/SidePanel/index.tsx +160 -0
- package/src/components/TemplateBuilder/index.tsx +585 -0
- package/src/components/TemplateBuilder/styles.scss +100 -0
- package/src/components/TemplateTypes/index.tsx +96 -0
- package/src/components/TemplateTypes/styles.scss +91 -0
- package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +81 -0
- package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +123 -0
- package/src/components/TopNavigation/DuplicateTemplateModal.tsx +103 -0
- package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +71 -0
- package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +88 -0
- package/src/components/TopNavigation/SaveTemplateModel/index.tsx +201 -0
- package/src/components/TopNavigation/SaveTemplateModel/styles.scss +128 -0
- package/src/components/TopNavigation/index.tsx +938 -0
- package/src/components/TopNavigation/styles.scss +303 -0
- package/src/importMeta.d.ts +31 -0
- package/src/index.scss +131 -0
- package/src/index.tsx +238 -0
- package/src/libs/test.ts +7 -0
- package/src/redux/actions/action-types.ts +52 -0
- package/src/redux/actions/customQRCodeActions.ts +54 -0
- package/src/redux/actions/snackbarActions.ts +16 -0
- package/src/redux/actions/templateActions.ts +236 -0
- package/src/redux/reducers/customFieldReducer.ts +99 -0
- package/src/redux/reducers/customQRCodeReducer.ts +58 -0
- package/src/redux/reducers/index.ts +15 -0
- package/src/redux/reducers/snackbarReducer.ts +40 -0
- package/src/redux/reducers/templateReducer.ts +485 -0
- package/src/redux/store.ts +18 -0
- package/src/styles/colors.scss +61 -0
- package/src/test/mocks.js +89 -0
- package/src/test/setupJest.js +1 -0
- package/src/utils/api.ts +36 -0
- package/src/utils/constants.ts +182 -0
- package/src/utils/customStyles.ts +45 -0
- package/src/utils/fetchWrapper.ts +73 -0
- package/src/utils/fonts.json +1597 -0
- package/src/utils/helper.ts +205 -0
- package/src/utils/local-storage.ts +15 -0
- package/src/utils/message.ts +162 -0
- package/src/utils/products.ts +186 -0
- package/src/utils/template-builder.ts +328 -0
- package/src/utils/templateIdentifierArea/biFold.ts +107 -0
- package/src/utils/templateIdentifierArea/index.ts +35 -0
- package/src/utils/templateIdentifierArea/personal.ts +107 -0
- package/src/utils/templateIdentifierArea/postCards.ts +163 -0
- package/src/utils/templateIdentifierArea/professional.ts +125 -0
- package/src/utils/templateIdentifierArea/snapPack.ts +107 -0
- package/src/utils/templateIdentifierArea/triFold.ts +107 -0
- package/src/utils/templateRestrictedArea/biFold.ts +329 -0
- package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +90 -0
- package/src/utils/templateRestrictedArea/personal.ts +90 -0
- package/src/utils/templateRestrictedArea/postCard.ts +334 -0
- package/src/utils/templateRestrictedArea/postCardJumbo.tsx +408 -0
- package/src/utils/templateRestrictedArea/professional.ts +318 -0
- package/src/utils/templateRestrictedArea/realPenned.ts +233 -0
- package/src/utils/templateRestrictedArea/snapPack.ts +1009 -0
- package/src/utils/templateRestrictedArea/triFold.ts +330 -0
- package/src/utils/templateSafetyBorders/biFold.ts +91 -0
- package/src/utils/templateSafetyBorders/index.ts +43 -0
- package/src/utils/templateSafetyBorders/personal.ts +41 -0
- package/src/utils/templateSafetyBorders/postCards.ts +259 -0
- package/src/utils/templateSafetyBorders/professional.ts +78 -0
- package/src/utils/templateSafetyBorders/snapPack.ts +165 -0
- package/src/utils/templateSafetyBorders/triFold.ts +114 -0
- package/src/utils/templateSafetyBorders/types.d.ts +68 -0
- package/src/utils/types.ts +12 -0
- package/src/v2Theme.scss +142 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +12 -0
- package/update-version.js +23 -0
- package/version.js +1 -0
- package/vite.config.ts +8 -0
- package/webpack.config.js +80 -0
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
// Import Polotno and third-party libraries
|
|
4
|
+
import { PolotnoContainer, WorkspaceWrap } from 'polotno';
|
|
5
|
+
import { Toolbar } from 'polotno/toolbar/toolbar';
|
|
6
|
+
import { ZoomButtons } from 'polotno/toolbar/zoom-buttons';
|
|
7
|
+
import { Workspace } from 'polotno/canvas/workspace';
|
|
8
|
+
import { setGoogleFonts } from 'polotno/config';
|
|
9
|
+
|
|
10
|
+
// Hooks
|
|
11
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
12
|
+
import { useParams, useNavigate } from 'react-router-dom';
|
|
13
|
+
import { RootState } from '../../redux/reducers';
|
|
14
|
+
import { AppDispatch } from '../../redux/store';
|
|
15
|
+
import { StoreType } from 'polotno/model/store';
|
|
16
|
+
|
|
17
|
+
// Actions
|
|
18
|
+
import {
|
|
19
|
+
CLEAR_REDUX,
|
|
20
|
+
GET_ONE_TEMPLATE,
|
|
21
|
+
SET_BLOCK_COLOR,
|
|
22
|
+
SET_CUSTOM_FIELDS,
|
|
23
|
+
SET_CUSTOM_FIELDS_V2,
|
|
24
|
+
SET_PLATFORM_FIELDS,
|
|
25
|
+
SET_ROS_OFFER_PERCENTAGE,
|
|
26
|
+
TEMPLATE_LOADING,
|
|
27
|
+
} from '../../redux/actions/action-types';
|
|
28
|
+
import { failure } from '../../redux/actions/snackbarActions';
|
|
29
|
+
import {
|
|
30
|
+
searchAndAdvanceChange,
|
|
31
|
+
selectProduct,
|
|
32
|
+
setPageCount,
|
|
33
|
+
} from '../../redux/actions/templateActions';
|
|
34
|
+
import { clearQrFields } from '../../redux/actions/customQRCodeActions';
|
|
35
|
+
|
|
36
|
+
// Utils
|
|
37
|
+
import {
|
|
38
|
+
changeColorOfBoxesForSnapPack,
|
|
39
|
+
drawRestrictedAreaOnPage,
|
|
40
|
+
extractCustomRistrictedBoxColor,
|
|
41
|
+
getFileAsBlob,
|
|
42
|
+
} from '../../utils/template-builder';
|
|
43
|
+
import { addIdentifiersForTemplates } from '../../utils/templateIdentifierArea';
|
|
44
|
+
import { addElementsforRealPennedLetters } from '../../utils/templateRestrictedArea/realPenned';
|
|
45
|
+
import { DEFAULT_RESTRICTED_AREA_BG, DPI, allowedImageTypes, multiPageLetters } from '../../utils/constants';
|
|
46
|
+
import { addSafetyBordersForTemplates } from '../../utils/templateSafetyBorders';
|
|
47
|
+
import { MESSAGES } from '../../utils/message';
|
|
48
|
+
import { removeItem } from '../../utils/local-storage';
|
|
49
|
+
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
import fonts from '../../utils/fonts.json';
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
import LexiRegularFont from '../../assets/Fonts/Lexi-Regular.ttf';
|
|
54
|
+
|
|
55
|
+
// Components
|
|
56
|
+
import TopNavigation from '../TopNavigation';
|
|
57
|
+
import SidePanel from '../SidePanel';
|
|
58
|
+
import Typography from '../GenericUIBlocks/Typography';
|
|
59
|
+
import GenericSnackbar from '../GenericUIBlocks/GenericSnackbar/Toast';
|
|
60
|
+
|
|
61
|
+
import './styles.scss';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* This code defines a React functional component called `TemplateBuilder` that is responsible for rendering a template builder interface.
|
|
65
|
+
* It includes various useEffect hooks to handle component lifecycle events and state updates.
|
|
66
|
+
* The component uses the `polotno` library to create a canvas workspace where users can design templates.
|
|
67
|
+
* It also includes a side panel with different sections for adding and customizing elements on the canvas.
|
|
68
|
+
*
|
|
69
|
+
* @param {Object} props - The component props.
|
|
70
|
+
* @param {Object} props.store - The store object passed as a prop to the `TemplateBuilder` component.
|
|
71
|
+
* @param {Object} props.styles - The styles contain CSS Properties passed as a prop to the `TemplateBuilder` component.
|
|
72
|
+
* @returns {JSX.Element} The rendered template builder interface.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
interface TemplateBuilderProps {
|
|
76
|
+
store: StoreType;
|
|
77
|
+
platformName?: string | null;
|
|
78
|
+
templateGalleryModal?: boolean;
|
|
79
|
+
createTemplateRoute?: string | null;
|
|
80
|
+
olcTemplate?: Record<string, any>;
|
|
81
|
+
designerTemplateQuery?: Record<string, any> | null;
|
|
82
|
+
allowSenderFields?: boolean;
|
|
83
|
+
allowPropertyFields?: boolean;
|
|
84
|
+
allowAdditionalPage?: boolean;
|
|
85
|
+
excludedFields?: string[] | null;
|
|
86
|
+
designerQueryAmount?: string | number;
|
|
87
|
+
allowedAddOns?: any;
|
|
88
|
+
allowedTemplateSections?: any;
|
|
89
|
+
propertyOfferCost?: number;
|
|
90
|
+
customPropertyOfferCost?: number;
|
|
91
|
+
gsvCost?: number;
|
|
92
|
+
selectedTemplateType?: string | null;
|
|
93
|
+
currentTheme?: string | null | undefined;
|
|
94
|
+
onReturnAndNavigate?: () => void;
|
|
95
|
+
onGetCustomFields?: () => Promise<any>;
|
|
96
|
+
onDuplicateTemplate?: (payload: any) => Promise<any>;
|
|
97
|
+
onCreateCustomTemplateQuery?: (payload: any) => Promise<any>;
|
|
98
|
+
onGetOneTemplate?: (payload: any) => Promise<any>;
|
|
99
|
+
onGetTemplates?: (payload: any) => Promise<any>;
|
|
100
|
+
onSubmit?: (payload: any) => Promise<any>;
|
|
101
|
+
onGetBrandingImages?: (payload: any) => Promise<any>;
|
|
102
|
+
onDeleteBrandingImage?: (id: string | number) => Promise<void>;
|
|
103
|
+
onUploadBrandingImage?: (payload: any) => Promise<any>;
|
|
104
|
+
onGetQRCodes?: (payload: any) => Promise<any>;
|
|
105
|
+
onDeleteQRCodes?: (id: string | number) => Promise<void>;
|
|
106
|
+
onUploadQRCode?: (payload: any) => Promise<any>;
|
|
107
|
+
onEditQRCode?: (payload: any) => Promise<any>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const TemplateBuilder: React.FC<TemplateBuilderProps> = ({
|
|
111
|
+
store,
|
|
112
|
+
platformName,
|
|
113
|
+
templateGalleryModal,
|
|
114
|
+
createTemplateRoute,
|
|
115
|
+
designerTemplateQuery,
|
|
116
|
+
olcTemplate,
|
|
117
|
+
allowSenderFields,
|
|
118
|
+
excludedFields,
|
|
119
|
+
designerQueryAmount,
|
|
120
|
+
allowPropertyFields,
|
|
121
|
+
allowedAddOns,
|
|
122
|
+
allowedTemplateSections,
|
|
123
|
+
allowAdditionalPage,
|
|
124
|
+
propertyOfferCost,
|
|
125
|
+
customPropertyOfferCost,
|
|
126
|
+
gsvCost,
|
|
127
|
+
selectedTemplateType,
|
|
128
|
+
currentTheme,
|
|
129
|
+
onCreateCustomTemplateQuery,
|
|
130
|
+
onReturnAndNavigate,
|
|
131
|
+
onGetOneTemplate,
|
|
132
|
+
onGetCustomFields,
|
|
133
|
+
onDuplicateTemplate,
|
|
134
|
+
onGetTemplates,
|
|
135
|
+
onSubmit,
|
|
136
|
+
onGetBrandingImages,
|
|
137
|
+
onDeleteBrandingImage,
|
|
138
|
+
onUploadBrandingImage,
|
|
139
|
+
onGetQRCodes,
|
|
140
|
+
onDeleteQRCodes,
|
|
141
|
+
onUploadQRCode,
|
|
142
|
+
onEditQRCode,
|
|
143
|
+
}) => {
|
|
144
|
+
const [isStoreUpdated, setIsStoreUpdated] = useState(false);
|
|
145
|
+
const [isDuplication, setIsDuplication] = useState(false);
|
|
146
|
+
const [switchTabCount, setSwitchTabCount] = useState(1);
|
|
147
|
+
const [selectedSection, setSelectedSection] = useState('text');
|
|
148
|
+
|
|
149
|
+
const { id } = useParams();
|
|
150
|
+
const dispatch: AppDispatch = useDispatch();
|
|
151
|
+
const navigate = useNavigate();
|
|
152
|
+
|
|
153
|
+
const template = useSelector(
|
|
154
|
+
(state: RootState) => state.templates.template
|
|
155
|
+
) as Record<string, any>;
|
|
156
|
+
const product = useSelector(
|
|
157
|
+
(state: RootState) => state.templates.product
|
|
158
|
+
) as Record<string, any>;
|
|
159
|
+
const envelopeType = useSelector(
|
|
160
|
+
(state: RootState) => state.templates.envelopeType
|
|
161
|
+
);
|
|
162
|
+
const allProducts = useSelector((state: RootState) => state.templates.products);
|
|
163
|
+
|
|
164
|
+
const currentTemplateType = product?.productType;
|
|
165
|
+
|
|
166
|
+
const currentProductId = +product?.id;
|
|
167
|
+
|
|
168
|
+
const containerStyle = {
|
|
169
|
+
width: '100vw',
|
|
170
|
+
height: currentTheme === 'v2' ? 'calc(100vh - 106px)' : '90vh',
|
|
171
|
+
position: 'relative',
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
if (olcTemplate) {
|
|
176
|
+
handleLoadTemplate();
|
|
177
|
+
}
|
|
178
|
+
}, [olcTemplate]);
|
|
179
|
+
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (designerTemplateQuery) {
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
handleLoadDesignerTemplate();
|
|
184
|
+
}, 100);
|
|
185
|
+
}
|
|
186
|
+
}, [designerTemplateQuery]);
|
|
187
|
+
|
|
188
|
+
// Event listener for visibility change
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
const handleVisibilityChange = () => {
|
|
191
|
+
if (document.hidden) {
|
|
192
|
+
setSwitchTabCount((prev) => prev + 1);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const handleClick = (event: MouseEvent) => {
|
|
197
|
+
if (
|
|
198
|
+
event.target instanceof Element &&
|
|
199
|
+
event.target.closest('.polotno-side-tabs-container') &&
|
|
200
|
+
store?.openedSidePanel !== 'Templates'
|
|
201
|
+
) {
|
|
202
|
+
setSelectedSection(store?.openedSidePanel);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
document.addEventListener('click', handleClick);
|
|
207
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
208
|
+
|
|
209
|
+
return () => {
|
|
210
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
211
|
+
document.removeEventListener('click', handleClick);
|
|
212
|
+
};
|
|
213
|
+
}, []);
|
|
214
|
+
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
removeItem('hireDesignerFormState');
|
|
217
|
+
removeItem('queryFiles');
|
|
218
|
+
}, [])
|
|
219
|
+
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
if (!product && !olcTemplate && !id && !designerTemplateQuery) {
|
|
222
|
+
navigate(createTemplateRoute || '/create-template');
|
|
223
|
+
}
|
|
224
|
+
}, []);
|
|
225
|
+
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
useEffect(() => {
|
|
228
|
+
if (product || (id && onGetOneTemplate)) {
|
|
229
|
+
setGoogleFonts(fonts);
|
|
230
|
+
|
|
231
|
+
if (id && onGetOneTemplate) {
|
|
232
|
+
try {
|
|
233
|
+
onGetOneTemplate(id).then((template) => {
|
|
234
|
+
if (template) {
|
|
235
|
+
dispatch({ type: GET_ONE_TEMPLATE, payload: { data: template } });
|
|
236
|
+
addSafetyBordersForTemplates(template?.product?.id, store);
|
|
237
|
+
dispatch({ type: TEMPLATE_LOADING, payload: true });
|
|
238
|
+
} else {
|
|
239
|
+
dispatch(failure('Unable to load the Template'));
|
|
240
|
+
setTimeout(() => {
|
|
241
|
+
navigate(createTemplateRoute || '/create-template');
|
|
242
|
+
}, 1000);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
} catch (error) {
|
|
246
|
+
return error;
|
|
247
|
+
} finally {
|
|
248
|
+
dispatch({ type: TEMPLATE_LOADING, payload: false });
|
|
249
|
+
}
|
|
250
|
+
// @ts-ignore
|
|
251
|
+
} else if (store.pages.length === 0 && !olcTemplate) {
|
|
252
|
+
createInitialPage();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
fetchCustomFields();
|
|
256
|
+
|
|
257
|
+
const handleChange = () => {
|
|
258
|
+
if (!isStoreUpdated) {
|
|
259
|
+
setIsStoreUpdated(true);
|
|
260
|
+
setIsDuplication(false);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const off = store.on('change', handleChange);
|
|
265
|
+
|
|
266
|
+
return () => {
|
|
267
|
+
store.history.clear();
|
|
268
|
+
store.clear();
|
|
269
|
+
dispatch(clearQrFields());
|
|
270
|
+
dispatch({ type: SET_ROS_OFFER_PERCENTAGE, payload: '' });
|
|
271
|
+
dispatch({ type: SET_BLOCK_COLOR, payload: DEFAULT_RESTRICTED_AREA_BG });
|
|
272
|
+
dispatch(setPageCount(store?.pages?.length));
|
|
273
|
+
off();
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
}, []);
|
|
277
|
+
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
if (!id && !olcTemplate && product && store.pages.length === 0) {
|
|
280
|
+
createInitialPage();
|
|
281
|
+
}
|
|
282
|
+
}, [product]);
|
|
283
|
+
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
const handleBeforeUnload = (event: { returnValue: string }) => {
|
|
286
|
+
const message = 'Are you sure you want to leave?';
|
|
287
|
+
event.returnValue = message;
|
|
288
|
+
return message;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const addBeforeUnloadListener = () => {
|
|
292
|
+
window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
293
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const removeBeforeUnloadListener = () => {
|
|
297
|
+
window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
if (isStoreUpdated && !isDuplication) {
|
|
301
|
+
addBeforeUnloadListener();
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return () => {
|
|
305
|
+
removeBeforeUnloadListener();
|
|
306
|
+
};
|
|
307
|
+
}, [isStoreUpdated, isDuplication]);
|
|
308
|
+
|
|
309
|
+
const fetchCustomFields = async () => {
|
|
310
|
+
if (onGetCustomFields) {
|
|
311
|
+
const allCustomFields: any = await onGetCustomFields();
|
|
312
|
+
const platformFields: any = [];
|
|
313
|
+
const customFields: any = [];
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
if (allCustomFields?.version === 'v2') {
|
|
317
|
+
const flattenedFields = allCustomFields.customFields.flatMap((section: { fields: any; }) => section.fields);
|
|
318
|
+
|
|
319
|
+
for (const field of flattenedFields) {
|
|
320
|
+
(field.isPlatformField ? platformFields : customFields).push(field);
|
|
321
|
+
}
|
|
322
|
+
const filteredCustomFields = allCustomFields?.customFields
|
|
323
|
+
.map((customField: any) => ({
|
|
324
|
+
...customField,
|
|
325
|
+
fields: customField.fields.filter((field: any) => customFields.includes(field))
|
|
326
|
+
}))
|
|
327
|
+
.filter((section: { fields: any[] }) => section.fields.length > 0);
|
|
328
|
+
|
|
329
|
+
if (allCustomFields?.customFields?.length) {
|
|
330
|
+
dispatch({ type: SET_CUSTOM_FIELDS, payload: [] });
|
|
331
|
+
dispatch({ type: SET_CUSTOM_FIELDS_V2, payload: filteredCustomFields });
|
|
332
|
+
} else {
|
|
333
|
+
dispatch({ type: SET_CUSTOM_FIELDS, payload: [] });
|
|
334
|
+
dispatch({ type: SET_CUSTOM_FIELDS_V2, payload: [] });
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (platformFields.length) {
|
|
338
|
+
dispatch({ type: SET_PLATFORM_FIELDS, payload: platformFields });
|
|
339
|
+
} else {
|
|
340
|
+
dispatch({ type: SET_PLATFORM_FIELDS, payload: [] });
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
} else {
|
|
344
|
+
|
|
345
|
+
for (const field of allCustomFields) {
|
|
346
|
+
(field.isPlatformField ? platformFields : customFields).push(field);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (customFields.length) {
|
|
350
|
+
dispatch({ type: SET_CUSTOM_FIELDS, payload: customFields });
|
|
351
|
+
} else {
|
|
352
|
+
dispatch({ type: SET_CUSTOM_FIELDS, payload: [] });
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (platformFields.length) {
|
|
356
|
+
dispatch({ type: SET_PLATFORM_FIELDS, payload: platformFields });
|
|
357
|
+
} else {
|
|
358
|
+
dispatch({ type: SET_PLATFORM_FIELDS, payload: [] });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const createInitialPage = async () => {
|
|
365
|
+
if (product) {
|
|
366
|
+
const activePanel = selectedTemplateType === 'prebuilt' ? 'Templates' : 'text';
|
|
367
|
+
activePanel === 'text' && store.openSidePanel(activePanel);
|
|
368
|
+
store.addPage();
|
|
369
|
+
const paperSize = product?.selectedSize?.split('x');
|
|
370
|
+
store.setUnit({
|
|
371
|
+
unit: 'in',
|
|
372
|
+
dpi: DPI,
|
|
373
|
+
});
|
|
374
|
+
store.setSize(+paperSize[1] * DPI, +paperSize[0] * DPI);
|
|
375
|
+
if (multiPageLetters.includes(product.productType)) {
|
|
376
|
+
store.addPage();
|
|
377
|
+
store.selectPage(store.pages[0].id);
|
|
378
|
+
}
|
|
379
|
+
//@ts-ignore
|
|
380
|
+
drawRestrictedAreaOnPage(store, product, envelopeType);
|
|
381
|
+
addIdentifiersForTemplates(product.id, store);
|
|
382
|
+
if (currentTemplateType === 'Real Penned Letter' && +product?.id === 16) {
|
|
383
|
+
handleRealPennedLetters();
|
|
384
|
+
}
|
|
385
|
+
dispatch(clearQrFields());
|
|
386
|
+
dispatch({ type: SET_ROS_OFFER_PERCENTAGE, payload: '' });
|
|
387
|
+
dispatch({ type: SET_BLOCK_COLOR, payload: DEFAULT_RESTRICTED_AREA_BG });
|
|
388
|
+
dispatch(setPageCount(store?.pages?.length));
|
|
389
|
+
if (activePanel === 'Templates') {
|
|
390
|
+
setTimeout(() => {
|
|
391
|
+
store.openSidePanel(activePanel);
|
|
392
|
+
}, 1500)
|
|
393
|
+
}
|
|
394
|
+
store.history.clear();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
setIsStoreUpdated(false);
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
const handleRealPennedLetters = async () => {
|
|
401
|
+
try {
|
|
402
|
+
// Load Lexi Regular Fonts Into Store
|
|
403
|
+
store.addFont({
|
|
404
|
+
fontFamily: 'lexi Regular',
|
|
405
|
+
url: LexiRegularFont,
|
|
406
|
+
});
|
|
407
|
+
addElementsforRealPennedLetters(store);
|
|
408
|
+
|
|
409
|
+
const response = await fetch(LexiRegularFont);
|
|
410
|
+
const blob = await response.blob();
|
|
411
|
+
|
|
412
|
+
const reader = new FileReader();
|
|
413
|
+
// Load Lexi Regular Base64 into JSON
|
|
414
|
+
reader.onloadend = () => {
|
|
415
|
+
store.addFont({
|
|
416
|
+
fontFamily: 'lexi Regular',
|
|
417
|
+
url: reader.result,
|
|
418
|
+
} as any);
|
|
419
|
+
};
|
|
420
|
+
reader.readAsDataURL(blob);
|
|
421
|
+
} catch (error) {
|
|
422
|
+
console.error('Error loading the font file:', error);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
const handleLoadDesignerTemplate = async () => {
|
|
427
|
+
if (designerTemplateQuery?.title && designerTemplateQuery?.product) {
|
|
428
|
+
const flatProducts = allProducts.flatMap(product =>
|
|
429
|
+
product.size.map((sizeItem: any) => ({
|
|
430
|
+
id: sizeItem.id || product.id,
|
|
431
|
+
title: product.title,
|
|
432
|
+
productType: product.productType,
|
|
433
|
+
size: [{ id: sizeItem.id || product.id, size: sizeItem.size }],
|
|
434
|
+
...(product.windowed !== undefined && { windowed: product.windowed })
|
|
435
|
+
}))
|
|
436
|
+
);
|
|
437
|
+
const selectedProduct = flatProducts.find((product) => product.id === designerTemplateQuery?.product?.id);
|
|
438
|
+
if (selectedProduct) {
|
|
439
|
+
dispatch({ type: CLEAR_REDUX });
|
|
440
|
+
dispatch({ type: SET_ROS_OFFER_PERCENTAGE, payload: '' });
|
|
441
|
+
dispatch({ type: SET_BLOCK_COLOR, payload: DEFAULT_RESTRICTED_AREA_BG });
|
|
442
|
+
dispatch(setPageCount(store?.pages?.length));
|
|
443
|
+
store.clear();
|
|
444
|
+
store.history.clear();
|
|
445
|
+
dispatch(searchAndAdvanceChange('title', designerTemplateQuery?.title));
|
|
446
|
+
if (selectedProduct.productType === 'Professional Letters') {
|
|
447
|
+
let selectedEnvelope = selectedProduct.id == 2 ? '#10 Double-Window' : '#10 Grey'
|
|
448
|
+
dispatch(searchAndAdvanceChange('envelopeType', selectedEnvelope));
|
|
449
|
+
}
|
|
450
|
+
dispatch(selectProduct(selectedProduct));
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
onReturnAndNavigate ? onReturnAndNavigate() : navigate(createTemplateRoute || '/');
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const handleLoadTemplate = async () => {
|
|
458
|
+
const existingTemplate = olcTemplate;
|
|
459
|
+
if (existingTemplate) {
|
|
460
|
+
dispatch({ type: GET_ONE_TEMPLATE, payload: { data: existingTemplate } });
|
|
461
|
+
const workspaceElement = document.querySelector(
|
|
462
|
+
'.polotno-workspace-container'
|
|
463
|
+
);
|
|
464
|
+
if (workspaceElement) {
|
|
465
|
+
workspaceElement.classList.add('show-loader');
|
|
466
|
+
}
|
|
467
|
+
// @ts-ignore
|
|
468
|
+
const paperDimensions = existingTemplate?.product?.paperSize.split('x');
|
|
469
|
+
store.setUnit({
|
|
470
|
+
unit: 'in',
|
|
471
|
+
dpi: 96,
|
|
472
|
+
});
|
|
473
|
+
store.setSize(+paperDimensions[1] * DPI, +paperDimensions[0] * DPI);
|
|
474
|
+
let jsonData = await getFileAsBlob(existingTemplate?.templateUrl);
|
|
475
|
+
if (existingTemplate?.product?.productType === 'Snap Pack Mailers') {
|
|
476
|
+
const updatedBoxes = changeColorOfBoxesForSnapPack(jsonData, true, true);
|
|
477
|
+
jsonData = updatedBoxes;
|
|
478
|
+
}
|
|
479
|
+
if (existingTemplate?.product?.productType === 'Real Penned Letter' && +existingTemplate?.product?.id === 16) {
|
|
480
|
+
let clonedJson = JSON.stringify(jsonData)
|
|
481
|
+
.replace(/{{/g, '((')
|
|
482
|
+
.replace(/}}/g, '))');
|
|
483
|
+
jsonData = JSON.parse(clonedJson);
|
|
484
|
+
}
|
|
485
|
+
const RistrictedBoxColor = extractCustomRistrictedBoxColor(jsonData);
|
|
486
|
+
dispatch({ type: SET_BLOCK_COLOR, payload: RistrictedBoxColor ? RistrictedBoxColor : DEFAULT_RESTRICTED_AREA_BG });
|
|
487
|
+
dispatch(setPageCount(store?.pages?.length));
|
|
488
|
+
store.loadJSON(jsonData);
|
|
489
|
+
await store.waitLoading();
|
|
490
|
+
dispatch(clearQrFields());
|
|
491
|
+
if (allowedAddOns?.includes('custom_property_offer') && existingTemplate?.meta?.rosOfferPercentage) {
|
|
492
|
+
dispatch({ type: SET_ROS_OFFER_PERCENTAGE, payload: existingTemplate?.meta?.rosOfferPercentage });
|
|
493
|
+
} else {
|
|
494
|
+
dispatch({ type: SET_ROS_OFFER_PERCENTAGE, payload: '' });
|
|
495
|
+
}
|
|
496
|
+
setIsStoreUpdated(false);
|
|
497
|
+
addSafetyBordersForTemplates(existingTemplate?.product?.id, store);
|
|
498
|
+
dispatch({ type: TEMPLATE_LOADING, payload: false });
|
|
499
|
+
if (workspaceElement) {
|
|
500
|
+
workspaceElement.classList.add('hide-loader');
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
// Incase of Real Penned Letters hide tooltip
|
|
506
|
+
const Tooltip = () => null;
|
|
507
|
+
|
|
508
|
+
return (
|
|
509
|
+
<>
|
|
510
|
+
<Typography className="hideTemplateBuilder">
|
|
511
|
+
{MESSAGES.TEMPLATE_MESSAGE_ON_SMALL_SCREEN}
|
|
512
|
+
</Typography>
|
|
513
|
+
<div className="polotno-container">
|
|
514
|
+
{switchTabCount > 0 && (
|
|
515
|
+
<div className="builder-wrapper">
|
|
516
|
+
<TopNavigation
|
|
517
|
+
store={store}
|
|
518
|
+
isStoreUpdated={isStoreUpdated}
|
|
519
|
+
olcTemplate={olcTemplate}
|
|
520
|
+
designerTemplateQuery={designerTemplateQuery}
|
|
521
|
+
onDuplicateTemplate={onDuplicateTemplate}
|
|
522
|
+
setIsDuplication={setIsDuplication}
|
|
523
|
+
onReturnAndNavigate={onReturnAndNavigate}
|
|
524
|
+
allowedAddOns={allowedAddOns}
|
|
525
|
+
allowAdditionalPage={allowAdditionalPage}
|
|
526
|
+
currentTheme={currentTheme}
|
|
527
|
+
onSubmit={onSubmit}
|
|
528
|
+
/>
|
|
529
|
+
|
|
530
|
+
<PolotnoContainer style={containerStyle}>
|
|
531
|
+
<SidePanel
|
|
532
|
+
store={store}
|
|
533
|
+
currentTemplateType={currentTemplateType}
|
|
534
|
+
currentProductId={currentProductId}
|
|
535
|
+
platformName={platformName}
|
|
536
|
+
templateGalleryModal={templateGalleryModal}
|
|
537
|
+
allowSenderFields={allowSenderFields}
|
|
538
|
+
allowPropertyFields={allowPropertyFields}
|
|
539
|
+
excludedFields={excludedFields}
|
|
540
|
+
designerQueryAmount={designerQueryAmount}
|
|
541
|
+
allowedAddOns={allowedAddOns}
|
|
542
|
+
allowedTemplateSections={allowedTemplateSections}
|
|
543
|
+
propertyOfferCost={propertyOfferCost}
|
|
544
|
+
customPropertyOfferCost={customPropertyOfferCost}
|
|
545
|
+
gsvCost={gsvCost}
|
|
546
|
+
selectedSection={selectedSection}
|
|
547
|
+
currentTheme={currentTheme}
|
|
548
|
+
onGetTemplates={onGetTemplates}
|
|
549
|
+
onGetOneTemplate={onGetOneTemplate}
|
|
550
|
+
onGetCustomFields={onGetCustomFields}
|
|
551
|
+
onCreateCustomTemplateQuery={onCreateCustomTemplateQuery}
|
|
552
|
+
onGetBrandingImages={onGetBrandingImages}
|
|
553
|
+
onDeleteBrandingImage={onDeleteBrandingImage}
|
|
554
|
+
onUploadBrandingImage={onUploadBrandingImage}
|
|
555
|
+
onGetQRCodes={onGetQRCodes}
|
|
556
|
+
onDeleteQRCodes={onDeleteQRCodes}
|
|
557
|
+
onUploadQRCode={onUploadQRCode}
|
|
558
|
+
onEditQRCode={onEditQRCode}
|
|
559
|
+
selectedTemplateType={selectedTemplateType}
|
|
560
|
+
/>
|
|
561
|
+
<WorkspaceWrap>
|
|
562
|
+
{+product?.id !== 16 && (
|
|
563
|
+
<Toolbar store={store} downloadButtonEnabled={false} />
|
|
564
|
+
)}
|
|
565
|
+
{+product?.id !== 16 ? (
|
|
566
|
+
<Workspace store={store} pageControlsEnabled={false} />
|
|
567
|
+
) : (
|
|
568
|
+
<Workspace
|
|
569
|
+
store={store}
|
|
570
|
+
pageControlsEnabled={false}
|
|
571
|
+
components={{ Tooltip }}
|
|
572
|
+
/>
|
|
573
|
+
)}
|
|
574
|
+
<ZoomButtons store={store} />
|
|
575
|
+
</WorkspaceWrap>
|
|
576
|
+
</PolotnoContainer>
|
|
577
|
+
<GenericSnackbar />
|
|
578
|
+
</div>
|
|
579
|
+
)}
|
|
580
|
+
</div>
|
|
581
|
+
</>
|
|
582
|
+
);
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
export default TemplateBuilder;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.polotno-container {
|
|
2
|
+
.builder-wrapper {
|
|
3
|
+
@media (max-width: 600px) {
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
6
|
+
.polotno-side-panel {
|
|
7
|
+
& .polotno-side-tabs-container {
|
|
8
|
+
& .polotno-side-tabs-inner {
|
|
9
|
+
& .polotno-side-panel-tab {
|
|
10
|
+
color: var(--text-color);
|
|
11
|
+
&.active,
|
|
12
|
+
&:hover {
|
|
13
|
+
background-color: var(--secondary-color);
|
|
14
|
+
opacity: 0.8;
|
|
15
|
+
color: var(--primary-color);
|
|
16
|
+
svg {
|
|
17
|
+
color: var(--primary-color);
|
|
18
|
+
path {
|
|
19
|
+
fill: var(--primary-color) !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.address-block-icon{
|
|
23
|
+
path {
|
|
24
|
+
fill: transparent !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
& .polotno-panel-container {
|
|
32
|
+
& > div > p {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
.bp5-tabs {
|
|
36
|
+
.bp5-tab-list {
|
|
37
|
+
.bp5-tab-indicator-wrapper {
|
|
38
|
+
.bp5-tab-indicator {
|
|
39
|
+
background-color: var(--primary-color);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.bp5-tab[aria-selected='true'] {
|
|
43
|
+
color: var(--primary-color);
|
|
44
|
+
&:focus {
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.bp5-tab[aria-selected='false'] {
|
|
49
|
+
color: #000;
|
|
50
|
+
&:focus {
|
|
51
|
+
outline: none;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.polotno-workspace-container {
|
|
59
|
+
background-color: transparent !important;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.show-loader {
|
|
64
|
+
&::after {
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
width: 50px;
|
|
68
|
+
height: 50px;
|
|
69
|
+
top: 50%;
|
|
70
|
+
left: 50%;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
border: 4px solid var(--primary-color);
|
|
73
|
+
border-right: 3px solid transparent;
|
|
74
|
+
transform: translate(-50%, -50%);
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
animation: circularAnimation 2s linear infinite;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes circularAnimation {
|
|
82
|
+
0% {
|
|
83
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
84
|
+
}
|
|
85
|
+
100% {
|
|
86
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.hide-loader {
|
|
92
|
+
&::after {
|
|
93
|
+
display: none !important; /* Hide the pseudo-element */
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.bp5-popover-transition-container {
|
|
98
|
+
z-index: 2200 !important;
|
|
99
|
+
}
|
|
100
|
+
}
|