@builder.io/sdk-qwik 0.12.0 → 0.12.2

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.
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useOn, useTaskQrl } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot as Slot$1, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useOn, useTaskQrl } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  import { s as safeDynamicRequire } from "./node-evaluate-db446d2b.js";
4
4
  import { isServer } from "@builder.io/qwik/build";
@@ -337,26 +337,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
337
337
  else
338
338
  return transformedBlock;
339
339
  }
340
- const EMPTY_HTML_ELEMENTS = [
341
- "area",
342
- "base",
343
- "br",
344
- "col",
345
- "embed",
346
- "hr",
347
- "img",
348
- "input",
349
- "keygen",
350
- "link",
351
- "meta",
352
- "param",
353
- "source",
354
- "track",
355
- "wbr"
356
- ];
357
- const isEmptyHtmlElement = (tagName) => {
358
- return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
359
- };
360
340
  const getComponent = ({ block, context, registeredComponents }) => {
361
341
  var _a;
362
342
  const componentName = (_a = getProcessedBlock({
@@ -641,38 +621,67 @@ function getStyleAttribute(style) {
641
621
  return style;
642
622
  }
643
623
  }
644
- const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
624
+ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
625
+ "area",
626
+ "base",
627
+ "br",
628
+ "col",
629
+ "embed",
630
+ "hr",
631
+ "img",
632
+ "input",
633
+ "keygen",
634
+ "link",
635
+ "meta",
636
+ "param",
637
+ "source",
638
+ "track",
639
+ "wbr"
640
+ ]);
641
+ const isEmptyElement = (tagName) => {
642
+ return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
643
+ };
644
+ const DynamicRenderer = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
645
645
  _jsxBranch();
646
646
  return /* @__PURE__ */ _jsxC(Fragment, {
647
- children: props.hasChildren ? /* @__PURE__ */ _jsxC(props.Wrapper, {
648
- ...getBlockProperties({
649
- block: props.block,
650
- context: props.context
651
- }),
652
- ...getBlockActions({
653
- block: props.block,
654
- rootState: props.context.rootState,
655
- rootSetState: props.context.rootSetState,
656
- localState: props.context.localState,
657
- context: props.context.context,
658
- stripPrefix: true
659
- }),
660
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "87_0")
661
- }, 0, "87_1") : /* @__PURE__ */ _jsxC(props.Wrapper, {
662
- ...getBlockProperties({
663
- block: props.block,
664
- context: props.context
665
- }),
666
- ...getBlockActions({
667
- block: props.block,
668
- rootState: props.context.rootState,
669
- rootSetState: props.context.rootSetState,
670
- localState: props.context.localState,
671
- context: props.context.context,
672
- stripPrefix: true
673
- })
674
- }, 0, "87_2")
675
- }, 1, "87_3");
647
+ children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ _jsxC(props.TagName, {
648
+ ...props.attributes,
649
+ ...props.actionAttributes,
650
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_0")
651
+ }, 0, "yW_1") : /* @__PURE__ */ _jsxC(props.TagName, {
652
+ ...props.attributes,
653
+ ...props.actionAttributes,
654
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_2")
655
+ }, 0, "yW_3") : /* @__PURE__ */ _jsxC(props.TagName, {
656
+ ...props.attributes,
657
+ ...props.actionAttributes
658
+ }, 0, "yW_4")
659
+ }, 1, "yW_5");
660
+ }, "DynamicRenderer_component_1Co0xkmyAfQ"));
661
+ const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
662
+ return /* @__PURE__ */ _jsxC(DynamicRenderer, {
663
+ get TagName() {
664
+ return props.Wrapper;
665
+ },
666
+ actionAttributes: getBlockActions({
667
+ block: props.block,
668
+ rootState: props.context.rootState,
669
+ rootSetState: props.context.rootSetState,
670
+ localState: props.context.localState,
671
+ context: props.context.context,
672
+ stripPrefix: true
673
+ }),
674
+ attributes: getBlockProperties({
675
+ block: props.block,
676
+ context: props.context
677
+ }),
678
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "87_0"),
679
+ [_IMMUTABLE]: {
680
+ TagName: _fnSignal((p0) => p0.Wrapper, [
681
+ props
682
+ ], "p0.Wrapper")
683
+ }
684
+ }, 1, "87_1");
676
685
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
677
686
  const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
678
687
  return /* @__PURE__ */ _jsxC(props.Wrapper, {
@@ -690,7 +699,7 @@ const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQ
690
699
  context: props.context.context
691
700
  })
692
701
  } : {},
693
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "q0_0")
702
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "q0_0")
694
703
  }, 0, "q0_1");
695
704
  }, "InteractiveElement_component_0UqfJpjhn0g"));
696
705
  const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
@@ -896,151 +905,120 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
896
905
  ], "p0.context")
897
906
  }
898
907
  }, 3, "jN_0"),
899
- !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ _jsxC(Fragment, {
908
+ !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
909
+ get Wrapper() {
910
+ return Tag.value;
911
+ },
912
+ get block() {
913
+ return processedBlock.value;
914
+ },
915
+ get context() {
916
+ return props.context;
917
+ },
900
918
  children: [
901
- isEmptyHtmlElement(Tag.value) ? /* @__PURE__ */ _jsxC(BlockWrapper, {
902
- get Wrapper() {
903
- return Tag.value;
919
+ /* @__PURE__ */ _jsxC(ComponentRef, {
920
+ get componentRef() {
921
+ return componentRefProps.value.componentRef;
922
+ },
923
+ get componentOptions() {
924
+ return componentRefProps.value.componentOptions;
904
925
  },
905
- get block() {
906
- return processedBlock.value;
926
+ get blockChildren() {
927
+ return componentRefProps.value.blockChildren;
907
928
  },
908
929
  get context() {
909
- return props.context;
930
+ return componentRefProps.value.context;
931
+ },
932
+ get registeredComponents() {
933
+ return componentRefProps.value.registeredComponents;
934
+ },
935
+ get builderBlock() {
936
+ return componentRefProps.value.builderBlock;
937
+ },
938
+ get includeBlockProps() {
939
+ return componentRefProps.value.includeBlockProps;
940
+ },
941
+ get isInteractive() {
942
+ return componentRefProps.value.isInteractive;
910
943
  },
911
- hasChildren: false,
912
944
  [_IMMUTABLE]: {
913
- Wrapper: _fnSignal((p0) => p0.value, [
914
- Tag
915
- ], "p0.value"),
916
- block: _fnSignal((p0) => p0.value, [
917
- processedBlock
918
- ], "p0.value"),
919
- context: _fnSignal((p0) => p0.context, [
920
- props
921
- ], "p0.context"),
922
- hasChildren: _IMMUTABLE
945
+ blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
946
+ componentRefProps
947
+ ], "p0.value.blockChildren"),
948
+ builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
949
+ componentRefProps
950
+ ], "p0.value.builderBlock"),
951
+ componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
952
+ componentRefProps
953
+ ], "p0.value.componentOptions"),
954
+ componentRef: _fnSignal((p0) => p0.value.componentRef, [
955
+ componentRefProps
956
+ ], "p0.value.componentRef"),
957
+ context: _fnSignal((p0) => p0.value.context, [
958
+ componentRefProps
959
+ ], "p0.value.context"),
960
+ includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
961
+ componentRefProps
962
+ ], "p0.value.includeBlockProps"),
963
+ isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
964
+ componentRefProps
965
+ ], "p0.value.isInteractive"),
966
+ registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
967
+ componentRefProps
968
+ ], "p0.value.registeredComponents")
923
969
  }
924
- }, 3, "jN_1") : null,
925
- !isEmptyHtmlElement(Tag.value) && repeatItem.value ? (repeatItem.value || []).map((data, index) => {
926
- return /* @__PURE__ */ _jsxC(RepeatedBlock, {
927
- get repeatContext() {
928
- return data.context;
929
- },
930
- get block() {
931
- return data.block;
970
+ }, 3, "jN_1"),
971
+ (childrenWithoutParentComponent.value || []).map((child) => {
972
+ return /* @__PURE__ */ _jsxC(Block, {
973
+ block: child,
974
+ get context() {
975
+ return state.childrenContext;
932
976
  },
933
977
  get registeredComponents() {
934
978
  return props.registeredComponents;
935
979
  },
936
980
  [_IMMUTABLE]: {
937
- block: _wrapProp(data, "block"),
981
+ context: _fnSignal((p0) => p0.childrenContext, [
982
+ state
983
+ ], "p0.childrenContext"),
938
984
  registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
939
985
  props
940
- ], "p0.registeredComponents"),
941
- repeatContext: _wrapProp(data, "context")
986
+ ], "p0.registeredComponents")
942
987
  }
943
- }, 3, index);
944
- }) : null,
945
- !isEmptyHtmlElement(Tag.value) && !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
946
- get Wrapper() {
947
- return Tag.value;
948
- },
949
- get block() {
950
- return processedBlock.value;
951
- },
952
- get context() {
953
- return props.context;
954
- },
955
- children: [
956
- /* @__PURE__ */ _jsxC(ComponentRef, {
957
- get componentRef() {
958
- return componentRefProps.value.componentRef;
959
- },
960
- get componentOptions() {
961
- return componentRefProps.value.componentOptions;
962
- },
963
- get blockChildren() {
964
- return componentRefProps.value.blockChildren;
965
- },
966
- get context() {
967
- return componentRefProps.value.context;
968
- },
969
- get registeredComponents() {
970
- return componentRefProps.value.registeredComponents;
971
- },
972
- get builderBlock() {
973
- return componentRefProps.value.builderBlock;
974
- },
975
- get includeBlockProps() {
976
- return componentRefProps.value.includeBlockProps;
977
- },
978
- get isInteractive() {
979
- return componentRefProps.value.isInteractive;
980
- },
981
- [_IMMUTABLE]: {
982
- blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
983
- componentRefProps
984
- ], "p0.value.blockChildren"),
985
- builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
986
- componentRefProps
987
- ], "p0.value.builderBlock"),
988
- componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
989
- componentRefProps
990
- ], "p0.value.componentOptions"),
991
- componentRef: _fnSignal((p0) => p0.value.componentRef, [
992
- componentRefProps
993
- ], "p0.value.componentRef"),
994
- context: _fnSignal((p0) => p0.value.context, [
995
- componentRefProps
996
- ], "p0.value.context"),
997
- includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
998
- componentRefProps
999
- ], "p0.value.includeBlockProps"),
1000
- isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
1001
- componentRefProps
1002
- ], "p0.value.isInteractive"),
1003
- registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
1004
- componentRefProps
1005
- ], "p0.value.registeredComponents")
1006
- }
1007
- }, 3, "jN_2"),
1008
- (childrenWithoutParentComponent.value || []).map((child) => {
1009
- return /* @__PURE__ */ _jsxC(Block, {
1010
- block: child,
1011
- get context() {
1012
- return state.childrenContext;
1013
- },
1014
- get registeredComponents() {
1015
- return props.registeredComponents;
1016
- },
1017
- [_IMMUTABLE]: {
1018
- context: _fnSignal((p0) => p0.childrenContext, [
1019
- state
1020
- ], "p0.childrenContext"),
1021
- registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
1022
- props
1023
- ], "p0.registeredComponents")
1024
- }
1025
- }, 3, child.id);
1026
- })
1027
- ],
1028
- hasChildren: true,
1029
- [_IMMUTABLE]: {
1030
- Wrapper: _fnSignal((p0) => p0.value, [
1031
- Tag
1032
- ], "p0.value"),
1033
- block: _fnSignal((p0) => p0.value, [
1034
- processedBlock
1035
- ], "p0.value"),
1036
- context: _fnSignal((p0) => p0.context, [
1037
- props
1038
- ], "p0.context"),
1039
- hasChildren: _IMMUTABLE
1040
- }
1041
- }, 1, "jN_3") : null
1042
- ]
1043
- }, 1, "jN_4") : /* @__PURE__ */ _jsxC(ComponentRef, {
988
+ }, 3, child.id);
989
+ })
990
+ ],
991
+ [_IMMUTABLE]: {
992
+ Wrapper: _fnSignal((p0) => p0.value, [
993
+ Tag
994
+ ], "p0.value"),
995
+ block: _fnSignal((p0) => p0.value, [
996
+ processedBlock
997
+ ], "p0.value"),
998
+ context: _fnSignal((p0) => p0.context, [
999
+ props
1000
+ ], "p0.context")
1001
+ }
1002
+ }, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
1003
+ return /* @__PURE__ */ _jsxC(RepeatedBlock, {
1004
+ get repeatContext() {
1005
+ return data.context;
1006
+ },
1007
+ get block() {
1008
+ return data.block;
1009
+ },
1010
+ get registeredComponents() {
1011
+ return props.registeredComponents;
1012
+ },
1013
+ [_IMMUTABLE]: {
1014
+ block: _wrapProp(data, "block"),
1015
+ registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
1016
+ props
1017
+ ], "p0.registeredComponents"),
1018
+ repeatContext: _wrapProp(data, "context")
1019
+ }
1020
+ }, 3, index);
1021
+ }) : /* @__PURE__ */ _jsxC(ComponentRef, {
1044
1022
  get componentRef() {
1045
1023
  return componentRefProps.value.componentRef;
1046
1024
  },
@@ -1091,10 +1069,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1091
1069
  componentRefProps
1092
1070
  ], "p0.value.registeredComponents")
1093
1071
  }
1094
- }, 3, "jN_5")
1072
+ }, 3, "jN_3")
1095
1073
  ]
1096
- }, 1, "jN_6") : null
1097
- }, 1, "jN_7");
1074
+ }, 1, "jN_4") : null
1075
+ }, 1, "jN_5");
1098
1076
  }, "Block_component_nnPv0RY0U0k"));
1099
1077
  const onClick$1 = function onClick2(props, state) {
1100
1078
  var _a, _b;
@@ -1163,7 +1141,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
1163
1141
  state
1164
1142
  ]),
1165
1143
  ...props.BlocksWrapperProps,
1166
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "3u_0"),
1144
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "3u_0"),
1167
1145
  [_IMMUTABLE]: {
1168
1146
  "builder-parent-id": _fnSignal((p0) => p0.parent, [
1169
1147
  props
@@ -1431,7 +1409,7 @@ const STYLES$1 = `
1431
1409
  }
1432
1410
  `;
1433
1411
  const FragmentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
1434
- return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot, null, 3, "oj_0"), 1, "oj_1");
1412
+ return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "oj_0"), 1, "oj_1");
1435
1413
  }, "FragmentComponent_component_T0AypnadAK0"));
1436
1414
  function removeProtocol(path) {
1437
1415
  return path.replace(/http(s)?:/, "");
@@ -1583,10 +1561,10 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1583
1561
  props
1584
1562
  ], '{paddingTop:p0.aspectRatio*100+"%"}')
1585
1563
  }, null, 3, "0A_1") : null,
1586
- ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_2") : null,
1564
+ ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ _jsxC(Slot$1, null, 3, "0A_2") : null,
1587
1565
  !props.fitContent && props.children ? /* @__PURE__ */ _jsxQ("div", null, {
1588
1566
  class: "div-Image-2"
1589
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_3"), 1, "0A_4") : null
1567
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "0A_3"), 1, "0A_4") : null
1590
1568
  ]
1591
1569
  }, 1, "0A_5");
1592
1570
  }, "Image_component_LRxDkFa1EfU"));
@@ -1614,7 +1592,7 @@ const STYLES = `
1614
1592
  const SectionComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
1615
1593
  return /* @__PURE__ */ _jsxS("section", {
1616
1594
  ...props.attributes,
1617
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "2Y_0"),
1595
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "2Y_0"),
1618
1596
  style: {
1619
1597
  width: "100%",
1620
1598
  alignSelf: "stretch",
@@ -1803,7 +1781,7 @@ const handleABTesting = async ({ item, canTrack }) => {
1803
1781
  };
1804
1782
  };
1805
1783
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1806
- const componentInfo$a = {
1784
+ const componentInfo$b = {
1807
1785
  name: "Core:Button",
1808
1786
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1809
1787
  defaultStyles: {
@@ -1841,7 +1819,7 @@ const componentInfo$a = {
1841
1819
  static: true,
1842
1820
  noWrap: true
1843
1821
  };
1844
- const componentInfo$9 = {
1822
+ const componentInfo$a = {
1845
1823
  // TODO: ways to statically preprocess JSON for references, functions, etc
1846
1824
  name: "Columns",
1847
1825
  isRSC: true,
@@ -2083,7 +2061,7 @@ const componentInfo$9 = {
2083
2061
  }
2084
2062
  ]
2085
2063
  };
2086
- const componentInfo$8 = {
2064
+ const componentInfo$9 = {
2087
2065
  name: "Custom Code",
2088
2066
  static: true,
2089
2067
  requiredPermissions: [
@@ -2162,7 +2140,7 @@ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((prop
2162
2140
  ], "p0.code")
2163
2141
  }, null, 3, "bY_0");
2164
2142
  }, "CustomCode_component_uYOSy7w7Zqw"));
2165
- const componentInfo$7 = {
2143
+ const componentInfo$8 = {
2166
2144
  name: "Embed",
2167
2145
  static: true,
2168
2146
  inputs: [
@@ -2255,14 +2233,14 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2255
2233
  ], "p0.content")
2256
2234
  }, null, 3, "9r_0");
2257
2235
  }, "Embed_component_Uji08ORjXbE"));
2258
- const componentInfo$6 = {
2236
+ const componentInfo$7 = {
2259
2237
  name: "Fragment",
2260
2238
  static: true,
2261
2239
  hidden: true,
2262
2240
  canHaveChildren: true,
2263
2241
  noWrap: true
2264
2242
  };
2265
- const componentInfo$5 = {
2243
+ const componentInfo$6 = {
2266
2244
  name: "Image",
2267
2245
  static: true,
2268
2246
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -2410,7 +2388,7 @@ const componentInfo$5 = {
2410
2388
  }
2411
2389
  ]
2412
2390
  };
2413
- const componentInfo$4 = {
2391
+ const componentInfo$5 = {
2414
2392
  // friendlyName?
2415
2393
  name: "Raw:Img",
2416
2394
  hideFromInsertMenu: true,
@@ -2452,7 +2430,7 @@ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
2452
2430
  ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2453
2431
  }, 0, isEditing() && props.imgSrc || "default-key");
2454
2432
  }, "ImgComponent_component_FXvIDBSffO8"));
2455
- const componentInfo$3 = {
2433
+ const componentInfo$4 = {
2456
2434
  name: "Core:Section",
2457
2435
  static: true,
2458
2436
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2497,6 +2475,61 @@ const componentInfo$3 = {
2497
2475
  }
2498
2476
  ]
2499
2477
  };
2478
+ const componentInfo$3 = {
2479
+ name: "Slot",
2480
+ isRSC: true,
2481
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
2482
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
2483
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
2484
+ // Maybe wrap this for canHaveChildren so bind children to this hm
2485
+ inputs: [
2486
+ {
2487
+ name: "name",
2488
+ type: "string",
2489
+ required: true,
2490
+ defaultValue: "children"
2491
+ }
2492
+ ]
2493
+ };
2494
+ const Slot = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2495
+ var _a, _b;
2496
+ return /* @__PURE__ */ _jsxS("div", {
2497
+ ...!((_a = props.builderContext.context) == null ? void 0 : _a.symbolId) && {
2498
+ "builder-slot": props.name
2499
+ },
2500
+ children: /* @__PURE__ */ _jsxC(Blocks, {
2501
+ get parent() {
2502
+ var _a2;
2503
+ return (_a2 = props.builderContext.context) == null ? void 0 : _a2.symbolId;
2504
+ },
2505
+ get path() {
2506
+ return `symbol.data.${props.name}`;
2507
+ },
2508
+ get context() {
2509
+ return props.builderContext;
2510
+ },
2511
+ blocks: deoptSignal((_b = props.builderContext.rootState) == null ? void 0 : _b[props.name]),
2512
+ [_IMMUTABLE]: {
2513
+ context: _fnSignal((p0) => p0.builderContext, [
2514
+ props
2515
+ ], "p0.builderContext"),
2516
+ parent: _fnSignal((p0) => {
2517
+ var _a2;
2518
+ return (_a2 = p0.builderContext.context) == null ? void 0 : _a2.symbolId;
2519
+ }, [
2520
+ props
2521
+ ], "p0.builderContext.context?.symbolId"),
2522
+ path: _fnSignal((p0) => `symbol.data.${p0.name}`, [
2523
+ props
2524
+ ], "`symbol.data.${p0.name}`")
2525
+ }
2526
+ }, 3, "B1_0")
2527
+ }, {
2528
+ style: {
2529
+ pointerEvents: "auto"
2530
+ }
2531
+ }, 0, "B1_1");
2532
+ }, "Slot_component_WWgWgfV0bb0"));
2500
2533
  const componentInfo$2 = {
2501
2534
  name: "Symbol",
2502
2535
  noWrap: true,
@@ -2782,7 +2815,7 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2782
2815
  flexDirection: "column",
2783
2816
  alignItems: "stretch"
2784
2817
  }
2785
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_2"), 1, "j7_3") : null,
2818
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_2"), 1, "j7_3") : null,
2786
2819
  ((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
2787
2820
  style: {
2788
2821
  pointerEvents: "none",
@@ -2795,41 +2828,41 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2795
2828
  width: "100%",
2796
2829
  height: "100%"
2797
2830
  }
2798
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_4"), 1, "j7_5") : null
2831
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_4"), 1, "j7_5") : null
2799
2832
  ], 1, "j7_6");
2800
2833
  }, "Video_component_qdcTZflYyoQ"));
2801
2834
  const getDefaultRegisteredComponents = () => [
2802
2835
  {
2803
2836
  component: Button,
2804
- ...componentInfo$a
2837
+ ...componentInfo$b
2805
2838
  },
2806
2839
  {
2807
2840
  component: Columns,
2808
- ...componentInfo$9
2841
+ ...componentInfo$a
2809
2842
  },
2810
2843
  {
2811
2844
  component: CustomCode,
2812
- ...componentInfo$8
2845
+ ...componentInfo$9
2813
2846
  },
2814
2847
  {
2815
2848
  component: Embed,
2816
- ...componentInfo$7
2849
+ ...componentInfo$8
2817
2850
  },
2818
2851
  {
2819
2852
  component: FragmentComponent,
2820
- ...componentInfo$6
2853
+ ...componentInfo$7
2821
2854
  },
2822
2855
  {
2823
2856
  component: Image,
2824
- ...componentInfo$5
2857
+ ...componentInfo$6
2825
2858
  },
2826
2859
  {
2827
2860
  component: ImgComponent,
2828
- ...componentInfo$4
2861
+ ...componentInfo$5
2829
2862
  },
2830
2863
  {
2831
2864
  component: SectionComponent,
2832
- ...componentInfo$3
2865
+ ...componentInfo$4
2833
2866
  },
2834
2867
  {
2835
2868
  component: Symbol$1,
@@ -2842,6 +2875,10 @@ const getDefaultRegisteredComponents = () => [
2842
2875
  {
2843
2876
  component: Video,
2844
2877
  ...componentInfo
2878
+ },
2879
+ {
2880
+ component: Slot,
2881
+ ...componentInfo$3
2845
2882
  }
2846
2883
  ];
2847
2884
  const components = [];
@@ -3082,6 +3119,17 @@ async function fetchEntries(options) {
3082
3119
  }
3083
3120
  }
3084
3121
  const getAllContent = fetchEntries;
3122
+ const DEFAULT_TRUSTED_HOSTS = [
3123
+ "*.beta.builder.io",
3124
+ "beta.builder.io",
3125
+ "builder.io",
3126
+ "localhost",
3127
+ "qa.builder.io"
3128
+ ];
3129
+ function isFromTrustedHost(trustedHosts, e) {
3130
+ const url = new URL(e.origin), hostname = url.hostname;
3131
+ return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
3132
+ }
3085
3133
  function isPreviewing() {
3086
3134
  if (!isBrowser())
3087
3135
  return false;
@@ -3281,7 +3329,7 @@ const getInteractionPropertiesForEvent = (event) => {
3281
3329
  }
3282
3330
  };
3283
3331
  };
3284
- const SDK_VERSION = "0.12.0";
3332
+ const SDK_VERSION = "0.12.2";
3285
3333
  const registry = {};
3286
3334
  function register(type, info) {
3287
3335
  let typeList = registry[type];
@@ -3364,8 +3412,11 @@ const setupBrowserForEditing = (options = {}) => {
3364
3412
  options
3365
3413
  }
3366
3414
  }, "*");
3367
- window.addEventListener("message", ({ data }) => {
3415
+ window.addEventListener("message", (event) => {
3368
3416
  var _a2, _b2;
3417
+ if (!isFromTrustedHost(options.trustedHosts, event))
3418
+ return;
3419
+ const { data } = event;
3369
3420
  if (!(data == null ? void 0 : data.type))
3370
3421
  return;
3371
3422
  switch (data.type) {
@@ -3444,6 +3495,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
3444
3495
  };
3445
3496
  const processMessage = function processMessage2(props, state, elementRef, event) {
3446
3497
  var _a;
3498
+ if (!isFromTrustedHost(props.trustedHosts, event))
3499
+ return;
3447
3500
  const { data } = event;
3448
3501
  if (data)
3449
3502
  switch (data.type) {
@@ -3578,6 +3631,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3578
3631
  } : {},
3579
3632
  ...props2.enrich ? {
3580
3633
  enrich: props2.enrich
3634
+ } : {},
3635
+ ...props2.trustedHosts ? {
3636
+ trustedHosts: props2.trustedHosts
3581
3637
  } : {}
3582
3638
  });
3583
3639
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
@@ -3742,7 +3798,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3742
3798
  },
3743
3799
  ...props.contentWrapperProps,
3744
3800
  class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
3745
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "06_0")) : null
3801
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "06_0")) : null
3746
3802
  }, 1, "06_1");
3747
3803
  }, "EnableEditor_component_ko1mO8oaj8k"));
3748
3804
  const getCssFromFont = (font) => {
@@ -3956,6 +4012,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3956
4012
  get contentWrapperProps() {
3957
4013
  return props.contentWrapperProps;
3958
4014
  },
4015
+ get trustedHosts() {
4016
+ return props.trustedHosts;
4017
+ },
3959
4018
  children: [
3960
4019
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
3961
4020
  get scriptStr() {
@@ -4067,7 +4126,10 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
4067
4126
  ], "p0.model"),
4068
4127
  showContent: _fnSignal((p0) => p0.showContent, [
4069
4128
  props
4070
- ], "p0.showContent")
4129
+ ], "p0.showContent"),
4130
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4131
+ props
4132
+ ], "p0.trustedHosts")
4071
4133
  }
4072
4134
  }, 1, "LQ_3");
4073
4135
  }, "ContentComponent_component_HIsczUcxjCE"));
@@ -4200,6 +4262,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4200
4262
  get contentWrapperProps() {
4201
4263
  return props.contentWrapperProps;
4202
4264
  },
4265
+ get trustedHosts() {
4266
+ return props.trustedHosts;
4267
+ },
4203
4268
  [_IMMUTABLE]: {
4204
4269
  apiKey: _fnSignal((p0) => p0.apiKey, [
4205
4270
  props
@@ -4246,7 +4311,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4246
4311
  model: _fnSignal((p0) => p0.model, [
4247
4312
  props
4248
4313
  ], "p0.model"),
4249
- showContent: _IMMUTABLE
4314
+ showContent: _IMMUTABLE,
4315
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4316
+ props
4317
+ ], "p0.trustedHosts")
4250
4318
  }
4251
4319
  }, 3, variant.testVariationId);
4252
4320
  })
@@ -4302,6 +4370,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4302
4370
  get contentWrapperProps() {
4303
4371
  return props.contentWrapperProps;
4304
4372
  },
4373
+ get trustedHosts() {
4374
+ return props.trustedHosts;
4375
+ },
4305
4376
  [_IMMUTABLE]: {
4306
4377
  apiKey: _fnSignal((p0) => p0.apiKey, [
4307
4378
  props
@@ -4351,7 +4422,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4351
4422
  model: _fnSignal((p0) => p0.model, [
4352
4423
  props
4353
4424
  ], "p0.model"),
4354
- showContent: _IMMUTABLE
4425
+ showContent: _IMMUTABLE,
4426
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4427
+ props
4428
+ ], "p0.trustedHosts")
4355
4429
  }
4356
4430
  }, 3, "XM_4")
4357
4431
  ]
@@ -4421,7 +4495,11 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4421
4495
  return props.builderContext.apiKey;
4422
4496
  },
4423
4497
  get context() {
4424
- return props.builderContext.context;
4498
+ var _a2;
4499
+ return {
4500
+ ...props.builderContext.context,
4501
+ symbolId: (_a2 = props.builderBlock) == null ? void 0 : _a2.id
4502
+ };
4425
4503
  },
4426
4504
  get customComponents() {
4427
4505
  return Object.values(props.builderComponents);
@@ -4451,9 +4529,15 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4451
4529
  content: _fnSignal((p0) => p0.contentToUse, [
4452
4530
  state
4453
4531
  ], "p0.contentToUse"),
4454
- context: _fnSignal((p0) => p0.builderContext.context, [
4532
+ context: _fnSignal((p0) => {
4533
+ var _a2;
4534
+ return {
4535
+ ...p0.builderContext.context,
4536
+ symbolId: (_a2 = p0.builderBlock) == null ? void 0 : _a2.id
4537
+ };
4538
+ }, [
4455
4539
  props
4456
- ], "p0.builderContext.context"),
4540
+ ], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
4457
4541
  customComponents: _fnSignal((p0) => Object.values(p0.builderComponents), [
4458
4542
  props
4459
4543
  ], "Object.values(p0.builderComponents)"),