@chaibuilder/sdk 1.2.65 → 1.2.66
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-Mm5byzEC.js +124 -0
- package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
- package/dist/CanvasArea-8NXGRRYC.js +137 -0
- package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
- package/dist/{CodeEditor-Qff4q7sx.js → CodeEditor-3l-mFvg4.js} +61 -46
- package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
- package/dist/STRINGS--j49GZJP.js +7 -0
- package/dist/STRINGS-gPz7CUOk.cjs +1 -0
- package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
- package/dist/SettingsPanel-Q3xQQm81.js +82 -0
- package/dist/{SidePanels-ijaUKSek.js → SidePanels-JyziIpDA.js} +87 -92
- package/dist/SidePanels-d04PONzN.cjs +1 -0
- package/dist/{Topbar-vHlnfxPs.js → Topbar-Xgd6YI66.js} +47 -51
- package/dist/Topbar-eIenyfZu.cjs +1 -0
- package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
- package/dist/{UILibrariesPanel-NVUMUPUj.js → UILibrariesPanel-a7TrMuAU.js} +82 -90
- package/dist/{UnsplashImages-UkHihhA5.js → UnsplashImages-6Bj8nQ8n.js} +73 -57
- package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
- package/dist/{UploadImages-HtuJZJlo.js → UploadImages-4PxhlZMB.js} +58 -44
- package/dist/UploadImages-uL2R7fju.cjs +1 -0
- package/dist/badge-7BVT3zxN.cjs +1 -0
- package/dist/badge-pJqQSA13.js +23 -0
- package/dist/context-menu-_8TFbFEJ.cjs +1 -0
- package/dist/context-menu-sks9vdzC.js +906 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +45 -20
- package/dist/core.js +85 -86
- package/dist/iconBase-vJD0OXxU.cjs +1 -0
- package/dist/iconBase-zweRWSz0.js +323 -0
- package/dist/index-Dgo2PNEV.js +33210 -0
- package/dist/index-jhNzBWrV.cjs +223 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/plugin-P0tpo_XZ.cjs +1 -0
- package/dist/plugin-_F-KZp1i.cjs +1 -0
- package/dist/plugin-f5uJtdXY.js +43 -0
- package/dist/plugin-sJ3Hzvpv.js +57 -0
- package/dist/render.cjs +3 -1
- package/dist/render.d.ts +19 -52
- package/dist/render.js +136 -183
- package/dist/select-JW3OMYm-.js +75 -0
- package/dist/select-fXj5tdMX.cjs +1 -0
- package/dist/separator-hT24N-xp.cjs +1 -0
- package/dist/separator-sgwOa1FE.js +18 -0
- package/dist/style.css +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +41 -1
- package/dist/tailwind.js +16 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +0 -10
- package/dist/ui.js +345 -163
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +1 -1
- package/dist/web-blocks.js +489 -724
- package/package.json +15 -45
- package/dist/CanvasArea-fSdH_RiN.cjs +0 -1
- package/dist/CanvasArea-ut5yknzX.js +0 -168
- package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
- package/dist/CurrentPage-jHSVy3hq.js +0 -120
- package/dist/CurrentPage-p_AM4lrF.cjs +0 -1
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/MODIFIERS-fd5XOmum.js +0 -60
- package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
- package/dist/PagesPanel-U3InJ9Db.js +0 -78
- package/dist/PagesPanel-wqDb4D-x.cjs +0 -1
- package/dist/ProjectPanel-XODJTO4J.js +0 -99
- package/dist/ProjectPanel-fWESzHr6.cjs +0 -1
- package/dist/SidePanels-lrMQqc0h.cjs +0 -1
- package/dist/Topbar-RrCDxd0i.cjs +0 -1
- package/dist/UILibrariesPanel-7btHgBD0.cjs +0 -1
- package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
- package/dist/UploadImages-3h0cRsvr.cjs +0 -1
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-RwIj1FxH.cjs +0 -1
- package/dist/add-page-modal-TOfMfmPA.js +0 -115
- package/dist/confirm-alert-eIp2cAkc.js +0 -60
- package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
- package/dist/controls-rRZhz0vu.cjs +0 -1
- package/dist/controls-yjgoZzB6.js +0 -199
- package/dist/delete-page-modal-4bxjpVBD.js +0 -97
- package/dist/delete-page-modal-qYDZmpgT.cjs +0 -1
- package/dist/email-blocks.cjs +0 -1
- package/dist/email-blocks.d.ts +0 -3
- package/dist/email-blocks.js +0 -294
- package/dist/email.cjs +0 -1
- package/dist/email.d.ts +0 -171
- package/dist/email.js +0 -90
- package/dist/empty-slot-Lsxjts7Q.js +0 -6
- package/dist/empty-slot-Sy930lX6.cjs +0 -1
- package/dist/form-4jTocVbZ.cjs +0 -1
- package/dist/form-NAzFjGs0.js +0 -125
- package/dist/functions--tdNWQDW.js +0 -30
- package/dist/functions-EVUeSwX1.cjs +0 -1
- package/dist/html-to-json-NqRjgFqp.cjs +0 -1
- package/dist/html-to-json-l_mw5y-e.js +0 -243
- package/dist/index--k2M8kzI.cjs +0 -1
- package/dist/index--mLLy7QQ.cjs +0 -1
- package/dist/index-5XyNUAjc.cjs +0 -290
- package/dist/index-C7mB4XFm.js +0 -3141
- package/dist/index-VBXQixVm.js +0 -117
- package/dist/index-YZhtVcj_.js +0 -2201
- package/dist/index-aeDphKpP.cjs +0 -1
- package/dist/index-lFgDm1oa.js +0 -83780
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/lib.cjs +0 -3
- package/dist/lib.d.ts +0 -80
- package/dist/lib.js +0 -1350
- package/dist/page-viewer-4wrnWnK0.js +0 -124
- package/dist/page-viewer-ra0GLx1p.cjs +0 -1
- package/dist/project-general-setting-IwZUkYF3.js +0 -90
- package/dist/project-general-setting-lFjTUhHD.cjs +0 -1
- package/dist/project-seo-setting-e1fTqVsd.js +0 -83
- package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
- package/dist/server.cjs +0 -1
- package/dist/server.d.ts +0 -299
- package/dist/server.js +0 -216
- package/dist/single-page-detail-ZNWFKqLW.js +0 -229
- package/dist/single-page-detail-g55Anu7R.cjs +0 -1
- package/dist/studio.cjs +0 -1
- package/dist/studio.d.ts +0 -176
- package/dist/studio.js +0 -67
- package/dist/utils-D_vtk3zK.cjs +0 -1
- package/dist/utils-VpVqnC9m.js +0 -1075
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import b, { createElement as S, useState as k, useEffect as E } from "react";
|
|
3
|
+
import { omit as B, has as P, isFunction as D, first as g, filter as f, groupBy as H, uniq as L, map as T, includes as F, isEmpty as y, reject as v, values as N } from "lodash-es";
|
|
4
|
+
import { useAtom as j } from "jotai";
|
|
5
|
+
import { useTranslation as M } from "react-i18next";
|
|
6
|
+
import { T as O, d as q, e as G, E as J, F as K, G as A, X as R, J as z, K as U, M as V, N as W } from "./context-menu-sks9vdzC.js";
|
|
7
|
+
import { BoxIcon as X } from "@radix-ui/react-icons";
|
|
8
|
+
import { r as Y, s as Q, i as Z, t as $, e as ee, v as te, c as C, I as oe } from "./index-Dgo2PNEV.js";
|
|
9
|
+
import { syncBlocksWithDefaults as re, useChaiBlocks as se } from "@chaibuilder/runtime";
|
|
10
|
+
import { O as w } from "./STRINGS--j49GZJP.js";
|
|
11
|
+
import { useFeature as ie } from "flagged";
|
|
12
|
+
import { c as _ } from "./iconBase-zweRWSz0.js";
|
|
13
|
+
import "@radix-ui/react-switch";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "class-variance-authority";
|
|
16
|
+
import "@radix-ui/react-alert-dialog";
|
|
17
|
+
import "@radix-ui/react-slot";
|
|
18
|
+
import "@radix-ui/react-label";
|
|
19
|
+
import "@radix-ui/react-scroll-area";
|
|
20
|
+
import "@radix-ui/react-tabs";
|
|
21
|
+
import "@radix-ui/react-tooltip";
|
|
22
|
+
import "@radix-ui/react-popover";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-dropdown-menu";
|
|
25
|
+
import "@radix-ui/react-toast";
|
|
26
|
+
import "cmdk";
|
|
27
|
+
import "@radix-ui/react-dialog";
|
|
28
|
+
import "@radix-ui/react-context-menu";
|
|
29
|
+
import "clsx";
|
|
30
|
+
import "tailwind-merge";
|
|
31
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
32
|
+
import "@react-hookz/web";
|
|
33
|
+
import "tree-model";
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "react-hotkeys-hook";
|
|
36
|
+
import "@floating-ui/dom";
|
|
37
|
+
import "@floating-ui/react-dom";
|
|
38
|
+
import "@tailwindcss/typography";
|
|
39
|
+
import "@tailwindcss/forms";
|
|
40
|
+
import "@tailwindcss/aspect-ratio";
|
|
41
|
+
import "tailwindcss-palette-generator";
|
|
42
|
+
import "lodash";
|
|
43
|
+
import "react-wrap-balancer";
|
|
44
|
+
import "react-dom";
|
|
45
|
+
import "prop-types";
|
|
46
|
+
import "@rjsf/validator-ajv8";
|
|
47
|
+
import "@rjsf/core";
|
|
48
|
+
import "react-arborist";
|
|
49
|
+
import "lucide-react";
|
|
50
|
+
import "himalaya";
|
|
51
|
+
import "react-icons-picker";
|
|
52
|
+
import "react-autosuggest";
|
|
53
|
+
import "fuse.js";
|
|
54
|
+
import "i18next";
|
|
55
|
+
const le = ({ block: t }) => {
|
|
56
|
+
const [, p] = j(Y), { type: r, icon: i, label: n } = t, { addCoreBlock: a, addPredefinedBlock: u } = Q(), [m, h] = Z(), [, l] = $(), [, d] = j(ee), x = () => {
|
|
57
|
+
if (P(t, "blocks")) {
|
|
58
|
+
const o = D(t.blocks) ? t.blocks() : t.blocks;
|
|
59
|
+
u(re(o), g(m));
|
|
60
|
+
} else
|
|
61
|
+
a(t, g(m));
|
|
62
|
+
d(w);
|
|
63
|
+
}, c = ie("dnd");
|
|
64
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { children: [
|
|
65
|
+
/* @__PURE__ */ e.jsx(q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
onClick: x,
|
|
69
|
+
type: "button",
|
|
70
|
+
onDragStart: (o) => {
|
|
71
|
+
o.dataTransfer.setData("text/plain", JSON.stringify(B(t, ["component", "icon"]))), o.dataTransfer.setDragImage(new Image(), 0, 0), p(B(t, ["component", "icon"])), setTimeout(() => {
|
|
72
|
+
h([]), l(null), d(w);
|
|
73
|
+
}, 200);
|
|
74
|
+
},
|
|
75
|
+
draggable: c ? "true" : "false",
|
|
76
|
+
className: "cursor-pointer space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",
|
|
77
|
+
children: [
|
|
78
|
+
S(i || X, { className: "w-4 h-4 mx-auto" }),
|
|
79
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: n || r })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("p", { children: n || r }) })
|
|
84
|
+
] }) });
|
|
85
|
+
}, at = ({ className: t, showHeading: p = !0 }) => {
|
|
86
|
+
const { t: r } = M(), [i, n] = k("core"), [a, u] = k("basic"), m = se(), [, h] = j(te), l = C("importHTMLSupport", !0), d = C("filterChaiBlock", () => !0), x = f(m, d), c = H(x, "category"), o = L(T(c.core, "group"));
|
|
87
|
+
return E(() => {
|
|
88
|
+
!F(o, a) && !y(o) && !y(a) && u(g(o));
|
|
89
|
+
}, [o, a]), /* @__PURE__ */ e.jsxs("div", { className: _("flex h-full w-full flex-col overflow-hidden", t), children: [
|
|
90
|
+
p ? /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
91
|
+
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: r("add_block") }),
|
|
92
|
+
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: r(i === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
93
|
+
] }) : null,
|
|
94
|
+
/* @__PURE__ */ e.jsx(
|
|
95
|
+
J,
|
|
96
|
+
{
|
|
97
|
+
onValueChange: (s) => {
|
|
98
|
+
h(""), n(s);
|
|
99
|
+
},
|
|
100
|
+
value: i,
|
|
101
|
+
className: _("h-max", l ? "" : "hidden"),
|
|
102
|
+
children: /* @__PURE__ */ e.jsxs(K, { className: "grid w-full " + (l ? "grid-cols-2" : "grid-cols-1"), children: [
|
|
103
|
+
/* @__PURE__ */ e.jsx(A, { value: "core", children: r("Blocks") }),
|
|
104
|
+
l ? /* @__PURE__ */ e.jsx(A, { value: "html", children: r("import") }) : null
|
|
105
|
+
] })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
i === "core" && /* @__PURE__ */ e.jsx(R, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: b.Children.toArray(
|
|
109
|
+
T(
|
|
110
|
+
o,
|
|
111
|
+
(s) => v(f(N(c.core), { group: s }), { hidden: !0 }).length ? /* @__PURE__ */ e.jsx(z, { type: "single", value: s, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(U, { value: s, children: [
|
|
112
|
+
/* @__PURE__ */ e.jsx(V, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: s }),
|
|
113
|
+
/* @__PURE__ */ e.jsx(W, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: b.Children.toArray(
|
|
114
|
+
v(f(N(c.core), { group: s }), { hidden: !0 }).map((I) => /* @__PURE__ */ e.jsx(le, { block: I }))
|
|
115
|
+
) }) })
|
|
116
|
+
] }) }) : null
|
|
117
|
+
)
|
|
118
|
+
) }) }),
|
|
119
|
+
i === "html" && l ? /* @__PURE__ */ e.jsx(oe, {}) : null
|
|
120
|
+
] });
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
at as default
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),a=require("react"),r=require("lodash-es"),E=require("jotai"),k=require("react-i18next"),t=require("./context-menu-_8TFbFEJ.cjs"),y=require("@radix-ui/react-icons"),o=require("./index-jhNzBWrV.cjs"),T=require("@chaibuilder/runtime"),R=require("./STRINGS-gPz7CUOk.cjs"),v=require("flagged"),b=require("./iconBase-vJD0OXxU.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("lucide-react");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const N=({block:s})=>{const[,q]=E.useAtom(o.draggedBlockAtom),{type:l,icon:c,label:m}=s,{addCoreBlock:d,addPredefinedBlock:j}=o.useAddBlock(),[p,g]=o.useSelectedBlockIds(),[,u]=o.useHighlightBlockId(),[,h]=E.useAtom(o.activePanelAtom),f=()=>{if(r.has(s,"blocks")){const i=r.isFunction(s.blocks)?s.blocks():s.blocks;j(T.syncBlocksWithDefaults(i),r.first(p))}else d(s,r.first(p));h(R.OUTLINE_KEY)},x=v.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(t.Tooltip,{children:[e.jsxRuntimeExports.jsx(t.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:f,type:"button",onDragStart:i=>{i.dataTransfer.setData("text/plain",JSON.stringify(r.omit(s,["component","icon"]))),i.dataTransfer.setDragImage(new Image,0,0),q(r.omit(s,["component","icon"])),setTimeout(()=>{g([]),u(null),h(R.OUTLINE_KEY)},200)},draggable:x?"true":"false",className:"cursor-pointer space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[a.createElement(c||y.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:m||l})]})}),e.jsxRuntimeExports.jsx(t.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:m||l})})]})})},A=({className:s,showHeading:q=!0})=>{const{t:l}=k.useTranslation(),[c,m]=a.useState("core"),[d,j]=a.useState("basic"),p=T.useChaiBlocks(),[,g]=E.useAtom(o.showPredefinedBlockCategoryAtom),u=o.useBuilderProp("importHTMLSupport",!0),h=o.useBuilderProp("filterChaiBlock",()=>!0),f=r.filter(p,h),x=r.groupBy(f,"category"),i=r.uniq(r.map(x.core,"group"));return a.useEffect(()=>{!r.includes(i,d)&&!r.isEmpty(i)&&!r.isEmpty(d)&&j(r.first(i))},[i,d]),e.jsxRuntimeExports.jsxs("div",{className:b.cn("flex h-full w-full flex-col overflow-hidden",s),children:[q?e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:l("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:l(c==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}):null,e.jsxRuntimeExports.jsx(t.Tabs,{onValueChange:n=>{g(""),m(n)},value:c,className:b.cn("h-max",u?"":"hidden"),children:e.jsxRuntimeExports.jsxs(t.TabsList,{className:"grid w-full "+(u?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(t.TabsTrigger,{value:"core",children:l("Blocks")}),u?e.jsxRuntimeExports.jsx(t.TabsTrigger,{value:"html",children:l("import")}):null]})}),c==="core"&&e.jsxRuntimeExports.jsx(t.ScrollArea,{className:"-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:a.Children.toArray(r.map(i,n=>r.reject(r.filter(r.values(x.core),{group:n}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(t.Accordion,{type:"single",value:n,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(t.AccordionItem,{value:n,children:[e.jsxRuntimeExports.jsx(t.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:n}),e.jsxRuntimeExports.jsx(t.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:a.Children.toArray(r.reject(r.filter(r.values(x.core),{group:n}),{hidden:!0}).map(B=>e.jsxRuntimeExports.jsx(N,{block:B})))})})]})}):null))})}),c==="html"&&u?e.jsxRuntimeExports.jsx(o.ImportHTML,{}):null]})};exports.default=A;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import m, { useCallback as p, Suspense as o } from "react";
|
|
3
|
+
import { round as x } from "lodash-es";
|
|
4
|
+
import { EraserIcon as d, ZoomInIcon as j } from "@radix-ui/react-icons";
|
|
5
|
+
import { h, i as u, j as f, k as v, c, l as A, B as k, D as g, U as C, m as N, E as b, S } from "./index-Dgo2PNEV.js";
|
|
6
|
+
import { S as r } from "./separator-sgwOa1FE.js";
|
|
7
|
+
import { useTranslation as B } from "react-i18next";
|
|
8
|
+
import { a1 as D, a2 as w, B as y, a3 as I, a4 as E, a5 as _, a6 as z, a7 as R, a8 as T, a9 as F, L as M, I as U, S as l } from "./context-menu-sks9vdzC.js";
|
|
9
|
+
import { useAtom as L } from "jotai";
|
|
10
|
+
import { SparklesIcon as Z } from "lucide-react";
|
|
11
|
+
import { Resizable as H } from "re-resizable";
|
|
12
|
+
import "./iconBase-zweRWSz0.js";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "tailwind-merge";
|
|
15
|
+
import "@chaibuilder/runtime";
|
|
16
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "tree-model";
|
|
19
|
+
import "react-quill";
|
|
20
|
+
import "./STRINGS--j49GZJP.js";
|
|
21
|
+
import "react-hotkeys-hook";
|
|
22
|
+
import "@floating-ui/dom";
|
|
23
|
+
import "@floating-ui/react-dom";
|
|
24
|
+
import "flagged";
|
|
25
|
+
import "@tailwindcss/typography";
|
|
26
|
+
import "@tailwindcss/forms";
|
|
27
|
+
import "@tailwindcss/aspect-ratio";
|
|
28
|
+
import "tailwindcss-palette-generator";
|
|
29
|
+
import "lodash";
|
|
30
|
+
import "react-wrap-balancer";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "prop-types";
|
|
33
|
+
import "@rjsf/validator-ajv8";
|
|
34
|
+
import "@rjsf/core";
|
|
35
|
+
import "react-arborist";
|
|
36
|
+
import "himalaya";
|
|
37
|
+
import "react-icons-picker";
|
|
38
|
+
import "react-autosuggest";
|
|
39
|
+
import "fuse.js";
|
|
40
|
+
import "@radix-ui/react-scroll-area";
|
|
41
|
+
import "i18next";
|
|
42
|
+
import "@radix-ui/react-separator";
|
|
43
|
+
import "@radix-ui/react-switch";
|
|
44
|
+
import "@radix-ui/react-accordion";
|
|
45
|
+
import "class-variance-authority";
|
|
46
|
+
import "@radix-ui/react-alert-dialog";
|
|
47
|
+
import "@radix-ui/react-slot";
|
|
48
|
+
import "@radix-ui/react-label";
|
|
49
|
+
import "@radix-ui/react-tabs";
|
|
50
|
+
import "@radix-ui/react-tooltip";
|
|
51
|
+
import "@radix-ui/react-popover";
|
|
52
|
+
import "@radix-ui/react-hover-card";
|
|
53
|
+
import "@radix-ui/react-dropdown-menu";
|
|
54
|
+
import "@radix-ui/react-toast";
|
|
55
|
+
import "cmdk";
|
|
56
|
+
import "@radix-ui/react-dialog";
|
|
57
|
+
import "@radix-ui/react-context-menu";
|
|
58
|
+
const P = () => {
|
|
59
|
+
const { t: e } = B(), { setNewBlocks: t } = h(), [, i] = u(), [, a] = f(), n = p(() => {
|
|
60
|
+
t([]), i([]), a([]);
|
|
61
|
+
}, [t]);
|
|
62
|
+
return /* @__PURE__ */ s.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ s.jsxs(D, { children: [
|
|
63
|
+
/* @__PURE__ */ s.jsx(w, { asChild: !0, children: /* @__PURE__ */ s.jsxs(y, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
64
|
+
/* @__PURE__ */ s.jsx(d, {}),
|
|
65
|
+
" ",
|
|
66
|
+
e("clear")
|
|
67
|
+
] }) }),
|
|
68
|
+
/* @__PURE__ */ s.jsxs(I, { className: "border-border", children: [
|
|
69
|
+
/* @__PURE__ */ s.jsxs(E, { children: [
|
|
70
|
+
/* @__PURE__ */ s.jsx(_, { children: e("clear_canvas_title") }),
|
|
71
|
+
/* @__PURE__ */ s.jsx(z, { children: e("clear_canvas_description") })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ s.jsxs(R, { children: [
|
|
74
|
+
/* @__PURE__ */ s.jsx(T, { children: e("cancel") }),
|
|
75
|
+
/* @__PURE__ */ s.jsx(F, { onClick: n, children: e("yes") })
|
|
76
|
+
] })
|
|
77
|
+
] })
|
|
78
|
+
] }) });
|
|
79
|
+
}, q = () => {
|
|
80
|
+
const [e, t] = L(v);
|
|
81
|
+
return c("askAiCallBack", null) ? /* @__PURE__ */ s.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
82
|
+
/* @__PURE__ */ s.jsxs(M, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
|
|
83
|
+
/* @__PURE__ */ s.jsx(Z, { className: "w-4" }),
|
|
84
|
+
"AI Assistant"
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ s.jsx(
|
|
87
|
+
U,
|
|
88
|
+
{
|
|
89
|
+
className: "scale-90",
|
|
90
|
+
checked: e,
|
|
91
|
+
onCheckedChange: (a) => {
|
|
92
|
+
t(a);
|
|
93
|
+
},
|
|
94
|
+
id: "ai-assitantt"
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }) : null;
|
|
98
|
+
}, G = () => {
|
|
99
|
+
const e = c("darkMode", !0), [t] = A();
|
|
100
|
+
return /* @__PURE__ */ s.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
101
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
102
|
+
/* @__PURE__ */ s.jsx(k, {}),
|
|
103
|
+
/* @__PURE__ */ s.jsx(r, { orientation: "vertical" }),
|
|
104
|
+
e ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ s.jsx(g, {}),
|
|
106
|
+
/* @__PURE__ */ s.jsx(r, { orientation: "vertical" })
|
|
107
|
+
] }) : null,
|
|
108
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
|
|
109
|
+
/* @__PURE__ */ s.jsx(j, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
110
|
+
" ",
|
|
111
|
+
/* @__PURE__ */ s.jsxs("div", { className: "text-xs leading-3", children: [
|
|
112
|
+
x(t, 0),
|
|
113
|
+
"%"
|
|
114
|
+
] })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ s.jsx(r, { orientation: "vertical" }),
|
|
117
|
+
/* @__PURE__ */ s.jsx(C, {})
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
120
|
+
/* @__PURE__ */ s.jsx(P, {}),
|
|
121
|
+
/* @__PURE__ */ s.jsx(r, { orientation: "vertical" }),
|
|
122
|
+
/* @__PURE__ */ s.jsx(q, {})
|
|
123
|
+
] })
|
|
124
|
+
] });
|
|
125
|
+
}, J = m.lazy(() => import("./CodeEditor-3l-mFvg4.js")), Vs = () => {
|
|
126
|
+
const [e] = N();
|
|
127
|
+
return /* @__PURE__ */ s.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
128
|
+
/* @__PURE__ */ s.jsx(G, {}),
|
|
129
|
+
/* @__PURE__ */ s.jsxs("div", { className: "relative flex h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
|
|
130
|
+
/* @__PURE__ */ s.jsx(o, { fallback: /* @__PURE__ */ s.jsx(l, { className: "h-full" }), children: /* @__PURE__ */ s.jsx(b, { children: /* @__PURE__ */ s.jsx(S, {}) }) }),
|
|
131
|
+
e ? /* @__PURE__ */ s.jsx(o, { fallback: /* @__PURE__ */ s.jsx(l, { className: "h-full" }), children: /* @__PURE__ */ s.jsx(H, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ s.jsx(J, {}) }) }) : null
|
|
132
|
+
] })
|
|
133
|
+
] });
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
Vs as default
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("react"),c=require("lodash-es"),l=require("@radix-ui/react-icons"),r=require("./index-jhNzBWrV.cjs"),n=require("./separator-hT24N-xp.cjs"),j=require("react-i18next"),s=require("./context-menu-_8TFbFEJ.cjs"),m=require("jotai"),d=require("lucide-react"),p=require("re-resizable");require("./iconBase-vJD0OXxU.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("@radix-ui/react-scroll-area");require("i18next");require("@radix-ui/react-separator");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");const q=()=>{const{t}=j.useTranslation(),{setNewBlocks:i}=r.useBlocksStoreUndoableActions(),[,a]=r.useSelectedBlockIds(),[,x]=r.useSelectedStylingBlocks(),u=o.useCallback(()=>{i([]),a([]),x([])},[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(s.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[e.jsxRuntimeExports.jsx(l.EraserIcon,{})," ",t("clear")]})}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{className:"border-border",children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{children:t("clear_canvas_title")}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:t("clear_canvas_description")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:t("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:u,children:t("yes")})]})]})]})})},E=()=>{const[t,i]=m.useAtom(r.aiAssistantActiveAtom);return r.useBuilderProp("askAiCallBack",null)?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsxs(s.Label,{htmlFor:"ai-assistant",className:"flex items-center gap-x-1 text-sm text-yellow-600",children:[e.jsxRuntimeExports.jsx(d.SparklesIcon,{className:"w-4"}),"AI Assistant"]}),e.jsxRuntimeExports.jsx(s.Switch,{className:"scale-90",checked:t,onCheckedChange:x=>{i(x)},id:"ai-assitantt"})]}):null},R=()=>{const t=r.useBuilderProp("darkMode",!0),[i]=r.useCanvasZoom();return e.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e.jsxRuntimeExports.jsx(r.Breakpoints,{}),e.jsxRuntimeExports.jsx(n.Separator,{orientation:"vertical"}),t?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.DarkMode,{}),e.jsxRuntimeExports.jsx(n.Separator,{orientation:"vertical"})]}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400",children:[e.jsxRuntimeExports.jsx(l.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",e.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[c.round(i,0),"%"]})]}),e.jsxRuntimeExports.jsx(n.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(r.UndoRedo,{})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[e.jsxRuntimeExports.jsx(q,{}),e.jsxRuntimeExports.jsx(n.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(E,{})]})]})},h=o.lazy(()=>Promise.resolve().then(()=>require("./CodeEditor-o-CkvDnY.cjs"))),f=()=>{const[t]=r.useCodeEditor();return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsxRuntimeExports.jsx(R,{}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full flex-col overflow-hidden bg-gray-100/40 px-2",children:[e.jsxRuntimeExports.jsx(o.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-full"}),children:e.jsxRuntimeExports.jsx(r.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(r.StaticCanvas,{})})}),t?e.jsxRuntimeExports.jsx(o.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-full"}),children:e.jsxRuntimeExports.jsx(p.Resizable,{enable:{top:!0,bottom:!1},className:"max-h-[400px] min-h-[200px]",children:e.jsxRuntimeExports.jsx(h,{})})}):null]})]})};exports.default=f;
|
|
@@ -1,79 +1,94 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import k from "@monaco-editor/react";
|
|
3
|
-
import {
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { useState as
|
|
3
|
+
import { B as C } from "./context-menu-sks9vdzC.js";
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
|
+
import { useState as p, useCallback as v, useEffect as g } from "react";
|
|
6
|
+
import { m as y, i as N, x as T, y as E } from "./index-Dgo2PNEV.js";
|
|
6
7
|
import { Cross2Icon as w } from "@radix-ui/react-icons";
|
|
7
8
|
import { useThrottledCallback as B } from "@react-hookz/web";
|
|
8
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
-
import "@radix-ui/react-toggle";
|
|
10
|
-
import "class-variance-authority";
|
|
11
|
-
import "./utils-VpVqnC9m.js";
|
|
12
|
-
import "lodash-es";
|
|
13
|
-
import "./MODIFIERS-fd5XOmum.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
9
|
import "@radix-ui/react-switch";
|
|
17
|
-
import "@radix-ui/react-slot";
|
|
18
10
|
import "@radix-ui/react-accordion";
|
|
11
|
+
import "class-variance-authority";
|
|
19
12
|
import "@radix-ui/react-alert-dialog";
|
|
20
|
-
import "@radix-ui/react-
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
21
14
|
import "@radix-ui/react-label";
|
|
22
15
|
import "@radix-ui/react-scroll-area";
|
|
23
16
|
import "@radix-ui/react-tabs";
|
|
24
17
|
import "@radix-ui/react-tooltip";
|
|
25
18
|
import "@radix-ui/react-popover";
|
|
26
|
-
import "@radix-ui/react-menubar";
|
|
27
19
|
import "@radix-ui/react-hover-card";
|
|
28
|
-
import "@radix-ui/react-select";
|
|
29
20
|
import "@radix-ui/react-dropdown-menu";
|
|
30
|
-
import "@radix-ui/react-separator";
|
|
31
21
|
import "@radix-ui/react-toast";
|
|
32
22
|
import "cmdk";
|
|
23
|
+
import "@radix-ui/react-dialog";
|
|
33
24
|
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "
|
|
35
|
-
import "
|
|
36
|
-
import "
|
|
37
|
-
import "./Functions-7jnEwJyw.js";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
25
|
+
import "clsx";
|
|
26
|
+
import "tailwind-merge";
|
|
27
|
+
import "lodash-es";
|
|
39
28
|
import "jotai";
|
|
29
|
+
import "./iconBase-zweRWSz0.js";
|
|
30
|
+
import "@chaibuilder/runtime";
|
|
31
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
40
32
|
import "tree-model";
|
|
41
|
-
|
|
33
|
+
import "react-quill";
|
|
34
|
+
import "./STRINGS--j49GZJP.js";
|
|
35
|
+
import "react-hotkeys-hook";
|
|
36
|
+
import "@floating-ui/dom";
|
|
37
|
+
import "@floating-ui/react-dom";
|
|
38
|
+
import "flagged";
|
|
39
|
+
import "@tailwindcss/typography";
|
|
40
|
+
import "@tailwindcss/forms";
|
|
41
|
+
import "@tailwindcss/aspect-ratio";
|
|
42
|
+
import "tailwindcss-palette-generator";
|
|
43
|
+
import "lodash";
|
|
44
|
+
import "react-wrap-balancer";
|
|
45
|
+
import "react-dom";
|
|
46
|
+
import "prop-types";
|
|
47
|
+
import "@rjsf/validator-ajv8";
|
|
48
|
+
import "@rjsf/core";
|
|
49
|
+
import "react-arborist";
|
|
50
|
+
import "lucide-react";
|
|
51
|
+
import "himalaya";
|
|
52
|
+
import "react-icons-picker";
|
|
53
|
+
import "react-autosuggest";
|
|
54
|
+
import "fuse.js";
|
|
55
|
+
import "i18next";
|
|
56
|
+
const n = (r) => {
|
|
42
57
|
const i = document.createElement("div");
|
|
43
|
-
return i.innerHTML =
|
|
58
|
+
return i.innerHTML = r, i.innerHTML;
|
|
44
59
|
};
|
|
45
|
-
function
|
|
46
|
-
const { t:
|
|
47
|
-
(
|
|
48
|
-
const b = n(
|
|
49
|
-
u([
|
|
60
|
+
function Lt() {
|
|
61
|
+
const { t: r } = j(), [i, a] = p(!1), [m, c] = p(""), [o, s] = y(), [l] = N(), d = T(), u = E(), f = B(
|
|
62
|
+
(e) => {
|
|
63
|
+
const b = n(e);
|
|
64
|
+
u([o.blockId], { [o.blockProp]: b });
|
|
50
65
|
},
|
|
51
66
|
[],
|
|
52
67
|
300
|
|
53
|
-
), x =
|
|
68
|
+
), x = v(() => {
|
|
54
69
|
if (i) {
|
|
55
|
-
const
|
|
56
|
-
d([
|
|
70
|
+
const e = n(m);
|
|
71
|
+
d([o.blockId], { [o.blockProp]: e });
|
|
57
72
|
}
|
|
58
|
-
}, [i,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [
|
|
73
|
+
}, [i, m]);
|
|
74
|
+
g(() => {
|
|
75
|
+
l.includes(o == null ? void 0 : o.blockId) || (x(), s(null));
|
|
76
|
+
}, [l]);
|
|
62
77
|
const h = () => {
|
|
63
|
-
|
|
78
|
+
s(null);
|
|
64
79
|
};
|
|
65
80
|
return /* @__PURE__ */ t.jsxs("div", { className: "h-full rounded-t-lg border-t-4 border-black bg-black text-white", children: [
|
|
66
81
|
/* @__PURE__ */ t.jsx("button", { onClick: h, className: "fixed inset-0 z-[100000] cursor-default bg-gray-400/20" }),
|
|
67
82
|
/* @__PURE__ */ t.jsxs("div", { className: "relative z-[100001] h-full w-full flex-col gap-y-1", children: [
|
|
68
83
|
/* @__PURE__ */ t.jsxs("div", { className: "-mt-1 flex items-center justify-between px-2 py-2", children: [
|
|
69
84
|
/* @__PURE__ */ t.jsxs("h3", { className: "space-x-3 text-sm font-semibold", children: [
|
|
70
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
71
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-xs text-gray-400", children:
|
|
85
|
+
/* @__PURE__ */ t.jsx("span", { children: r("HTML Code Editor |") }),
|
|
86
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-xs text-gray-400", children: r("Scripts will be only executed in preview and live mode.") })
|
|
72
87
|
] }),
|
|
73
88
|
/* @__PURE__ */ t.jsx("div", { className: "flex gap-x-2", children: /* @__PURE__ */ t.jsx(
|
|
74
|
-
|
|
89
|
+
C,
|
|
75
90
|
{
|
|
76
|
-
onClick: () =>
|
|
91
|
+
onClick: () => s(null),
|
|
77
92
|
size: "sm",
|
|
78
93
|
variant: "destructive",
|
|
79
94
|
className: "h-6 w-fit",
|
|
@@ -84,11 +99,11 @@ function xt() {
|
|
|
84
99
|
/* @__PURE__ */ t.jsx(
|
|
85
100
|
k,
|
|
86
101
|
{
|
|
87
|
-
onMount: (
|
|
88
|
-
|
|
102
|
+
onMount: (e) => {
|
|
103
|
+
e.setValue(o.initialCode);
|
|
89
104
|
},
|
|
90
|
-
onChange: (
|
|
91
|
-
|
|
105
|
+
onChange: (e) => {
|
|
106
|
+
a(!0), c(e), f(e);
|
|
92
107
|
},
|
|
93
108
|
height: "100%",
|
|
94
109
|
defaultLanguage: "html",
|
|
@@ -105,5 +120,5 @@ function xt() {
|
|
|
105
120
|
] });
|
|
106
121
|
}
|
|
107
122
|
export {
|
|
108
|
-
|
|
123
|
+
Lt as default
|
|
109
124
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),b=require("@monaco-editor/react"),k=require("./context-menu-_8TFbFEJ.cjs"),C=require("react-i18next"),u=require("react"),n=require("./index-jhNzBWrV.cjs"),E=require("@radix-ui/react-icons"),R=require("@react-hookz/web");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("lodash-es");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("lucide-react");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const a=s=>{const i=document.createElement("div");return i.innerHTML=s,i.innerHTML};function g(){const{t:s}=C.useTranslation(),[i,d]=u.useState(!1),[l,q]=u.useState(""),[r,o]=n.useCodeEditor(),[c]=n.useSelectedBlockIds(),x=n.useUpdateBlocksProps(),m=n.useUpdateBlocksPropsRealtime(),p=R.useThrottledCallback(t=>{const h=a(t);m([r.blockId],{[r.blockProp]:h})},[],300),j=u.useCallback(()=>{if(i){const t=a(l);x([r.blockId],{[r.blockProp]:t})}},[i,l]);u.useEffect(()=>{c.includes(r==null?void 0:r.blockId)||(j(),o(null))},[c]);const f=()=>{o(null)};return e.jsxRuntimeExports.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsxRuntimeExports.jsx("button",{onClick:f,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxRuntimeExports.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsxRuntimeExports.jsx("span",{children:s("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:s("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(k.Button,{onClick:()=>o(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(E.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(b,{onMount:t=>{t.setValue(r.initialCode)},onChange:t=>{d(!0),q(t),p(t)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const E="#styles:",s="#slots:",Y="#i18n",t="outline";exports.I18N_KEY=Y;exports.OUTLINE_KEY=t;exports.SLOT_KEY=s;exports.STYLES_KEY=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),n=require("react"),o=require("lodash-es"),x=require("react-i18next"),q=require("@radix-ui/react-icons"),r=require("./index-jhNzBWrV.cjs"),c=require("lucide-react");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./context-menu-_8TFbFEJ.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const l=()=>{const t=r.useSelectedBlock(),{t:s}=x.useTranslation(),[i,u]=n.useState(!0);return o.isNull(t)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(q.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:s("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(r.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col px-2 pr-4",children:[e.jsxRuntimeExports.jsx(r.BlockSettings,{}),e.jsxRuntimeExports.jsx(r.BlockStyling,{}),e.jsxRuntimeExports.jsxs("div",{onClick:()=>u(!i),className:"flex items-center justify-between border-b border-gray-300 py-2 text-sm font-bold hover:bg-gray-50",children:[e.jsxRuntimeExports.jsx("span",{children:"Attributes"}),e.jsxRuntimeExports.jsx("span",{children:e.jsxRuntimeExports.jsx(c.ChevronDown,{className:"h-4 w-4 text-gray-500 "+(i?"rotate-180":"")})})]}),i&&e.jsxRuntimeExports.jsx(r.BlockAttributesEditor,{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})})};exports.default=l;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { useState as e } from "react";
|
|
3
|
+
import { isNull as s } from "lodash-es";
|
|
4
|
+
import { useTranslation as p } from "react-i18next";
|
|
5
|
+
import { MixerHorizontalIcon as l } from "@radix-ui/react-icons";
|
|
6
|
+
import { n, E as a, o as c, p as x, q as d } from "./index-Dgo2PNEV.js";
|
|
7
|
+
import { ChevronDown as j } from "lucide-react";
|
|
8
|
+
import "jotai";
|
|
9
|
+
import "./iconBase-zweRWSz0.js";
|
|
10
|
+
import "clsx";
|
|
11
|
+
import "tailwind-merge";
|
|
12
|
+
import "@chaibuilder/runtime";
|
|
13
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
14
|
+
import "@react-hookz/web";
|
|
15
|
+
import "tree-model";
|
|
16
|
+
import "react-quill";
|
|
17
|
+
import "./STRINGS--j49GZJP.js";
|
|
18
|
+
import "react-hotkeys-hook";
|
|
19
|
+
import "@floating-ui/dom";
|
|
20
|
+
import "@floating-ui/react-dom";
|
|
21
|
+
import "flagged";
|
|
22
|
+
import "@tailwindcss/typography";
|
|
23
|
+
import "@tailwindcss/forms";
|
|
24
|
+
import "@tailwindcss/aspect-ratio";
|
|
25
|
+
import "tailwindcss-palette-generator";
|
|
26
|
+
import "./context-menu-sks9vdzC.js";
|
|
27
|
+
import "@radix-ui/react-switch";
|
|
28
|
+
import "@radix-ui/react-accordion";
|
|
29
|
+
import "class-variance-authority";
|
|
30
|
+
import "@radix-ui/react-alert-dialog";
|
|
31
|
+
import "@radix-ui/react-slot";
|
|
32
|
+
import "@radix-ui/react-label";
|
|
33
|
+
import "@radix-ui/react-scroll-area";
|
|
34
|
+
import "@radix-ui/react-tabs";
|
|
35
|
+
import "@radix-ui/react-tooltip";
|
|
36
|
+
import "@radix-ui/react-popover";
|
|
37
|
+
import "@radix-ui/react-hover-card";
|
|
38
|
+
import "@radix-ui/react-dropdown-menu";
|
|
39
|
+
import "@radix-ui/react-toast";
|
|
40
|
+
import "cmdk";
|
|
41
|
+
import "@radix-ui/react-dialog";
|
|
42
|
+
import "@radix-ui/react-context-menu";
|
|
43
|
+
import "lodash";
|
|
44
|
+
import "react-wrap-balancer";
|
|
45
|
+
import "react-dom";
|
|
46
|
+
import "prop-types";
|
|
47
|
+
import "@rjsf/validator-ajv8";
|
|
48
|
+
import "@rjsf/core";
|
|
49
|
+
import "react-arborist";
|
|
50
|
+
import "himalaya";
|
|
51
|
+
import "react-icons-picker";
|
|
52
|
+
import "react-autosuggest";
|
|
53
|
+
import "fuse.js";
|
|
54
|
+
import "i18next";
|
|
55
|
+
const ut = () => {
|
|
56
|
+
const o = n(), { t: i } = p(), [r, m] = e(!0);
|
|
57
|
+
return s(o) ? /* @__PURE__ */ t.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
58
|
+
/* @__PURE__ */ t.jsx(l, { className: "mx-auto text-3xl" }),
|
|
59
|
+
/* @__PURE__ */ t.jsx("h1", { children: i("no_block_selected_for_styling") })
|
|
60
|
+
] }) }) : /* @__PURE__ */ t.jsx(a, { children: /* @__PURE__ */ t.jsxs("div", { className: "relative flex w-full flex-col px-2 pr-4", children: [
|
|
61
|
+
/* @__PURE__ */ t.jsx(c, {}),
|
|
62
|
+
/* @__PURE__ */ t.jsx(x, {}),
|
|
63
|
+
/* @__PURE__ */ t.jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
onClick: () => m(!r),
|
|
67
|
+
className: "flex items-center justify-between border-b border-gray-300 py-2 text-sm font-bold hover:bg-gray-50",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ t.jsx("span", { children: "Attributes" }),
|
|
70
|
+
/* @__PURE__ */ t.jsx("span", { children: /* @__PURE__ */ t.jsx(j, { className: "h-4 w-4 text-gray-500 " + (r ? "rotate-180" : "") }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
r && /* @__PURE__ */ t.jsx(d, {}),
|
|
75
|
+
/* @__PURE__ */ t.jsx("br", {}),
|
|
76
|
+
/* @__PURE__ */ t.jsx("br", {}),
|
|
77
|
+
/* @__PURE__ */ t.jsx("br", {})
|
|
78
|
+
] }) });
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
ut as default
|
|
82
|
+
};
|