@chaibuilder/sdk 1.2.80 → 1.2.81
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-nJAmkLwG.cjs → CodeEditor-d_5YVs-1.cjs} +1 -1
- package/dist/{CodeEditor-LsV5mq7M.js → CodeEditor-u-gDiPZ2.js} +1 -1
- package/dist/{Topbar--cCJT5MN.cjs → Topbar-QNcTBAxD.cjs} +1 -1
- package/dist/{Topbar-CY8ipE2A.js → Topbar-qT5SdMRK.js} +1 -1
- package/dist/{UnsplashImages-_A9idjFx.js → UnsplashImages-gys3oUzE.js} +1 -1
- package/dist/{UnsplashImages-pKkUwrBV.cjs → UnsplashImages-sgNjZifT.cjs} +1 -1
- package/dist/{UploadImages-cFKKLJaD.js → UploadImages-EQnGq0Zj.js} +1 -1
- package/dist/{UploadImages-uz-HrZD6.cjs → UploadImages-pGw_00d5.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -0
- package/dist/core.js +58 -57
- package/dist/{index-t4-5YjXE.cjs → index-csmyn0rE.cjs} +2 -2
- package/dist/{index-D2EMs9t6.js → index-kTk1tj2l.js} +64 -62
- package/package.json +1 -1
|
@@ -3579,7 +3579,7 @@ const useAllDataProviders = () => useMemo$1(() => getChaiDataProviders(), []), B
|
|
|
3579
3579
|
}, StaticCanvas$1 = StaticCanvas, FallbackError = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-md bg-red-200 p-4 text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-full flex-col items-center justify-center", children: [
|
|
3580
3580
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: "Oops! Something went wrong." }),
|
|
3581
3581
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Please try again." })
|
|
3582
|
-
] }) }), CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-
|
|
3582
|
+
] }) }), CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-u-gDiPZ2.js")), CanvasArea = () => {
|
|
3583
3583
|
const [r] = useCodeEditor(), n = useBuilderProp("onError", noop$1);
|
|
3584
3584
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
|
|
3585
3585
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
|
|
@@ -4976,7 +4976,7 @@ const ViewData = ({ data: r, fullView: n }) => {
|
|
|
4976
4976
|
}
|
|
4977
4977
|
)
|
|
4978
4978
|
] });
|
|
4979
|
-
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-
|
|
4979
|
+
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-gys3oUzE.js")), UploadImages = React__default.lazy(() => import("./UploadImages-EQnGq0Zj.js")), ImagesPanel = ({
|
|
4980
4980
|
isModalView: r = !1,
|
|
4981
4981
|
onSelect: n = () => {
|
|
4982
4982
|
}
|
|
@@ -7354,21 +7354,24 @@ const CoreBlock = ({ block: r, disabled: n, parentId: o }) => {
|
|
|
7354
7354
|
) }),
|
|
7355
7355
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: b(c || i) }) })
|
|
7356
7356
|
] }) });
|
|
7357
|
-
},
|
|
7358
|
-
|
|
7359
|
-
|
|
7357
|
+
}, DefaultChaiBlocks = ({ parentId: r, gridCols: n = "grid-cols-2" }) => {
|
|
7358
|
+
const o = useChaiBlocks(), a = useBuilderProp("filterChaiBlock", () => !0), i = filter(o, a), l = groupBy(i, "category"), c = uniq(map(l.core, "group"));
|
|
7359
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ChaiBuilderBlocks, { gridCols: n, parentId: r, groups: c, blocks: l.core });
|
|
7360
|
+
}, CORE_GROUPS = ["basic", "typography", "media", "layout", "form", "advanced", "other"], ChaiBuilderBlocks = ({ groups: r, blocks: n, parentId: o, gridCols: a = "grid-cols-4" }) => {
|
|
7361
|
+
var u;
|
|
7362
|
+
const { t: i } = useTranslation(), [l] = useBlocksStore(), c = (u = find(l, (d) => d._id === o)) == null ? void 0 : u._type;
|
|
7360
7363
|
return React__default.Children.toArray(
|
|
7361
7364
|
map(
|
|
7362
|
-
sortBy(r, (
|
|
7363
|
-
(
|
|
7364
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize hover:no-underline", children: capitalize(
|
|
7365
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "mx-auto max-w-xl p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid
|
|
7366
|
-
reject(filter(values(n), { group:
|
|
7365
|
+
sortBy(r, (d) => CORE_GROUPS.indexOf(d) === -1 ? 99 : CORE_GROUPS.indexOf(d)),
|
|
7366
|
+
(d) => reject(filter(values(n), { group: d }), { hidden: !0 }).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", value: d, collapsible: !0, className: "w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: d, children: [
|
|
7367
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize hover:no-underline", children: capitalize(i(d.toLowerCase())) }),
|
|
7368
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "mx-auto max-w-xl p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid gap-2 " + a, children: React__default.Children.toArray(
|
|
7369
|
+
reject(filter(values(n), { group: d }), { hidden: !0 }).map((p) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7367
7370
|
CoreBlock,
|
|
7368
7371
|
{
|
|
7369
7372
|
parentId: o,
|
|
7370
|
-
block:
|
|
7371
|
-
disabled: !canAcceptChildBlock(
|
|
7373
|
+
block: p,
|
|
7374
|
+
disabled: !canAcceptChildBlock(c, p.type) || !canBeNestedInside(c, p.type)
|
|
7372
7375
|
}
|
|
7373
7376
|
))
|
|
7374
7377
|
) }) })
|
|
@@ -7380,10 +7383,8 @@ const CoreBlock = ({ block: r, disabled: n, parentId: o }) => {
|
|
|
7380
7383
|
showHeading: n = !0,
|
|
7381
7384
|
parentId: o = void 0
|
|
7382
7385
|
}) => {
|
|
7383
|
-
const { t: a } = useTranslation(), [i, l] = useState$1("library"), [
|
|
7384
|
-
return
|
|
7385
|
-
!includes(x, c) && !isEmpty(x) && !isEmpty(c) && u(first(x));
|
|
7386
|
-
}, [x, c]), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full flex-col overflow-hidden", r), children: [
|
|
7386
|
+
const { t: a } = useTranslation(), [i, l] = useState$1("library"), [, c] = useAtom$1(showPredefinedBlockCategoryAtom), u = useBuilderProp("importHTMLSupport", !0);
|
|
7387
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full flex-col overflow-hidden", r), children: [
|
|
7387
7388
|
n ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
7388
7389
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: a("add_block") }),
|
|
7389
7390
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: a(i === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
@@ -7391,21 +7392,21 @@ const CoreBlock = ({ block: r, disabled: n, parentId: o }) => {
|
|
|
7391
7392
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7392
7393
|
Tabs$1,
|
|
7393
7394
|
{
|
|
7394
|
-
onValueChange: (
|
|
7395
|
-
|
|
7395
|
+
onValueChange: (d) => {
|
|
7396
|
+
c(""), l(d);
|
|
7396
7397
|
},
|
|
7397
7398
|
value: i,
|
|
7398
|
-
className: cn("h-max",
|
|
7399
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList$1, { className: "grid w-full " + (
|
|
7399
|
+
className: cn("h-max", u ? "" : "hidden"),
|
|
7400
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList$1, { className: "grid w-full " + (u ? "grid-cols-3" : "grid-cols-1"), children: [
|
|
7400
7401
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "library", children: a("library") }),
|
|
7401
7402
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "core", children: a("blocks") }),
|
|
7402
|
-
|
|
7403
|
+
u ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "html", children: a("import") }) : null
|
|
7403
7404
|
] })
|
|
7404
7405
|
}
|
|
7405
7406
|
),
|
|
7406
|
-
i === "core" && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7407
|
+
i === "core" && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultChaiBlocks, { gridCols: "grid-cols-4", parentId: o }) }) }),
|
|
7407
7408
|
i === "library" && /* @__PURE__ */ jsxRuntimeExports.jsx(UILibraries, { parentId: o }),
|
|
7408
|
-
i === "html" &&
|
|
7409
|
+
i === "html" && u ? /* @__PURE__ */ jsxRuntimeExports.jsx(ImportHTML$1, { parentId: o }) : null
|
|
7409
7410
|
] });
|
|
7410
7411
|
}, AddBlocksPanel$1 = AddBlocksPanel;
|
|
7411
7412
|
function FaCheck(r) {
|
|
@@ -33915,7 +33916,7 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
33915
33916
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
33916
33917
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
|
|
33917
33918
|
] }) });
|
|
33918
|
-
}, SettingsPanel$1 = SettingsPanel, TopBar = lazy(() => import("./Topbar-
|
|
33919
|
+
}, SettingsPanel$1 = SettingsPanel, TopBar = lazy(() => import("./Topbar-qT5SdMRK.js")), menuItems = [
|
|
33919
33920
|
{ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }), label: "sidebar.outline", component: Outline$1 },
|
|
33920
33921
|
{ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, { size: 16 }), label: "sidebar.edit_block", component: SettingsPanel$1 },
|
|
33921
33922
|
{ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LightningBoltIcon, { className: "size-5" }), label: "sidebar.ai_assistant", component: AskAI },
|
|
@@ -34036,43 +34037,44 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
34036
34037
|
] }) }) });
|
|
34037
34038
|
};
|
|
34038
34039
|
export {
|
|
34039
|
-
|
|
34040
|
+
useSelectedBlock as $,
|
|
34040
34041
|
AddBlocksPanel$1 as A,
|
|
34041
34042
|
BlockSettings as B,
|
|
34042
34043
|
ChaiSelect$1 as C,
|
|
34043
|
-
|
|
34044
|
-
|
|
34044
|
+
DefaultChaiBlocks as D,
|
|
34045
|
+
useAddClassesToBlocks as E,
|
|
34045
34046
|
FaCheck as F,
|
|
34046
|
-
|
|
34047
|
-
|
|
34047
|
+
useCanvasWidth as G,
|
|
34048
|
+
useCanvasZoom as H,
|
|
34048
34049
|
ImportHTML$1 as I,
|
|
34049
|
-
|
|
34050
|
-
|
|
34051
|
-
|
|
34052
|
-
|
|
34053
|
-
|
|
34050
|
+
useCopyBlockIds as J,
|
|
34051
|
+
useCopyToClipboard as K,
|
|
34052
|
+
useCurrentPage as L,
|
|
34053
|
+
useCutBlockIds as M,
|
|
34054
|
+
useDarkMode as N,
|
|
34054
34055
|
Outline$1 as O,
|
|
34055
|
-
|
|
34056
|
-
|
|
34057
|
-
|
|
34058
|
-
|
|
34056
|
+
useDuplicateBlocks as P,
|
|
34057
|
+
useGetPageData as Q,
|
|
34058
|
+
useHiddenBlockIds as R,
|
|
34059
|
+
useHighlightBlockId as S,
|
|
34059
34060
|
ThemeOptions as T,
|
|
34060
34061
|
UILibraries as U,
|
|
34061
|
-
|
|
34062
|
-
|
|
34063
|
-
|
|
34064
|
-
|
|
34065
|
-
|
|
34066
|
-
|
|
34062
|
+
usePasteBlocks as V,
|
|
34063
|
+
useBrandingOptions as W,
|
|
34064
|
+
useRemoveBlocks as X,
|
|
34065
|
+
useRemoveClassesFromBlocks as Y,
|
|
34066
|
+
useSelectedBlockCurrentClasses as Z,
|
|
34067
|
+
useSelectedBlockAllClasses as _,
|
|
34067
34068
|
useSelectedBlockIds as a,
|
|
34068
|
-
|
|
34069
|
-
|
|
34070
|
-
|
|
34071
|
-
|
|
34072
|
-
|
|
34073
|
-
|
|
34074
|
-
|
|
34075
|
-
|
|
34069
|
+
useStylingBreakpoint as a0,
|
|
34070
|
+
useUILibraryBlocks as a1,
|
|
34071
|
+
useStylingState as a2,
|
|
34072
|
+
useSelectedBlocksDisplayChild as a3,
|
|
34073
|
+
useAllBlocks as a4,
|
|
34074
|
+
useActivePanel as a5,
|
|
34075
|
+
useAddBlockParent as a6,
|
|
34076
|
+
useSelectedBreakpoints as a7,
|
|
34077
|
+
useSelectedStylingBlocks as a8,
|
|
34076
34078
|
useUpdateBlocksProps as b,
|
|
34077
34079
|
useUpdateBlocksPropsRealtime as c,
|
|
34078
34080
|
useBuilderProp as d,
|
|
@@ -34087,15 +34089,15 @@ export {
|
|
|
34087
34089
|
AIUserPrompt as m,
|
|
34088
34090
|
BlockAttributesEditor as n,
|
|
34089
34091
|
ChaiBuilderEditor as o,
|
|
34090
|
-
|
|
34091
|
-
|
|
34092
|
-
|
|
34093
|
-
|
|
34094
|
-
|
|
34092
|
+
DarkMode as p,
|
|
34093
|
+
Breakpoints as q,
|
|
34094
|
+
UndoRedo as r,
|
|
34095
|
+
getBlocksFromHTML as s,
|
|
34096
|
+
useBlocksStore as t,
|
|
34095
34097
|
useCodeEditor as u,
|
|
34096
|
-
|
|
34097
|
-
|
|
34098
|
-
|
|
34099
|
-
|
|
34100
|
-
|
|
34098
|
+
useUndoManager as v,
|
|
34099
|
+
useBuilderReset as w,
|
|
34100
|
+
useReadOnlyMode as x,
|
|
34101
|
+
useActiveModal as y,
|
|
34102
|
+
useAddBlock as z
|
|
34101
34103
|
};
|