@chaibuilder/sdk 0.1.8 → 0.1.9
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/dist/{AddBlocks-4e50ad65.cjs → AddBlocks-8bcba532.cjs} +1 -1
- package/dist/{AddBlocks-619d3dde.js → AddBlocks-a9d3b6c0.js} +2 -2
- package/dist/BrandingOptions-c4c8676e.cjs +1 -0
- package/dist/{BrandingOptions-05634eee.js → BrandingOptions-c8dba155.js} +18 -16
- package/dist/{CanvasArea-8f96a9f5.js → CanvasArea-77c280f6.js} +4 -4
- package/dist/{CanvasArea-f26157c0.cjs → CanvasArea-c8892280.cjs} +2 -2
- package/dist/{CurrentPage-d372a5a9.js → CurrentPage-6ca95592.js} +2 -2
- package/dist/{CurrentPage-0663041c.cjs → CurrentPage-ebe20c9e.cjs} +1 -1
- package/dist/{Layers-57457feb.cjs → Layers-c1be574f.cjs} +1 -1
- package/dist/{Layers-5da1d796.js → Layers-d3c8eea6.js} +4 -4
- package/dist/{MarkAsGlobalBlock-1a0d0725.js → MarkAsGlobalBlock-04b2d169.js} +3 -3
- package/dist/{MarkAsGlobalBlock-dd53daec.cjs → MarkAsGlobalBlock-d40a9947.cjs} +1 -1
- package/dist/{PagesPanel-113739d6.cjs → PagesPanel-27f7a791.cjs} +1 -1
- package/dist/{PagesPanel-42dba988.js → PagesPanel-78e3bbb9.js} +4 -4
- package/dist/{ProjectPanel-7e26e6a3.js → ProjectPanel-22ec7598.js} +4 -4
- package/dist/{ProjectPanel-ee6b71ab.cjs → ProjectPanel-8cec3a82.cjs} +1 -1
- package/dist/{Settings-9f28c157.cjs → Settings-675c7a84.cjs} +1 -1
- package/dist/{Settings-cdaf197a.js → Settings-e49b1212.js} +4 -4
- package/dist/{SidePanels-ce2deb33.cjs → SidePanels-35ad2f5f.cjs} +1 -1
- package/dist/{SidePanels-7757f767.js → SidePanels-7371a5c6.js} +4 -4
- package/dist/{Topbar-7600678e.cjs → Topbar-3bda931b.cjs} +1 -1
- package/dist/{Topbar-73c9aa97.js → Topbar-da90da83.js} +3 -3
- package/dist/{add-page-modal-eb896eef.cjs → add-page-modal-15f377cc.cjs} +1 -1
- package/dist/{add-page-modal-96a1f8dc.js → add-page-modal-6b37b90c.js} +5 -5
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -8
- package/dist/core.js +57 -59
- package/dist/{delete-page-modal-aabd460d.js → delete-page-modal-3b1edeb1.js} +3 -3
- package/dist/{delete-page-modal-306dab3c.cjs → delete-page-modal-92a70848.cjs} +1 -1
- package/dist/{form-6eac0287.cjs → form-431f0141.cjs} +1 -1
- package/dist/{form-5d5c5c9e.js → form-526188f9.js} +1 -1
- package/dist/{html-to-json-feece010.cjs → html-to-json-78bfa1f3.cjs} +1 -1
- package/dist/{html-to-json-eb4de645.js → html-to-json-8397fab5.js} +1 -1
- package/dist/{index-38bc7894.js → index-67c3fc28.js} +1053 -1071
- package/dist/{index-94612af5.cjs → index-d214d8c8.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +8 -0
- package/dist/lib.js +36 -34
- package/dist/link-8b201d2c.cjs +1 -0
- package/dist/{link-f80a947d.js → link-ebe8a751.js} +60 -51
- package/dist/{page-viewer-f60c4980.cjs → page-viewer-584e4c45.cjs} +1 -1
- package/dist/{page-viewer-be5d5315.js → page-viewer-dcd98e40.js} +4 -4
- package/dist/{project-general-setting-bebd5cb1.cjs → project-general-setting-09427e43.cjs} +1 -1
- package/dist/{project-general-setting-cc9b43cd.js → project-general-setting-f4614eb4.js} +5 -5
- package/dist/{project-seo-setting-e3924578.cjs → project-seo-setting-157acce4.cjs} +1 -1
- package/dist/{project-seo-setting-01536592.js → project-seo-setting-f31a84f5.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{single-page-detail-33436195.js → single-page-detail-20bf1b52.js} +5 -5
- package/dist/{single-page-detail-584589e0.cjs → single-page-detail-e9713757.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/BrandingOptions-d2a7778f.cjs +0 -1
- package/dist/link-86c532b5.cjs +0 -1
package/dist/lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./utils-3c452dd0.cjs"),r=require("./html-to-json-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./utils-3c452dd0.cjs"),r=require("./html-to-json-78bfa1f3.cjs"),s=require("lodash");require("clsx");require("tailwind-merge");require("./MODIFIERS-70fef873.cjs");require("himalaya");const d={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},k={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"},T=16,b=4;function V(n){return n.indexOf("rem")!==-1&&(n=`${parseFloat(n.replace("rem",""))*T}px`),n}const y=n=>{const l=n.match(/\[.*\]/);if(l===null)return n;const p=r.constructClassObject(n);if(p===null)return n;const{property:g}=p;let e=s.first(l).replace(/\]/i,"").replace(/\[/i,"");const c=n.replace(/\[.*\]/i,"");e=V(e);let a=n;switch(g){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const t=s.map(s.keys(k),i=>`${i}px`);if(s.includes(t,e)){const i=s.parseInt(e.replace("px",""),10);i===1?a=`${c}px`:a=c+i/b}}if(e.indexOf("%")!==-1){const t=s.map(s.keys(d),i=>`${i}%`);if(s.includes(t,e)){const i=parseFloat(e.replace("%",""));a=c+s.get(d,i)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${c}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${c}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};s.includes(s.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const o={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};s.includes(s.keys(o),e)&&(a=c+o[e]);break;case"lineHeight":const u={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};s.includes(s.keys(u),e)&&(a=c+u[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${c}${e}`:n;break;case"opacity":const m=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],f=parseFloat(e)*100;s.includes(m,f.toString())&&(a=`opacity-${f}`);break}return a},O=n=>({...n}),w=n=>({...n});exports.cn=h.cn;exports.generateUUID=r.generateUUID;exports.getBlocksFromHTML=r.getBlocksFromHTML;exports.getBreakpointValue=r.getBreakpointValue;exports.convertArbitraryToTailwindClass=y;exports.enableStyling=w;exports.setBlockProps=O;
|
package/dist/lib.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ export declare const cn: (...inputs: ClassValue[]) => string;
|
|
|
12
12
|
|
|
13
13
|
export declare const convertArbitraryToTailwindClass: (className: string) => string;
|
|
14
14
|
|
|
15
|
+
export declare const enableStyling: (attrs: Record<string, string>) => {
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
15
19
|
/**
|
|
16
20
|
* Get the unique uuid
|
|
17
21
|
*/
|
|
@@ -26,4 +30,8 @@ export declare const getBlocksFromHTML: (html: string) => ChaiBlock[];
|
|
|
26
30
|
|
|
27
31
|
export declare const getBreakpointValue: (width: number) => "2XL" | "XL" | "LG" | "MD" | "SM" | "XS";
|
|
28
32
|
|
|
33
|
+
export declare const setBlockProps: (attrs: Record<string, string>) => {
|
|
34
|
+
[x: string]: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
29
37
|
export { }
|
package/dist/lib.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { c as b } from "./html-to-json-
|
|
3
|
-
import { g as
|
|
4
|
-
import { first as T, includes as
|
|
1
|
+
import { c as z } from "./utils-ac68b2c8.js";
|
|
2
|
+
import { c as b } from "./html-to-json-8397fab5.js";
|
|
3
|
+
import { g as H, b as M, a as W } from "./html-to-json-8397fab5.js";
|
|
4
|
+
import { first as T, includes as i, keys as p, map as u, parseInt as V, get as O } from "lodash";
|
|
5
5
|
import "clsx";
|
|
6
6
|
import "tailwind-merge";
|
|
7
7
|
import "./MODIFIERS-c2e02614.js";
|
|
8
8
|
import "himalaya";
|
|
9
|
-
const
|
|
9
|
+
const g = {
|
|
10
10
|
25: "1/4",
|
|
11
11
|
"33.33": "1/3",
|
|
12
12
|
50: "1/2",
|
|
@@ -23,7 +23,7 @@ const d = {
|
|
|
23
23
|
"58.33": "7/12",
|
|
24
24
|
"91.67": "11/12",
|
|
25
25
|
100: "full"
|
|
26
|
-
},
|
|
26
|
+
}, k = {
|
|
27
27
|
0: "0",
|
|
28
28
|
1: "px",
|
|
29
29
|
2: "0.5",
|
|
@@ -59,23 +59,23 @@ const d = {
|
|
|
59
59
|
288: "72",
|
|
60
60
|
320: "80",
|
|
61
61
|
384: "96"
|
|
62
|
-
},
|
|
62
|
+
}, _ = 16, $ = 4;
|
|
63
63
|
function w(s) {
|
|
64
|
-
return s.indexOf("rem") !== -1 && (s = `${parseFloat(s.replace("rem", "")) *
|
|
64
|
+
return s.indexOf("rem") !== -1 && (s = `${parseFloat(s.replace("rem", "")) * _}px`), s;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const P = (s) => {
|
|
67
67
|
const r = s.match(/\[.*\]/);
|
|
68
68
|
if (r === null)
|
|
69
69
|
return s;
|
|
70
70
|
const x = b(s);
|
|
71
71
|
if (x === null)
|
|
72
72
|
return s;
|
|
73
|
-
const { property:
|
|
73
|
+
const { property: d } = x;
|
|
74
74
|
let e = T(r).replace(/\]/i, "").replace(/\[/i, "");
|
|
75
|
-
const
|
|
75
|
+
const n = s.replace(/\[.*\]/i, "");
|
|
76
76
|
e = w(e);
|
|
77
77
|
let a = s;
|
|
78
|
-
switch (
|
|
78
|
+
switch (d) {
|
|
79
79
|
case "top":
|
|
80
80
|
case "right":
|
|
81
81
|
case "left":
|
|
@@ -108,23 +108,23 @@ const B = (s) => {
|
|
|
108
108
|
case "spaceX":
|
|
109
109
|
case "spaceY":
|
|
110
110
|
if (e.indexOf("px") !== -1) {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
|
|
111
|
+
const t = u(p(k), (c) => `${c}px`);
|
|
112
|
+
if (i(t, e)) {
|
|
113
|
+
const c = V(e.replace("px", ""), 10);
|
|
114
|
+
c === 1 ? a = `${n}px` : a = n + c / $;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
if (e.indexOf("%") !== -1) {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
a =
|
|
118
|
+
const t = u(p(g), (c) => `${c}%`);
|
|
119
|
+
if (i(t, e)) {
|
|
120
|
+
const c = parseFloat(e.replace("%", ""));
|
|
121
|
+
a = n + O(g, c);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (a = `${
|
|
124
|
+
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (a = `${n}screen`), e.indexOf("vh") !== -1 && parseFloat(e.replace("vh", "")) === 100 && (a = `${n}screen`);
|
|
125
125
|
break;
|
|
126
126
|
case "minWidth":
|
|
127
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${
|
|
127
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${n}full`), e === "0px" && (a = "min-w-0");
|
|
128
128
|
break;
|
|
129
129
|
case "maxWidth":
|
|
130
130
|
e === "0px" && (a = "max-w-0");
|
|
@@ -145,10 +145,10 @@ const B = (s) => {
|
|
|
145
145
|
"640px": "screen-sm",
|
|
146
146
|
"1536px": "screen-2xl"
|
|
147
147
|
};
|
|
148
|
-
p(
|
|
148
|
+
i(p(l), e) && (a = `max-w-${l[e]}`);
|
|
149
149
|
break;
|
|
150
150
|
case "minHeight":
|
|
151
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${
|
|
151
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${n}full`), e === "0px" && (a = "min-h-0"), e === "100vh" && (a = "min-h-screen");
|
|
152
152
|
break;
|
|
153
153
|
case "fontSize":
|
|
154
154
|
const o = {
|
|
@@ -166,7 +166,7 @@ const B = (s) => {
|
|
|
166
166
|
"96px": "8xl",
|
|
167
167
|
"128px": "9xl"
|
|
168
168
|
};
|
|
169
|
-
p(
|
|
169
|
+
i(p(o), e) && (a = n + o[e]);
|
|
170
170
|
break;
|
|
171
171
|
case "lineHeight":
|
|
172
172
|
const f = {
|
|
@@ -185,10 +185,10 @@ const B = (s) => {
|
|
|
185
185
|
"1.625": "relaxed",
|
|
186
186
|
2: "loose"
|
|
187
187
|
};
|
|
188
|
-
p(
|
|
188
|
+
i(p(f), e) && (a = n + f[e]);
|
|
189
189
|
break;
|
|
190
190
|
case "zIndex":
|
|
191
|
-
a = ["0", "10", "20", "30", "40", "50"].indexOf(e) !== -1 ? `${
|
|
191
|
+
a = ["0", "10", "20", "30", "40", "50"].indexOf(e) !== -1 ? `${n}${e}` : s;
|
|
192
192
|
break;
|
|
193
193
|
case "opacity":
|
|
194
194
|
const h = [
|
|
@@ -208,15 +208,17 @@ const B = (s) => {
|
|
|
208
208
|
"95",
|
|
209
209
|
"100"
|
|
210
210
|
], m = parseFloat(e) * 100;
|
|
211
|
-
|
|
211
|
+
i(h, m.toString()) && (a = `opacity-${m}`);
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
214
|
return a;
|
|
215
|
-
};
|
|
215
|
+
}, y = (s) => ({ ...s }), A = (s) => ({ ...s });
|
|
216
216
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
z as cn,
|
|
218
|
+
P as convertArbitraryToTailwindClass,
|
|
219
|
+
A as enableStyling,
|
|
220
|
+
H as generateUUID,
|
|
221
|
+
M as getBlocksFromHTML,
|
|
222
|
+
W as getBreakpointValue,
|
|
223
|
+
y as setBlockProps
|
|
222
224
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-5c3ac4f7.cjs"),m=require("react-icons-picker"),h=require("react-dom"),g=require("lodash"),d=require("react"),x=require("./dialog-170eaad9.cjs"),j=require("./ImagesPanel-addb2bf9.cjs"),E=require("react-quill");require("react-i18next");const R=require("./useBuilderProp-5e57d0c8.cjs"),f=t=>{try{const s=document.getElementById("icon-picker-field"),r=document.createElement("div");h.render(e.jsxRuntimeExports.jsx(m.IconPickerItem,{value:t}),r),s.appendChild(r),r.hidden=!0;let l=r.innerHTML;setTimeout(()=>s.removeChild(r),1e3);const o=new DOMParser().parseFromString(l,"image/svg+xml"),n=o.querySelector("svg");return n&&(n.removeAttribute("width"),n.removeAttribute("height")),new XMLSerializer().serializeToString(o)}catch{return""}},b=({value:t,onChange:s,onBlur:r,id:l})=>{const a=o=>{s("<svg />");const n=f(o);s(n),r(l,n)};return e.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12 group",children:[e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t==null?void 0:t.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"}),e.jsxRuntimeExports.jsx(m,{value:t?"BiSolidGrid":null,onChange:a,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),e.jsxRuntimeExports.jsx("textarea",{value:t,onChange:o=>s(o.target.value),className:"h-full border w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},k=({children:t,onSelect:s})=>{const[r,l]=d.useState(!1),a=(...o)=>{s.call(void 0,...o),l(!1)};return e.jsxRuntimeExports.jsxs(x.Dialog,{open:r,onOpenChange:o=>l(o),children:[e.jsxRuntimeExports.jsx(x.DialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(x.DialogContent,{className:"flex h-3/4 max-w-5xl",children:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:e.jsxRuntimeExports.jsx(j.default,{isModalView:!0,onSelect:a})})})]})},p=k,v=({value:t,onChange:s,id:r,onBlur:l})=>e.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?e.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:t||!g.isEmpty(t)?"Replace Image":"Choose Image"})}),e.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),e.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:a}})=>l(r,a),onChange:a=>s(a.target.value)})]})]}),y=({id:t,placeholder:s,value:r,onChange:l,onBlur:a})=>{const o={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},n=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:e.jsxRuntimeExports.jsx(E,{id:t,value:r,onBlur:c=>a(t,c),onChange:c=>l(c),modules:o,formats:n,placeholder:s,className:"mt-1 rounded-md"})},w=({schema:t,formData:s,onChange:r})=>{const[l,a]=d.useState([]),o=R.useBuilderProp("getPages",()=>[]),{type:n="page",href:c="",target:u="self"}=s;return d.useEffect(()=>{(async()=>{const i=await o();a(i)})()},[o]),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[e.jsxRuntimeExports.jsx("select",{name:"type",defaultValue:"page",value:n,onChange:i=>r({...s,type:i.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(i=>e.jsxRuntimeExports.jsx("option",{value:i.const,children:i.title},i.const))}),n==="page"?e.jsxRuntimeExports.jsxs("select",{name:"href",defaultValue:"",placeholder:"Choose Page",value:c,onChange:i=>r({...s,href:i.target.value}),children:[e.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),g.map(l,i=>e.jsxRuntimeExports.jsx("option",{value:i.slug,children:i.page_name},i.uuid))]}):e.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:c,onChange:i=>r({...s,href:i.target.value}),placeholder:n==="page"||n==="url"?"Enter URL":n==="scroll"?"#ElementID":"Enter detail"}),(n==="page"||n==="url")&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:u==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>r({...s,target:u==="_blank"?"_self":"_blank"})}),e.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.IconPickerField=b;exports.ImagePickerField=v;exports.LinkField=w;exports.RichTextEditorField=y;
|
|
@@ -1,46 +1,55 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import g, { IconPickerItem as m } from "react-icons-picker";
|
|
3
|
+
import x from "react-dom";
|
|
4
4
|
import { isEmpty as h, map as f } from "lodash";
|
|
5
|
-
import { useState as u, useEffect as
|
|
6
|
-
import { D as
|
|
5
|
+
import { useState as u, useEffect as b } from "react";
|
|
6
|
+
import { D as j, b as v, a as k } from "./dialog-3d4e82ed.js";
|
|
7
7
|
import y from "./ImagesPanel-8ccab6d9.js";
|
|
8
8
|
import w from "react-quill";
|
|
9
9
|
import "react-i18next";
|
|
10
10
|
import { u as N } from "./useBuilderProp-81a14920.js";
|
|
11
11
|
const B = (t) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
try {
|
|
13
|
+
const r = document.getElementById("icon-picker-field"), s = document.createElement("div");
|
|
14
|
+
x.render(/* @__PURE__ */ e.jsx(m, { value: t }), s), r.appendChild(s), s.hidden = !0;
|
|
15
|
+
let a = s.innerHTML;
|
|
16
|
+
setTimeout(() => r.removeChild(s), 1e3);
|
|
17
|
+
const n = new DOMParser().parseFromString(a, "image/svg+xml"), l = n.querySelector("svg");
|
|
18
|
+
return l && (l.removeAttribute("width"), l.removeAttribute("height")), new XMLSerializer().serializeToString(n);
|
|
19
|
+
} catch {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
}, z = ({ value: t, onChange: r, onBlur: s, id: a }) => {
|
|
23
|
+
const i = (n) => {
|
|
18
24
|
r("<svg />");
|
|
19
|
-
const
|
|
20
|
-
r(
|
|
25
|
+
const l = B(n);
|
|
26
|
+
r(l), s(a, l);
|
|
21
27
|
};
|
|
22
28
|
return /* @__PURE__ */ e.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
|
|
23
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative h-12 w-12", children: [
|
|
29
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative h-12 w-12 group", children: [
|
|
24
30
|
/* @__PURE__ */ e.jsx(
|
|
25
31
|
"div",
|
|
26
32
|
{
|
|
27
33
|
dangerouslySetInnerHTML: { __html: t == null ? void 0 : t.replace("<svg", '<svg class="h-5 w-5"') },
|
|
28
|
-
className: "absolute left-1/2 top-1/2 -translate-x-1/2
|
|
34
|
+
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"
|
|
29
35
|
}
|
|
30
36
|
),
|
|
31
37
|
/* @__PURE__ */ e.jsx(
|
|
32
|
-
|
|
38
|
+
g,
|
|
33
39
|
{
|
|
34
40
|
value: t ? "BiSolidGrid" : null,
|
|
35
41
|
onChange: i,
|
|
36
42
|
pickButtonStyle: {
|
|
43
|
+
position: "relative",
|
|
37
44
|
height: "48px",
|
|
38
45
|
width: "48px",
|
|
39
46
|
border: "1px solid #BBBBBB",
|
|
40
47
|
display: "flex",
|
|
41
48
|
alignItems: "center",
|
|
42
49
|
justifyContent: "center",
|
|
43
|
-
borderRadius: "6px"
|
|
50
|
+
borderRadius: "6px",
|
|
51
|
+
backgroundColor: "transparent",
|
|
52
|
+
zIndex: 1
|
|
44
53
|
},
|
|
45
54
|
searchInputStyle: {
|
|
46
55
|
backgroundColor: "transparent",
|
|
@@ -56,21 +65,21 @@ const B = (t) => {
|
|
|
56
65
|
"textarea",
|
|
57
66
|
{
|
|
58
67
|
value: t,
|
|
59
|
-
onChange: (
|
|
60
|
-
className: "h-full w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
|
|
68
|
+
onChange: (n) => r(n.target.value),
|
|
69
|
+
className: "h-full border w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
|
|
61
70
|
placeholder: "Choose icon or enter svg"
|
|
62
71
|
}
|
|
63
72
|
)
|
|
64
73
|
] });
|
|
65
74
|
}, C = ({ children: t, onSelect: r }) => {
|
|
66
|
-
const [
|
|
67
|
-
r.call(void 0, ...
|
|
75
|
+
const [s, a] = u(!1), i = (...n) => {
|
|
76
|
+
r.call(void 0, ...n), a(!1);
|
|
68
77
|
};
|
|
69
|
-
return /* @__PURE__ */ e.jsxs(
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
/* @__PURE__ */ e.jsx(
|
|
78
|
+
return /* @__PURE__ */ e.jsxs(j, { open: s, onOpenChange: (n) => a(n), children: [
|
|
79
|
+
/* @__PURE__ */ e.jsx(v, { asChild: !0, children: t }),
|
|
80
|
+
/* @__PURE__ */ e.jsx(k, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ e.jsx(y, { isModalView: !0, onSelect: i }) }) })
|
|
72
81
|
] });
|
|
73
|
-
}, p = C, A = ({ value: t, onChange: r, id:
|
|
82
|
+
}, p = C, A = ({ value: t, onChange: r, id: s, onBlur: a }) => /* @__PURE__ */ e.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
|
|
74
83
|
t ? /* @__PURE__ */ e.jsx("img", { src: t, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
|
|
75
84
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-3/5 flex-col", children: [
|
|
76
85
|
/* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: t || !h(t) ? "Replace Image" : "Choose Image" }) }),
|
|
@@ -82,20 +91,20 @@ const B = (t) => {
|
|
|
82
91
|
className: "text-xs",
|
|
83
92
|
placeholder: "Enter image URL",
|
|
84
93
|
value: t,
|
|
85
|
-
onBlur: ({ target: { value: i } }) =>
|
|
94
|
+
onBlur: ({ target: { value: i } }) => a(s, i),
|
|
86
95
|
onChange: (i) => r(i.target.value)
|
|
87
96
|
}
|
|
88
97
|
)
|
|
89
98
|
] })
|
|
90
|
-
] }),
|
|
91
|
-
const
|
|
99
|
+
] }), F = ({ id: t, placeholder: r, value: s, onChange: a, onBlur: i }) => {
|
|
100
|
+
const n = {
|
|
92
101
|
toolbar: [
|
|
93
102
|
["bold", "italic", "underline", "strike", "blockquote"],
|
|
94
103
|
[{ list: "ordered" }, { list: "bullet" }],
|
|
95
104
|
[{ color: [] }, { background: [] }, { align: [] }],
|
|
96
105
|
["link", "clean"]
|
|
97
106
|
]
|
|
98
|
-
},
|
|
107
|
+
}, l = [
|
|
99
108
|
"header",
|
|
100
109
|
"font",
|
|
101
110
|
"list",
|
|
@@ -114,23 +123,23 @@ const B = (t) => {
|
|
|
114
123
|
w,
|
|
115
124
|
{
|
|
116
125
|
id: t,
|
|
117
|
-
value:
|
|
126
|
+
value: s,
|
|
118
127
|
onBlur: (c) => i(t, c),
|
|
119
|
-
onChange: (c) =>
|
|
120
|
-
modules:
|
|
121
|
-
formats:
|
|
128
|
+
onChange: (c) => a(c),
|
|
129
|
+
modules: n,
|
|
130
|
+
formats: l,
|
|
122
131
|
placeholder: r,
|
|
123
132
|
className: "mt-1 rounded-md"
|
|
124
133
|
}
|
|
125
134
|
);
|
|
126
|
-
},
|
|
127
|
-
const [
|
|
128
|
-
return
|
|
135
|
+
}, D = ({ schema: t, formData: r, onChange: s }) => {
|
|
136
|
+
const [a, i] = u([]), n = N("getPages", () => []), { type: l = "page", href: c = "", target: d = "self" } = r;
|
|
137
|
+
return b(() => {
|
|
129
138
|
(async () => {
|
|
130
|
-
const
|
|
131
|
-
i(
|
|
139
|
+
const o = await n();
|
|
140
|
+
i(o);
|
|
132
141
|
})();
|
|
133
|
-
}, [
|
|
142
|
+
}, [n]), /* @__PURE__ */ e.jsxs("div", { children: [
|
|
134
143
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium", children: (t == null ? void 0 : t.title) ?? "Link" }),
|
|
135
144
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
|
|
136
145
|
/* @__PURE__ */ e.jsx(
|
|
@@ -138,28 +147,28 @@ const B = (t) => {
|
|
|
138
147
|
{
|
|
139
148
|
name: "type",
|
|
140
149
|
defaultValue: "page",
|
|
141
|
-
value:
|
|
142
|
-
onChange: (
|
|
150
|
+
value: l,
|
|
151
|
+
onChange: (o) => s({ ...r, type: o.target.value }),
|
|
143
152
|
children: [
|
|
144
153
|
{ const: "page", title: "Open Page" },
|
|
145
154
|
{ const: "url", title: "Open URL" },
|
|
146
155
|
{ const: "email", title: "Compose Email" },
|
|
147
156
|
{ const: "telephone", title: "Call Phone" },
|
|
148
157
|
{ const: "scroll", title: "Scroll to element" }
|
|
149
|
-
].map((
|
|
158
|
+
].map((o) => /* @__PURE__ */ e.jsx("option", { value: o.const, children: o.title }, o.const))
|
|
150
159
|
}
|
|
151
160
|
),
|
|
152
|
-
|
|
161
|
+
l === "page" ? /* @__PURE__ */ e.jsxs(
|
|
153
162
|
"select",
|
|
154
163
|
{
|
|
155
164
|
name: "href",
|
|
156
165
|
defaultValue: "",
|
|
157
166
|
placeholder: "Choose Page",
|
|
158
167
|
value: c,
|
|
159
|
-
onChange: (
|
|
168
|
+
onChange: (o) => s({ ...r, href: o.target.value }),
|
|
160
169
|
children: [
|
|
161
170
|
/* @__PURE__ */ e.jsx("option", { value: "", children: "Choose page" }),
|
|
162
|
-
f(
|
|
171
|
+
f(a, (o) => /* @__PURE__ */ e.jsx("option", { value: o.slug, children: o.page_name }, o.uuid))
|
|
163
172
|
]
|
|
164
173
|
}
|
|
165
174
|
) : /* @__PURE__ */ e.jsx(
|
|
@@ -168,18 +177,18 @@ const B = (t) => {
|
|
|
168
177
|
name: "href",
|
|
169
178
|
type: "text",
|
|
170
179
|
value: c,
|
|
171
|
-
onChange: (
|
|
172
|
-
placeholder:
|
|
180
|
+
onChange: (o) => s({ ...r, href: o.target.value }),
|
|
181
|
+
placeholder: l === "page" || l === "url" ? "Enter URL" : l === "scroll" ? "#ElementID" : "Enter detail"
|
|
173
182
|
}
|
|
174
183
|
),
|
|
175
|
-
(
|
|
184
|
+
(l === "page" || l === "url") && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
176
185
|
/* @__PURE__ */ e.jsx(
|
|
177
186
|
"input",
|
|
178
187
|
{
|
|
179
188
|
type: "checkbox",
|
|
180
189
|
defaultChecked: d === "_blank",
|
|
181
190
|
className: "cursor-pointer rounded-md border border-border",
|
|
182
|
-
onChange: () =>
|
|
191
|
+
onChange: () => s({ ...r, target: d === "_blank" ? "_self" : "_blank" })
|
|
183
192
|
}
|
|
184
193
|
),
|
|
185
194
|
/* @__PURE__ */ e.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
|
|
@@ -188,8 +197,8 @@ const B = (t) => {
|
|
|
188
197
|
] });
|
|
189
198
|
};
|
|
190
199
|
export {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
z as I,
|
|
201
|
+
D as L,
|
|
202
|
+
F as R,
|
|
194
203
|
A as a
|
|
195
204
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),n=require("react"),u=require("@radix-ui/react-icons"),o=require("./popover-7cb9079b.cjs"),x=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),n=require("react"),u=require("@radix-ui/react-icons"),o=require("./popover-7cb9079b.cjs"),x=require("./index-d214d8c8.cjs");require("@radix-ui/react-popover");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const j=n.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-e9713757.cjs"))),m=({pageData:s})=>{const[r,t]=n.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:i=>{t(r==="PENDING"?"ALERT":i?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:i=>{i.stopPropagation(),t("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(u.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(u.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(j,{pageData:s,open:r,setOpen:t})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:t}=x.useProject(),i=x.useChangePage(),l=(t==null?void 0:t.homepage)===s.uuid,a=r===s.uuid,c=()=>i(s);return t?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(u.HomeIcon,{}):e.jsxRuntimeExports.jsx(u.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(m,{pageData:s})]}):null},d=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(p,{...t})))});exports.default=d;
|
|
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import o, { useState as m, Suspense as c } from "react";
|
|
3
3
|
import { HomeIcon as p, FileTextIcon as u, ChevronRightIcon as d, GearIcon as x } from "@radix-ui/react-icons";
|
|
4
4
|
import { P as g, a as h, b as f } from "./popover-f7addcf4.js";
|
|
5
|
-
import { R as j, P as N, Q as P } from "./index-
|
|
5
|
+
import { R as j, P as N, Q as P } from "./index-67c3fc28.js";
|
|
6
6
|
import "@radix-ui/react-popover";
|
|
7
7
|
import "./utils-ac68b2c8.js";
|
|
8
8
|
import "clsx";
|
|
@@ -21,15 +21,15 @@ import "@radix-ui/react-toast";
|
|
|
21
21
|
import "jotai";
|
|
22
22
|
import "react-hotkeys-hook";
|
|
23
23
|
import "flat-to-nested";
|
|
24
|
-
import "./html-to-json-
|
|
24
|
+
import "./html-to-json-8397fab5.js";
|
|
25
25
|
import "./MODIFIERS-c2e02614.js";
|
|
26
26
|
import "himalaya";
|
|
27
27
|
import "redux-undo";
|
|
28
28
|
import "@react-hookz/web";
|
|
29
29
|
import "@chaibuilder/blocks";
|
|
30
|
-
import "sonner";
|
|
31
30
|
import "lucide-react";
|
|
32
|
-
|
|
31
|
+
import "sonner";
|
|
32
|
+
const b = o.lazy(() => import("./single-page-detail-20bf1b52.js")), v = ({ pageData: r }) => {
|
|
33
33
|
const [s, t] = m("CLOSE");
|
|
34
34
|
return /* @__PURE__ */ e.jsxs(
|
|
35
35
|
g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-5c3ac4f7.cjs"),a=require("react"),f=require("./scroll-area-088530b9.cjs"),o=require("@chaibuilder/blocks"),m=require("./form-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-5c3ac4f7.cjs"),a=require("react"),f=require("./scroll-area-088530b9.cjs"),o=require("@chaibuilder/blocks"),m=require("./form-431f0141.cjs"),d=require("./index-d214d8c8.cjs");require("@radix-ui/react-scroll-area");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@rjsf/core");require("@rjsf/validator-ajv8");require("lodash");require("./link-8b201d2c.cjs");require("react-icons-picker");require("react-dom");require("./dialog-170eaad9.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-icons");require("./ImagesPanel-addb2bf9.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("lucide-react");require("sonner");function g(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const j=g(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=d.useProject();j.useEffect(()=>{e&&i(e)},[e,i]);const q=({formData:l},t)=>{i(s=>({...s,[t]:l[t]}))},c={name:o.SingleLineText({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.Image({title:"Favicon",default:e==null?void 0:e.favicon})};return n.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:n.jsxRuntimeExports.jsx(m.Form,{properties:c,disabled:u,formData:r,onChange:q})})};exports.default=b;
|
|
@@ -2,8 +2,8 @@ import { j as i } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { S as f } from "./scroll-area-9f64a082.js";
|
|
4
4
|
import { SingleLineText as c, Image as d } from "@chaibuilder/blocks";
|
|
5
|
-
import { F as u } from "./form-
|
|
6
|
-
import { P as x } from "./index-
|
|
5
|
+
import { F as u } from "./form-526188f9.js";
|
|
6
|
+
import { P as x } from "./index-67c3fc28.js";
|
|
7
7
|
import "@radix-ui/react-scroll-area";
|
|
8
8
|
import "./utils-ac68b2c8.js";
|
|
9
9
|
import "clsx";
|
|
@@ -11,7 +11,7 @@ import "tailwind-merge";
|
|
|
11
11
|
import "@rjsf/core";
|
|
12
12
|
import "@rjsf/validator-ajv8";
|
|
13
13
|
import "lodash";
|
|
14
|
-
import "./link-
|
|
14
|
+
import "./link-ebe8a751.js";
|
|
15
15
|
import "react-icons-picker";
|
|
16
16
|
import "react-dom";
|
|
17
17
|
import "./dialog-3d4e82ed.js";
|
|
@@ -34,13 +34,13 @@ import "react-dnd";
|
|
|
34
34
|
import "@minoru/react-dnd-treeview";
|
|
35
35
|
import "react-hotkeys-hook";
|
|
36
36
|
import "flat-to-nested";
|
|
37
|
-
import "./html-to-json-
|
|
37
|
+
import "./html-to-json-8397fab5.js";
|
|
38
38
|
import "./MODIFIERS-c2e02614.js";
|
|
39
39
|
import "himalaya";
|
|
40
40
|
import "redux-undo";
|
|
41
41
|
import "@react-hookz/web";
|
|
42
|
-
import "sonner";
|
|
43
42
|
import "lucide-react";
|
|
43
|
+
import "sonner";
|
|
44
44
|
const mo = ({
|
|
45
45
|
_projectData: m,
|
|
46
46
|
seany: t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("@chaibuilder/blocks"),g=require("./form-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("@chaibuilder/blocks"),g=require("./form-431f0141.cjs");require("react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("lodash");require("./link-8b201d2c.cjs");require("react-icons-picker");require("react-dom");require("./dialog-170eaad9.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-icons");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./ImagesPanel-addb2bf9.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");const D=({_projectData:e,seany:q})=>{var t,o,u,s,a,l;const d=({formData:c})=>{const i={...c};i.seoData.title===void 0&&(i.seoData.title=""),i.seoData.description===void 0&&(i.seoData.description=""),i.seoData.image===void 0&&(i.seoData.image=""),q(f=>({...f,...i}))},m={seoData:r.Model({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((o=e.seoData)==null?void 0:o.description)||"",image:((u=e.seoData)==null?void 0:u.image)||""},properties:{title:r.SingleLineText({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:r.MultilineText({title:"Default Description",default:((a=e.seoData)==null?void 0:a.description)||""}),image:r.Image({title:"Social Media Image",default:((l=e.seoData)==null?void 0:l.image)||""})}})};return n.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:n.jsxRuntimeExports.jsx(g.Form,{properties:m,formData:e,onChange:d})})};exports.default=D;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { Model as D, SingleLineText as c, MultilineText as g, Image as x } from "@chaibuilder/blocks";
|
|
3
|
-
import { F as v } from "./form-
|
|
3
|
+
import { F as v } from "./form-526188f9.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@rjsf/core";
|
|
6
6
|
import "@rjsf/validator-ajv8";
|
|
7
7
|
import "lodash";
|
|
8
|
-
import "./link-
|
|
8
|
+
import "./link-ebe8a751.js";
|
|
9
9
|
import "react-icons-picker";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
import "./dialog-3d4e82ed.js";
|