@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.
@@ -238,26 +238,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
238
238
  else
239
239
  return transformedBlock;
240
240
  }
241
- const EMPTY_HTML_ELEMENTS = [
242
- "area",
243
- "base",
244
- "br",
245
- "col",
246
- "embed",
247
- "hr",
248
- "img",
249
- "input",
250
- "keygen",
251
- "link",
252
- "meta",
253
- "param",
254
- "source",
255
- "track",
256
- "wbr"
257
- ];
258
- const isEmptyHtmlElement = (tagName) => {
259
- return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
260
- };
261
241
  const getComponent = ({ block, context, registeredComponents }) => {
262
242
  var _a;
263
243
  const componentName = (_a = getProcessedBlock({
@@ -542,38 +522,67 @@ function getStyleAttribute(style) {
542
522
  return style;
543
523
  }
544
524
  }
545
- const BlockWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
525
+ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
526
+ "area",
527
+ "base",
528
+ "br",
529
+ "col",
530
+ "embed",
531
+ "hr",
532
+ "img",
533
+ "input",
534
+ "keygen",
535
+ "link",
536
+ "meta",
537
+ "param",
538
+ "source",
539
+ "track",
540
+ "wbr"
541
+ ]);
542
+ const isEmptyElement = (tagName) => {
543
+ return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
544
+ };
545
+ const DynamicRenderer = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
546
546
  qwik._jsxBranch();
547
547
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
548
- children: props.hasChildren ? /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
549
- ...getBlockProperties({
550
- block: props.block,
551
- context: props.context
552
- }),
553
- ...getBlockActions({
554
- block: props.block,
555
- rootState: props.context.rootState,
556
- rootSetState: props.context.rootSetState,
557
- localState: props.context.localState,
558
- context: props.context.context,
559
- stripPrefix: true
560
- }),
561
- children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "87_0")
562
- }, 0, "87_1") : /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
563
- ...getBlockProperties({
564
- block: props.block,
565
- context: props.context
566
- }),
567
- ...getBlockActions({
568
- block: props.block,
569
- rootState: props.context.rootState,
570
- rootSetState: props.context.rootSetState,
571
- localState: props.context.localState,
572
- context: props.context.context,
573
- stripPrefix: true
574
- })
575
- }, 0, "87_2")
576
- }, 1, "87_3");
548
+ children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ qwik._jsxC(props.TagName, {
549
+ ...props.attributes,
550
+ ...props.actionAttributes,
551
+ children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "yW_0")
552
+ }, 0, "yW_1") : /* @__PURE__ */ qwik._jsxC(props.TagName, {
553
+ ...props.attributes,
554
+ ...props.actionAttributes,
555
+ children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "yW_2")
556
+ }, 0, "yW_3") : /* @__PURE__ */ qwik._jsxC(props.TagName, {
557
+ ...props.attributes,
558
+ ...props.actionAttributes
559
+ }, 0, "yW_4")
560
+ }, 1, "yW_5");
561
+ }, "DynamicRenderer_component_1Co0xkmyAfQ"));
562
+ const BlockWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
563
+ return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
564
+ get TagName() {
565
+ return props.Wrapper;
566
+ },
567
+ actionAttributes: getBlockActions({
568
+ block: props.block,
569
+ rootState: props.context.rootState,
570
+ rootSetState: props.context.rootSetState,
571
+ localState: props.context.localState,
572
+ context: props.context.context,
573
+ stripPrefix: true
574
+ }),
575
+ attributes: getBlockProperties({
576
+ block: props.block,
577
+ context: props.context
578
+ }),
579
+ children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "87_0"),
580
+ [qwik._IMMUTABLE]: {
581
+ TagName: qwik._fnSignal((p0) => p0.Wrapper, [
582
+ props
583
+ ], "p0.Wrapper")
584
+ }
585
+ }, 1, "87_1");
577
586
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
578
587
  const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
579
588
  return /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
@@ -797,151 +806,120 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
797
806
  ], "p0.context")
798
807
  }
799
808
  }, 3, "jN_0"),
800
- !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
809
+ !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ qwik._jsxC(BlockWrapper, {
810
+ get Wrapper() {
811
+ return Tag.value;
812
+ },
813
+ get block() {
814
+ return processedBlock.value;
815
+ },
816
+ get context() {
817
+ return props.context;
818
+ },
801
819
  children: [
802
- isEmptyHtmlElement(Tag.value) ? /* @__PURE__ */ qwik._jsxC(BlockWrapper, {
803
- get Wrapper() {
804
- return Tag.value;
820
+ /* @__PURE__ */ qwik._jsxC(ComponentRef, {
821
+ get componentRef() {
822
+ return componentRefProps.value.componentRef;
823
+ },
824
+ get componentOptions() {
825
+ return componentRefProps.value.componentOptions;
805
826
  },
806
- get block() {
807
- return processedBlock.value;
827
+ get blockChildren() {
828
+ return componentRefProps.value.blockChildren;
808
829
  },
809
830
  get context() {
810
- return props.context;
831
+ return componentRefProps.value.context;
832
+ },
833
+ get registeredComponents() {
834
+ return componentRefProps.value.registeredComponents;
835
+ },
836
+ get builderBlock() {
837
+ return componentRefProps.value.builderBlock;
838
+ },
839
+ get includeBlockProps() {
840
+ return componentRefProps.value.includeBlockProps;
841
+ },
842
+ get isInteractive() {
843
+ return componentRefProps.value.isInteractive;
811
844
  },
812
- hasChildren: false,
813
845
  [qwik._IMMUTABLE]: {
814
- Wrapper: qwik._fnSignal((p0) => p0.value, [
815
- Tag
816
- ], "p0.value"),
817
- block: qwik._fnSignal((p0) => p0.value, [
818
- processedBlock
819
- ], "p0.value"),
820
- context: qwik._fnSignal((p0) => p0.context, [
821
- props
822
- ], "p0.context"),
823
- hasChildren: qwik._IMMUTABLE
846
+ blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
847
+ componentRefProps
848
+ ], "p0.value.blockChildren"),
849
+ builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
850
+ componentRefProps
851
+ ], "p0.value.builderBlock"),
852
+ componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
853
+ componentRefProps
854
+ ], "p0.value.componentOptions"),
855
+ componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
856
+ componentRefProps
857
+ ], "p0.value.componentRef"),
858
+ context: qwik._fnSignal((p0) => p0.value.context, [
859
+ componentRefProps
860
+ ], "p0.value.context"),
861
+ includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
862
+ componentRefProps
863
+ ], "p0.value.includeBlockProps"),
864
+ isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
865
+ componentRefProps
866
+ ], "p0.value.isInteractive"),
867
+ registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
868
+ componentRefProps
869
+ ], "p0.value.registeredComponents")
824
870
  }
825
- }, 3, "jN_1") : null,
826
- !isEmptyHtmlElement(Tag.value) && repeatItem.value ? (repeatItem.value || []).map((data, index) => {
827
- return /* @__PURE__ */ qwik._jsxC(RepeatedBlock, {
828
- get repeatContext() {
829
- return data.context;
830
- },
831
- get block() {
832
- return data.block;
871
+ }, 3, "jN_1"),
872
+ (childrenWithoutParentComponent.value || []).map((child) => {
873
+ return /* @__PURE__ */ qwik._jsxC(Block, {
874
+ block: child,
875
+ get context() {
876
+ return state.childrenContext;
833
877
  },
834
878
  get registeredComponents() {
835
879
  return props.registeredComponents;
836
880
  },
837
881
  [qwik._IMMUTABLE]: {
838
- block: qwik._wrapProp(data, "block"),
882
+ context: qwik._fnSignal((p0) => p0.childrenContext, [
883
+ state
884
+ ], "p0.childrenContext"),
839
885
  registeredComponents: qwik._fnSignal((p0) => p0.registeredComponents, [
840
886
  props
841
- ], "p0.registeredComponents"),
842
- repeatContext: qwik._wrapProp(data, "context")
887
+ ], "p0.registeredComponents")
843
888
  }
844
- }, 3, index);
845
- }) : null,
846
- !isEmptyHtmlElement(Tag.value) && !repeatItem.value ? /* @__PURE__ */ qwik._jsxC(BlockWrapper, {
847
- get Wrapper() {
848
- return Tag.value;
849
- },
850
- get block() {
851
- return processedBlock.value;
852
- },
853
- get context() {
854
- return props.context;
855
- },
856
- children: [
857
- /* @__PURE__ */ qwik._jsxC(ComponentRef, {
858
- get componentRef() {
859
- return componentRefProps.value.componentRef;
860
- },
861
- get componentOptions() {
862
- return componentRefProps.value.componentOptions;
863
- },
864
- get blockChildren() {
865
- return componentRefProps.value.blockChildren;
866
- },
867
- get context() {
868
- return componentRefProps.value.context;
869
- },
870
- get registeredComponents() {
871
- return componentRefProps.value.registeredComponents;
872
- },
873
- get builderBlock() {
874
- return componentRefProps.value.builderBlock;
875
- },
876
- get includeBlockProps() {
877
- return componentRefProps.value.includeBlockProps;
878
- },
879
- get isInteractive() {
880
- return componentRefProps.value.isInteractive;
881
- },
882
- [qwik._IMMUTABLE]: {
883
- blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
884
- componentRefProps
885
- ], "p0.value.blockChildren"),
886
- builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
887
- componentRefProps
888
- ], "p0.value.builderBlock"),
889
- componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
890
- componentRefProps
891
- ], "p0.value.componentOptions"),
892
- componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
893
- componentRefProps
894
- ], "p0.value.componentRef"),
895
- context: qwik._fnSignal((p0) => p0.value.context, [
896
- componentRefProps
897
- ], "p0.value.context"),
898
- includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
899
- componentRefProps
900
- ], "p0.value.includeBlockProps"),
901
- isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
902
- componentRefProps
903
- ], "p0.value.isInteractive"),
904
- registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
905
- componentRefProps
906
- ], "p0.value.registeredComponents")
907
- }
908
- }, 3, "jN_2"),
909
- (childrenWithoutParentComponent.value || []).map((child) => {
910
- return /* @__PURE__ */ qwik._jsxC(Block, {
911
- block: child,
912
- get context() {
913
- return state.childrenContext;
914
- },
915
- get registeredComponents() {
916
- return props.registeredComponents;
917
- },
918
- [qwik._IMMUTABLE]: {
919
- context: qwik._fnSignal((p0) => p0.childrenContext, [
920
- state
921
- ], "p0.childrenContext"),
922
- registeredComponents: qwik._fnSignal((p0) => p0.registeredComponents, [
923
- props
924
- ], "p0.registeredComponents")
925
- }
926
- }, 3, child.id);
927
- })
928
- ],
929
- hasChildren: true,
930
- [qwik._IMMUTABLE]: {
931
- Wrapper: qwik._fnSignal((p0) => p0.value, [
932
- Tag
933
- ], "p0.value"),
934
- block: qwik._fnSignal((p0) => p0.value, [
935
- processedBlock
936
- ], "p0.value"),
937
- context: qwik._fnSignal((p0) => p0.context, [
938
- props
939
- ], "p0.context"),
940
- hasChildren: qwik._IMMUTABLE
941
- }
942
- }, 1, "jN_3") : null
943
- ]
944
- }, 1, "jN_4") : /* @__PURE__ */ qwik._jsxC(ComponentRef, {
889
+ }, 3, child.id);
890
+ })
891
+ ],
892
+ [qwik._IMMUTABLE]: {
893
+ Wrapper: qwik._fnSignal((p0) => p0.value, [
894
+ Tag
895
+ ], "p0.value"),
896
+ block: qwik._fnSignal((p0) => p0.value, [
897
+ processedBlock
898
+ ], "p0.value"),
899
+ context: qwik._fnSignal((p0) => p0.context, [
900
+ props
901
+ ], "p0.context")
902
+ }
903
+ }, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
904
+ return /* @__PURE__ */ qwik._jsxC(RepeatedBlock, {
905
+ get repeatContext() {
906
+ return data.context;
907
+ },
908
+ get block() {
909
+ return data.block;
910
+ },
911
+ get registeredComponents() {
912
+ return props.registeredComponents;
913
+ },
914
+ [qwik._IMMUTABLE]: {
915
+ block: qwik._wrapProp(data, "block"),
916
+ registeredComponents: qwik._fnSignal((p0) => p0.registeredComponents, [
917
+ props
918
+ ], "p0.registeredComponents"),
919
+ repeatContext: qwik._wrapProp(data, "context")
920
+ }
921
+ }, 3, index);
922
+ }) : /* @__PURE__ */ qwik._jsxC(ComponentRef, {
945
923
  get componentRef() {
946
924
  return componentRefProps.value.componentRef;
947
925
  },
@@ -992,10 +970,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
992
970
  componentRefProps
993
971
  ], "p0.value.registeredComponents")
994
972
  }
995
- }, 3, "jN_5")
973
+ }, 3, "jN_3")
996
974
  ]
997
- }, 1, "jN_6") : null
998
- }, 1, "jN_7");
975
+ }, 1, "jN_4") : null
976
+ }, 1, "jN_5");
999
977
  }, "Block_component_nnPv0RY0U0k"));
1000
978
  const onClick$1 = function onClick2(props, state) {
1001
979
  var _a, _b;
@@ -1704,7 +1682,7 @@ const handleABTesting = async ({ item, canTrack }) => {
1704
1682
  };
1705
1683
  };
1706
1684
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1707
- const componentInfo$a = {
1685
+ const componentInfo$b = {
1708
1686
  name: "Core:Button",
1709
1687
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1710
1688
  defaultStyles: {
@@ -1742,7 +1720,7 @@ const componentInfo$a = {
1742
1720
  static: true,
1743
1721
  noWrap: true
1744
1722
  };
1745
- const componentInfo$9 = {
1723
+ const componentInfo$a = {
1746
1724
  // TODO: ways to statically preprocess JSON for references, functions, etc
1747
1725
  name: "Columns",
1748
1726
  isRSC: true,
@@ -1984,7 +1962,7 @@ const componentInfo$9 = {
1984
1962
  }
1985
1963
  ]
1986
1964
  };
1987
- const componentInfo$8 = {
1965
+ const componentInfo$9 = {
1988
1966
  name: "Custom Code",
1989
1967
  static: true,
1990
1968
  requiredPermissions: [
@@ -2063,7 +2041,7 @@ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
2063
2041
  ], "p0.code")
2064
2042
  }, null, 3, "bY_0");
2065
2043
  }, "CustomCode_component_uYOSy7w7Zqw"));
2066
- const componentInfo$7 = {
2044
+ const componentInfo$8 = {
2067
2045
  name: "Embed",
2068
2046
  static: true,
2069
2047
  inputs: [
@@ -2156,14 +2134,14 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2156
2134
  ], "p0.content")
2157
2135
  }, null, 3, "9r_0");
2158
2136
  }, "Embed_component_Uji08ORjXbE"));
2159
- const componentInfo$6 = {
2137
+ const componentInfo$7 = {
2160
2138
  name: "Fragment",
2161
2139
  static: true,
2162
2140
  hidden: true,
2163
2141
  canHaveChildren: true,
2164
2142
  noWrap: true
2165
2143
  };
2166
- const componentInfo$5 = {
2144
+ const componentInfo$6 = {
2167
2145
  name: "Image",
2168
2146
  static: true,
2169
2147
  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",
@@ -2311,7 +2289,7 @@ const componentInfo$5 = {
2311
2289
  }
2312
2290
  ]
2313
2291
  };
2314
- const componentInfo$4 = {
2292
+ const componentInfo$5 = {
2315
2293
  // friendlyName?
2316
2294
  name: "Raw:Img",
2317
2295
  hideFromInsertMenu: true,
@@ -2353,7 +2331,7 @@ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
2353
2331
  ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2354
2332
  }, 0, isEditing() && props.imgSrc || "default-key");
2355
2333
  }, "ImgComponent_component_FXvIDBSffO8"));
2356
- const componentInfo$3 = {
2334
+ const componentInfo$4 = {
2357
2335
  name: "Core:Section",
2358
2336
  static: true,
2359
2337
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2398,6 +2376,61 @@ const componentInfo$3 = {
2398
2376
  }
2399
2377
  ]
2400
2378
  };
2379
+ const componentInfo$3 = {
2380
+ name: "Slot",
2381
+ isRSC: true,
2382
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
2383
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
2384
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
2385
+ // Maybe wrap this for canHaveChildren so bind children to this hm
2386
+ inputs: [
2387
+ {
2388
+ name: "name",
2389
+ type: "string",
2390
+ required: true,
2391
+ defaultValue: "children"
2392
+ }
2393
+ ]
2394
+ };
2395
+ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2396
+ var _a, _b;
2397
+ return /* @__PURE__ */ qwik._jsxS("div", {
2398
+ ...!((_a = props.builderContext.context) == null ? void 0 : _a.symbolId) && {
2399
+ "builder-slot": props.name
2400
+ },
2401
+ children: /* @__PURE__ */ qwik._jsxC(Blocks, {
2402
+ get parent() {
2403
+ var _a2;
2404
+ return (_a2 = props.builderContext.context) == null ? void 0 : _a2.symbolId;
2405
+ },
2406
+ get path() {
2407
+ return `symbol.data.${props.name}`;
2408
+ },
2409
+ get context() {
2410
+ return props.builderContext;
2411
+ },
2412
+ blocks: deoptSignal((_b = props.builderContext.rootState) == null ? void 0 : _b[props.name]),
2413
+ [qwik._IMMUTABLE]: {
2414
+ context: qwik._fnSignal((p0) => p0.builderContext, [
2415
+ props
2416
+ ], "p0.builderContext"),
2417
+ parent: qwik._fnSignal((p0) => {
2418
+ var _a2;
2419
+ return (_a2 = p0.builderContext.context) == null ? void 0 : _a2.symbolId;
2420
+ }, [
2421
+ props
2422
+ ], "p0.builderContext.context?.symbolId"),
2423
+ path: qwik._fnSignal((p0) => `symbol.data.${p0.name}`, [
2424
+ props
2425
+ ], "`symbol.data.${p0.name}`")
2426
+ }
2427
+ }, 3, "B1_0")
2428
+ }, {
2429
+ style: {
2430
+ pointerEvents: "auto"
2431
+ }
2432
+ }, 0, "B1_1");
2433
+ }, "Slot_component_WWgWgfV0bb0"));
2401
2434
  const componentInfo$2 = {
2402
2435
  name: "Symbol",
2403
2436
  noWrap: true,
@@ -2702,35 +2735,35 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2702
2735
  const getDefaultRegisteredComponents = () => [
2703
2736
  {
2704
2737
  component: Button,
2705
- ...componentInfo$a
2738
+ ...componentInfo$b
2706
2739
  },
2707
2740
  {
2708
2741
  component: Columns,
2709
- ...componentInfo$9
2742
+ ...componentInfo$a
2710
2743
  },
2711
2744
  {
2712
2745
  component: CustomCode,
2713
- ...componentInfo$8
2746
+ ...componentInfo$9
2714
2747
  },
2715
2748
  {
2716
2749
  component: Embed,
2717
- ...componentInfo$7
2750
+ ...componentInfo$8
2718
2751
  },
2719
2752
  {
2720
2753
  component: FragmentComponent,
2721
- ...componentInfo$6
2754
+ ...componentInfo$7
2722
2755
  },
2723
2756
  {
2724
2757
  component: Image,
2725
- ...componentInfo$5
2758
+ ...componentInfo$6
2726
2759
  },
2727
2760
  {
2728
2761
  component: ImgComponent,
2729
- ...componentInfo$4
2762
+ ...componentInfo$5
2730
2763
  },
2731
2764
  {
2732
2765
  component: SectionComponent,
2733
- ...componentInfo$3
2766
+ ...componentInfo$4
2734
2767
  },
2735
2768
  {
2736
2769
  component: Symbol$1,
@@ -2743,6 +2776,10 @@ const getDefaultRegisteredComponents = () => [
2743
2776
  {
2744
2777
  component: Video,
2745
2778
  ...componentInfo
2779
+ },
2780
+ {
2781
+ component: Slot,
2782
+ ...componentInfo$3
2746
2783
  }
2747
2784
  ];
2748
2785
  const components = [];
@@ -2983,6 +3020,17 @@ async function fetchEntries(options) {
2983
3020
  }
2984
3021
  }
2985
3022
  const getAllContent = fetchEntries;
3023
+ const DEFAULT_TRUSTED_HOSTS = [
3024
+ "*.beta.builder.io",
3025
+ "beta.builder.io",
3026
+ "builder.io",
3027
+ "localhost",
3028
+ "qa.builder.io"
3029
+ ];
3030
+ function isFromTrustedHost(trustedHosts, e) {
3031
+ const url = new URL(e.origin), hostname = url.hostname;
3032
+ return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
3033
+ }
2986
3034
  function isPreviewing() {
2987
3035
  if (!isBrowser())
2988
3036
  return false;
@@ -3182,7 +3230,7 @@ const getInteractionPropertiesForEvent = (event) => {
3182
3230
  }
3183
3231
  };
3184
3232
  };
3185
- const SDK_VERSION = "0.12.0";
3233
+ const SDK_VERSION = "0.12.2";
3186
3234
  const registry = {};
3187
3235
  function register(type, info) {
3188
3236
  let typeList = registry[type];
@@ -3265,8 +3313,11 @@ const setupBrowserForEditing = (options = {}) => {
3265
3313
  options
3266
3314
  }
3267
3315
  }, "*");
3268
- window.addEventListener("message", ({ data }) => {
3316
+ window.addEventListener("message", (event) => {
3269
3317
  var _a2, _b2;
3318
+ if (!isFromTrustedHost(options.trustedHosts, event))
3319
+ return;
3320
+ const { data } = event;
3270
3321
  if (!(data == null ? void 0 : data.type))
3271
3322
  return;
3272
3323
  switch (data.type) {
@@ -3345,6 +3396,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
3345
3396
  };
3346
3397
  const processMessage = function processMessage2(props, state, elementRef, event) {
3347
3398
  var _a;
3399
+ if (!isFromTrustedHost(props.trustedHosts, event))
3400
+ return;
3348
3401
  const { data } = event;
3349
3402
  if (data)
3350
3403
  switch (data.type) {
@@ -3479,6 +3532,9 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3479
3532
  } : {},
3480
3533
  ...props2.enrich ? {
3481
3534
  enrich: props2.enrich
3535
+ } : {},
3536
+ ...props2.trustedHosts ? {
3537
+ trustedHosts: props2.trustedHosts
3482
3538
  } : {}
3483
3539
  });
3484
3540
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
@@ -3857,6 +3913,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3857
3913
  get contentWrapperProps() {
3858
3914
  return props.contentWrapperProps;
3859
3915
  },
3916
+ get trustedHosts() {
3917
+ return props.trustedHosts;
3918
+ },
3860
3919
  children: [
3861
3920
  props.isSsrAbTest ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
3862
3921
  get scriptStr() {
@@ -3968,7 +4027,10 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3968
4027
  ], "p0.model"),
3969
4028
  showContent: qwik._fnSignal((p0) => p0.showContent, [
3970
4029
  props
3971
- ], "p0.showContent")
4030
+ ], "p0.showContent"),
4031
+ trustedHosts: qwik._fnSignal((p0) => p0.trustedHosts, [
4032
+ props
4033
+ ], "p0.trustedHosts")
3972
4034
  }
3973
4035
  }, 1, "LQ_3");
3974
4036
  }, "ContentComponent_component_HIsczUcxjCE"));
@@ -4101,6 +4163,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
4101
4163
  get contentWrapperProps() {
4102
4164
  return props.contentWrapperProps;
4103
4165
  },
4166
+ get trustedHosts() {
4167
+ return props.trustedHosts;
4168
+ },
4104
4169
  [qwik._IMMUTABLE]: {
4105
4170
  apiKey: qwik._fnSignal((p0) => p0.apiKey, [
4106
4171
  props
@@ -4147,7 +4212,10 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
4147
4212
  model: qwik._fnSignal((p0) => p0.model, [
4148
4213
  props
4149
4214
  ], "p0.model"),
4150
- showContent: qwik._IMMUTABLE
4215
+ showContent: qwik._IMMUTABLE,
4216
+ trustedHosts: qwik._fnSignal((p0) => p0.trustedHosts, [
4217
+ props
4218
+ ], "p0.trustedHosts")
4151
4219
  }
4152
4220
  }, 3, variant.testVariationId);
4153
4221
  })
@@ -4203,6 +4271,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
4203
4271
  get contentWrapperProps() {
4204
4272
  return props.contentWrapperProps;
4205
4273
  },
4274
+ get trustedHosts() {
4275
+ return props.trustedHosts;
4276
+ },
4206
4277
  [qwik._IMMUTABLE]: {
4207
4278
  apiKey: qwik._fnSignal((p0) => p0.apiKey, [
4208
4279
  props
@@ -4252,7 +4323,10 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
4252
4323
  model: qwik._fnSignal((p0) => p0.model, [
4253
4324
  props
4254
4325
  ], "p0.model"),
4255
- showContent: qwik._IMMUTABLE
4326
+ showContent: qwik._IMMUTABLE,
4327
+ trustedHosts: qwik._fnSignal((p0) => p0.trustedHosts, [
4328
+ props
4329
+ ], "p0.trustedHosts")
4256
4330
  }
4257
4331
  }, 3, "XM_4")
4258
4332
  ]
@@ -4322,7 +4396,11 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
4322
4396
  return props.builderContext.apiKey;
4323
4397
  },
4324
4398
  get context() {
4325
- return props.builderContext.context;
4399
+ var _a2;
4400
+ return {
4401
+ ...props.builderContext.context,
4402
+ symbolId: (_a2 = props.builderBlock) == null ? void 0 : _a2.id
4403
+ };
4326
4404
  },
4327
4405
  get customComponents() {
4328
4406
  return Object.values(props.builderComponents);
@@ -4352,9 +4430,15 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
4352
4430
  content: qwik._fnSignal((p0) => p0.contentToUse, [
4353
4431
  state
4354
4432
  ], "p0.contentToUse"),
4355
- context: qwik._fnSignal((p0) => p0.builderContext.context, [
4433
+ context: qwik._fnSignal((p0) => {
4434
+ var _a2;
4435
+ return {
4436
+ ...p0.builderContext.context,
4437
+ symbolId: (_a2 = p0.builderBlock) == null ? void 0 : _a2.id
4438
+ };
4439
+ }, [
4356
4440
  props
4357
- ], "p0.builderContext.context"),
4441
+ ], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
4358
4442
  customComponents: qwik._fnSignal((p0) => Object.values(p0.builderComponents), [
4359
4443
  props
4360
4444
  ], "Object.values(p0.builderComponents)"),