@chaibuilder/sdk 1.3.0-beta.5 → 1.3.0-beta.6

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.
@@ -206,10 +206,10 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
206
206
  }
207
207
  }, x = (k) => returnAtomValue(p(k)), m = (k) => {
208
208
  let A = n.get(k);
209
- return A || (A = R(k)), A;
209
+ return A || (A = C(k)), A;
210
210
  }, g = (k, A) => !A.l.size && (!A.t.size || A.t.size === 1 && A.t.has(k)), b = (k) => {
211
211
  const A = n.get(k);
212
- A && g(k, A) && C(k);
212
+ A && g(k, A) && R(k);
213
213
  }, j = (k) => {
214
214
  const A = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new WeakMap(), E = (S) => {
215
215
  const N = n.get(S);
@@ -257,20 +257,20 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
257
257
  }, v = (k, ...A) => {
258
258
  const B = f(k, ...A);
259
259
  return w(), B;
260
- }, R = (k, A) => {
260
+ }, C = (k, A) => {
261
261
  const B = {
262
262
  t: new Set(A && [A]),
263
263
  l: /* @__PURE__ */ new Set()
264
264
  };
265
265
  if (n.set(k, B), p(k).d.forEach((E, _) => {
266
266
  const S = n.get(_);
267
- S ? S.t.add(k) : _ !== k && R(_, k);
267
+ S ? S.t.add(k) : _ !== k && C(_, k);
268
268
  }), p(k), isActuallyWritableAtom(k) && k.onMount) {
269
269
  const E = k.onMount((..._) => v(k, ..._));
270
270
  E && (B.u = E);
271
271
  }
272
272
  return B;
273
- }, C = (k) => {
273
+ }, R = (k) => {
274
274
  var A;
275
275
  const B = (A = n.get(k)) == null ? void 0 : A.u;
276
276
  B && B(), n.delete(k);
@@ -278,7 +278,7 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
278
278
  E && (hasPromiseAtomValue(E) && cancelPromise(E.v), E.d.forEach((_, S) => {
279
279
  if (S !== k) {
280
280
  const N = n.get(S);
281
- N && (N.t.delete(k), g(S, N) && C(S));
281
+ N && (N.t.delete(k), g(S, N) && R(S));
282
282
  }
283
283
  }));
284
284
  }, I = (k, A, B) => {
@@ -289,10 +289,10 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
289
289
  return;
290
290
  }
291
291
  const N = n.get(S);
292
- N && (N.t.delete(k), g(S, N) && C(S));
292
+ N && (N.t.delete(k), g(S, N) && R(S));
293
293
  }), E.forEach((_) => {
294
294
  const S = n.get(_);
295
- S ? S.t.add(k) : n.has(k) && R(_, k);
295
+ S ? S.t.add(k) : n.has(k) && C(_, k);
296
296
  });
297
297
  }, w = () => {
298
298
  for (; r.size; ) {
@@ -343,8 +343,8 @@ function splitAtom(o, n) {
343
343
  x[b] = f;
344
344
  return;
345
345
  }
346
- const v = (C) => {
347
- const I = C(l), w = C(o), k = a(w, I == null ? void 0 : I.arr).keyList.indexOf(j);
346
+ const v = (R) => {
347
+ const I = R(l), w = R(o), k = a(w, I == null ? void 0 : I.arr).keyList.indexOf(j);
348
348
  if (k < 0 || k >= w.length) {
349
349
  const A = c[a(c).keyList.indexOf(j)];
350
350
  if (A)
@@ -352,8 +352,8 @@ function splitAtom(o, n) {
352
352
  throw new Error("splitAtom: index out of bounds for read");
353
353
  }
354
354
  return w[k];
355
- }, R = (C, I, w) => {
356
- const T = C(l), k = C(o), B = a(k, T == null ? void 0 : T.arr).keyList.indexOf(j);
355
+ }, C = (R, I, w) => {
356
+ const T = R(l), k = R(o), B = a(k, T == null ? void 0 : T.arr).keyList.indexOf(j);
357
357
  if (B < 0 || B >= k.length)
358
358
  throw new Error("splitAtom: index out of bounds for write");
359
359
  const E = isFunction(w) ? w(k[B]) : w;
@@ -363,7 +363,7 @@ function splitAtom(o, n) {
363
363
  ...k.slice(B + 1)
364
364
  ]);
365
365
  };
366
- x[b] = isWritable(o) ? atom(v, R) : atom(v);
366
+ x[b] = isWritable(o) ? atom(v, C) : atom(v);
367
367
  }), p && p.keyList.length === m.length && p.keyList.every((g, b) => g === m[b]) ? u = p : u = { arr: c, atomList: x, keyList: m }, r.set(c, u), u;
368
368
  }, l = atom((c) => {
369
369
  const d = c(l), u = c(o);
@@ -1152,12 +1152,12 @@ const useBlocksStoreManager = () => {
1152
1152
  } = useBlocksStoreManager();
1153
1153
  return {
1154
1154
  moveBlocks: (j, f, v) => {
1155
- const R = map(j, (I) => {
1155
+ const C = map(j, (I) => {
1156
1156
  const T = n.find((B) => B._id === I)._parent || null, A = n.filter((B) => T ? B._parent === T : !B._parent).map((B) => B._id).indexOf(I);
1157
1157
  return { _id: I, oldParent: T, oldPosition: A };
1158
- }), C = R.find(({ _id: I }) => I === j[0]);
1159
- C && C.oldParent === f && C.oldPosition === v || (i(j, f, v), o({
1160
- undo: () => each(R, ({ _id: I, oldParent: w, oldPosition: T }) => {
1158
+ }), R = C.find(({ _id: I }) => I === j[0]);
1159
+ R && R.oldParent === f && R.oldPosition === v || (i(j, f, v), o({
1160
+ undo: () => each(C, ({ _id: I, oldParent: w, oldPosition: T }) => {
1161
1161
  i([I], w, T);
1162
1162
  }),
1163
1163
  redo: () => i(j, f, v)
@@ -1170,27 +1170,27 @@ const useBlocksStoreManager = () => {
1170
1170
  });
1171
1171
  },
1172
1172
  removeBlocks: (j) => {
1173
- var C;
1174
- const f = (C = first(j)) == null ? void 0 : C._parent, R = n.filter((I) => f ? I._parent === f : !I._parent).indexOf(first(j));
1173
+ var R;
1174
+ const f = (R = first(j)) == null ? void 0 : R._parent, C = n.filter((I) => f ? I._parent === f : !I._parent).indexOf(first(j));
1175
1175
  l(map(j, "_id")), o({
1176
- undo: () => a(j, f, R),
1176
+ undo: () => a(j, f, C),
1177
1177
  redo: () => l(map(j, "_id"))
1178
1178
  });
1179
1179
  },
1180
1180
  updateBlocks: (j, f, v) => {
1181
- let R = [];
1181
+ let C = [];
1182
1182
  if (v)
1183
- R = map(j, (C) => ({ _id: C, ...v }));
1183
+ C = map(j, (R) => ({ _id: R, ...v }));
1184
1184
  else {
1185
- const C = keys(f);
1186
- R = map(j, (I) => {
1185
+ const R = keys(f);
1186
+ C = map(j, (I) => {
1187
1187
  const w = n.find((k) => k._id === I), T = { _id: I };
1188
- return each(C, (k) => T[k] = w[k]), T;
1188
+ return each(R, (k) => T[k] = w[k]), T;
1189
1189
  });
1190
1190
  }
1191
- c(map(j, (C) => ({ _id: C, ...f }))), o({
1192
- undo: () => c(R),
1193
- redo: () => c(map(j, (C) => ({ _id: C, ...f })))
1191
+ c(map(j, (R) => ({ _id: R, ...f }))), o({
1192
+ undo: () => c(C),
1193
+ redo: () => c(map(j, (R) => ({ _id: R, ...f })))
1194
1194
  });
1195
1195
  },
1196
1196
  updateBlocksRuntime: (j, f) => {
@@ -1205,8 +1205,8 @@ const useBlocksStoreManager = () => {
1205
1205
  updateMultipleBlocksProps: (j) => {
1206
1206
  let f = [];
1207
1207
  f = map(j, (v) => {
1208
- const R = keys(v), C = n.find((w) => w._id === v._id), I = {};
1209
- return each(R, (w) => I[w] = C[w]), I;
1208
+ const C = keys(v), R = n.find((w) => w._id === v._id), I = {};
1209
+ return each(C, (w) => I[w] = R[w]), I;
1210
1210
  }), c(j), o({
1211
1211
  undo: () => c(f),
1212
1212
  redo: () => c(j)
@@ -1237,16 +1237,16 @@ const useBlocksStoreManager = () => {
1237
1237
  return a(v, c, d);
1238
1238
  }
1239
1239
  const u = generateUUID(), p = getBlockDefaultProps(i.props), x = [];
1240
- forIn(p, (v, R) => {
1240
+ forIn(p, (v, C) => {
1241
1241
  if (startsWith(v, SLOT_KEY)) {
1242
- const C = v.replace(SLOT_KEY, "");
1242
+ const R = v.replace(SLOT_KEY, "");
1243
1243
  x.push({
1244
- _id: C,
1244
+ _id: R,
1245
1245
  _type: "Slot",
1246
1246
  _parent: u,
1247
- _name: i.props[R].name,
1248
- _styles: i.props[R].styles,
1249
- _emptyStyles: i.props[R].emptyStyles
1247
+ _name: i.props[C].name,
1248
+ _styles: i.props[C].styles,
1249
+ _emptyStyles: i.props[C].emptyStyles
1250
1250
  });
1251
1251
  }
1252
1252
  });
@@ -3068,8 +3068,8 @@ const useDnd = () => {
3068
3068
  }
3069
3069
  const g = dropTarget, j = getOrientation(g) === "vertical" ? m.clientY + ((I = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : I.scrollY) : m.clientX;
3070
3070
  dropIndex = calculateDropIndex(j, possiblePositions);
3071
- const f = d, v = g.getAttribute("data-block-id"), R = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3072
- if ((f == null ? void 0 : f._id) === v || !R || !canDropInTarget(dropTarget, d)) {
3071
+ const f = d, v = g.getAttribute("data-block-id"), C = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3072
+ if ((f == null ? void 0 : f._id) === v || !C || !canDropInTarget(dropTarget, d)) {
3073
3073
  x();
3074
3074
  return;
3075
3075
  }
@@ -3077,8 +3077,8 @@ const useDnd = () => {
3077
3077
  a(f, v === "canvas" ? null : v, dropIndex), setTimeout(x, 300);
3078
3078
  return;
3079
3079
  }
3080
- let C = g.getAttribute("data-block-id");
3081
- C === null && (C = m.target.parentElement.getAttribute("data-block-id")), c([f._id], C === "canvas" ? null : C, dropIndex), x(), setTimeout(removePlaceholder, 300);
3080
+ let R = g.getAttribute("data-block-id");
3081
+ R === null && (R = m.target.parentElement.getAttribute("data-block-id")), c([f._id], R === "canvas" ? null : R, dropIndex), x(), setTimeout(removePlaceholder, 300);
3082
3082
  },
3083
3083
  onDragEnter: (m) => {
3084
3084
  const g = m, b = g.target;
@@ -3291,53 +3291,7 @@ const useHandleCanvasDblClick = () => {
3291
3291
  ]
3292
3292
  }
3293
3293
  ) });
3294
- }, googleFontsMap = {
3295
- Montserrat: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3296
- Roboto: [100, 300, 400, 500, 700, 900],
3297
- "Open Sans": [300, 400, 600, 700, 800],
3298
- Lato: [100, 300, 400, 700, 900],
3299
- Poppins: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3300
- Inter: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3301
- Nunito: [200, 300, 400, 600, 700, 800, 900],
3302
- Oswald: [200, 300, 400, 500, 600, 700],
3303
- Raleway: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3304
- Ubuntu: [300, 400, 500, 700],
3305
- "Source Sans Pro": [200, 300, 400, 600, 700, 900],
3306
- "Noto Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3307
- "Work Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3308
- "Playfair Display": [400, 500, 600, 700, 800, 900],
3309
- "DM Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3310
- Merriweather: [300, 400, 700, 900],
3311
- Lora: [400, 500, 600, 700],
3312
- "PT Serif": [400, 700],
3313
- "Roboto Mono": [100, 200, 300, 400, 500, 600, 700],
3314
- "Source Code Pro": [200, 300, 400, 500, 600, 700, 800, 900],
3315
- Quicksand: [300, 400, 500, 600, 700],
3316
- Manrope: [200, 300, 400, 500, 600, 700, 800],
3317
- "Space Grotesk": [300, 400, 500, 600, 700],
3318
- "Plus Jakarta Sans": [200, 300, 400, 500, 600, 700, 800],
3319
- "Varela Round": [400],
3320
- Comfortaa: [300, 400, 500, 600, 700],
3321
- Barlow: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3322
- Mulish: [200, 300, 400, 500, 600, 700, 800, 900],
3323
- Rubik: [300, 400, 500, 600, 700, 800, 900],
3324
- Outfit: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3325
- "Fira Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3326
- "Josefin Sans": [100, 200, 300, 400, 500, 600, 700],
3327
- "Be Vietnam Pro": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3328
- Urbanist: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3329
- "IBM Plex Sans": [100, 200, 300, 400, 500, 600, 700],
3330
- "Red Hat Display": [300, 400, 500, 600, 700, 800, 900],
3331
- "Red Hat Text": [300, 400, 500, 600, 700],
3332
- Sora: [100, 200, 300, 400, 500, 600, 700, 800],
3333
- Karla: [200, 300, 400, 500, 600, 700, 800],
3334
- "Albert Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3335
- "Public Sans": [100, 200, 300, 400, 500, 600, 700, 800, 900],
3336
- Figtree: [300, 400, 500, 600, 700, 800, 900],
3337
- Cabin: [400, 500, 600, 700],
3338
- Bitter: [100, 200, 300, 400, 500, 600, 700, 800, 900],
3339
- Lexend: [100, 200, 300, 400, 500, 600, 700, 800, 900]
3340
- }, getFontWeights = (o) => googleFontsMap[o] || [300, 400, 500, 600, 700, 800, 900], HeadTags = () => {
3294
+ }, HeadTags = () => {
3341
3295
  const [o] = useBrandingOptions(), [n] = useSelectedBlockIds(), [r] = useDarkMode(), a = useAtomValue$1(arbitraryFontsAtom), [l] = useSelectedStylingBlocks(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), { document: d, window: u } = useFrame(), [p] = useState(d == null ? void 0 : d.getElementById("highlighted-block")), [x] = useState(
3342
3296
  d == null ? void 0 : d.getElementById("selected-block")
3343
3297
  ), [m] = useState(
@@ -3350,14 +3304,14 @@ const useHandleCanvasDblClick = () => {
3350
3304
  }, [r, d]);
3351
3305
  const b = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
3352
3306
  return useEffect(() => {
3353
- const f = get(o, "primaryColor", "#000"), v = get(o, "secondaryColor", "#FFF"), R = get(o, "bodyBgLightColor", "#fff"), C = get(o, "bodyBgDarkColor", "#000"), I = get(o, "bodyTextDarkColor", "#000"), w = get(o, "bodyTextLightColor", "#fff"), T = s({
3307
+ const f = get(o, "primaryColor", "#000"), v = get(o, "secondaryColor", "#FFF"), C = get(o, "bodyBgLightColor", "#fff"), R = get(o, "bodyBgDarkColor", "#000"), I = get(o, "bodyTextDarkColor", "#000"), w = get(o, "bodyTextLightColor", "#fff"), T = s({
3354
3308
  colors: [f, v],
3355
3309
  names: ["primary", "secondary"]
3356
3310
  });
3357
3311
  set(T, "primary.DEFAULT", f), set(T, "secondary.DEFAULT", v);
3358
3312
  const k = {
3359
- "bg-light": R,
3360
- "bg-dark": C,
3313
+ "bg-light": C,
3314
+ "bg-dark": R,
3361
3315
  "text-dark": I,
3362
3316
  "text-light": w
3363
3317
  }, A = get(o, "roundedCorners", "0");
@@ -3430,10 +3384,7 @@ const useHandleCanvasDblClick = () => {
3430
3384
  "link",
3431
3385
  {
3432
3386
  rel: "stylesheet",
3433
- href: `https://fonts.googleapis.com/css2?${a.map((f) => f.replace(/_/g, "+")).map((f) => {
3434
- const v = f.replace(/\+/g, " "), R = getFontWeights(v);
3435
- return `family=${f}:wght@${R.join(";")}`;
3436
- }).join("&")}&display=swap`
3387
+ href: `https://fonts.googleapis.com/css2?${a.map((f) => f.replace(/_/g, "+")).map((f) => `family=${f}`).join("&")}&display=swap`
3437
3388
  }
3438
3389
  )
3439
3390
  ] });
@@ -3551,19 +3502,19 @@ function applyLanguage(o, n, r) {
3551
3502
  }
3552
3503
  function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
3553
3504
  const { selectedLang: r } = useLanguages(), [a] = useAtom$1(xShowBlocksAtom), [l] = useCutBlockIds(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), [, d] = useCanvasWidth(), [u] = useCanvasSettings(), [p] = useHiddenBlockIds(), { getGlobalBlocks: x } = useGlobalBlocksStore(), m = useCallback((f) => getStyleAttrs(f, d), [d]), [g] = useChaiExternalData(), [b] = useAtom$1(inlineEditingActiveAtom), j = useCallback(
3554
- (f) => f.reduce((v, R) => {
3555
- const C = get(u, R, {});
3556
- return { ...v, ...C };
3505
+ (f) => f.reduce((v, C) => {
3506
+ const R = get(u, C, {});
3507
+ return { ...v, ...R };
3557
3508
  }, {}),
3558
3509
  [u]
3559
3510
  );
3560
3511
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.toArray(
3561
3512
  o.map((f, v) => {
3562
3513
  if (b === f._id || p.includes(f._id)) return null;
3563
- const R = {}, C = filter(n, { _parent: f._id });
3564
- if (R.children = C.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: C }) : null, f._type === "GlobalBlock") {
3514
+ const C = {}, R = filter(n, { _parent: f._id });
3515
+ if (C.children = R.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: R }) : null, f._type === "GlobalBlock") {
3565
3516
  const S = x(f);
3566
- R.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(S, (N) => !N._parent), allBlocks: S });
3517
+ C.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(S, (N) => !N._parent), allBlocks: S });
3567
3518
  }
3568
3519
  const I = getBlockComponent(f._type), w = get(I, "server", !1), T = w ? RSCBlock : get(I, "builderComponent", get(I, "component", null));
3569
3520
  if (isNull(T)) return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${f == null ? void 0 : f._type} not registered -->` });
@@ -3589,7 +3540,7 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
3589
3540
  index: v,
3590
3541
  ...applyBindings(applyLanguage(f, r, I), g),
3591
3542
  ...omit(B, ["__isHidden"]),
3592
- ...R,
3543
+ ...C,
3593
3544
  inBuilder: !0,
3594
3545
  blockState: A
3595
3546
  }) });
@@ -3642,7 +3593,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3642
3593
  };
3643
3594
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", onClick: d, className: "h-full w-full p-8 pb-0", ref: i, children: o });
3644
3595
  }, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
3645
- const [o] = useCanvasWidth(), [, n] = useSelectedBlockIds(), r = useSelectedBlock(), [, a] = useHighlightBlockId(), l = useRef(null), i = useRef(null), [c, d] = useState({ width: 0, height: 0 }), u = useCanvasScale(c), [p, x] = useState([]), [, m] = useState([]), [, g] = useAtom$1(canvasIframeAtom), [b, j] = useSelectedStylingBlocks(), f = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), R = (w) => {
3596
+ const [o] = useCanvasWidth(), [, n] = useSelectedBlockIds(), r = useSelectedBlock(), [, a] = useHighlightBlockId(), l = useRef(null), i = useRef(null), [c, d] = useState({ width: 0, height: 0 }), u = useCanvasScale(c), [p, x] = useState([]), [, m] = useState([]), [, g] = useAtom$1(canvasIframeAtom), [b, j] = useSelectedStylingBlocks(), f = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), C = (w) => {
3646
3597
  d((T) => ({ ...T, width: w }));
3647
3598
  };
3648
3599
  useEffect(() => {
@@ -3650,7 +3601,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3650
3601
  const { clientWidth: w, clientHeight: T } = i.current;
3651
3602
  d({ width: w, height: T });
3652
3603
  }, [i, o]);
3653
- const C = (w, T = 0) => {
3604
+ const R = (w, T = 0) => {
3654
3605
  const { top: k } = w.getBoundingClientRect();
3655
3606
  return k + T >= 0 && k - T <= window.innerHeight;
3656
3607
  };
@@ -3658,7 +3609,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3658
3609
  var w, T;
3659
3610
  if (r && r.type !== "Multiple" && l.current) {
3660
3611
  const k = getElementByDataBlockId(l.current.contentDocument, r._id);
3661
- k && (C(k) || (T = (w = l.current) == null ? void 0 : w.contentWindow) == null || T.scrollTo({ top: k.offsetTop, behavior: "smooth" }), x([k]));
3612
+ k && (R(k) || (T = (w = l.current) == null ? void 0 : w.contentWindow) == null || T.scrollTo({ top: k.offsetTop, behavior: "smooth" }), x([k]));
3662
3613
  }
3663
3614
  }, [r]), useEffect(() => {
3664
3615
  if (!isEmpty(b) && l.current) {
@@ -3674,7 +3625,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3674
3625
  let w = IframeInitialContent;
3675
3626
  return w = w.replace("__HTML_DIR__", v), w;
3676
3627
  }, [v]);
3677
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: R, onResize: R, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3628
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: C, onResize: C, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3678
3629
  "div",
3679
3630
  {
3680
3631
  onClick: () => {
@@ -3813,7 +3764,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3813
3764
  l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
3814
3765
  ] }, l))
3815
3766
  ] }) });
3816
- }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-BTeBxM9t.js")), CanvasArea = () => {
3767
+ }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-Dg8G9eNI.js")), CanvasArea = () => {
3817
3768
  const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
3818
3769
  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: [
3819
3770
  /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas, {}) }) }),
@@ -3901,7 +3852,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3901
3852
  bodyBgLightColor: f,
3902
3853
  roundedCorners: v
3903
3854
  } = r;
3904
- let R = {
3855
+ let C = {
3905
3856
  headingFont: y({
3906
3857
  title: c("Theme Config.Heading Font"),
3907
3858
  default: p,
@@ -3919,8 +3870,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3919
3870
  primaryColor: h({ title: c("Theme Config.Primary"), default: x }),
3920
3871
  secondaryColor: h({ title: c("Theme Config.Secondary"), default: j })
3921
3872
  };
3922
- l || (R = {
3923
- ...R,
3873
+ l || (C = {
3874
+ ...C,
3924
3875
  bodyBgLightColor: h({
3925
3876
  title: c("Theme Config.Background"),
3926
3877
  default: f
@@ -3938,13 +3889,13 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3938
3889
  default: g
3939
3890
  })
3940
3891
  });
3941
- const C = {
3892
+ const R = {
3942
3893
  type: "object",
3943
3894
  properties: {}
3944
3895
  }, I = {};
3945
- return Object.keys(R).forEach((w) => {
3946
- const T = R[w];
3947
- return C.properties || (C.properties = {}), C.properties[w] = T.schema, I[w] = T.uiSchema, !0;
3896
+ return Object.keys(C).forEach((w) => {
3897
+ const T = C[w];
3898
+ return R.properties || (R.properties = {}), R.properties[w] = T.schema, I[w] = T.uiSchema, !0;
3948
3899
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
3949
3900
  o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "px-1 font-semibold", children: c("Theme Configuration") }) }) : null,
3950
3901
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -3957,7 +3908,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3957
3908
  liveOmit: !0,
3958
3909
  liveValidate: !0,
3959
3910
  uiSchema: I,
3960
- schema: C,
3911
+ schema: R,
3961
3912
  formData: r,
3962
3913
  validator,
3963
3914
  onChange: d
@@ -4164,14 +4115,14 @@ function BiExpandVertical(o) {
4164
4115
  const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4165
4116
  const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [d] = useAtom$1(canvasIframeAtom);
4166
4117
  let u = null;
4167
- const p = o.children.length > 0, { highlightBlock: x, clearHighlight: m } = useBlockHighlight(), { id: g, data: b, isSelected: j, willReceiveDrop: f, isDragging: v, isEditing: R, handleClick: C } = o, I = (E) => {
4118
+ const p = o.children.length > 0, { highlightBlock: x, clearHighlight: m } = useBlockHighlight(), { id: g, data: b, isSelected: j, willReceiveDrop: f, isDragging: v, isEditing: C, handleClick: R } = o, I = (E) => {
4168
4119
  E.stopPropagation(), !i.includes(g) && o.toggle();
4169
4120
  }, w = (E) => {
4170
4121
  E.isInternal && (u = E.isOpen, E.isOpen && E.close());
4171
4122
  }, T = (E) => {
4172
4123
  E.isInternal && u !== null && (u ? E.open() : E.close(), u = null);
4173
4124
  }, k = (E) => {
4174
- E.stopPropagation(), !o.isOpen && !i.includes(g) && o.toggle(), C(E);
4125
+ E.stopPropagation(), !o.isOpen && !i.includes(g) && o.toggle(), R(E);
4175
4126
  };
4176
4127
  useEffect(() => {
4177
4128
  const E = setTimeout(() => {
@@ -4241,7 +4192,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4241
4192
  ),
4242
4193
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
4243
4194
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: b == null ? void 0 : b._type }) }),
4244
- R ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
4195
+ C ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
4245
4196
  "div",
4246
4197
  {
4247
4198
  className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
@@ -4641,7 +4592,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4641
4592
  ...getAttrs(r),
4642
4593
  ...getStyles(r)
4643
4594
  }, r.attributes) {
4644
- const v = r.attributes.find((R) => includes(NAME_ATTRIBUTES, R.key));
4595
+ const v = r.attributes.find((C) => includes(NAME_ATTRIBUTES, C.key));
4645
4596
  v && (a._name = v.value);
4646
4597
  }
4647
4598
  if (i)
@@ -4659,14 +4610,14 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4659
4610
  ];
4660
4611
  a = {
4661
4612
  ...a,
4662
- href: ((u = l.find((R) => R.key === "href")) == null ? void 0 : u.value) || "",
4663
- hrefType: ((p = l.find((R) => R.key === "data-vbtype")) == null ? void 0 : p.value) || "video",
4664
- autoplay: ((x = l.find((R) => R.key === "data-autoplay")) == null ? void 0 : x.value) === "true",
4665
- maxWidth: ((g = (m = l.find((R) => R.key === "data-maxwidth")) == null ? void 0 : m.value) == null ? void 0 : g.replace("px", "")) || "",
4666
- backdropColor: ((b = l.find((R) => R.key === "data-overlay")) == null ? void 0 : b.value) || "",
4667
- galleryName: ((j = l.find((R) => R.key === "data-gall")) == null ? void 0 : j.value) || ""
4668
- }, forEach(v, (R) => {
4669
- has(a, `styles_attrs.${R}`) && delete a.styles_attrs[R];
4613
+ href: ((u = l.find((C) => C.key === "href")) == null ? void 0 : u.value) || "",
4614
+ hrefType: ((p = l.find((C) => C.key === "data-vbtype")) == null ? void 0 : p.value) || "video",
4615
+ autoplay: ((x = l.find((C) => C.key === "data-autoplay")) == null ? void 0 : x.value) === "true",
4616
+ maxWidth: ((g = (m = l.find((C) => C.key === "data-maxwidth")) == null ? void 0 : m.value) == null ? void 0 : g.replace("px", "")) || "",
4617
+ backdropColor: ((b = l.find((C) => C.key === "data-overlay")) == null ? void 0 : b.value) || "",
4618
+ galleryName: ((j = l.find((C) => C.key === "data-gall")) == null ? void 0 : j.value) || ""
4619
+ }, forEach(v, (C) => {
4620
+ has(a, `styles_attrs.${C}`) && delete a.styles_attrs[C];
4670
4621
  });
4671
4622
  }
4672
4623
  if (a._type === "Input") {
@@ -4676,8 +4627,8 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4676
4627
  const v = stringify([r]);
4677
4628
  return hasVideoEmbed(v) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(v)), set(a, "styles", `${STYLES_KEY},absolute top-0 left-0 w-full h-full`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = v, [a];
4678
4629
  } else if (r.tagName === "svg") {
4679
- const v = find(r.attributes, { key: "height" }), R = find(r.attributes, { key: "width" }), C = get(v, "value") ? `[${get(v, "value")}px]` : "24px", I = get(R, "value") ? `[${get(R, "value")}px]` : "24px", w = get(find(r.attributes, { key: "class" }), "value", "w-full h-full");
4680
- return a.styles = `${STYLES_KEY}, ${cn(`w-${I} h-${C}`, w)}`.trim(), r.attributes = filter(r.attributes, (T) => !includes(["style", "width", "height", "class"], T.key)), a.icon = stringify([r]), [a];
4630
+ const v = find(r.attributes, { key: "height" }), C = find(r.attributes, { key: "width" }), R = get(v, "value") ? `[${get(v, "value")}px]` : "24px", I = get(C, "value") ? `[${get(C, "value")}px]` : "24px", w = get(find(r.attributes, { key: "class" }), "value", "w-full h-full");
4631
+ return a.styles = `${STYLES_KEY}, ${cn(`w-${I} h-${R}`, w)}`.trim(), r.attributes = filter(r.attributes, (T) => !includes(["style", "width", "height", "class"], T.key)), a.icon = stringify([r]), [a];
4681
4632
  } else if (r.tagName == "option" && n && ((f = n.block) == null ? void 0 : f._type) === "Select")
4682
4633
  return n.block.options.push({
4683
4634
  label: getTextContent(r.children),
@@ -4744,7 +4695,7 @@ function ExpandableObject(o) {
4744
4695
  useEffect(() => {
4745
4696
  m.current ? j(p(d, r, n)) : m.current = !0;
4746
4697
  }, [p]);
4747
- const f = g ? u.collapseIcon : u.expandIcon, v = g ? "collapse JSON" : "expand JSON", R = useComponentId(), C = d + 1, I = a.length - 1, w = (T) => {
4698
+ const f = g ? u.collapseIcon : u.expandIcon, v = g ? "collapse JSON" : "expand JSON", C = useComponentId(), R = d + 1, I = a.length - 1, w = (T) => {
4748
4699
  T.key === " " && (T.preventDefault(), b());
4749
4700
  };
4750
4701
  return /* @__PURE__ */ createElement("div", {
@@ -4758,7 +4709,7 @@ function ExpandableObject(o) {
4758
4709
  tabIndex: 0,
4759
4710
  "aria-label": v,
4760
4711
  "aria-expanded": g,
4761
- "aria-controls": g ? R : void 0
4712
+ "aria-controls": g ? C : void 0
4762
4713
  }), n && (x ? /* @__PURE__ */ createElement("span", {
4763
4714
  className: u.clickableLabel,
4764
4715
  onClick: b,
@@ -4770,14 +4721,14 @@ function ExpandableObject(o) {
4770
4721
  }, n, ":")), /* @__PURE__ */ createElement("span", {
4771
4722
  className: u.punctuation
4772
4723
  }, i), g ? /* @__PURE__ */ createElement("div", {
4773
- id: R
4724
+ id: C
4774
4725
  }, a.map((T, k) => /* @__PURE__ */ createElement(DataRender, {
4775
4726
  key: T[0] || k,
4776
4727
  field: T[0],
4777
4728
  value: T[1],
4778
4729
  style: u,
4779
4730
  lastElement: k === I,
4780
- level: C,
4731
+ level: R,
4781
4732
  shouldExpandNode: p,
4782
4733
  clickToExpandNode: x
4783
4734
  }))) : /* @__PURE__ */ createElement("span", {
@@ -5283,7 +5234,7 @@ const ViewData = ({ data: o, fullView: n }) => {
5283
5234
  }
5284
5235
  )
5285
5236
  ] });
5286
- }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-lnZxVhFX.js")), UploadImages = React__default.lazy(() => import("./UploadImages-ybTT38Hc.js")), ImagesPanel = ({
5237
+ }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-DPqU7_If.js")), UploadImages = React__default.lazy(() => import("./UploadImages-BA3AIppS.js")), ImagesPanel = ({
5287
5238
  isModalView: o = !1,
5288
5239
  onSelect: n = () => {
5289
5240
  }
@@ -5378,11 +5329,11 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
5378
5329
  onChange: r
5379
5330
  }) => {
5380
5331
  var _;
5381
- const { t: a } = useTranslation(), l = useBuilderProp("searchCollectionItems", (S, N) => []), [i, c] = useState(!1), [d, u] = useState(!1), [p, x] = useState(!1), [m, g] = useState("pages"), [b, j] = useState(""), [f, v] = useState([]), [R, C] = useState(-1), I = useRef(null), w = (_ = n == null ? void 0 : n.find((S) => S.key === m)) == null ? void 0 : _.name;
5332
+ const { t: a } = useTranslation(), l = useBuilderProp("searchCollectionItems", (S, N) => []), [i, c] = useState(!1), [d, u] = useState(!1), [p, x] = useState(!1), [m, g] = useState("pages"), [b, j] = useState(""), [f, v] = useState([]), [C, R] = useState(-1), I = useRef(null), w = (_ = n == null ? void 0 : n.find((S) => S.key === m)) == null ? void 0 : _.name;
5382
5333
  useEffect(() => {
5383
5334
  if (!o || d || !startsWith(o, "collection:") || i) return;
5384
5335
  const S = split(o, ":"), N = get(S, 1, "pages") || "pages";
5385
- g(N), j(""), v([]), C(-1), (async () => {
5336
+ g(N), j(""), v([]), R(-1), (async () => {
5386
5337
  u(!0);
5387
5338
  const L = await l(N, [get(S, 2, "pages")]);
5388
5339
  L && Array.isArray(L) && j(get(L, [0, "name"], "")), c(!0), u(!1);
@@ -5396,24 +5347,24 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
5396
5347
  const N = await l(m, S);
5397
5348
  v(N);
5398
5349
  }
5399
- u(!1), C(-1);
5350
+ u(!1), R(-1);
5400
5351
  },
5401
5352
  [m],
5402
5353
  300
5403
5354
  ), k = (S) => {
5404
5355
  const N = ["collection", m, S.id];
5405
- N[1] && (r(N.join(":")), j(S.name), x(!1), v([]), C(-1));
5356
+ N[1] && (r(N.join(":")), j(S.name), x(!1), v([]), R(-1));
5406
5357
  }, A = (S) => {
5407
5358
  switch (S.key) {
5408
5359
  case "ArrowDown":
5409
- S.preventDefault(), C((N) => N < f.length - 1 ? N + 1 : N);
5360
+ S.preventDefault(), R((N) => N < f.length - 1 ? N + 1 : N);
5410
5361
  break;
5411
5362
  case "ArrowUp":
5412
- S.preventDefault(), C((N) => N > 0 ? N - 1 : N);
5363
+ S.preventDefault(), R((N) => N > 0 ? N - 1 : N);
5413
5364
  break;
5414
5365
  case "Enter":
5415
5366
  if (S.preventDefault(), f.length === 0) return;
5416
- R >= 0 && k(f[R]);
5367
+ C >= 0 && k(f[C]);
5417
5368
  break;
5418
5369
  case "Escape":
5419
5370
  S.preventDefault(), B();
@@ -5421,13 +5372,13 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
5421
5372
  }
5422
5373
  };
5423
5374
  useEffect(() => {
5424
- if (R >= 0 && I.current) {
5425
- const S = I.current.children[R];
5375
+ if (C >= 0 && I.current) {
5376
+ const S = I.current.children[C];
5426
5377
  S == null || S.scrollIntoView({ block: "nearest" });
5427
5378
  }
5428
- }, [R]);
5379
+ }, [C]);
5429
5380
  const B = () => {
5430
- j(""), v([]), C(-1), x(!1), r("");
5381
+ j(""), v([]), R(-1), x(!1), r("");
5431
5382
  }, E = (S) => {
5432
5383
  j(S), x(!isEmpty(S)), u(!0), T(S);
5433
5384
  };
@@ -5459,7 +5410,7 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
5459
5410
  "li",
5460
5411
  {
5461
5412
  onClick: () => k(S),
5462
- className: `cursor-pointer p-2 text-xs ${o != null && o.includes(S.id) ? "bg-blue-200" : N === R ? "bg-gray-100" : "hover:bg-gray-100"}`,
5413
+ className: `cursor-pointer p-2 text-xs ${o != null && o.includes(S.id) ? "bg-blue-200" : N === C ? "bg-gray-100" : "hover:bg-gray-100"}`,
5463
5414
  children: [
5464
5415
  S.name,
5465
5416
  " ",
@@ -5651,28 +5602,28 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
5651
5602
  }), a;
5652
5603
  };
5653
5604
  function BlockSettings() {
5654
- const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: f }, v, R) => {
5605
+ const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: f }, v, C) => {
5655
5606
  if (v && (c == null ? void 0 : c._id) === n._id) {
5656
- const C = v.replace("root.", "");
5657
- a([n._id], { [C]: get(f, C) }, R);
5607
+ const R = v.replace("root.", "");
5608
+ a([n._id], { [R]: get(f, R) }, C);
5658
5609
  }
5659
5610
  }, x = useCallback(
5660
- debounce(({ formData: f }, v, R) => {
5661
- p({ formData: f }, v, R), d(f);
5611
+ debounce(({ formData: f }, v, C) => {
5612
+ p({ formData: f }, v, C), d(f);
5662
5613
  }, 1500),
5663
5614
  [n == null ? void 0 : n._id, o]
5664
5615
  ), m = ({ formData: f }, v) => {
5665
5616
  if (v) {
5666
- const R = v.replace("root.", "");
5617
+ const C = v.replace("root.", "");
5667
5618
  r(
5668
5619
  [n._id],
5669
- convertDotNotationToObject(R, get(f, R.split(".")))
5670
- ), x({ formData: f }, v, { [R]: get(c, R) });
5620
+ convertDotNotationToObject(C, get(f, C.split(".")))
5621
+ ), x({ formData: f }, v, { [C]: get(c, C) });
5671
5622
  }
5672
5623
  }, g = keys(get(i, "_bindings", {})), b = useMemo(() => {
5673
5624
  const f = cloneDeep(get(l, "props", {}));
5674
- return each(f, (v, R) => {
5675
- get(v, "hidden", !1) && delete f[R];
5625
+ return each(f, (v, C) => {
5626
+ get(v, "hidden", !1) && delete f[C];
5676
5627
  }), u && each(g, (v) => delete f[v]), f;
5677
5628
  }, [l, g, u]), j = get(l, "server", !1);
5678
5629
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-x-hidden px-px", children: [
@@ -5763,12 +5714,12 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
5763
5714
  try {
5764
5715
  const f = m === "content" ? cloneDeep(getBlockWithChildren(g, d)) : [cloneDeep(d.find((w) => w._id === g))];
5765
5716
  set(f, "0._parent", null);
5766
- const v = u === p ? "" : u, R = await l(m, promptWithLanguage(b, x, m), f, v), { blocks: C, error: I } = R;
5717
+ const v = u === p ? "" : u, C = await l(m, promptWithLanguage(b, x, m), f, v), { blocks: R, error: I } = C;
5767
5718
  if (I) {
5768
5719
  a(I);
5769
5720
  return;
5770
5721
  }
5771
- m === "styles" ? c(C) : i(C), j && j(R);
5722
+ m === "styles" ? c(R) : i(R), j && j(C);
5772
5723
  } catch (f) {
5773
5724
  a(f);
5774
5725
  } finally {
@@ -5940,7 +5891,7 @@ function ManualClasses() {
5940
5891
  return j(map(E, "item"));
5941
5892
  }, v = () => {
5942
5893
  j([]);
5943
- }, R = (k) => k.name, C = (k) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: k.name }), I = {
5894
+ }, C = (k) => k.name, R = (k) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: k.name }), I = {
5944
5895
  autoComplete: "off",
5945
5896
  autoCorrect: "off",
5946
5897
  autoCapitalize: "off",
@@ -5994,8 +5945,8 @@ function ManualClasses() {
5994
5945
  suggestions: b,
5995
5946
  onSuggestionsFetchRequested: f,
5996
5947
  onSuggestionsClearRequested: v,
5997
- getSuggestionValue: R,
5998
- renderSuggestion: C,
5948
+ getSuggestionValue: C,
5949
+ renderSuggestion: R,
5999
5950
  inputProps: I,
6000
5951
  containerProps: {
6001
5952
  className: "relative h-8 w-full gap-y-1 py-1 border-border"
@@ -6637,7 +6588,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6637
6588
  },
6638
6589
  a
6639
6590
  )) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
6640
- const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: x } = o, [m, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [b, j] = useState(!1), [f, v] = useState(""), [R, C] = useState(!1), [I, w] = useState(!1);
6591
+ const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: x } = o, [m, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [b, j] = useState(!1), [f, v] = useState(""), [C, R] = useState(!1), [I, w] = useState(!1);
6641
6592
  useEffect(() => {
6642
6593
  const { value: E, unit: _ } = getClassValueAndUnit(i);
6643
6594
  if (_ === "") {
@@ -6688,7 +6639,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6688
6639
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }),
6689
6640
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "Current value is using a Tailwind preset class." })
6690
6641
  ] })
6691
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${R ? "z-auto" : ""}`, children: [
6642
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${C ? "z-auto" : ""}`, children: [
6692
6643
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
6693
6644
  ["none", "auto"].indexOf(m) !== -1 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
6694
6645
  "input",
@@ -6718,7 +6669,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6718
6669
  var _;
6719
6670
  (_ = E == null ? void 0 : E.target) == null || _.select(), r(!1);
6720
6671
  },
6721
- value: R ? f : a,
6672
+ value: C ? f : a,
6722
6673
  className: "h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(
6723
6674
  " ",
6724
6675
  b ? "border-red-500 text-red-500" : "border-foreground/20"
@@ -6750,12 +6701,12 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6750
6701
  ) }) })
6751
6702
  ] })
6752
6703
  ] }),
6753
- ["none", "auto"].indexOf(m) !== -1 || R ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
6704
+ ["none", "auto"].indexOf(m) !== -1 || C ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
6754
6705
  DragStyleButton,
6755
6706
  {
6756
- onDragStart: () => C(!0),
6707
+ onDragStart: () => R(!0),
6757
6708
  onDragEnd: (E) => {
6758
- if (v(() => ""), C(!1), isEmpty(E))
6709
+ if (v(() => ""), R(!1), isEmpty(E))
6759
6710
  return;
6760
6711
  const _ = `${E}`, N = `${_.startsWith("-") ? "-" : ""}${d}[${_.replace("-", "")}${m === "-" ? "" : m}]`;
6761
6712
  T(N);
@@ -6870,12 +6821,12 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6870
6821
  g(j, [E], A);
6871
6822
  },
6872
6823
  [j, u, x, p, l, g]
6873
- ), R = useCallback(() => {
6824
+ ), C = useCallback(() => {
6874
6825
  b(j, [f]);
6875
- }, [j, f, b]), C = useMemo(() => canChangeClass(m, x), [m, x]);
6826
+ }, [j, f, b]), R = useMemo(() => canChangeClass(m, x), [m, x]);
6876
6827
  useEffect(() => {
6877
- i(C, m);
6878
- }, [C, i, m]);
6828
+ i(R, m);
6829
+ }, [R, i, m]);
6879
6830
  const [, , I] = useCanvasWidth(), w = useCallback(
6880
6831
  (k) => {
6881
6832
  I({
@@ -6889,7 +6840,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6889
6840
  },
6890
6841
  [I]
6891
6842
  ), T = get(m, "dark", null) === u && get(m, "mod", null) === p && get(m, "mq", null) === x;
6892
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: C, canReset: m && T, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
6843
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: R, canReset: m && T, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
6893
6844
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${m && !T ? "text-foreground" : ""}`, children: n(a) }) }),
6894
6845
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
6895
6846
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[150px]", children: [
@@ -6909,7 +6860,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6909
6860
  r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: v }),
6910
6861
  r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: v })
6911
6862
  ] }),
6912
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: T ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => R(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && m ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
6863
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: T ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => C(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && m ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
6913
6864
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
6914
6865
  "button",
6915
6866
  {
@@ -7202,17 +7153,17 @@ const BlockCard = ({
7202
7153
  [o]
7203
7154
  ), j = async (f) => {
7204
7155
  const v = await i(n, o);
7205
- let R = r;
7206
- if (g(first(v)) && (R = null), !isEmpty(v)) {
7207
- const C = { blocks: v, uiLibrary: !0, parent: R };
7208
- if (f.dataTransfer.setData("text/plain", JSON.stringify(C)), o.preview) {
7156
+ let C = r;
7157
+ if (g(first(v)) && (C = null), !isEmpty(v)) {
7158
+ const R = { blocks: v, uiLibrary: !0, parent: C };
7159
+ if (f.dataTransfer.setData("text/plain", JSON.stringify(R)), o.preview) {
7209
7160
  const I = new Image();
7210
7161
  I.src = o.preview, I.onload = () => {
7211
7162
  f.dataTransfer.setDragImage(I, 0, 0);
7212
7163
  };
7213
7164
  } else
7214
7165
  f.dataTransfer.setDragImage(new Image(), 0, 0);
7215
- m(C), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK }), setTimeout(() => {
7166
+ m(R), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK }), setTimeout(() => {
7216
7167
  u([]), p();
7217
7168
  }, 200);
7218
7169
  }
@@ -7252,9 +7203,9 @@ const BlockCard = ({
7252
7203
  })();
7253
7204
  }, [o, l, i, c]), { data: l || [], isLoading: i === "loading" };
7254
7205
  }, UILibrarySection = ({ parentId: o }) => {
7255
- const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((C) => C.category === "custom"), c = a.find((C) => C.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [x, m] = useState("Hero"), g = get(p, x, []), b = useRef(null), { t: j } = useTranslation(), f = (C) => {
7206
+ const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((R) => R.category === "custom"), c = a.find((R) => R.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [x, m] = useState("Hero"), g = get(p, x, []), b = useRef(null), { t: j } = useTranslation(), f = (R) => {
7256
7207
  b.current && (clearTimeout(b.current), b.current = null), b.current = setTimeout(() => {
7257
- b.current && m(C);
7208
+ b.current && m(R);
7258
7209
  }, 300);
7259
7210
  };
7260
7211
  if (u)
@@ -7262,7 +7213,7 @@ const BlockCard = ({
7262
7213
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
7263
7214
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
7264
7215
  ] });
7265
- const v = filter(g, (C, I) => I % 2 === 0), R = filter(g, (C, I) => I % 2 === 1);
7216
+ const v = filter(g, (R, I) => I % 2 === 0), C = filter(g, (R, I) => I % 2 === 1);
7266
7217
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-2 flex h-full max-h-full overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
7267
7218
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
7268
7219
  /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
@@ -7270,7 +7221,7 @@ const BlockCard = ({
7270
7221
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: j("Groups") }),
7271
7222
  /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-1 border-border" }),
7272
7223
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20", children: React__default.Children.toArray(
7273
- map(p, (C, I) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
7224
+ map(p, (R, I) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
7274
7225
  "div",
7275
7226
  {
7276
7227
  onMouseEnter: () => f(I),
@@ -7298,10 +7249,10 @@ const BlockCard = ({
7298
7249
  children: [
7299
7250
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
7300
7251
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
7301
- v.map((C) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: C, library: c }))
7252
+ v.map((R) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: R, library: c }))
7302
7253
  ) }),
7303
7254
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
7304
- R.map((C) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: C, library: c }))
7255
+ C.map((R) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: R, library: c }))
7305
7256
  ) })
7306
7257
  ] }),
7307
7258
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
@@ -8421,9 +8372,9 @@ const AIUserPrompt = ({ blockId: o }) => {
8421
8372
  }, v = (w) => {
8422
8373
  const T = a.filter((k, A) => A !== w);
8423
8374
  r(T), l(T);
8424
- }, R = (w) => {
8375
+ }, C = (w) => {
8425
8376
  x(w), c(a[w].key), u(a[w].value);
8426
- }, C = () => {
8377
+ }, R = () => {
8427
8378
  if (i.startsWith("@")) {
8428
8379
  g("Attribute keys cannot start with '@'");
8429
8380
  return;
@@ -8433,14 +8384,14 @@ const AIUserPrompt = ({ blockId: o }) => {
8433
8384
  w[p] = { key: i, value: d }, r(w), l(w), x(null), c(""), u(""), g("");
8434
8385
  }
8435
8386
  }, I = (w) => {
8436
- w.key === "Enter" && !w.shiftKey && (w.preventDefault(), p !== null ? C() : f());
8387
+ w.key === "Enter" && !w.shiftKey && (w.preventDefault(), p !== null ? R() : f());
8437
8388
  };
8438
8389
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-full", children: [
8439
8390
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
8440
8391
  "form",
8441
8392
  {
8442
8393
  onSubmit: (w) => {
8443
- w.preventDefault(), p !== null ? C() : f();
8394
+ w.preventDefault(), p !== null ? R() : f();
8444
8395
  },
8445
8396
  className: "space-y-3",
8446
8397
  children: [
@@ -8493,7 +8444,7 @@ const AIUserPrompt = ({ blockId: o }) => {
8493
8444
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value.toString() })
8494
8445
  ] }),
8495
8446
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
8496
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => R(T), children: [
8447
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => C(T), children: [
8497
8448
  /* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
8498
8449
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
8499
8450
  ] }),
@@ -8929,9 +8880,9 @@ const PageDataProviders = () => {
8929
8880
  (f) => !isNull(f)
8930
8881
  ), g = (f) => {
8931
8882
  const v = find(n, { providerKey: f });
8932
- c((R) => [...R, v]), a((R) => [...R, { providerKey: v.providerKey, args: {} }]), u(""), l("UNSAVED");
8883
+ c((C) => [...C, v]), a((C) => [...C, { providerKey: v.providerKey, args: {} }]), u(""), l("UNSAVED");
8933
8884
  }, b = (f) => {
8934
- c((v) => filter(v, (R) => R.providerKey !== f.providerKey)), a((v) => filter(v, (R) => R.providerKey !== f.providerKey)), l("UNSAVED");
8885
+ c((v) => filter(v, (C) => C.providerKey !== f.providerKey)), a((v) => filter(v, (C) => C.providerKey !== f.providerKey)), l("UNSAVED");
8935
8886
  }, j = (f) => x(f);
8936
8887
  return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
8937
8888
  o("You have no data providers registered. Please add a data provider to your project."),
@@ -9028,7 +8979,7 @@ const PageDataProviders = () => {
9028
8979
  function AiFillDatabase(o) {
9029
8980
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M832 64H192c-17.7 0-32 14.3-32 32v224h704V96c0-17.7-14.3-32-32-32zM288 232c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM160 928c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V704H160v224zm128-136c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40zM160 640h704V384H160v256zm128-168c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40z" }, child: [] }] })(o);
9030
8981
  }
9031
- const TopBar = lazy(() => import("./Topbar-9jcE7VnL.js"));
8982
+ const TopBar = lazy(() => import("./Topbar-DnBBEcVI.js"));
9032
8983
  function useSidebarMenuItems(o) {
9033
8984
  const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
9034
8985
  return useMemo(() => {