@chaibuilder/sdk 2.6.0 → 2.6.2

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "2.6.0",
8
+ "version": "2.6.2",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",
@@ -128,7 +128,6 @@
128
128
  "lodash": "^4.17.21",
129
129
  "lodash-es": "4.17.21",
130
130
  "lucide-react": "0.539.0",
131
- "re-resizable": "6.11.2",
132
131
  "react-arborist": "^3.4.3",
133
132
  "react-autosuggest": "10.1.0",
134
133
  "react-colorful": "5.6.1",
@@ -1,72 +0,0 @@
1
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useCodeEditor as k, useSelectedBlockIds as C, useUpdateBlocksProps as v, useUpdateBlocksPropsRealtime as g } from "./core.js";
3
- import "lodash-es";
4
- import "clsx";
5
- import "tailwind-merge";
6
- import "tree-model";
7
- import { useState as d, useCallback as N, useEffect as w } from "react";
8
- import "jotai";
9
- import "@chaibuilder/runtime";
10
- import "sonner";
11
- import { useTranslation as y } from "react-i18next";
12
- import { v as T } from "./toggle-DXTcRcvD.js";
13
- import { Cross2Icon as B } from "@radix-ui/react-icons";
14
- import { useThrottledCallback as E } from "@react-hookz/web";
15
- const m = (s) => {
16
- const o = document.createElement("div");
17
- return o.innerHTML = s, o.innerHTML;
18
- };
19
- function G() {
20
- const { t: s } = y(), [o, u] = d(!1), [n, p] = d(""), [e, a] = k(), [c] = C(), f = v(), h = g(), x = E(
21
- (l) => {
22
- const i = m(l);
23
- h([e.blockId], { [e.blockProp]: i });
24
- },
25
- [],
26
- 300
27
- ), b = N(() => {
28
- if (o) {
29
- const l = m(n);
30
- f([e.blockId], { [e.blockProp]: l });
31
- }
32
- }, [o, n]);
33
- return w(() => {
34
- c.includes(e == null ? void 0 : e.blockId) || (b(), a(null));
35
- }, [c]), /* @__PURE__ */ r("div", { className: "h-full rounded-t-lg border-t-4 border-black bg-black text-white", children: [
36
- /* @__PURE__ */ t("button", { onClick: () => {
37
- a(null);
38
- }, className: "fixed inset-0 z-[100000] cursor-default bg-gray-400/20" }),
39
- /* @__PURE__ */ r("div", { className: "relative z-[100001] h-full w-full flex-col gap-y-1", children: [
40
- /* @__PURE__ */ r("div", { className: "-mt-1 flex items-center justify-between px-2 py-2", children: [
41
- /* @__PURE__ */ r("h3", { className: "space-x-3 text-sm font-semibold", children: [
42
- /* @__PURE__ */ t("span", { children: s("HTML Code Editor |") }),
43
- /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: s("Scripts will be only executed in preview and live mode.") })
44
- ] }),
45
- /* @__PURE__ */ t("div", { className: "flex gap-x-2", children: /* @__PURE__ */ t(
46
- T,
47
- {
48
- onClick: () => a(null),
49
- size: "sm",
50
- variant: "destructive",
51
- className: "h-6 w-fit",
52
- children: /* @__PURE__ */ t(B, {})
53
- }
54
- ) })
55
- ] }),
56
- /* @__PURE__ */ t(
57
- "textarea",
58
- {
59
- className: "h-full w-full bg-black p-2 font-mono text-xs text-white/90",
60
- value: n || e.initialCode,
61
- onChange: (l) => {
62
- const i = l.target.value;
63
- u(!0), p(i), x(i);
64
- }
65
- }
66
- )
67
- ] })
68
- ] });
69
- }
70
- export {
71
- G as default
72
- };
@@ -1 +0,0 @@
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;