@chaibuilder/sdk 1.2.42 → 1.2.44
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-Bb-K6Y0Z.cjs +1 -0
- package/dist/{AddBlocks--7JKHvJX.js → AddBlocks-QCb-vIta.js} +57 -56
- package/dist/CanvasArea-Hqy_21xf.js +1215 -0
- package/dist/CanvasArea-xvT325mp.cjs +57 -0
- package/dist/{ChaiBuilderEditor-GronwWg6.cjs → ChaiBuilderEditor-AIXWnz29.cjs} +44 -44
- package/dist/{ChaiBuilderEditor-f4SJU7kK.js → ChaiBuilderEditor-NnMEdW3k.js} +6627 -6635
- package/dist/{CurrentPage-hq3wJX-B.cjs → CurrentPage-n_oOiHx5.cjs} +1 -1
- package/dist/{CurrentPage-S5EFVi8y.js → CurrentPage-rkdt2mNr.js} +3 -3
- package/dist/{ListTree-un8hNvIi.js → ListTree-PuZP9LQu.js} +3 -3
- package/dist/{ListTree-PbmMwEnK.cjs → ListTree-z0FeSAsc.cjs} +1 -1
- package/dist/{PagesPanel-2zdTxUbm.cjs → PagesPanel-4ftrFiS0.cjs} +1 -1
- package/dist/{PagesPanel-f0XKYnEj.js → PagesPanel-TYArrNU6.js} +4 -4
- package/dist/{ProjectPanel-RMEd0gwn.cjs → ProjectPanel-2scMInUn.cjs} +1 -1
- package/dist/{ProjectPanel-vbBl5OmU.js → ProjectPanel-qY_Bnqjm.js} +4 -4
- package/dist/{Settings-Lsp-FmFS.js → Settings-k9Ll55Wc.js} +965 -892
- package/dist/Settings-kbUR5-xt.cjs +1 -0
- package/dist/SidePanels-ZHxoiJ7y.cjs +1 -0
- package/dist/{SidePanels-zU4GsqbI.js → SidePanels-eOnxPSSw.js} +151 -151
- package/dist/{ThemeConfiguration-1rD36g89.js → ThemeConfiguration-TINcg8VX.js} +5 -5
- package/dist/{ThemeConfiguration-76oEQ5z0.cjs → ThemeConfiguration-fRsktVs4.cjs} +1 -1
- package/dist/{Topbar--M5IjXGt.js → Topbar--KrJ6nJg.js} +2 -2
- package/dist/{Topbar-7bRZS3P8.cjs → Topbar-tgFkKz7R.cjs} +1 -1
- package/dist/UILibrariesPanel-2HyAEVLE.cjs +1 -0
- package/dist/{UILibrariesPanel-EaMt1AzV.js → UILibrariesPanel-sleogb55.js} +55 -56
- package/dist/{UnsplashImages-o7mUozj7.js → UnsplashImages-P7_2yEo-.js} +9 -9
- package/dist/{UnsplashImages-eq44FmxF.cjs → UnsplashImages-azP_HIqG.cjs} +1 -1
- package/dist/{UploadImages-o4teNCqv.cjs → UploadImages-nnszHoZa.cjs} +1 -1
- package/dist/{UploadImages-s52Hvpts.js → UploadImages-ovzzQW6b.js} +7 -7
- package/dist/{add-page-modal-eoOwcRKz.js → add-page-modal-SmBfx0LH.js} +4 -4
- package/dist/{add-page-modal-7FLXbRFp.cjs → add-page-modal-nDBqhemF.cjs} +1 -1
- package/dist/atoms-ZOWyNoiC.js +6 -0
- package/dist/atoms-a0H_593V.cjs +1 -0
- package/dist/{confirm-alert-rFmTdGxh.cjs → confirm-alert-75rfTsgE.cjs} +1 -1
- package/dist/{confirm-alert-o0OjZdvp.js → confirm-alert-yipdBkkj.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-OU79XN8M.js → delete-page-modal-HIul7JBc.js} +3 -3
- package/dist/{delete-page-modal-sG2uFkT0.cjs → delete-page-modal-lO-dULGW.cjs} +1 -1
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +30 -30
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -1
- package/dist/email.js +2 -2
- package/dist/empty-slot-Lsxjts7Q.js +6 -0
- package/dist/empty-slot-Sy930lX6.cjs +1 -0
- package/dist/{form--h34bK4z.js → form-cZPoXqTP.js} +5 -5
- package/dist/{form-SuV0Z9nJ.cjs → form-yq_mbR58.cjs} +1 -1
- package/dist/{index-7hLL3kv4.js → index-Vu40oRWp.js} +2 -2
- package/dist/{index-3mF2lq-B.cjs → index-q_bEEzdK.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +3 -3
- package/dist/{page-viewer-9-Dy66-a.cjs → page-viewer-3ZqrDjrz.cjs} +1 -1
- package/dist/{page-viewer-tfXRwkWz.js → page-viewer-ZOVAaE9q.js} +4 -4
- package/dist/{project-general-setting-ZjAN2VZX.js → project-general-setting-2iNlm_kN.js} +8 -8
- package/dist/{project-general-setting-ZbNwglNP.cjs → project-general-setting-IIxWGrU2.cjs} +1 -1
- package/dist/{project-seo-setting-vqWoo5Ev.cjs → project-seo-setting-46PdN9FR.cjs} +1 -1
- package/dist/{project-seo-setting-gAXZ15Wb.js → project-seo-setting-FX0cbkrO.js} +3 -3
- package/dist/{single-page-detail-ISRJ-Ebt.js → single-page-detail-4v8ojQss.js} +5 -5
- package/dist/{single-page-detail-a4nAhK0N.cjs → single-page-detail-MsBTVx9h.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -1
- package/dist/studio.js +3 -3
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +50 -50
- package/dist/{useCanvasSettings-EyxD8eas.cjs → useCanvasSettings-A7Qj0z4L.cjs} +1 -1
- package/dist/{useCanvasSettings-fsSISbZ6.js → useCanvasSettings-QH5zCmxD.js} +1 -1
- package/dist/utils-K3Zk762G.cjs +1 -0
- package/dist/{Class-6Hz2KzYb.js → utils-iMv3T4WT.js} +16 -15
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +237 -238
- package/package.json +2 -2
- package/dist/AddBlocks-HZaa1NM6.cjs +0 -1
- package/dist/CanvasArea-CTmYdaUo.cjs +0 -55
- package/dist/CanvasArea-myZvxQCj.js +0 -1199
- package/dist/Class-Zc8hpE7f.cjs +0 -1
- package/dist/Settings-UqeNroki.cjs +0 -1
- package/dist/SidePanels-DimF3tJV.cjs +0 -1
- package/dist/UILibrariesPanel-1F_Kcnkm.cjs +0 -1
- package/dist/empty-slot-ZBlsQi6m.js +0 -15
- package/dist/empty-slot-nzYOgZuS.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),t=require("lodash-es"),h=require("jotai"),E=require("react-i18next"),s=require("./ChaiBuilderEditor-AIXWnz29.cjs"),b=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),T=require("flagged"),q=require("./STRINGS-gPz7CUOk.cjs"),N=require("./atoms-a0H_593V.cjs"),k=require("./html-to-json-VPWiWWGH.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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-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-quill");require("react-hotkeys-hook");require("lucide-react");require("himalaya");const y=({block:r})=>{const[,i]=h.useAtom(N.draggedBlockAtom),{type:l,icon:c,label:d}=r,{addCoreBlock:p,addPredefinedBlock:j}=s.useAddBlock(),[o,g]=s.useSelectedBlockIds(),[,f]=s.useHighlightBlockId(),[,x]=h.useAtom(s.activePanelAtom),a=()=>{if(t.has(r,"blocks")){const m=t.isFunction(r.blocks)?r.blocks():r.blocks;j(R.syncBlocksWithDefaults(m),t.first(o))}else p(r,t.first(o));x(q.OUTLINE_KEY)},n=T.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:a,type:"button",onDragStart:m=>{m.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),m.dataTransfer.setDragImage(new Image,0,0),i(t.omit(r,["component","icon"])),setTimeout(()=>{g([]),f(null),x(q.OUTLINE_KEY)},200)},draggable:"true",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(n?"cursor-grab":"cursor-pointer"),children:[u.createElement(c||b.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:d||l})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:d||l})})]})})},B=()=>{const{t:r}=E.useTranslation(),[i,l]=u.useState(""),{addPredefinedBlock:c}=s.useAddBlock(),[d]=s.useSelectedBlockIds(),[,p]=h.useAtom(s.activePanelAtom),j=()=>{const o=k.getBlocksFromHTML(i);c([...o],t.first(d)||null),l(""),p(q.OUTLINE_KEY)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:o=>o&&o.focus(),onChange:o=>l(o.target.value),rows:12,value:i,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:i.trim()==="",onClick:()=>j(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},v=()=>{const{t:r}=E.useTranslation(),[i,l]=u.useState("core"),[c,d]=u.useState("basic"),p=R.useChaiBlocks(),[,j]=h.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),g=s.useBuilderProp("filterChaiBlock",()=>!0),f=t.filter(p,g),x=t.groupBy(f,"category"),a=t.uniq(t.map(x.core,"group"));return u.useEffect(()=>{!t.includes(a,c)&&!t.isEmpty(a)&&!t.isEmpty(c)&&d(t.first(a))},[a,c]),e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-72 flex-col overflow-hidden",children:[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:r("add_block")}),e.jsxRuntimeExports.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")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:n=>{j(""),l(n)},value:i,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),i==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:u.Children.toArray(t.map(a,n=>t.reject(t.filter(t.values(x.core),{group:n}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:n,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:n,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:n}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:u.Children.toArray(t.reject(t.filter(t.values(x.core),{group:n}),{hidden:!0}).map(m=>e.jsxRuntimeExports.jsx(y,{block:m})))})})]})}):null))})}),i==="html"&&o?e.jsxRuntimeExports.jsx(B,{}):null]})};exports.default=v;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import
|
|
3
|
-
import { has as E, isFunction as F, first as h, omit as
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { m as
|
|
2
|
+
import k, { createElement as L, useState as b, useEffect as S } from "react";
|
|
3
|
+
import { has as E, isFunction as F, first as h, omit as N, filter as g, groupBy as H, uniq as D, map as B, includes as q, isEmpty as y, reject as C, values as v } from "lodash-es";
|
|
4
|
+
import { useAtom as x } from "jotai";
|
|
5
|
+
import { useTranslation as A } from "react-i18next";
|
|
6
|
+
import { m as w, L as I, z, ag as P, ac as M, ad as O, ae as R, bk as G, bl as J, bm as K, bn as U, aq as V, ba as W, bo as Y, B as Q, bp as X, bq as Z, br as $, h as T, ai as ee, aj as te, ak as _, bf as se, b5 as oe, b6 as re, b7 as ae, b8 as le } from "./ChaiBuilderEditor-NnMEdW3k.js";
|
|
7
7
|
import { BoxIcon as ie } from "@radix-ui/react-icons";
|
|
8
8
|
import { syncBlocksWithDefaults as ce, useChaiBlocks as ne } from "@chaibuilder/runtime";
|
|
9
9
|
import { useFeature as de } from "flagged";
|
|
10
|
-
import { O as
|
|
11
|
-
import {
|
|
10
|
+
import { O as j } from "./STRINGS--j49GZJP.js";
|
|
11
|
+
import { d as me } from "./atoms-ZOWyNoiC.js";
|
|
12
|
+
import { g as pe } from "./html-to-json-Z6R2o_fA.js";
|
|
12
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
14
|
import "clsx";
|
|
14
15
|
import "react-dom";
|
|
@@ -19,9 +20,9 @@ import "./Functions-7jnEwJyw.js";
|
|
|
19
20
|
import "tailwind-merge";
|
|
20
21
|
import "@react-hookz/web";
|
|
21
22
|
import "./MODIFIERS-cBT31iqE.js";
|
|
23
|
+
import "./utils-iMv3T4WT.js";
|
|
22
24
|
import "@radix-ui/react-toggle";
|
|
23
25
|
import "class-variance-authority";
|
|
24
|
-
import "./Class-6Hz2KzYb.js";
|
|
25
26
|
import "@radix-ui/react-switch";
|
|
26
27
|
import "@radix-ui/react-slot";
|
|
27
28
|
import "@radix-ui/react-accordion";
|
|
@@ -44,101 +45,101 @@ import "react-quill";
|
|
|
44
45
|
import "react-hotkeys-hook";
|
|
45
46
|
import "lucide-react";
|
|
46
47
|
import "himalaya";
|
|
47
|
-
const
|
|
48
|
-
const { type:
|
|
49
|
-
if (E(
|
|
50
|
-
const
|
|
51
|
-
|
|
48
|
+
const he = ({ block: t }) => {
|
|
49
|
+
const [, o] = x(me), { type: a, icon: l, label: c } = t, { addCoreBlock: m, addPredefinedBlock: p } = w(), [s, u] = I(), [, f] = z(), [, n] = x(P), i = () => {
|
|
50
|
+
if (E(t, "blocks")) {
|
|
51
|
+
const d = F(t.blocks) ? t.blocks() : t.blocks;
|
|
52
|
+
p(ce(d), h(s));
|
|
52
53
|
} else
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
54
|
+
m(t, h(s));
|
|
55
|
+
n(j);
|
|
56
|
+
}, r = de("dnd");
|
|
57
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(M, { children: [
|
|
57
58
|
/* @__PURE__ */ e.jsx(O, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
58
59
|
"button",
|
|
59
60
|
{
|
|
60
|
-
onClick:
|
|
61
|
+
onClick: i,
|
|
61
62
|
type: "button",
|
|
62
|
-
onDragStart: (
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
onDragStart: (d) => {
|
|
64
|
+
d.dataTransfer.setData("text/plain", JSON.stringify(N(t, ["component", "icon"]))), d.dataTransfer.setDragImage(new Image(), 0, 0), o(N(t, ["component", "icon"])), setTimeout(() => {
|
|
65
|
+
u([]), f(null), n(j);
|
|
65
66
|
}, 200);
|
|
66
67
|
},
|
|
67
|
-
draggable:
|
|
68
|
-
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (
|
|
68
|
+
draggable: "true",
|
|
69
|
+
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (r ? "cursor-grab" : "cursor-pointer"),
|
|
69
70
|
children: [
|
|
70
|
-
L(
|
|
71
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children:
|
|
71
|
+
L(l || ie, { className: "w-4 h-4 mx-auto" }),
|
|
72
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: c || a })
|
|
72
73
|
]
|
|
73
74
|
}
|
|
74
75
|
) }),
|
|
75
|
-
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx("p", { children:
|
|
76
|
+
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx("p", { children: c || a }) })
|
|
76
77
|
] }) });
|
|
77
|
-
},
|
|
78
|
-
const { t
|
|
79
|
-
const
|
|
80
|
-
l([...
|
|
78
|
+
}, xe = () => {
|
|
79
|
+
const { t } = A(), [o, a] = b(""), { addPredefinedBlock: l } = w(), [c] = I(), [, m] = x(P), p = () => {
|
|
80
|
+
const s = pe(o);
|
|
81
|
+
l([...s], h(c) || null), a(""), m(j);
|
|
81
82
|
};
|
|
82
83
|
return /* @__PURE__ */ e.jsxs(G, { className: "border-border/0 p-0 shadow-none", children: [
|
|
83
|
-
/* @__PURE__ */ e.jsx(J, { className: "p-3", children: /* @__PURE__ */ e.jsx(K, { children:
|
|
84
|
+
/* @__PURE__ */ e.jsx(J, { className: "p-3", children: /* @__PURE__ */ e.jsx(K, { children: t("html_snippet_description") }) }),
|
|
84
85
|
/* @__PURE__ */ e.jsx(U, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
85
|
-
/* @__PURE__ */ e.jsx(V, { htmlFor: "current", className: "text-sm", children:
|
|
86
|
+
/* @__PURE__ */ e.jsx(V, { htmlFor: "current", className: "text-sm", children: t("tailwind_html_snippet") }),
|
|
86
87
|
/* @__PURE__ */ e.jsx(
|
|
87
88
|
W,
|
|
88
89
|
{
|
|
89
90
|
autoFocus: !0,
|
|
90
91
|
tabIndex: 1,
|
|
91
|
-
ref: (
|
|
92
|
-
onChange: (
|
|
92
|
+
ref: (s) => s && s.focus(),
|
|
93
|
+
onChange: (s) => a(s.target.value),
|
|
93
94
|
rows: 12,
|
|
94
95
|
value: o,
|
|
95
|
-
placeholder:
|
|
96
|
+
placeholder: t("enter_code_snippet"),
|
|
96
97
|
className: "resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"
|
|
97
98
|
}
|
|
98
99
|
)
|
|
99
100
|
] }) }),
|
|
100
101
|
/* @__PURE__ */ e.jsxs(Y, { className: "flex flex-col justify-end p-3", children: [
|
|
101
|
-
/* @__PURE__ */ e.jsx(Q, { disabled: o.trim() === "", onClick: () =>
|
|
102
|
-
/* @__PURE__ */ e.jsx(X, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(Z, { className: "text-xs font-normal leading-4", children:
|
|
102
|
+
/* @__PURE__ */ e.jsx(Q, { disabled: o.trim() === "", onClick: () => p(), size: "sm", className: "w-full", children: t("import_html") }),
|
|
103
|
+
/* @__PURE__ */ e.jsx(X, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(Z, { className: "text-xs font-normal leading-4", children: t("note_imported_html") }) })
|
|
103
104
|
] })
|
|
104
105
|
] });
|
|
105
|
-
},
|
|
106
|
-
const { t
|
|
106
|
+
}, ct = () => {
|
|
107
|
+
const { t } = A(), [o, a] = b("core"), [l, c] = b("basic"), m = ne(), [, p] = x($), s = T("importHTMLSupport", !0), u = T("filterChaiBlock", () => !0), f = g(m, u), n = H(f, "category"), i = D(B(n.core, "group"));
|
|
107
108
|
return S(() => {
|
|
108
|
-
!
|
|
109
|
-
}, [
|
|
109
|
+
!q(i, l) && !y(i) && !y(l) && c(h(i));
|
|
110
|
+
}, [i, l]), /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-72 flex-col overflow-hidden", children: [
|
|
110
111
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
111
|
-
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children:
|
|
112
|
-
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children:
|
|
112
|
+
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: t("add_block") }),
|
|
113
|
+
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: t(o === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
113
114
|
] }),
|
|
114
115
|
/* @__PURE__ */ e.jsx(
|
|
115
116
|
ee,
|
|
116
117
|
{
|
|
117
118
|
onValueChange: (r) => {
|
|
118
|
-
|
|
119
|
+
p(""), a(r);
|
|
119
120
|
},
|
|
120
121
|
value: o,
|
|
121
122
|
className: "h-max",
|
|
122
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
123
|
-
/* @__PURE__ */ e.jsx(
|
|
124
|
-
|
|
123
|
+
children: /* @__PURE__ */ e.jsxs(te, { className: "grid w-full " + (s ? "grid-cols-2" : "grid-cols-1"), children: [
|
|
124
|
+
/* @__PURE__ */ e.jsx(_, { value: "core", children: t("Blocks") }),
|
|
125
|
+
s ? /* @__PURE__ */ e.jsx(_, { value: "html", children: t("import") }) : null
|
|
125
126
|
] })
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
o === "core" && /* @__PURE__ */ e.jsx(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
(r) => C(
|
|
132
|
-
/* @__PURE__ */ e.jsx(
|
|
133
|
-
/* @__PURE__ */ e.jsx(
|
|
134
|
-
C(
|
|
129
|
+
o === "core" && /* @__PURE__ */ e.jsx(se, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: k.Children.toArray(
|
|
130
|
+
B(
|
|
131
|
+
i,
|
|
132
|
+
(r) => C(g(v(n.core), { group: r }), { hidden: !0 }).length ? /* @__PURE__ */ e.jsx(oe, { type: "single", value: r, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(re, { value: r, children: [
|
|
133
|
+
/* @__PURE__ */ e.jsx(ae, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: r }),
|
|
134
|
+
/* @__PURE__ */ e.jsx(le, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: k.Children.toArray(
|
|
135
|
+
C(g(v(n.core), { group: r }), { hidden: !0 }).map((d) => /* @__PURE__ */ e.jsx(he, { block: d }))
|
|
135
136
|
) }) })
|
|
136
137
|
] }) }) : null
|
|
137
138
|
)
|
|
138
139
|
) }) }),
|
|
139
|
-
o === "html" &&
|
|
140
|
+
o === "html" && s ? /* @__PURE__ */ e.jsx(xe, {}) : null
|
|
140
141
|
] });
|
|
141
142
|
};
|
|
142
143
|
export {
|
|
143
|
-
|
|
144
|
+
ct as default
|
|
144
145
|
};
|