@chaibuilder/sdk 2.1.3 → 2.1.5

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@radix-ui/react-icons"),v=require("@react-hookz/web"),n=require("react"),j=require("react-i18next"),g=require("./tooltip-CUA6Xg5r.cjs"),a=require("./core.cjs"),u=o=>{const s=document.createElement("div");return s.innerHTML=o,s.innerHTML};function y(){const{t:o}=j.useTranslation(),[s,x]=n.useState(!1),[i,m]=n.useState(""),[t,r]=a.useCodeEditor(),[d]=a.useSelectedBlockIds(),b=a.useUpdateBlocksProps(),f=a.useUpdateBlocksPropsRealtime(),p=v.useThrottledCallback(l=>{const c=u(l);f([t.blockId],{[t.blockProp]:c})},[],300),h=n.useCallback(()=>{if(s){const l=u(i);b([t.blockId],{[t.blockProp]:l})}},[s,i]);n.useEffect(()=>{d.includes(t==null?void 0:t.blockId)||(h(),r(null))},[d]);const k=()=>{r(null)};return e.jsxs("div",{className:"h-full text-white bg-black border-t-4 border-black rounded-t-lg",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:"flex items-center justify-between px-2 py-2 -mt-1",children:[e.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:o("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]}),e.jsx("div",{className:"flex gap-x-2",children:e.jsx(g.Button,{onClick:()=>r(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsx(C.Cross2Icon,{})})})]}),e.jsx("textarea",{className:"w-full h-full p-2 font-mono text-xs bg-black text-white/90",value:i||t.initialCode,onChange:l=>{const c=l.target.value;x(!0),m(c),p(c)}})]})]})}exports.default=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@radix-ui/react-icons"),v=require("@react-hookz/web"),n=require("react"),j=require("react-i18next"),g=require("./tooltip-BF2E5xPf.cjs"),a=require("./core.cjs"),u=o=>{const s=document.createElement("div");return s.innerHTML=o,s.innerHTML};function y(){const{t:o}=j.useTranslation(),[s,x]=n.useState(!1),[i,m]=n.useState(""),[t,r]=a.useCodeEditor(),[d]=a.useSelectedBlockIds(),b=a.useUpdateBlocksProps(),f=a.useUpdateBlocksPropsRealtime(),p=v.useThrottledCallback(l=>{const c=u(l);f([t.blockId],{[t.blockProp]:c})},[],300),h=n.useCallback(()=>{if(s){const l=u(i);b([t.blockId],{[t.blockProp]:l})}},[s,i]);n.useEffect(()=>{d.includes(t==null?void 0:t.blockId)||(h(),r(null))},[d]);const k=()=>{r(null)};return e.jsxs("div",{className:"h-full text-white bg-black border-t-4 border-black rounded-t-lg",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:"flex items-center justify-between px-2 py-2 -mt-1",children:[e.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:o("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]}),e.jsx("div",{className:"flex gap-x-2",children:e.jsx(g.Button,{onClick:()=>r(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsx(C.Cross2Icon,{})})})]}),e.jsx("textarea",{className:"w-full h-full p-2 font-mono text-xs bg-black text-white/90",value:i||t.initialCode,onChange:l=>{const c=l.target.value;x(!0),m(c),p(c)}})]})]})}exports.default=y;
@@ -3,7 +3,7 @@ import { Cross2Icon as k } from "@radix-ui/react-icons";
3
3
  import { useThrottledCallback as C } from "@react-hookz/web";
4
4
  import { useState as d, useCallback as v, useEffect as g } from "react";
5
5
  import { useTranslation as N } from "react-i18next";
6
- import { B as w } from "./tooltip-BU2vOhlU.js";
6
+ import { B as w } from "./tooltip-DGVZAvLU.js";
7
7
  import { useCodeEditor as y, useSelectedBlockIds as T, useUpdateBlocksProps as B, useUpdateBlocksPropsRealtime as E } from "./core.js";
8
8
  const u = (o) => {
9
9
  const l = document.createElement("div");