@builder.io/sdk-qwik 0.4.1 → 0.4.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/index.qwik.cjs
CHANGED
|
@@ -456,38 +456,32 @@ const RenderComponent = (props) => {
|
|
|
456
456
|
}, 1, "R9_1");
|
|
457
457
|
};
|
|
458
458
|
const RenderRepeatedBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
rootSetState: props.repeatContext.rootSetState,
|
|
464
|
-
context: props.repeatContext.context,
|
|
465
|
-
apiKey: props.repeatContext.apiKey,
|
|
466
|
-
registeredComponents: props.repeatContext.registeredComponents,
|
|
467
|
-
inheritedStyles: props.repeatContext.inheritedStyles,
|
|
468
|
-
apiVersion: props.repeatContext.apiVersion
|
|
469
|
-
}));
|
|
459
|
+
const state = qwik.useStore({
|
|
460
|
+
store: props.repeatContext
|
|
461
|
+
});
|
|
462
|
+
qwik.useContextProvider(BuilderContext, state.store);
|
|
470
463
|
return /* @__PURE__ */ qwik._jsxC(RenderBlock, {
|
|
471
464
|
get block() {
|
|
472
465
|
return props.block;
|
|
473
466
|
},
|
|
474
467
|
get context() {
|
|
475
|
-
return
|
|
468
|
+
return state.store;
|
|
476
469
|
},
|
|
477
470
|
[qwik._IMMUTABLE]: {
|
|
478
471
|
block: qwik._fnSignal((p0) => p0.block, [
|
|
479
472
|
props
|
|
480
473
|
], "p0.block"),
|
|
481
|
-
context: qwik._fnSignal((p0) => p0.
|
|
482
|
-
|
|
483
|
-
], "p0.
|
|
474
|
+
context: qwik._fnSignal((p0) => p0.store, [
|
|
475
|
+
state
|
|
476
|
+
], "p0.store")
|
|
484
477
|
}
|
|
485
478
|
}, 3, "K5_0");
|
|
486
479
|
}, "RenderRepeatedBlock_component_nRyVBtbGKc8"));
|
|
487
480
|
const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
488
481
|
qwik._jsxBranch();
|
|
489
482
|
const state = qwik.useStore({
|
|
490
|
-
Tag: props.block.tagName || "div"
|
|
483
|
+
Tag: props.block.tagName || "div",
|
|
484
|
+
childrenContext: props.context
|
|
491
485
|
});
|
|
492
486
|
const component = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
493
487
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -564,29 +558,8 @@ const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
564
558
|
repeatItem,
|
|
565
559
|
useBlock
|
|
566
560
|
]));
|
|
567
|
-
const childrenContext = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
568
|
-
const [attributes2, props2, useBlock2] = qwik.useLexicalScope();
|
|
569
|
-
const getInheritedTextStyles = () => {
|
|
570
|
-
return {};
|
|
571
|
-
};
|
|
572
|
-
return {
|
|
573
|
-
apiKey: props2.context.apiKey,
|
|
574
|
-
apiVersion: props2.context.apiVersion,
|
|
575
|
-
localState: props2.context.localState,
|
|
576
|
-
rootState: props2.context.rootState,
|
|
577
|
-
rootSetState: props2.context.rootSetState,
|
|
578
|
-
content: props2.context.content,
|
|
579
|
-
context: props2.context.context,
|
|
580
|
-
registeredComponents: props2.context.registeredComponents,
|
|
581
|
-
inheritedStyles: getInheritedTextStyles()
|
|
582
|
-
};
|
|
583
|
-
}, "RenderBlock_component_childrenContext_useComputed_gskFnyBnHDI", [
|
|
584
|
-
attributes,
|
|
585
|
-
props,
|
|
586
|
-
useBlock
|
|
587
|
-
]));
|
|
588
561
|
const renderComponentProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
589
|
-
const [actions2, attributes2,
|
|
562
|
+
const [actions2, attributes2, component2, state2, useBlock2] = qwik.useLexicalScope();
|
|
590
563
|
return {
|
|
591
564
|
blockChildren: useBlock2.value.children ?? [],
|
|
592
565
|
componentRef: component2.value?.component,
|
|
@@ -599,13 +572,13 @@ const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
599
572
|
}
|
|
600
573
|
}
|
|
601
574
|
},
|
|
602
|
-
context:
|
|
575
|
+
context: state2.childrenContext
|
|
603
576
|
};
|
|
604
577
|
}, "RenderBlock_component_renderComponentProps_useComputed_tWa1cp0r7XY", [
|
|
605
578
|
actions,
|
|
606
579
|
attributes,
|
|
607
|
-
childrenContext,
|
|
608
580
|
component,
|
|
581
|
+
state,
|
|
609
582
|
useBlock
|
|
610
583
|
]));
|
|
611
584
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
@@ -640,12 +613,12 @@ const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
640
613
|
return /* @__PURE__ */ qwik._jsxC(RenderBlock, {
|
|
641
614
|
block: child,
|
|
642
615
|
get context() {
|
|
643
|
-
return childrenContext
|
|
616
|
+
return state.childrenContext;
|
|
644
617
|
},
|
|
645
618
|
[qwik._IMMUTABLE]: {
|
|
646
|
-
context: qwik._fnSignal((p0) => p0.
|
|
647
|
-
|
|
648
|
-
], "p0.
|
|
619
|
+
context: qwik._fnSignal((p0) => p0.childrenContext, [
|
|
620
|
+
state
|
|
621
|
+
], "p0.childrenContext")
|
|
649
622
|
}
|
|
650
623
|
}, 3, "render-block-" + child.id);
|
|
651
624
|
}),
|
|
@@ -653,12 +626,12 @@ const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
653
626
|
return /* @__PURE__ */ qwik._jsxC(BlockStyles, {
|
|
654
627
|
block: child,
|
|
655
628
|
get context() {
|
|
656
|
-
return childrenContext
|
|
629
|
+
return state.childrenContext;
|
|
657
630
|
},
|
|
658
631
|
[qwik._IMMUTABLE]: {
|
|
659
|
-
context: qwik._fnSignal((p0) => p0.
|
|
660
|
-
|
|
661
|
-
], "p0.
|
|
632
|
+
context: qwik._fnSignal((p0) => p0.childrenContext, [
|
|
633
|
+
state
|
|
634
|
+
], "p0.childrenContext")
|
|
662
635
|
}
|
|
663
636
|
}, 3, "block-style-" + child.id);
|
|
664
637
|
})
|
|
@@ -716,6 +689,14 @@ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
716
689
|
builderContext,
|
|
717
690
|
props,
|
|
718
691
|
state
|
|
692
|
+
]),
|
|
693
|
+
onKeyPress$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
694
|
+
const [builderContext2, props2, state2] = qwik.useLexicalScope();
|
|
695
|
+
return onClick$1(props2);
|
|
696
|
+
}, "RenderBlocks_component_div_onKeyPress_N5bJZwtuEmI", [
|
|
697
|
+
builderContext,
|
|
698
|
+
props,
|
|
699
|
+
state
|
|
719
700
|
])
|
|
720
701
|
}, {
|
|
721
702
|
class: qwik._fnSignal((p0) => p0.value + " div-RenderBlocks", [
|
|
@@ -1950,7 +1931,9 @@ const componentInfo$1 = {
|
|
|
1950
1931
|
"jpeg",
|
|
1951
1932
|
"jpg",
|
|
1952
1933
|
"png",
|
|
1953
|
-
"svg"
|
|
1934
|
+
"svg",
|
|
1935
|
+
"gif",
|
|
1936
|
+
"webp"
|
|
1954
1937
|
],
|
|
1955
1938
|
required: true
|
|
1956
1939
|
}
|
|
@@ -2671,7 +2654,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
2671
2654
|
}
|
|
2672
2655
|
};
|
|
2673
2656
|
};
|
|
2674
|
-
const SDK_VERSION = "0.4.
|
|
2657
|
+
const SDK_VERSION = "0.4.3";
|
|
2675
2658
|
const registry = {};
|
|
2676
2659
|
function register(type, info) {
|
|
2677
2660
|
let typeList = registry[type];
|
|
@@ -2905,7 +2888,8 @@ function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2)
|
|
|
2905
2888
|
}
|
|
2906
2889
|
return;
|
|
2907
2890
|
}
|
|
2908
|
-
const
|
|
2891
|
+
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
|
|
2892
|
+
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
2909
2893
|
const AB_TEST_FN_NAME = "bldrAbTest";
|
|
2910
2894
|
const CONTENT_FN_NAME = "bldrCntntScrpt";
|
|
2911
2895
|
const getVariantsScriptString = (variants, contentId) => {
|
|
@@ -3028,31 +3012,31 @@ const getContentInitialValue = ({ content, data }) => {
|
|
|
3028
3012
|
};
|
|
3029
3013
|
};
|
|
3030
3014
|
const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
|
|
3031
|
-
state.
|
|
3032
|
-
...state.
|
|
3015
|
+
state.builderContextSignal.content = {
|
|
3016
|
+
...state.builderContextSignal.content,
|
|
3033
3017
|
...newContent,
|
|
3034
3018
|
data: {
|
|
3035
|
-
...state.
|
|
3019
|
+
...state.builderContextSignal.content?.data,
|
|
3036
3020
|
...newContent?.data
|
|
3037
3021
|
},
|
|
3038
3022
|
meta: {
|
|
3039
|
-
...state.
|
|
3023
|
+
...state.builderContextSignal.content?.meta,
|
|
3040
3024
|
...newContent?.meta,
|
|
3041
|
-
breakpoints: newContent?.meta?.breakpoints || state.
|
|
3025
|
+
breakpoints: newContent?.meta?.breakpoints || state.builderContextSignal.content?.meta?.breakpoints
|
|
3042
3026
|
}
|
|
3043
3027
|
};
|
|
3044
3028
|
};
|
|
3045
3029
|
const setBreakpoints = function setBreakpoints2(props, state, elementRef, breakpoints) {
|
|
3046
|
-
state.
|
|
3047
|
-
...state.
|
|
3030
|
+
state.builderContextSignal.content = {
|
|
3031
|
+
...state.builderContextSignal.content,
|
|
3048
3032
|
meta: {
|
|
3049
|
-
...state.
|
|
3033
|
+
...state.builderContextSignal.content?.meta,
|
|
3050
3034
|
breakpoints
|
|
3051
3035
|
}
|
|
3052
3036
|
};
|
|
3053
3037
|
};
|
|
3054
3038
|
const contentSetState = function contentSetState2(props, state, elementRef, newRootState) {
|
|
3055
|
-
state.
|
|
3039
|
+
state.builderContextSignal.rootState = newRootState;
|
|
3056
3040
|
};
|
|
3057
3041
|
const processMessage = function processMessage2(props, state, elementRef, event) {
|
|
3058
3042
|
const { data } = event;
|
|
@@ -3061,7 +3045,7 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
3061
3045
|
case "builder.configureSdk": {
|
|
3062
3046
|
const messageContent = data.data;
|
|
3063
3047
|
const { breakpoints, contentId } = messageContent;
|
|
3064
|
-
if (!contentId || contentId !== state.
|
|
3048
|
+
if (!contentId || contentId !== state.builderContextSignal.content?.id)
|
|
3065
3049
|
return;
|
|
3066
3050
|
if (breakpoints)
|
|
3067
3051
|
setBreakpoints(props, state, elementRef, breakpoints);
|
|
@@ -3081,20 +3065,20 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
3081
3065
|
}
|
|
3082
3066
|
};
|
|
3083
3067
|
const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
3084
|
-
const jsCode = state.
|
|
3068
|
+
const jsCode = state.builderContextSignal.content?.data?.jsCode;
|
|
3085
3069
|
if (jsCode)
|
|
3086
3070
|
evaluate({
|
|
3087
3071
|
code: jsCode,
|
|
3088
3072
|
context: props.context || {},
|
|
3089
3073
|
localState: void 0,
|
|
3090
|
-
rootState: state.
|
|
3074
|
+
rootState: state.builderContextSignal.rootState,
|
|
3091
3075
|
rootSetState: contentSetState.bind(null, props, state, elementRef)
|
|
3092
3076
|
});
|
|
3093
3077
|
};
|
|
3094
3078
|
const onClick = function onClick22(props, state, elementRef, event) {
|
|
3095
|
-
if (state.
|
|
3096
|
-
const variationId = state.
|
|
3097
|
-
const contentId = state.
|
|
3079
|
+
if (state.builderContextSignal.content) {
|
|
3080
|
+
const variationId = state.builderContextSignal.content?.testVariationId;
|
|
3081
|
+
const contentId = state.builderContextSignal.content?.id;
|
|
3098
3082
|
_track({
|
|
3099
3083
|
type: "click",
|
|
3100
3084
|
canTrack: state.canTrackToUse,
|
|
@@ -3113,14 +3097,14 @@ const evalExpression = function evalExpression2(props, state, elementRef, expres
|
|
|
3113
3097
|
code: group,
|
|
3114
3098
|
context: props.context || {},
|
|
3115
3099
|
localState: void 0,
|
|
3116
|
-
rootState: state.
|
|
3100
|
+
rootState: state.builderContextSignal.rootState,
|
|
3117
3101
|
rootSetState: contentSetState.bind(null, props, state, elementRef)
|
|
3118
3102
|
}));
|
|
3119
3103
|
};
|
|
3120
3104
|
const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
|
|
3121
3105
|
fetch$1(url).then((response) => response.json()).then((json) => {
|
|
3122
3106
|
const newState = {
|
|
3123
|
-
...state.
|
|
3107
|
+
...state.builderContextSignal.rootState,
|
|
3124
3108
|
[key]: json
|
|
3125
3109
|
};
|
|
3126
3110
|
contentSetState(props, state, elementRef, newState);
|
|
@@ -3129,7 +3113,7 @@ const handleRequest = function handleRequest2(props, state, elementRef, { url, k
|
|
|
3129
3113
|
});
|
|
3130
3114
|
};
|
|
3131
3115
|
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
3132
|
-
const requests = state.
|
|
3116
|
+
const requests = state.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
3133
3117
|
Object.entries(requests).forEach(([key, url]) => {
|
|
3134
3118
|
if (url && (!state.httpReqsData[key] || isEditing())) {
|
|
3135
3119
|
const evaluatedUrl = evalExpression(props, state, elementRef, url);
|
|
@@ -3144,7 +3128,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3144
3128
|
if (isEditing())
|
|
3145
3129
|
window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
|
|
3146
3130
|
detail: {
|
|
3147
|
-
state: state.
|
|
3131
|
+
state: state.builderContextSignal.rootState,
|
|
3148
3132
|
ref: {
|
|
3149
3133
|
name: props.model
|
|
3150
3134
|
}
|
|
@@ -3155,24 +3139,36 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3155
3139
|
qwik._jsxBranch();
|
|
3156
3140
|
const elementRef = qwik.useSignal();
|
|
3157
3141
|
const state = qwik.useStore({
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3142
|
+
builderContextSignal: {
|
|
3143
|
+
content: getContentInitialValue({
|
|
3144
|
+
content: props.content,
|
|
3145
|
+
data: props.data
|
|
3146
|
+
}),
|
|
3147
|
+
localState: void 0,
|
|
3148
|
+
rootState: getContextStateInitialValue({
|
|
3149
|
+
content: props.content,
|
|
3150
|
+
data: props.data,
|
|
3151
|
+
locale: props.locale
|
|
3152
|
+
}),
|
|
3153
|
+
rootSetState: void 0,
|
|
3154
|
+
context: props.context || {},
|
|
3155
|
+
apiKey: props.apiKey,
|
|
3156
|
+
apiVersion: props.apiVersion,
|
|
3157
|
+
registeredComponents: [
|
|
3158
|
+
...getDefaultRegisteredComponents(),
|
|
3159
|
+
...components,
|
|
3160
|
+
...props.customComponents || []
|
|
3161
|
+
].reduce((acc, { component, ...curr }) => ({
|
|
3162
|
+
...acc,
|
|
3163
|
+
[curr.name]: {
|
|
3164
|
+
component,
|
|
3165
|
+
...curr
|
|
3166
|
+
}
|
|
3167
|
+
}), {}),
|
|
3168
|
+
inheritedStyles: {}
|
|
3169
|
+
},
|
|
3169
3170
|
canTrackToUse: checkIsDefined(props.canTrack) ? props.canTrack : true,
|
|
3170
3171
|
clicked: false,
|
|
3171
|
-
contentState: getContextStateInitialValue({
|
|
3172
|
-
content: props.content,
|
|
3173
|
-
data: props.data,
|
|
3174
|
-
locale: props.locale
|
|
3175
|
-
}),
|
|
3176
3172
|
forceReRenderCount: 0,
|
|
3177
3173
|
httpReqsData: {},
|
|
3178
3174
|
overrideContent: null,
|
|
@@ -3180,25 +3176,11 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3180
3176
|
contentId: props.content?.id,
|
|
3181
3177
|
parentContentId: props.parentContentId
|
|
3182
3178
|
}),
|
|
3183
|
-
update: 0
|
|
3184
|
-
useContent: getContentInitialValue({
|
|
3185
|
-
content: props.content,
|
|
3186
|
-
data: props.data
|
|
3187
|
-
})
|
|
3179
|
+
update: 0
|
|
3188
3180
|
}, {
|
|
3189
3181
|
deep: true
|
|
3190
3182
|
});
|
|
3191
|
-
qwik.useContextProvider(BuilderContext,
|
|
3192
|
-
content: state.useContent,
|
|
3193
|
-
localState: void 0,
|
|
3194
|
-
rootState: state.contentState,
|
|
3195
|
-
rootSetState: void 0,
|
|
3196
|
-
context: props.context || {},
|
|
3197
|
-
apiKey: props.apiKey,
|
|
3198
|
-
apiVersion: props.apiVersion,
|
|
3199
|
-
registeredComponents: state.allRegisteredComponents,
|
|
3200
|
-
inheritedStyles: {}
|
|
3201
|
-
}));
|
|
3183
|
+
qwik.useContextProvider(BuilderContext, state.builderContextSignal);
|
|
3202
3184
|
qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3203
3185
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3204
3186
|
if (!props2.apiKey)
|
|
@@ -3218,16 +3200,16 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3218
3200
|
enrich: props2.enrich
|
|
3219
3201
|
} : {}
|
|
3220
3202
|
});
|
|
3221
|
-
Object.values(state2.
|
|
3203
|
+
Object.values(state2.builderContextSignal.registeredComponents).forEach((registeredComponent) => {
|
|
3222
3204
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
3223
3205
|
window.parent?.postMessage(message, "*");
|
|
3224
3206
|
});
|
|
3225
3207
|
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
3226
3208
|
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
3227
3209
|
}
|
|
3228
|
-
if (state2.
|
|
3229
|
-
const variationId = state2.
|
|
3230
|
-
const contentId = state2.
|
|
3210
|
+
if (state2.builderContextSignal.content) {
|
|
3211
|
+
const variationId = state2.builderContextSignal.content?.testVariationId;
|
|
3212
|
+
const contentId = state2.builderContextSignal.content?.id;
|
|
3231
3213
|
_track({
|
|
3232
3214
|
type: "impression",
|
|
3233
3215
|
canTrack: state2.canTrackToUse,
|
|
@@ -3272,8 +3254,8 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3272
3254
|
]));
|
|
3273
3255
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
3274
3256
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3275
|
-
track2(() => state2.
|
|
3276
|
-
track2(() => state2.
|
|
3257
|
+
track2(() => state2.builderContextSignal.content?.data?.jsCode);
|
|
3258
|
+
track2(() => state2.builderContextSignal.rootState);
|
|
3277
3259
|
evaluateJsCode(props2, state2, elementRef2);
|
|
3278
3260
|
}, "RenderContent_component_useTask_1_X59YMGOetns", [
|
|
3279
3261
|
elementRef,
|
|
@@ -3282,7 +3264,7 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3282
3264
|
]));
|
|
3283
3265
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
3284
3266
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3285
|
-
track2(() => state2.
|
|
3267
|
+
track2(() => state2.builderContextSignal.content?.data?.httpRequests);
|
|
3286
3268
|
runHttpRequests(props2, state2, elementRef2);
|
|
3287
3269
|
}, "RenderContent_component_useTask_2_u3gn3Pj2b2s", [
|
|
3288
3270
|
elementRef,
|
|
@@ -3291,7 +3273,7 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3291
3273
|
]));
|
|
3292
3274
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
3293
3275
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3294
|
-
track2(() => state2.
|
|
3276
|
+
track2(() => state2.builderContextSignal.rootState);
|
|
3295
3277
|
emitStateUpdate(props2, state2);
|
|
3296
3278
|
}, "RenderContent_component_useTask_3_xLCHvjhJYRM", [
|
|
3297
3279
|
elementRef,
|
|
@@ -3299,7 +3281,7 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3299
3281
|
state
|
|
3300
3282
|
]));
|
|
3301
3283
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
3302
|
-
children: state.
|
|
3284
|
+
children: state.builderContextSignal.content ? /* @__PURE__ */ qwik._jsxS("div", {
|
|
3303
3285
|
ref: elementRef,
|
|
3304
3286
|
...{},
|
|
3305
3287
|
...props.hideContent ? {
|
|
@@ -3314,34 +3296,34 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3314
3296
|
}, null, 3, "03_0") : null,
|
|
3315
3297
|
/* @__PURE__ */ qwik._jsxC(RenderContentStyles, {
|
|
3316
3298
|
get contentId() {
|
|
3317
|
-
return state.
|
|
3299
|
+
return state.builderContextSignal.content?.id;
|
|
3318
3300
|
},
|
|
3319
3301
|
get cssCode() {
|
|
3320
|
-
return state.
|
|
3302
|
+
return state.builderContextSignal.content?.data?.cssCode;
|
|
3321
3303
|
},
|
|
3322
3304
|
get customFonts() {
|
|
3323
|
-
return state.
|
|
3305
|
+
return state.builderContextSignal.content?.data?.customFonts;
|
|
3324
3306
|
},
|
|
3325
3307
|
[qwik._IMMUTABLE]: {
|
|
3326
|
-
contentId: qwik._fnSignal((p0) => p0.
|
|
3308
|
+
contentId: qwik._fnSignal((p0) => p0.builderContextSignal.content?.id, [
|
|
3327
3309
|
state
|
|
3328
|
-
], "p0.
|
|
3329
|
-
cssCode: qwik._fnSignal((p0) => p0.
|
|
3310
|
+
], "p0.builderContextSignal.content?.id"),
|
|
3311
|
+
cssCode: qwik._fnSignal((p0) => p0.builderContextSignal.content?.data?.cssCode, [
|
|
3330
3312
|
state
|
|
3331
|
-
], "p0.
|
|
3332
|
-
customFonts: qwik._fnSignal((p0) => p0.
|
|
3313
|
+
], "p0.builderContextSignal.content?.data?.cssCode"),
|
|
3314
|
+
customFonts: qwik._fnSignal((p0) => p0.builderContextSignal.content?.data?.customFonts, [
|
|
3333
3315
|
state
|
|
3334
|
-
], "p0.
|
|
3316
|
+
], "p0.builderContextSignal.content?.data?.customFonts")
|
|
3335
3317
|
}
|
|
3336
3318
|
}, 3, "03_1"),
|
|
3337
3319
|
/* @__PURE__ */ qwik._jsxC(RenderBlocks, {
|
|
3338
3320
|
get blocks() {
|
|
3339
|
-
return state.
|
|
3321
|
+
return state.builderContextSignal.content?.data?.blocks;
|
|
3340
3322
|
},
|
|
3341
3323
|
[qwik._IMMUTABLE]: {
|
|
3342
|
-
blocks: qwik._fnSignal((p0) => p0.
|
|
3324
|
+
blocks: qwik._fnSignal((p0) => p0.builderContextSignal.content?.data?.blocks, [
|
|
3343
3325
|
state
|
|
3344
|
-
], "p0.
|
|
3326
|
+
], "p0.builderContextSignal.content?.data?.blocks")
|
|
3345
3327
|
}
|
|
3346
3328
|
}, 3, state.forceReRenderCount)
|
|
3347
3329
|
],
|
|
@@ -3354,9 +3336,9 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3354
3336
|
state
|
|
3355
3337
|
])
|
|
3356
3338
|
}, {
|
|
3357
|
-
"builder-content-id": qwik._fnSignal((p0) => p0.
|
|
3339
|
+
"builder-content-id": qwik._fnSignal((p0) => p0.builderContextSignal.content?.id, [
|
|
3358
3340
|
state
|
|
3359
|
-
], "p0.
|
|
3341
|
+
], "p0.builderContextSignal.content?.id"),
|
|
3360
3342
|
"builder-model": qwik._fnSignal((p0) => p0.model, [
|
|
3361
3343
|
props
|
|
3362
3344
|
], "p0.model"),
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, _wrapProp,
|
|
1
|
+
import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, _wrapProp, useStore, useContextProvider, useContext, Slot, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
4
4
|
useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
|
|
@@ -454,38 +454,32 @@ const RenderComponent = (props) => {
|
|
|
454
454
|
}, 1, "R9_1");
|
|
455
455
|
};
|
|
456
456
|
const RenderRepeatedBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
rootSetState: props.repeatContext.rootSetState,
|
|
462
|
-
context: props.repeatContext.context,
|
|
463
|
-
apiKey: props.repeatContext.apiKey,
|
|
464
|
-
registeredComponents: props.repeatContext.registeredComponents,
|
|
465
|
-
inheritedStyles: props.repeatContext.inheritedStyles,
|
|
466
|
-
apiVersion: props.repeatContext.apiVersion
|
|
467
|
-
}));
|
|
457
|
+
const state = useStore({
|
|
458
|
+
store: props.repeatContext
|
|
459
|
+
});
|
|
460
|
+
useContextProvider(BuilderContext, state.store);
|
|
468
461
|
return /* @__PURE__ */ _jsxC(RenderBlock, {
|
|
469
462
|
get block() {
|
|
470
463
|
return props.block;
|
|
471
464
|
},
|
|
472
465
|
get context() {
|
|
473
|
-
return
|
|
466
|
+
return state.store;
|
|
474
467
|
},
|
|
475
468
|
[_IMMUTABLE]: {
|
|
476
469
|
block: _fnSignal((p0) => p0.block, [
|
|
477
470
|
props
|
|
478
471
|
], "p0.block"),
|
|
479
|
-
context: _fnSignal((p0) => p0.
|
|
480
|
-
|
|
481
|
-
], "p0.
|
|
472
|
+
context: _fnSignal((p0) => p0.store, [
|
|
473
|
+
state
|
|
474
|
+
], "p0.store")
|
|
482
475
|
}
|
|
483
476
|
}, 3, "K5_0");
|
|
484
477
|
}, "RenderRepeatedBlock_component_nRyVBtbGKc8"));
|
|
485
478
|
const RenderBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
486
479
|
_jsxBranch();
|
|
487
480
|
const state = useStore({
|
|
488
|
-
Tag: props.block.tagName || "div"
|
|
481
|
+
Tag: props.block.tagName || "div",
|
|
482
|
+
childrenContext: props.context
|
|
489
483
|
});
|
|
490
484
|
const component = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
491
485
|
const [props2] = useLexicalScope();
|
|
@@ -562,29 +556,8 @@ const RenderBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
562
556
|
repeatItem,
|
|
563
557
|
useBlock
|
|
564
558
|
]));
|
|
565
|
-
const childrenContext = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
566
|
-
const [attributes2, props2, useBlock2] = useLexicalScope();
|
|
567
|
-
const getInheritedTextStyles = () => {
|
|
568
|
-
return {};
|
|
569
|
-
};
|
|
570
|
-
return {
|
|
571
|
-
apiKey: props2.context.apiKey,
|
|
572
|
-
apiVersion: props2.context.apiVersion,
|
|
573
|
-
localState: props2.context.localState,
|
|
574
|
-
rootState: props2.context.rootState,
|
|
575
|
-
rootSetState: props2.context.rootSetState,
|
|
576
|
-
content: props2.context.content,
|
|
577
|
-
context: props2.context.context,
|
|
578
|
-
registeredComponents: props2.context.registeredComponents,
|
|
579
|
-
inheritedStyles: getInheritedTextStyles()
|
|
580
|
-
};
|
|
581
|
-
}, "RenderBlock_component_childrenContext_useComputed_gskFnyBnHDI", [
|
|
582
|
-
attributes,
|
|
583
|
-
props,
|
|
584
|
-
useBlock
|
|
585
|
-
]));
|
|
586
559
|
const renderComponentProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
587
|
-
const [actions2, attributes2,
|
|
560
|
+
const [actions2, attributes2, component2, state2, useBlock2] = useLexicalScope();
|
|
588
561
|
return {
|
|
589
562
|
blockChildren: useBlock2.value.children ?? [],
|
|
590
563
|
componentRef: component2.value?.component,
|
|
@@ -597,13 +570,13 @@ const RenderBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
597
570
|
}
|
|
598
571
|
}
|
|
599
572
|
},
|
|
600
|
-
context:
|
|
573
|
+
context: state2.childrenContext
|
|
601
574
|
};
|
|
602
575
|
}, "RenderBlock_component_renderComponentProps_useComputed_tWa1cp0r7XY", [
|
|
603
576
|
actions,
|
|
604
577
|
attributes,
|
|
605
|
-
childrenContext,
|
|
606
578
|
component,
|
|
579
|
+
state,
|
|
607
580
|
useBlock
|
|
608
581
|
]));
|
|
609
582
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
@@ -638,12 +611,12 @@ const RenderBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
638
611
|
return /* @__PURE__ */ _jsxC(RenderBlock, {
|
|
639
612
|
block: child,
|
|
640
613
|
get context() {
|
|
641
|
-
return childrenContext
|
|
614
|
+
return state.childrenContext;
|
|
642
615
|
},
|
|
643
616
|
[_IMMUTABLE]: {
|
|
644
|
-
context: _fnSignal((p0) => p0.
|
|
645
|
-
|
|
646
|
-
], "p0.
|
|
617
|
+
context: _fnSignal((p0) => p0.childrenContext, [
|
|
618
|
+
state
|
|
619
|
+
], "p0.childrenContext")
|
|
647
620
|
}
|
|
648
621
|
}, 3, "render-block-" + child.id);
|
|
649
622
|
}),
|
|
@@ -651,12 +624,12 @@ const RenderBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
651
624
|
return /* @__PURE__ */ _jsxC(BlockStyles, {
|
|
652
625
|
block: child,
|
|
653
626
|
get context() {
|
|
654
|
-
return childrenContext
|
|
627
|
+
return state.childrenContext;
|
|
655
628
|
},
|
|
656
629
|
[_IMMUTABLE]: {
|
|
657
|
-
context: _fnSignal((p0) => p0.
|
|
658
|
-
|
|
659
|
-
], "p0.
|
|
630
|
+
context: _fnSignal((p0) => p0.childrenContext, [
|
|
631
|
+
state
|
|
632
|
+
], "p0.childrenContext")
|
|
660
633
|
}
|
|
661
634
|
}, 3, "block-style-" + child.id);
|
|
662
635
|
})
|
|
@@ -714,6 +687,14 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
714
687
|
builderContext,
|
|
715
688
|
props,
|
|
716
689
|
state
|
|
690
|
+
]),
|
|
691
|
+
onKeyPress$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
692
|
+
const [builderContext2, props2, state2] = useLexicalScope();
|
|
693
|
+
return onClick$1(props2);
|
|
694
|
+
}, "RenderBlocks_component_div_onKeyPress_N5bJZwtuEmI", [
|
|
695
|
+
builderContext,
|
|
696
|
+
props,
|
|
697
|
+
state
|
|
717
698
|
])
|
|
718
699
|
}, {
|
|
719
700
|
class: _fnSignal((p0) => p0.value + " div-RenderBlocks", [
|
|
@@ -1948,7 +1929,9 @@ const componentInfo$1 = {
|
|
|
1948
1929
|
"jpeg",
|
|
1949
1930
|
"jpg",
|
|
1950
1931
|
"png",
|
|
1951
|
-
"svg"
|
|
1932
|
+
"svg",
|
|
1933
|
+
"gif",
|
|
1934
|
+
"webp"
|
|
1952
1935
|
],
|
|
1953
1936
|
required: true
|
|
1954
1937
|
}
|
|
@@ -2669,7 +2652,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
2669
2652
|
}
|
|
2670
2653
|
};
|
|
2671
2654
|
};
|
|
2672
|
-
const SDK_VERSION = "0.4.
|
|
2655
|
+
const SDK_VERSION = "0.4.3";
|
|
2673
2656
|
const registry = {};
|
|
2674
2657
|
function register(type, info) {
|
|
2675
2658
|
let typeList = registry[type];
|
|
@@ -2903,7 +2886,8 @@ function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2)
|
|
|
2903
2886
|
}
|
|
2904
2887
|
return;
|
|
2905
2888
|
}
|
|
2906
|
-
const
|
|
2889
|
+
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
|
|
2890
|
+
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
2907
2891
|
const AB_TEST_FN_NAME = "bldrAbTest";
|
|
2908
2892
|
const CONTENT_FN_NAME = "bldrCntntScrpt";
|
|
2909
2893
|
const getVariantsScriptString = (variants, contentId) => {
|
|
@@ -3026,31 +3010,31 @@ const getContentInitialValue = ({ content, data }) => {
|
|
|
3026
3010
|
};
|
|
3027
3011
|
};
|
|
3028
3012
|
const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
|
|
3029
|
-
state.
|
|
3030
|
-
...state.
|
|
3013
|
+
state.builderContextSignal.content = {
|
|
3014
|
+
...state.builderContextSignal.content,
|
|
3031
3015
|
...newContent,
|
|
3032
3016
|
data: {
|
|
3033
|
-
...state.
|
|
3017
|
+
...state.builderContextSignal.content?.data,
|
|
3034
3018
|
...newContent?.data
|
|
3035
3019
|
},
|
|
3036
3020
|
meta: {
|
|
3037
|
-
...state.
|
|
3021
|
+
...state.builderContextSignal.content?.meta,
|
|
3038
3022
|
...newContent?.meta,
|
|
3039
|
-
breakpoints: newContent?.meta?.breakpoints || state.
|
|
3023
|
+
breakpoints: newContent?.meta?.breakpoints || state.builderContextSignal.content?.meta?.breakpoints
|
|
3040
3024
|
}
|
|
3041
3025
|
};
|
|
3042
3026
|
};
|
|
3043
3027
|
const setBreakpoints = function setBreakpoints2(props, state, elementRef, breakpoints) {
|
|
3044
|
-
state.
|
|
3045
|
-
...state.
|
|
3028
|
+
state.builderContextSignal.content = {
|
|
3029
|
+
...state.builderContextSignal.content,
|
|
3046
3030
|
meta: {
|
|
3047
|
-
...state.
|
|
3031
|
+
...state.builderContextSignal.content?.meta,
|
|
3048
3032
|
breakpoints
|
|
3049
3033
|
}
|
|
3050
3034
|
};
|
|
3051
3035
|
};
|
|
3052
3036
|
const contentSetState = function contentSetState2(props, state, elementRef, newRootState) {
|
|
3053
|
-
state.
|
|
3037
|
+
state.builderContextSignal.rootState = newRootState;
|
|
3054
3038
|
};
|
|
3055
3039
|
const processMessage = function processMessage2(props, state, elementRef, event) {
|
|
3056
3040
|
const { data } = event;
|
|
@@ -3059,7 +3043,7 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
3059
3043
|
case "builder.configureSdk": {
|
|
3060
3044
|
const messageContent = data.data;
|
|
3061
3045
|
const { breakpoints, contentId } = messageContent;
|
|
3062
|
-
if (!contentId || contentId !== state.
|
|
3046
|
+
if (!contentId || contentId !== state.builderContextSignal.content?.id)
|
|
3063
3047
|
return;
|
|
3064
3048
|
if (breakpoints)
|
|
3065
3049
|
setBreakpoints(props, state, elementRef, breakpoints);
|
|
@@ -3079,20 +3063,20 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
3079
3063
|
}
|
|
3080
3064
|
};
|
|
3081
3065
|
const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
3082
|
-
const jsCode = state.
|
|
3066
|
+
const jsCode = state.builderContextSignal.content?.data?.jsCode;
|
|
3083
3067
|
if (jsCode)
|
|
3084
3068
|
evaluate({
|
|
3085
3069
|
code: jsCode,
|
|
3086
3070
|
context: props.context || {},
|
|
3087
3071
|
localState: void 0,
|
|
3088
|
-
rootState: state.
|
|
3072
|
+
rootState: state.builderContextSignal.rootState,
|
|
3089
3073
|
rootSetState: contentSetState.bind(null, props, state, elementRef)
|
|
3090
3074
|
});
|
|
3091
3075
|
};
|
|
3092
3076
|
const onClick = function onClick22(props, state, elementRef, event) {
|
|
3093
|
-
if (state.
|
|
3094
|
-
const variationId = state.
|
|
3095
|
-
const contentId = state.
|
|
3077
|
+
if (state.builderContextSignal.content) {
|
|
3078
|
+
const variationId = state.builderContextSignal.content?.testVariationId;
|
|
3079
|
+
const contentId = state.builderContextSignal.content?.id;
|
|
3096
3080
|
_track({
|
|
3097
3081
|
type: "click",
|
|
3098
3082
|
canTrack: state.canTrackToUse,
|
|
@@ -3111,14 +3095,14 @@ const evalExpression = function evalExpression2(props, state, elementRef, expres
|
|
|
3111
3095
|
code: group,
|
|
3112
3096
|
context: props.context || {},
|
|
3113
3097
|
localState: void 0,
|
|
3114
|
-
rootState: state.
|
|
3098
|
+
rootState: state.builderContextSignal.rootState,
|
|
3115
3099
|
rootSetState: contentSetState.bind(null, props, state, elementRef)
|
|
3116
3100
|
}));
|
|
3117
3101
|
};
|
|
3118
3102
|
const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
|
|
3119
3103
|
fetch$1(url).then((response) => response.json()).then((json) => {
|
|
3120
3104
|
const newState = {
|
|
3121
|
-
...state.
|
|
3105
|
+
...state.builderContextSignal.rootState,
|
|
3122
3106
|
[key]: json
|
|
3123
3107
|
};
|
|
3124
3108
|
contentSetState(props, state, elementRef, newState);
|
|
@@ -3127,7 +3111,7 @@ const handleRequest = function handleRequest2(props, state, elementRef, { url, k
|
|
|
3127
3111
|
});
|
|
3128
3112
|
};
|
|
3129
3113
|
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
3130
|
-
const requests = state.
|
|
3114
|
+
const requests = state.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
3131
3115
|
Object.entries(requests).forEach(([key, url]) => {
|
|
3132
3116
|
if (url && (!state.httpReqsData[key] || isEditing())) {
|
|
3133
3117
|
const evaluatedUrl = evalExpression(props, state, elementRef, url);
|
|
@@ -3142,7 +3126,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3142
3126
|
if (isEditing())
|
|
3143
3127
|
window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
|
|
3144
3128
|
detail: {
|
|
3145
|
-
state: state.
|
|
3129
|
+
state: state.builderContextSignal.rootState,
|
|
3146
3130
|
ref: {
|
|
3147
3131
|
name: props.model
|
|
3148
3132
|
}
|
|
@@ -3153,24 +3137,36 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3153
3137
|
_jsxBranch();
|
|
3154
3138
|
const elementRef = useSignal();
|
|
3155
3139
|
const state = useStore({
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3140
|
+
builderContextSignal: {
|
|
3141
|
+
content: getContentInitialValue({
|
|
3142
|
+
content: props.content,
|
|
3143
|
+
data: props.data
|
|
3144
|
+
}),
|
|
3145
|
+
localState: void 0,
|
|
3146
|
+
rootState: getContextStateInitialValue({
|
|
3147
|
+
content: props.content,
|
|
3148
|
+
data: props.data,
|
|
3149
|
+
locale: props.locale
|
|
3150
|
+
}),
|
|
3151
|
+
rootSetState: void 0,
|
|
3152
|
+
context: props.context || {},
|
|
3153
|
+
apiKey: props.apiKey,
|
|
3154
|
+
apiVersion: props.apiVersion,
|
|
3155
|
+
registeredComponents: [
|
|
3156
|
+
...getDefaultRegisteredComponents(),
|
|
3157
|
+
...components,
|
|
3158
|
+
...props.customComponents || []
|
|
3159
|
+
].reduce((acc, { component, ...curr }) => ({
|
|
3160
|
+
...acc,
|
|
3161
|
+
[curr.name]: {
|
|
3162
|
+
component,
|
|
3163
|
+
...curr
|
|
3164
|
+
}
|
|
3165
|
+
}), {}),
|
|
3166
|
+
inheritedStyles: {}
|
|
3167
|
+
},
|
|
3167
3168
|
canTrackToUse: checkIsDefined(props.canTrack) ? props.canTrack : true,
|
|
3168
3169
|
clicked: false,
|
|
3169
|
-
contentState: getContextStateInitialValue({
|
|
3170
|
-
content: props.content,
|
|
3171
|
-
data: props.data,
|
|
3172
|
-
locale: props.locale
|
|
3173
|
-
}),
|
|
3174
3170
|
forceReRenderCount: 0,
|
|
3175
3171
|
httpReqsData: {},
|
|
3176
3172
|
overrideContent: null,
|
|
@@ -3178,25 +3174,11 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3178
3174
|
contentId: props.content?.id,
|
|
3179
3175
|
parentContentId: props.parentContentId
|
|
3180
3176
|
}),
|
|
3181
|
-
update: 0
|
|
3182
|
-
useContent: getContentInitialValue({
|
|
3183
|
-
content: props.content,
|
|
3184
|
-
data: props.data
|
|
3185
|
-
})
|
|
3177
|
+
update: 0
|
|
3186
3178
|
}, {
|
|
3187
3179
|
deep: true
|
|
3188
3180
|
});
|
|
3189
|
-
useContextProvider(BuilderContext,
|
|
3190
|
-
content: state.useContent,
|
|
3191
|
-
localState: void 0,
|
|
3192
|
-
rootState: state.contentState,
|
|
3193
|
-
rootSetState: void 0,
|
|
3194
|
-
context: props.context || {},
|
|
3195
|
-
apiKey: props.apiKey,
|
|
3196
|
-
apiVersion: props.apiVersion,
|
|
3197
|
-
registeredComponents: state.allRegisteredComponents,
|
|
3198
|
-
inheritedStyles: {}
|
|
3199
|
-
}));
|
|
3181
|
+
useContextProvider(BuilderContext, state.builderContextSignal);
|
|
3200
3182
|
useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
3201
3183
|
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3202
3184
|
if (!props2.apiKey)
|
|
@@ -3216,16 +3198,16 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3216
3198
|
enrich: props2.enrich
|
|
3217
3199
|
} : {}
|
|
3218
3200
|
});
|
|
3219
|
-
Object.values(state2.
|
|
3201
|
+
Object.values(state2.builderContextSignal.registeredComponents).forEach((registeredComponent) => {
|
|
3220
3202
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
3221
3203
|
window.parent?.postMessage(message, "*");
|
|
3222
3204
|
});
|
|
3223
3205
|
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
3224
3206
|
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
3225
3207
|
}
|
|
3226
|
-
if (state2.
|
|
3227
|
-
const variationId = state2.
|
|
3228
|
-
const contentId = state2.
|
|
3208
|
+
if (state2.builderContextSignal.content) {
|
|
3209
|
+
const variationId = state2.builderContextSignal.content?.testVariationId;
|
|
3210
|
+
const contentId = state2.builderContextSignal.content?.id;
|
|
3229
3211
|
_track({
|
|
3230
3212
|
type: "impression",
|
|
3231
3213
|
canTrack: state2.canTrackToUse,
|
|
@@ -3270,8 +3252,8 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3270
3252
|
]));
|
|
3271
3253
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
|
|
3272
3254
|
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3273
|
-
track2(() => state2.
|
|
3274
|
-
track2(() => state2.
|
|
3255
|
+
track2(() => state2.builderContextSignal.content?.data?.jsCode);
|
|
3256
|
+
track2(() => state2.builderContextSignal.rootState);
|
|
3275
3257
|
evaluateJsCode(props2, state2, elementRef2);
|
|
3276
3258
|
}, "RenderContent_component_useTask_1_X59YMGOetns", [
|
|
3277
3259
|
elementRef,
|
|
@@ -3280,7 +3262,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3280
3262
|
]));
|
|
3281
3263
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
|
|
3282
3264
|
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3283
|
-
track2(() => state2.
|
|
3265
|
+
track2(() => state2.builderContextSignal.content?.data?.httpRequests);
|
|
3284
3266
|
runHttpRequests(props2, state2, elementRef2);
|
|
3285
3267
|
}, "RenderContent_component_useTask_2_u3gn3Pj2b2s", [
|
|
3286
3268
|
elementRef,
|
|
@@ -3289,7 +3271,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3289
3271
|
]));
|
|
3290
3272
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
|
|
3291
3273
|
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3292
|
-
track2(() => state2.
|
|
3274
|
+
track2(() => state2.builderContextSignal.rootState);
|
|
3293
3275
|
emitStateUpdate(props2, state2);
|
|
3294
3276
|
}, "RenderContent_component_useTask_3_xLCHvjhJYRM", [
|
|
3295
3277
|
elementRef,
|
|
@@ -3297,7 +3279,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3297
3279
|
state
|
|
3298
3280
|
]));
|
|
3299
3281
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
3300
|
-
children: state.
|
|
3282
|
+
children: state.builderContextSignal.content ? /* @__PURE__ */ _jsxS("div", {
|
|
3301
3283
|
ref: elementRef,
|
|
3302
3284
|
...{},
|
|
3303
3285
|
...props.hideContent ? {
|
|
@@ -3312,34 +3294,34 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3312
3294
|
}, null, 3, "03_0") : null,
|
|
3313
3295
|
/* @__PURE__ */ _jsxC(RenderContentStyles, {
|
|
3314
3296
|
get contentId() {
|
|
3315
|
-
return state.
|
|
3297
|
+
return state.builderContextSignal.content?.id;
|
|
3316
3298
|
},
|
|
3317
3299
|
get cssCode() {
|
|
3318
|
-
return state.
|
|
3300
|
+
return state.builderContextSignal.content?.data?.cssCode;
|
|
3319
3301
|
},
|
|
3320
3302
|
get customFonts() {
|
|
3321
|
-
return state.
|
|
3303
|
+
return state.builderContextSignal.content?.data?.customFonts;
|
|
3322
3304
|
},
|
|
3323
3305
|
[_IMMUTABLE]: {
|
|
3324
|
-
contentId: _fnSignal((p0) => p0.
|
|
3306
|
+
contentId: _fnSignal((p0) => p0.builderContextSignal.content?.id, [
|
|
3325
3307
|
state
|
|
3326
|
-
], "p0.
|
|
3327
|
-
cssCode: _fnSignal((p0) => p0.
|
|
3308
|
+
], "p0.builderContextSignal.content?.id"),
|
|
3309
|
+
cssCode: _fnSignal((p0) => p0.builderContextSignal.content?.data?.cssCode, [
|
|
3328
3310
|
state
|
|
3329
|
-
], "p0.
|
|
3330
|
-
customFonts: _fnSignal((p0) => p0.
|
|
3311
|
+
], "p0.builderContextSignal.content?.data?.cssCode"),
|
|
3312
|
+
customFonts: _fnSignal((p0) => p0.builderContextSignal.content?.data?.customFonts, [
|
|
3331
3313
|
state
|
|
3332
|
-
], "p0.
|
|
3314
|
+
], "p0.builderContextSignal.content?.data?.customFonts")
|
|
3333
3315
|
}
|
|
3334
3316
|
}, 3, "03_1"),
|
|
3335
3317
|
/* @__PURE__ */ _jsxC(RenderBlocks, {
|
|
3336
3318
|
get blocks() {
|
|
3337
|
-
return state.
|
|
3319
|
+
return state.builderContextSignal.content?.data?.blocks;
|
|
3338
3320
|
},
|
|
3339
3321
|
[_IMMUTABLE]: {
|
|
3340
|
-
blocks: _fnSignal((p0) => p0.
|
|
3322
|
+
blocks: _fnSignal((p0) => p0.builderContextSignal.content?.data?.blocks, [
|
|
3341
3323
|
state
|
|
3342
|
-
], "p0.
|
|
3324
|
+
], "p0.builderContextSignal.content?.data?.blocks")
|
|
3343
3325
|
}
|
|
3344
3326
|
}, 3, state.forceReRenderCount)
|
|
3345
3327
|
],
|
|
@@ -3352,9 +3334,9 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3352
3334
|
state
|
|
3353
3335
|
])
|
|
3354
3336
|
}, {
|
|
3355
|
-
"builder-content-id": _fnSignal((p0) => p0.
|
|
3337
|
+
"builder-content-id": _fnSignal((p0) => p0.builderContextSignal.content?.id, [
|
|
3356
3338
|
state
|
|
3357
|
-
], "p0.
|
|
3339
|
+
], "p0.builderContextSignal.content?.id"),
|
|
3358
3340
|
"builder-model": _fnSignal((p0) => p0.model, [
|
|
3359
3341
|
props
|
|
3360
3342
|
], "p0.model"),
|
package/package.json
CHANGED
|
@@ -4,14 +4,5 @@ type Props = {
|
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
repeatContext: BuilderContextInterface;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
|
|
9
|
-
*
|
|
10
|
-
* ```vue
|
|
11
|
-
* <template>
|
|
12
|
-
* <slot></slot>
|
|
13
|
-
* </template>
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
7
|
export declare const RenderRepeatedBlock: import("@builder.io/qwik").Component<Props>;
|
|
17
8
|
export default RenderRepeatedBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.4.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.3";
|