@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 { isServer } from "@builder.io/qwik/build";
4
4
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
@@ -236,26 +236,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
236
236
  else
237
237
  return transformedBlock;
238
238
  }
239
- const EMPTY_HTML_ELEMENTS = [
240
- "area",
241
- "base",
242
- "br",
243
- "col",
244
- "embed",
245
- "hr",
246
- "img",
247
- "input",
248
- "keygen",
249
- "link",
250
- "meta",
251
- "param",
252
- "source",
253
- "track",
254
- "wbr"
255
- ];
256
- const isEmptyHtmlElement = (tagName) => {
257
- return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
258
- };
259
239
  const getComponent = ({ block, context, registeredComponents }) => {
260
240
  var _a;
261
241
  const componentName = (_a = getProcessedBlock({
@@ -540,38 +520,67 @@ function getStyleAttribute(style) {
540
520
  return style;
541
521
  }
542
522
  }
543
- const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
523
+ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
524
+ "area",
525
+ "base",
526
+ "br",
527
+ "col",
528
+ "embed",
529
+ "hr",
530
+ "img",
531
+ "input",
532
+ "keygen",
533
+ "link",
534
+ "meta",
535
+ "param",
536
+ "source",
537
+ "track",
538
+ "wbr"
539
+ ]);
540
+ const isEmptyElement = (tagName) => {
541
+ return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
542
+ };
543
+ const DynamicRenderer = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
544
544
  _jsxBranch();
545
545
  return /* @__PURE__ */ _jsxC(Fragment, {
546
- children: props.hasChildren ? /* @__PURE__ */ _jsxC(props.Wrapper, {
547
- ...getBlockProperties({
548
- block: props.block,
549
- context: props.context
550
- }),
551
- ...getBlockActions({
552
- block: props.block,
553
- rootState: props.context.rootState,
554
- rootSetState: props.context.rootSetState,
555
- localState: props.context.localState,
556
- context: props.context.context,
557
- stripPrefix: true
558
- }),
559
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "87_0")
560
- }, 0, "87_1") : /* @__PURE__ */ _jsxC(props.Wrapper, {
561
- ...getBlockProperties({
562
- block: props.block,
563
- context: props.context
564
- }),
565
- ...getBlockActions({
566
- block: props.block,
567
- rootState: props.context.rootState,
568
- rootSetState: props.context.rootSetState,
569
- localState: props.context.localState,
570
- context: props.context.context,
571
- stripPrefix: true
572
- })
573
- }, 0, "87_2")
574
- }, 1, "87_3");
546
+ children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ _jsxC(props.TagName, {
547
+ ...props.attributes,
548
+ ...props.actionAttributes,
549
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_0")
550
+ }, 0, "yW_1") : /* @__PURE__ */ _jsxC(props.TagName, {
551
+ ...props.attributes,
552
+ ...props.actionAttributes,
553
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_2")
554
+ }, 0, "yW_3") : /* @__PURE__ */ _jsxC(props.TagName, {
555
+ ...props.attributes,
556
+ ...props.actionAttributes
557
+ }, 0, "yW_4")
558
+ }, 1, "yW_5");
559
+ }, "DynamicRenderer_component_1Co0xkmyAfQ"));
560
+ const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
561
+ return /* @__PURE__ */ _jsxC(DynamicRenderer, {
562
+ get TagName() {
563
+ return props.Wrapper;
564
+ },
565
+ actionAttributes: getBlockActions({
566
+ block: props.block,
567
+ rootState: props.context.rootState,
568
+ rootSetState: props.context.rootSetState,
569
+ localState: props.context.localState,
570
+ context: props.context.context,
571
+ stripPrefix: true
572
+ }),
573
+ attributes: getBlockProperties({
574
+ block: props.block,
575
+ context: props.context
576
+ }),
577
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "87_0"),
578
+ [_IMMUTABLE]: {
579
+ TagName: _fnSignal((p0) => p0.Wrapper, [
580
+ props
581
+ ], "p0.Wrapper")
582
+ }
583
+ }, 1, "87_1");
575
584
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
576
585
  const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
577
586
  return /* @__PURE__ */ _jsxC(props.Wrapper, {
@@ -589,7 +598,7 @@ const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQ
589
598
  context: props.context.context
590
599
  })
591
600
  } : {},
592
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "q0_0")
601
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "q0_0")
593
602
  }, 0, "q0_1");
594
603
  }, "InteractiveElement_component_0UqfJpjhn0g"));
595
604
  const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
@@ -795,151 +804,120 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
795
804
  ], "p0.context")
796
805
  }
797
806
  }, 3, "jN_0"),
798
- !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ _jsxC(Fragment, {
807
+ !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
808
+ get Wrapper() {
809
+ return Tag.value;
810
+ },
811
+ get block() {
812
+ return processedBlock.value;
813
+ },
814
+ get context() {
815
+ return props.context;
816
+ },
799
817
  children: [
800
- isEmptyHtmlElement(Tag.value) ? /* @__PURE__ */ _jsxC(BlockWrapper, {
801
- get Wrapper() {
802
- return Tag.value;
818
+ /* @__PURE__ */ _jsxC(ComponentRef, {
819
+ get componentRef() {
820
+ return componentRefProps.value.componentRef;
821
+ },
822
+ get componentOptions() {
823
+ return componentRefProps.value.componentOptions;
803
824
  },
804
- get block() {
805
- return processedBlock.value;
825
+ get blockChildren() {
826
+ return componentRefProps.value.blockChildren;
806
827
  },
807
828
  get context() {
808
- return props.context;
829
+ return componentRefProps.value.context;
830
+ },
831
+ get registeredComponents() {
832
+ return componentRefProps.value.registeredComponents;
833
+ },
834
+ get builderBlock() {
835
+ return componentRefProps.value.builderBlock;
836
+ },
837
+ get includeBlockProps() {
838
+ return componentRefProps.value.includeBlockProps;
839
+ },
840
+ get isInteractive() {
841
+ return componentRefProps.value.isInteractive;
809
842
  },
810
- hasChildren: false,
811
843
  [_IMMUTABLE]: {
812
- Wrapper: _fnSignal((p0) => p0.value, [
813
- Tag
814
- ], "p0.value"),
815
- block: _fnSignal((p0) => p0.value, [
816
- processedBlock
817
- ], "p0.value"),
818
- context: _fnSignal((p0) => p0.context, [
819
- props
820
- ], "p0.context"),
821
- hasChildren: _IMMUTABLE
844
+ blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
845
+ componentRefProps
846
+ ], "p0.value.blockChildren"),
847
+ builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
848
+ componentRefProps
849
+ ], "p0.value.builderBlock"),
850
+ componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
851
+ componentRefProps
852
+ ], "p0.value.componentOptions"),
853
+ componentRef: _fnSignal((p0) => p0.value.componentRef, [
854
+ componentRefProps
855
+ ], "p0.value.componentRef"),
856
+ context: _fnSignal((p0) => p0.value.context, [
857
+ componentRefProps
858
+ ], "p0.value.context"),
859
+ includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
860
+ componentRefProps
861
+ ], "p0.value.includeBlockProps"),
862
+ isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
863
+ componentRefProps
864
+ ], "p0.value.isInteractive"),
865
+ registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
866
+ componentRefProps
867
+ ], "p0.value.registeredComponents")
822
868
  }
823
- }, 3, "jN_1") : null,
824
- !isEmptyHtmlElement(Tag.value) && repeatItem.value ? (repeatItem.value || []).map((data, index) => {
825
- return /* @__PURE__ */ _jsxC(RepeatedBlock, {
826
- get repeatContext() {
827
- return data.context;
828
- },
829
- get block() {
830
- return data.block;
869
+ }, 3, "jN_1"),
870
+ (childrenWithoutParentComponent.value || []).map((child) => {
871
+ return /* @__PURE__ */ _jsxC(Block, {
872
+ block: child,
873
+ get context() {
874
+ return state.childrenContext;
831
875
  },
832
876
  get registeredComponents() {
833
877
  return props.registeredComponents;
834
878
  },
835
879
  [_IMMUTABLE]: {
836
- block: _wrapProp(data, "block"),
880
+ context: _fnSignal((p0) => p0.childrenContext, [
881
+ state
882
+ ], "p0.childrenContext"),
837
883
  registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
838
884
  props
839
- ], "p0.registeredComponents"),
840
- repeatContext: _wrapProp(data, "context")
885
+ ], "p0.registeredComponents")
841
886
  }
842
- }, 3, index);
843
- }) : null,
844
- !isEmptyHtmlElement(Tag.value) && !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
845
- get Wrapper() {
846
- return Tag.value;
847
- },
848
- get block() {
849
- return processedBlock.value;
850
- },
851
- get context() {
852
- return props.context;
853
- },
854
- children: [
855
- /* @__PURE__ */ _jsxC(ComponentRef, {
856
- get componentRef() {
857
- return componentRefProps.value.componentRef;
858
- },
859
- get componentOptions() {
860
- return componentRefProps.value.componentOptions;
861
- },
862
- get blockChildren() {
863
- return componentRefProps.value.blockChildren;
864
- },
865
- get context() {
866
- return componentRefProps.value.context;
867
- },
868
- get registeredComponents() {
869
- return componentRefProps.value.registeredComponents;
870
- },
871
- get builderBlock() {
872
- return componentRefProps.value.builderBlock;
873
- },
874
- get includeBlockProps() {
875
- return componentRefProps.value.includeBlockProps;
876
- },
877
- get isInteractive() {
878
- return componentRefProps.value.isInteractive;
879
- },
880
- [_IMMUTABLE]: {
881
- blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
882
- componentRefProps
883
- ], "p0.value.blockChildren"),
884
- builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
885
- componentRefProps
886
- ], "p0.value.builderBlock"),
887
- componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
888
- componentRefProps
889
- ], "p0.value.componentOptions"),
890
- componentRef: _fnSignal((p0) => p0.value.componentRef, [
891
- componentRefProps
892
- ], "p0.value.componentRef"),
893
- context: _fnSignal((p0) => p0.value.context, [
894
- componentRefProps
895
- ], "p0.value.context"),
896
- includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
897
- componentRefProps
898
- ], "p0.value.includeBlockProps"),
899
- isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
900
- componentRefProps
901
- ], "p0.value.isInteractive"),
902
- registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
903
- componentRefProps
904
- ], "p0.value.registeredComponents")
905
- }
906
- }, 3, "jN_2"),
907
- (childrenWithoutParentComponent.value || []).map((child) => {
908
- return /* @__PURE__ */ _jsxC(Block, {
909
- block: child,
910
- get context() {
911
- return state.childrenContext;
912
- },
913
- get registeredComponents() {
914
- return props.registeredComponents;
915
- },
916
- [_IMMUTABLE]: {
917
- context: _fnSignal((p0) => p0.childrenContext, [
918
- state
919
- ], "p0.childrenContext"),
920
- registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
921
- props
922
- ], "p0.registeredComponents")
923
- }
924
- }, 3, child.id);
925
- })
926
- ],
927
- hasChildren: true,
928
- [_IMMUTABLE]: {
929
- Wrapper: _fnSignal((p0) => p0.value, [
930
- Tag
931
- ], "p0.value"),
932
- block: _fnSignal((p0) => p0.value, [
933
- processedBlock
934
- ], "p0.value"),
935
- context: _fnSignal((p0) => p0.context, [
936
- props
937
- ], "p0.context"),
938
- hasChildren: _IMMUTABLE
939
- }
940
- }, 1, "jN_3") : null
941
- ]
942
- }, 1, "jN_4") : /* @__PURE__ */ _jsxC(ComponentRef, {
887
+ }, 3, child.id);
888
+ })
889
+ ],
890
+ [_IMMUTABLE]: {
891
+ Wrapper: _fnSignal((p0) => p0.value, [
892
+ Tag
893
+ ], "p0.value"),
894
+ block: _fnSignal((p0) => p0.value, [
895
+ processedBlock
896
+ ], "p0.value"),
897
+ context: _fnSignal((p0) => p0.context, [
898
+ props
899
+ ], "p0.context")
900
+ }
901
+ }, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
902
+ return /* @__PURE__ */ _jsxC(RepeatedBlock, {
903
+ get repeatContext() {
904
+ return data.context;
905
+ },
906
+ get block() {
907
+ return data.block;
908
+ },
909
+ get registeredComponents() {
910
+ return props.registeredComponents;
911
+ },
912
+ [_IMMUTABLE]: {
913
+ block: _wrapProp(data, "block"),
914
+ registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
915
+ props
916
+ ], "p0.registeredComponents"),
917
+ repeatContext: _wrapProp(data, "context")
918
+ }
919
+ }, 3, index);
920
+ }) : /* @__PURE__ */ _jsxC(ComponentRef, {
943
921
  get componentRef() {
944
922
  return componentRefProps.value.componentRef;
945
923
  },
@@ -990,10 +968,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
990
968
  componentRefProps
991
969
  ], "p0.value.registeredComponents")
992
970
  }
993
- }, 3, "jN_5")
971
+ }, 3, "jN_3")
994
972
  ]
995
- }, 1, "jN_6") : null
996
- }, 1, "jN_7");
973
+ }, 1, "jN_4") : null
974
+ }, 1, "jN_5");
997
975
  }, "Block_component_nnPv0RY0U0k"));
998
976
  const onClick$1 = function onClick2(props, state) {
999
977
  var _a, _b;
@@ -1062,7 +1040,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
1062
1040
  state
1063
1041
  ]),
1064
1042
  ...props.BlocksWrapperProps,
1065
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "3u_0"),
1043
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "3u_0"),
1066
1044
  [_IMMUTABLE]: {
1067
1045
  "builder-parent-id": _fnSignal((p0) => p0.parent, [
1068
1046
  props
@@ -1330,7 +1308,7 @@ const STYLES$1 = `
1330
1308
  }
1331
1309
  `;
1332
1310
  const FragmentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
1333
- return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot, null, 3, "oj_0"), 1, "oj_1");
1311
+ return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "oj_0"), 1, "oj_1");
1334
1312
  }, "FragmentComponent_component_T0AypnadAK0"));
1335
1313
  function removeProtocol(path) {
1336
1314
  return path.replace(/http(s)?:/, "");
@@ -1482,10 +1460,10 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1482
1460
  props
1483
1461
  ], '{paddingTop:p0.aspectRatio*100+"%"}')
1484
1462
  }, null, 3, "0A_1") : null,
1485
- ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_2") : null,
1463
+ ((_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,
1486
1464
  !props.fitContent && props.children ? /* @__PURE__ */ _jsxQ("div", null, {
1487
1465
  class: "div-Image-2"
1488
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_3"), 1, "0A_4") : null
1466
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "0A_3"), 1, "0A_4") : null
1489
1467
  ]
1490
1468
  }, 1, "0A_5");
1491
1469
  }, "Image_component_LRxDkFa1EfU"));
@@ -1513,7 +1491,7 @@ const STYLES = `
1513
1491
  const SectionComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
1514
1492
  return /* @__PURE__ */ _jsxS("section", {
1515
1493
  ...props.attributes,
1516
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "2Y_0"),
1494
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "2Y_0"),
1517
1495
  style: {
1518
1496
  width: "100%",
1519
1497
  alignSelf: "stretch",
@@ -1702,7 +1680,7 @@ const handleABTesting = async ({ item, canTrack }) => {
1702
1680
  };
1703
1681
  };
1704
1682
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1705
- const componentInfo$a = {
1683
+ const componentInfo$b = {
1706
1684
  name: "Core:Button",
1707
1685
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1708
1686
  defaultStyles: {
@@ -1740,7 +1718,7 @@ const componentInfo$a = {
1740
1718
  static: true,
1741
1719
  noWrap: true
1742
1720
  };
1743
- const componentInfo$9 = {
1721
+ const componentInfo$a = {
1744
1722
  // TODO: ways to statically preprocess JSON for references, functions, etc
1745
1723
  name: "Columns",
1746
1724
  isRSC: true,
@@ -1982,7 +1960,7 @@ const componentInfo$9 = {
1982
1960
  }
1983
1961
  ]
1984
1962
  };
1985
- const componentInfo$8 = {
1963
+ const componentInfo$9 = {
1986
1964
  name: "Custom Code",
1987
1965
  static: true,
1988
1966
  requiredPermissions: [
@@ -2061,7 +2039,7 @@ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((prop
2061
2039
  ], "p0.code")
2062
2040
  }, null, 3, "bY_0");
2063
2041
  }, "CustomCode_component_uYOSy7w7Zqw"));
2064
- const componentInfo$7 = {
2042
+ const componentInfo$8 = {
2065
2043
  name: "Embed",
2066
2044
  static: true,
2067
2045
  inputs: [
@@ -2154,14 +2132,14 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2154
2132
  ], "p0.content")
2155
2133
  }, null, 3, "9r_0");
2156
2134
  }, "Embed_component_Uji08ORjXbE"));
2157
- const componentInfo$6 = {
2135
+ const componentInfo$7 = {
2158
2136
  name: "Fragment",
2159
2137
  static: true,
2160
2138
  hidden: true,
2161
2139
  canHaveChildren: true,
2162
2140
  noWrap: true
2163
2141
  };
2164
- const componentInfo$5 = {
2142
+ const componentInfo$6 = {
2165
2143
  name: "Image",
2166
2144
  static: true,
2167
2145
  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",
@@ -2309,7 +2287,7 @@ const componentInfo$5 = {
2309
2287
  }
2310
2288
  ]
2311
2289
  };
2312
- const componentInfo$4 = {
2290
+ const componentInfo$5 = {
2313
2291
  // friendlyName?
2314
2292
  name: "Raw:Img",
2315
2293
  hideFromInsertMenu: true,
@@ -2351,7 +2329,7 @@ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
2351
2329
  ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2352
2330
  }, 0, isEditing() && props.imgSrc || "default-key");
2353
2331
  }, "ImgComponent_component_FXvIDBSffO8"));
2354
- const componentInfo$3 = {
2332
+ const componentInfo$4 = {
2355
2333
  name: "Core:Section",
2356
2334
  static: true,
2357
2335
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2396,6 +2374,61 @@ const componentInfo$3 = {
2396
2374
  }
2397
2375
  ]
2398
2376
  };
2377
+ const componentInfo$3 = {
2378
+ name: "Slot",
2379
+ isRSC: true,
2380
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
2381
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
2382
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
2383
+ // Maybe wrap this for canHaveChildren so bind children to this hm
2384
+ inputs: [
2385
+ {
2386
+ name: "name",
2387
+ type: "string",
2388
+ required: true,
2389
+ defaultValue: "children"
2390
+ }
2391
+ ]
2392
+ };
2393
+ const Slot = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
2394
+ var _a, _b;
2395
+ return /* @__PURE__ */ _jsxS("div", {
2396
+ ...!((_a = props.builderContext.context) == null ? void 0 : _a.symbolId) && {
2397
+ "builder-slot": props.name
2398
+ },
2399
+ children: /* @__PURE__ */ _jsxC(Blocks, {
2400
+ get parent() {
2401
+ var _a2;
2402
+ return (_a2 = props.builderContext.context) == null ? void 0 : _a2.symbolId;
2403
+ },
2404
+ get path() {
2405
+ return `symbol.data.${props.name}`;
2406
+ },
2407
+ get context() {
2408
+ return props.builderContext;
2409
+ },
2410
+ blocks: deoptSignal((_b = props.builderContext.rootState) == null ? void 0 : _b[props.name]),
2411
+ [_IMMUTABLE]: {
2412
+ context: _fnSignal((p0) => p0.builderContext, [
2413
+ props
2414
+ ], "p0.builderContext"),
2415
+ parent: _fnSignal((p0) => {
2416
+ var _a2;
2417
+ return (_a2 = p0.builderContext.context) == null ? void 0 : _a2.symbolId;
2418
+ }, [
2419
+ props
2420
+ ], "p0.builderContext.context?.symbolId"),
2421
+ path: _fnSignal((p0) => `symbol.data.${p0.name}`, [
2422
+ props
2423
+ ], "`symbol.data.${p0.name}`")
2424
+ }
2425
+ }, 3, "B1_0")
2426
+ }, {
2427
+ style: {
2428
+ pointerEvents: "auto"
2429
+ }
2430
+ }, 0, "B1_1");
2431
+ }, "Slot_component_WWgWgfV0bb0"));
2399
2432
  const componentInfo$2 = {
2400
2433
  name: "Symbol",
2401
2434
  noWrap: true,
@@ -2681,7 +2714,7 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2681
2714
  flexDirection: "column",
2682
2715
  alignItems: "stretch"
2683
2716
  }
2684
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_2"), 1, "j7_3") : null,
2717
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_2"), 1, "j7_3") : null,
2685
2718
  ((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
2686
2719
  style: {
2687
2720
  pointerEvents: "none",
@@ -2694,41 +2727,41 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
2694
2727
  width: "100%",
2695
2728
  height: "100%"
2696
2729
  }
2697
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_4"), 1, "j7_5") : null
2730
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_4"), 1, "j7_5") : null
2698
2731
  ], 1, "j7_6");
2699
2732
  }, "Video_component_qdcTZflYyoQ"));
2700
2733
  const getDefaultRegisteredComponents = () => [
2701
2734
  {
2702
2735
  component: Button,
2703
- ...componentInfo$a
2736
+ ...componentInfo$b
2704
2737
  },
2705
2738
  {
2706
2739
  component: Columns,
2707
- ...componentInfo$9
2740
+ ...componentInfo$a
2708
2741
  },
2709
2742
  {
2710
2743
  component: CustomCode,
2711
- ...componentInfo$8
2744
+ ...componentInfo$9
2712
2745
  },
2713
2746
  {
2714
2747
  component: Embed,
2715
- ...componentInfo$7
2748
+ ...componentInfo$8
2716
2749
  },
2717
2750
  {
2718
2751
  component: FragmentComponent,
2719
- ...componentInfo$6
2752
+ ...componentInfo$7
2720
2753
  },
2721
2754
  {
2722
2755
  component: Image,
2723
- ...componentInfo$5
2756
+ ...componentInfo$6
2724
2757
  },
2725
2758
  {
2726
2759
  component: ImgComponent,
2727
- ...componentInfo$4
2760
+ ...componentInfo$5
2728
2761
  },
2729
2762
  {
2730
2763
  component: SectionComponent,
2731
- ...componentInfo$3
2764
+ ...componentInfo$4
2732
2765
  },
2733
2766
  {
2734
2767
  component: Symbol$1,
@@ -2741,6 +2774,10 @@ const getDefaultRegisteredComponents = () => [
2741
2774
  {
2742
2775
  component: Video,
2743
2776
  ...componentInfo
2777
+ },
2778
+ {
2779
+ component: Slot,
2780
+ ...componentInfo$3
2744
2781
  }
2745
2782
  ];
2746
2783
  const components = [];
@@ -2981,6 +3018,17 @@ async function fetchEntries(options) {
2981
3018
  }
2982
3019
  }
2983
3020
  const getAllContent = fetchEntries;
3021
+ const DEFAULT_TRUSTED_HOSTS = [
3022
+ "*.beta.builder.io",
3023
+ "beta.builder.io",
3024
+ "builder.io",
3025
+ "localhost",
3026
+ "qa.builder.io"
3027
+ ];
3028
+ function isFromTrustedHost(trustedHosts, e) {
3029
+ const url = new URL(e.origin), hostname = url.hostname;
3030
+ return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
3031
+ }
2984
3032
  function isPreviewing() {
2985
3033
  if (!isBrowser())
2986
3034
  return false;
@@ -3180,7 +3228,7 @@ const getInteractionPropertiesForEvent = (event) => {
3180
3228
  }
3181
3229
  };
3182
3230
  };
3183
- const SDK_VERSION = "0.12.0";
3231
+ const SDK_VERSION = "0.12.2";
3184
3232
  const registry = {};
3185
3233
  function register(type, info) {
3186
3234
  let typeList = registry[type];
@@ -3263,8 +3311,11 @@ const setupBrowserForEditing = (options = {}) => {
3263
3311
  options
3264
3312
  }
3265
3313
  }, "*");
3266
- window.addEventListener("message", ({ data }) => {
3314
+ window.addEventListener("message", (event) => {
3267
3315
  var _a2, _b2;
3316
+ if (!isFromTrustedHost(options.trustedHosts, event))
3317
+ return;
3318
+ const { data } = event;
3268
3319
  if (!(data == null ? void 0 : data.type))
3269
3320
  return;
3270
3321
  switch (data.type) {
@@ -3343,6 +3394,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
3343
3394
  };
3344
3395
  const processMessage = function processMessage2(props, state, elementRef, event) {
3345
3396
  var _a;
3397
+ if (!isFromTrustedHost(props.trustedHosts, event))
3398
+ return;
3346
3399
  const { data } = event;
3347
3400
  if (data)
3348
3401
  switch (data.type) {
@@ -3477,6 +3530,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3477
3530
  } : {},
3478
3531
  ...props2.enrich ? {
3479
3532
  enrich: props2.enrich
3533
+ } : {},
3534
+ ...props2.trustedHosts ? {
3535
+ trustedHosts: props2.trustedHosts
3480
3536
  } : {}
3481
3537
  });
3482
3538
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
@@ -3641,7 +3697,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3641
3697
  },
3642
3698
  ...props.contentWrapperProps,
3643
3699
  class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
3644
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "06_0")) : null
3700
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "06_0")) : null
3645
3701
  }, 1, "06_1");
3646
3702
  }, "EnableEditor_component_ko1mO8oaj8k"));
3647
3703
  const getCssFromFont = (font) => {
@@ -3855,6 +3911,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3855
3911
  get contentWrapperProps() {
3856
3912
  return props.contentWrapperProps;
3857
3913
  },
3914
+ get trustedHosts() {
3915
+ return props.trustedHosts;
3916
+ },
3858
3917
  children: [
3859
3918
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
3860
3919
  get scriptStr() {
@@ -3966,7 +4025,10 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3966
4025
  ], "p0.model"),
3967
4026
  showContent: _fnSignal((p0) => p0.showContent, [
3968
4027
  props
3969
- ], "p0.showContent")
4028
+ ], "p0.showContent"),
4029
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4030
+ props
4031
+ ], "p0.trustedHosts")
3970
4032
  }
3971
4033
  }, 1, "LQ_3");
3972
4034
  }, "ContentComponent_component_HIsczUcxjCE"));
@@ -4099,6 +4161,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4099
4161
  get contentWrapperProps() {
4100
4162
  return props.contentWrapperProps;
4101
4163
  },
4164
+ get trustedHosts() {
4165
+ return props.trustedHosts;
4166
+ },
4102
4167
  [_IMMUTABLE]: {
4103
4168
  apiKey: _fnSignal((p0) => p0.apiKey, [
4104
4169
  props
@@ -4145,7 +4210,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4145
4210
  model: _fnSignal((p0) => p0.model, [
4146
4211
  props
4147
4212
  ], "p0.model"),
4148
- showContent: _IMMUTABLE
4213
+ showContent: _IMMUTABLE,
4214
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4215
+ props
4216
+ ], "p0.trustedHosts")
4149
4217
  }
4150
4218
  }, 3, variant.testVariationId);
4151
4219
  })
@@ -4201,6 +4269,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4201
4269
  get contentWrapperProps() {
4202
4270
  return props.contentWrapperProps;
4203
4271
  },
4272
+ get trustedHosts() {
4273
+ return props.trustedHosts;
4274
+ },
4204
4275
  [_IMMUTABLE]: {
4205
4276
  apiKey: _fnSignal((p0) => p0.apiKey, [
4206
4277
  props
@@ -4250,7 +4321,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4250
4321
  model: _fnSignal((p0) => p0.model, [
4251
4322
  props
4252
4323
  ], "p0.model"),
4253
- showContent: _IMMUTABLE
4324
+ showContent: _IMMUTABLE,
4325
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4326
+ props
4327
+ ], "p0.trustedHosts")
4254
4328
  }
4255
4329
  }, 3, "XM_4")
4256
4330
  ]
@@ -4320,7 +4394,11 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4320
4394
  return props.builderContext.apiKey;
4321
4395
  },
4322
4396
  get context() {
4323
- return props.builderContext.context;
4397
+ var _a2;
4398
+ return {
4399
+ ...props.builderContext.context,
4400
+ symbolId: (_a2 = props.builderBlock) == null ? void 0 : _a2.id
4401
+ };
4324
4402
  },
4325
4403
  get customComponents() {
4326
4404
  return Object.values(props.builderComponents);
@@ -4350,9 +4428,15 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4350
4428
  content: _fnSignal((p0) => p0.contentToUse, [
4351
4429
  state
4352
4430
  ], "p0.contentToUse"),
4353
- context: _fnSignal((p0) => p0.builderContext.context, [
4431
+ context: _fnSignal((p0) => {
4432
+ var _a2;
4433
+ return {
4434
+ ...p0.builderContext.context,
4435
+ symbolId: (_a2 = p0.builderBlock) == null ? void 0 : _a2.id
4436
+ };
4437
+ }, [
4354
4438
  props
4355
- ], "p0.builderContext.context"),
4439
+ ], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
4356
4440
  customComponents: _fnSignal((p0) => Object.values(p0.builderComponents), [
4357
4441
  props
4358
4442
  ], "Object.values(p0.builderComponents)"),