@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) => {
@@ -3467,26 +3467,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
3467
3467
  else
3468
3468
  return transformedBlock;
3469
3469
  }
3470
- const EMPTY_HTML_ELEMENTS = [
3471
- "area",
3472
- "base",
3473
- "br",
3474
- "col",
3475
- "embed",
3476
- "hr",
3477
- "img",
3478
- "input",
3479
- "keygen",
3480
- "link",
3481
- "meta",
3482
- "param",
3483
- "source",
3484
- "track",
3485
- "wbr"
3486
- ];
3487
- const isEmptyHtmlElement = (tagName) => {
3488
- return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
3489
- };
3490
3470
  const getComponent = ({ block, context, registeredComponents }) => {
3491
3471
  var _a;
3492
3472
  const componentName = (_a = getProcessedBlock({
@@ -3771,38 +3751,67 @@ function getStyleAttribute(style) {
3771
3751
  return style;
3772
3752
  }
3773
3753
  }
3774
- const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
3754
+ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
3755
+ "area",
3756
+ "base",
3757
+ "br",
3758
+ "col",
3759
+ "embed",
3760
+ "hr",
3761
+ "img",
3762
+ "input",
3763
+ "keygen",
3764
+ "link",
3765
+ "meta",
3766
+ "param",
3767
+ "source",
3768
+ "track",
3769
+ "wbr"
3770
+ ]);
3771
+ const isEmptyElement = (tagName) => {
3772
+ return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
3773
+ };
3774
+ const DynamicRenderer = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
3775
3775
  _jsxBranch();
3776
3776
  return /* @__PURE__ */ _jsxC(Fragment, {
3777
- children: props.hasChildren ? /* @__PURE__ */ _jsxC(props.Wrapper, {
3778
- ...getBlockProperties({
3779
- block: props.block,
3780
- context: props.context
3781
- }),
3782
- ...getBlockActions({
3783
- block: props.block,
3784
- rootState: props.context.rootState,
3785
- rootSetState: props.context.rootSetState,
3786
- localState: props.context.localState,
3787
- context: props.context.context,
3788
- stripPrefix: true
3789
- }),
3790
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "87_0")
3791
- }, 0, "87_1") : /* @__PURE__ */ _jsxC(props.Wrapper, {
3792
- ...getBlockProperties({
3793
- block: props.block,
3794
- context: props.context
3795
- }),
3796
- ...getBlockActions({
3797
- block: props.block,
3798
- rootState: props.context.rootState,
3799
- rootSetState: props.context.rootSetState,
3800
- localState: props.context.localState,
3801
- context: props.context.context,
3802
- stripPrefix: true
3803
- })
3804
- }, 0, "87_2")
3805
- }, 1, "87_3");
3777
+ children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ _jsxC(props.TagName, {
3778
+ ...props.attributes,
3779
+ ...props.actionAttributes,
3780
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_0")
3781
+ }, 0, "yW_1") : /* @__PURE__ */ _jsxC(props.TagName, {
3782
+ ...props.attributes,
3783
+ ...props.actionAttributes,
3784
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_2")
3785
+ }, 0, "yW_3") : /* @__PURE__ */ _jsxC(props.TagName, {
3786
+ ...props.attributes,
3787
+ ...props.actionAttributes
3788
+ }, 0, "yW_4")
3789
+ }, 1, "yW_5");
3790
+ }, "DynamicRenderer_component_1Co0xkmyAfQ"));
3791
+ const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
3792
+ return /* @__PURE__ */ _jsxC(DynamicRenderer, {
3793
+ get TagName() {
3794
+ return props.Wrapper;
3795
+ },
3796
+ actionAttributes: getBlockActions({
3797
+ block: props.block,
3798
+ rootState: props.context.rootState,
3799
+ rootSetState: props.context.rootSetState,
3800
+ localState: props.context.localState,
3801
+ context: props.context.context,
3802
+ stripPrefix: true
3803
+ }),
3804
+ attributes: getBlockProperties({
3805
+ block: props.block,
3806
+ context: props.context
3807
+ }),
3808
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "87_0"),
3809
+ [_IMMUTABLE]: {
3810
+ TagName: _fnSignal((p0) => p0.Wrapper, [
3811
+ props
3812
+ ], "p0.Wrapper")
3813
+ }
3814
+ }, 1, "87_1");
3806
3815
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
3807
3816
  const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
3808
3817
  return /* @__PURE__ */ _jsxC(props.Wrapper, {
@@ -3820,7 +3829,7 @@ const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQ
3820
3829
  context: props.context.context
3821
3830
  })
3822
3831
  } : {},
3823
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "q0_0")
3832
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "q0_0")
3824
3833
  }, 0, "q0_1");
3825
3834
  }, "InteractiveElement_component_0UqfJpjhn0g"));
3826
3835
  const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
@@ -4026,151 +4035,120 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4026
4035
  ], "p0.context")
4027
4036
  }
4028
4037
  }, 3, "jN_0"),
4029
- !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ _jsxC(Fragment, {
4038
+ !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
4039
+ get Wrapper() {
4040
+ return Tag.value;
4041
+ },
4042
+ get block() {
4043
+ return processedBlock.value;
4044
+ },
4045
+ get context() {
4046
+ return props.context;
4047
+ },
4030
4048
  children: [
4031
- isEmptyHtmlElement(Tag.value) ? /* @__PURE__ */ _jsxC(BlockWrapper, {
4032
- get Wrapper() {
4033
- return Tag.value;
4049
+ /* @__PURE__ */ _jsxC(ComponentRef, {
4050
+ get componentRef() {
4051
+ return componentRefProps.value.componentRef;
4052
+ },
4053
+ get componentOptions() {
4054
+ return componentRefProps.value.componentOptions;
4034
4055
  },
4035
- get block() {
4036
- return processedBlock.value;
4056
+ get blockChildren() {
4057
+ return componentRefProps.value.blockChildren;
4037
4058
  },
4038
4059
  get context() {
4039
- return props.context;
4060
+ return componentRefProps.value.context;
4061
+ },
4062
+ get registeredComponents() {
4063
+ return componentRefProps.value.registeredComponents;
4064
+ },
4065
+ get builderBlock() {
4066
+ return componentRefProps.value.builderBlock;
4067
+ },
4068
+ get includeBlockProps() {
4069
+ return componentRefProps.value.includeBlockProps;
4070
+ },
4071
+ get isInteractive() {
4072
+ return componentRefProps.value.isInteractive;
4040
4073
  },
4041
- hasChildren: false,
4042
4074
  [_IMMUTABLE]: {
4043
- Wrapper: _fnSignal((p0) => p0.value, [
4044
- Tag
4045
- ], "p0.value"),
4046
- block: _fnSignal((p0) => p0.value, [
4047
- processedBlock
4048
- ], "p0.value"),
4049
- context: _fnSignal((p0) => p0.context, [
4050
- props
4051
- ], "p0.context"),
4052
- hasChildren: _IMMUTABLE
4075
+ blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
4076
+ componentRefProps
4077
+ ], "p0.value.blockChildren"),
4078
+ builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
4079
+ componentRefProps
4080
+ ], "p0.value.builderBlock"),
4081
+ componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
4082
+ componentRefProps
4083
+ ], "p0.value.componentOptions"),
4084
+ componentRef: _fnSignal((p0) => p0.value.componentRef, [
4085
+ componentRefProps
4086
+ ], "p0.value.componentRef"),
4087
+ context: _fnSignal((p0) => p0.value.context, [
4088
+ componentRefProps
4089
+ ], "p0.value.context"),
4090
+ includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
4091
+ componentRefProps
4092
+ ], "p0.value.includeBlockProps"),
4093
+ isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
4094
+ componentRefProps
4095
+ ], "p0.value.isInteractive"),
4096
+ registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
4097
+ componentRefProps
4098
+ ], "p0.value.registeredComponents")
4053
4099
  }
4054
- }, 3, "jN_1") : null,
4055
- !isEmptyHtmlElement(Tag.value) && repeatItem.value ? (repeatItem.value || []).map((data, index) => {
4056
- return /* @__PURE__ */ _jsxC(RepeatedBlock, {
4057
- get repeatContext() {
4058
- return data.context;
4059
- },
4060
- get block() {
4061
- return data.block;
4100
+ }, 3, "jN_1"),
4101
+ (childrenWithoutParentComponent.value || []).map((child) => {
4102
+ return /* @__PURE__ */ _jsxC(Block, {
4103
+ block: child,
4104
+ get context() {
4105
+ return state.childrenContext;
4062
4106
  },
4063
4107
  get registeredComponents() {
4064
4108
  return props.registeredComponents;
4065
4109
  },
4066
4110
  [_IMMUTABLE]: {
4067
- block: _wrapProp(data, "block"),
4111
+ context: _fnSignal((p0) => p0.childrenContext, [
4112
+ state
4113
+ ], "p0.childrenContext"),
4068
4114
  registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
4069
4115
  props
4070
- ], "p0.registeredComponents"),
4071
- repeatContext: _wrapProp(data, "context")
4116
+ ], "p0.registeredComponents")
4072
4117
  }
4073
- }, 3, index);
4074
- }) : null,
4075
- !isEmptyHtmlElement(Tag.value) && !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
4076
- get Wrapper() {
4077
- return Tag.value;
4078
- },
4079
- get block() {
4080
- return processedBlock.value;
4081
- },
4082
- get context() {
4083
- return props.context;
4084
- },
4085
- children: [
4086
- /* @__PURE__ */ _jsxC(ComponentRef, {
4087
- get componentRef() {
4088
- return componentRefProps.value.componentRef;
4089
- },
4090
- get componentOptions() {
4091
- return componentRefProps.value.componentOptions;
4092
- },
4093
- get blockChildren() {
4094
- return componentRefProps.value.blockChildren;
4095
- },
4096
- get context() {
4097
- return componentRefProps.value.context;
4098
- },
4099
- get registeredComponents() {
4100
- return componentRefProps.value.registeredComponents;
4101
- },
4102
- get builderBlock() {
4103
- return componentRefProps.value.builderBlock;
4104
- },
4105
- get includeBlockProps() {
4106
- return componentRefProps.value.includeBlockProps;
4107
- },
4108
- get isInteractive() {
4109
- return componentRefProps.value.isInteractive;
4110
- },
4111
- [_IMMUTABLE]: {
4112
- blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
4113
- componentRefProps
4114
- ], "p0.value.blockChildren"),
4115
- builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
4116
- componentRefProps
4117
- ], "p0.value.builderBlock"),
4118
- componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
4119
- componentRefProps
4120
- ], "p0.value.componentOptions"),
4121
- componentRef: _fnSignal((p0) => p0.value.componentRef, [
4122
- componentRefProps
4123
- ], "p0.value.componentRef"),
4124
- context: _fnSignal((p0) => p0.value.context, [
4125
- componentRefProps
4126
- ], "p0.value.context"),
4127
- includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
4128
- componentRefProps
4129
- ], "p0.value.includeBlockProps"),
4130
- isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
4131
- componentRefProps
4132
- ], "p0.value.isInteractive"),
4133
- registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
4134
- componentRefProps
4135
- ], "p0.value.registeredComponents")
4136
- }
4137
- }, 3, "jN_2"),
4138
- (childrenWithoutParentComponent.value || []).map((child) => {
4139
- return /* @__PURE__ */ _jsxC(Block, {
4140
- block: child,
4141
- get context() {
4142
- return state.childrenContext;
4143
- },
4144
- get registeredComponents() {
4145
- return props.registeredComponents;
4146
- },
4147
- [_IMMUTABLE]: {
4148
- context: _fnSignal((p0) => p0.childrenContext, [
4149
- state
4150
- ], "p0.childrenContext"),
4151
- registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
4152
- props
4153
- ], "p0.registeredComponents")
4154
- }
4155
- }, 3, child.id);
4156
- })
4157
- ],
4158
- hasChildren: true,
4159
- [_IMMUTABLE]: {
4160
- Wrapper: _fnSignal((p0) => p0.value, [
4161
- Tag
4162
- ], "p0.value"),
4163
- block: _fnSignal((p0) => p0.value, [
4164
- processedBlock
4165
- ], "p0.value"),
4166
- context: _fnSignal((p0) => p0.context, [
4167
- props
4168
- ], "p0.context"),
4169
- hasChildren: _IMMUTABLE
4170
- }
4171
- }, 1, "jN_3") : null
4172
- ]
4173
- }, 1, "jN_4") : /* @__PURE__ */ _jsxC(ComponentRef, {
4118
+ }, 3, child.id);
4119
+ })
4120
+ ],
4121
+ [_IMMUTABLE]: {
4122
+ Wrapper: _fnSignal((p0) => p0.value, [
4123
+ Tag
4124
+ ], "p0.value"),
4125
+ block: _fnSignal((p0) => p0.value, [
4126
+ processedBlock
4127
+ ], "p0.value"),
4128
+ context: _fnSignal((p0) => p0.context, [
4129
+ props
4130
+ ], "p0.context")
4131
+ }
4132
+ }, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
4133
+ return /* @__PURE__ */ _jsxC(RepeatedBlock, {
4134
+ get repeatContext() {
4135
+ return data.context;
4136
+ },
4137
+ get block() {
4138
+ return data.block;
4139
+ },
4140
+ get registeredComponents() {
4141
+ return props.registeredComponents;
4142
+ },
4143
+ [_IMMUTABLE]: {
4144
+ block: _wrapProp(data, "block"),
4145
+ registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
4146
+ props
4147
+ ], "p0.registeredComponents"),
4148
+ repeatContext: _wrapProp(data, "context")
4149
+ }
4150
+ }, 3, index);
4151
+ }) : /* @__PURE__ */ _jsxC(ComponentRef, {
4174
4152
  get componentRef() {
4175
4153
  return componentRefProps.value.componentRef;
4176
4154
  },
@@ -4221,10 +4199,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4221
4199
  componentRefProps
4222
4200
  ], "p0.value.registeredComponents")
4223
4201
  }
4224
- }, 3, "jN_5")
4202
+ }, 3, "jN_3")
4225
4203
  ]
4226
- }, 1, "jN_6") : null
4227
- }, 1, "jN_7");
4204
+ }, 1, "jN_4") : null
4205
+ }, 1, "jN_5");
4228
4206
  }, "Block_component_nnPv0RY0U0k"));
4229
4207
  const onClick$1 = function onClick2(props, state) {
4230
4208
  var _a, _b;
@@ -4293,7 +4271,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
4293
4271
  state
4294
4272
  ]),
4295
4273
  ...props.BlocksWrapperProps,
4296
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "3u_0"),
4274
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "3u_0"),
4297
4275
  [_IMMUTABLE]: {
4298
4276
  "builder-parent-id": _fnSignal((p0) => p0.parent, [
4299
4277
  props
@@ -4561,7 +4539,7 @@ const STYLES$1 = `
4561
4539
  }
4562
4540
  `;
4563
4541
  const FragmentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4564
- return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot, null, 3, "oj_0"), 1, "oj_1");
4542
+ return /* @__PURE__ */ _jsxQ("span", null, null, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "oj_0"), 1, "oj_1");
4565
4543
  }, "FragmentComponent_component_T0AypnadAK0"));
4566
4544
  function removeProtocol(path) {
4567
4545
  return path.replace(/http(s)?:/, "");
@@ -4713,10 +4691,10 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4713
4691
  props
4714
4692
  ], '{paddingTop:p0.aspectRatio*100+"%"}')
4715
4693
  }, null, 3, "0A_1") : null,
4716
- ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_2") : null,
4694
+ ((_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,
4717
4695
  !props.fitContent && props.children ? /* @__PURE__ */ _jsxQ("div", null, {
4718
4696
  class: "div-Image-2"
4719
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "0A_3"), 1, "0A_4") : null
4697
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "0A_3"), 1, "0A_4") : null
4720
4698
  ]
4721
4699
  }, 1, "0A_5");
4722
4700
  }, "Image_component_LRxDkFa1EfU"));
@@ -4744,7 +4722,7 @@ const STYLES = `
4744
4722
  const SectionComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4745
4723
  return /* @__PURE__ */ _jsxS("section", {
4746
4724
  ...props.attributes,
4747
- children: /* @__PURE__ */ _jsxC(Slot, null, 3, "2Y_0"),
4725
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "2Y_0"),
4748
4726
  style: {
4749
4727
  width: "100%",
4750
4728
  alignSelf: "stretch",
@@ -4933,7 +4911,7 @@ const handleABTesting = async ({ item, canTrack }) => {
4933
4911
  };
4934
4912
  };
4935
4913
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
4936
- const componentInfo$a = {
4914
+ const componentInfo$b = {
4937
4915
  name: "Core:Button",
4938
4916
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
4939
4917
  defaultStyles: {
@@ -4971,7 +4949,7 @@ const componentInfo$a = {
4971
4949
  static: true,
4972
4950
  noWrap: true
4973
4951
  };
4974
- const componentInfo$9 = {
4952
+ const componentInfo$a = {
4975
4953
  // TODO: ways to statically preprocess JSON for references, functions, etc
4976
4954
  name: "Columns",
4977
4955
  isRSC: true,
@@ -5213,7 +5191,7 @@ const componentInfo$9 = {
5213
5191
  }
5214
5192
  ]
5215
5193
  };
5216
- const componentInfo$8 = {
5194
+ const componentInfo$9 = {
5217
5195
  name: "Custom Code",
5218
5196
  static: true,
5219
5197
  requiredPermissions: [
@@ -5292,7 +5270,7 @@ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((prop
5292
5270
  ], "p0.code")
5293
5271
  }, null, 3, "bY_0");
5294
5272
  }, "CustomCode_component_uYOSy7w7Zqw"));
5295
- const componentInfo$7 = {
5273
+ const componentInfo$8 = {
5296
5274
  name: "Embed",
5297
5275
  static: true,
5298
5276
  inputs: [
@@ -5385,14 +5363,14 @@ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5385
5363
  ], "p0.content")
5386
5364
  }, null, 3, "9r_0");
5387
5365
  }, "Embed_component_Uji08ORjXbE"));
5388
- const componentInfo$6 = {
5366
+ const componentInfo$7 = {
5389
5367
  name: "Fragment",
5390
5368
  static: true,
5391
5369
  hidden: true,
5392
5370
  canHaveChildren: true,
5393
5371
  noWrap: true
5394
5372
  };
5395
- const componentInfo$5 = {
5373
+ const componentInfo$6 = {
5396
5374
  name: "Image",
5397
5375
  static: true,
5398
5376
  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",
@@ -5540,7 +5518,7 @@ const componentInfo$5 = {
5540
5518
  }
5541
5519
  ]
5542
5520
  };
5543
- const componentInfo$4 = {
5521
+ const componentInfo$5 = {
5544
5522
  // friendlyName?
5545
5523
  name: "Raw:Img",
5546
5524
  hideFromInsertMenu: true,
@@ -5582,7 +5560,7 @@ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
5582
5560
  ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
5583
5561
  }, 0, isEditing() && props.imgSrc || "default-key");
5584
5562
  }, "ImgComponent_component_FXvIDBSffO8"));
5585
- const componentInfo$3 = {
5563
+ const componentInfo$4 = {
5586
5564
  name: "Core:Section",
5587
5565
  static: true,
5588
5566
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -5627,6 +5605,61 @@ const componentInfo$3 = {
5627
5605
  }
5628
5606
  ]
5629
5607
  };
5608
+ const componentInfo$3 = {
5609
+ name: "Slot",
5610
+ isRSC: true,
5611
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
5612
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
5613
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
5614
+ // Maybe wrap this for canHaveChildren so bind children to this hm
5615
+ inputs: [
5616
+ {
5617
+ name: "name",
5618
+ type: "string",
5619
+ required: true,
5620
+ defaultValue: "children"
5621
+ }
5622
+ ]
5623
+ };
5624
+ const Slot = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5625
+ var _a, _b;
5626
+ return /* @__PURE__ */ _jsxS("div", {
5627
+ ...!((_a = props.builderContext.context) == null ? void 0 : _a.symbolId) && {
5628
+ "builder-slot": props.name
5629
+ },
5630
+ children: /* @__PURE__ */ _jsxC(Blocks, {
5631
+ get parent() {
5632
+ var _a2;
5633
+ return (_a2 = props.builderContext.context) == null ? void 0 : _a2.symbolId;
5634
+ },
5635
+ get path() {
5636
+ return `symbol.data.${props.name}`;
5637
+ },
5638
+ get context() {
5639
+ return props.builderContext;
5640
+ },
5641
+ blocks: deoptSignal((_b = props.builderContext.rootState) == null ? void 0 : _b[props.name]),
5642
+ [_IMMUTABLE]: {
5643
+ context: _fnSignal((p0) => p0.builderContext, [
5644
+ props
5645
+ ], "p0.builderContext"),
5646
+ parent: _fnSignal((p0) => {
5647
+ var _a2;
5648
+ return (_a2 = p0.builderContext.context) == null ? void 0 : _a2.symbolId;
5649
+ }, [
5650
+ props
5651
+ ], "p0.builderContext.context?.symbolId"),
5652
+ path: _fnSignal((p0) => `symbol.data.${p0.name}`, [
5653
+ props
5654
+ ], "`symbol.data.${p0.name}`")
5655
+ }
5656
+ }, 3, "B1_0")
5657
+ }, {
5658
+ style: {
5659
+ pointerEvents: "auto"
5660
+ }
5661
+ }, 0, "B1_1");
5662
+ }, "Slot_component_WWgWgfV0bb0"));
5630
5663
  const componentInfo$2 = {
5631
5664
  name: "Symbol",
5632
5665
  noWrap: true,
@@ -5912,7 +5945,7 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5912
5945
  flexDirection: "column",
5913
5946
  alignItems: "stretch"
5914
5947
  }
5915
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_2"), 1, "j7_3") : null,
5948
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_2"), 1, "j7_3") : null,
5916
5949
  ((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
5917
5950
  style: {
5918
5951
  pointerEvents: "none",
@@ -5925,41 +5958,41 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5925
5958
  width: "100%",
5926
5959
  height: "100%"
5927
5960
  }
5928
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_4"), 1, "j7_5") : null
5961
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_4"), 1, "j7_5") : null
5929
5962
  ], 1, "j7_6");
5930
5963
  }, "Video_component_qdcTZflYyoQ"));
5931
5964
  const getDefaultRegisteredComponents = () => [
5932
5965
  {
5933
5966
  component: Button,
5934
- ...componentInfo$a
5967
+ ...componentInfo$b
5935
5968
  },
5936
5969
  {
5937
5970
  component: Columns,
5938
- ...componentInfo$9
5971
+ ...componentInfo$a
5939
5972
  },
5940
5973
  {
5941
5974
  component: CustomCode,
5942
- ...componentInfo$8
5975
+ ...componentInfo$9
5943
5976
  },
5944
5977
  {
5945
5978
  component: Embed,
5946
- ...componentInfo$7
5979
+ ...componentInfo$8
5947
5980
  },
5948
5981
  {
5949
5982
  component: FragmentComponent,
5950
- ...componentInfo$6
5983
+ ...componentInfo$7
5951
5984
  },
5952
5985
  {
5953
5986
  component: Image,
5954
- ...componentInfo$5
5987
+ ...componentInfo$6
5955
5988
  },
5956
5989
  {
5957
5990
  component: ImgComponent,
5958
- ...componentInfo$4
5991
+ ...componentInfo$5
5959
5992
  },
5960
5993
  {
5961
5994
  component: SectionComponent,
5962
- ...componentInfo$3
5995
+ ...componentInfo$4
5963
5996
  },
5964
5997
  {
5965
5998
  component: Symbol$1,
@@ -5972,6 +6005,10 @@ const getDefaultRegisteredComponents = () => [
5972
6005
  {
5973
6006
  component: Video,
5974
6007
  ...componentInfo
6008
+ },
6009
+ {
6010
+ component: Slot,
6011
+ ...componentInfo$3
5975
6012
  }
5976
6013
  ];
5977
6014
  const components = [];
@@ -6212,6 +6249,17 @@ async function fetchEntries(options) {
6212
6249
  }
6213
6250
  }
6214
6251
  const getAllContent = fetchEntries;
6252
+ const DEFAULT_TRUSTED_HOSTS = [
6253
+ "*.beta.builder.io",
6254
+ "beta.builder.io",
6255
+ "builder.io",
6256
+ "localhost",
6257
+ "qa.builder.io"
6258
+ ];
6259
+ function isFromTrustedHost(trustedHosts, e) {
6260
+ const url = new URL(e.origin), hostname = url.hostname;
6261
+ return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
6262
+ }
6215
6263
  function isPreviewing() {
6216
6264
  if (!isBrowser())
6217
6265
  return false;
@@ -6411,7 +6459,7 @@ const getInteractionPropertiesForEvent = (event) => {
6411
6459
  }
6412
6460
  };
6413
6461
  };
6414
- const SDK_VERSION = "0.12.0";
6462
+ const SDK_VERSION = "0.12.2";
6415
6463
  const registry = {};
6416
6464
  function register(type, info) {
6417
6465
  let typeList = registry[type];
@@ -6494,8 +6542,11 @@ const setupBrowserForEditing = (options = {}) => {
6494
6542
  options
6495
6543
  }
6496
6544
  }, "*");
6497
- window.addEventListener("message", ({ data }) => {
6545
+ window.addEventListener("message", (event) => {
6498
6546
  var _a2, _b2;
6547
+ if (!isFromTrustedHost(options.trustedHosts, event))
6548
+ return;
6549
+ const { data } = event;
6499
6550
  if (!(data == null ? void 0 : data.type))
6500
6551
  return;
6501
6552
  switch (data.type) {
@@ -6574,6 +6625,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
6574
6625
  };
6575
6626
  const processMessage = function processMessage2(props, state, elementRef, event) {
6576
6627
  var _a;
6628
+ if (!isFromTrustedHost(props.trustedHosts, event))
6629
+ return;
6577
6630
  const { data } = event;
6578
6631
  if (data)
6579
6632
  switch (data.type) {
@@ -6708,6 +6761,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6708
6761
  } : {},
6709
6762
  ...props2.enrich ? {
6710
6763
  enrich: props2.enrich
6764
+ } : {},
6765
+ ...props2.trustedHosts ? {
6766
+ trustedHosts: props2.trustedHosts
6711
6767
  } : {}
6712
6768
  });
6713
6769
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
@@ -6872,7 +6928,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6872
6928
  },
6873
6929
  ...props.contentWrapperProps,
6874
6930
  class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
6875
- }, /* @__PURE__ */ _jsxC(Slot, null, 3, "06_0")) : null
6931
+ }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "06_0")) : null
6876
6932
  }, 1, "06_1");
6877
6933
  }, "EnableEditor_component_ko1mO8oaj8k"));
6878
6934
  const getCssFromFont = (font) => {
@@ -7086,6 +7142,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7086
7142
  get contentWrapperProps() {
7087
7143
  return props.contentWrapperProps;
7088
7144
  },
7145
+ get trustedHosts() {
7146
+ return props.trustedHosts;
7147
+ },
7089
7148
  children: [
7090
7149
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
7091
7150
  get scriptStr() {
@@ -7197,7 +7256,10 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7197
7256
  ], "p0.model"),
7198
7257
  showContent: _fnSignal((p0) => p0.showContent, [
7199
7258
  props
7200
- ], "p0.showContent")
7259
+ ], "p0.showContent"),
7260
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
7261
+ props
7262
+ ], "p0.trustedHosts")
7201
7263
  }
7202
7264
  }, 1, "LQ_3");
7203
7265
  }, "ContentComponent_component_HIsczUcxjCE"));
@@ -7330,6 +7392,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7330
7392
  get contentWrapperProps() {
7331
7393
  return props.contentWrapperProps;
7332
7394
  },
7395
+ get trustedHosts() {
7396
+ return props.trustedHosts;
7397
+ },
7333
7398
  [_IMMUTABLE]: {
7334
7399
  apiKey: _fnSignal((p0) => p0.apiKey, [
7335
7400
  props
@@ -7376,7 +7441,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7376
7441
  model: _fnSignal((p0) => p0.model, [
7377
7442
  props
7378
7443
  ], "p0.model"),
7379
- showContent: _IMMUTABLE
7444
+ showContent: _IMMUTABLE,
7445
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
7446
+ props
7447
+ ], "p0.trustedHosts")
7380
7448
  }
7381
7449
  }, 3, variant.testVariationId);
7382
7450
  })
@@ -7432,6 +7500,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7432
7500
  get contentWrapperProps() {
7433
7501
  return props.contentWrapperProps;
7434
7502
  },
7503
+ get trustedHosts() {
7504
+ return props.trustedHosts;
7505
+ },
7435
7506
  [_IMMUTABLE]: {
7436
7507
  apiKey: _fnSignal((p0) => p0.apiKey, [
7437
7508
  props
@@ -7481,7 +7552,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7481
7552
  model: _fnSignal((p0) => p0.model, [
7482
7553
  props
7483
7554
  ], "p0.model"),
7484
- showContent: _IMMUTABLE
7555
+ showContent: _IMMUTABLE,
7556
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
7557
+ props
7558
+ ], "p0.trustedHosts")
7485
7559
  }
7486
7560
  }, 3, "XM_4")
7487
7561
  ]
@@ -7551,7 +7625,11 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
7551
7625
  return props.builderContext.apiKey;
7552
7626
  },
7553
7627
  get context() {
7554
- return props.builderContext.context;
7628
+ var _a2;
7629
+ return {
7630
+ ...props.builderContext.context,
7631
+ symbolId: (_a2 = props.builderBlock) == null ? void 0 : _a2.id
7632
+ };
7555
7633
  },
7556
7634
  get customComponents() {
7557
7635
  return Object.values(props.builderComponents);
@@ -7581,9 +7659,15 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
7581
7659
  content: _fnSignal((p0) => p0.contentToUse, [
7582
7660
  state
7583
7661
  ], "p0.contentToUse"),
7584
- context: _fnSignal((p0) => p0.builderContext.context, [
7662
+ context: _fnSignal((p0) => {
7663
+ var _a2;
7664
+ return {
7665
+ ...p0.builderContext.context,
7666
+ symbolId: (_a2 = p0.builderBlock) == null ? void 0 : _a2.id
7667
+ };
7668
+ }, [
7585
7669
  props
7586
- ], "p0.builderContext.context"),
7670
+ ], "{...p0.builderContext.context,symbolId:p0.builderBlock?.id}"),
7587
7671
  customComponents: _fnSignal((p0) => Object.values(p0.builderComponents), [
7588
7672
  props
7589
7673
  ], "Object.values(p0.builderComponents)"),