@chaibuilder/sdk 1.2.103 → 1.2.104
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-BOeEt5yL.cjs +1 -0
- package/dist/{CodeEditor-NKqXoCPq.js → CodeEditor-xKHFmP7r.js} +4 -5
- package/dist/Topbar-Ulmx0c7w.cjs +1 -0
- package/dist/{Topbar-yEANMgiO.js → Topbar-Z4cQD_EP.js} +13 -14
- package/dist/{UnsplashImages-Z3xcNddA.js → UnsplashImages-C9snpLoA.js} +4 -5
- package/dist/UnsplashImages-z3brw7hu.cjs +1 -0
- package/dist/{UploadImages-v50EQZLT.js → UploadImages-yrFhyBgy.js} +10 -11
- package/dist/UploadImages-zMZiwU9y.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +73 -74
- package/dist/{index-K9hzPq-7.cjs → index-7bVOae6Z.cjs} +6 -6
- package/dist/{index-aV4x9E1G.js → index-dB_zEyAf.js} +493 -492
- package/dist/plugin-UiUFs2fK.js +44 -0
- package/dist/plugin-f6SDZ_Or.js +108 -0
- package/dist/plugin-jum1MjXp.cjs +1 -0
- package/dist/plugin-xOpS-UNV.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +2 -2
- package/dist/render.js +77 -89
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +5 -9
- package/dist/tailwind.js +5 -17
- package/package.json +2 -2
- package/dist/CodeEditor-x97t1x8H.cjs +0 -1
- package/dist/Topbar-76FfrmEx.cjs +0 -1
- package/dist/UnsplashImages-LpHbt_-q.cjs +0 -1
- package/dist/UploadImages-PYkTPdPr.cjs +0 -1
- package/dist/plugin-3Y9Uv3RT.cjs +0 -1
- package/dist/plugin-KIpT3NWi.cjs +0 -1
- package/dist/plugin-LKCHtO27.js +0 -43
- package/dist/plugin-ooqqxWRQ.js +0 -55
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),n=require("lodash-es"),E=require("jotai"),I=require("./context-menu-sQn7ryJ6.cjs"),w=require("react-i18next"),g=require("./index-K9hzPq-7.cjs"),b=require("lucide-react");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-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-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./iconBase-aZzpqff_.cjs");require("@chaibuilder/runtime");require("./plugin-KIpT3NWi.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-Yl7cSWDc.cjs");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("react-event-hook");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("@rjsf/validator-ajv8");require("@rjsf/core");require("./controls-p9IwFnPx.cjs");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const k=E.atom([]),S=({isModalView:a,onSelect:o})=>{const{t:s}=w.useTranslation(),d=g.useBuilderProp("uploadMediaCallback"),x=g.useBuilderProp("fetchMediaCallback"),[u,c]=E.useAtom(k),[R,p]=i.useState(!1),[j,q]=i.useState(!1),[,y]=i.useState(),[h,m]=i.useState("");i.useEffect(()=>{(async()=>{if(!x)return;q(!0);const r=await x();c(r||[]),q(!1)})()},[]);const N=r=>{var t,l;if(m(""),r&&((l=(t=r==null?void 0:r.target)==null?void 0:t.files)==null?void 0:l.length)>0){const f=r.target.files[0];f.type.startsWith("image")?v(f):m(s("Please select an image"))}},v=async r=>{if(d){p(!0);try{const{url:t}=await d(r);o(t),y(void 0);const l=await x();c(l)}catch(t){c([]),m((t==null?void 0:t.message)||"Something went wrong.")}p(!1)}};return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:a?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center rounded-lg",children:e.jsxRuntimeExports.jsxs("label",{htmlFor:"image-upload",className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[e.jsxRuntimeExports.jsx(b.Upload,{className:"mb-3 h-10 w-10 text-gray-400"}),e.jsxRuntimeExports.jsx("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:e.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:s("Click to upload")})}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:s("SVG, PNG, JPG or GIF (Max. 2mb)")})]}),R?e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[e.jsxRuntimeExports.jsx(b.Loader,{className:"h-6 w-6 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"ml-2 text-sm text-gray-500",children:s("Uploading...")})]}):null,h&&e.jsxRuntimeExports.jsx("p",{className:"pb-2 text-xs text-red-500",children:h||s("Something went wrong")})]})}),e.jsxRuntimeExports.jsx("input",{type:"file",id:"image-upload",accept:"image/*",hidden:!0,onChange:N})]}),e.jsxRuntimeExports.jsxs(I.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${a?"px-2":""} pt-2`,children:[n.isEmpty(u)&&j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:s("Fetching...")})}),n.isEmpty(u)&&!j&&e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-4 h-12 rounded-full p-6"}),e.jsxRuntimeExports.jsx("h3",{className:"mb-2 text-sm font-semibold",children:s("No images found")}),e.jsxRuntimeExports.jsx("p",{className:"mb-4 max-w-sm text-muted-foreground",children:s("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.")})]}),a?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(u,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>o(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.thumbUrl})})},r.id))}):n.map(u,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>o(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.url})})},r.id))]})]})};exports.default=S;
|
package/dist/plugin-3Y9Uv3RT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("lodash-es"),u=require("tailwindcss-palette-generator"),b=require("./plugin-KIpT3NWi.cjs"),f=o=>{const t=r.get(o,"primaryColor","#000"),c=r.get(o,"secondaryColor","#ccc"),i=r.get(o,"headingFont","Inter"),l=r.get(o,"bodyFont","Inter"),n=r.get(o,"roundedCorners","0"),a=r.get(o,"bodyBgLightColor","#fff"),d=r.get(o,"bodyBgDarkColor","#000"),g=r.get(o,"bodyTextLightColor","#000"),e=r.get(o,"bodyTextDarkColor","#fff"),s=u([{color:t,name:"primary"},{color:c,name:"secondary"}]),y={"bg-light":a,"bg-dark":d,"text-dark":e,"text-light":g};return{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},fontFamily:{heading:[i],body:[l]},borderRadius:{DEFAULT:`${n||"0px"}px`},colors:{...s,...y}}},C=b.plugin(function({addBase:o,theme:t}){o({"h1,h2,h3,h4,h5,h6":{fontFamily:t("fontFamily.heading")},body:{fontFamily:t("fontFamily.body"),color:t("colors.text-light"),backgroundColor:t("colors.bg-light")},".dark body":{color:t("colors.text-dark"),backgroundColor:t("colors.bg-dark")}})});exports.chaiBuilderPlugin=C;exports.getChaiBuilderTheme=f;
|
package/dist/plugin-KIpT3NWi.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={},f={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}});function u(n,t){return{handler:n,config:t}}u.withOptions=function(n,t=()=>({})){const r=function(i){return{__options:i,handler:n(i),config:t(i)}};return r.__isOptionsFunction=!0,r.__pluginFunction=n,r.__configFunction=t,r};const l=u})(f);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const u=l(f);function l(t){return t&&t.__esModule?t:{default:t}}const n=u.default})(c);let o=c;var _=(o.__esModule?o:{default:o}).default;const d=a(_);exports.getDefaultExportFromCjs=a;exports.plugin=d;
|
package/dist/plugin-LKCHtO27.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { get as r } from "lodash-es";
|
|
2
|
-
import e from "tailwindcss-palette-generator";
|
|
3
|
-
import { p as f } from "./plugin-ooqqxWRQ.js";
|
|
4
|
-
const C = (o) => {
|
|
5
|
-
const n = r(o, "primaryColor", "#000"), a = r(o, "secondaryColor", "#ccc"), c = r(o, "headingFont", "Inter"), d = r(o, "bodyFont", "Inter"), t = r(o, "roundedCorners", "0"), l = r(o, "bodyBgLightColor", "#fff"), i = r(o, "bodyBgDarkColor", "#000"), s = r(o, "bodyTextLightColor", "#000"), g = r(o, "bodyTextDarkColor", "#fff"), y = e([
|
|
6
|
-
{ color: n, name: "primary" },
|
|
7
|
-
{ color: a, name: "secondary" }
|
|
8
|
-
]), b = {
|
|
9
|
-
"bg-light": l,
|
|
10
|
-
"bg-dark": i,
|
|
11
|
-
"text-dark": g,
|
|
12
|
-
"text-light": s
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
15
|
-
container: {
|
|
16
|
-
center: !0,
|
|
17
|
-
padding: "1rem",
|
|
18
|
-
screens: { "2xl": "1400px" }
|
|
19
|
-
},
|
|
20
|
-
fontFamily: { heading: [c], body: [d] },
|
|
21
|
-
borderRadius: { DEFAULT: `${t || "0px"}px` },
|
|
22
|
-
colors: { ...y, ...b }
|
|
23
|
-
};
|
|
24
|
-
}, F = f(function({ addBase: o, theme: n }) {
|
|
25
|
-
o({
|
|
26
|
-
"h1,h2,h3,h4,h5,h6": {
|
|
27
|
-
fontFamily: n("fontFamily.heading")
|
|
28
|
-
},
|
|
29
|
-
body: {
|
|
30
|
-
fontFamily: n("fontFamily.body"),
|
|
31
|
-
color: n("colors.text-light"),
|
|
32
|
-
backgroundColor: n("colors.bg-light")
|
|
33
|
-
},
|
|
34
|
-
".dark body": {
|
|
35
|
-
color: n("colors.text-dark"),
|
|
36
|
-
backgroundColor: n("colors.bg-dark")
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
export {
|
|
41
|
-
F as c,
|
|
42
|
-
C as g
|
|
43
|
-
};
|
package/dist/plugin-ooqqxWRQ.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function f(e) {
|
|
2
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3
|
-
}
|
|
4
|
-
var i = {}, c = {};
|
|
5
|
-
(function(e) {
|
|
6
|
-
Object.defineProperty(e, "__esModule", {
|
|
7
|
-
value: !0
|
|
8
|
-
}), Object.defineProperty(e, "default", {
|
|
9
|
-
enumerable: !0,
|
|
10
|
-
get: function() {
|
|
11
|
-
return l;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
function u(n, t) {
|
|
15
|
-
return {
|
|
16
|
-
handler: n,
|
|
17
|
-
config: t
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
u.withOptions = function(n, t = () => ({})) {
|
|
21
|
-
const r = function(a) {
|
|
22
|
-
return {
|
|
23
|
-
__options: a,
|
|
24
|
-
handler: n(a),
|
|
25
|
-
config: t(a)
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
return r.__isOptionsFunction = !0, r.__pluginFunction = n, r.__configFunction = t, r;
|
|
29
|
-
};
|
|
30
|
-
const l = u;
|
|
31
|
-
})(c);
|
|
32
|
-
(function(e) {
|
|
33
|
-
Object.defineProperty(e, "__esModule", {
|
|
34
|
-
value: !0
|
|
35
|
-
}), Object.defineProperty(e, "default", {
|
|
36
|
-
enumerable: !0,
|
|
37
|
-
get: function() {
|
|
38
|
-
return n;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const u = /* @__PURE__ */ l(c);
|
|
42
|
-
function l(t) {
|
|
43
|
-
return t && t.__esModule ? t : {
|
|
44
|
-
default: t
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const n = u.default;
|
|
48
|
-
})(i);
|
|
49
|
-
let o = i;
|
|
50
|
-
var _ = (o.__esModule ? o : { default: o }).default;
|
|
51
|
-
const d = /* @__PURE__ */ f(_);
|
|
52
|
-
export {
|
|
53
|
-
f as g,
|
|
54
|
-
d as p
|
|
55
|
-
};
|