@chaibuilder/sdk 2.0.0-beta.3 → 2.0.0-beta.31
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/ChaiThemeFn--DgGggh_.js +190 -0
- package/dist/ChaiThemeFn-bugxb1Cl.cjs +13 -0
- package/dist/{CodeEditor-0eH8iZVR.js → CodeEditor-4lhmWkV8.js} +18 -19
- package/dist/CodeEditor-TiCZr6Ta.cjs +1 -0
- package/dist/STRINGS-26RPxXyi.cjs +1 -0
- package/dist/STRINGS-BnWT5XcX.js +5 -0
- package/dist/Topbar-Rar8liE-.cjs +1 -0
- package/dist/Topbar-iARshVmF.js +72 -0
- package/dist/{context-menu-I8woggB3.js → context-menu-EDKTnqIV.js} +65 -65
- package/dist/core.cjs +61 -1
- package/dist/core.d.ts +89 -53
- package/dist/core.js +8829 -106
- package/dist/plugin-4xaTkTNB.cjs +1 -0
- package/dist/plugin-GuIj4Ul0.js +24 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +34 -16
- package/dist/render.js +119 -121
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -20
- package/dist/style.css +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +26 -25
- package/dist/tailwind.js +2 -2
- package/dist/ui.js +2 -2
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +1279 -684
- package/package.json +6 -9
- package/dist/CodeEditor-11MpHO6f.cjs +0 -1
- package/dist/STRINGS-Xxstm-7I.js +0 -7
- package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
- package/dist/Topbar-mYNWDS80.js +0 -160
- package/dist/Topbar-wetkUwFe.cjs +0 -1
- package/dist/controls-lEwMTdPQ.js +0 -234
- package/dist/controls-p9IwFnPx.cjs +0 -1
- package/dist/index-ElguMY6B.js +0 -8540
- package/dist/index-kmPTldAW.cjs +0 -63
- package/dist/plugin-UiUFs2fK.js +0 -44
- package/dist/plugin-f6SDZ_Or.js +0 -108
- package/dist/plugin-jum1MjXp.cjs +0 -1
- package/dist/plugin-xOpS-UNV.cjs +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { isEmpty as f, uniq as p, keys as y, flatten as b } from "lodash-es";
|
|
2
|
+
function _(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
const j = {
|
|
6
|
+
fontFamily: {
|
|
7
|
+
"font-heading": "Inter",
|
|
8
|
+
"font-body": "Inter"
|
|
9
|
+
},
|
|
10
|
+
borderRadius: "10px",
|
|
11
|
+
colors: [
|
|
12
|
+
{
|
|
13
|
+
group: "Body",
|
|
14
|
+
items: {
|
|
15
|
+
background: ["#FFFFFF", "#121212"],
|
|
16
|
+
foreground: ["#121212", "#FFFFFF"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
group: "Primary",
|
|
21
|
+
items: {
|
|
22
|
+
primary: ["#2563EB", "#3B82F6"],
|
|
23
|
+
"primary-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
group: "Secondary",
|
|
28
|
+
items: {
|
|
29
|
+
secondary: ["#F3F4F6", "#374151"],
|
|
30
|
+
"secondary-foreground": ["#1F2937", "#F9FAFB"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
group: "Border, Input & Ring",
|
|
35
|
+
items: {
|
|
36
|
+
border: ["#E5E7EB", "#374151"],
|
|
37
|
+
input: ["#E5E7EB", "#374151"],
|
|
38
|
+
ring: ["#2563EB", "#3B82F6"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
group: "Card",
|
|
43
|
+
items: {
|
|
44
|
+
card: ["#FFFFFF", "#1F2937"],
|
|
45
|
+
"card-foreground": ["#121212", "#FFFFFF"]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
group: "Popover",
|
|
50
|
+
items: {
|
|
51
|
+
popover: ["#FFFFFF", "#1F2937"],
|
|
52
|
+
"popover-foreground": ["#121212", "#FFFFFF"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
group: "Muted",
|
|
57
|
+
items: {
|
|
58
|
+
muted: ["#F3F4F6", "#374151"],
|
|
59
|
+
"muted-foreground": ["#6B7280", "#9CA3AF"]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
group: "Accent",
|
|
64
|
+
items: {
|
|
65
|
+
accent: ["#F3F4F6", "#374151"],
|
|
66
|
+
"accent-foreground": ["#1F2937", "#FFFFFF"]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
group: "Destructive",
|
|
71
|
+
items: {
|
|
72
|
+
destructive: ["#DC2626", "#EF4444"],
|
|
73
|
+
"destructive-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
var g = {}, m = {};
|
|
79
|
+
(function(e) {
|
|
80
|
+
Object.defineProperty(e, "__esModule", {
|
|
81
|
+
value: !0
|
|
82
|
+
}), Object.defineProperty(e, "default", {
|
|
83
|
+
enumerable: !0,
|
|
84
|
+
get: function() {
|
|
85
|
+
return t;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
function o(r, n) {
|
|
89
|
+
return {
|
|
90
|
+
handler: r,
|
|
91
|
+
config: n
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
o.withOptions = function(r, n = () => ({})) {
|
|
95
|
+
const s = function(a) {
|
|
96
|
+
return {
|
|
97
|
+
__options: a,
|
|
98
|
+
handler: r(a),
|
|
99
|
+
config: n(a)
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
return s.__isOptionsFunction = !0, s.__pluginFunction = r, s.__configFunction = n, s;
|
|
103
|
+
};
|
|
104
|
+
const t = o;
|
|
105
|
+
})(m);
|
|
106
|
+
(function(e) {
|
|
107
|
+
Object.defineProperty(e, "__esModule", {
|
|
108
|
+
value: !0
|
|
109
|
+
}), Object.defineProperty(e, "default", {
|
|
110
|
+
enumerable: !0,
|
|
111
|
+
get: function() {
|
|
112
|
+
return r;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const o = /* @__PURE__ */ t(m);
|
|
116
|
+
function t(n) {
|
|
117
|
+
return n && n.__esModule ? n : {
|
|
118
|
+
default: n
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const r = o.default;
|
|
122
|
+
})(g);
|
|
123
|
+
let l = g;
|
|
124
|
+
var $ = (l.__esModule ? l : { default: l }).default;
|
|
125
|
+
const M = /* @__PURE__ */ _($), O = (e) => ({
|
|
126
|
+
fontFamily: e.fontFamily ? y(e.fontFamily).reduce(
|
|
127
|
+
(t, r) => ({
|
|
128
|
+
...t,
|
|
129
|
+
[r.replace("font-", "")]: `var(--${r})`
|
|
130
|
+
}),
|
|
131
|
+
{}
|
|
132
|
+
) : {},
|
|
133
|
+
borderRadius: e.borderRadius ? {
|
|
134
|
+
lg: "var(--radius)",
|
|
135
|
+
md: "calc(var(--radius) - 2px)",
|
|
136
|
+
sm: "calc(var(--radius) - 4px)"
|
|
137
|
+
} : {},
|
|
138
|
+
colors: e.colors ? b(e.colors.map((t) => Object.entries(t.items))).reduce(
|
|
139
|
+
(t, [r]) => ({ ...t, [r]: `hsl(var(--${r}))` }),
|
|
140
|
+
{}
|
|
141
|
+
) : {}
|
|
142
|
+
});
|
|
143
|
+
function d(e) {
|
|
144
|
+
const o = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
145
|
+
let t = parseInt(o[1], 16), r = parseInt(o[2], 16), n = parseInt(o[3], 16);
|
|
146
|
+
t /= 255, r /= 255, n /= 255;
|
|
147
|
+
const s = Math.max(t, r, n), a = Math.min(t, r, n);
|
|
148
|
+
let u, i;
|
|
149
|
+
const c = (s + a) / 2;
|
|
150
|
+
if (s == a)
|
|
151
|
+
u = i = 0;
|
|
152
|
+
else {
|
|
153
|
+
const F = s - a;
|
|
154
|
+
switch (i = c > 0.5 ? F / (2 - s - a) : F / (s + a), s) {
|
|
155
|
+
case t:
|
|
156
|
+
u = (r - n) / F + (r < n ? 6 : 0);
|
|
157
|
+
break;
|
|
158
|
+
case r:
|
|
159
|
+
u = (n - t) / F + 2;
|
|
160
|
+
break;
|
|
161
|
+
case n:
|
|
162
|
+
u = (t - r) / F + 4;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
u /= 6;
|
|
166
|
+
}
|
|
167
|
+
return `${Math.round(u * 360)} ${Math.round(i * 100)}% ${Math.round(c * 100)}%`;
|
|
168
|
+
}
|
|
169
|
+
const P = (e) => `:root {
|
|
170
|
+
${e.fontFamily && Object.entries(e.fontFamily).map(([o, t]) => `--font-${o}: "${t}";`).join(`
|
|
171
|
+
`)}
|
|
172
|
+
${e.borderRadius && `--radius: ${e.borderRadius};`}
|
|
173
|
+
${e.colors && Object.entries(e.colors).map(([o, t]) => `--${o}: ${d(t[0])};`).join(`
|
|
174
|
+
`)}
|
|
175
|
+
}
|
|
176
|
+
.dark {
|
|
177
|
+
${e.colors && Object.entries(e.colors).map(([o, t]) => `--${o}: ${d(t[1])};`).join(`
|
|
178
|
+
`)}
|
|
179
|
+
}`, k = (e) => f(e.fontFamily) ? "" : p(Object.entries(e.fontFamily).map(([, t]) => t)).map((t) => `<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}&display=swap`}">`).join(`
|
|
180
|
+
`), E = (e) => f(e.fontFamily) ? "" : p(Object.entries(e.fontFamily).map(([, t]) => t)).map((t) => `@import url("${`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}&display=swap`}");`).join(`
|
|
181
|
+
`);
|
|
182
|
+
export {
|
|
183
|
+
k as a,
|
|
184
|
+
P as b,
|
|
185
|
+
E as c,
|
|
186
|
+
j as d,
|
|
187
|
+
_ as e,
|
|
188
|
+
O as g,
|
|
189
|
+
M as p
|
|
190
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";const F=require("lodash-es");function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const y={fontFamily:{"font-heading":"Inter","font-body":"Inter"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]};var g={},m={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});function n(r,o){return{handler:r,config:o}}n.withOptions=function(r,o=()=>({})){const s=function(u){return{__options:u,handler:r(u),config:o(u)}};return s.__isOptionsFunction=!0,s.__pluginFunction=r,s.__configFunction=o,s};const t=n})(m);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const n=t(m);function t(o){return o&&o.__esModule?o:{default:o}}const r=n.default})(g);let c=g;var b=(c.__esModule?c:{default:c}).default;const _=p(b),$=e=>({fontFamily:e.fontFamily?F.keys(e.fontFamily).reduce((t,r)=>({...t,[r.replace("font-","")]:`var(--${r})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?F.flatten(e.colors.map(t=>Object.entries(t.items))).reduce((t,[r])=>({...t,[r]:`hsl(var(--${r}))`}),{}):{}});function f(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let t=parseInt(n[1],16),r=parseInt(n[2],16),o=parseInt(n[3],16);t/=255,r/=255,o/=255;const s=Math.max(t,r,o),u=Math.min(t,r,o);let a,l;const d=(s+u)/2;if(s==u)a=l=0;else{const i=s-u;switch(l=d>.5?i/(2-s-u):i/(s+u),s){case t:a=(r-o)/i+(r<o?6:0);break;case r:a=(o-t)/i+2;break;case o:a=(t-r)/i+4;break}a/=6}return`${Math.round(a*360)} ${Math.round(l*100)}% ${Math.round(d*100)}%`}const v=e=>`:root {
|
|
2
|
+
${e.fontFamily&&Object.entries(e.fontFamily).map(([n,t])=>`--font-${n}: "${t}";`).join(`
|
|
3
|
+
`)}
|
|
4
|
+
${e.borderRadius&&`--radius: ${e.borderRadius};`}
|
|
5
|
+
${e.colors&&Object.entries(e.colors).map(([n,t])=>`--${n}: ${f(t[0])};`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
}
|
|
8
|
+
.dark {
|
|
9
|
+
${e.colors&&Object.entries(e.colors).map(([n,t])=>`--${n}: ${f(t[1])};`).join(`
|
|
10
|
+
`)}
|
|
11
|
+
}`,j=e=>F.isEmpty(e.fontFamily)?"":F.uniq(Object.entries(e.fontFamily).map(([,t])=>t)).map(t=>`<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}&display=swap`}">`).join(`
|
|
12
|
+
`),E=e=>F.isEmpty(e.fontFamily)?"":F.uniq(Object.entries(e.fontFamily).map(([,t])=>t)).map(t=>`@import url("${`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}&display=swap`}");`).join(`
|
|
13
|
+
`);exports.defaultThemeOptions=y;exports.getChaiThemeCssVariables=v;exports.getChaiThemeOptions=$;exports.getDefaultExportFromCjs=p;exports.getThemeFontsCSSImport=E;exports.getThemeFontsLinkMarkup=j;exports.plugin=_;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import k from "@monaco-editor/react";
|
|
3
|
-
import { B as C } from "./context-menu-
|
|
3
|
+
import { B as C } from "./context-menu-EDKTnqIV.js";
|
|
4
4
|
import { useTranslation as j } from "react-i18next";
|
|
5
|
-
import { useState as
|
|
6
|
-
import {
|
|
5
|
+
import { useState as p, useCallback as v, useEffect as g } from "react";
|
|
6
|
+
import { useCodeEditor as y, useSelectedBlockIds as N, useUpdateBlocksProps as T, useUpdateBlocksPropsRealtime as E } from "./core.js";
|
|
7
7
|
import { Cross2Icon as w } from "@radix-ui/react-icons";
|
|
8
8
|
import { useThrottledCallback as B } from "@react-hookz/web";
|
|
9
9
|
import "@radix-ui/react-switch";
|
|
@@ -27,11 +27,10 @@ import "tailwind-merge";
|
|
|
27
27
|
import "lodash-es";
|
|
28
28
|
import "jotai";
|
|
29
29
|
import "./iconBase-Ief2hJUZ.js";
|
|
30
|
-
import "
|
|
31
|
-
import "./plugin-f6SDZ_Or.js";
|
|
30
|
+
import "./ChaiThemeFn--DgGggh_.js";
|
|
32
31
|
import "tree-model";
|
|
32
|
+
import "@chaibuilder/runtime";
|
|
33
33
|
import "react-quill";
|
|
34
|
-
import "./STRINGS-Xxstm-7I.js";
|
|
35
34
|
import "flagged";
|
|
36
35
|
import "react-hotkeys-hook";
|
|
37
36
|
import "@floating-ui/dom";
|
|
@@ -39,43 +38,43 @@ import "@floating-ui/react-dom";
|
|
|
39
38
|
import "@tailwindcss/typography";
|
|
40
39
|
import "@tailwindcss/forms";
|
|
41
40
|
import "@tailwindcss/aspect-ratio";
|
|
41
|
+
import "./STRINGS-BnWT5XcX.js";
|
|
42
42
|
import "react-wrap-balancer";
|
|
43
|
+
import "lucide-react";
|
|
43
44
|
import "react-dom";
|
|
44
45
|
import "prop-types";
|
|
45
46
|
import "react-error-boundary";
|
|
46
47
|
import "re-resizable";
|
|
47
|
-
import "lucide-react";
|
|
48
|
-
import "@rjsf/validator-ajv8";
|
|
49
|
-
import "@rjsf/core";
|
|
50
|
-
import "./controls-lEwMTdPQ.js";
|
|
51
48
|
import "react-arborist";
|
|
52
49
|
import "himalaya";
|
|
50
|
+
import "@rjsf/core";
|
|
51
|
+
import "@rjsf/validator-ajv8";
|
|
53
52
|
import "react-icons-picker";
|
|
54
53
|
import "react-autosuggest";
|
|
55
54
|
import "fuse.js";
|
|
56
55
|
import "i18next";
|
|
57
56
|
import "framer-motion";
|
|
58
|
-
const
|
|
57
|
+
const n = (r) => {
|
|
59
58
|
const i = document.createElement("div");
|
|
60
59
|
return i.innerHTML = r, i.innerHTML;
|
|
61
60
|
};
|
|
62
|
-
function
|
|
63
|
-
const { t: r } = j(), [i,
|
|
61
|
+
function Mt() {
|
|
62
|
+
const { t: r } = j(), [i, a] = p(!1), [m, c] = p(""), [o, s] = y(), [l] = N(), d = T(), u = E(), f = B(
|
|
64
63
|
(e) => {
|
|
65
|
-
const b =
|
|
64
|
+
const b = n(e);
|
|
66
65
|
u([o.blockId], { [o.blockProp]: b });
|
|
67
66
|
},
|
|
68
67
|
[],
|
|
69
68
|
300
|
|
70
69
|
), x = v(() => {
|
|
71
70
|
if (i) {
|
|
72
|
-
const e =
|
|
71
|
+
const e = n(m);
|
|
73
72
|
d([o.blockId], { [o.blockProp]: e });
|
|
74
73
|
}
|
|
75
74
|
}, [i, m]);
|
|
76
75
|
g(() => {
|
|
77
|
-
|
|
78
|
-
}, [
|
|
76
|
+
l.includes(o == null ? void 0 : o.blockId) || (x(), s(null));
|
|
77
|
+
}, [l]);
|
|
79
78
|
const h = () => {
|
|
80
79
|
s(null);
|
|
81
80
|
};
|
|
@@ -105,7 +104,7 @@ function Pt() {
|
|
|
105
104
|
e.setValue(o.initialCode);
|
|
106
105
|
},
|
|
107
106
|
onChange: (e) => {
|
|
108
|
-
|
|
107
|
+
a(!0), c(e), f(e);
|
|
109
108
|
},
|
|
110
109
|
height: "100%",
|
|
111
110
|
defaultLanguage: "html",
|
|
@@ -122,5 +121,5 @@ function Pt() {
|
|
|
122
121
|
] });
|
|
123
122
|
}
|
|
124
123
|
export {
|
|
125
|
-
|
|
124
|
+
Mt as default
|
|
126
125
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),b=require("@monaco-editor/react"),k=require("./context-menu-0lRey9QY.cjs"),C=require("react-i18next"),u=require("react"),n=require("./core.cjs"),E=require("@radix-ui/react-icons"),R=require("@react-hookz/web");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("lodash-es");require("jotai");require("./iconBase-aZzpqff_.cjs");require("./ChaiThemeFn-bugxb1Cl.cjs");require("tree-model");require("@chaibuilder/runtime");require("react-quill");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("./STRINGS-26RPxXyi.cjs");require("react-wrap-balancer");require("lucide-react");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("react-arborist");require("himalaya");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const a=s=>{const i=document.createElement("div");return i.innerHTML=s,i.innerHTML};function g(){const{t:s}=C.useTranslation(),[i,d]=u.useState(!1),[l,q]=u.useState(""),[r,o]=n.useCodeEditor(),[c]=n.useSelectedBlockIds(),x=n.useUpdateBlocksProps(),m=n.useUpdateBlocksPropsRealtime(),p=R.useThrottledCallback(t=>{const h=a(t);m([r.blockId],{[r.blockProp]:h})},[],300),j=u.useCallback(()=>{if(i){const t=a(l);x([r.blockId],{[r.blockProp]:t})}},[i,l]);u.useEffect(()=>{c.includes(r==null?void 0:r.blockId)||(j(),o(null))},[c]);const f=()=>{o(null)};return e.jsxRuntimeExports.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsxRuntimeExports.jsx("button",{onClick:f,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxRuntimeExports.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsxRuntimeExports.jsx("span",{children:s("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:s("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(k.Button,{onClick:()=>o(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(E.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(b,{onMount:t=>{t.setValue(r.initialCode)},onChange:t=>{d(!0),q(t),p(t)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const _="#styles:",E="__ADD_BLOCK_INTERNAL_ROOT";exports.ROOT_TEMP_KEY=E;exports.STYLES_KEY=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),r=require("react"),s=require("./context-menu-0lRey9QY.cjs");require("react-i18next");const u=require("./core.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("lodash-es");require("jotai");require("./iconBase-aZzpqff_.cjs");require("./ChaiThemeFn-bugxb1Cl.cjs");require("@react-hookz/web");require("tree-model");require("@chaibuilder/runtime");require("react-quill");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("./STRINGS-26RPxXyi.cjs");require("react-wrap-balancer");require("lucide-react");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("react-arborist");require("himalaya");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const q=()=>{const t=u.useBuilderProp("topBarComponents.left",[]),n=u.useBuilderProp("topBarComponents.center",[]),o=u.useBuilderProp("topBarComponents.right",[]);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(t.map(i=>e.jsxRuntimeExports.jsx(r.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(n.map(i=>e.jsxRuntimeExports.jsx(r.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:r.Children.toArray(o.map(i=>e.jsxRuntimeExports.jsx(r.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))})]})};exports.default=q;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import o, { Suspense as m } from "react";
|
|
3
|
+
import { S as i } from "./context-menu-EDKTnqIV.js";
|
|
4
|
+
import "react-i18next";
|
|
5
|
+
import { useBuilderProp as p } from "./core.js";
|
|
6
|
+
import "@radix-ui/react-switch";
|
|
7
|
+
import "@radix-ui/react-accordion";
|
|
8
|
+
import "@radix-ui/react-icons";
|
|
9
|
+
import "class-variance-authority";
|
|
10
|
+
import "@radix-ui/react-alert-dialog";
|
|
11
|
+
import "@radix-ui/react-slot";
|
|
12
|
+
import "@radix-ui/react-dialog";
|
|
13
|
+
import "@radix-ui/react-label";
|
|
14
|
+
import "@radix-ui/react-scroll-area";
|
|
15
|
+
import "@radix-ui/react-tabs";
|
|
16
|
+
import "@radix-ui/react-tooltip";
|
|
17
|
+
import "@radix-ui/react-popover";
|
|
18
|
+
import "@radix-ui/react-hover-card";
|
|
19
|
+
import "@radix-ui/react-dropdown-menu";
|
|
20
|
+
import "@radix-ui/react-separator";
|
|
21
|
+
import "@radix-ui/react-toast";
|
|
22
|
+
import "@radix-ui/react-context-menu";
|
|
23
|
+
import "clsx";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "lodash-es";
|
|
26
|
+
import "jotai";
|
|
27
|
+
import "./iconBase-Ief2hJUZ.js";
|
|
28
|
+
import "./ChaiThemeFn--DgGggh_.js";
|
|
29
|
+
import "@react-hookz/web";
|
|
30
|
+
import "tree-model";
|
|
31
|
+
import "@chaibuilder/runtime";
|
|
32
|
+
import "react-quill";
|
|
33
|
+
import "flagged";
|
|
34
|
+
import "react-hotkeys-hook";
|
|
35
|
+
import "@floating-ui/dom";
|
|
36
|
+
import "@floating-ui/react-dom";
|
|
37
|
+
import "@tailwindcss/typography";
|
|
38
|
+
import "@tailwindcss/forms";
|
|
39
|
+
import "@tailwindcss/aspect-ratio";
|
|
40
|
+
import "./STRINGS-BnWT5XcX.js";
|
|
41
|
+
import "react-wrap-balancer";
|
|
42
|
+
import "lucide-react";
|
|
43
|
+
import "react-dom";
|
|
44
|
+
import "prop-types";
|
|
45
|
+
import "react-error-boundary";
|
|
46
|
+
import "re-resizable";
|
|
47
|
+
import "react-arborist";
|
|
48
|
+
import "himalaya";
|
|
49
|
+
import "@rjsf/core";
|
|
50
|
+
import "@rjsf/validator-ajv8";
|
|
51
|
+
import "react-icons-picker";
|
|
52
|
+
import "react-autosuggest";
|
|
53
|
+
import "fuse.js";
|
|
54
|
+
import "i18next";
|
|
55
|
+
import "framer-motion";
|
|
56
|
+
const lt = () => {
|
|
57
|
+
const e = p("topBarComponents.left", []), s = p("topBarComponents.center", []), a = p("topBarComponents.right", []);
|
|
58
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
59
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
|
|
60
|
+
e.map((r) => /* @__PURE__ */ t.jsx(m, { fallback: /* @__PURE__ */ t.jsx(i, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
|
|
61
|
+
) }) }),
|
|
62
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-2", children: o.Children.toArray(
|
|
63
|
+
s.map((r) => /* @__PURE__ */ t.jsx(m, { fallback: /* @__PURE__ */ t.jsx(i, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
|
|
64
|
+
) }),
|
|
65
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-1", children: o.Children.toArray(
|
|
66
|
+
a.map((r) => /* @__PURE__ */ t.jsx(m, { fallback: /* @__PURE__ */ t.jsx(i, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
|
|
67
|
+
) })
|
|
68
|
+
] });
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
lt as default
|
|
72
|
+
};
|
|
@@ -743,50 +743,50 @@ ot.displayName = i.Separator.displayName;
|
|
|
743
743
|
const st = ({ className: e, ...t }) => /* @__PURE__ */ o.jsx("span", { className: s("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
|
|
744
744
|
st.displayName = "ContextMenuShortcut";
|
|
745
745
|
export {
|
|
746
|
-
|
|
746
|
+
Tt as $,
|
|
747
747
|
mt as A,
|
|
748
748
|
W as B,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
749
|
+
ue as C,
|
|
750
|
+
xt as D,
|
|
751
|
+
be as E,
|
|
752
|
+
ye as F,
|
|
753
|
+
Ce as G,
|
|
754
|
+
_ as H,
|
|
755
|
+
ve as I,
|
|
756
|
+
bt as J,
|
|
757
|
+
Re as K,
|
|
758
|
+
we as L,
|
|
759
|
+
Te as M,
|
|
760
|
+
De as N,
|
|
761
|
+
vt as O,
|
|
762
|
+
ht as P,
|
|
763
|
+
Se as Q,
|
|
764
|
+
Nt as R,
|
|
765
765
|
Pt as S,
|
|
766
766
|
je as T,
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
767
|
+
yt as U,
|
|
768
|
+
wt as V,
|
|
769
|
+
jt as W,
|
|
770
|
+
Ae as X,
|
|
771
|
+
Ct as Y,
|
|
772
|
+
Rt as Z,
|
|
773
|
+
Ie as _,
|
|
774
|
+
le as a,
|
|
775
|
+
Dt as a0,
|
|
776
|
+
Pe as a1,
|
|
777
|
+
ze as a2,
|
|
778
|
+
Oe as a3,
|
|
779
|
+
Ve as a4,
|
|
780
|
+
Ee as a5,
|
|
781
|
+
Le as a6,
|
|
782
|
+
_e as a7,
|
|
783
|
+
St as a8,
|
|
784
|
+
At as a9,
|
|
785
|
+
It as aa,
|
|
786
|
+
Me as ab,
|
|
787
|
+
ke as ac,
|
|
788
|
+
kt as ad,
|
|
789
|
+
He as ae,
|
|
790
790
|
Ue as af,
|
|
791
791
|
Qe as ag,
|
|
792
792
|
qe as ah,
|
|
@@ -806,29 +806,29 @@ export {
|
|
|
806
806
|
We as av,
|
|
807
807
|
Ke as aw,
|
|
808
808
|
_t as ax,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
809
|
+
K as b,
|
|
810
|
+
s as c,
|
|
811
|
+
D as d,
|
|
812
|
+
Z as e,
|
|
813
|
+
$ as f,
|
|
814
|
+
ee as g,
|
|
815
|
+
ft as h,
|
|
816
|
+
te as i,
|
|
817
|
+
pt as j,
|
|
818
|
+
ut as k,
|
|
819
|
+
ae as l,
|
|
820
|
+
oe as m,
|
|
821
|
+
se as n,
|
|
822
|
+
re as o,
|
|
823
|
+
ne as p,
|
|
824
|
+
de as q,
|
|
825
|
+
ie as r,
|
|
826
|
+
gt as s,
|
|
827
|
+
ce as t,
|
|
828
|
+
me as u,
|
|
829
|
+
fe as v,
|
|
830
|
+
pe as w,
|
|
831
|
+
xe as x,
|
|
832
|
+
Ne as y,
|
|
833
|
+
ge as z
|
|
834
834
|
};
|