@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/node/index.qwik.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
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 { 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
|
|
27
|
+
class: _fnSignal((p0) => `builder-button ${p0.attributes.class}`, [
|
|
29
28
|
props
|
|
30
|
-
],
|
|
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
|
|
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.
|
|
648
|
-
...
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
...
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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(
|
|
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
|
-
|
|
902
|
-
get
|
|
903
|
-
return
|
|
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
|
|
906
|
-
return
|
|
921
|
+
get blockChildren() {
|
|
922
|
+
return componentRefProps.value.blockChildren;
|
|
907
923
|
},
|
|
908
924
|
get context() {
|
|
909
|
-
return
|
|
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
|
-
|
|
914
|
-
|
|
915
|
-
], "p0.value"),
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
], "p0.value"),
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
], "p0.
|
|
922
|
-
|
|
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")
|
|
925
|
-
|
|
926
|
-
return /* @__PURE__ */ _jsxC(
|
|
927
|
-
|
|
928
|
-
|
|
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
|
-
|
|
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,
|
|
944
|
-
})
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
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, "
|
|
1067
|
+
}, 3, "jN_3")
|
|
1095
1068
|
]
|
|
1096
|
-
}, 1, "
|
|
1097
|
-
}, 1, "
|
|
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.
|
|
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", (
|
|
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,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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEmptyElement: (tagName: any) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.12.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.3";
|