@builder.io/sdk-qwik 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.qwik.cjs +523 -380
- package/lib/index.qwik.mjs +524 -381
- package/package.json +2 -2
- package/types/blocks/columns/columns.d.ts +0 -2
- package/types/blocks/image/image.d.ts +0 -9
- package/types/blocks/video/video.d.ts +0 -8
- package/types/components/render-block/block-styles.d.ts +1 -6
- package/types/components/render-block/render-block.d.ts +1 -43
- package/types/components/render-block/render-block.helpers.d.ts +1 -0
- package/types/components/render-blocks.d.ts +0 -1
- package/types/components/render-content-variants/helpers.d.ts +6 -0
- package/types/components/render-content-variants/render-content-variants.d.ts +3 -0
- package/types/components/render-inlined-styles.d.ts +1 -5
- package/types/functions/get-block-properties.d.ts +1 -0
- package/types/functions/get-content/index.d.ts +1 -1
- package/types/helpers/logger.d.ts +5 -0
- package/types/types/builder-content.d.ts +1 -1
- package/types/types/components.d.ts +1 -72
- package/types/types/input.d.ts +4 -0
package/lib/index.qwik.cjs
CHANGED
|
@@ -5,8 +5,11 @@ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
|
5
5
|
const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
6
6
|
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
|
|
7
7
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
8
|
-
children: props.link ? /* @__PURE__ */ qwik.
|
|
9
|
-
...props.attributes
|
|
8
|
+
children: props.link ? /* @__PURE__ */ qwik._jsxS("a", {
|
|
9
|
+
...props.attributes,
|
|
10
|
+
children: qwik._fnSignal((p0) => p0.text, [
|
|
11
|
+
props
|
|
12
|
+
], "p0.text")
|
|
10
13
|
}, {
|
|
11
14
|
role: "button",
|
|
12
15
|
href: qwik._fnSignal((p0) => p0.link, [
|
|
@@ -15,16 +18,15 @@ const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
|
|
|
15
18
|
target: qwik._fnSignal((p0) => p0.openLinkInNewTab ? "_blank" : void 0, [
|
|
16
19
|
props
|
|
17
20
|
], 'p0.openLinkInNewTab?"_blank":undefined')
|
|
18
|
-
},
|
|
19
|
-
props
|
|
20
|
-
], "p0.text"), 2, "jc_0") : /* @__PURE__ */ qwik._jsxQ("button", {
|
|
21
|
+
}, 0, "jc_0") : /* @__PURE__ */ qwik._jsxS("button", {
|
|
21
22
|
class: (() => {
|
|
22
23
|
props.attributes.class;
|
|
23
24
|
})(),
|
|
24
|
-
...props.attributes
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
...props.attributes,
|
|
26
|
+
children: qwik._fnSignal((p0) => p0.text, [
|
|
27
|
+
props
|
|
28
|
+
], "p0.text")
|
|
29
|
+
}, null, 0, null)
|
|
28
30
|
}, 1, "jc_1");
|
|
29
31
|
}, "Button_component_gJoMUICXoUQ"));
|
|
30
32
|
const STYLES$3 = `
|
|
@@ -161,8 +163,8 @@ const convertStyleMapToCSSArray = (style) => {
|
|
|
161
163
|
return cssProps.filter(checkIsDefined);
|
|
162
164
|
};
|
|
163
165
|
const convertStyleMapToCSS = (style) => convertStyleMapToCSSArray(style).join("\n");
|
|
164
|
-
const createCssClass = ({ mediaQuery, className
|
|
165
|
-
const cssClass = `.${
|
|
166
|
+
const createCssClass = ({ mediaQuery, className, styles }) => {
|
|
167
|
+
const cssClass = `.${className} {
|
|
166
168
|
${convertStyleMapToCSS(styles)}
|
|
167
169
|
}`;
|
|
168
170
|
if (mediaQuery)
|
|
@@ -172,69 +174,95 @@ const createCssClass = ({ mediaQuery, className: className3, styles }) => {
|
|
|
172
174
|
else
|
|
173
175
|
return cssClass;
|
|
174
176
|
};
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
const RenderInlinedStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
178
|
+
const tag = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
179
|
+
return "style";
|
|
180
|
+
}, "RenderInlinedStyles_component_tag_useComputed_S1nSc0C6qB4"));
|
|
181
|
+
qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
182
|
+
const [props2, tag2] = qwik.useLexicalScope();
|
|
183
|
+
return `<${tag2.value}>${props2.styles}</${tag2.value}>`;
|
|
184
|
+
}, "RenderInlinedStyles_component_injectedStyleScript_useComputed_CVKinNBYTxE", [
|
|
185
|
+
props,
|
|
186
|
+
tag
|
|
187
|
+
]));
|
|
181
188
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
182
|
-
children: /* @__PURE__ */ qwik._jsxQ("style", {
|
|
183
|
-
dangerouslySetInnerHTML: qwik.
|
|
184
|
-
|
|
189
|
+
children: /* @__PURE__ */ qwik._jsxQ("style", null, {
|
|
190
|
+
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.styles, [
|
|
191
|
+
props
|
|
192
|
+
], "p0.styles")
|
|
193
|
+
}, null, 3, "zz_0")
|
|
185
194
|
}, 1, "zz_2");
|
|
186
|
-
};
|
|
187
|
-
const
|
|
188
|
-
return getProcessedBlock({
|
|
189
|
-
block: props.block,
|
|
190
|
-
state: props.context.state,
|
|
191
|
-
context: props.context.context,
|
|
192
|
-
shouldEvaluateBindings: true
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
|
-
const canShowBlock$1 = function canShowBlock2(props, state) {
|
|
196
|
-
if (checkIsDefined(useBlock$1(props).hide))
|
|
197
|
-
return !useBlock$1(props).hide;
|
|
198
|
-
if (checkIsDefined(useBlock$1(props).show))
|
|
199
|
-
return useBlock$1(props).show;
|
|
200
|
-
return true;
|
|
201
|
-
};
|
|
202
|
-
const css = function css2(props, state) {
|
|
203
|
-
const styles = useBlock$1(props).responsiveStyles;
|
|
204
|
-
const content = props.context.content;
|
|
205
|
-
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
206
|
-
const largeStyles = styles?.large;
|
|
207
|
-
const mediumStyles = styles?.medium;
|
|
208
|
-
const smallStyles = styles?.small;
|
|
209
|
-
const className3 = useBlock$1(props).id;
|
|
210
|
-
const largeStylesClass = largeStyles ? createCssClass({
|
|
211
|
-
className: className3,
|
|
212
|
-
styles: largeStyles
|
|
213
|
-
}) : "";
|
|
214
|
-
const mediumStylesClass = mediumStyles ? createCssClass({
|
|
215
|
-
className: className3,
|
|
216
|
-
styles: mediumStyles,
|
|
217
|
-
mediaQuery: getMaxWidthQueryForSize("medium", sizesWithUpdatedBreakpoints)
|
|
218
|
-
}) : "";
|
|
219
|
-
const smallStylesClass = smallStyles ? createCssClass({
|
|
220
|
-
className: className3,
|
|
221
|
-
styles: smallStyles,
|
|
222
|
-
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
223
|
-
}) : "";
|
|
224
|
-
return [
|
|
225
|
-
largeStylesClass,
|
|
226
|
-
mediumStylesClass,
|
|
227
|
-
smallStylesClass
|
|
228
|
-
].join(" ");
|
|
229
|
-
};
|
|
230
|
-
const BlockStyles = (props) => {
|
|
195
|
+
}, "RenderInlinedStyles_component_ejNQtXd1ahM"));
|
|
196
|
+
const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
231
197
|
qwik._jsxBranch();
|
|
198
|
+
const useBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
199
|
+
const [props2] = qwik.useLexicalScope();
|
|
200
|
+
return getProcessedBlock({
|
|
201
|
+
block: props2.block,
|
|
202
|
+
state: props2.context.state,
|
|
203
|
+
context: props2.context.context,
|
|
204
|
+
shouldEvaluateBindings: true
|
|
205
|
+
});
|
|
206
|
+
}, "BlockStyles_component_useBlock_useComputed_9Y0pQBSnHds", [
|
|
207
|
+
props
|
|
208
|
+
]));
|
|
209
|
+
const canShowBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
210
|
+
const [useBlock2] = qwik.useLexicalScope();
|
|
211
|
+
if (checkIsDefined(useBlock2.value.hide))
|
|
212
|
+
return !useBlock2.value.hide;
|
|
213
|
+
if (checkIsDefined(useBlock2.value.show))
|
|
214
|
+
return useBlock2.value.show;
|
|
215
|
+
return true;
|
|
216
|
+
}, "BlockStyles_component_canShowBlock_useComputed_QhiYxJDtCJY", [
|
|
217
|
+
useBlock
|
|
218
|
+
]));
|
|
219
|
+
const css = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
220
|
+
const [props2, useBlock2] = qwik.useLexicalScope();
|
|
221
|
+
const styles = useBlock2.value.responsiveStyles;
|
|
222
|
+
const content = props2.context.content;
|
|
223
|
+
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
224
|
+
const largeStyles = styles?.large;
|
|
225
|
+
const mediumStyles = styles?.medium;
|
|
226
|
+
const smallStyles = styles?.small;
|
|
227
|
+
const className = useBlock2.value.id;
|
|
228
|
+
if (!className)
|
|
229
|
+
return "";
|
|
230
|
+
const largeStylesClass = largeStyles ? createCssClass({
|
|
231
|
+
className,
|
|
232
|
+
styles: largeStyles
|
|
233
|
+
}) : "";
|
|
234
|
+
const mediumStylesClass = mediumStyles ? createCssClass({
|
|
235
|
+
className,
|
|
236
|
+
styles: mediumStyles,
|
|
237
|
+
mediaQuery: getMaxWidthQueryForSize("medium", sizesWithUpdatedBreakpoints)
|
|
238
|
+
}) : "";
|
|
239
|
+
const smallStylesClass = smallStyles ? createCssClass({
|
|
240
|
+
className,
|
|
241
|
+
styles: smallStyles,
|
|
242
|
+
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
243
|
+
}) : "";
|
|
244
|
+
return [
|
|
245
|
+
largeStylesClass,
|
|
246
|
+
mediumStylesClass,
|
|
247
|
+
smallStylesClass
|
|
248
|
+
].join(" ");
|
|
249
|
+
}, "BlockStyles_component_css_useComputed_wAetZF3ncbo", [
|
|
250
|
+
props,
|
|
251
|
+
useBlock
|
|
252
|
+
]));
|
|
232
253
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
233
|
-
children: css
|
|
234
|
-
styles
|
|
254
|
+
children: css.value && canShowBlock.value ? /* @__PURE__ */ qwik._jsxC(RenderInlinedStyles, {
|
|
255
|
+
get styles() {
|
|
256
|
+
return css.value;
|
|
257
|
+
},
|
|
258
|
+
[qwik._IMMUTABLE]: {
|
|
259
|
+
styles: qwik._fnSignal((p0) => p0.value, [
|
|
260
|
+
css
|
|
261
|
+
], "p0.value")
|
|
262
|
+
}
|
|
235
263
|
}, 3, "LQ_0") : null
|
|
236
264
|
}, 1, "LQ_1");
|
|
237
|
-
};
|
|
265
|
+
}, "BlockStyles_component_r0t5qGxiwHA"));
|
|
238
266
|
function capitalizeFirstLetter(string) {
|
|
239
267
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
240
268
|
}
|
|
@@ -274,8 +302,14 @@ function getBlockComponentOptions(block) {
|
|
|
274
302
|
function transformBlockProperties(properties) {
|
|
275
303
|
return properties;
|
|
276
304
|
}
|
|
305
|
+
const extractRelevantRootBlockProperties = (block) => {
|
|
306
|
+
return {
|
|
307
|
+
href: block.href
|
|
308
|
+
};
|
|
309
|
+
};
|
|
277
310
|
function getBlockProperties(block) {
|
|
278
311
|
const properties = {
|
|
312
|
+
...extractRelevantRootBlockProperties(block),
|
|
279
313
|
...block.properties,
|
|
280
314
|
"builder-id": block.id,
|
|
281
315
|
style: getStyleAttribute(block.style),
|
|
@@ -303,9 +337,6 @@ function getStyleAttribute(style) {
|
|
|
303
337
|
return style;
|
|
304
338
|
}
|
|
305
339
|
}
|
|
306
|
-
function getBlockTag(block) {
|
|
307
|
-
return block.tagName || "div";
|
|
308
|
-
}
|
|
309
340
|
const EMPTY_HTML_ELEMENTS = [
|
|
310
341
|
"area",
|
|
311
342
|
"base",
|
|
@@ -372,6 +403,20 @@ const getRepeatItemData = ({ block, context }) => {
|
|
|
372
403
|
}));
|
|
373
404
|
return repeatArray;
|
|
374
405
|
};
|
|
406
|
+
const getProxyState = (context) => {
|
|
407
|
+
if (typeof Proxy === "undefined") {
|
|
408
|
+
console.error("no Proxy available in this environment, cannot proxy state.");
|
|
409
|
+
return context.state;
|
|
410
|
+
}
|
|
411
|
+
const useState = new Proxy(context.state, {
|
|
412
|
+
set: (obj, prop, value) => {
|
|
413
|
+
obj[prop] = value;
|
|
414
|
+
context.setState?.(obj);
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
return useState;
|
|
419
|
+
};
|
|
375
420
|
const RenderComponent = (props) => {
|
|
376
421
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
377
422
|
children: props.componentRef ? /* @__PURE__ */ qwik._jsxC(props.componentRef, {
|
|
@@ -429,111 +474,135 @@ const RenderRepeatedBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qw
|
|
|
429
474
|
}
|
|
430
475
|
}, 3, "K5_0");
|
|
431
476
|
}, "RenderRepeatedBlock_component_nRyVBtbGKc8"));
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
};
|
|
438
|
-
const tag = function tag22(props, state) {
|
|
439
|
-
return getBlockTag(useBlock(props));
|
|
440
|
-
};
|
|
441
|
-
const useBlock = function useBlock22(props, state) {
|
|
442
|
-
return repeatItemData(props) ? props.block : getProcessedBlock({
|
|
443
|
-
block: props.block,
|
|
444
|
-
state: props.context.state,
|
|
445
|
-
context: props.context.context,
|
|
446
|
-
shouldEvaluateBindings: true
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
const canShowBlock = function canShowBlock22(props, state) {
|
|
450
|
-
if (checkIsDefined(useBlock(props).hide))
|
|
451
|
-
return !useBlock(props).hide;
|
|
452
|
-
if (checkIsDefined(useBlock(props).show))
|
|
453
|
-
return useBlock(props).show;
|
|
454
|
-
return true;
|
|
455
|
-
};
|
|
456
|
-
const proxyState = function proxyState2(props, state) {
|
|
457
|
-
if (typeof Proxy === "undefined") {
|
|
458
|
-
console.error("no Proxy available in this environment, cannot proxy state.");
|
|
459
|
-
return props.context.state;
|
|
460
|
-
}
|
|
461
|
-
const useState = new Proxy(props.context.state, {
|
|
462
|
-
set: (obj, prop, value) => {
|
|
463
|
-
obj[prop] = value;
|
|
464
|
-
props.context.setState?.(obj);
|
|
465
|
-
return true;
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
return useState;
|
|
469
|
-
};
|
|
470
|
-
const actions = function actions2(props, state) {
|
|
471
|
-
return getBlockActions({
|
|
472
|
-
block: useBlock(props),
|
|
473
|
-
state: proxyState(props),
|
|
474
|
-
context: props.context.context
|
|
477
|
+
const RenderBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
478
|
+
qwik._jsxBranch();
|
|
479
|
+
const state = qwik.useStore({
|
|
480
|
+
proxyState: getProxyState(props.context),
|
|
481
|
+
tag: props.block.tagName || "div"
|
|
475
482
|
});
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
483
|
+
const component = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
484
|
+
const [props2] = qwik.useLexicalScope();
|
|
485
|
+
return getComponent({
|
|
486
|
+
block: props2.block,
|
|
487
|
+
context: props2.context
|
|
488
|
+
});
|
|
489
|
+
}, "RenderBlock_component_component_useComputed_qb7DMTJ9XGY", [
|
|
490
|
+
props
|
|
491
|
+
]));
|
|
492
|
+
const repeatItemData = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
493
|
+
const [props2] = qwik.useLexicalScope();
|
|
494
|
+
return getRepeatItemData({
|
|
495
|
+
block: props2.block,
|
|
496
|
+
context: props2.context
|
|
497
|
+
});
|
|
498
|
+
}, "RenderBlock_component_repeatItemData_useComputed_Q2wkGRsY3KE", [
|
|
499
|
+
props
|
|
500
|
+
]));
|
|
501
|
+
const useBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
502
|
+
const [props2, repeatItemData2] = qwik.useLexicalScope();
|
|
503
|
+
return repeatItemData2.value ? props2.block : getProcessedBlock({
|
|
504
|
+
block: props2.block,
|
|
505
|
+
state: props2.context.state,
|
|
506
|
+
context: props2.context.context,
|
|
507
|
+
shouldEvaluateBindings: true
|
|
508
|
+
});
|
|
509
|
+
}, "RenderBlock_component_useBlock_useComputed_4ZTSqMpaluI", [
|
|
510
|
+
props,
|
|
511
|
+
repeatItemData
|
|
512
|
+
]));
|
|
513
|
+
const canShowBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
514
|
+
const [useBlock2] = qwik.useLexicalScope();
|
|
515
|
+
if ("hide" in useBlock2.value)
|
|
516
|
+
return !useBlock2.value.hide;
|
|
517
|
+
if ("show" in useBlock2.value)
|
|
518
|
+
return useBlock2.value.show;
|
|
519
|
+
return true;
|
|
520
|
+
}, "RenderBlock_component_canShowBlock_useComputed_82dAQcDBUzY", [
|
|
521
|
+
useBlock
|
|
522
|
+
]));
|
|
523
|
+
const actions = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
524
|
+
const [props2, state2, useBlock2] = qwik.useLexicalScope();
|
|
525
|
+
return getBlockActions({
|
|
526
|
+
block: useBlock2.value,
|
|
527
|
+
state: props2.context.state,
|
|
528
|
+
context: props2.context.context
|
|
529
|
+
});
|
|
530
|
+
}, "RenderBlock_component_actions_useComputed_AOTwdXfwCqY", [
|
|
531
|
+
props,
|
|
532
|
+
state,
|
|
533
|
+
useBlock
|
|
534
|
+
]));
|
|
535
|
+
const attributes = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
536
|
+
const [props2, useBlock2] = qwik.useLexicalScope();
|
|
537
|
+
const blockProperties = getBlockProperties(useBlock2.value);
|
|
538
|
+
return {
|
|
539
|
+
...blockProperties,
|
|
540
|
+
...{}
|
|
541
|
+
};
|
|
542
|
+
}, "RenderBlock_component_attributes_useComputed_2cvnb0dCzeU", [
|
|
543
|
+
props,
|
|
544
|
+
useBlock
|
|
545
|
+
]));
|
|
546
|
+
const childrenWithoutParentComponent = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
547
|
+
const [component2, repeatItemData2, useBlock2] = qwik.useLexicalScope();
|
|
548
|
+
const shouldRenderChildrenOutsideRef = !component2.value?.component && !repeatItemData2.value;
|
|
549
|
+
return shouldRenderChildrenOutsideRef ? useBlock2.value.children ?? [] : [];
|
|
550
|
+
}, "RenderBlock_component_childrenWithoutParentComponent_useComputed_l4hT2V9liQc", [
|
|
551
|
+
component,
|
|
552
|
+
repeatItemData,
|
|
553
|
+
useBlock
|
|
554
|
+
]));
|
|
555
|
+
const childrenContext = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
556
|
+
const [attributes2, props2, useBlock2] = qwik.useLexicalScope();
|
|
557
|
+
const getInheritedTextStyles = () => {
|
|
558
|
+
return {};
|
|
559
|
+
};
|
|
560
|
+
return {
|
|
561
|
+
apiKey: props2.context.apiKey,
|
|
562
|
+
apiVersion: props2.context.apiVersion,
|
|
563
|
+
state: props2.context.state,
|
|
564
|
+
content: props2.context.content,
|
|
565
|
+
context: props2.context.context,
|
|
566
|
+
setState: props2.context.setState,
|
|
567
|
+
registeredComponents: props2.context.registeredComponents,
|
|
568
|
+
inheritedStyles: getInheritedTextStyles()
|
|
569
|
+
};
|
|
570
|
+
}, "RenderBlock_component_childrenContext_useComputed_gskFnyBnHDI", [
|
|
571
|
+
attributes,
|
|
572
|
+
props,
|
|
573
|
+
useBlock
|
|
574
|
+
]));
|
|
575
|
+
const renderComponentProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
576
|
+
const [actions2, attributes2, childrenContext2, component2, useBlock2] = qwik.useLexicalScope();
|
|
577
|
+
return {
|
|
578
|
+
blockChildren: useBlock2.value.children ?? [],
|
|
579
|
+
componentRef: component2.value?.component,
|
|
580
|
+
componentOptions: {
|
|
581
|
+
...getBlockComponentOptions(useBlock2.value),
|
|
582
|
+
...!component2.value?.noWrap ? {} : {
|
|
583
|
+
attributes: {
|
|
584
|
+
...attributes2.value,
|
|
585
|
+
...actions2.value
|
|
586
|
+
}
|
|
494
587
|
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
return getRepeatItemData({
|
|
506
|
-
block: props.block,
|
|
507
|
-
context: props.context
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
const childrenContext = function childrenContext2(props, state) {
|
|
511
|
-
const getInheritedTextStyles = () => {
|
|
512
|
-
return {};
|
|
513
|
-
};
|
|
514
|
-
return {
|
|
515
|
-
apiKey: props.context.apiKey,
|
|
516
|
-
apiVersion: props.context.apiVersion,
|
|
517
|
-
state: props.context.state,
|
|
518
|
-
content: props.context.content,
|
|
519
|
-
context: props.context.context,
|
|
520
|
-
setState: props.context.setState,
|
|
521
|
-
registeredComponents: props.context.registeredComponents,
|
|
522
|
-
inheritedStyles: getInheritedTextStyles()
|
|
523
|
-
};
|
|
524
|
-
};
|
|
525
|
-
const RenderBlock = (props) => {
|
|
526
|
-
qwik._jsxBranch();
|
|
527
|
-
const state = {};
|
|
528
|
-
state.tag = tag(props);
|
|
588
|
+
},
|
|
589
|
+
context: childrenContext2.value
|
|
590
|
+
};
|
|
591
|
+
}, "RenderBlock_component_renderComponentProps_useComputed_tWa1cp0r7XY", [
|
|
592
|
+
actions,
|
|
593
|
+
attributes,
|
|
594
|
+
childrenContext,
|
|
595
|
+
component,
|
|
596
|
+
useBlock
|
|
597
|
+
]));
|
|
529
598
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
530
|
-
children: canShowBlock
|
|
599
|
+
children: canShowBlock.value ? !component.value?.noWrap ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
531
600
|
children: [
|
|
532
|
-
isEmptyHtmlElement(tag
|
|
533
|
-
...attributes
|
|
534
|
-
...actions
|
|
535
|
-
},
|
|
536
|
-
!isEmptyHtmlElement(tag
|
|
601
|
+
isEmptyHtmlElement(state.tag) ? /* @__PURE__ */ qwik._jsxC(state.tag, {
|
|
602
|
+
...attributes.value,
|
|
603
|
+
...actions.value
|
|
604
|
+
}, 0, "9d_0") : null,
|
|
605
|
+
!isEmptyHtmlElement(state.tag) && repeatItemData.value ? (repeatItemData.value || []).map(function(data, index) {
|
|
537
606
|
return /* @__PURE__ */ qwik._jsxC(RenderRepeatedBlock, {
|
|
538
607
|
get repeatContext() {
|
|
539
608
|
return data.context;
|
|
@@ -547,36 +616,47 @@ const RenderBlock = (props) => {
|
|
|
547
616
|
}
|
|
548
617
|
}, 3, index);
|
|
549
618
|
}) : null,
|
|
550
|
-
!isEmptyHtmlElement(tag
|
|
551
|
-
...attributes
|
|
552
|
-
...actions
|
|
619
|
+
!isEmptyHtmlElement(state.tag) && !repeatItemData.value ? /* @__PURE__ */ qwik._jsxC(state.tag, {
|
|
620
|
+
...attributes.value,
|
|
621
|
+
...actions.value,
|
|
553
622
|
children: [
|
|
554
623
|
/* @__PURE__ */ qwik._jsxC(RenderComponent, {
|
|
555
|
-
...renderComponentProps
|
|
556
|
-
},
|
|
557
|
-
(childrenWithoutParentComponent
|
|
624
|
+
...renderComponentProps.value
|
|
625
|
+
}, 0, "9d_1"),
|
|
626
|
+
(childrenWithoutParentComponent.value || []).map(function(child) {
|
|
558
627
|
return /* @__PURE__ */ qwik._jsxC(RenderBlock, {
|
|
559
628
|
block: child,
|
|
560
|
-
context
|
|
629
|
+
get context() {
|
|
630
|
+
return childrenContext.value;
|
|
631
|
+
},
|
|
632
|
+
[qwik._IMMUTABLE]: {
|
|
633
|
+
context: qwik._fnSignal((p0) => p0.value, [
|
|
634
|
+
childrenContext
|
|
635
|
+
], "p0.value")
|
|
636
|
+
}
|
|
561
637
|
}, 3, "render-block-" + child.id);
|
|
562
638
|
}),
|
|
563
|
-
(childrenWithoutParentComponent
|
|
639
|
+
(childrenWithoutParentComponent.value || []).map(function(child) {
|
|
564
640
|
return /* @__PURE__ */ qwik._jsxC(BlockStyles, {
|
|
565
641
|
block: child,
|
|
566
|
-
context
|
|
642
|
+
get context() {
|
|
643
|
+
return childrenContext.value;
|
|
644
|
+
},
|
|
645
|
+
[qwik._IMMUTABLE]: {
|
|
646
|
+
context: qwik._fnSignal((p0) => p0.value, [
|
|
647
|
+
childrenContext
|
|
648
|
+
], "p0.value")
|
|
649
|
+
}
|
|
567
650
|
}, 3, "block-style-" + child.id);
|
|
568
651
|
})
|
|
569
652
|
]
|
|
570
653
|
}, 0, "9d_2") : null
|
|
571
654
|
]
|
|
572
655
|
}, 1, "9d_3") : /* @__PURE__ */ qwik._jsxC(RenderComponent, {
|
|
573
|
-
...renderComponentProps
|
|
574
|
-
},
|
|
656
|
+
...renderComponentProps.value
|
|
657
|
+
}, 0, "9d_4") : null
|
|
575
658
|
}, 1, "9d_5");
|
|
576
|
-
};
|
|
577
|
-
const className = function className2(props, state, builderContext2) {
|
|
578
|
-
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
579
|
-
};
|
|
659
|
+
}, "RenderBlock_component_m0hg0zT573Q"));
|
|
580
660
|
const onClick$1 = function onClick2(props, state, builderContext2) {
|
|
581
661
|
if (isEditing() && !props.blocks?.length)
|
|
582
662
|
window.parent?.postMessage({
|
|
@@ -601,8 +681,13 @@ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
601
681
|
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "RenderBlocks_component_useStylesScoped_0XKYzaR059E"));
|
|
602
682
|
const builderContext$1 = qwik.useContext(builderContext);
|
|
603
683
|
const state = {};
|
|
684
|
+
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
685
|
+
const [props2] = qwik.useLexicalScope();
|
|
686
|
+
return "builder-blocks" + (!props2.blocks?.length ? " no-blocks" : "");
|
|
687
|
+
}, "RenderBlocks_component_className_useComputed_7iQuBozD6Tc", [
|
|
688
|
+
props
|
|
689
|
+
]));
|
|
604
690
|
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
605
|
-
class: className(props) + " div-RenderBlocks",
|
|
606
691
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
607
692
|
const [builderContext2, props2, state2] = qwik.useLexicalScope();
|
|
608
693
|
return onClick$1(props2);
|
|
@@ -620,6 +705,9 @@ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
620
705
|
state
|
|
621
706
|
])
|
|
622
707
|
}, {
|
|
708
|
+
class: qwik._fnSignal((p0) => p0.value + " div-RenderBlocks", [
|
|
709
|
+
className
|
|
710
|
+
], 'p0.value+" div-RenderBlocks"'),
|
|
623
711
|
"builder-path": qwik._fnSignal((p0) => p0.path, [
|
|
624
712
|
props
|
|
625
713
|
], "p0.path"),
|
|
@@ -670,15 +758,6 @@ const getTabletStyle = function getTabletStyle2(props, state, builderContext2, {
|
|
|
670
758
|
const getMobileStyle = function getMobileStyle2(props, state, builderContext2, { stackedStyle, desktopStyle }) {
|
|
671
759
|
return state.stackAt === "never" ? desktopStyle : stackedStyle;
|
|
672
760
|
};
|
|
673
|
-
const columnsCssVars = function columnsCssVars2(props, state, builderContext2) {
|
|
674
|
-
return {
|
|
675
|
-
"--flex-dir": state.flexDir,
|
|
676
|
-
"--flex-dir-tablet": getTabletStyle(props, state, builderContext2, {
|
|
677
|
-
stackedStyle: state.flexDir,
|
|
678
|
-
desktopStyle: "row"
|
|
679
|
-
})
|
|
680
|
-
};
|
|
681
|
-
};
|
|
682
761
|
const columnCssVars = function columnCssVars2(props, state, builderContext2, index) {
|
|
683
762
|
index === 0 ? 0 : state.gutterSize;
|
|
684
763
|
const width = getColumnCssWidth(props, state, builderContext2, index);
|
|
@@ -708,52 +787,79 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
|
|
|
708
787
|
const breakpointSizes = getSizesForBreakpoints(builderContext2.content?.meta?.breakpoints || {});
|
|
709
788
|
return breakpointSizes[size].max;
|
|
710
789
|
};
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
790
|
+
const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
791
|
+
qwik._jsxBranch();
|
|
792
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
793
|
+
const builderContext$1 = qwik.useContext(builderContext);
|
|
794
|
+
const state = qwik.useStore({
|
|
795
|
+
cols: props.columns || [],
|
|
796
|
+
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
797
|
+
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
798
|
+
stackAt: props.stackColumnsAt || "tablet"
|
|
799
|
+
});
|
|
800
|
+
const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
801
|
+
const [builderContext2, props2, state2] = qwik.useLexicalScope();
|
|
802
|
+
return {
|
|
803
|
+
"--flex-dir": state2.flexDir,
|
|
804
|
+
"--flex-dir-tablet": getTabletStyle(props2, state2, builderContext2, {
|
|
805
|
+
stackedStyle: state2.flexDir,
|
|
806
|
+
desktopStyle: "row"
|
|
807
|
+
})
|
|
808
|
+
};
|
|
809
|
+
}, "Columns_component_columnsCssVars_useComputed_adFEq2RWT9s", [
|
|
810
|
+
builderContext$1,
|
|
811
|
+
props,
|
|
812
|
+
state
|
|
813
|
+
]));
|
|
814
|
+
const columnsStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
815
|
+
const [builderContext2, props2, state2] = qwik.useLexicalScope();
|
|
816
|
+
return `
|
|
817
|
+
@media (max-width: ${getWidthForBreakpointSize(props2, state2, builderContext2, "medium")}px) {
|
|
818
|
+
.${props2.builderBlock.id}-breakpoints {
|
|
715
819
|
flex-direction: var(--flex-dir-tablet);
|
|
716
820
|
align-items: stretch;
|
|
717
821
|
}
|
|
718
822
|
|
|
719
|
-
.${
|
|
823
|
+
.${props2.builderBlock.id}-breakpoints > .builder-column {
|
|
720
824
|
width: var(--column-width-tablet) !important;
|
|
721
825
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
722
826
|
}
|
|
723
827
|
}
|
|
724
828
|
|
|
725
|
-
@media (max-width: ${getWidthForBreakpointSize(
|
|
726
|
-
.${
|
|
829
|
+
@media (max-width: ${getWidthForBreakpointSize(props2, state2, builderContext2, "small")}px) {
|
|
830
|
+
.${props2.builderBlock.id}-breakpoints {
|
|
727
831
|
flex-direction: var(--flex-dir);
|
|
728
832
|
align-items: stretch;
|
|
729
833
|
}
|
|
730
834
|
|
|
731
|
-
.${
|
|
835
|
+
.${props2.builderBlock.id}-breakpoints > .builder-column {
|
|
732
836
|
width: var(--column-width-mobile) !important;
|
|
733
837
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
734
838
|
}
|
|
735
839
|
},
|
|
736
840
|
`;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
cols: props.columns || [],
|
|
744
|
-
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
745
|
-
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
746
|
-
stackAt: props.stackColumnsAt || "tablet"
|
|
747
|
-
});
|
|
748
|
-
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
749
|
-
style: columnsCssVars(props, state, builderContext$1)
|
|
750
|
-
}, {
|
|
841
|
+
}, "Columns_component_columnsStyles_useComputed_nBtMPbzd1Wc", [
|
|
842
|
+
builderContext$1,
|
|
843
|
+
props,
|
|
844
|
+
state
|
|
845
|
+
]));
|
|
846
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
751
847
|
class: qwik._fnSignal((p0) => `builder-columns ${p0.builderBlock.id}-breakpoints div-Columns`, [
|
|
752
848
|
props
|
|
753
|
-
], '`builder-columns ${p0.builderBlock.id}-breakpoints`+" div-Columns"')
|
|
849
|
+
], '`builder-columns ${p0.builderBlock.id}-breakpoints`+" div-Columns"'),
|
|
850
|
+
style: qwik._fnSignal((p0) => p0.value, [
|
|
851
|
+
columnsCssVars
|
|
852
|
+
], "p0.value")
|
|
754
853
|
}, [
|
|
755
854
|
/* @__PURE__ */ qwik._jsxC(RenderInlinedStyles, {
|
|
756
|
-
styles
|
|
855
|
+
get styles() {
|
|
856
|
+
return columnsStyles.value;
|
|
857
|
+
},
|
|
858
|
+
[qwik._IMMUTABLE]: {
|
|
859
|
+
styles: qwik._fnSignal((p0) => p0.value, [
|
|
860
|
+
columnsStyles
|
|
861
|
+
], "p0.value")
|
|
862
|
+
}
|
|
757
863
|
}, 3, "c0_0"),
|
|
758
864
|
(props.columns || []).map(function(column, index) {
|
|
759
865
|
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
@@ -849,55 +955,59 @@ function getSrcSet(url) {
|
|
|
849
955
|
]).join(", ");
|
|
850
956
|
return url;
|
|
851
957
|
}
|
|
852
|
-
const srcSetToUse = function srcSetToUse2(props, state) {
|
|
853
|
-
const imageToUse = props.image || props.src;
|
|
854
|
-
if (!imageToUse || !(imageToUse.match(/builder\.io/) || imageToUse.match(/cdn\.shopify\.com/)))
|
|
855
|
-
return props.srcset;
|
|
856
|
-
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
857
|
-
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
858
|
-
console.debug("Removed given srcset");
|
|
859
|
-
return getSrcSet(imageToUse);
|
|
860
|
-
}
|
|
861
|
-
} else if (props.image && !props.srcset)
|
|
862
|
-
return getSrcSet(imageToUse);
|
|
863
|
-
return getSrcSet(imageToUse);
|
|
864
|
-
};
|
|
865
|
-
const webpSrcSet = function webpSrcSet2(props, state) {
|
|
866
|
-
if (srcSetToUse(props)?.match(/builder\.io/) && !props.noWebp)
|
|
867
|
-
return srcSetToUse(props).replace(/\?/g, "?format=webp&");
|
|
868
|
-
else
|
|
869
|
-
return "";
|
|
870
|
-
};
|
|
871
|
-
const aspectRatioCss = function aspectRatioCss2(props, state) {
|
|
872
|
-
const aspectRatioStyles = {
|
|
873
|
-
position: "absolute",
|
|
874
|
-
height: "100%",
|
|
875
|
-
width: "100%",
|
|
876
|
-
left: "0px",
|
|
877
|
-
top: "0px"
|
|
878
|
-
};
|
|
879
|
-
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
880
|
-
return out;
|
|
881
|
-
};
|
|
882
958
|
const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
883
959
|
qwik._jsxBranch();
|
|
884
960
|
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
961
|
+
const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
962
|
+
const [props2] = qwik.useLexicalScope();
|
|
963
|
+
const imageToUse = props2.image || props2.src;
|
|
964
|
+
if (!imageToUse || !(imageToUse.match(/builder\.io/) || imageToUse.match(/cdn\.shopify\.com/)))
|
|
965
|
+
return props2.srcset;
|
|
966
|
+
if (props2.srcset && props2.image?.includes("builder.io/api/v1/image")) {
|
|
967
|
+
if (!props2.srcset.includes(props2.image.split("?")[0])) {
|
|
968
|
+
console.debug("Removed given srcset");
|
|
969
|
+
return getSrcSet(imageToUse);
|
|
970
|
+
}
|
|
971
|
+
} else if (props2.image && !props2.srcset)
|
|
972
|
+
return getSrcSet(imageToUse);
|
|
973
|
+
return getSrcSet(imageToUse);
|
|
974
|
+
}, "Image_component_srcSetToUse_useComputed_TZMibf9Gpvw", [
|
|
975
|
+
props
|
|
976
|
+
]));
|
|
977
|
+
const webpSrcSet = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
978
|
+
const [props2, srcSetToUse2] = qwik.useLexicalScope();
|
|
979
|
+
if (srcSetToUse2.value?.match(/builder\.io/) && !props2.noWebp)
|
|
980
|
+
return srcSetToUse2.value.replace(/\?/g, "?format=webp&");
|
|
981
|
+
else
|
|
982
|
+
return "";
|
|
983
|
+
}, "Image_component_webpSrcSet_useComputed_01YCu72BBtA", [
|
|
984
|
+
props,
|
|
985
|
+
srcSetToUse
|
|
986
|
+
]));
|
|
987
|
+
const aspectRatioCss = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
988
|
+
const [props2] = qwik.useLexicalScope();
|
|
989
|
+
const aspectRatioStyles = {
|
|
990
|
+
position: "absolute",
|
|
991
|
+
height: "100%",
|
|
992
|
+
width: "100%",
|
|
993
|
+
left: "0px",
|
|
994
|
+
top: "0px"
|
|
995
|
+
};
|
|
996
|
+
const out = props2.aspectRatio ? aspectRatioStyles : void 0;
|
|
997
|
+
return out;
|
|
998
|
+
}, "Image_component_aspectRatioCss_useComputed_yJ1jG0g5fbw", [
|
|
999
|
+
props
|
|
1000
|
+
]));
|
|
885
1001
|
return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
|
|
886
1002
|
children: [
|
|
887
1003
|
/* @__PURE__ */ qwik._jsxQ("picture", null, null, [
|
|
888
|
-
webpSrcSet
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
1004
|
+
webpSrcSet.value ? /* @__PURE__ */ qwik._jsxQ("source", null, {
|
|
1005
|
+
type: "image/webp",
|
|
1006
|
+
srcSet: qwik._fnSignal((p0) => p0.value, [
|
|
1007
|
+
webpSrcSet
|
|
1008
|
+
], "p0.value")
|
|
892
1009
|
}, null, 3, "0A_0") : null,
|
|
893
|
-
/* @__PURE__ */ qwik._jsxQ("img", {
|
|
894
|
-
style: {
|
|
895
|
-
objectPosition: props.backgroundPosition || "center",
|
|
896
|
-
objectFit: props.backgroundSize || "cover",
|
|
897
|
-
...aspectRatioCss(props)
|
|
898
|
-
},
|
|
899
|
-
srcSet: srcSetToUse(props)
|
|
900
|
-
}, {
|
|
1010
|
+
/* @__PURE__ */ qwik._jsxQ("img", null, {
|
|
901
1011
|
loading: "lazy",
|
|
902
1012
|
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
903
1013
|
props
|
|
@@ -905,12 +1015,23 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
905
1015
|
role: qwik._fnSignal((p0) => p0.altText ? "presentation" : void 0, [
|
|
906
1016
|
props
|
|
907
1017
|
], 'p0.altText?"presentation":undefined'),
|
|
1018
|
+
style: qwik._fnSignal((p0, p1) => ({
|
|
1019
|
+
objectPosition: p1.backgroundPosition || "center",
|
|
1020
|
+
objectFit: p1.backgroundSize || "cover",
|
|
1021
|
+
...p0.value
|
|
1022
|
+
}), [
|
|
1023
|
+
aspectRatioCss,
|
|
1024
|
+
props
|
|
1025
|
+
], '{objectPosition:p1.backgroundPosition||"center",objectFit:p1.backgroundSize||"cover",...p0.value}'),
|
|
908
1026
|
class: qwik._fnSignal((p0) => "builder-image" + (p0.className ? " " + p0.className : "") + " img-Image", [
|
|
909
1027
|
props
|
|
910
1028
|
], '"builder-image"+(p0.className?" "+p0.className:"")+" img-Image"'),
|
|
911
1029
|
src: qwik._fnSignal((p0) => p0.image, [
|
|
912
1030
|
props
|
|
913
1031
|
], "p0.image"),
|
|
1032
|
+
srcSet: qwik._fnSignal((p0) => p0.value, [
|
|
1033
|
+
srcSetToUse
|
|
1034
|
+
], "p0.value"),
|
|
914
1035
|
sizes: qwik._fnSignal((p0) => p0.sizes, [
|
|
915
1036
|
props
|
|
916
1037
|
], "p0.sizes")
|
|
@@ -1434,7 +1555,7 @@ const componentInfo$6 = {
|
|
|
1434
1555
|
]
|
|
1435
1556
|
};
|
|
1436
1557
|
const SectionComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1437
|
-
return /* @__PURE__ */ qwik.
|
|
1558
|
+
return /* @__PURE__ */ qwik._jsxS("section", {
|
|
1438
1559
|
...props.attributes,
|
|
1439
1560
|
style: {
|
|
1440
1561
|
width: "100%",
|
|
@@ -1447,8 +1568,9 @@ const SectionComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
1447
1568
|
alignItems: "stretch",
|
|
1448
1569
|
marginLeft: "auto",
|
|
1449
1570
|
marginRight: "auto"
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1571
|
+
},
|
|
1572
|
+
children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "2Y_0")
|
|
1573
|
+
}, null, 0, "2Y_1");
|
|
1452
1574
|
}, "SectionComponent_component_ZWF9iD5WeLg"));
|
|
1453
1575
|
const componentInfo$5 = {
|
|
1454
1576
|
name: "Symbol",
|
|
@@ -1489,6 +1611,11 @@ const componentInfo$5 = {
|
|
|
1489
1611
|
}
|
|
1490
1612
|
]
|
|
1491
1613
|
};
|
|
1614
|
+
const logger = {
|
|
1615
|
+
log: (...message) => console.log("[Builder.io]: ", ...message),
|
|
1616
|
+
error: (...message) => console.error("[Builder.io]: ", ...message),
|
|
1617
|
+
warn: (...message) => console.warn("[Builder.io]: ", ...message)
|
|
1618
|
+
};
|
|
1492
1619
|
function getGlobalThis() {
|
|
1493
1620
|
if (typeof globalThis !== "undefined")
|
|
1494
1621
|
return globalThis;
|
|
@@ -1741,30 +1868,35 @@ async function getContent(options) {
|
|
|
1741
1868
|
...options,
|
|
1742
1869
|
limit: 1
|
|
1743
1870
|
});
|
|
1744
|
-
if ("results" in allContent)
|
|
1871
|
+
if (allContent && "results" in allContent)
|
|
1745
1872
|
return allContent?.results[0] || null;
|
|
1746
1873
|
return null;
|
|
1747
1874
|
}
|
|
1748
1875
|
async function getAllContent(options) {
|
|
1749
|
-
const url = generateContentUrl(options);
|
|
1750
|
-
const res = await fetch$1(url.href);
|
|
1751
|
-
const content = await res.json();
|
|
1752
|
-
if ("status" in content && !("results" in content)) {
|
|
1753
|
-
console.error("[Builder.io]: Error fetching data. ", content, options);
|
|
1754
|
-
return content;
|
|
1755
|
-
}
|
|
1756
|
-
const canTrack = options.canTrack !== false;
|
|
1757
1876
|
try {
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1877
|
+
const url = generateContentUrl(options);
|
|
1878
|
+
const res = await fetch$1(url.href);
|
|
1879
|
+
const content = await res.json();
|
|
1880
|
+
if ("status" in content && !("results" in content)) {
|
|
1881
|
+
logger.error("Error fetching data. ", content, options);
|
|
1882
|
+
return content;
|
|
1883
|
+
}
|
|
1884
|
+
const canTrack = options.canTrack !== false;
|
|
1885
|
+
try {
|
|
1886
|
+
if (canTrack && Array.isArray(content.results))
|
|
1887
|
+
for (const item of content.results)
|
|
1888
|
+
await handleABTesting({
|
|
1889
|
+
item,
|
|
1890
|
+
canTrack
|
|
1891
|
+
});
|
|
1892
|
+
} catch (e) {
|
|
1893
|
+
logger.error("Could not setup A/B testing. ", e);
|
|
1894
|
+
}
|
|
1895
|
+
return content;
|
|
1896
|
+
} catch (error) {
|
|
1897
|
+
logger.error("Error fetching data. ", error);
|
|
1898
|
+
return null;
|
|
1766
1899
|
}
|
|
1767
|
-
return content;
|
|
1768
1900
|
}
|
|
1769
1901
|
const fetchContent = function fetchContent2(props, state, builderContext2) {
|
|
1770
1902
|
if (!state.contentToUse && props.symbol?.model && builderContext2?.apiKey)
|
|
@@ -1779,7 +1911,7 @@ const fetchContent = function fetchContent2(props, state, builderContext2) {
|
|
|
1779
1911
|
if (response)
|
|
1780
1912
|
state.contentToUse = response;
|
|
1781
1913
|
}).catch((err) => {
|
|
1782
|
-
|
|
1914
|
+
logger.error("Could not fetch symbol content: ", err);
|
|
1783
1915
|
});
|
|
1784
1916
|
};
|
|
1785
1917
|
const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
@@ -1812,68 +1944,69 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
1812
1944
|
props,
|
|
1813
1945
|
state
|
|
1814
1946
|
]));
|
|
1815
|
-
return /* @__PURE__ */ qwik.
|
|
1816
|
-
...props.attributes
|
|
1947
|
+
return /* @__PURE__ */ qwik._jsxS("div", {
|
|
1948
|
+
...props.attributes,
|
|
1949
|
+
children: /* @__PURE__ */ qwik._jsxC(RenderContent, {
|
|
1950
|
+
get apiVersion() {
|
|
1951
|
+
return builderContext$1.apiVersion;
|
|
1952
|
+
},
|
|
1953
|
+
get apiKey() {
|
|
1954
|
+
return builderContext$1.apiKey;
|
|
1955
|
+
},
|
|
1956
|
+
get context() {
|
|
1957
|
+
return builderContext$1.context;
|
|
1958
|
+
},
|
|
1959
|
+
get customComponents() {
|
|
1960
|
+
return Object.values(builderContext$1.registeredComponents);
|
|
1961
|
+
},
|
|
1962
|
+
get data() {
|
|
1963
|
+
return {
|
|
1964
|
+
...props.symbol?.data,
|
|
1965
|
+
...builderContext$1.state,
|
|
1966
|
+
...state.contentToUse?.data?.state
|
|
1967
|
+
};
|
|
1968
|
+
},
|
|
1969
|
+
get model() {
|
|
1970
|
+
return props.symbol?.model;
|
|
1971
|
+
},
|
|
1972
|
+
get content() {
|
|
1973
|
+
return state.contentToUse;
|
|
1974
|
+
},
|
|
1975
|
+
[qwik._IMMUTABLE]: {
|
|
1976
|
+
apiVersion: qwik._fnSignal((p0) => p0.apiVersion, [
|
|
1977
|
+
builderContext$1
|
|
1978
|
+
], "p0.apiVersion"),
|
|
1979
|
+
apiKey: qwik._fnSignal((p0) => p0.apiKey, [
|
|
1980
|
+
builderContext$1
|
|
1981
|
+
], "p0.apiKey"),
|
|
1982
|
+
context: qwik._fnSignal((p0) => p0.context, [
|
|
1983
|
+
builderContext$1
|
|
1984
|
+
], "p0.context"),
|
|
1985
|
+
customComponents: qwik._fnSignal((p0) => Object.values(p0.registeredComponents), [
|
|
1986
|
+
builderContext$1
|
|
1987
|
+
], "Object.values(p0.registeredComponents)"),
|
|
1988
|
+
data: qwik._fnSignal((p0, p1, p2) => ({
|
|
1989
|
+
...p1.symbol?.data,
|
|
1990
|
+
...p0.state,
|
|
1991
|
+
...p2.contentToUse?.data?.state
|
|
1992
|
+
}), [
|
|
1993
|
+
builderContext$1,
|
|
1994
|
+
props,
|
|
1995
|
+
state
|
|
1996
|
+
], "{...p1.symbol?.data,...p0.state,...p2.contentToUse?.data?.state}"),
|
|
1997
|
+
model: qwik._fnSignal((p0) => p0.symbol?.model, [
|
|
1998
|
+
props
|
|
1999
|
+
], "p0.symbol?.model"),
|
|
2000
|
+
content: qwik._fnSignal((p0) => p0.contentToUse, [
|
|
2001
|
+
state
|
|
2002
|
+
], "p0.contentToUse")
|
|
2003
|
+
}
|
|
2004
|
+
}, 3, "Wt_0")
|
|
1817
2005
|
}, {
|
|
1818
2006
|
class: qwik._fnSignal((p0) => p0.className, [
|
|
1819
2007
|
state
|
|
1820
2008
|
], "p0.className")
|
|
1821
|
-
},
|
|
1822
|
-
get apiVersion() {
|
|
1823
|
-
return builderContext$1.apiVersion;
|
|
1824
|
-
},
|
|
1825
|
-
get apiKey() {
|
|
1826
|
-
return builderContext$1.apiKey;
|
|
1827
|
-
},
|
|
1828
|
-
get context() {
|
|
1829
|
-
return builderContext$1.context;
|
|
1830
|
-
},
|
|
1831
|
-
get customComponents() {
|
|
1832
|
-
return Object.values(builderContext$1.registeredComponents);
|
|
1833
|
-
},
|
|
1834
|
-
get data() {
|
|
1835
|
-
return {
|
|
1836
|
-
...props.symbol?.data,
|
|
1837
|
-
...builderContext$1.state,
|
|
1838
|
-
...state.contentToUse?.data?.state
|
|
1839
|
-
};
|
|
1840
|
-
},
|
|
1841
|
-
get model() {
|
|
1842
|
-
return props.symbol?.model;
|
|
1843
|
-
},
|
|
1844
|
-
get content() {
|
|
1845
|
-
return state.contentToUse;
|
|
1846
|
-
},
|
|
1847
|
-
[qwik._IMMUTABLE]: {
|
|
1848
|
-
apiVersion: qwik._fnSignal((p0) => p0.apiVersion, [
|
|
1849
|
-
builderContext$1
|
|
1850
|
-
], "p0.apiVersion"),
|
|
1851
|
-
apiKey: qwik._fnSignal((p0) => p0.apiKey, [
|
|
1852
|
-
builderContext$1
|
|
1853
|
-
], "p0.apiKey"),
|
|
1854
|
-
context: qwik._fnSignal((p0) => p0.context, [
|
|
1855
|
-
builderContext$1
|
|
1856
|
-
], "p0.context"),
|
|
1857
|
-
customComponents: qwik._fnSignal((p0) => Object.values(p0.registeredComponents), [
|
|
1858
|
-
builderContext$1
|
|
1859
|
-
], "Object.values(p0.registeredComponents)"),
|
|
1860
|
-
data: qwik._fnSignal((p0, p1, p2) => ({
|
|
1861
|
-
...p1.symbol?.data,
|
|
1862
|
-
...p0.state,
|
|
1863
|
-
...p2.contentToUse?.data?.state
|
|
1864
|
-
}), [
|
|
1865
|
-
builderContext$1,
|
|
1866
|
-
props,
|
|
1867
|
-
state
|
|
1868
|
-
], "{...p1.symbol?.data,...p0.state,...p2.contentToUse?.data?.state}"),
|
|
1869
|
-
model: qwik._fnSignal((p0) => p0.symbol?.model, [
|
|
1870
|
-
props
|
|
1871
|
-
], "p0.symbol?.model"),
|
|
1872
|
-
content: qwik._fnSignal((p0) => p0.contentToUse, [
|
|
1873
|
-
state
|
|
1874
|
-
], "p0.contentToUse")
|
|
1875
|
-
}
|
|
1876
|
-
}, 3, "Wt_0"), 0, "Wt_1");
|
|
2009
|
+
}, 0, "Wt_1");
|
|
1877
2010
|
}, "Symbol_component_WVvggdkUPdk"));
|
|
1878
2011
|
const componentInfo$4 = {
|
|
1879
2012
|
name: "Text",
|
|
@@ -2019,34 +2152,41 @@ const componentInfo$3 = {
|
|
|
2019
2152
|
}
|
|
2020
2153
|
]
|
|
2021
2154
|
};
|
|
2022
|
-
const videoProps = function videoProps2(props, state) {
|
|
2023
|
-
return {
|
|
2024
|
-
...props.autoPlay === true ? {
|
|
2025
|
-
autoPlay: true
|
|
2026
|
-
} : {},
|
|
2027
|
-
...props.muted === true ? {
|
|
2028
|
-
muted: true
|
|
2029
|
-
} : {},
|
|
2030
|
-
...props.controls === true ? {
|
|
2031
|
-
controls: true
|
|
2032
|
-
} : {},
|
|
2033
|
-
...props.loop === true ? {
|
|
2034
|
-
loop: true
|
|
2035
|
-
} : {},
|
|
2036
|
-
...props.playsInline === true ? {
|
|
2037
|
-
playsInline: true
|
|
2038
|
-
} : {}
|
|
2039
|
-
};
|
|
2040
|
-
};
|
|
2041
|
-
const spreadProps = function spreadProps2(props, state) {
|
|
2042
|
-
return {
|
|
2043
|
-
...props.attributes,
|
|
2044
|
-
...videoProps(props)
|
|
2045
|
-
};
|
|
2046
|
-
};
|
|
2047
2155
|
const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2048
|
-
|
|
2049
|
-
|
|
2156
|
+
const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2157
|
+
const [props2] = qwik.useLexicalScope();
|
|
2158
|
+
return {
|
|
2159
|
+
...props2.autoPlay === true ? {
|
|
2160
|
+
autoPlay: true
|
|
2161
|
+
} : {},
|
|
2162
|
+
...props2.muted === true ? {
|
|
2163
|
+
muted: true
|
|
2164
|
+
} : {},
|
|
2165
|
+
...props2.controls === true ? {
|
|
2166
|
+
controls: true
|
|
2167
|
+
} : {},
|
|
2168
|
+
...props2.loop === true ? {
|
|
2169
|
+
loop: true
|
|
2170
|
+
} : {},
|
|
2171
|
+
...props2.playsInline === true ? {
|
|
2172
|
+
playsInline: true
|
|
2173
|
+
} : {}
|
|
2174
|
+
};
|
|
2175
|
+
}, "Video_component_videoProps_useComputed_60AadUGY06E", [
|
|
2176
|
+
props
|
|
2177
|
+
]));
|
|
2178
|
+
const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2179
|
+
const [props2, videoProps2] = qwik.useLexicalScope();
|
|
2180
|
+
return {
|
|
2181
|
+
...props2.attributes,
|
|
2182
|
+
...videoProps2.value
|
|
2183
|
+
};
|
|
2184
|
+
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
2185
|
+
props,
|
|
2186
|
+
videoProps
|
|
2187
|
+
]));
|
|
2188
|
+
return /* @__PURE__ */ qwik._jsxS("video", {
|
|
2189
|
+
...spreadProps.value
|
|
2050
2190
|
}, {
|
|
2051
2191
|
style: qwik._fnSignal((p0) => ({
|
|
2052
2192
|
width: "100%",
|
|
@@ -2064,7 +2204,7 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2064
2204
|
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
2065
2205
|
props
|
|
2066
2206
|
], "p0.posterImage")
|
|
2067
|
-
},
|
|
2207
|
+
}, 0, "j7_0");
|
|
2068
2208
|
}, "Video_component_qdcTZflYyoQ"));
|
|
2069
2209
|
const componentInfo$2 = {
|
|
2070
2210
|
name: "Embed",
|
|
@@ -2159,7 +2299,7 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2159
2299
|
}, null, 3, "9r_0");
|
|
2160
2300
|
}, "Embed_component_Uji08ORjXbE"));
|
|
2161
2301
|
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2162
|
-
return /* @__PURE__ */ qwik.
|
|
2302
|
+
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
2163
2303
|
...props.attributes
|
|
2164
2304
|
}, {
|
|
2165
2305
|
style: qwik._fnSignal((p0) => ({
|
|
@@ -2174,7 +2314,7 @@ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
2174
2314
|
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
2175
2315
|
props
|
|
2176
2316
|
], "p0.imgSrc||p0.image")
|
|
2177
|
-
},
|
|
2317
|
+
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
2178
2318
|
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
2179
2319
|
const componentInfo$1 = {
|
|
2180
2320
|
name: "Raw:Img",
|
|
@@ -2335,13 +2475,13 @@ function isPreviewing() {
|
|
|
2335
2475
|
return Boolean(location.search.indexOf("builder.preview=") !== -1);
|
|
2336
2476
|
}
|
|
2337
2477
|
const components = [];
|
|
2338
|
-
function registerComponent(
|
|
2478
|
+
function registerComponent(component, info) {
|
|
2339
2479
|
components.push({
|
|
2340
|
-
component
|
|
2480
|
+
component,
|
|
2341
2481
|
...info
|
|
2342
2482
|
});
|
|
2343
2483
|
console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
|
|
2344
|
-
return
|
|
2484
|
+
return component;
|
|
2345
2485
|
}
|
|
2346
2486
|
const createRegisterComponentMessage = ({ component: _, ...info }) => ({
|
|
2347
2487
|
type: "builder.registerComponent",
|
|
@@ -2507,7 +2647,7 @@ const createEvent = async ({ type: eventType, canTrack, apiKey, metadata, ...pro
|
|
|
2507
2647
|
});
|
|
2508
2648
|
async function _track(eventProps) {
|
|
2509
2649
|
if (!eventProps.apiKey) {
|
|
2510
|
-
|
|
2650
|
+
logger.error("Missing API key for track call. Please provide your API key.");
|
|
2511
2651
|
return;
|
|
2512
2652
|
}
|
|
2513
2653
|
if (!eventProps.canTrack)
|
|
@@ -2964,6 +3104,8 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
2964
3104
|
content: props.content,
|
|
2965
3105
|
data: props.data
|
|
2966
3106
|
})
|
|
3107
|
+
}, {
|
|
3108
|
+
deep: true
|
|
2967
3109
|
});
|
|
2968
3110
|
qwik.useContextProvider(builderContext, qwik.useStore({
|
|
2969
3111
|
content: state.useContent,
|
|
@@ -2976,7 +3118,7 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
2976
3118
|
qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2977
3119
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
2978
3120
|
if (!props2.apiKey)
|
|
2979
|
-
|
|
3121
|
+
logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
2980
3122
|
if (isBrowser()) {
|
|
2981
3123
|
if (isEditing()) {
|
|
2982
3124
|
state2.forceReRenderCount = state2.forceReRenderCount + 1;
|
|
@@ -3009,9 +3151,10 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
3009
3151
|
}
|
|
3010
3152
|
if (isPreviewing()) {
|
|
3011
3153
|
const searchParams = new URL(location.href).searchParams;
|
|
3012
|
-
const
|
|
3154
|
+
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
3155
|
+
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
3013
3156
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
3014
|
-
if (
|
|
3157
|
+
if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
|
|
3015
3158
|
getContent({
|
|
3016
3159
|
model: props2.model,
|
|
3017
3160
|
apiKey: props2.apiKey,
|