@chaibuilder/sdk 2.0.0-beta.4 → 2.0.0-beta.40
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/README.md +0 -4
- package/dist/ChaiThemeFn-Ba9O-eBT.js +201 -0
- package/dist/ChaiThemeFn-DQu-2Eh9.cjs +13 -0
- package/dist/CodeEditor-C5hkhszC.cjs +1 -0
- package/dist/CodeEditor-DmPiW1eD.js +77 -0
- package/dist/STRINGS-DtEft2kY.js +5 -0
- package/dist/STRINGS-n7COZtKr.cjs +1 -0
- package/dist/Topbar-CTL7UXRB.js +22 -0
- package/dist/Topbar-CiOsi4Ut.cjs +1 -0
- package/dist/{context-menu-I8woggB3.js → context-menu-BsI3Hqio.js} +66 -66
- package/dist/{context-menu-0lRey9QY.cjs → context-menu-dsqhw1Ub.cjs} +1 -1
- package/dist/core.cjs +302 -1
- package/dist/core.d.ts +121 -81
- package/dist/core.js +33557 -122
- package/dist/{iconBase-Ief2hJUZ.js → iconBase-DHfFLkem.js} +6 -12
- package/dist/jsx-runtime-DGh1k5sI.cjs +31 -0
- package/dist/jsx-runtime-Dx-03ztt.js +445 -0
- package/dist/mockServiceWorker.js +39 -24
- package/dist/plugin-2xcljWGM.cjs +1 -0
- package/dist/plugin-Bvqh40K5.js +24 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +36 -18
- package/dist/render.js +127 -127
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -20
- package/dist/{style.css → sdk.css} +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +31 -26
- package/dist/tailwind.js +5 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +59 -68
- package/dist/ui.js +199 -356
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +1327 -703
- package/package.json +102 -115
- package/dist/CodeEditor-fHc8uUZi.js +0 -126
- package/dist/CodeEditor-jEPBwyMf.cjs +0 -1
- package/dist/STRINGS-Xxstm-7I.js +0 -7
- package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
- package/dist/Topbar-9ltyM5Cl.js +0 -160
- package/dist/Topbar-CbNTH5d8.cjs +0 -1
- package/dist/controls-lEwMTdPQ.js +0 -234
- package/dist/controls-p9IwFnPx.cjs +0 -1
- package/dist/index-UvIwJj5Y.js +0 -8540
- package/dist/index-gHOGFo7e.cjs +0 -63
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/jsx-runtime-Sp0orL4X.js +0 -631
- 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
- /package/dist/{iconBase-aZzpqff_.cjs → iconBase-Cn2BsTrq.cjs} +0 -0
package/README.md
CHANGED
|
@@ -4,10 +4,6 @@ Chai Builder is an Open Source Low Code React + Tailwind CSS Visual Builder.
|
|
|
4
4
|
It allows you to create web pages visually by dragging and dropping elements onto the canvas.
|
|
5
5
|
It is a simple React component that renders a full-fledged visual builder into any React application.
|
|
6
6
|
|
|
7
|
-
#### [View Demo](https://chaibuilder.com/demos/web)
|
|
8
|
-
#### [Documentation](https://chaibuilder.com/docs/sdk/introduction)
|
|
9
|
-
#### [API References](https://api-reference.chaibuilder.com)
|
|
10
|
-
|
|
11
7
|
---
|
|
12
8
|
|
|
13
9
|
### Manual installation:
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { isEmpty as $, uniq as b, keys as _, flatten as v } from "lodash-es";
|
|
2
|
+
function P(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
const k = {
|
|
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 l = {}, c = {}, p;
|
|
79
|
+
function j() {
|
|
80
|
+
return p || (p = 1, function(e) {
|
|
81
|
+
Object.defineProperty(e, "__esModule", {
|
|
82
|
+
value: !0
|
|
83
|
+
}), Object.defineProperty(e, "default", {
|
|
84
|
+
enumerable: !0,
|
|
85
|
+
get: function() {
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
function n(t, o) {
|
|
90
|
+
return {
|
|
91
|
+
handler: t,
|
|
92
|
+
config: o
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
n.withOptions = function(t, o = () => ({})) {
|
|
96
|
+
const u = function(a) {
|
|
97
|
+
return {
|
|
98
|
+
__options: a,
|
|
99
|
+
handler: t(a),
|
|
100
|
+
config: o(a)
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
return u.__isOptionsFunction = !0, u.__pluginFunction = t, u.__configFunction = o, u;
|
|
104
|
+
};
|
|
105
|
+
const r = n;
|
|
106
|
+
}(c)), c;
|
|
107
|
+
}
|
|
108
|
+
var g;
|
|
109
|
+
function C() {
|
|
110
|
+
return g || (g = 1, function(e) {
|
|
111
|
+
Object.defineProperty(e, "__esModule", {
|
|
112
|
+
value: !0
|
|
113
|
+
}), Object.defineProperty(e, "default", {
|
|
114
|
+
enumerable: !0,
|
|
115
|
+
get: function() {
|
|
116
|
+
return t;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const n = /* @__PURE__ */ r(j());
|
|
120
|
+
function r(o) {
|
|
121
|
+
return o && o.__esModule ? o : {
|
|
122
|
+
default: o
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const t = n.default;
|
|
126
|
+
}(l)), l;
|
|
127
|
+
}
|
|
128
|
+
var d, m;
|
|
129
|
+
function E() {
|
|
130
|
+
if (m) return d;
|
|
131
|
+
m = 1;
|
|
132
|
+
let e = C();
|
|
133
|
+
return d = (e.__esModule ? e : { default: e }).default, d;
|
|
134
|
+
}
|
|
135
|
+
var M = E();
|
|
136
|
+
const B = /* @__PURE__ */ P(M), R = (e) => ({
|
|
137
|
+
fontFamily: e.fontFamily ? _(e.fontFamily).reduce(
|
|
138
|
+
(r, t) => ({
|
|
139
|
+
...r,
|
|
140
|
+
[t.replace("font-", "")]: `var(--${t})`
|
|
141
|
+
}),
|
|
142
|
+
{}
|
|
143
|
+
) : {},
|
|
144
|
+
borderRadius: e.borderRadius ? {
|
|
145
|
+
lg: "var(--radius)",
|
|
146
|
+
md: "calc(var(--radius) - 2px)",
|
|
147
|
+
sm: "calc(var(--radius) - 4px)"
|
|
148
|
+
} : {},
|
|
149
|
+
colors: e.colors ? v(e.colors.map((r) => Object.entries(r.items))).reduce(
|
|
150
|
+
(r, [t]) => ({ ...r, [t]: `hsl(var(--${t}))` }),
|
|
151
|
+
{}
|
|
152
|
+
) : {}
|
|
153
|
+
});
|
|
154
|
+
function y(e) {
|
|
155
|
+
const n = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
156
|
+
let r = parseInt(n[1], 16), t = parseInt(n[2], 16), o = parseInt(n[3], 16);
|
|
157
|
+
r /= 255, t /= 255, o /= 255;
|
|
158
|
+
const u = Math.max(r, t, o), a = Math.min(r, t, o);
|
|
159
|
+
let s, F;
|
|
160
|
+
const f = (u + a) / 2;
|
|
161
|
+
if (u == a)
|
|
162
|
+
s = F = 0;
|
|
163
|
+
else {
|
|
164
|
+
const i = u - a;
|
|
165
|
+
switch (F = f > 0.5 ? i / (2 - u - a) : i / (u + a), u) {
|
|
166
|
+
case r:
|
|
167
|
+
s = (t - o) / i + (t < o ? 6 : 0);
|
|
168
|
+
break;
|
|
169
|
+
case t:
|
|
170
|
+
s = (o - r) / i + 2;
|
|
171
|
+
break;
|
|
172
|
+
case o:
|
|
173
|
+
s = (r - t) / i + 4;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
s /= 6;
|
|
177
|
+
}
|
|
178
|
+
return `${Math.round(s * 360)} ${Math.round(F * 100)}% ${Math.round(f * 100)}%`;
|
|
179
|
+
}
|
|
180
|
+
const q = (e) => `:root {
|
|
181
|
+
${e.fontFamily && Object.entries(e.fontFamily).map(([n, r]) => `--font-${n}: "${r}";`).join(`
|
|
182
|
+
`)}
|
|
183
|
+
${e.borderRadius && `--radius: ${e.borderRadius};`}
|
|
184
|
+
${e.colors && Object.entries(e.colors).map(([n, r]) => `--${n}: ${y(r[0])};`).join(`
|
|
185
|
+
`)}
|
|
186
|
+
}
|
|
187
|
+
.dark {
|
|
188
|
+
${e.colors && Object.entries(e.colors).map(([n, r]) => `--${n}: ${y(r[1])};`).join(`
|
|
189
|
+
`)}
|
|
190
|
+
}`, I = (e) => $(e.fontFamily) ? "" : b(Object.entries(e.fontFamily).map(([, r]) => r)).map((r) => `<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${r.replace(/\s+/g, "+")}&display=swap`}">`).join(`
|
|
191
|
+
`), w = (e) => $(e.fontFamily) ? "" : b(Object.entries(e.fontFamily).map(([, r]) => r)).map((r) => `@import url("${`https://fonts.googleapis.com/css2?family=${r.replace(/\s+/g, "+")}&display=swap`}");`).join(`
|
|
192
|
+
`);
|
|
193
|
+
export {
|
|
194
|
+
I as a,
|
|
195
|
+
q as b,
|
|
196
|
+
w as c,
|
|
197
|
+
k as d,
|
|
198
|
+
P as e,
|
|
199
|
+
R as g,
|
|
200
|
+
B as p
|
|
201
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";const a=require("lodash-es");function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const _={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 c={},d={},p;function v(){return p||(p=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function n(t,o){return{handler:t,config:o}}n.withOptions=function(t,o=()=>({})){const u=function(s){return{__options:s,handler:t(s),config:o(s)}};return u.__isOptionsFunction=!0,u.__pluginFunction=t,u.__configFunction=o,u};const r=n}(d)),d}var m;function P(){return m||(m=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const n=r(v());function r(o){return o&&o.__esModule?o:{default:o}}const t=n.default}(c)),c}var f,y;function C(){if(y)return f;y=1;let e=P();return f=(e.__esModule?e:{default:e}).default,f}var j=C();const E=b(j),O=e=>({fontFamily:e.fontFamily?a.keys(e.fontFamily).reduce((r,t)=>({...r,[t.replace("font-","")]:`var(--${t})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?a.flatten(e.colors.map(r=>Object.entries(r.items))).reduce((r,[t])=>({...r,[t]:`hsl(var(--${t}))`}),{}):{}});function $(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=parseInt(n[1],16),t=parseInt(n[2],16),o=parseInt(n[3],16);r/=255,t/=255,o/=255;const u=Math.max(r,t,o),s=Math.min(r,t,o);let i,l;const g=(u+s)/2;if(u==s)i=l=0;else{const F=u-s;switch(l=g>.5?F/(2-u-s):F/(u+s),u){case r:i=(t-o)/F+(t<o?6:0);break;case t:i=(o-r)/F+2;break;case o:i=(r-t)/F+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(g*100)}%`}const k=e=>`:root {
|
|
2
|
+
${e.fontFamily&&Object.entries(e.fontFamily).map(([n,r])=>`--font-${n}: "${r}";`).join(`
|
|
3
|
+
`)}
|
|
4
|
+
${e.borderRadius&&`--radius: ${e.borderRadius};`}
|
|
5
|
+
${e.colors&&Object.entries(e.colors).map(([n,r])=>`--${n}: ${$(r[0])};`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
}
|
|
8
|
+
.dark {
|
|
9
|
+
${e.colors&&Object.entries(e.colors).map(([n,r])=>`--${n}: ${$(r[1])};`).join(`
|
|
10
|
+
`)}
|
|
11
|
+
}`,M=e=>a.isEmpty(e.fontFamily)?"":a.uniq(Object.entries(e.fontFamily).map(([,r])=>r)).map(r=>`<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${r.replace(/\s+/g,"+")}&display=swap`}">`).join(`
|
|
12
|
+
`),h=e=>a.isEmpty(e.fontFamily)?"":a.uniq(Object.entries(e.fontFamily).map(([,r])=>r)).map(r=>`@import url("${`https://fonts.googleapis.com/css2?family=${r.replace(/\s+/g,"+")}&display=swap`}");`).join(`
|
|
13
|
+
`);exports.defaultThemeOptions=_;exports.getChaiThemeCssVariables=k;exports.getChaiThemeOptions=O;exports.getDefaultExportFromCjs=b;exports.getThemeFontsCSSImport=h;exports.getThemeFontsLinkMarkup=M;exports.plugin=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-DGh1k5sI.cjs"),k=require("@monaco-editor/react"),C=require("./context-menu-dsqhw1Ub.cjs"),E=require("react-i18next"),i=require("react"),l=require("./core.cjs"),R=require("@radix-ui/react-icons"),g=require("@react-hookz/web"),u=o=>{const n=document.createElement("div");return n.innerHTML=o,n.innerHTML};function v(){const{t:o}=E.useTranslation(),[n,d]=i.useState(!1),[c,x]=i.useState(""),[t,r]=l.useCodeEditor(),[a]=l.useSelectedBlockIds(),m=l.useUpdateBlocksProps(),p=l.useUpdateBlocksPropsRealtime(),j=g.useThrottledCallback(s=>{const b=u(s);p([t.blockId],{[t.blockProp]:b})},[],300),f=i.useCallback(()=>{if(n){const s=u(c);m([t.blockId],{[t.blockProp]:s})}},[n,c]);i.useEffect(()=>{a.includes(t==null?void 0:t.blockId)||(f(),r(null))},[a]);const h=()=>{r(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:h,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:o("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(C.Button,{onClick:()=>r(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(R.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(k,{onMount:s=>{s.setValue(t.initialCode)},onChange:s=>{d(!0),x(s),j(s)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=v;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-Dx-03ztt.js";
|
|
2
|
+
import k from "@monaco-editor/react";
|
|
3
|
+
import { B as C } from "./context-menu-BsI3Hqio.js";
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
|
+
import { useState as r, 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
|
+
import { Cross2Icon as w } from "@radix-ui/react-icons";
|
|
8
|
+
import { useThrottledCallback as B } from "@react-hookz/web";
|
|
9
|
+
const c = (l) => {
|
|
10
|
+
const o = document.createElement("div");
|
|
11
|
+
return o.innerHTML = l, o.innerHTML;
|
|
12
|
+
};
|
|
13
|
+
function U() {
|
|
14
|
+
const { t: l } = j(), [o, d] = r(!1), [i, m] = r(""), [t, n] = y(), [a] = N(), u = T(), p = E(), f = B(
|
|
15
|
+
(s) => {
|
|
16
|
+
const b = c(s);
|
|
17
|
+
p([t.blockId], { [t.blockProp]: b });
|
|
18
|
+
},
|
|
19
|
+
[],
|
|
20
|
+
300
|
|
21
|
+
), x = v(() => {
|
|
22
|
+
if (o) {
|
|
23
|
+
const s = c(i);
|
|
24
|
+
u([t.blockId], { [t.blockProp]: s });
|
|
25
|
+
}
|
|
26
|
+
}, [o, i]);
|
|
27
|
+
g(() => {
|
|
28
|
+
a.includes(t == null ? void 0 : t.blockId) || (x(), n(null));
|
|
29
|
+
}, [a]);
|
|
30
|
+
const h = () => {
|
|
31
|
+
n(null);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "h-full rounded-t-lg border-t-4 border-black bg-black text-white", children: [
|
|
34
|
+
/* @__PURE__ */ e.jsx("button", { onClick: h, className: "fixed inset-0 z-[100000] cursor-default bg-gray-400/20" }),
|
|
35
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100001] h-full w-full flex-col gap-y-1", children: [
|
|
36
|
+
/* @__PURE__ */ e.jsxs("div", { className: "-mt-1 flex items-center justify-between px-2 py-2", children: [
|
|
37
|
+
/* @__PURE__ */ e.jsxs("h3", { className: "space-x-3 text-sm font-semibold", children: [
|
|
38
|
+
/* @__PURE__ */ e.jsx("span", { children: l("HTML Code Editor |") }),
|
|
39
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-400", children: l("Scripts will be only executed in preview and live mode.") })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-x-2", children: /* @__PURE__ */ e.jsx(
|
|
42
|
+
C,
|
|
43
|
+
{
|
|
44
|
+
onClick: () => n(null),
|
|
45
|
+
size: "sm",
|
|
46
|
+
variant: "destructive",
|
|
47
|
+
className: "h-6 w-fit",
|
|
48
|
+
children: /* @__PURE__ */ e.jsx(w, {})
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ e.jsx(
|
|
53
|
+
k,
|
|
54
|
+
{
|
|
55
|
+
onMount: (s) => {
|
|
56
|
+
s.setValue(t.initialCode);
|
|
57
|
+
},
|
|
58
|
+
onChange: (s) => {
|
|
59
|
+
d(!0), m(s), f(s);
|
|
60
|
+
},
|
|
61
|
+
height: "100%",
|
|
62
|
+
defaultLanguage: "html",
|
|
63
|
+
theme: "vs-dark",
|
|
64
|
+
defaultValue: "",
|
|
65
|
+
options: {
|
|
66
|
+
minimap: {
|
|
67
|
+
enabled: !1
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
U as default
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const _="#styles:",E="__ADD_BLOCK_INTERNAL_ROOT";exports.ROOT_TEMP_KEY=E;exports.STYLES_KEY=_;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-Dx-03ztt.js";
|
|
2
|
+
import t, { Suspense as r } from "react";
|
|
3
|
+
import { S as a } from "./context-menu-BsI3Hqio.js";
|
|
4
|
+
import "react-i18next";
|
|
5
|
+
import { useBuilderProp as n } from "./core.js";
|
|
6
|
+
const f = () => {
|
|
7
|
+
const o = n("topBarComponents.left", []), l = n("topBarComponents.center", []), c = n("topBarComponents.right", []);
|
|
8
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
9
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: t.Children.toArray(
|
|
10
|
+
o.map((s) => /* @__PURE__ */ e.jsx(r, { fallback: /* @__PURE__ */ e.jsx(a, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
|
|
11
|
+
) }) }),
|
|
12
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: t.Children.toArray(
|
|
13
|
+
l.map((s) => /* @__PURE__ */ e.jsx(r, { fallback: /* @__PURE__ */ e.jsx(a, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
|
|
14
|
+
) }),
|
|
15
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: t.Children.toArray(
|
|
16
|
+
c.map((s) => /* @__PURE__ */ e.jsx(r, { fallback: /* @__PURE__ */ e.jsx(a, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
|
|
17
|
+
) })
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
f as default
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-DGh1k5sI.cjs"),s=require("react"),r=require("./context-menu-dsqhw1Ub.cjs");require("react-i18next");const n=require("./core.cjs"),c=()=>{const o=n.useBuilderProp("topBarComponents.left",[]),x=n.useBuilderProp("topBarComponents.center",[]),i=n.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:s.Children.toArray(o.map(t=>e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:s.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:s.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})]})};exports.default=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-
|
|
1
|
+
import { j as o } from "./jsx-runtime-Dx-03ztt.js";
|
|
2
2
|
import * as T from "@radix-ui/react-switch";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import * as u from "@radix-ui/react-accordion";
|
|
@@ -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
|
};
|