@chaibuilder/sdk 2.0.7 → 2.0.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/{CodeEditor-SZJ1H4vl.cjs → CodeEditor-BVHvdz8H.cjs} +1 -1
- package/dist/{CodeEditor-C-jeR5bt.js → CodeEditor-ZtRSywKI.js} +1 -1
- package/dist/{Topbar-DZ2jHLv7.js → Topbar-CX5hnmQJ.js} +1 -1
- package/dist/{Topbar-DSfx67NF.cjs → Topbar-D7QTF9G-.cjs} +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +696 -550
- package/dist/tooltip-BMhhYJb6.cjs +1 -0
- package/dist/{tooltip-PKiP886L.js → tooltip-VMv3Eoxb.js} +243 -219
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +10 -0
- package/dist/ui.js +200 -182
- package/package.json +5 -1
- package/dist/tooltip-1Uu2avkZ.cjs +0 -1
|
@@ -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-
|
|
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-BMhhYJb6.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-
|
|
6
|
+
import { B as w } from "./tooltip-VMv3Eoxb.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");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense as n } from "react";
|
|
3
|
-
import { S as r } from "./tooltip-
|
|
3
|
+
import { S as r } from "./tooltip-VMv3Eoxb.js";
|
|
4
4
|
import "react-i18next";
|
|
5
5
|
import { useBuilderProp as a } from "./core.js";
|
|
6
6
|
const x = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),r=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),r=require("./tooltip-BMhhYJb6.cjs");require("react-i18next");const c=require("./core.cjs"),i=()=>{const l=c.useBuilderProp("topBarComponents.left",[]),o=c.useBuilderProp("topBarComponents.center",[]),a=c.useBuilderProp("topBarComponents.right",[]);return e.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("div",{className:"flex items-center space-x-2 font-bold",children:l.map((s,t)=>e.jsx(n.Suspense,{fallback:e.jsx(r.Skeleton,{className:"h-10"}),children:e.jsx(s,{})},`left-${t}`))})}),e.jsx("div",{className:"flex items-center space-x-2",children:o.map((s,t)=>e.jsx(n.Suspense,{fallback:e.jsx(r.Skeleton,{className:"h-10"}),children:e.jsx(s,{})},`center-${t}`))}),e.jsx("div",{className:"flex items-center space-x-1",children:a.map((s,t)=>e.jsx(n.Suspense,{fallback:e.jsx(r.Skeleton,{className:"h-10"}),children:e.jsx(s,{})},`right-${t}`))})]})};exports.default=i;
|