@billgangcom/theme-lib 1.3.0 → 1.5.0

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 (37) hide show
  1. package/dist/abstractions/IBlock.d.ts +1 -0
  2. package/dist/builder/index.d.ts +3 -0
  3. package/dist/builder.cjs.js +5 -10
  4. package/dist/builder.es.js +1702 -3447
  5. package/dist/components/Preview/{RenderBlock → Render}/index.d.ts +2 -0
  6. package/dist/components/Sidebar/Layers/FooterLayer/index.d.ts +1 -0
  7. package/dist/components/Sidebar/Layers/HeaderLayer/index.d.ts +1 -0
  8. package/dist/components/Sidebar/Layers/index.d.ts +4 -0
  9. package/dist/drag-BmBJI4g2.js +5 -0
  10. package/dist/drag-CRprmRb-.cjs +1 -0
  11. package/dist/image-Bx3xvWOB.cjs +1 -0
  12. package/dist/image-CASDWdgb.js +5 -0
  13. package/dist/index-BO6B5tl0.cjs +39 -0
  14. package/dist/index-O501BDCu.js +3939 -0
  15. package/dist/shared/lib/api.d.ts +2 -0
  16. package/dist/shared/ui/Button/index.d.ts +1 -1
  17. package/dist/shared/ui/Checkbox/index.d.ts +7 -0
  18. package/dist/shared/ui/Switch/index.d.ts +3 -0
  19. package/dist/shared/ui/index.d.ts +1 -0
  20. package/dist/sliders-BOds2ujo.js +5 -0
  21. package/dist/sliders-CsvSCMlf.cjs +1 -0
  22. package/dist/store/index.d.ts +1 -0
  23. package/dist/store/useChooseImageStore.d.ts +6 -0
  24. package/dist/store/useLayersStore.d.ts +5 -0
  25. package/dist/ui/ButtonsSettings/index.d.ts +20 -0
  26. package/dist/ui/ButtonsSettings/popup.d.ts +12 -0
  27. package/dist/ui/ChooseImage/index.d.ts +14 -0
  28. package/dist/ui/ItemsSettings/index.d.ts +25 -0
  29. package/dist/ui/ItemsSettings/popup.d.ts +12 -0
  30. package/dist/ui/TextSettings/index.d.ts +1 -1
  31. package/dist/ui/TypeTexts/index.d.ts +7 -0
  32. package/dist/ui/index.d.ts +4 -0
  33. package/dist/ui.cjs.js +1 -1
  34. package/dist/ui.es.js +527 -93
  35. package/package.json +1 -1
  36. package/dist/index-YVaQxWXR.cjs +0 -34
  37. package/dist/index-dSkEANl1.js +0 -1914
@@ -1,3 +1,5 @@
1
1
  import { Method } from 'axios';
2
2
  export declare const API_URL = "https://g-api.billgang.com";
3
3
  export declare const updateSettings: (method: Method | undefined, endpoint: string, data?: Record<string, any>) => Promise<any>;
4
+ export declare const getImages: () => Promise<any>;
5
+ export declare const updateImages: (formData: FormData) => Promise<any>;
@@ -1,4 +1,4 @@
1
- type Size = 'm' | 'l';
1
+ type Size = 's' | 'm' | 'l';
2
2
  interface Props {
3
3
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
4
4
  style?: React.CSSProperties;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ value: boolean;
4
+ onChange: (value: boolean) => void;
5
+ }
6
+ export declare const Checkbox: React.FC<Props>;
7
+ export {};
@@ -3,6 +3,9 @@ interface Props {
3
3
  onChange?: (value: boolean) => void;
4
4
  style?: React.CSSProperties;
5
5
  current: boolean;
6
+ label?: string;
7
+ hasBackground?: boolean;
8
+ paddingless?: boolean;
6
9
  }
7
10
  export declare const Switch: React.FC<Props>;
8
11
  export {};
@@ -10,3 +10,4 @@ export * from './Modal';
10
10
  export * from './Textarea';
11
11
  export * from './Radio';
12
12
  export * from './Tip';
13
+ export * from './Checkbox';
@@ -0,0 +1,5 @@
1
+ import * as C from "react";
2
+ const t = (e) => /* @__PURE__ */ C.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M4.99904 8.20312V3.125C4.99904 2.95924 4.93319 2.80027 4.81598 2.68306C4.69877 2.56585 4.5398 2.5 4.37404 2.5C4.20828 2.5 4.04931 2.56585 3.9321 2.68306C3.81489 2.80027 3.74904 2.95924 3.74904 3.125V8.20312C3.21128 8.34081 2.73464 8.65356 2.39427 9.09207C2.05389 9.53057 1.86914 10.0699 1.86914 10.625C1.86914 11.1801 2.05389 11.7194 2.39427 12.1579C2.73464 12.5964 3.21128 12.9092 3.74904 13.0469V16.875C3.74904 17.0408 3.81489 17.1997 3.9321 17.3169C4.04931 17.4342 4.20828 17.5 4.37404 17.5C4.5398 17.5 4.69877 17.4342 4.81598 17.3169C4.93319 17.1997 4.99904 17.0408 4.99904 16.875V13.0469C5.5368 12.9092 6.01344 12.5964 6.35382 12.1579C6.69419 11.7194 6.87894 11.1801 6.87894 10.625C6.87894 10.0699 6.69419 9.53057 6.35382 9.09207C6.01344 8.65356 5.5368 8.34081 4.99904 8.20312ZM4.37404 11.875C4.12682 11.875 3.88514 11.8017 3.67958 11.6643C3.47402 11.527 3.3138 11.3318 3.21919 11.1034C3.12458 10.8749 3.09983 10.6236 3.14806 10.3811C3.19629 10.1387 3.31534 9.91593 3.49016 9.74112C3.66497 9.5663 3.8877 9.44725 4.13018 9.39902C4.37266 9.35079 4.62399 9.37554 4.8524 9.47015C5.0808 9.56476 5.27603 9.72498 5.41338 9.93054C5.55073 10.1361 5.62404 10.3778 5.62404 10.625C5.62404 10.9565 5.49235 11.2745 5.25793 11.5089C5.02351 11.7433 4.70556 11.875 4.37404 11.875ZM10.624 4.45312V3.125C10.624 2.95924 10.5582 2.80027 10.441 2.68306C10.3238 2.56585 10.1648 2.5 9.99904 2.5C9.83328 2.5 9.67431 2.56585 9.5571 2.68306C9.43989 2.80027 9.37404 2.95924 9.37404 3.125V4.45312C8.83628 4.59081 8.35964 4.90356 8.01927 5.34207C7.67889 5.78057 7.49414 6.31989 7.49414 6.875C7.49414 7.43011 7.67889 7.96943 8.01927 8.40793C8.35964 8.84644 8.83628 9.15919 9.37404 9.29688V16.875C9.37404 17.0408 9.43989 17.1997 9.5571 17.3169C9.67431 17.4342 9.83328 17.5 9.99904 17.5C10.1648 17.5 10.3238 17.4342 10.441 17.3169C10.5582 17.1997 10.624 17.0408 10.624 16.875V9.29688C11.1618 9.15919 11.6384 8.84644 11.9788 8.40793C12.3192 7.96943 12.5039 7.43011 12.5039 6.875C12.5039 6.31989 12.3192 5.78057 11.9788 5.34207C11.6384 4.90356 11.1618 4.59081 10.624 4.45312ZM9.99904 8.125C9.75182 8.125 9.51014 8.05169 9.30458 7.91434C9.09902 7.77699 8.9388 7.58176 8.84419 7.35335C8.74958 7.12495 8.72483 6.87361 8.77306 6.63114C8.82129 6.38866 8.94034 6.16593 9.11516 5.99112C9.28997 5.8163 9.5127 5.69725 9.75518 5.64902C9.99766 5.60079 10.249 5.62554 10.4774 5.72015C10.7058 5.81476 10.901 5.97498 11.0384 6.18054C11.1757 6.3861 11.249 6.62777 11.249 6.875C11.249 7.20652 11.1173 7.52446 10.8829 7.75888C10.6485 7.9933 10.3306 8.125 9.99904 8.125ZM18.124 13.125C18.1235 12.5707 17.9392 12.0323 17.5999 11.5941C17.2606 11.1558 16.7855 10.8425 16.249 10.7031V3.125C16.249 2.95924 16.1832 2.80027 16.066 2.68306C15.9488 2.56585 15.7898 2.5 15.624 2.5C15.4583 2.5 15.2993 2.56585 15.1821 2.68306C15.0649 2.80027 14.999 2.95924 14.999 3.125V10.7031C14.4613 10.8408 13.9846 11.1536 13.6443 11.5921C13.3039 12.0306 13.1191 12.5699 13.1191 13.125C13.1191 13.6801 13.3039 14.2194 13.6443 14.6579C13.9846 15.0964 14.4613 15.4092 14.999 15.5469V16.875C14.999 17.0408 15.0649 17.1997 15.1821 17.3169C15.2993 17.4342 15.4583 17.5 15.624 17.5C15.7898 17.5 15.9488 17.4342 16.066 17.3169C16.1832 17.1997 16.249 17.0408 16.249 16.875V15.5469C16.7855 15.4075 17.2606 15.0942 17.5999 14.6559C17.9392 14.2177 18.1235 13.6793 18.124 13.125ZM15.624 14.375C15.3768 14.375 15.1351 14.3017 14.9296 14.1643C14.724 14.027 14.5638 13.8318 14.4692 13.6034C14.3746 13.3749 14.3498 13.1236 14.3981 12.8811C14.4463 12.6387 14.5653 12.4159 14.7402 12.2411C14.915 12.0663 15.1377 11.9472 15.3802 11.899C15.6227 11.8508 15.874 11.8755 16.1024 11.9701C16.3308 12.0648 16.526 12.225 16.6634 12.4305C16.8007 12.6361 16.874 12.8778 16.874 13.125C16.874 13.4565 16.7423 13.7745 16.5079 14.0089C16.2735 14.2433 15.9556 14.375 15.624 14.375Z", fill: "#252525" }));
3
+ export {
4
+ t as default
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function c(C){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const e in C)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(C,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>C[e]})}}return t.default=C,Object.freeze(t)}const r=c(o),l=C=>r.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...C},r.createElement("path",{d:"M4.99904 8.20312V3.125C4.99904 2.95924 4.93319 2.80027 4.81598 2.68306C4.69877 2.56585 4.5398 2.5 4.37404 2.5C4.20828 2.5 4.04931 2.56585 3.9321 2.68306C3.81489 2.80027 3.74904 2.95924 3.74904 3.125V8.20312C3.21128 8.34081 2.73464 8.65356 2.39427 9.09207C2.05389 9.53057 1.86914 10.0699 1.86914 10.625C1.86914 11.1801 2.05389 11.7194 2.39427 12.1579C2.73464 12.5964 3.21128 12.9092 3.74904 13.0469V16.875C3.74904 17.0408 3.81489 17.1997 3.9321 17.3169C4.04931 17.4342 4.20828 17.5 4.37404 17.5C4.5398 17.5 4.69877 17.4342 4.81598 17.3169C4.93319 17.1997 4.99904 17.0408 4.99904 16.875V13.0469C5.5368 12.9092 6.01344 12.5964 6.35382 12.1579C6.69419 11.7194 6.87894 11.1801 6.87894 10.625C6.87894 10.0699 6.69419 9.53057 6.35382 9.09207C6.01344 8.65356 5.5368 8.34081 4.99904 8.20312ZM4.37404 11.875C4.12682 11.875 3.88514 11.8017 3.67958 11.6643C3.47402 11.527 3.3138 11.3318 3.21919 11.1034C3.12458 10.8749 3.09983 10.6236 3.14806 10.3811C3.19629 10.1387 3.31534 9.91593 3.49016 9.74112C3.66497 9.5663 3.8877 9.44725 4.13018 9.39902C4.37266 9.35079 4.62399 9.37554 4.8524 9.47015C5.0808 9.56476 5.27603 9.72498 5.41338 9.93054C5.55073 10.1361 5.62404 10.3778 5.62404 10.625C5.62404 10.9565 5.49235 11.2745 5.25793 11.5089C5.02351 11.7433 4.70556 11.875 4.37404 11.875ZM10.624 4.45312V3.125C10.624 2.95924 10.5582 2.80027 10.441 2.68306C10.3238 2.56585 10.1648 2.5 9.99904 2.5C9.83328 2.5 9.67431 2.56585 9.5571 2.68306C9.43989 2.80027 9.37404 2.95924 9.37404 3.125V4.45312C8.83628 4.59081 8.35964 4.90356 8.01927 5.34207C7.67889 5.78057 7.49414 6.31989 7.49414 6.875C7.49414 7.43011 7.67889 7.96943 8.01927 8.40793C8.35964 8.84644 8.83628 9.15919 9.37404 9.29688V16.875C9.37404 17.0408 9.43989 17.1997 9.5571 17.3169C9.67431 17.4342 9.83328 17.5 9.99904 17.5C10.1648 17.5 10.3238 17.4342 10.441 17.3169C10.5582 17.1997 10.624 17.0408 10.624 16.875V9.29688C11.1618 9.15919 11.6384 8.84644 11.9788 8.40793C12.3192 7.96943 12.5039 7.43011 12.5039 6.875C12.5039 6.31989 12.3192 5.78057 11.9788 5.34207C11.6384 4.90356 11.1618 4.59081 10.624 4.45312ZM9.99904 8.125C9.75182 8.125 9.51014 8.05169 9.30458 7.91434C9.09902 7.77699 8.9388 7.58176 8.84419 7.35335C8.74958 7.12495 8.72483 6.87361 8.77306 6.63114C8.82129 6.38866 8.94034 6.16593 9.11516 5.99112C9.28997 5.8163 9.5127 5.69725 9.75518 5.64902C9.99766 5.60079 10.249 5.62554 10.4774 5.72015C10.7058 5.81476 10.901 5.97498 11.0384 6.18054C11.1757 6.3861 11.249 6.62777 11.249 6.875C11.249 7.20652 11.1173 7.52446 10.8829 7.75888C10.6485 7.9933 10.3306 8.125 9.99904 8.125ZM18.124 13.125C18.1235 12.5707 17.9392 12.0323 17.5999 11.5941C17.2606 11.1558 16.7855 10.8425 16.249 10.7031V3.125C16.249 2.95924 16.1832 2.80027 16.066 2.68306C15.9488 2.56585 15.7898 2.5 15.624 2.5C15.4583 2.5 15.2993 2.56585 15.1821 2.68306C15.0649 2.80027 14.999 2.95924 14.999 3.125V10.7031C14.4613 10.8408 13.9846 11.1536 13.6443 11.5921C13.3039 12.0306 13.1191 12.5699 13.1191 13.125C13.1191 13.6801 13.3039 14.2194 13.6443 14.6579C13.9846 15.0964 14.4613 15.4092 14.999 15.5469V16.875C14.999 17.0408 15.0649 17.1997 15.1821 17.3169C15.2993 17.4342 15.4583 17.5 15.624 17.5C15.7898 17.5 15.9488 17.4342 16.066 17.3169C16.1832 17.1997 16.249 17.0408 16.249 16.875V15.5469C16.7855 15.4075 17.2606 15.0942 17.5999 14.6559C17.9392 14.2177 18.1235 13.6793 18.124 13.125ZM15.624 14.375C15.3768 14.375 15.1351 14.3017 14.9296 14.1643C14.724 14.027 14.5638 13.8318 14.4692 13.6034C14.3746 13.3749 14.3498 13.1236 14.3981 12.8811C14.4463 12.6387 14.5653 12.4159 14.7402 12.2411C14.915 12.0663 15.1377 11.9472 15.3802 11.899C15.6227 11.8508 15.874 11.8755 16.1024 11.9701C16.3308 12.0648 16.526 12.225 16.6634 12.4305C16.8007 12.6361 16.874 12.8778 16.874 13.125C16.874 13.4565 16.7423 13.7745 16.5079 14.0089C16.2735 14.2433 15.9556 14.375 15.624 14.375Z",fill:"#252525"}));exports.default=l;
@@ -10,3 +10,4 @@ export * from './useFontsStore';
10
10
  export * from './useSettingsStore';
11
11
  export * from './useColorPickerStore';
12
12
  export * from './usePagesStore';
13
+ export * from './useChooseImageStore';
@@ -0,0 +1,6 @@
1
+ interface Options {
2
+ openModal: boolean;
3
+ setOpenModal: (openModal: boolean) => void;
4
+ }
5
+ export declare const useChooseImageStore: import("zustand").UseBoundStore<import("zustand").StoreApi<Options>>;
6
+ export {};
@@ -1,11 +1,16 @@
1
+ import { IBlock } from '../abstractions';
1
2
  interface Block {
2
3
  name: string;
3
4
  value: any;
4
5
  }
5
6
  interface Options {
7
+ header: IBlock | null;
8
+ footer: IBlock | null;
6
9
  blocks: Record<string, Record<string, Block>>;
7
10
  currentBlock: string | null;
8
11
  positionBlock: number | null;
12
+ setHeader: (header: IBlock) => void;
13
+ setFooter: (footer: IBlock) => void;
9
14
  createPage: (name: string) => void;
10
15
  deletePage: (name: string) => void;
11
16
  updatePage: (oldName: string, newName: string) => void;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { TextType } from '../TypeTexts';
3
+ export type TypeButton = 'Primary' | 'Secondary';
4
+ export type Destination = 'Open Link' | 'Go to Page';
5
+ export interface ButtonType {
6
+ image?: string;
7
+ type: TypeButton;
8
+ id: string;
9
+ typeText: TextType;
10
+ destination: Destination;
11
+ link?: string;
12
+ }
13
+ interface Props {
14
+ isActiveButtons: boolean;
15
+ setIsActiveButtons: React.Dispatch<React.SetStateAction<boolean>>;
16
+ buttons: ButtonType[];
17
+ setButtons: React.Dispatch<React.SetStateAction<ButtonType[]>>;
18
+ }
19
+ export declare const ButtonsSettings: React.FC<Props>;
20
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ButtonType } from '.';
2
+ import React from 'react';
3
+ interface Props {
4
+ activeButton: ButtonType;
5
+ setActiveButton: React.Dispatch<React.SetStateAction<ButtonType | null>>;
6
+ popupPosition: {
7
+ top: number;
8
+ left: number;
9
+ };
10
+ }
11
+ export declare const ButtonPopup: React.FC<Props>;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ label?: string;
4
+ }
5
+ export declare const ChooseImage: React.FC<Props>;
6
+ export interface Image {
7
+ cfId: string;
8
+ createdAt: string;
9
+ fileName: string;
10
+ id: number;
11
+ isSelected: boolean;
12
+ }
13
+ export declare const ChooseImageModal: React.FC;
14
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ export interface ItemBase {
3
+ image?: string;
4
+ name: string;
5
+ id: string;
6
+ }
7
+ export interface Product extends ItemBase {
8
+ }
9
+ export interface Pages extends ItemBase {
10
+ }
11
+ interface Props<T extends ItemBase> {
12
+ isActiveItems: boolean;
13
+ setIsActiveItems: React.Dispatch<React.SetStateAction<boolean>>;
14
+ items: T[];
15
+ setItems: React.Dispatch<React.SetStateAction<T[]>>;
16
+ isProductStats?: boolean;
17
+ setIsProductStats?: React.Dispatch<React.SetStateAction<boolean>>;
18
+ title?: string;
19
+ subtitle?: string;
20
+ editable?: boolean;
21
+ draggable?: boolean;
22
+ withImage?: boolean;
23
+ }
24
+ export declare const ItemsSettings: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ItemBase } from '.';
2
+ import React from 'react';
3
+ interface Props<T extends ItemBase> {
4
+ activeItem: T;
5
+ setActiveItem: React.Dispatch<React.SetStateAction<T | null>>;
6
+ popupPosition: {
7
+ top: number;
8
+ left: number;
9
+ };
10
+ }
11
+ export declare const ProductPopup: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type TextType = 'bold' | 'italic' | 'underline' | 'strike-through' | 'code';
2
+ import { TextType } from '../TypeTexts';
3
3
  interface Props {
4
4
  typeText: TextType;
5
5
  setTypeText: React.Dispatch<React.SetStateAction<TextType>>;
@@ -0,0 +1,7 @@
1
+ export type TextType = 'bold' | 'italic' | 'underline' | 'strike-through' | 'code';
2
+ interface Props {
3
+ typeText: TextType;
4
+ setTypeText: React.Dispatch<React.SetStateAction<TextType>>;
5
+ }
6
+ export declare const TypeTexts: React.FC<Props>;
7
+ export {};
@@ -1,3 +1,7 @@
1
1
  export * from '../shared/ui';
2
2
  export * from './LayoutSettings';
3
3
  export * from './TextSettings';
4
+ export * from './ItemsSettings';
5
+ export * from './ButtonsSettings';
6
+ export * from './TypeTexts';
7
+ export * from './ChooseImage';
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-YVaQxWXR.cjs");require("react");const u="_wrapper_o1bnv_2",_="_alignmentBlock_o1bnv_8",h="_title_o1bnv_16",g="_subtitle_o1bnv_23",j="_alignmentContent_o1bnv_30",b="_alignments_o1bnv_37",v="_alignment_o1bnv_8",R="_circle_o1bnv_56",E="_paddings_o1bnv_63",k="_padding_o1bnv_63",T="_input_o1bnv_81",s={wrapper:u,alignmentBlock:_,title:h,subtitle:g,alignmentContent:j,alignments:b,alignment:v,circle:R,paddings:E,padding:k,input:T},N=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],y=["left","top","right","bottom"],S=c=>{const{alignment:o,padding:a,setPadding:x,setAlignment:r}=c;return t.jsxRuntimeExports.jsxs("div",{className:s.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:s.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:s.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:s.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:s.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:s.alignments,children:N.map(e=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{console.log(e,o),r(l=>(console.log(l,e),e))},className:s.alignment,children:[e!==o&&t.jsxRuntimeExports.jsx("div",{className:s.circle}),e===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},e))}),t.jsxRuntimeExports.jsx("div",{className:s.paddings,children:y.map(e=>t.jsxRuntimeExports.jsxs("label",{className:s.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${e}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(a[e]),onChange:l=>x(m=>({...m,[e]:Number(l)})),paddingless:!0})]}))})]})]})]})},C="_subtitle_1hhz4_1",B="_header_1hhz4_8",I="_text_1hhz4_9",f="_top_1hhz4_16",w="_itemsBlock_1hhz4_23",z="_typeTexts_1hhz4_29",P="_block_1hhz4_35",L="_active_1hhz4_46",i={subtitle:C,header:B,text:I,top:f,itemsBlock:w,typeTexts:z,block:P,active:L},$=["bold","italic","underline","strike-through","code"],A=c=>{const{typeText:o,isActiveText:a,setIsActiveText:x,text:r,setText:e,setTypeText:l,title:m,subtitle:p="Items"}=c;return t.jsxRuntimeExports.jsxs("div",{className:i.text,children:[t.jsxRuntimeExports.jsxs("div",{className:i.top,children:[t.jsxRuntimeExports.jsx("h3",{className:i.title,children:m}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:n=>x(d=>n)})]}),t.jsxRuntimeExports.jsxs("div",{className:i.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:i.subtitle,children:p}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:n=>e(d=>n),value:r,maxLength:150}),t.jsxRuntimeExports.jsx("div",{className:i.typeTexts,children:$.map(n=>t.jsxRuntimeExports.jsx("div",{className:t.clx(i.block,{[i.active]:o===n}),onClick:()=>l(d=>n),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${n}`,fill:o===n?"#252525":"#757575",width:20,height:20})},String(n)))})]})]})};exports.Button=t.Button;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.LayoutSettings=S;exports.TextSettings=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BO6B5tl0.cjs"),h=require("react"),T="_wrapper_o1bnv_2",$="_alignmentBlock_o1bnv_8",S="_title_o1bnv_16",P="_subtitle_o1bnv_23",A="_alignmentContent_o1bnv_30",L="_alignments_o1bnv_37",z="_alignment_o1bnv_8",O="_circle_o1bnv_56",H="_paddings_o1bnv_63",M="_padding_o1bnv_63",F="_input_o1bnv_81",j={wrapper:T,alignmentBlock:$,title:S,subtitle:P,alignmentContent:A,alignments:L,alignment:z,circle:O,paddings:H,padding:M,input:F},G=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],q=["left","top","right","bottom"],D=x=>{const{alignment:n,padding:r,setPadding:e,setAlignment:a}=x;return t.jsxRuntimeExports.jsxs("div",{className:j.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:j.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:j.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:j.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:j.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:j.alignments,children:G.map(o=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{a(c=>o)},className:j.alignment,children:[o!==n&&t.jsxRuntimeExports.jsx("div",{className:j.circle}),o===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},o))}),t.jsxRuntimeExports.jsx("div",{className:j.paddings,children:q.map(o=>t.jsxRuntimeExports.jsxs("label",{className:j.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${o}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(r[o]),onChange:c=>e(m=>({...m,[o]:Number(c)})),paddingless:!0})]}))})]})]})]})},Y="_subtitle_2zbxx_1",J="_header_2zbxx_8",K="_text_2zbxx_9",Q="_top_2zbxx_16",U="_itemsBlock_2zbxx_23",E={subtitle:Y,header:J,text:K,top:Q,itemsBlock:U},V="_typeTexts_3zlec_1",W="_block_3zlec_7",X="_active_3zlec_18",N={typeTexts:V,block:W,active:X},Z=["bold","italic","underline","strike-through","code"],f=x=>{const{typeText:n,setTypeText:r}=x;return t.jsxRuntimeExports.jsx("div",{className:N.typeTexts,children:Z.map(e=>t.jsxRuntimeExports.jsx("div",{className:t.clx(N.block,{[N.active]:n===e}),onClick:()=>r(a=>e),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${e}`,fill:n===e?"#252525":"#757575",width:20,height:20})},String(e)))})},tt=x=>{const{typeText:n,isActiveText:r,setIsActiveText:e,text:a,setText:o,setTypeText:c,title:m,subtitle:g="Items"}=x;return t.jsxRuntimeExports.jsxs("div",{className:E.text,children:[t.jsxRuntimeExports.jsxs("div",{className:E.top,children:[t.jsxRuntimeExports.jsx("h3",{className:E.title,children:m}),t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:d=>e(s=>d)})]}),t.jsxRuntimeExports.jsxs("div",{className:E.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:E.subtitle,children:g}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:d=>o(s=>d),value:a,maxLength:150}),t.jsxRuntimeExports.jsx(f,{typeText:n,setTypeText:c})]})]})},st="_subtitle_2l7ty_1",et="_header_2l7ty_8",nt="_text_2l7ty_9",ot="_productsBlock_2l7ty_10",it="_top_2l7ty_22",ct="_itemsBlock_2l7ty_29",lt="_typeTexts_2l7ty_35",at="_block_2l7ty_41",xt="_active_2l7ty_52",rt="_products_2l7ty_10",ut="_product_2l7ty_10",pt="_button_2l7ty_70",mt="_image_2l7ty_80",dt="_info_2l7ty_87",_t="_name_2l7ty_98",jt="_buttons_2l7ty_102",ht="_modal_2l7ty_108",gt="_other_2l7ty_125",l={subtitle:st,header:et,text:nt,productsBlock:ot,top:it,itemsBlock:ct,typeTexts:lt,block:at,active:xt,products:rt,product:ut,button:pt,image:mt,info:dt,name:_t,buttons:jt,modal:ht,other:gt},bt=x=>{const{activeItem:n,setActiveItem:r,popupPosition:e}=x;return t.jsxRuntimeExports.jsxs("div",{className:l.modal,onClick:a=>{a.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>r(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},vt=x=>{const{isActiveItems:n,setIsActiveItems:r,items:e,setItems:a,isProductStats:o,setIsProductStats:c,title:m,subtitle:g,editable:d=!0,draggable:s=!1,withImage:p=!0}=x,[v,b]=h.useState(null),[y,R]=h.useState({top:0,left:0});h.useEffect(()=>{const i=()=>{b(null)};return document.body.addEventListener("click",i),b(null),()=>{b(null),document.body.removeEventListener("click",i)}},[]);const I=(i,_)=>{i.stopPropagation();const k=i.target.getBoundingClientRect(),B=100,C=window.innerHeight;let w=k.top+window.scrollY;w+B>C&&(w=C-B-20),R({top:w-80,left:k.left-30}),b(_)};return t.jsxRuntimeExports.jsxs("div",{className:l.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:l.title,children:m}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:i=>r(_=>i)})]}),v&&d&&t.jsxRuntimeExports.jsx(bt,{activeItem:v,setActiveItem:b,popupPosition:y}),t.jsxRuntimeExports.jsxs("div",{className:l.products,children:[g&&t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:g}),e.map(i=>t.jsxRuntimeExports.jsxs("div",{className:l.product,children:[s&&t.jsxRuntimeExports.jsx(t.Icon,{name:"drag",hoverable:!0,width:20,height:20}),t.jsxRuntimeExports.jsxs("div",{className:l.info,children:[p&&t.jsxRuntimeExports.jsx("div",{className:l.image,children:i.image?t.jsxRuntimeExports.jsx("img",{src:i.image}):t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}),t.jsxRuntimeExports.jsx("span",{className:l.name,children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:l.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:_=>{I(_,i)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(_=>_.filter(k=>k.id!==i.id)),width:20,height:20,fill:"#C12A2A"})]})]},i.id)),t.jsxRuntimeExports.jsxs(t.Button,{className:l.button,size:"s",onClick:()=>a(i=>{const _=[...i];return _.push({name:"Product 1",id:t.v4()}),_}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),o!==void 0&&t.jsxRuntimeExports.jsxs("div",{className:l.other,children:[t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:"Other"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:i=>c==null?void 0:c(_=>i),label:"Product Stats",hasBackground:!0,paddingless:!1})]})]})},Rt="_subtitle_1y5sw_1",Et="_header_1y5sw_8",yt="_text_1y5sw_9",kt="_productsBlock_1y5sw_10",wt="_buttonsBlock_1y5sw_11",Nt="_top_1y5sw_22",ft="_itemsBlock_1y5sw_29",Bt="_typeTexts_1y5sw_35",Ct="_block_1y5sw_41",It="_active_1y5sw_52",Tt="_products_1y5sw_10",$t="_product_1y5sw_10",St="_button_1y5sw_11",Pt="_image_1y5sw_80",At="_info_1y5sw_87",Lt="_name_1y5sw_98",zt="_buttons_1y5sw_11",Ot="_modal_1y5sw_108",Ht="_other_1y5sw_125",Mt="_options_1y5sw_131",u={subtitle:Rt,header:Et,text:yt,productsBlock:kt,buttonsBlock:wt,top:Nt,itemsBlock:ft,typeTexts:Bt,block:Ct,active:It,products:Tt,product:$t,button:St,image:Pt,info:At,name:Lt,buttons:zt,modal:Ot,other:Ht,options:Mt},Ft=x=>{const{activeButton:n,setActiveButton:r,popupPosition:e}=x,[a,o]=h.useState(n.typeText),[c,m]=h.useState(n.destination),[g,d]=h.useState(n.link||"");return t.jsxRuntimeExports.jsxs("div",{className:u.modal,onClick:s=>{s.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:u.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>r(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:u.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:s=>m(s),options:["Go to Page","Open Link"],value:c}),c==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>d(s),value:g,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:()=>{},value:"Lorem ipsum dolor sit amet com",label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(f,{typeText:a,setTypeText:o})]})]})},Gt=x=>{const{isActiveButtons:n,setIsActiveButtons:r,buttons:e,setButtons:a}=x,[o,c]=h.useState(null),[m,g]=h.useState({top:0,left:0});h.useEffect(()=>{const s=()=>{c(null)};return document.body.addEventListener("click",s),c(null),()=>{c(null),document.body.removeEventListener("click",s)}},[]);const d=(s,p)=>{s.stopPropagation();const v=s.target.getBoundingClientRect(),b=490,y=window.innerHeight;let R=v.top+window.scrollY;R+b>y&&(R=y-b-20),g({top:R,left:v.left-30}),c(p)};return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:u.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:u.top,children:[t.jsxRuntimeExports.jsx("h3",{className:u.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:s=>r(p=>s)})]}),t.jsxRuntimeExports.jsxs("div",{className:u.products,children:[t.jsxRuntimeExports.jsx("h5",{className:u.subtitle,children:"Button Type"}),e.map(s=>t.jsxRuntimeExports.jsxs("div",{className:u.product,children:[t.jsxRuntimeExports.jsxs("div",{className:u.info,children:[t.jsxRuntimeExports.jsx("span",{className:u.name,children:s.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:u.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:p=>{d(p,s)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(p=>p.filter(v=>v.id!==s.id)),width:20,height:20,fill:"#C12A2A"})]})]},s.id)),o&&t.jsxRuntimeExports.jsx(Ft,{activeButton:o,setActiveButton:c,popupPosition:m}),t.jsxRuntimeExports.jsxs(t.Button,{className:u.button,size:"s",onClick:()=>a(s=>{const p=[...s];return p.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),p}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})]})})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.ButtonsSettings=Gt;exports.ItemsSettings=vt;exports.LayoutSettings=D;exports.TextSettings=tt;exports.TypeTexts=f;