@builder.io/sdk-qwik 0.12.1 → 0.12.3

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,10 +1,9 @@
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";
1
+ import { componentQrl, inlinedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot as Slot$1, useStore, useContextProvider, _wrapProp, useStylesScopedQrl, 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";
5
5
  import "node:module";
6
6
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
7
- useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
8
7
  return /* @__PURE__ */ _jsxC(Fragment, {
9
8
  children: props.link ? /* @__PURE__ */ _jsxS("a", {
10
9
  ...props.attributes,
@@ -25,20 +24,16 @@ const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
25
24
  props
26
25
  ], "p0.text")
27
26
  }, {
28
- class: _fnSignal((p0) => p0.attributes.class + " button-Button", [
27
+ class: _fnSignal((p0) => `builder-button ${p0.attributes.class}`, [
29
28
  props
30
- ], 'p0.attributes.class+" button-Button"'),
29
+ ], "`builder-button ${p0.attributes.class}`"),
30
+ role: "button",
31
31
  style: _fnSignal((p0) => p0.attributes.style, [
32
32
  props
33
33
  ], "p0.attributes.style")
34
34
  }, 0, null)
35
35
  }, 1, "jc_1");
36
36
  }, "Button_component_gJoMUICXoUQ"));
37
- const STYLES$3 = `
38
- .button-Button {
39
- all: unset;
40
- }
41
- `;
42
37
  const builderContext = createContextId("Builder");
43
38
  const ComponentsContext = createContextId("Components");
44
39
  function getBlockComponentOptions(block) {
@@ -337,26 +332,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
337
332
  else
338
333
  return transformedBlock;
339
334
  }
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
335
  const getComponent = ({ block, context, registeredComponents }) => {
361
336
  var _a;
362
337
  const componentName = (_a = getProcessedBlock({
@@ -641,38 +616,67 @@ function getStyleAttribute(style) {
641
616
  return style;
642
617
  }
643
618
  }
644
- const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
619
+ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
620
+ "area",
621
+ "base",
622
+ "br",
623
+ "col",
624
+ "embed",
625
+ "hr",
626
+ "img",
627
+ "input",
628
+ "keygen",
629
+ "link",
630
+ "meta",
631
+ "param",
632
+ "source",
633
+ "track",
634
+ "wbr"
635
+ ]);
636
+ const isEmptyElement = (tagName) => {
637
+ return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
638
+ };
639
+ const DynamicRenderer = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
645
640
  _jsxBranch();
646
641
  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$1, 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");
642
+ children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ _jsxC(props.TagName, {
643
+ ...props.attributes,
644
+ ...props.actionAttributes,
645
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_0")
646
+ }, 0, "yW_1") : /* @__PURE__ */ _jsxC(props.TagName, {
647
+ ...props.attributes,
648
+ ...props.actionAttributes,
649
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_2")
650
+ }, 0, "yW_3") : /* @__PURE__ */ _jsxC(props.TagName, {
651
+ ...props.attributes,
652
+ ...props.actionAttributes
653
+ }, 0, "yW_4")
654
+ }, 1, "yW_5");
655
+ }, "DynamicRenderer_component_1Co0xkmyAfQ"));
656
+ const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
657
+ return /* @__PURE__ */ _jsxC(DynamicRenderer, {
658
+ get TagName() {
659
+ return props.Wrapper;
660
+ },
661
+ actionAttributes: getBlockActions({
662
+ block: props.block,
663
+ rootState: props.context.rootState,
664
+ rootSetState: props.context.rootSetState,
665
+ localState: props.context.localState,
666
+ context: props.context.context,
667
+ stripPrefix: true
668
+ }),
669
+ attributes: getBlockProperties({
670
+ block: props.block,
671
+ context: props.context
672
+ }),
673
+ children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "87_0"),
674
+ [_IMMUTABLE]: {
675
+ TagName: _fnSignal((p0) => p0.Wrapper, [
676
+ props
677
+ ], "p0.Wrapper")
678
+ }
679
+ }, 1, "87_1");
676
680
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
677
681
  const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
678
682
  return /* @__PURE__ */ _jsxC(props.Wrapper, {
@@ -896,151 +900,120 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
896
900
  ], "p0.context")
897
901
  }
898
902
  }, 3, "jN_0"),
899
- !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ _jsxC(Fragment, {
903
+ !((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
904
+ get Wrapper() {
905
+ return Tag.value;
906
+ },
907
+ get block() {
908
+ return processedBlock.value;
909
+ },
910
+ get context() {
911
+ return props.context;
912
+ },
900
913
  children: [
901
- isEmptyHtmlElement(Tag.value) ? /* @__PURE__ */ _jsxC(BlockWrapper, {
902
- get Wrapper() {
903
- return Tag.value;
914
+ /* @__PURE__ */ _jsxC(ComponentRef, {
915
+ get componentRef() {
916
+ return componentRefProps.value.componentRef;
917
+ },
918
+ get componentOptions() {
919
+ return componentRefProps.value.componentOptions;
904
920
  },
905
- get block() {
906
- return processedBlock.value;
921
+ get blockChildren() {
922
+ return componentRefProps.value.blockChildren;
907
923
  },
908
924
  get context() {
909
- return props.context;
925
+ return componentRefProps.value.context;
926
+ },
927
+ get registeredComponents() {
928
+ return componentRefProps.value.registeredComponents;
929
+ },
930
+ get builderBlock() {
931
+ return componentRefProps.value.builderBlock;
932
+ },
933
+ get includeBlockProps() {
934
+ return componentRefProps.value.includeBlockProps;
935
+ },
936
+ get isInteractive() {
937
+ return componentRefProps.value.isInteractive;
910
938
  },
911
- hasChildren: false,
912
939
  [_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
940
+ blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
941
+ componentRefProps
942
+ ], "p0.value.blockChildren"),
943
+ builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
944
+ componentRefProps
945
+ ], "p0.value.builderBlock"),
946
+ componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
947
+ componentRefProps
948
+ ], "p0.value.componentOptions"),
949
+ componentRef: _fnSignal((p0) => p0.value.componentRef, [
950
+ componentRefProps
951
+ ], "p0.value.componentRef"),
952
+ context: _fnSignal((p0) => p0.value.context, [
953
+ componentRefProps
954
+ ], "p0.value.context"),
955
+ includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
956
+ componentRefProps
957
+ ], "p0.value.includeBlockProps"),
958
+ isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
959
+ componentRefProps
960
+ ], "p0.value.isInteractive"),
961
+ registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
962
+ componentRefProps
963
+ ], "p0.value.registeredComponents")
923
964
  }
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;
965
+ }, 3, "jN_1"),
966
+ (childrenWithoutParentComponent.value || []).map((child) => {
967
+ return /* @__PURE__ */ _jsxC(Block, {
968
+ block: child,
969
+ get context() {
970
+ return state.childrenContext;
932
971
  },
933
972
  get registeredComponents() {
934
973
  return props.registeredComponents;
935
974
  },
936
975
  [_IMMUTABLE]: {
937
- block: _wrapProp(data, "block"),
976
+ context: _fnSignal((p0) => p0.childrenContext, [
977
+ state
978
+ ], "p0.childrenContext"),
938
979
  registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
939
980
  props
940
- ], "p0.registeredComponents"),
941
- repeatContext: _wrapProp(data, "context")
981
+ ], "p0.registeredComponents")
942
982
  }
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, {
983
+ }, 3, child.id);
984
+ })
985
+ ],
986
+ [_IMMUTABLE]: {
987
+ Wrapper: _fnSignal((p0) => p0.value, [
988
+ Tag
989
+ ], "p0.value"),
990
+ block: _fnSignal((p0) => p0.value, [
991
+ processedBlock
992
+ ], "p0.value"),
993
+ context: _fnSignal((p0) => p0.context, [
994
+ props
995
+ ], "p0.context")
996
+ }
997
+ }, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
998
+ return /* @__PURE__ */ _jsxC(RepeatedBlock, {
999
+ get repeatContext() {
1000
+ return data.context;
1001
+ },
1002
+ get block() {
1003
+ return data.block;
1004
+ },
1005
+ get registeredComponents() {
1006
+ return props.registeredComponents;
1007
+ },
1008
+ [_IMMUTABLE]: {
1009
+ block: _wrapProp(data, "block"),
1010
+ registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
1011
+ props
1012
+ ], "p0.registeredComponents"),
1013
+ repeatContext: _wrapProp(data, "context")
1014
+ }
1015
+ }, 3, index);
1016
+ }) : /* @__PURE__ */ _jsxC(ComponentRef, {
1044
1017
  get componentRef() {
1045
1018
  return componentRefProps.value.componentRef;
1046
1019
  },
@@ -1091,10 +1064,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1091
1064
  componentRefProps
1092
1065
  ], "p0.value.registeredComponents")
1093
1066
  }
1094
- }, 3, "jN_5")
1067
+ }, 3, "jN_3")
1095
1068
  ]
1096
- }, 1, "jN_6") : null
1097
- }, 1, "jN_7");
1069
+ }, 1, "jN_4") : null
1070
+ }, 1, "jN_5");
1098
1071
  }, "Block_component_nnPv0RY0U0k"));
1099
1072
  const onClick$1 = function onClick2(props, state) {
1100
1073
  var _a, _b;
@@ -3141,6 +3114,17 @@ async function fetchEntries(options) {
3141
3114
  }
3142
3115
  }
3143
3116
  const getAllContent = fetchEntries;
3117
+ const DEFAULT_TRUSTED_HOSTS = [
3118
+ "*.beta.builder.io",
3119
+ "beta.builder.io",
3120
+ "builder.io",
3121
+ "localhost",
3122
+ "qa.builder.io"
3123
+ ];
3124
+ function isFromTrustedHost(trustedHosts, e) {
3125
+ const url = new URL(e.origin), hostname = url.hostname;
3126
+ return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
3127
+ }
3144
3128
  function isPreviewing() {
3145
3129
  if (!isBrowser())
3146
3130
  return false;
@@ -3340,7 +3324,7 @@ const getInteractionPropertiesForEvent = (event) => {
3340
3324
  }
3341
3325
  };
3342
3326
  };
3343
- const SDK_VERSION = "0.12.1";
3327
+ const SDK_VERSION = "0.12.3";
3344
3328
  const registry = {};
3345
3329
  function register(type, info) {
3346
3330
  let typeList = registry[type];
@@ -3423,8 +3407,11 @@ const setupBrowserForEditing = (options = {}) => {
3423
3407
  options
3424
3408
  }
3425
3409
  }, "*");
3426
- window.addEventListener("message", ({ data }) => {
3410
+ window.addEventListener("message", (event) => {
3427
3411
  var _a2, _b2;
3412
+ if (!isFromTrustedHost(options.trustedHosts, event))
3413
+ return;
3414
+ const { data } = event;
3428
3415
  if (!(data == null ? void 0 : data.type))
3429
3416
  return;
3430
3417
  switch (data.type) {
@@ -3503,6 +3490,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
3503
3490
  };
3504
3491
  const processMessage = function processMessage2(props, state, elementRef, event) {
3505
3492
  var _a;
3493
+ if (!isFromTrustedHost(props.trustedHosts, event))
3494
+ return;
3506
3495
  const { data } = event;
3507
3496
  if (data)
3508
3497
  switch (data.type) {
@@ -3637,6 +3626,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3637
3626
  } : {},
3638
3627
  ...props2.enrich ? {
3639
3628
  enrich: props2.enrich
3629
+ } : {},
3630
+ ...props2.trustedHosts ? {
3631
+ trustedHosts: props2.trustedHosts
3640
3632
  } : {}
3641
3633
  });
3642
3634
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
@@ -3859,6 +3851,10 @@ ${getFontCss({
3859
3851
  customFonts: props.customFonts
3860
3852
  })}
3861
3853
 
3854
+ .builder-button {
3855
+ all: unset;
3856
+ }
3857
+
3862
3858
  .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
3863
3859
  margin: 0;
3864
3860
  }
@@ -4015,6 +4011,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
4015
4011
  get contentWrapperProps() {
4016
4012
  return props.contentWrapperProps;
4017
4013
  },
4014
+ get trustedHosts() {
4015
+ return props.trustedHosts;
4016
+ },
4018
4017
  children: [
4019
4018
  props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
4020
4019
  get scriptStr() {
@@ -4126,7 +4125,10 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
4126
4125
  ], "p0.model"),
4127
4126
  showContent: _fnSignal((p0) => p0.showContent, [
4128
4127
  props
4129
- ], "p0.showContent")
4128
+ ], "p0.showContent"),
4129
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4130
+ props
4131
+ ], "p0.trustedHosts")
4130
4132
  }
4131
4133
  }, 1, "LQ_3");
4132
4134
  }, "ContentComponent_component_HIsczUcxjCE"));
@@ -4259,6 +4261,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4259
4261
  get contentWrapperProps() {
4260
4262
  return props.contentWrapperProps;
4261
4263
  },
4264
+ get trustedHosts() {
4265
+ return props.trustedHosts;
4266
+ },
4262
4267
  [_IMMUTABLE]: {
4263
4268
  apiKey: _fnSignal((p0) => p0.apiKey, [
4264
4269
  props
@@ -4305,7 +4310,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4305
4310
  model: _fnSignal((p0) => p0.model, [
4306
4311
  props
4307
4312
  ], "p0.model"),
4308
- showContent: _IMMUTABLE
4313
+ showContent: _IMMUTABLE,
4314
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4315
+ props
4316
+ ], "p0.trustedHosts")
4309
4317
  }
4310
4318
  }, 3, variant.testVariationId);
4311
4319
  })
@@ -4361,6 +4369,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4361
4369
  get contentWrapperProps() {
4362
4370
  return props.contentWrapperProps;
4363
4371
  },
4372
+ get trustedHosts() {
4373
+ return props.trustedHosts;
4374
+ },
4364
4375
  [_IMMUTABLE]: {
4365
4376
  apiKey: _fnSignal((p0) => p0.apiKey, [
4366
4377
  props
@@ -4410,7 +4421,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
4410
4421
  model: _fnSignal((p0) => p0.model, [
4411
4422
  props
4412
4423
  ], "p0.model"),
4413
- showContent: _IMMUTABLE
4424
+ showContent: _IMMUTABLE,
4425
+ trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
4426
+ props
4427
+ ], "p0.trustedHosts")
4414
4428
  }
4415
4429
  }, 3, "XM_4")
4416
4430
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,4 +1,3 @@
1
1
  import { ButtonProps } from "./button.types.js";
2
2
  export declare const Button: import("@builder.io/qwik").Component<ButtonProps>;
3
3
  export default Button;
4
- export declare const STYLES = "\n.button-Button {\n all: unset;\n}\n";
@@ -1,7 +1,6 @@
1
1
  import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
2
2
  import type { BuilderBlock } from '../../types/builder-block.js';
3
3
  import type { RepeatData } from './types.js';
4
- export declare const isEmptyHtmlElement: (tagName: unknown) => boolean;
5
4
  export declare const getComponent: ({ block, context, registeredComponents }: {
6
5
  block: BuilderBlock;
7
6
  context: BuilderContextInterface;
@@ -1,21 +1,13 @@
1
1
  import { BuilderContextInterface } from "../../../context/types.js";
2
2
  import { BuilderBlock } from "../../../types/builder-block.js";
3
3
  import { PropsWithChildren } from "../../../types/typescript.js";
4
- /**
5
- * This import is used by the Svelte SDK. Do not remove.
6
- */
7
4
  type BlockWrapperProps = {
8
5
  Wrapper: string;
9
6
  block: BuilderBlock;
10
7
  context: BuilderContextInterface;
11
- hasChildren: boolean;
12
8
  };
13
9
  /**
14
10
  * This component renders a block's wrapper HTML element (from the block's `tagName` property).
15
- * It reuses the exact same logic as the `InteractiveElement` component, but we need to have 2 separate components for
16
- * Svelte's sake, as it needs to know at compile-time whether to use:
17
- * - `<svelte:element>` (for HTML element) or
18
- * - `<svelte:component>` (for custom components)
19
11
  */
20
12
  export declare const BlockWrapper: import("@builder.io/qwik").Component<PropsWithChildren<BlockWrapperProps>>;
21
13
  export default BlockWrapper;
@@ -62,4 +62,8 @@ export interface ContentVariantsPrps {
62
62
  * Additonal props to pass to `blocksWrapper`. Defaults to `{}`.
63
63
  */
64
64
  blocksWrapperProps?: any;
65
+ /**
66
+ * List of hosts to allow editing content from.
67
+ */
68
+ trustedHosts?: string[];
65
69
  }
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from "../../types/typescript.js";
2
+ export declare const DynamicRenderer: import("@builder.io/qwik").Component<PropsWithChildren<{
3
+ TagName: any;
4
+ attributes: any;
5
+ actionAttributes: any;
6
+ }>>;
7
+ export default DynamicRenderer;
@@ -0,0 +1 @@
1
+ export declare const isEmptyElement: (tagName: any) => boolean;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.12.1";
1
+ export declare const SDK_VERSION = "0.12.3";
@@ -0,0 +1,3 @@
1
+ export declare function isFromTrustedHost(trustedHosts: string[] | undefined, e: {
2
+ origin: string;
3
+ }): boolean;
@@ -3,4 +3,5 @@ export declare const setupBrowserForEditing: (options?: {
3
3
  enrich?: boolean;
4
4
  includeRefs?: boolean;
5
5
  locale?: string;
6
+ trustedHosts?: string[];
6
7
  }) => void;