@chaibuilder/sdk 1.2.63 → 1.2.65
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/CanvasArea-fSdH_RiN.cjs +1 -0
- package/dist/{CanvasArea-DvfLxy0w.js → CanvasArea-ut5yknzX.js} +58 -54
- package/dist/{CodeEditor-QPwyZNgA.js → CodeEditor-Qff4q7sx.js} +1 -1
- package/dist/{CurrentPage-rOUX01kk.js → CurrentPage-jHSVy3hq.js} +38 -26
- package/dist/CurrentPage-p_AM4lrF.cjs +1 -0
- package/dist/{PagesPanel-6P4VkMP-.js → PagesPanel-U3InJ9Db.js} +20 -8
- package/dist/PagesPanel-wqDb4D-x.cjs +1 -0
- package/dist/{ProjectPanel-Cn3teDRW.js → ProjectPanel-XODJTO4J.js} +36 -24
- package/dist/ProjectPanel-fWESzHr6.cjs +1 -0
- package/dist/{SidePanels-_Im6sF4f.js → SidePanels-ijaUKSek.js} +84 -70
- package/dist/SidePanels-lrMQqc0h.cjs +1 -0
- package/dist/Topbar-RrCDxd0i.cjs +1 -0
- package/dist/{Topbar-SuY-S0im.js → Topbar-vHlnfxPs.js} +45 -30
- package/dist/UILibrariesPanel-7btHgBD0.cjs +1 -0
- package/dist/{UILibrariesPanel-RI9mo293.js → UILibrariesPanel-NVUMUPUj.js} +83 -63
- package/dist/{UnsplashImages-dasLGrBn.js → UnsplashImages-UkHihhA5.js} +16 -16
- package/dist/{UploadImages-Gh2AQpk1.js → UploadImages-HtuJZJlo.js} +7 -7
- package/dist/add-page-modal-RwIj1FxH.cjs +1 -0
- package/dist/{add-page-modal-zCiyvKEa.js → add-page-modal-TOfMfmPA.js} +32 -23
- package/dist/{confirm-alert-9XYi0a4k.js → confirm-alert-eIp2cAkc.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -7
- package/dist/core.js +74 -59
- package/dist/{delete-page-modal-pzagU_6y.js → delete-page-modal-4bxjpVBD.js} +33 -21
- package/dist/delete-page-modal-qYDZmpgT.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.js +20 -5
- package/dist/{form-EjiQiiEY.js → form-NAzFjGs0.js} +9 -9
- package/dist/html-to-json-NqRjgFqp.cjs +1 -0
- package/dist/html-to-json-l_mw5y-e.js +243 -0
- package/dist/{index-DzAuS11k.cjs → index--k2M8kzI.cjs} +1 -1
- package/dist/{index-BbW1Uw_k.cjs → index-5XyNUAjc.cjs} +81 -22
- package/dist/{index-bscJUvUx.js → index-C7mB4XFm.js} +117 -117
- package/dist/{index-qSbpzIA4.js → index-YZhtVcj_.js} +4 -4
- package/dist/{index-EEcKvBh3.js → index-lFgDm1oa.js} +48587 -45055
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +22 -22
- package/dist/page-viewer-4wrnWnK0.js +124 -0
- package/dist/page-viewer-ra0GLx1p.cjs +1 -0
- package/dist/{project-general-setting-5B7s5swF.js → project-general-setting-IwZUkYF3.js} +18 -9
- package/dist/project-general-setting-lFjTUhHD.cjs +1 -0
- package/dist/{project-seo-setting-aAGnwBrw.js → project-seo-setting-e1fTqVsd.js} +2 -2
- package/dist/{single-page-detail-Yr0EbBJJ.js → single-page-detail-ZNWFKqLW.js} +69 -60
- package/dist/single-page-detail-g55Anu7R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +18 -6
- package/dist/style.css +2 -2
- package/dist/ui.js +67 -67
- package/package.json +1 -1
- package/dist/AddBlocks-4wpxOF2K.cjs +0 -1
- package/dist/AddBlocks-ChNxwRrx.js +0 -142
- package/dist/CanvasArea-hGLbDJlM.cjs +0 -1
- package/dist/CurrentPage-fMCaBGwl.cjs +0 -1
- package/dist/PagesPanel-ZCZjs7Bi.cjs +0 -1
- package/dist/ProjectPanel-XSVWRr6v.cjs +0 -1
- package/dist/Settings-Amh8Mtm7.cjs +0 -1
- package/dist/Settings-dbB2VPAj.js +0 -2378
- package/dist/SidePanels-5adH7U3T.cjs +0 -1
- package/dist/StaticCanvas-fDhBK35X.cjs +0 -60
- package/dist/StaticCanvas-goU42OMU.js +0 -749
- package/dist/ThemeConfigPanel-N6l317II.cjs +0 -1
- package/dist/ThemeConfigPanel-aEN4tTYi.js +0 -191
- package/dist/Topbar-ag6qdgbe.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/add-page-modal-80cVOM7i.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/delete-page-modal-foPRP--l.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/page-viewer-XFTCHu_2.cjs +0 -1
- package/dist/page-viewer-Z1wXyzzc.js +0 -112
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-HV3X_wHI.cjs +0 -1
- package/dist/single-page-detail-6C1WP3s5.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-aeDphKpP.cjs"),r=require("./controls-rRZhz0vu.cjs"),m=require("lodash-es"),P=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const f=k(B),T=({value:t,onChange:e,id:a,onBlur:l})=>{const n=m.debounce(e,200),v=u=>n(u.target.value);return i.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:i.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:i.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(a,u),onChange:v})})})},g=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],D=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",m.noop),[e,a]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=f.useRef(e),{t:v}=P.useTranslation();f.useEffect(()=>()=>{m.isEqual(e,n.current)||t(n.current)},[]);const u=({formData:o},d)=>{d&&(a(o),n.current=o)},{bodyFont:q,headingFont:b,primaryColor:h,bodyTextDarkColor:y,bodyTextLightColor:C,bodyBgDarkColor:S,secondaryColor:j,bodyBgLightColor:O,roundedCorners:R}=e;let s={headingFont:r.f({title:"Heading font",default:b,options:g}),bodyFont:r.f({title:"Body font",default:q,options:g}),roundedCorners:r.y({title:"Rounded Corner",default:parseInt(R||5,10)}),primaryColor:r.s({title:"Primary",default:h}),secondaryColor:r.s({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.s({title:"Background",default:O}),bodyTextLightColor:r.s({title:"Text color",default:y}),bodyBgDarkColor:r.s({title:"Background (Dark mode)",default:S}),bodyTextDarkColor:r.s({title:"Text color(Dark mode)",default:C})});const c={type:"object",properties:{}},x={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,x[o]=d.uiSchema,!0}),i.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[i.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:i.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:v("Theme Configuration")})}),i.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:i.jsxRuntimeExports.jsx(E,{widgets:{color:T},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:x,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=D;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import * as c from "react";
|
|
3
|
-
import j from "@rjsf/validator-ajv8";
|
|
4
|
-
import k from "@rjsf/core";
|
|
5
|
-
import { h as P, ai as T, br as w } from "./index-bscJUvUx.js";
|
|
6
|
-
import { f, y as D, s as a } from "./controls-yjgoZzB6.js";
|
|
7
|
-
import { debounce as R, noop as M, isEqual as F } from "lodash-es";
|
|
8
|
-
import { useTranslation as L } from "react-i18next";
|
|
9
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
-
import "@radix-ui/react-toggle";
|
|
11
|
-
import "class-variance-authority";
|
|
12
|
-
import "./utils-VpVqnC9m.js";
|
|
13
|
-
import "./MODIFIERS-fd5XOmum.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
|
-
import "@radix-ui/react-switch";
|
|
17
|
-
import "@radix-ui/react-slot";
|
|
18
|
-
import "@radix-ui/react-accordion";
|
|
19
|
-
import "@radix-ui/react-icons";
|
|
20
|
-
import "@radix-ui/react-alert-dialog";
|
|
21
|
-
import "@radix-ui/react-dialog";
|
|
22
|
-
import "@radix-ui/react-label";
|
|
23
|
-
import "@radix-ui/react-scroll-area";
|
|
24
|
-
import "@radix-ui/react-tabs";
|
|
25
|
-
import "@radix-ui/react-tooltip";
|
|
26
|
-
import "@radix-ui/react-popover";
|
|
27
|
-
import "@radix-ui/react-menubar";
|
|
28
|
-
import "@radix-ui/react-hover-card";
|
|
29
|
-
import "@radix-ui/react-select";
|
|
30
|
-
import "@radix-ui/react-dropdown-menu";
|
|
31
|
-
import "@radix-ui/react-separator";
|
|
32
|
-
import "@radix-ui/react-toast";
|
|
33
|
-
import "cmdk";
|
|
34
|
-
import "@radix-ui/react-context-menu";
|
|
35
|
-
import "react-icons-picker";
|
|
36
|
-
import "react-dom";
|
|
37
|
-
import "react-quill";
|
|
38
|
-
import "./Functions-7jnEwJyw.js";
|
|
39
|
-
import "@chaibuilder/runtime";
|
|
40
|
-
import "jotai";
|
|
41
|
-
import "@react-hookz/web";
|
|
42
|
-
import "tree-model";
|
|
43
|
-
const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
|
|
44
|
-
const i = R(e, 200), d = (l) => i(l.target.value);
|
|
45
|
-
return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
|
|
46
|
-
"input",
|
|
47
|
-
{
|
|
48
|
-
type: "color",
|
|
49
|
-
className: "text-xs p-0",
|
|
50
|
-
value: u,
|
|
51
|
-
onBlur: ({ target: { value: l } }) => m(p, l),
|
|
52
|
-
onChange: d
|
|
53
|
-
}
|
|
54
|
-
) }) });
|
|
55
|
-
}, g = [
|
|
56
|
-
{ title: "Roboto", value: "Roboto" },
|
|
57
|
-
{ title: "Open Sans", value: "Open Sans" },
|
|
58
|
-
{ title: "Montserrat", value: "Montserrat" },
|
|
59
|
-
{ title: "Lato", value: "Lato" },
|
|
60
|
-
{ title: "Poppins", value: "Poppins" },
|
|
61
|
-
{ title: "Oswald", value: "Oswald" },
|
|
62
|
-
{ title: "Raleway", value: "Raleway" },
|
|
63
|
-
{ title: "Ubuntu", value: "Ubuntu" },
|
|
64
|
-
{ title: "Nunito", value: "Nunito" },
|
|
65
|
-
{ title: "Merriweather", value: "Merriweather" },
|
|
66
|
-
{ title: "Nunito Sans", value: "Nunito Sans" },
|
|
67
|
-
{ title: "Playfair Display", value: "Playfair Display" },
|
|
68
|
-
{ title: "Rubik", value: "Rubik" },
|
|
69
|
-
{ title: "Inter", value: "Inter" },
|
|
70
|
-
{ title: "Lora", value: "Lora" },
|
|
71
|
-
{ title: "Kanit", value: "Kanit" },
|
|
72
|
-
{ title: "Fira Sans", value: "Fira Sans" },
|
|
73
|
-
{ title: "Hind", value: "Hind" },
|
|
74
|
-
{ title: "Quicksand", value: "Quicksand" },
|
|
75
|
-
{ title: "Mulish", value: "Mulish" },
|
|
76
|
-
{ title: "Barlow", value: "Barlow" },
|
|
77
|
-
{ title: "Inconsolata", value: "Inconsolata" },
|
|
78
|
-
{ title: "Titillium Web", value: "Titillium Web" },
|
|
79
|
-
{ title: "Heebo", value: "Heebo" },
|
|
80
|
-
{ title: "IBM Plex Sans", value: "IBM Plex Sans" },
|
|
81
|
-
{ title: "DM Sans", value: "DM Sans" },
|
|
82
|
-
{ title: "Nanum Gothic", value: "Nanum Gothic" },
|
|
83
|
-
{ title: "Karla", value: "Karla" },
|
|
84
|
-
{ title: "Arimo", value: "Arimo" },
|
|
85
|
-
{ title: "Cabin", value: "Cabin" },
|
|
86
|
-
{ title: "Oxygen", value: "Oxygen" },
|
|
87
|
-
{ title: "Overpass", value: "Overpass" },
|
|
88
|
-
{ title: "Assistant", value: "Assistant" },
|
|
89
|
-
{ title: "Tajawal", value: "Tajawal" },
|
|
90
|
-
{ title: "Play", value: "Play" },
|
|
91
|
-
{ title: "Exo", value: "Exo" },
|
|
92
|
-
{ title: "Cinzel", value: "Cinzel" },
|
|
93
|
-
{ title: "Faustina", value: "Faustina" },
|
|
94
|
-
{ title: "Philosopher", value: "Philosopher" },
|
|
95
|
-
{ title: "Gelasio", value: "Gelasio" },
|
|
96
|
-
{ title: "Sofia Sans Condensed", value: "Sofia Sans Condensed" },
|
|
97
|
-
{ title: "Noto Sans Devanagari", value: "Noto Sans Devanagari" },
|
|
98
|
-
{ title: "Actor", value: "Actor" },
|
|
99
|
-
{ title: "Epilogue", value: "Epilogue" },
|
|
100
|
-
{ title: "Glegoo", value: "Glegoo" },
|
|
101
|
-
{ title: "Overlock", value: "Overlock" },
|
|
102
|
-
{ title: "Lustria", value: "Lustria" },
|
|
103
|
-
{ title: "Ovo", value: "Ovo" },
|
|
104
|
-
{ title: "Suranna", value: "Suranna" },
|
|
105
|
-
{ title: "Bebas Neue", value: "Bebas Neue" },
|
|
106
|
-
{ title: "Manrope", value: "Manrope" }
|
|
107
|
-
], Ot = () => {
|
|
108
|
-
const u = P("onSaveBrandingOptions", M), [e, p] = T(), [m] = w(), i = c.useRef(e), { t: d } = L();
|
|
109
|
-
c.useEffect(() => () => {
|
|
110
|
-
F(e, i.current) || u(i.current);
|
|
111
|
-
}, []);
|
|
112
|
-
const l = ({ formData: o }, s) => {
|
|
113
|
-
s && (p(o), i.current = o);
|
|
114
|
-
}, {
|
|
115
|
-
bodyFont: h,
|
|
116
|
-
headingFont: b,
|
|
117
|
-
primaryColor: x,
|
|
118
|
-
bodyTextDarkColor: C,
|
|
119
|
-
bodyTextLightColor: y,
|
|
120
|
-
bodyBgDarkColor: S,
|
|
121
|
-
secondaryColor: B,
|
|
122
|
-
bodyBgLightColor: O,
|
|
123
|
-
roundedCorners: N
|
|
124
|
-
} = e;
|
|
125
|
-
let r = {
|
|
126
|
-
headingFont: f({
|
|
127
|
-
title: "Heading font",
|
|
128
|
-
default: b,
|
|
129
|
-
options: g
|
|
130
|
-
}),
|
|
131
|
-
bodyFont: f({
|
|
132
|
-
title: "Body font",
|
|
133
|
-
default: h,
|
|
134
|
-
options: g
|
|
135
|
-
}),
|
|
136
|
-
roundedCorners: D({
|
|
137
|
-
title: "Rounded Corner",
|
|
138
|
-
default: parseInt(N || 5, 10)
|
|
139
|
-
}),
|
|
140
|
-
primaryColor: a({ title: "Primary", default: x }),
|
|
141
|
-
secondaryColor: a({ title: "Secondary", default: B })
|
|
142
|
-
};
|
|
143
|
-
m || (r = {
|
|
144
|
-
...r,
|
|
145
|
-
bodyBgLightColor: a({
|
|
146
|
-
title: "Background",
|
|
147
|
-
default: O
|
|
148
|
-
}),
|
|
149
|
-
bodyTextLightColor: a({
|
|
150
|
-
title: "Text color",
|
|
151
|
-
default: C
|
|
152
|
-
}),
|
|
153
|
-
bodyBgDarkColor: a({
|
|
154
|
-
title: "Background (Dark mode)",
|
|
155
|
-
default: S
|
|
156
|
-
}),
|
|
157
|
-
bodyTextDarkColor: a({
|
|
158
|
-
title: "Text color(Dark mode)",
|
|
159
|
-
default: y
|
|
160
|
-
})
|
|
161
|
-
});
|
|
162
|
-
const n = {
|
|
163
|
-
type: "object",
|
|
164
|
-
properties: {}
|
|
165
|
-
}, v = {};
|
|
166
|
-
return Object.keys(r).forEach((o) => {
|
|
167
|
-
const s = r[o];
|
|
168
|
-
return n.properties || (n.properties = {}), n.properties[o] = s.schema, v[o] = s.uiSchema, !0;
|
|
169
|
-
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full w-60 select-none flex-col", children: [
|
|
170
|
-
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: d("Theme Configuration") }) }),
|
|
171
|
-
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
172
|
-
k,
|
|
173
|
-
{
|
|
174
|
-
widgets: { color: E },
|
|
175
|
-
idSeparator: ".",
|
|
176
|
-
autoComplete: "off",
|
|
177
|
-
omitExtraData: !0,
|
|
178
|
-
liveOmit: !0,
|
|
179
|
-
liveValidate: !0,
|
|
180
|
-
uiSchema: v,
|
|
181
|
-
schema: n,
|
|
182
|
-
formData: e,
|
|
183
|
-
validator: j,
|
|
184
|
-
onChange: l
|
|
185
|
-
}
|
|
186
|
-
) })
|
|
187
|
-
] });
|
|
188
|
-
};
|
|
189
|
-
export {
|
|
190
|
-
Ot as default
|
|
191
|
-
};
|
package/dist/Topbar-ag6qdgbe.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./index-aeDphKpP.cjs"),p=require("./index-BbW1Uw_k.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");const m=()=>r.useBuilderProp("languages",["en"]),j=()=>m().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),d=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:i}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(p.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":i(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},h=function(){const s=r.useBuilderProp("previewComponent"),[,i]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},q=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),i=r.useBuilderProp("topBarComponents.right",[]),x=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(u.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(j,{}),e.jsxRuntimeExports.jsx(h,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(d,{}):null,n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=q;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("lodash-es"),f=require("react"),s=require("./index-aeDphKpP.cjs"),y=require("@chaibuilder/runtime"),I=require("lucide-react"),E=require("jotai"),C=require("./Functions-N3yhPYKY.cjs"),B=require("@radix-ui/react-icons"),L=require("./MODIFIERS-mVmfEGgo.cjs"),S=require("react-i18next"),T=require("./atoms-KQpaDRnF.cjs"),A=require("clsx"),P=require("flagged");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@react-hookz/web");require("tree-model");function O(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return o.default=t,Object.freeze(o)}const D=O(f);function _({uiLibraries:t,library:o,setLibrary:i}){var p;const[l,x]=D.useState(!1),{t:n}=S.useTranslation();return o?e.jsxRuntimeExports.jsxs(s.Popover,{open:l,onOpenChange:x,children:[e.jsxRuntimeExports.jsx(s.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("span",{children:n("Choose Library")}),e.jsxRuntimeExports.jsxs(s.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[o?(p=t.find(u=>u.uuid===o))==null?void 0:p.name:n("Select library"),e.jsxRuntimeExports.jsx(B.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(s.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(s.Command,{children:[e.jsxRuntimeExports.jsx(s.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(s.CommandList,{children:[e.jsxRuntimeExports.jsx(s.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(s.CommandGroup,{children:t.map(u=>e.jsxRuntimeExports.jsxs(s.CommandItem,{value:u.uuid,onSelect:j=>{i(j),x(!1)},children:[u.name,e.jsxRuntimeExports.jsx(B.CheckIcon,{className:C.cn("ml-auto h-4 w-4",o===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const M=({block:t,closePopover:o,library:i})=>{const[l,x]=f.useState(!1),n=s.useBuilderProp("getUILibraryBlock",r.noop),{addCoreBlock:p,addPredefinedBlock:u}=s.useAddBlock(),[j,R]=s.useSelectedBlockIds(),[,q]=s.useHighlightBlockId(),g=r.get(t,"name",r.get(t,"label")),b=P.useFeature("dnd"),[,k]=E.useAtom(T.draggedBlockAtom),a=c=>{const m=r.has(c,"styles_attrs.data-page-section");return c._type==="Box"&&m},v=f.useCallback(async c=>{if(c.stopPropagation(),r.has(t,"component")){p(t,r.first(j)),o();return}x(!0);const m=await n(i,t);let h=r.first(j);a(r.first(m))&&(h=null),r.isEmpty(m)||u(y.syncBlocksWithDefaults(m),h),o()},[t]),d=async c=>{const m=await n(i,t);let h=r.first(j);if(a(r.first(m))&&(h=null),!r.isEmpty(m)){const N={blocks:m,uiLibrary:!0,parent:h};if(c.dataTransfer.setData("text/plain",JSON.stringify(N)),t.preview){const w=new Image;w.src=t.preview,w.onload=()=>{c.dataTransfer.setDragImage(w,0,0)}}else c.dataTransfer.setDragImage(new Image,0,0);k(N),setTimeout(()=>{R([]),q(null),o()},200)}};return e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{onClick:l?()=>{}:v,draggable:b?"true":"false",onDragStart:d,className:A("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(I.Loader,{className:"animate-spin",size:15,color:"white"}),e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[25px] w-full rounded-md",alt:g}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:g})})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:g})})]})},U=E.atom({}),z=t=>{const[o,i]=E.useAtom(U),l=s.useBuilderProp("getUILibraryBlocks",r.noop),x=r.get(o,`${t==null?void 0:t.uuid}.blocks`,[]),n=r.get(o,`${t==null?void 0:t.uuid}.loading`,!1);return f.useEffect(()=>{(async()=>{if(n||x.length>0||!t)return;i(u=>({...u,[t==null?void 0:t.uuid]:{loading:!0,blocks:[]}}));const p=await l(t);i(u=>({...u,[t==null?void 0:t.uuid]:{loading:!1,blocks:p||[]}}))})()},[t,x,n]),{data:x,isLoading:n}},F=s.atomWithStorage("_selectedLibrary",null),G=()=>{const[t,o]=E.useAtom(F),i=s.useBuilderProp("uiLibraries",[]),l=y.useChaiBlocks(),x=r.values(l).filter(d=>d.category==="custom"),n=i.find(d=>d.uuid===t)||r.first(i),{data:p,isLoading:u}=z(n),j=r.groupBy([...p,...x],"group"),[R,q]=f.useState("Hero"),[,g]=E.useAtom(s.activePanelAtom),b=r.get(j,R,[]),{t:k}=S.useTranslation(),a=f.useRef(null),v=d=>{a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{a.current&&q(d)},300)};return u?e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-full w-full"}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background",children:[n!=null&&n.uuid?e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:e.jsxRuntimeExports.jsx(_,{library:n==null?void 0:n.uuid,setLibrary:o,uiLibraries:i})})})}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex h-[95%] border-t border-gray-300 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-40 flex-col gap-1 px-1",children:f.Children.toArray(r.map(j,(d,c)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>v(c),onMouseLeave:()=>clearTimeout(a.current),onClick:()=>q(c),className:C.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",c===R?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:r.capitalize(c)}),e.jsxRuntimeExports.jsx(B.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},c)))}),e.jsxRuntimeExports.jsxs(s.ScrollArea,{onMouseEnter:()=>a.current?clearTimeout(a.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500",children:k("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:f.Children.toArray(b.map(d=>e.jsxRuntimeExports.jsx(M,{block:d,library:n,closePopover:()=>g(L.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},H=()=>e.jsxRuntimeExports.jsx(G,{});exports.default=H;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-aeDphKpP.cjs"),g=require("./controls-rRZhz0vu.cjs"),R=require("./form-4jTocVbZ.cjs"),f=require("./index-DzAuS11k.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-BbW1Uw_k.cjs");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.g({title:"Page Name",default:r.name}),slug:g.g({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
package/dist/atoms-KQpaDRnF.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("jotai"),t=o.atom(null),r=o.atom(null);exports.draggedBlockAtom=t;exports.dropTargetBlockIdAtom=r;
|
package/dist/atoms-Oomqut88.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-aeDphKpP.cjs"),l=require("./index-DzAuS11k.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("./index-BbW1Uw_k.cjs");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { stringify as y, parse as N } from "himalaya";
|
|
2
|
-
import { g as L, c as k } from "./Functions-7jnEwJyw.js";
|
|
3
|
-
import { isEmpty as m, includes as g, get as n, forEach as S, find as u, set as o, capitalize as $, flatMapDeep as A, filter as B, flatten as C } from "lodash-es";
|
|
4
|
-
import { a as p } from "./MODIFIERS-fd5XOmum.js";
|
|
5
|
-
import { has as R, startsWith as E } from "lodash";
|
|
6
|
-
const M = (t) => {
|
|
7
|
-
const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, a = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
|
|
8
|
-
return e.test(t) || a.test(t);
|
|
9
|
-
}, H = (t) => {
|
|
10
|
-
if (m(t))
|
|
11
|
-
return t;
|
|
12
|
-
const e = /<video[^>]+src=['"]([^'">]+)['"]/, a = /<iframe[^>]+src=['"]([^'">]+)['"]/, r = t.match(e), c = t.match(a), i = r ? r[1] : c ? c[1] : null, s = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
13
|
-
return i && (s.test(i) || l.test(i)) ? i : t;
|
|
14
|
-
}, b = "$name", I = {
|
|
15
|
-
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
16
|
-
video: {
|
|
17
|
-
src: "url",
|
|
18
|
-
autoplay: "controls.autoPlay",
|
|
19
|
-
muted: "controls.muted",
|
|
20
|
-
loop: "controls.loop",
|
|
21
|
-
controls: "controls.widgets"
|
|
22
|
-
},
|
|
23
|
-
a: {
|
|
24
|
-
href: "link.href",
|
|
25
|
-
target: "link.target",
|
|
26
|
-
type: ""
|
|
27
|
-
// @TODO: Detect here what to url, email, phone, elementId
|
|
28
|
-
},
|
|
29
|
-
input: {
|
|
30
|
-
placeholder: "placeholder",
|
|
31
|
-
required: "required",
|
|
32
|
-
type: "inputType",
|
|
33
|
-
name: "fieldName"
|
|
34
|
-
},
|
|
35
|
-
textarea: {
|
|
36
|
-
placeholder: "placeholder",
|
|
37
|
-
required: "required",
|
|
38
|
-
type: "inputType",
|
|
39
|
-
name: "fieldName"
|
|
40
|
-
},
|
|
41
|
-
select: {
|
|
42
|
-
placeholder: "placeholder",
|
|
43
|
-
required: "required",
|
|
44
|
-
multiple: "multiple",
|
|
45
|
-
name: "fieldName"
|
|
46
|
-
}
|
|
47
|
-
}, q = (t, e) => t.children.length === 1 && g(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), _ = (t) => t.map((e) => e.type === "text" ? n(e, "content", "") : m(e.children) ? "" : _(e.children)).join(""), h = (t) => t === null ? "" : t, f = (t) => {
|
|
48
|
-
if (t.tagName === "svg")
|
|
49
|
-
return {};
|
|
50
|
-
const e = {}, a = I[t.tagName] || {}, r = t.attributes;
|
|
51
|
-
return S(r, ({ key: c, value: i }) => {
|
|
52
|
-
if (c !== b)
|
|
53
|
-
if (a[c]) {
|
|
54
|
-
if (t.tagName === "img" && c === "src" && !i.startsWith("http")) {
|
|
55
|
-
const s = u(t.attributes, { key: "width" }), l = u(t.attributes, { key: "height" });
|
|
56
|
-
s && l ? i = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${l == null ? void 0 : l.value}` : i = "https://via.placeholder.com/150x150";
|
|
57
|
-
}
|
|
58
|
-
o(e, a[c], h(i));
|
|
59
|
-
} else
|
|
60
|
-
g(["style", "class", "srcset"], c) || (R(e, "styles_attrs") || (e.styles_attrs = {}), E(c, "@") && (c = c.replace("@", "x-on:")), e.styles_attrs[`${c}`] = h(i));
|
|
61
|
-
}), delete e.class, e;
|
|
62
|
-
}, P = (t, e = "styles") => {
|
|
63
|
-
if (!t.attributes)
|
|
64
|
-
return { [e]: `${p},` };
|
|
65
|
-
const a = u(t.attributes, { key: "class" });
|
|
66
|
-
if (a) {
|
|
67
|
-
const r = a.value;
|
|
68
|
-
return { [e]: `${p},${r}` };
|
|
69
|
-
}
|
|
70
|
-
return { [e]: `${p},` };
|
|
71
|
-
}, U = (t) => {
|
|
72
|
-
switch (t.tagName) {
|
|
73
|
-
case "img":
|
|
74
|
-
return { _type: "Image" };
|
|
75
|
-
case "input":
|
|
76
|
-
return { _type: "Input", showLabel: !1 };
|
|
77
|
-
case "hr":
|
|
78
|
-
return { _type: "Divider" };
|
|
79
|
-
case "br":
|
|
80
|
-
return { _type: "LineBreak" };
|
|
81
|
-
case "textarea":
|
|
82
|
-
return { _type: "TextArea", showLabel: !1 };
|
|
83
|
-
case "audio":
|
|
84
|
-
return { _type: "Audio" };
|
|
85
|
-
case "canvas":
|
|
86
|
-
return { _type: "Canvas" };
|
|
87
|
-
case "video":
|
|
88
|
-
case "iframe":
|
|
89
|
-
return { _type: "CustomHTML" };
|
|
90
|
-
case "svg":
|
|
91
|
-
return { _type: "Icon" };
|
|
92
|
-
case "select":
|
|
93
|
-
return { _type: "Select", options: [] };
|
|
94
|
-
case "option":
|
|
95
|
-
return { _type: "Option" };
|
|
96
|
-
case "ul":
|
|
97
|
-
case "ol":
|
|
98
|
-
case "dl":
|
|
99
|
-
return {
|
|
100
|
-
_type: "List",
|
|
101
|
-
tag: t.tagName,
|
|
102
|
-
_listType: t.tagName === "ol" ? "list-decimal" : "list-none"
|
|
103
|
-
};
|
|
104
|
-
case "li":
|
|
105
|
-
case "dt":
|
|
106
|
-
return { _type: "ListItem", tag: t.tagName };
|
|
107
|
-
case "span":
|
|
108
|
-
case "figcaption":
|
|
109
|
-
case "legend":
|
|
110
|
-
return { _type: "Span", tag: t.tagName };
|
|
111
|
-
case "p":
|
|
112
|
-
return { _type: "Paragraph", content: "" };
|
|
113
|
-
case "a":
|
|
114
|
-
return { _type: "Link" };
|
|
115
|
-
case "form":
|
|
116
|
-
return { _type: "Form" };
|
|
117
|
-
case "label":
|
|
118
|
-
return { _type: "Label" };
|
|
119
|
-
case "button":
|
|
120
|
-
return { _type: "Button" };
|
|
121
|
-
case "code":
|
|
122
|
-
return { _type: "Code" };
|
|
123
|
-
case "h1":
|
|
124
|
-
case "h2":
|
|
125
|
-
case "h3":
|
|
126
|
-
case "h4":
|
|
127
|
-
case "h5":
|
|
128
|
-
case "h6":
|
|
129
|
-
return { _type: "Heading", tag: t.tagName };
|
|
130
|
-
case "table":
|
|
131
|
-
return { _type: "Table" };
|
|
132
|
-
case "tr":
|
|
133
|
-
return { _type: "TableRow" };
|
|
134
|
-
case "td":
|
|
135
|
-
case "th":
|
|
136
|
-
return { _type: "TableCell", tag: t.tagName };
|
|
137
|
-
case "thead":
|
|
138
|
-
return { _type: "TableHead" };
|
|
139
|
-
case "tbody":
|
|
140
|
-
return { _type: "TableBody" };
|
|
141
|
-
case "tfoot":
|
|
142
|
-
return { _type: "TableFooter" };
|
|
143
|
-
default:
|
|
144
|
-
const e = n(t, "children", []).length > 0 ? "Box" : "EmptyBox";
|
|
145
|
-
return {
|
|
146
|
-
_type: e,
|
|
147
|
-
tag: t.tagName,
|
|
148
|
-
_name: e == "EmptyBox" || t.tagName === "div" ? e : $(t.tagName)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}, d = (t, e = null) => A(t, (a) => {
|
|
152
|
-
var i;
|
|
153
|
-
if (a.type === "comment")
|
|
154
|
-
return [];
|
|
155
|
-
let r = { _id: L() };
|
|
156
|
-
if (e && (r._parent = e.block._id), a.type === "text")
|
|
157
|
-
return m(n(a, "content", "")) ? [] : e && q(e.node, e.block) ? (o(e, "block.content", n(a, "content", "")), []) : { ...r, _type: "Text", content: n(a, "content", "") };
|
|
158
|
-
if (r = {
|
|
159
|
-
...r,
|
|
160
|
-
...U(a),
|
|
161
|
-
...f(a),
|
|
162
|
-
...P(a)
|
|
163
|
-
}, a.attributes) {
|
|
164
|
-
const s = a.attributes.find((l) => l.key === b);
|
|
165
|
-
s && (r._name = s.value);
|
|
166
|
-
}
|
|
167
|
-
if (r._type === "Input") {
|
|
168
|
-
const s = r.inputType || "text";
|
|
169
|
-
s === "checkbox" ? o(r, "_type", "Checkbox") : s === "radio" && o(r, "_type", "Radio");
|
|
170
|
-
} else if (a.tagName === "video" || a.tagName === "iframe") {
|
|
171
|
-
const s = y([a]);
|
|
172
|
-
return M(s) && (o(r, "_type", "Video"), o(r, "url", H(s)), o(r, "styles", `${p},absolute top-0 left-0 w-full h-full`), o(r, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), r.content = s, [r];
|
|
173
|
-
} else if (a.tagName === "svg") {
|
|
174
|
-
const s = u(a.attributes, { key: "height" }), l = u(a.attributes, { key: "width" }), v = n(s, "value") ? `[${n(s, "value")}px]` : "24px", T = n(l, "value") ? `[${n(l, "value")}px]` : "24px", x = n(u(a.attributes, { key: "class" }), "value", "w-full h-full");
|
|
175
|
-
return r.styles = `${p}, ${k(`w-${T} h-${v}`, x)}`.trim(), a.attributes = B(a.attributes, (w) => !g(["style", "width", "height", "class"], w.key)), r.icon = y([a]), [r];
|
|
176
|
-
} else if (a.tagName == "option" && e && ((i = e.block) == null ? void 0 : i._type) === "Select")
|
|
177
|
-
return e.block.options.push({
|
|
178
|
-
label: _(a.children),
|
|
179
|
-
...f(a)
|
|
180
|
-
}), [];
|
|
181
|
-
const c = d(a.children, { block: r, node: a });
|
|
182
|
-
return [r, ...c];
|
|
183
|
-
}), z = (t) => {
|
|
184
|
-
const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
185
|
-
return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
186
|
-
}, Z = (t) => {
|
|
187
|
-
const e = N(z(t));
|
|
188
|
-
return m(t) ? [] : C(d(e));
|
|
189
|
-
};
|
|
190
|
-
export {
|
|
191
|
-
Z as g
|
|
192
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),r=require("lodash-es"),o=require("./MODIFIERS-mVmfEGgo.cjs"),g=require("lodash"),x=t=>{const e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,s=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return e.test(t)||s.test(t)},w=t=>{if(r.isEmpty(t))return t;const e=/<video[^>]+src=['"]([^'">]+)['"]/,s=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(e),c=t.match(s),l=a?a[1]:c?c[1]:null,i=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return l&&(i.test(l)||n.test(l))?l:t},h="$name",S={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},E=(t,e)=>t.children.length===1&&r.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],e._type),f=t=>t.map(e=>e.type==="text"?r.get(e,"content",""):r.isEmpty(e.children)?"":f(e.children)).join(""),y=t=>t===null?"":t,m=t=>{if(t.tagName==="svg")return{};const e={},s=S[t.tagName]||{},a=t.attributes;return r.forEach(a,({key:c,value:l})=>{if(c!==h)if(s[c]){if(t.tagName==="img"&&c==="src"&&!l.startsWith("http")){const i=r.find(t.attributes,{key:"width"}),n=r.find(t.attributes,{key:"height"});i&&n?l=`https://via.placeholder.com/${i==null?void 0:i.value}x${n==null?void 0:n.value}`:l="https://via.placeholder.com/150x150"}r.set(e,s[c],y(l))}else r.includes(["style","class","srcset"],c)||(g.has(e,"styles_attrs")||(e.styles_attrs={}),g.startsWith(c,"@")&&(c=c.replace("@","x-on:")),e.styles_attrs[`${c}`]=y(l))}),delete e.class,e},N=(t,e="styles")=>{if(!t.attributes)return{[e]:`${o.STYLES_KEY},`};const s=r.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[e]:`${o.STYLES_KEY},${a}`}}return{[e]:`${o.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:const e=r.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:e,tag:t.tagName,_name:e=="EmptyBox"||t.tagName==="div"?e:r.capitalize(t.tagName)}}},b=(t,e=null)=>r.flatMapDeep(t,s=>{var l;if(s.type==="comment")return[];let a={_id:p.generateUUID()};if(e&&(a._parent=e.block._id),s.type==="text")return r.isEmpty(r.get(s,"content",""))?[]:e&&E(e.node,e.block)?(r.set(e,"block.content",r.get(s,"content","")),[]):{...a,_type:"Text",content:r.get(s,"content","")};if(a={...a,...L(s),...m(s),...N(s)},s.attributes){const i=s.attributes.find(n=>n.key===h);i&&(a._name=i.value)}if(a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?r.set(a,"_type","Checkbox"):i==="radio"&&r.set(a,"_type","Radio")}else if(s.tagName==="video"||s.tagName==="iframe"){const i=u.stringify([s]);return x(i)&&(r.set(a,"_type","Video"),r.set(a,"url",w(i)),r.set(a,"styles",`${o.STYLES_KEY},absolute top-0 left-0 w-full h-full`),r.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=i,[a]}else if(s.tagName==="svg"){const i=r.find(s.attributes,{key:"height"}),n=r.find(s.attributes,{key:"width"}),d=r.get(i,"value")?`[${r.get(i,"value")}px]`:"24px",_=r.get(n,"value")?`[${r.get(n,"value")}px]`:"24px",T=r.get(r.find(s.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${o.STYLES_KEY}, ${p.cn(`w-${_} h-${d}`,T)}`.trim(),s.attributes=r.filter(s.attributes,v=>!r.includes(["style","width","height","class"],v.key)),a.icon=u.stringify([s]),[a]}else if(s.tagName=="option"&&e&&((l=e.block)==null?void 0:l._type)==="Select")return e.block.options.push({label:f(s.children),...m(s)}),[];const c=b(s.children,{block:a,node:s});return[a,...c]}),k=t=>{const e=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(e&&e.length>0?e[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},$=t=>{const e=u.parse(k(t));return r.isEmpty(t)?[]:r.flatten(b(e))};exports.getBlocksFromHTML=$;
|