@chaibuilder/sdk 2.5.8 → 2.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{code-editor-0HrsuGAE.js → code-editor-CAnkmeVK.js} +1 -1
- package/dist/{code-editor-67qfXwGU.cjs → code-editor-D5TOcelm.cjs} +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.d.ts +0 -2
- package/dist/core.js +747 -722
- package/dist/{css-import-modal-CcUf6F6T.js → css-import-modal-Ds-qmte_.js} +99 -90
- package/dist/{css-import-modal-CdOK43Be.cjs → css-import-modal-w1WZrKpm.cjs} +2 -2
- package/dist/{toggle-BgZfmuec.cjs → toggle-CCqv4Cah.cjs} +1 -1
- package/dist/{toggle-CyXEVUOu.js → toggle-DXTcRcvD.js} +60 -60
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +123 -119
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ import "jotai";
|
|
|
9
9
|
import "@chaibuilder/runtime";
|
|
10
10
|
import "sonner";
|
|
11
11
|
import { useTranslation as y } from "react-i18next";
|
|
12
|
-
import { v as T } from "./toggle-
|
|
12
|
+
import { v as T } from "./toggle-DXTcRcvD.js";
|
|
13
13
|
import { Cross2Icon as B } from "@radix-ui/react-icons";
|
|
14
14
|
import { useThrottledCallback as E } from "@react-hookz/web";
|
|
15
15
|
const m = (s) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./core.cjs");require("lodash-es");require("clsx");require("tailwind-merge");require("tree-model");const n=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const C=require("react-i18next"),v=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./core.cjs");require("lodash-es");require("clsx");require("tailwind-merge");require("tree-model");const n=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const C=require("react-i18next"),v=require("./toggle-CCqv4Cah.cjs"),g=require("@radix-ui/react-icons"),j=require("@react-hookz/web"),d=r=>{const s=document.createElement("div");return s.innerHTML=r,s.innerHTML};function q(){const{t:r}=C.useTranslation(),[s,x]=n.useState(!1),[i,m]=n.useState(""),[t,a]=c.useCodeEditor(),[u]=c.useSelectedBlockIds(),b=c.useUpdateBlocksProps(),f=c.useUpdateBlocksPropsRealtime(),h=j.useThrottledCallback(l=>{const o=d(l);f([t.blockId],{[t.blockProp]:o})},[],300),p=n.useCallback(()=>{if(s){const l=d(i);b([t.blockId],{[t.blockProp]:l})}},[s,i]);n.useEffect(()=>{u.includes(t==null?void 0:t.blockId)||(p(),a(null))},[u]);const k=()=>{a(null)};return e.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsx("button",{onClick:k,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:r("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:r("Scripts will be only executed in preview and live mode.")})]}),e.jsx("div",{className:"flex gap-x-2",children:e.jsx(v.Button,{onClick:()=>a(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsx(g.Cross2Icon,{})})})]}),e.jsx("textarea",{className:"h-full w-full bg-black p-2 font-mono text-xs text-white/90",value:i||t.initialCode,onChange:l=>{const o=l.target.value;x(!0),m(o),h(o)}})]})]})}exports.default=q;
|