@builder.io/sdk-react-nextjs 0.14.20 → 0.14.24

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.
Files changed (45) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-8d2c6823.cjs → browser/USE_CLIENT_BUNDLE-4f10369a.cjs} +2 -2
  2. package/lib/browser/{USE_CLIENT_BUNDLE-b0af90c6.js → USE_CLIENT_BUNDLE-f9d01f92.js} +21 -21
  3. package/lib/{edge/USE_SERVER_BUNDLE-c879ad04.js → browser/USE_SERVER_BUNDLE-4e9478d4.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-9e66cbc6.cjs → browser/USE_SERVER_BUNDLE-76397f77.cjs} +1 -1
  5. package/lib/browser/{bundle-12d2c3ee.cjs → bundle-35974522.cjs} +14 -14
  6. package/lib/browser/{bundle-83df769b.js → bundle-ca09c73c.js} +358 -351
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/{browser/USE_CLIENT_BUNDLE-eb52194d.cjs → edge/USE_CLIENT_BUNDLE-d7a952fe.cjs} +2 -2
  10. package/lib/{node/USE_CLIENT_BUNDLE-68277019.js → edge/USE_CLIENT_BUNDLE-edb4fc98.js} +21 -21
  11. package/lib/{node/USE_SERVER_BUNDLE-84ab22ef.js → edge/USE_SERVER_BUNDLE-8a6ee05a.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-a4d10e9b.cjs → edge/USE_SERVER_BUNDLE-e3d2232b.cjs} +1 -1
  13. package/lib/edge/{bundle-8a8fdc14.cjs → bundle-2bd976c9.cjs} +26 -26
  14. package/lib/edge/{bundle-73367f5c.js → bundle-bdc1f5be.js} +648 -641
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/{edge/USE_CLIENT_BUNDLE-47285217.cjs → node/USE_CLIENT_BUNDLE-2a3a1484.cjs} +2 -2
  18. package/lib/{edge/USE_CLIENT_BUNDLE-2d9b453e.js → node/USE_CLIENT_BUNDLE-af2f5052.js} +21 -21
  19. package/lib/{browser/USE_SERVER_BUNDLE-719f53b1.cjs → node/USE_SERVER_BUNDLE-290676c5.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-d83b7d23.js → node/USE_SERVER_BUNDLE-55adca17.js} +1 -1
  21. package/lib/node/{bundle-832f5a95.cjs → bundle-10b57ad3.cjs} +6 -6
  22. package/lib/node/{bundle-08369562.js → bundle-9b0c3f03.js} +93 -86
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +3 -3
  26. package/types/cjs/blocks/accordion/accordion.d.ts +4 -0
  27. package/types/cjs/blocks/accordion/accordion.types.d.ts +12 -0
  28. package/types/cjs/blocks/accordion/component-info.d.ts +2 -0
  29. package/types/cjs/blocks/accordion/helpers.d.ts +1 -0
  30. package/types/cjs/blocks/accordion/index.d.ts +1 -0
  31. package/types/cjs/components/block/animator.d.ts +0 -1
  32. package/types/cjs/components/content-variants/content-variants.types.d.ts +1 -1
  33. package/types/cjs/constants/sdk-version.d.ts +1 -1
  34. package/types/cjs/functions/camel-to-kebab-case.d.ts +1 -1
  35. package/types/cjs/helpers/flatten.d.ts +10 -0
  36. package/types/esm/blocks/accordion/accordion.d.ts +4 -0
  37. package/types/esm/blocks/accordion/accordion.types.d.ts +12 -0
  38. package/types/esm/blocks/accordion/component-info.d.ts +2 -0
  39. package/types/esm/blocks/accordion/helpers.d.ts +1 -0
  40. package/types/esm/blocks/accordion/index.d.ts +1 -0
  41. package/types/esm/components/block/animator.d.ts +0 -1
  42. package/types/esm/components/content-variants/content-variants.types.d.ts +1 -1
  43. package/types/esm/constants/sdk-version.d.ts +1 -1
  44. package/types/esm/functions/camel-to-kebab-case.d.ts +1 -1
  45. package/types/esm/helpers/flatten.d.ts +10 -0
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { LRUCache } from "lru-cache";
4
- import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-68277019.js";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-af2f5052.js";
5
5
  import "next/navigation";
6
6
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
7
7
  switch (TARGET) {
@@ -250,17 +250,17 @@ const getIsolateContext = () => IVM_CONTEXT || setIsolateContext(), runInNode =
250
250
  event: o,
251
251
  state: c
252
252
  }), f = getIsolateContext(), l = f.global;
253
- l.setSync(BUILDER_SET_STATE_NAME, function(b, p) {
254
- set(a, b, p), i == null || i(a);
255
- }), d.forEach(([b, p]) => {
253
+ l.setSync(BUILDER_SET_STATE_NAME, function(y, p) {
254
+ set(a, y, p), i == null || i(a);
255
+ }), d.forEach(([y, p]) => {
256
256
  const v = typeof p == "object" ? new s.Reference(
257
257
  // workaround: methods with default values for arguments is not being cloned over
258
- b === "builder" ? {
258
+ y === "builder" ? {
259
259
  ...p,
260
260
  getUserAttributes: () => p.getUserAttributes()
261
261
  } : p
262
262
  ) : null;
263
- l.setSync(getSyncValName(b), v);
263
+ l.setSync(getSyncValName(y), v);
264
264
  });
265
265
  const u = processCode({
266
266
  code: e,
@@ -396,7 +396,7 @@ function getProcessedBlock({
396
396
  context: t
397
397
  }) : a;
398
398
  }
399
- const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
399
+ const camelToKebabCase = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "", convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
400
400
  if (typeof o == "string")
401
401
  return `${camelToKebabCase(n)}: ${o};`;
402
402
  }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
@@ -495,7 +495,7 @@ const getComponent = ({
495
495
  },
496
496
  block: o
497
497
  }));
498
- }, shouldPassLinkComponent = (e) => e && (e.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(e.name)), shouldPassRegisteredComponents = (e) => e && (e.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(e.name)), SIZES = {
498
+ }, shouldPassLinkComponent = (e) => e && (e.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)), shouldPassRegisteredComponents = (e) => e && (e.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)), SIZES = {
499
499
  small: {
500
500
  min: 320,
501
501
  default: 321,
@@ -547,47 +547,6 @@ function InlinedStyles(e) {
547
547
  }
548
548
  );
549
549
  }
550
- function assign(e, ...t) {
551
- const n = Object(e);
552
- for (let o = 1; o < arguments.length; o++) {
553
- const r = arguments[o];
554
- if (r != null)
555
- for (const i in r)
556
- Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
557
- }
558
- return n;
559
- }
560
- const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
561
- function warnElementNotPresent(e) {
562
- console.warn(`Cannot animate element: element with ID ${e} not found!`);
563
- }
564
- function augmentAnimation(e, t) {
565
- const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
566
- for (const s of a)
567
- for (const c of n)
568
- c in s || (s[c] = o[c]);
569
- }
570
- function getAllStylesUsed(e) {
571
- const t = [];
572
- for (const n of e.steps)
573
- for (const o in n.styles)
574
- t.indexOf(o) === -1 && t.push(o);
575
- return t;
576
- }
577
- function triggerAnimation(e) {
578
- const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
579
- if (!t.length) {
580
- warnElementNotPresent(e.elementId || e.id || "");
581
- return;
582
- }
583
- Array.from(t).forEach((n) => {
584
- augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
585
- n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
586
- n.style.transition = "", n.style.transitionDelay = "";
587
- }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
588
- });
589
- });
590
- }
591
550
  function BlockStyles(e) {
592
551
  const t = function() {
593
552
  const r = getProcessedBlock({
@@ -600,7 +559,7 @@ function BlockStyles(e) {
600
559
  });
601
560
  return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
602
561
  }, n = function() {
603
- var m, h, y;
562
+ var m, h, b;
604
563
  const r = getProcessedBlock({
605
564
  block: e.block,
606
565
  localState: e.context.localState,
@@ -623,7 +582,7 @@ function BlockStyles(e) {
623
582
  "medium",
624
583
  s
625
584
  )
626
- }) : "", b = f ? createCssClass({
585
+ }) : "", y = f ? createCssClass({
627
586
  className: l,
628
587
  styles: f,
629
588
  mediaQuery: getMaxWidthQueryForSize(
@@ -633,12 +592,12 @@ function BlockStyles(e) {
633
592
  }) : "", p = r.animations && r.animations.find((S) => S.trigger === "hover");
634
593
  let v = "";
635
594
  if (p) {
636
- const S = ((y = (h = p.steps) == null ? void 0 : h[1]) == null ? void 0 : y.styles) || {};
595
+ const S = ((b = (h = p.steps) == null ? void 0 : h[1]) == null ? void 0 : b.styles) || {};
637
596
  v = createCssClass({
638
597
  className: `${l}:hover`,
639
598
  styles: {
640
599
  ...S,
641
- transition: `all ${p.duration}s ${camelCaseToKebabCase(
600
+ transition: `all ${p.duration}s ${camelToKebabCase(
642
601
  p.easing
643
602
  )}`,
644
603
  transitionDelay: p.delay ? `${p.delay}s` : "0s"
@@ -648,7 +607,7 @@ function BlockStyles(e) {
648
607
  return [
649
608
  u,
650
609
  g,
651
- b,
610
+ y,
652
611
  v
653
612
  ].join(" ");
654
613
  };
@@ -814,8 +773,8 @@ function Block(e) {
814
773
  var g;
815
774
  return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
816
775
  }, i = function() {
817
- var b, p;
818
- if ((b = e.block.repeat) != null && b.collection)
776
+ var y, p;
777
+ if ((y = e.block.repeat) != null && y.collection)
819
778
  return !!((p = n()) != null && p.length);
820
779
  const u = "hide" in o() ? o().hide : !1;
821
780
  return ("show" in o() ? o().show : !0) && !u;
@@ -823,7 +782,7 @@ function Block(e) {
823
782
  var g;
824
783
  return !((g = t()) != null && g.component) && !n() ? o().children ?? [] : [];
825
784
  }, s = function() {
826
- var u, g, b;
785
+ var u, g, y;
827
786
  return {
828
787
  blockChildren: o().children ?? [],
829
788
  componentRef: (u = t()) == null ? void 0 : u.component,
@@ -842,7 +801,7 @@ function Block(e) {
842
801
  registeredComponents: e.registeredComponents,
843
802
  builderBlock: o(),
844
803
  includeBlockProps: ((g = t()) == null ? void 0 : g.noWrap) === !0,
845
- isInteractive: !((b = t()) != null && b.isRSC)
804
+ isInteractive: !((y = t()) != null && y.isRSC)
846
805
  };
847
806
  };
848
807
  return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -936,21 +895,21 @@ function Columns(e) {
936
895
  const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(h) {
937
896
  return h.link ? e.builderLinkComponent || "a" : "div";
938
897
  }, i = function(h) {
939
- var y;
940
- return ((y = n[h]) == null ? void 0 : y.width) || 100 / n.length;
898
+ var b;
899
+ return ((b = n[h]) == null ? void 0 : b.width) || 100 / n.length;
941
900
  }, a = function(h) {
942
- const y = t * (n.length - 1) / n.length;
943
- return `calc(${i(h)}% - ${y}px)`;
901
+ const b = t * (n.length - 1) / n.length;
902
+ return `calc(${i(h)}% - ${b}px)`;
944
903
  }, s = function({
945
904
  stackedStyle: h,
946
- desktopStyle: y
905
+ desktopStyle: b
947
906
  }) {
948
- return o === "tablet" ? h : y;
907
+ return o === "tablet" ? h : b;
949
908
  }, c = function({
950
909
  stackedStyle: h,
951
- desktopStyle: y
910
+ desktopStyle: b
952
911
  }) {
953
- return o === "never" ? y : h;
912
+ return o === "never" ? b : h;
954
913
  }, d = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", f = function() {
955
914
  return {
956
915
  "--flex-dir": d,
@@ -960,7 +919,7 @@ function Columns(e) {
960
919
  })
961
920
  };
962
921
  }, l = function(h) {
963
- const y = h === 0 ? 0 : t, S = a(h), C = `${y}px`, I = "100%", x = 0;
922
+ const b = h === 0 ? 0 : t, S = a(h), C = `${b}px`, I = "100%", x = 0;
964
923
  return {
965
924
  ...{
966
925
  display: "flex",
@@ -1017,20 +976,20 @@ function Columns(e) {
1017
976
  }
1018
977
  },
1019
978
  `;
1020
- }, b = function(h, y) {
979
+ }, y = function(h, b) {
1021
980
  return {
1022
981
  ...h.link ? {
1023
982
  href: h.link
1024
983
  } : {},
1025
984
  [getClassPropName()]: "builder-column",
1026
- style: mapStyleObjToStrIfNeeded(l(y))
985
+ style: mapStyleObjToStrIfNeeded(l(b))
1027
986
  };
1028
987
  };
1029
988
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1030
989
  /* @__PURE__ */ jsxs(
1031
990
  "div",
1032
991
  {
1033
- className: getColumnsClass((p = e.builderBlock) == null ? void 0 : p.id) + " div-2651dce4",
992
+ className: getColumnsClass((p = e.builderBlock) == null ? void 0 : p.id) + " div-eeca3604",
1034
993
  style: f(),
1035
994
  children: [
1036
995
  /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: g() }),
@@ -1039,7 +998,7 @@ function Columns(e) {
1039
998
  {
1040
999
  TagName: r(m),
1041
1000
  actionAttributes: {},
1042
- attributes: b(m, h),
1001
+ attributes: y(m, h),
1043
1002
  children: /* @__PURE__ */ jsx(
1044
1003
  Blocks,
1045
1004
  {
@@ -1060,7 +1019,7 @@ function Columns(e) {
1060
1019
  ]
1061
1020
  }
1062
1021
  ),
1063
- /* @__PURE__ */ jsx("style", { children: `.div-2651dce4 {
1022
+ /* @__PURE__ */ jsx("style", { children: `.div-eeca3604 {
1064
1023
  display: flex;
1065
1024
  line-height: normal;
1066
1025
  }` })
@@ -2062,6 +2021,13 @@ function flatten(e, t = null, n = ".") {
2062
2021
  };
2063
2022
  }, {});
2064
2023
  }
2024
+ function flattenMongoQuery(e, t, n = {}) {
2025
+ for (const o in e) {
2026
+ const r = e[o], i = t ? t + "." + o : o;
2027
+ r && typeof r == "object" && !Array.isArray(r) && !Object.keys(r).find((a) => a.startsWith("$")) ? flattenMongoQuery(r, i, n) : n[i] = r;
2028
+ }
2029
+ return n;
2030
+ }
2065
2031
  const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUILDER_OPTIONS_PREFIX = "options.", getBuilderSearchParams = (e) => {
2066
2032
  if (!e)
2067
2033
  return {};
@@ -2092,7 +2058,7 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
2092
2058
  offset: l,
2093
2059
  cacheSeconds: u,
2094
2060
  staleCacheSeconds: g,
2095
- sort: b,
2061
+ sort: y,
2096
2062
  includeUnpublished: p
2097
2063
  } = e;
2098
2064
  if (!i)
@@ -2100,9 +2066,9 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
2100
2066
  if (!["v3"].includes(c))
2101
2067
  throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
2102
2068
  const v = t !== 1, m = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
2103
- if (m.searchParams.set("apiKey", i), m.searchParams.set("limit", String(t)), m.searchParams.set("noTraverse", String(v)), m.searchParams.set("includeRefs", String(!0)), s && m.searchParams.set("locale", s), a && m.searchParams.set("enrich", String(a)), m.searchParams.set("omit", f || "meta.componentsUsed"), d && m.searchParams.set("fields", d), Number.isFinite(l) && l > -1 && m.searchParams.set("offset", String(Math.floor(l))), typeof p == "boolean" && m.searchParams.set("includeUnpublished", String(p)), u && isPositiveNumber(u) && m.searchParams.set("cacheSeconds", String(u)), g && isPositiveNumber(g) && m.searchParams.set("staleCacheSeconds", String(g)), b) {
2069
+ if (m.searchParams.set("apiKey", i), m.searchParams.set("limit", String(t)), m.searchParams.set("noTraverse", String(v)), m.searchParams.set("includeRefs", String(!0)), s && m.searchParams.set("locale", s), a && m.searchParams.set("enrich", String(a)), m.searchParams.set("omit", f || "meta.componentsUsed"), d && m.searchParams.set("fields", d), Number.isFinite(l) && l > -1 && m.searchParams.set("offset", String(Math.floor(l))), typeof p == "boolean" && m.searchParams.set("includeUnpublished", String(p)), u && isPositiveNumber(u) && m.searchParams.set("cacheSeconds", String(u)), g && isPositiveNumber(g) && m.searchParams.set("staleCacheSeconds", String(g)), y) {
2104
2070
  const S = flatten({
2105
- sort: b
2071
+ sort: y
2106
2072
  });
2107
2073
  for (const C in S)
2108
2074
  m.searchParams.set(C, JSON.stringify(S[C]));
@@ -2110,11 +2076,11 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
2110
2076
  const h = {
2111
2077
  ...getBuilderSearchParamsFromWindow(),
2112
2078
  ...normalizeSearchParams(e.options || {})
2113
- }, y = flatten(h);
2114
- for (const S in y)
2115
- m.searchParams.set(S, String(y[S]));
2079
+ }, b = flatten(h);
2080
+ for (const S in b)
2081
+ m.searchParams.set(S, String(b[S]));
2116
2082
  if (n && m.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2117
- const S = flatten({
2083
+ const S = flattenMongoQuery({
2118
2084
  query: o
2119
2085
  });
2120
2086
  for (const C in S)
@@ -2362,7 +2328,7 @@ function isFromTrustedHost(e, t) {
2362
2328
  const n = new URL(t.origin), o = n.hostname;
2363
2329
  return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
2364
2330
  }
2365
- const SDK_VERSION = "0.14.20", registry = {};
2331
+ const SDK_VERSION = "0.14.24", registry = {};
2366
2332
  function register(e, t) {
2367
2333
  let n = registry[e];
2368
2334
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -2446,8 +2412,8 @@ const setupBrowserForEditing = (e = {}) => {
2446
2412
  error: u.message
2447
2413
  }
2448
2414
  }, "*") : l && typeof l.then == "function" ? l.then((g) => {
2449
- var b;
2450
- (b = window.parent) == null || b.postMessage({
2415
+ var y;
2416
+ (y = window.parent) == null || y.postMessage({
2451
2417
  type: "builder.evaluateResult",
2452
2418
  data: {
2453
2419
  id: d,
@@ -2510,7 +2476,48 @@ const setupBrowserForEditing = (e = {}) => {
2510
2476
  return window.addEventListener("message", o), () => {
2511
2477
  window.removeEventListener("message", o);
2512
2478
  };
2513
- }, getCssFromFont = (e) => {
2479
+ };
2480
+ function assign(e, ...t) {
2481
+ const n = Object(e);
2482
+ for (let o = 1; o < arguments.length; o++) {
2483
+ const r = arguments[o];
2484
+ if (r != null)
2485
+ for (const i in r)
2486
+ Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
2487
+ }
2488
+ return n;
2489
+ }
2490
+ function warnElementNotPresent(e) {
2491
+ console.warn(`Cannot animate element: element with ID ${e} not found!`);
2492
+ }
2493
+ function augmentAnimation(e, t) {
2494
+ const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
2495
+ for (const s of a)
2496
+ for (const c of n)
2497
+ c in s || (s[c] = o[c]);
2498
+ }
2499
+ function getAllStylesUsed(e) {
2500
+ const t = [];
2501
+ for (const n of e.steps)
2502
+ for (const o in n.styles)
2503
+ t.indexOf(o) === -1 && t.push(o);
2504
+ return t;
2505
+ }
2506
+ function triggerAnimation(e) {
2507
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2508
+ if (!t.length) {
2509
+ warnElementNotPresent(e.elementId || e.id || "");
2510
+ return;
2511
+ }
2512
+ Array.from(t).forEach((n) => {
2513
+ augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
2514
+ n.style.transition = `all ${e.duration}s ${camelToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
2515
+ n.style.transition = "", n.style.transitionDelay = "";
2516
+ }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2517
+ });
2518
+ });
2519
+ }
2520
+ const getCssFromFont = (e) => {
2514
2521
  var i;
2515
2522
  const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((i = e == null ? void 0 : e.files) == null ? void 0 : i.regular);
2516
2523
  let r = "";
@@ -2614,10 +2621,10 @@ function ContentComponent(e) {
2614
2621
  ...getDefaultRegisteredComponents(),
2615
2622
  ...e.customComponents || []
2616
2623
  ].reduce(
2617
- (g, { component: b, ...p }) => ({
2624
+ (g, { component: y, ...p }) => ({
2618
2625
  ...g,
2619
2626
  [p.name]: {
2620
- component: b,
2627
+ component: y,
2621
2628
  ...serializeComponentInfo(p)
2622
2629
  }
2623
2630
  }),
@@ -2641,7 +2648,7 @@ function ContentComponent(e) {
2641
2648
  ...getDefaultRegisteredComponents(),
2642
2649
  ...e.customComponents || []
2643
2650
  ].reduce(
2644
- (g, { component: b, ...p }) => ({
2651
+ (g, { component: y, ...p }) => ({
2645
2652
  ...g,
2646
2653
  [p.name]: serializeComponentInfo(p)
2647
2654
  }),
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-8d2c6823.cjs"),e=require("./bundle-832f5a95.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-a4d10e9b.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-2a3a1484.cjs"),e=require("./bundle-10b57ad3.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-290676c5.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,8 +1,8 @@
1
- import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-68277019.js";
2
- import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-08369562.js";
1
+ import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-af2f5052.js";
2
+ import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-9b0c3f03.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
- import "./USE_SERVER_BUNDLE-84ab22ef.js";
5
+ import "./USE_SERVER_BUNDLE-55adca17.js";
6
6
  import "next/navigation";
7
7
  import "lru-cache";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-nextjs",
3
3
  "description": "Builder.io RSC SDK for NextJS App Directory",
4
- "version": "0.14.20",
4
+ "version": "0.14.24",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -98,8 +98,8 @@
98
98
  "@builder.io/sdks": "workspace:*",
99
99
  "@vitejs/plugin-react": "^4.0.4",
100
100
  "next": ">=13.4.20",
101
- "nx": "^16.6.0",
102
- "nx-cloud": "^16.2.0",
101
+ "nx": "16.10.0",
102
+ "nx-cloud": "16.5.2",
103
103
  "react": "^18.2.0",
104
104
  "rimraf": "^3.0.2",
105
105
  "typescript": "^5.1.6",
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { AccordionProps } from "./accordion.types.js";
3
+ declare function Accordion(props: AccordionProps): React.JSX.Element;
4
+ export default Accordion;
@@ -0,0 +1,12 @@
1
+ import type { BuilderBlock } from '../../types/builder-block.js';
2
+ import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
3
+ export interface AccordionProps extends BuilderComponentsProp, BuilderLinkComponentProp, BuilderDataProps {
4
+ items: {
5
+ title: BuilderBlock[];
6
+ detail: BuilderBlock[];
7
+ }[];
8
+ oneAtATime?: boolean;
9
+ grid?: boolean;
10
+ gridRowWidth?: string;
11
+ useChildrenForItems?: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -0,0 +1 @@
1
+ export declare const convertOrderNumberToString: (order: number) => string;
@@ -0,0 +1 @@
1
+ export { default } from './accordion.js';
@@ -1,5 +1,4 @@
1
1
  import type { BuilderAnimation } from '../../types/builder-block.js';
2
- export declare const camelCaseToKebabCase: (str?: string) => string;
3
2
  export declare function bindAnimations(animations: BuilderAnimation[]): void;
4
3
  export declare function triggerAnimation(animation: BuilderAnimation): void;
5
4
  export declare function bindScrollInViewAnimation(animation: BuilderAnimation): void;
@@ -22,7 +22,7 @@ export interface ContentVariantsPrps {
22
22
  */
23
23
  context?: BuilderRenderContext;
24
24
  /**
25
- * Your API Key: needed to dynamically fetch symbols (required).
25
+ * Your API Key: needed to enable visual editing, and to dynamically fetch symbols (required).
26
26
  */
27
27
  apiKey: string;
28
28
  apiVersion?: ApiVersion;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.20";
1
+ export declare const SDK_VERSION = "0.14.24";
@@ -1 +1 @@
1
- export declare const camelToKebabCase: (string: string) => string;
1
+ export declare const camelToKebabCase: (str?: string) => string;
@@ -4,3 +4,13 @@
4
4
  * { foo: { bar: 'baz' }} -> { 'foo.bar': 'baz' }
5
5
  */
6
6
  export declare function flatten<T extends Record<string, any>>(object: T, path?: string | null, separator?: string): T;
7
+ /**
8
+ * Flatten a nested MongoDB query object into a flat object with dot-separated keys.
9
+ * $ keys are not flattened and are left as is.
10
+ *
11
+ * { foo: { bar: { $gt: 5 }}} -> { 'foo.bar': { '$gt': 5 }}
12
+ * { foo: {'bar.id': { $elemMatch: { 'baz.id': { $in: ['abc', 'bcd'] }}}}} -> { 'foo.bar.id': { '$elemMatch': { 'baz.id': { '$in': ['abc', 'bcd'] }}}}
13
+ */
14
+ export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
15
+ [key: string]: string;
16
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { AccordionProps } from "./accordion.types.js";
3
+ declare function Accordion(props: AccordionProps): React.JSX.Element;
4
+ export default Accordion;
@@ -0,0 +1,12 @@
1
+ import type { BuilderBlock } from '../../types/builder-block.js';
2
+ import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
3
+ export interface AccordionProps extends BuilderComponentsProp, BuilderLinkComponentProp, BuilderDataProps {
4
+ items: {
5
+ title: BuilderBlock[];
6
+ detail: BuilderBlock[];
7
+ }[];
8
+ oneAtATime?: boolean;
9
+ grid?: boolean;
10
+ gridRowWidth?: string;
11
+ useChildrenForItems?: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -0,0 +1 @@
1
+ export declare const convertOrderNumberToString: (order: number) => string;
@@ -0,0 +1 @@
1
+ export { default } from './accordion.js';
@@ -1,5 +1,4 @@
1
1
  import type { BuilderAnimation } from '../../types/builder-block.js';
2
- export declare const camelCaseToKebabCase: (str?: string) => string;
3
2
  export declare function bindAnimations(animations: BuilderAnimation[]): void;
4
3
  export declare function triggerAnimation(animation: BuilderAnimation): void;
5
4
  export declare function bindScrollInViewAnimation(animation: BuilderAnimation): void;
@@ -22,7 +22,7 @@ export interface ContentVariantsPrps {
22
22
  */
23
23
  context?: BuilderRenderContext;
24
24
  /**
25
- * Your API Key: needed to dynamically fetch symbols (required).
25
+ * Your API Key: needed to enable visual editing, and to dynamically fetch symbols (required).
26
26
  */
27
27
  apiKey: string;
28
28
  apiVersion?: ApiVersion;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.20";
1
+ export declare const SDK_VERSION = "0.14.24";
@@ -1 +1 @@
1
- export declare const camelToKebabCase: (string: string) => string;
1
+ export declare const camelToKebabCase: (str?: string) => string;
@@ -4,3 +4,13 @@
4
4
  * { foo: { bar: 'baz' }} -> { 'foo.bar': 'baz' }
5
5
  */
6
6
  export declare function flatten<T extends Record<string, any>>(object: T, path?: string | null, separator?: string): T;
7
+ /**
8
+ * Flatten a nested MongoDB query object into a flat object with dot-separated keys.
9
+ * $ keys are not flattened and are left as is.
10
+ *
11
+ * { foo: { bar: { $gt: 5 }}} -> { 'foo.bar': { '$gt': 5 }}
12
+ * { foo: {'bar.id': { $elemMatch: { 'baz.id': { $in: ['abc', 'bcd'] }}}}} -> { 'foo.bar.id': { '$elemMatch': { 'baz.id': { '$in': ['abc', 'bcd'] }}}}
13
+ */
14
+ export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
15
+ [key: string]: string;
16
+ };