@openlettermarketing/olc-react-sdk 0.0.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/build/078b970ed8544b3c1d6a.woff2 +1 -0
  4. package/build/08a02fd275ecea6ef662f3ec8daaa32b.woff +0 -0
  5. package/build/0b74aa87abece70366c1771c4acca4e6.woff2 +0 -0
  6. package/build/0f46f8d8d4c86e97ab79680929430b5a.woff +0 -0
  7. package/build/0f9e8d4e940df8f6edfe114f2693359e.woff2 +0 -0
  8. package/build/10bbca98a818154c8140.woff +1 -0
  9. package/build/1b4b5615c2cc1d3b3562e46a4639071f.woff +0 -0
  10. package/build/1e2b9039d9ecdbea5d80be9f5d2d8ac0.woff2 +0 -0
  11. package/build/1eeaf1d0bde712085ffc7693bc6b6e3b.woff +0 -0
  12. package/build/20cbef325a3893fe67ad3f0c2720261f.woff2 +0 -0
  13. package/build/226db02060758b02ee1d.woff2 +1 -0
  14. package/build/229bcc3370343b068b96.woff +1 -0
  15. package/build/2ab03962aa9aa9a835c6.woff +1 -0
  16. package/build/2b4b00a609df7b5f0629.woff +1 -0
  17. package/build/31161fccc41bc72f7c300394137a632c.woff2 +0 -0
  18. package/build/33051edcbe786e6ffb9e.woff2 +1 -0
  19. package/build/37a1043b1a05d05ecd6b.woff2 +1 -0
  20. package/build/3b0f8e16e5bcd8f12096.woff2 +1 -0
  21. package/build/3dad27bec33be7aca881.woff +1 -0
  22. package/build/40b3b0d5e09a90fb6e3eda90583d9060.woff +0 -0
  23. package/build/4191c49f85cf8d80a464dfdbc4dae020.woff2 +0 -0
  24. package/build/4262c811b890c5f39daa.woff +1 -0
  25. package/build/42ce943388c4ff9a05a1827bd417762b.woff +0 -0
  26. package/build/45ef043c386456f5b09e.woff2 +1 -0
  27. package/build/47ae969018277a34c57a.woff +1 -0
  28. package/build/4c2578dbd1ff5ea1417281bd5e9635f3.woff +0 -0
  29. package/build/4cc5eccdc5c999a2f26de3d2288a3be3.woff +0 -0
  30. package/build/5245d2dfa665c22ee628.woff2 +1 -0
  31. package/build/544acdec5810964d78ffa5f80880a685.woff2 +0 -0
  32. package/build/55bbeb2a455ee4d261df347a1bf23272.woff +0 -0
  33. package/build/576f4f3d30f1a74c0e6e.woff +1 -0
  34. package/build/5952d3d3c5df5a2f8e09159d3e87bbd2.woff2 +0 -0
  35. package/build/5d2eaa33f8194c062cad2a48ea271f20.woff2 +0 -0
  36. package/build/5f7fdbd0ba543a7a2c59.woff2 +1 -0
  37. package/build/635c633f87deb3bb6c94.woff +1 -0
  38. package/build/63a3bb0067edaf8596bcc9e05335a08f.woff2 +0 -0
  39. package/build/63fbd5c46deac46bc49d.woff2 +1 -0
  40. package/build/65678f6198b402319e1556408d4dca17.woff2 +0 -0
  41. package/build/65d7177279840c70fd98.woff +1 -0
  42. package/build/6672663822e45eb08a26.woff +1 -0
  43. package/build/6c13238f0b1bd29762a9.woff2 +1 -0
  44. package/build/6eab7f5e6cae783b49bf13d5d03778aa.woff +0 -0
  45. package/build/6efafe4a5a505ed66087.woff2 +1 -0
  46. package/build/708f2f7425851a3b7633ad76610902cb.woff +0 -0
  47. package/build/71c75c707fa65ae2e020.woff +1 -0
  48. package/build/71fe56d0eae817ea6306a608c3ed8e29.ttf +0 -0
  49. package/build/7cabe478a7dd00f2be5e.woff2 +1 -0
  50. package/build/862bc70ae0a0695770e7075a1f7190d4.woff2 +0 -0
  51. package/build/91c4ed20ea233963e54fdfd7c94bbb3c.woff +0 -0
  52. package/build/967ff698d058fd7afc9471f46a7c6ebf.woff +0 -0
  53. package/build/99e09492528287bd42d3.woff2 +1 -0
  54. package/build/9cab44e73e21bce8d0ec19926a90a6cc.woff2 +0 -0
  55. package/build/9e418f84ee90e15d0251f040ea885b1c.woff +0 -0
  56. package/build/a09f33b5a3e7968c63b4.woff +1 -0
  57. package/build/a183ee79cca1f8c65af3.woff +1 -0
  58. package/build/a72b6dcf32e1950961ff.woff2 +1 -0
  59. package/build/a74efd2eea3c4e386507.woff2 +1 -0
  60. package/build/a797c6df2a7f3307ec1447aea8430ea9.woff +0 -0
  61. package/build/ac62c8eba7f954b48546cfea5ace5bdf.woff2 +0 -0
  62. package/build/afbcb5ba2915e27272bc.woff +1 -0
  63. package/build/b4118e4ad76754e71d0b83b5dfa34574.woff2 +0 -0
  64. package/build/b42ff4f76286c2718c6a28e8988a2ca9.woff +0 -0
  65. package/build/b5907ba78848350cc015775558fffd18.woff2 +0 -0
  66. package/build/b61f9df87fe302b1bada.woff +1 -0
  67. package/build/b7a60a349aea44e3fa5d.woff2 +1 -0
  68. package/build/bb55db38ba23eafee35c.woff2 +1 -0
  69. package/build/be0e76b30a7663adf9eb4a9605c287b6.woff2 +0 -0
  70. package/build/c9f54ac8a46a41a3e42e.woff +1 -0
  71. package/build/cd2ad378115f549d3c5b311fe2f1b5ef.woff +0 -0
  72. package/build/d0a064c5281603dbff7e.woff +1 -0
  73. package/build/d311f70377911d4de94e.woff +1 -0
  74. package/build/d364ef973d16c473e75b.woff2 +1 -0
  75. package/build/d559bd0e015df10bf067.woff2 +1 -0
  76. package/build/d734ef5c1391f85dfa86a8df4240b867.woff +0 -0
  77. package/build/dd25e4776efe42c2253f674251b1f6bc.woff +0 -0
  78. package/build/e18e42b90e145975a8d5.woff2 +1 -0
  79. package/build/e3bd0ea116d26368ddb7bbea8b6d46c9.woff2 +0 -0
  80. package/build/e4e658bd15474bdf1f720924cfa2df5b.woff +0 -0
  81. package/build/ed6d45d8f05318f8fb35.woff +1 -0
  82. package/build/f1535355a7df553be385f90ff3a00f7a.woff2 +0 -0
  83. package/build/f25a8073a166dea985ec.woff2 +1 -0
  84. package/build/f46a1ac3f31c2604b7f2.woff +1 -0
  85. package/build/f5d386a9b66422144df379be5b249a14.woff2 +0 -0
  86. package/build/fa67b2dd0048a5433bd5ce386f4760fc.woff +0 -0
  87. package/build/fa78d8d6788399bf6527af32633fd8dc.woff2 +0 -0
  88. package/build/index.js +539 -0
  89. package/build/index.js.map +1 -0
  90. package/build/types/App.d.ts +8 -0
  91. package/build/types/assets/images/input/cancel.d.ts +3 -0
  92. package/build/types/assets/images/input/search.d.ts +3 -0
  93. package/build/types/assets/images/modal-icons/modal-cross.d.ts +3 -0
  94. package/build/types/assets/images/modal-icons/save.d.ts +3 -0
  95. package/build/types/assets/images/templates/content-copy-icon.d.ts +3 -0
  96. package/build/types/assets/images/templates/custom-template.d.ts +3 -0
  97. package/build/types/assets/images/templates/dynamic-field.d.ts +3 -0
  98. package/build/types/assets/images/templates/info-icon.d.ts +3 -0
  99. package/build/types/assets/images/templates/size-image-lg.d.ts +3 -0
  100. package/build/types/assets/images/templates/size-image-mid.d.ts +3 -0
  101. package/build/types/assets/images/templates/size-image.d.ts +3 -0
  102. package/build/types/components/CreateTemplate/index.d.ts +7 -0
  103. package/build/types/components/GenericUIBlocks/Button/index.d.ts +10 -0
  104. package/build/types/components/GenericUIBlocks/CircularProgress/index.d.ts +7 -0
  105. package/build/types/components/GenericUIBlocks/Dialog/index.d.ts +19 -0
  106. package/build/types/components/GenericUIBlocks/Divider/index.d.ts +4 -0
  107. package/build/types/components/GenericUIBlocks/GeneralSelect/index.d.ts +18 -0
  108. package/build/types/components/GenericUIBlocks/GeneralTooltip/index.d.ts +10 -0
  109. package/build/types/components/GenericUIBlocks/GenericSnackbar/index.d.ts +5 -0
  110. package/build/types/components/GenericUIBlocks/Grid/index.d.ts +3 -0
  111. package/build/types/components/GenericUIBlocks/Input/index.d.ts +19 -0
  112. package/build/types/components/GenericUIBlocks/Typography/index.d.ts +10 -0
  113. package/build/types/components/SidePanel/customFields/customFieldSection.d.ts +5 -0
  114. package/build/types/components/SidePanel/index.d.ts +7 -0
  115. package/build/types/components/SidePanel/templates/customTemplateSection.d.ts +23 -0
  116. package/build/types/components/TemplateBuilder/index.d.ts +21 -0
  117. package/build/types/components/TopNavigation/ConfirmNavigateDialog/index.d.ts +9 -0
  118. package/build/types/components/TopNavigation/EditTemplateNameModel/index.d.ts +17 -0
  119. package/build/types/components/TopNavigation/SaveTemplateModel/index.d.ts +10 -0
  120. package/build/types/components/TopNavigation/index.d.ts +8 -0
  121. package/build/types/index.d.ts +15 -0
  122. package/build/types/redux/actions/action-types.d.ts +29 -0
  123. package/build/types/redux/actions/customFieldAction.d.ts +4 -0
  124. package/build/types/redux/actions/snackbarActions.d.ts +5 -0
  125. package/build/types/redux/actions/templateActions.d.ts +209 -0
  126. package/build/types/redux/reducers/customFieldReducer.d.ts +8 -0
  127. package/build/types/redux/reducers/index.d.ts +13 -0
  128. package/build/types/redux/reducers/snackbarReducer.d.ts +16 -0
  129. package/build/types/redux/reducers/templateReducer.d.ts +58 -0
  130. package/build/types/redux/store.d.ts +10 -0
  131. package/build/types/utils/api.d.ts +5 -0
  132. package/build/types/utils/constants.d.ts +9 -0
  133. package/build/types/utils/fetchWrapper.d.ts +8 -0
  134. package/build/types/utils/helper.d.ts +5 -0
  135. package/build/types/utils/local-storage.d.ts +4 -0
  136. package/build/types/utils/message.d.ts +64 -0
  137. package/build/types/utils/template-builder.d.ts +18 -0
  138. package/build/types/utils/templateRestrictedArea/biFold.d.ts +78 -0
  139. package/build/types/utils/templateRestrictedArea/postCard.d.ts +78 -0
  140. package/build/types/utils/templateRestrictedArea/professional.d.ts +78 -0
  141. package/build/types/utils/templateRestrictedArea/realPenned.d.ts +78 -0
  142. package/build/types/utils/templateRestrictedArea/triFold.d.ts +78 -0
  143. package/package.json +99 -0
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface AppProps {
3
+ secretKey: string;
4
+ returnRoute?: string | null;
5
+ styles?: React.CSSProperties;
6
+ }
7
+ declare const App: React.FC<AppProps>;
8
+ export default App;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Cancel: (props: any) => React.JSX.Element;
3
+ export default Cancel;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Search: (props: any) => React.JSX.Element;
3
+ export default Search;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ModalCross: (props: any) => React.JSX.Element;
3
+ export default ModalCross;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Save: () => React.JSX.Element;
3
+ export default Save;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const contentCopyIcon: (props: any) => React.JSX.Element;
3
+ export default contentCopyIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CustomTemplate: () => React.JSX.Element;
3
+ export default CustomTemplate;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DynamicField: () => React.JSX.Element;
3
+ export default DynamicField;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const infoIcon: (props: any) => React.JSX.Element;
3
+ export default infoIcon;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const sizeImageLg: () => React.JSX.Element;
3
+ export default sizeImageLg;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const sizeImageMid: () => React.JSX.Element;
3
+ export default sizeImageMid;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare function sizeImage(): React.JSX.Element;
3
+ export default sizeImage;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ interface CreateTemplateProps {
4
+ returnRoute?: string | null;
5
+ }
6
+ declare const CreateTemplate: React.FC<CreateTemplateProps>;
7
+ export default CreateTemplate;
@@ -0,0 +1,10 @@
1
+ import React, { CSSProperties, ReactNode, MouseEventHandler } from 'react';
2
+ import './styles.scss';
3
+ interface ButtonProps {
4
+ children?: ReactNode;
5
+ style?: CSSProperties;
6
+ onClick?: MouseEventHandler<HTMLDivElement>;
7
+ className?: string;
8
+ }
9
+ declare const Button: React.FC<ButtonProps>;
10
+ export default Button;
@@ -0,0 +1,7 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import './styles.scss';
3
+ interface CircularProgressProps {
4
+ style?: CSSProperties;
5
+ }
6
+ declare const CircularProgress: React.FC<CircularProgressProps>;
7
+ export default CircularProgress;
@@ -0,0 +1,19 @@
1
+ import React, { ReactNode, CSSProperties } from 'react';
2
+ import './styles.scss';
3
+ interface DialogProps {
4
+ icon?: ReactNode;
5
+ customStyles?: CSSProperties;
6
+ open: boolean;
7
+ handleClose: () => void;
8
+ loading?: boolean;
9
+ title?: string;
10
+ subHeading?: string;
11
+ description?: string;
12
+ onSubmit?: () => void;
13
+ onCancel?: () => void;
14
+ cancelText?: string;
15
+ submitText?: string;
16
+ children?: ReactNode;
17
+ }
18
+ declare const Dialog: React.FC<DialogProps>;
19
+ export default Dialog;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ declare const Divider: React.FC;
4
+ export default Divider;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ interface Option {
4
+ id?: number | string;
5
+ value: string;
6
+ label: string;
7
+ }
8
+ interface GeneralSelectProps {
9
+ options: Option[];
10
+ placeholder?: string;
11
+ error?: string;
12
+ label?: string;
13
+ selectedValue: Option | null;
14
+ isError: boolean;
15
+ setSelectedValue: (option: Option | null) => void;
16
+ }
17
+ declare const GeneralSelect: React.FC<GeneralSelectProps>;
18
+ export default GeneralSelect;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import 'react-tooltip/dist/react-tooltip.css';
3
+ import './styles.scss';
4
+ interface GeneralTooltipProps {
5
+ anchorSelect: string;
6
+ place: 'top' | 'right' | 'bottom' | 'left';
7
+ title: string;
8
+ }
9
+ declare const GeneralTooltip: React.FC<GeneralTooltipProps>;
10
+ export default GeneralTooltip;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import 'react-toastify/dist/ReactToastify.css';
3
+ import './styles.scss';
4
+ declare const GenericSnackbar: React.FC;
5
+ export default GenericSnackbar;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const GridContainer: ({ children, style }: any) => React.JSX.Element;
3
+ export declare const GridItem: ({ xs, sm, md, lg, xl, children }: any) => React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ChangeEvent, FC } from 'react';
2
+ import './styles.scss';
3
+ import './styles.scss';
4
+ interface InputProps {
5
+ variant?: keyof JSX.IntrinsicElements;
6
+ type: any;
7
+ value: string;
8
+ onChange: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | any>) => void;
9
+ placeholder?: string;
10
+ label?: string;
11
+ error?: string;
12
+ inputIcon?: boolean;
13
+ searchApplied?: boolean;
14
+ onClick?: () => void;
15
+ removeSearchInput?: () => void;
16
+ onKeyDown?: () => void;
17
+ }
18
+ declare const Input: FC<InputProps>;
19
+ export default Input;
@@ -0,0 +1,10 @@
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
+ import './styles.scss';
3
+ interface TypographyProps {
4
+ children?: ReactNode;
5
+ style?: CSSProperties;
6
+ variant?: keyof JSX.IntrinsicElements;
7
+ className?: string;
8
+ }
9
+ declare const Typography: React.FC<TypographyProps>;
10
+ export default Typography;
@@ -0,0 +1,5 @@
1
+ import type { TemplatesSection } from 'polotno/side-panel';
2
+ import './styles.scss';
3
+ type SideSection = typeof TemplatesSection;
4
+ declare const customFieldSection: SideSection;
5
+ export default customFieldSection;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { StoreType } from 'polotno/model/store';
3
+ interface Props {
4
+ store: StoreType;
5
+ }
6
+ declare const SidePanel: React.FC<Props>;
7
+ export default SidePanel;
@@ -0,0 +1,23 @@
1
+ import type { TemplatesSection } from 'polotno/side-panel';
2
+ import './styles.scss';
3
+ type SideSection = typeof TemplatesSection;
4
+ export type Payload = {
5
+ tab: string;
6
+ page: number;
7
+ pageSize: number;
8
+ productId: string | null;
9
+ search?: string;
10
+ categoryIds?: string[];
11
+ };
12
+ export type TemplateType = {
13
+ id: string;
14
+ label: string;
15
+ };
16
+ export type TemplateCategory = {
17
+ id: string;
18
+ title: string;
19
+ totalTemplates: number;
20
+ label?: string;
21
+ };
22
+ declare const customTemplateSection: SideSection;
23
+ export default customTemplateSection;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { StoreType } from 'polotno/model/store';
3
+ import './styles.scss';
4
+ /**
5
+ * This code defines a React functional component called `TemplateBuilder` that is responsible for rendering a template builder interface.
6
+ * It includes various useEffect hooks to handle component lifecycle events and state updates.
7
+ * The component uses the `polotno` library to create a canvas workspace where users can design templates.
8
+ * It also includes a side panel with different sections for adding and customizing elements on the canvas.
9
+ *
10
+ * @param {Object} props - The component props.
11
+ * @param {Object} props.store - The store object passed as a prop to the `TemplateBuilder` component.
12
+ * @param {Object} props.styles - The styles contain CSS Properties passed as a prop to the `TemplateBuilder` component.
13
+ * @returns {JSX.Element} The rendered template builder interface.
14
+ */
15
+ import './styles.scss';
16
+ interface TemplateBuilderProps {
17
+ store: StoreType;
18
+ styles?: React.CSSProperties;
19
+ }
20
+ declare const TemplateBuilder: React.FC<TemplateBuilderProps>;
21
+ export default TemplateBuilder;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import "./styles.scss";
3
+ interface ConfirmNavigateDialogProps {
4
+ open: boolean;
5
+ handleClose: () => void;
6
+ handleNavigateAction: () => void;
7
+ }
8
+ declare const ConfirmNavigateDialog: React.FC<ConfirmNavigateDialogProps>;
9
+ export default ConfirmNavigateDialog;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ /**
4
+ * EditTemplateNameModel Component
5
+ * A modal for duplicating a template.
6
+ *
7
+ * @param {boolean} open - Boolean indicating whether the modal is open.
8
+ * @param {Function} handleClose - Function to handle the closing of the modal.
9
+ * @returns {JSX.Element} The duplicate template modal component.
10
+ *
11
+ */
12
+ interface EditTemplateNameModelProps {
13
+ open: boolean;
14
+ handleClose: () => void;
15
+ }
16
+ declare const EditTemplateNameModel: React.FC<EditTemplateNameModelProps>;
17
+ export default EditTemplateNameModel;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ interface SaveTemplateModelProps {
4
+ open: boolean;
5
+ loading: boolean;
6
+ handleClose: () => void;
7
+ handleSave: () => void;
8
+ }
9
+ declare const SaveTemplateModel: React.FC<SaveTemplateModelProps>;
10
+ export default SaveTemplateModel;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ interface TopNavigationProps {
4
+ store: any;
5
+ isStoreUpdated: boolean;
6
+ }
7
+ declare const TopNavigation: React.FC<TopNavigationProps>;
8
+ export default TopNavigation;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ import '@fontsource/inter/400.css';
4
+ import '@fontsource/inter/700.css';
5
+ import '@fontsource/inter/600.css';
6
+ interface TemplateBuilderProps {
7
+ container: HTMLElement | null;
8
+ apiKey: string;
9
+ mode: 'test' | 'live';
10
+ secretKey: string;
11
+ returnRoute?: string | null;
12
+ styles?: React.CSSProperties;
13
+ }
14
+ declare const TemplateBuilder: ({ container, apiKey, secretKey, mode, returnRoute, styles, }: TemplateBuilderProps) => void;
15
+ export default TemplateBuilder;
@@ -0,0 +1,29 @@
1
+ export declare const SET_SUCCESS_SNACKBAR = "SET_SUCCESS_SNACKBAR";
2
+ export declare const SET_ERROR_SNACKBAR = "SET_ERROR_SNACKBAR";
3
+ export declare const CLEAR_SNACKBAR = "CLEAR_SNACKBAR";
4
+ export declare const SET_DYNAMIC_FIELD_VALUE: string;
5
+ export declare const SET_DYNAMIC_FIELDS: string;
6
+ export declare const UPDATE_DYNAMIC_FIELDS: string;
7
+ export declare const UPDATE_CONTACT_FIELDS: string;
8
+ export declare const REMOVE_FROM_DYNAMIC_FIELDS: string;
9
+ export declare const GET_PRODUCTS: string;
10
+ export declare const CLEAR_DYNAMIC_FIELDS: string;
11
+ export declare const CLEAR_FIELDS: string;
12
+ export declare const GET_ALL_TEMPLATES: string;
13
+ export declare const GET_ONE_TEMPLATE: string;
14
+ export declare const TEMPLATE_LOADING: string;
15
+ export declare const TEMPLATE_PAGINATION_CHANGE: string;
16
+ export declare const TEMPLATE_SEARCH: string;
17
+ export declare const CLEAR_ALL_TEMPLATE: string;
18
+ export declare const CLEAR_TEMPLATE_FIELDS: string;
19
+ export declare const GET_DYNAMIC_FIELDS_FROM_SERVER: string;
20
+ export declare const LOAD_DATA_FROM_LOCAL_STORAGE: string;
21
+ export declare const CLEAR_TEMPLATE: string;
22
+ export declare const SELECT_PRODUCT: string;
23
+ export declare const SELECT_POSTCARD: string;
24
+ export declare const SET_PRODUCT_TYPES: string;
25
+ export declare const SET_PRODUCT_DETAILS: string;
26
+ export declare const SET_PRODUCTS_DATA: string;
27
+ export declare const CLEAR_REDUX: string;
28
+ export declare const FETCH_TEMPLATES_REQUEST: string;
29
+ export declare const SET_TEMPLATES: string;
@@ -0,0 +1,4 @@
1
+ import { AppDispatch } from '../store';
2
+ export declare const FETCH_CUSTOM_FIELDS_REQUEST = "FETCH_CUSTOM_FIELDS_REQUEST";
3
+ export declare const SET_CUSTOM_FIELDS = "SET_CUSTOM_FIELDS";
4
+ export declare const fetchCustomFields: () => (dispatch: AppDispatch) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { AppDispatch } from "../store";
2
+ declare const success: (message: string, heading?: string) => (dispatch: AppDispatch) => void;
3
+ declare const failure: (message: string, heading?: string) => (dispatch: AppDispatch) => void;
4
+ declare const closeSnackbar: () => (dispatch: AppDispatch) => void;
5
+ export { success, failure, closeSnackbar };
@@ -0,0 +1,209 @@
1
+ import { AppDispatch } from '../store';
2
+ /**
3
+ * Retrieves a list of templates from a server using an HTTP GET request.
4
+ *
5
+ * @param {number} [page=1] - The page number of the templates to retrieve.
6
+ * @param {number} [pageSize=10] - The number of templates per page.
7
+ * @returns {Promise<void>} - A promise that resolves when the action is dispatched.
8
+ */
9
+ declare const getAllTemplates: (page?: number, pageSize?: number, search?: string, productTypes?: string, creator?: string, templateType?: string, productId?: number | null, refresh?: boolean, isShared?: boolean) => (dispatch: AppDispatch) => Promise<void>;
10
+ /**
11
+ * Makes an HTTP GET request to the 'templates' endpoint and dispatches an action with the retrieved data.
12
+ * @param {number} id - The ID of the template to retrieve.
13
+ * @param {function} dispatch - A function used to dispatch actions to the Redux store.
14
+ * @returns {void}
15
+ */
16
+ declare const getOneTemplate: (id: number, type?: string) => (dispatch: AppDispatch) => Promise<void>;
17
+ /**
18
+ * Uploads a template using the provided template form data.
19
+ *
20
+ * @param {FormData} templateFormData - The form data containing the template files to upload.
21
+ * @returns {Promise<any>} - A promise that resolves with the response from the server.
22
+ * @throws {Error} - If an error occurs during the upload process.
23
+ */
24
+ declare const uploadTemplate: (templateFormData: FormData) => Promise<unknown>;
25
+ /**
26
+ * Creates a template using the provided data.
27
+ *
28
+ * @param {object} data - The data needed to create the template.
29
+ * @returns {Promise<object>} - A promise that resolves to the response from the successful request or the error response if an error occurs.
30
+ */
31
+ declare const createTemplate: (data: object) => Promise<unknown>;
32
+ /**
33
+ * Update a template using the provided data.
34
+ *
35
+ * @param {number} id - The ID of the template to update.
36
+ * @param {object} data - The data needed to create the template.
37
+ * @returns {Promise<object>} - A promise that resolves to the response from the successful request or the error response if an error occurs.
38
+ */
39
+ declare const updateTemplate: (id: number, data: object) => Promise<unknown>;
40
+ /**
41
+ * Deletes a template by its ID.
42
+ *
43
+ * @param {string} id - The unique identifier of the template to delete.
44
+ * @returns {Promise<any>} A Promise that resolves to the response indicating
45
+ * the success of the template deletion, or rejects
46
+ * with an error response in case of failure.
47
+ *
48
+ * @throws {Error} If the request to delete the template fails.
49
+ */
50
+ declare const deleteTemplate: (id: string) => Promise<unknown>;
51
+ /**
52
+ * Retrieves the view proof for a template with the given ID.
53
+ *
54
+ * @param {string} id - The ID of the template for which the view proof is requested.
55
+ * @returns {Promise<object>} - The response object from the GET request, containing the view proof for the template with the given ID.
56
+ * @throws {object} - The error response if there is an error.
57
+ */
58
+ declare const getViewProof: (id: string) => Promise<unknown>;
59
+ /**
60
+ * Duplicates a template by its ID.
61
+ *
62
+ * @param {string} id - The unique identifier of the template to duplicate.
63
+ * @param {Object} data - Additional data to be sent with the duplicate request.
64
+ * @returns {Promise<any>} A Promise that resolves to the response containing information
65
+ * about the duplicated template, or rejects with an error response
66
+ * in case of failure.
67
+ *
68
+ * @throws {Error} If the request to duplicate the template fails.
69
+ */
70
+ declare const doublicateTemplate: (id: string, data: object) => Promise<unknown>;
71
+ /**
72
+ * Fetches products and dispatches an action with the product data to the Redux store.
73
+ *
74
+ * @param {Function} dispatch - The dispatch function from the Redux store.
75
+ * @returns {Promise<void>} A Promise that resolves after dispatching the action,
76
+ * or rejects if there is an error fetching the products.
77
+ *
78
+ * @throws {Error} If there is an error fetching the products.
79
+ */
80
+ declare const getAllProducts: () => (dispatch: AppDispatch) => Promise<void>;
81
+ /**
82
+ * Fetches custom fields and dispatches an action with the custom fields data to the Redux store.
83
+ *
84
+ * @param {Function} dispatch - The dispatch function from the Redux store.
85
+ * @returns {Promise<void>} A Promise that resolves after dispatching the action,
86
+ * or rejects if there is an error fetching the custom fields.
87
+ *
88
+ * @throws {Error} If there is an error fetching the custom fields.
89
+ */
90
+ declare const getAllCustomFields: () => (dispatch: AppDispatch) => Promise<void>;
91
+ /**
92
+ * Fetches product details and dispatches an action with the product details data to the Redux store.
93
+ *
94
+ * @param {object} payload - The payload containing the product details.
95
+ * @returns {Promise<void>} A Promise that resolves after dispatching the action,
96
+ * or rejects if there is an error fetching the product details.
97
+ *
98
+ * @throws {Error} If there is an error fetching the product details.
99
+ */
100
+ declare const getProductDetails: (payload: object) => (dispatch: AppDispatch) => Promise<void>;
101
+ /**
102
+ * Loads form data to the store.
103
+ *
104
+ * @param {string} data - The form data in JSON format.
105
+ * @returns {void} - Dispatches an action to the Redux store.
106
+ */
107
+ declare const loadFormDataToStore: (data: string) => (dispatch: AppDispatch) => void;
108
+ /**
109
+ * Downloads the proof for the provided data.
110
+ *
111
+ * @param {object} data - The data for which the proof is requested.
112
+ * @returns {Promise<any>} - The response object from the POST request.
113
+ * @throws {object} - The error response if there is an error.
114
+ */
115
+ declare const downloadProof: (data: object) => Promise<unknown>;
116
+ /**
117
+ * Uploads a file.
118
+ *
119
+ * @param {File} file - The file to upload.
120
+ * @returns {Promise<string>} - The file path of the uploaded file.
121
+ * @throws {object} - The error response if there is an error.
122
+ */
123
+ declare const uploadFile: (file: File) => Promise<string>;
124
+ /**
125
+ * Clears template fields.
126
+ *
127
+ * @returns {Function} - The thunk function.
128
+ */
129
+ declare const clearTemplateFields: () => (dispatch: AppDispatch) => void;
130
+ /**
131
+ * Selects a product.
132
+ *
133
+ * @param {any} product - The selected product.
134
+ * @param {string} [productType=''] - The type of the selected product.
135
+ * @returns {Function} - The thunk function.
136
+ */
137
+ declare const selectProduct: (product: any, productType?: string) => (dispatch: AppDispatch) => void;
138
+ /**
139
+ * Selects a postcard.
140
+ *
141
+ * @param {any} product - The selected product.
142
+ * @param {string} productType - The type of the selected product.
143
+ * @returns {Function} - The thunk function.
144
+ */
145
+ declare const selectPostCard: (product: any, productType: string) => (dispatch: AppDispatch) => void;
146
+ /**
147
+ * Clears all templates.
148
+ *
149
+ * @returns {Function} - The thunk function.
150
+ */
151
+ declare const clearAllTemplates: () => (dispatch: AppDispatch) => void;
152
+ /**
153
+ * Searches and advances change.
154
+ *
155
+ * @param {string} name - The name of the field.
156
+ * @param {any} value - The value of the field.
157
+ * @returns {Function} - The thunk function.
158
+ */
159
+ declare const searchAndAdvanceChange: (name: string, value: any) => (dispatch: AppDispatch) => void;
160
+ /**
161
+ * Changes dynamic input.
162
+ *
163
+ * @param {any} value - The value of the dynamic input.
164
+ * @returns {Function} - The thunk function.
165
+ */
166
+ declare const dynmicInputChange: (value: any) => (dispatch: AppDispatch) => void;
167
+ /**
168
+ * Sets dynamic fields.
169
+ *
170
+ * @returns {Function} - The thunk function.
171
+ */
172
+ declare const setDynamicFields: () => (dispatch: AppDispatch) => void;
173
+ /**
174
+ * Removes an item from dynamic fields.
175
+ *
176
+ * @param {any} value - The value of the item to remove.
177
+ * @returns {Function} - The thunk function.
178
+ */
179
+ declare const removeItemFromDynamicField: (value: any) => (dispatch: AppDispatch) => void;
180
+ /**
181
+ * Clears dynamic fields.
182
+ *
183
+ * @returns {Function} - The thunk function.
184
+ */
185
+ declare const clearDynaicFields: () => (dispatch: AppDispatch) => void;
186
+ /**
187
+ * Clears filters.
188
+ *
189
+ * @returns {Function} - The thunk function.
190
+ */
191
+ declare const clearFilter: () => (dispatch: AppDispatch) => {
192
+ type: string;
193
+ };
194
+ /**
195
+ * Retrieves all template categories from the server using an HTTP GET request.
196
+ *
197
+ * @returns {Promise<any>} - A promise that resolves with the response from the server.
198
+ * @throws {object} - The error response if there is an error.
199
+ */
200
+ declare const getAllTemplateCategories: () => Promise<any>;
201
+ /**
202
+ * Retrieves templates by tab using the provided payload.
203
+ *
204
+ * @param {object} payload - The payload containing the necessary data to filter templates by tab.
205
+ * @returns {Promise<any>} - A promise that resolves with the response data from the server.
206
+ * @throws {object} - The error response if there is an error.
207
+ */
208
+ declare const getAllTemplatesByTab: (payload: object) => Promise<any>;
209
+ export { dynmicInputChange, setDynamicFields, clearDynaicFields, removeItemFromDynamicField, getAllProducts, uploadTemplate, getAllTemplates, getOneTemplate, createTemplate, updateTemplate, clearFilter, deleteTemplate, getViewProof, doublicateTemplate, searchAndAdvanceChange, clearAllTemplates, selectProduct, selectPostCard, clearTemplateFields, getAllCustomFields, loadFormDataToStore, uploadFile, getProductDetails, downloadProof, getAllTemplateCategories, getAllTemplatesByTab };
@@ -0,0 +1,8 @@
1
+ export interface CustomFieldState {
2
+ customFields: any[];
3
+ defaultDynamicFields: any[];
4
+ loading: boolean;
5
+ error: string | null;
6
+ }
7
+ declare const customFieldReducer: (state: CustomFieldState | undefined, action: any) => CustomFieldState;
8
+ export { customFieldReducer };
@@ -0,0 +1,13 @@
1
+ declare const rootReducer: import("redux").Reducer<{
2
+ templates: import("./templateReducer").TemplateState;
3
+ customFields: import("./customFieldReducer").CustomFieldState;
4
+ snackbarReducers: {
5
+ snackbar: any;
6
+ };
7
+ }, any, Partial<{
8
+ templates: never;
9
+ customFields: import("./customFieldReducer").CustomFieldState | undefined;
10
+ snackbarReducers: never;
11
+ }>>;
12
+ export type RootState = ReturnType<typeof rootReducer>;
13
+ export default rootReducer;
@@ -0,0 +1,16 @@
1
+ interface SnackbarState {
2
+ snackbar: {
3
+ open: boolean;
4
+ status: 'success' | 'error';
5
+ heading: string;
6
+ message: string;
7
+ };
8
+ }
9
+ export type ActionPayload = {
10
+ type: string;
11
+ payload: any;
12
+ };
13
+ declare const snackbarReducers: (state: SnackbarState | undefined, { type, payload }: ActionPayload) => {
14
+ snackbar: any;
15
+ };
16
+ export { snackbarReducers };