@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.
- package/lib/browser/index.qwik.cjs +210 -196
- package/lib/browser/index.qwik.mjs +211 -197
- package/lib/edge/index.qwik.cjs +210 -196
- package/lib/edge/index.qwik.mjs +211 -197
- package/lib/node/index.qwik.cjs +210 -196
- package/lib/node/index.qwik.mjs +211 -197
- package/package.json +1 -1
- package/types/src/blocks/button/button.d.ts +0 -1
- package/types/src/components/block/block.helpers.d.ts +0 -1
- package/types/src/components/block/components/block-wrapper.d.ts +0 -8
- package/types/src/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/src/components/dynamic-renderer/dynamic-renderer.d.ts +7 -0
- package/types/src/components/dynamic-renderer/dynamic-renderer.helpers.d.ts +1 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/is-from-trusted-host.d.ts +3 -0
- package/types/src/scripts/init-editing.d.ts +1 -0
package/lib/edge/index.qwik.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl,
|
|
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 { isServer } from "@builder.io/qwik/build";
|
|
4
4
|
const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
5
|
-
useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
|
|
6
5
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
7
6
|
children: props.link ? /* @__PURE__ */ _jsxS("a", {
|
|
8
7
|
...props.attributes,
|
|
@@ -23,20 +22,16 @@ const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
|
|
|
23
22
|
props
|
|
24
23
|
], "p0.text")
|
|
25
24
|
}, {
|
|
26
|
-
class: _fnSignal((p0) => p0.attributes.class
|
|
25
|
+
class: _fnSignal((p0) => `builder-button ${p0.attributes.class}`, [
|
|
27
26
|
props
|
|
28
|
-
],
|
|
27
|
+
], "`builder-button ${p0.attributes.class}`"),
|
|
28
|
+
role: "button",
|
|
29
29
|
style: _fnSignal((p0) => p0.attributes.style, [
|
|
30
30
|
props
|
|
31
31
|
], "p0.attributes.style")
|
|
32
32
|
}, 0, null)
|
|
33
33
|
}, 1, "jc_1");
|
|
34
34
|
}, "Button_component_gJoMUICXoUQ"));
|
|
35
|
-
const STYLES$3 = `
|
|
36
|
-
.button-Button {
|
|
37
|
-
all: unset;
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
35
|
const builderContext = createContextId("Builder");
|
|
41
36
|
const ComponentsContext = createContextId("Components");
|
|
42
37
|
function getBlockComponentOptions(block) {
|
|
@@ -3467,26 +3462,6 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
|
|
|
3467
3462
|
else
|
|
3468
3463
|
return transformedBlock;
|
|
3469
3464
|
}
|
|
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
3465
|
const getComponent = ({ block, context, registeredComponents }) => {
|
|
3491
3466
|
var _a;
|
|
3492
3467
|
const componentName = (_a = getProcessedBlock({
|
|
@@ -3771,38 +3746,67 @@ function getStyleAttribute(style) {
|
|
|
3771
3746
|
return style;
|
|
3772
3747
|
}
|
|
3773
3748
|
}
|
|
3774
|
-
const
|
|
3749
|
+
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
|
|
3750
|
+
"area",
|
|
3751
|
+
"base",
|
|
3752
|
+
"br",
|
|
3753
|
+
"col",
|
|
3754
|
+
"embed",
|
|
3755
|
+
"hr",
|
|
3756
|
+
"img",
|
|
3757
|
+
"input",
|
|
3758
|
+
"keygen",
|
|
3759
|
+
"link",
|
|
3760
|
+
"meta",
|
|
3761
|
+
"param",
|
|
3762
|
+
"source",
|
|
3763
|
+
"track",
|
|
3764
|
+
"wbr"
|
|
3765
|
+
]);
|
|
3766
|
+
const isEmptyElement = (tagName) => {
|
|
3767
|
+
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.has(tagName.toLowerCase());
|
|
3768
|
+
};
|
|
3769
|
+
const DynamicRenderer = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
3775
3770
|
_jsxBranch();
|
|
3776
3771
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
3777
|
-
children: props.
|
|
3778
|
-
...
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
...
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3772
|
+
children: !isEmptyElement(props.TagName) ? typeof props.TagName === "string" ? /* @__PURE__ */ _jsxC(props.TagName, {
|
|
3773
|
+
...props.attributes,
|
|
3774
|
+
...props.actionAttributes,
|
|
3775
|
+
children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_0")
|
|
3776
|
+
}, 0, "yW_1") : /* @__PURE__ */ _jsxC(props.TagName, {
|
|
3777
|
+
...props.attributes,
|
|
3778
|
+
...props.actionAttributes,
|
|
3779
|
+
children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "yW_2")
|
|
3780
|
+
}, 0, "yW_3") : /* @__PURE__ */ _jsxC(props.TagName, {
|
|
3781
|
+
...props.attributes,
|
|
3782
|
+
...props.actionAttributes
|
|
3783
|
+
}, 0, "yW_4")
|
|
3784
|
+
}, 1, "yW_5");
|
|
3785
|
+
}, "DynamicRenderer_component_1Co0xkmyAfQ"));
|
|
3786
|
+
const BlockWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
3787
|
+
return /* @__PURE__ */ _jsxC(DynamicRenderer, {
|
|
3788
|
+
get TagName() {
|
|
3789
|
+
return props.Wrapper;
|
|
3790
|
+
},
|
|
3791
|
+
actionAttributes: getBlockActions({
|
|
3792
|
+
block: props.block,
|
|
3793
|
+
rootState: props.context.rootState,
|
|
3794
|
+
rootSetState: props.context.rootSetState,
|
|
3795
|
+
localState: props.context.localState,
|
|
3796
|
+
context: props.context.context,
|
|
3797
|
+
stripPrefix: true
|
|
3798
|
+
}),
|
|
3799
|
+
attributes: getBlockProperties({
|
|
3800
|
+
block: props.block,
|
|
3801
|
+
context: props.context
|
|
3802
|
+
}),
|
|
3803
|
+
children: /* @__PURE__ */ _jsxC(Slot$1, null, 3, "87_0"),
|
|
3804
|
+
[_IMMUTABLE]: {
|
|
3805
|
+
TagName: _fnSignal((p0) => p0.Wrapper, [
|
|
3806
|
+
props
|
|
3807
|
+
], "p0.Wrapper")
|
|
3808
|
+
}
|
|
3809
|
+
}, 1, "87_1");
|
|
3806
3810
|
}, "BlockWrapper_component_kOI0j0aW8Nw"));
|
|
3807
3811
|
const InteractiveElement = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
3808
3812
|
return /* @__PURE__ */ _jsxC(props.Wrapper, {
|
|
@@ -4026,151 +4030,120 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
4026
4030
|
], "p0.context")
|
|
4027
4031
|
}
|
|
4028
4032
|
}, 3, "jN_0"),
|
|
4029
|
-
!((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? /* @__PURE__ */ _jsxC(
|
|
4033
|
+
!((_a = blockComponent.value) == null ? void 0 : _a.noWrap) ? !repeatItem.value ? /* @__PURE__ */ _jsxC(BlockWrapper, {
|
|
4034
|
+
get Wrapper() {
|
|
4035
|
+
return Tag.value;
|
|
4036
|
+
},
|
|
4037
|
+
get block() {
|
|
4038
|
+
return processedBlock.value;
|
|
4039
|
+
},
|
|
4040
|
+
get context() {
|
|
4041
|
+
return props.context;
|
|
4042
|
+
},
|
|
4030
4043
|
children: [
|
|
4031
|
-
|
|
4032
|
-
get
|
|
4033
|
-
return
|
|
4044
|
+
/* @__PURE__ */ _jsxC(ComponentRef, {
|
|
4045
|
+
get componentRef() {
|
|
4046
|
+
return componentRefProps.value.componentRef;
|
|
4047
|
+
},
|
|
4048
|
+
get componentOptions() {
|
|
4049
|
+
return componentRefProps.value.componentOptions;
|
|
4034
4050
|
},
|
|
4035
|
-
get
|
|
4036
|
-
return
|
|
4051
|
+
get blockChildren() {
|
|
4052
|
+
return componentRefProps.value.blockChildren;
|
|
4037
4053
|
},
|
|
4038
4054
|
get context() {
|
|
4039
|
-
return
|
|
4055
|
+
return componentRefProps.value.context;
|
|
4056
|
+
},
|
|
4057
|
+
get registeredComponents() {
|
|
4058
|
+
return componentRefProps.value.registeredComponents;
|
|
4059
|
+
},
|
|
4060
|
+
get builderBlock() {
|
|
4061
|
+
return componentRefProps.value.builderBlock;
|
|
4062
|
+
},
|
|
4063
|
+
get includeBlockProps() {
|
|
4064
|
+
return componentRefProps.value.includeBlockProps;
|
|
4065
|
+
},
|
|
4066
|
+
get isInteractive() {
|
|
4067
|
+
return componentRefProps.value.isInteractive;
|
|
4040
4068
|
},
|
|
4041
|
-
hasChildren: false,
|
|
4042
4069
|
[_IMMUTABLE]: {
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
], "p0.value"),
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
], "p0.value"),
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
], "p0.
|
|
4052
|
-
|
|
4070
|
+
blockChildren: _fnSignal((p0) => p0.value.blockChildren, [
|
|
4071
|
+
componentRefProps
|
|
4072
|
+
], "p0.value.blockChildren"),
|
|
4073
|
+
builderBlock: _fnSignal((p0) => p0.value.builderBlock, [
|
|
4074
|
+
componentRefProps
|
|
4075
|
+
], "p0.value.builderBlock"),
|
|
4076
|
+
componentOptions: _fnSignal((p0) => p0.value.componentOptions, [
|
|
4077
|
+
componentRefProps
|
|
4078
|
+
], "p0.value.componentOptions"),
|
|
4079
|
+
componentRef: _fnSignal((p0) => p0.value.componentRef, [
|
|
4080
|
+
componentRefProps
|
|
4081
|
+
], "p0.value.componentRef"),
|
|
4082
|
+
context: _fnSignal((p0) => p0.value.context, [
|
|
4083
|
+
componentRefProps
|
|
4084
|
+
], "p0.value.context"),
|
|
4085
|
+
includeBlockProps: _fnSignal((p0) => p0.value.includeBlockProps, [
|
|
4086
|
+
componentRefProps
|
|
4087
|
+
], "p0.value.includeBlockProps"),
|
|
4088
|
+
isInteractive: _fnSignal((p0) => p0.value.isInteractive, [
|
|
4089
|
+
componentRefProps
|
|
4090
|
+
], "p0.value.isInteractive"),
|
|
4091
|
+
registeredComponents: _fnSignal((p0) => p0.value.registeredComponents, [
|
|
4092
|
+
componentRefProps
|
|
4093
|
+
], "p0.value.registeredComponents")
|
|
4053
4094
|
}
|
|
4054
|
-
}, 3, "jN_1")
|
|
4055
|
-
|
|
4056
|
-
return /* @__PURE__ */ _jsxC(
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
get block() {
|
|
4061
|
-
return data.block;
|
|
4095
|
+
}, 3, "jN_1"),
|
|
4096
|
+
(childrenWithoutParentComponent.value || []).map((child) => {
|
|
4097
|
+
return /* @__PURE__ */ _jsxC(Block, {
|
|
4098
|
+
block: child,
|
|
4099
|
+
get context() {
|
|
4100
|
+
return state.childrenContext;
|
|
4062
4101
|
},
|
|
4063
4102
|
get registeredComponents() {
|
|
4064
4103
|
return props.registeredComponents;
|
|
4065
4104
|
},
|
|
4066
4105
|
[_IMMUTABLE]: {
|
|
4067
|
-
|
|
4106
|
+
context: _fnSignal((p0) => p0.childrenContext, [
|
|
4107
|
+
state
|
|
4108
|
+
], "p0.childrenContext"),
|
|
4068
4109
|
registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
|
|
4069
4110
|
props
|
|
4070
|
-
], "p0.registeredComponents")
|
|
4071
|
-
repeatContext: _wrapProp(data, "context")
|
|
4111
|
+
], "p0.registeredComponents")
|
|
4072
4112
|
}
|
|
4073
|
-
}, 3,
|
|
4074
|
-
})
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
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, {
|
|
4113
|
+
}, 3, child.id);
|
|
4114
|
+
})
|
|
4115
|
+
],
|
|
4116
|
+
[_IMMUTABLE]: {
|
|
4117
|
+
Wrapper: _fnSignal((p0) => p0.value, [
|
|
4118
|
+
Tag
|
|
4119
|
+
], "p0.value"),
|
|
4120
|
+
block: _fnSignal((p0) => p0.value, [
|
|
4121
|
+
processedBlock
|
|
4122
|
+
], "p0.value"),
|
|
4123
|
+
context: _fnSignal((p0) => p0.context, [
|
|
4124
|
+
props
|
|
4125
|
+
], "p0.context")
|
|
4126
|
+
}
|
|
4127
|
+
}, 1, "jN_2") : (repeatItem.value || []).map((data, index) => {
|
|
4128
|
+
return /* @__PURE__ */ _jsxC(RepeatedBlock, {
|
|
4129
|
+
get repeatContext() {
|
|
4130
|
+
return data.context;
|
|
4131
|
+
},
|
|
4132
|
+
get block() {
|
|
4133
|
+
return data.block;
|
|
4134
|
+
},
|
|
4135
|
+
get registeredComponents() {
|
|
4136
|
+
return props.registeredComponents;
|
|
4137
|
+
},
|
|
4138
|
+
[_IMMUTABLE]: {
|
|
4139
|
+
block: _wrapProp(data, "block"),
|
|
4140
|
+
registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
|
|
4141
|
+
props
|
|
4142
|
+
], "p0.registeredComponents"),
|
|
4143
|
+
repeatContext: _wrapProp(data, "context")
|
|
4144
|
+
}
|
|
4145
|
+
}, 3, index);
|
|
4146
|
+
}) : /* @__PURE__ */ _jsxC(ComponentRef, {
|
|
4174
4147
|
get componentRef() {
|
|
4175
4148
|
return componentRefProps.value.componentRef;
|
|
4176
4149
|
},
|
|
@@ -4221,10 +4194,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
4221
4194
|
componentRefProps
|
|
4222
4195
|
], "p0.value.registeredComponents")
|
|
4223
4196
|
}
|
|
4224
|
-
}, 3, "
|
|
4197
|
+
}, 3, "jN_3")
|
|
4225
4198
|
]
|
|
4226
|
-
}, 1, "
|
|
4227
|
-
}, 1, "
|
|
4199
|
+
}, 1, "jN_4") : null
|
|
4200
|
+
}, 1, "jN_5");
|
|
4228
4201
|
}, "Block_component_nnPv0RY0U0k"));
|
|
4229
4202
|
const onClick$1 = function onClick2(props, state) {
|
|
4230
4203
|
var _a, _b;
|
|
@@ -6271,6 +6244,17 @@ async function fetchEntries(options) {
|
|
|
6271
6244
|
}
|
|
6272
6245
|
}
|
|
6273
6246
|
const getAllContent = fetchEntries;
|
|
6247
|
+
const DEFAULT_TRUSTED_HOSTS = [
|
|
6248
|
+
"*.beta.builder.io",
|
|
6249
|
+
"beta.builder.io",
|
|
6250
|
+
"builder.io",
|
|
6251
|
+
"localhost",
|
|
6252
|
+
"qa.builder.io"
|
|
6253
|
+
];
|
|
6254
|
+
function isFromTrustedHost(trustedHosts, e) {
|
|
6255
|
+
const url = new URL(e.origin), hostname = url.hostname;
|
|
6256
|
+
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
6257
|
+
}
|
|
6274
6258
|
function isPreviewing() {
|
|
6275
6259
|
if (!isBrowser())
|
|
6276
6260
|
return false;
|
|
@@ -6470,7 +6454,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
6470
6454
|
}
|
|
6471
6455
|
};
|
|
6472
6456
|
};
|
|
6473
|
-
const SDK_VERSION = "0.12.
|
|
6457
|
+
const SDK_VERSION = "0.12.3";
|
|
6474
6458
|
const registry = {};
|
|
6475
6459
|
function register(type, info) {
|
|
6476
6460
|
let typeList = registry[type];
|
|
@@ -6553,8 +6537,11 @@ const setupBrowserForEditing = (options = {}) => {
|
|
|
6553
6537
|
options
|
|
6554
6538
|
}
|
|
6555
6539
|
}, "*");
|
|
6556
|
-
window.addEventListener("message", (
|
|
6540
|
+
window.addEventListener("message", (event) => {
|
|
6557
6541
|
var _a2, _b2;
|
|
6542
|
+
if (!isFromTrustedHost(options.trustedHosts, event))
|
|
6543
|
+
return;
|
|
6544
|
+
const { data } = event;
|
|
6558
6545
|
if (!(data == null ? void 0 : data.type))
|
|
6559
6546
|
return;
|
|
6560
6547
|
switch (data.type) {
|
|
@@ -6633,6 +6620,8 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
|
|
|
6633
6620
|
};
|
|
6634
6621
|
const processMessage = function processMessage2(props, state, elementRef, event) {
|
|
6635
6622
|
var _a;
|
|
6623
|
+
if (!isFromTrustedHost(props.trustedHosts, event))
|
|
6624
|
+
return;
|
|
6636
6625
|
const { data } = event;
|
|
6637
6626
|
if (data)
|
|
6638
6627
|
switch (data.type) {
|
|
@@ -6767,6 +6756,9 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
6767
6756
|
} : {},
|
|
6768
6757
|
...props2.enrich ? {
|
|
6769
6758
|
enrich: props2.enrich
|
|
6759
|
+
} : {},
|
|
6760
|
+
...props2.trustedHosts ? {
|
|
6761
|
+
trustedHosts: props2.trustedHosts
|
|
6770
6762
|
} : {}
|
|
6771
6763
|
});
|
|
6772
6764
|
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
@@ -6989,6 +6981,10 @@ ${getFontCss({
|
|
|
6989
6981
|
customFonts: props.customFonts
|
|
6990
6982
|
})}
|
|
6991
6983
|
|
|
6984
|
+
.builder-button {
|
|
6985
|
+
all: unset;
|
|
6986
|
+
}
|
|
6987
|
+
|
|
6992
6988
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
6993
6989
|
margin: 0;
|
|
6994
6990
|
}
|
|
@@ -7145,6 +7141,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7145
7141
|
get contentWrapperProps() {
|
|
7146
7142
|
return props.contentWrapperProps;
|
|
7147
7143
|
},
|
|
7144
|
+
get trustedHosts() {
|
|
7145
|
+
return props.trustedHosts;
|
|
7146
|
+
},
|
|
7148
7147
|
children: [
|
|
7149
7148
|
props.isSsrAbTest ? /* @__PURE__ */ _jsxC(InlinedScript, {
|
|
7150
7149
|
get scriptStr() {
|
|
@@ -7256,7 +7255,10 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7256
7255
|
], "p0.model"),
|
|
7257
7256
|
showContent: _fnSignal((p0) => p0.showContent, [
|
|
7258
7257
|
props
|
|
7259
|
-
], "p0.showContent")
|
|
7258
|
+
], "p0.showContent"),
|
|
7259
|
+
trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
|
|
7260
|
+
props
|
|
7261
|
+
], "p0.trustedHosts")
|
|
7260
7262
|
}
|
|
7261
7263
|
}, 1, "LQ_3");
|
|
7262
7264
|
}, "ContentComponent_component_HIsczUcxjCE"));
|
|
@@ -7389,6 +7391,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7389
7391
|
get contentWrapperProps() {
|
|
7390
7392
|
return props.contentWrapperProps;
|
|
7391
7393
|
},
|
|
7394
|
+
get trustedHosts() {
|
|
7395
|
+
return props.trustedHosts;
|
|
7396
|
+
},
|
|
7392
7397
|
[_IMMUTABLE]: {
|
|
7393
7398
|
apiKey: _fnSignal((p0) => p0.apiKey, [
|
|
7394
7399
|
props
|
|
@@ -7435,7 +7440,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7435
7440
|
model: _fnSignal((p0) => p0.model, [
|
|
7436
7441
|
props
|
|
7437
7442
|
], "p0.model"),
|
|
7438
|
-
showContent: _IMMUTABLE
|
|
7443
|
+
showContent: _IMMUTABLE,
|
|
7444
|
+
trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
|
|
7445
|
+
props
|
|
7446
|
+
], "p0.trustedHosts")
|
|
7439
7447
|
}
|
|
7440
7448
|
}, 3, variant.testVariationId);
|
|
7441
7449
|
})
|
|
@@ -7491,6 +7499,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7491
7499
|
get contentWrapperProps() {
|
|
7492
7500
|
return props.contentWrapperProps;
|
|
7493
7501
|
},
|
|
7502
|
+
get trustedHosts() {
|
|
7503
|
+
return props.trustedHosts;
|
|
7504
|
+
},
|
|
7494
7505
|
[_IMMUTABLE]: {
|
|
7495
7506
|
apiKey: _fnSignal((p0) => p0.apiKey, [
|
|
7496
7507
|
props
|
|
@@ -7540,7 +7551,10 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7540
7551
|
model: _fnSignal((p0) => p0.model, [
|
|
7541
7552
|
props
|
|
7542
7553
|
], "p0.model"),
|
|
7543
|
-
showContent: _IMMUTABLE
|
|
7554
|
+
showContent: _IMMUTABLE,
|
|
7555
|
+
trustedHosts: _fnSignal((p0) => p0.trustedHosts, [
|
|
7556
|
+
props
|
|
7557
|
+
], "p0.trustedHosts")
|
|
7544
7558
|
}
|
|
7545
7559
|
}, 3, "XM_4")
|
|
7546
7560
|
]
|