@builder.io/sdk-solid 2.0.1 → 2.0.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/dist/index.d.ts +1 -1
- package/lib/browser/dev.js +41 -24
- package/lib/browser/dev.jsx +40 -33
- package/lib/browser/index.js +41 -24
- package/lib/browser/index.jsx +40 -33
- package/lib/edge/dev.js +41 -24
- package/lib/edge/dev.jsx +40 -33
- package/lib/edge/index.js +41 -24
- package/lib/edge/index.jsx +40 -33
- package/lib/node/dev.js +41 -24
- package/lib/node/dev.jsx +40 -33
- package/lib/node/index.js +41 -24
- package/lib/node/index.jsx +40 -33
- package/package.json +1 -1
package/lib/browser/index.jsx
CHANGED
|
@@ -1458,6 +1458,7 @@ function Columns(props) {
|
|
|
1458
1458
|
return breakpointSizes[size].max;
|
|
1459
1459
|
}
|
|
1460
1460
|
function columnsStyles() {
|
|
1461
|
+
const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
|
|
1461
1462
|
return `
|
|
1462
1463
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1463
1464
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1465,7 +1466,7 @@ function Columns(props) {
|
|
|
1465
1466
|
align-items: stretch;
|
|
1466
1467
|
}
|
|
1467
1468
|
|
|
1468
|
-
|
|
1469
|
+
${childColumnDiv} {
|
|
1469
1470
|
width: var(--column-width-tablet) !important;
|
|
1470
1471
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
1471
1472
|
}
|
|
@@ -1477,7 +1478,7 @@ function Columns(props) {
|
|
|
1477
1478
|
align-items: stretch;
|
|
1478
1479
|
}
|
|
1479
1480
|
|
|
1480
|
-
|
|
1481
|
+
${childColumnDiv} {
|
|
1481
1482
|
width: var(--column-width-mobile) !important;
|
|
1482
1483
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
1483
1484
|
}
|
|
@@ -1496,7 +1497,7 @@ function Columns(props) {
|
|
|
1496
1497
|
}
|
|
1497
1498
|
return <>
|
|
1498
1499
|
<div
|
|
1499
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1500
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-3ff242de"}
|
|
1500
1501
|
style={columnsCssVars()}
|
|
1501
1502
|
{...{}}
|
|
1502
1503
|
>
|
|
@@ -1525,7 +1526,7 @@ function Columns(props) {
|
|
|
1525
1526
|
/></Dynamic_renderer_default>;
|
|
1526
1527
|
}}</For4>
|
|
1527
1528
|
</div>
|
|
1528
|
-
<style>{`.div-
|
|
1529
|
+
<style>{`.div-3ff242de {
|
|
1529
1530
|
display: flex;
|
|
1530
1531
|
line-height: normal;
|
|
1531
1532
|
}`}</style>
|
|
@@ -1599,6 +1600,9 @@ function Image(props) {
|
|
|
1599
1600
|
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
1600
1601
|
return props.srcset;
|
|
1601
1602
|
}
|
|
1603
|
+
if (props.noWebp) {
|
|
1604
|
+
return void 0;
|
|
1605
|
+
}
|
|
1602
1606
|
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
1603
1607
|
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
1604
1608
|
return getSrcSet(url);
|
|
@@ -1631,7 +1635,7 @@ function Image(props) {
|
|
|
1631
1635
|
<picture>
|
|
1632
1636
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1633
1637
|
<img
|
|
1634
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
1638
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e"}
|
|
1635
1639
|
loading={props.highPriority ? "eager" : "lazy"}
|
|
1636
1640
|
fetchpriority={props.highPriority ? "high" : "auto"}
|
|
1637
1641
|
alt={props.altText}
|
|
@@ -1649,22 +1653,22 @@ function Image(props) {
|
|
|
1649
1653
|
<Show7
|
|
1650
1654
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1651
1655
|
><div
|
|
1652
|
-
class="builder-image-sizer div-
|
|
1656
|
+
class="builder-image-sizer div-e3b1053e"
|
|
1653
1657
|
style={{
|
|
1654
1658
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1655
1659
|
}}
|
|
1656
1660
|
/></Show7>
|
|
1657
1661
|
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1658
|
-
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-
|
|
1662
|
+
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-e3b1053e-2">{props.children}</div></Show7>
|
|
1659
1663
|
</>
|
|
1660
|
-
<style>{`.img-
|
|
1664
|
+
<style>{`.img-e3b1053e {
|
|
1661
1665
|
opacity: 1;
|
|
1662
1666
|
transition: opacity 0.2s ease-in-out;
|
|
1663
|
-
}.div-
|
|
1667
|
+
}.div-e3b1053e {
|
|
1664
1668
|
width: 100%;
|
|
1665
1669
|
pointer-events: none;
|
|
1666
1670
|
font-size: 0;
|
|
1667
|
-
}.div-
|
|
1671
|
+
}.div-e3b1053e-2 {
|
|
1668
1672
|
display: flex;
|
|
1669
1673
|
flex-direction: column;
|
|
1670
1674
|
align-items: stretch;
|
|
@@ -1700,16 +1704,10 @@ function SectionComponent(props) {
|
|
|
1700
1704
|
var section_default = SectionComponent;
|
|
1701
1705
|
|
|
1702
1706
|
// src/blocks/symbol/symbol.tsx
|
|
1703
|
-
import { onMount as onMount5, on as
|
|
1707
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
1704
1708
|
|
|
1705
1709
|
// src/components/content-variants/content-variants.tsx
|
|
1706
|
-
import {
|
|
1707
|
-
Show as Show14,
|
|
1708
|
-
For as For9,
|
|
1709
|
-
onMount as onMount4,
|
|
1710
|
-
createMemo as createMemo18,
|
|
1711
|
-
createSignal as createSignal18
|
|
1712
|
-
} from "solid-js";
|
|
1710
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
1713
1711
|
|
|
1714
1712
|
// src/helpers/url.ts
|
|
1715
1713
|
var getTopLevelDomain = (host) => {
|
|
@@ -4079,17 +4077,14 @@ var serializeFn = (fnValue) => {
|
|
|
4079
4077
|
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
4080
4078
|
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
4081
4079
|
};
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
}
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
[key]: serializeValue(value)
|
|
4091
|
-
}), {}))
|
|
4092
|
-
});
|
|
4080
|
+
function serializeComponentInfo(info) {
|
|
4081
|
+
return JSON.parse(JSON.stringify(info, (key, value) => {
|
|
4082
|
+
if (typeof value === "function") {
|
|
4083
|
+
return serializeFn(value);
|
|
4084
|
+
}
|
|
4085
|
+
return value;
|
|
4086
|
+
}));
|
|
4087
|
+
}
|
|
4093
4088
|
|
|
4094
4089
|
// src/components/content-variants/inlined-fns.ts
|
|
4095
4090
|
var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
@@ -4652,7 +4647,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4652
4647
|
}
|
|
4653
4648
|
|
|
4654
4649
|
// src/constants/sdk-version.ts
|
|
4655
|
-
var SDK_VERSION = "2.0.
|
|
4650
|
+
var SDK_VERSION = "2.0.3";
|
|
4656
4651
|
|
|
4657
4652
|
// src/functions/register.ts
|
|
4658
4653
|
var registry = {};
|
|
@@ -5304,7 +5299,13 @@ function ContentComponent(props) {
|
|
|
5304
5299
|
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
5305
5300
|
[
|
|
5306
5301
|
...getDefaultRegisteredComponents(),
|
|
5307
|
-
...props.customComponents
|
|
5302
|
+
...props.customComponents?.filter(({ models }) => {
|
|
5303
|
+
if (!models?.length)
|
|
5304
|
+
return true;
|
|
5305
|
+
if (!props.model)
|
|
5306
|
+
return true;
|
|
5307
|
+
return models.includes(props.model);
|
|
5308
|
+
}) || []
|
|
5308
5309
|
].reduce(
|
|
5309
5310
|
(acc, { component, ...info }) => ({
|
|
5310
5311
|
...acc,
|
|
@@ -5334,7 +5335,13 @@ function ContentComponent(props) {
|
|
|
5334
5335
|
apiVersion: props.apiVersion,
|
|
5335
5336
|
componentInfos: [
|
|
5336
5337
|
...getDefaultRegisteredComponents(),
|
|
5337
|
-
...props.customComponents
|
|
5338
|
+
...props.customComponents?.filter(({ models }) => {
|
|
5339
|
+
if (!models?.length)
|
|
5340
|
+
return true;
|
|
5341
|
+
if (!props.model)
|
|
5342
|
+
return true;
|
|
5343
|
+
return models.includes(props.model);
|
|
5344
|
+
}) || []
|
|
5338
5345
|
].reduce(
|
|
5339
5346
|
(acc, { component: _, ...info }) => ({
|
|
5340
5347
|
...acc,
|
|
@@ -5560,7 +5567,7 @@ function Symbol(props) {
|
|
|
5560
5567
|
function onUpdateFn_0() {
|
|
5561
5568
|
setContent();
|
|
5562
5569
|
}
|
|
5563
|
-
|
|
5570
|
+
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5564
5571
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5565
5572
|
nonce={props.builderContext.nonce}
|
|
5566
5573
|
isNestedRender={true}
|
package/lib/edge/dev.js
CHANGED
|
@@ -4709,7 +4709,7 @@ var getColumnsClass = (id2) => {
|
|
|
4709
4709
|
|
|
4710
4710
|
// src/blocks/columns/columns.tsx
|
|
4711
4711
|
var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
|
|
4712
|
-
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-
|
|
4712
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3ff242de {
|
|
4713
4713
|
display: flex;
|
|
4714
4714
|
line-height: normal;
|
|
4715
4715
|
}`);
|
|
@@ -4789,6 +4789,7 @@ function Columns(props) {
|
|
|
4789
4789
|
return breakpointSizes[size].max;
|
|
4790
4790
|
}
|
|
4791
4791
|
function columnsStyles() {
|
|
4792
|
+
const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
|
|
4792
4793
|
return `
|
|
4793
4794
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4794
4795
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4796,7 +4797,7 @@ function Columns(props) {
|
|
|
4796
4797
|
align-items: stretch;
|
|
4797
4798
|
}
|
|
4798
4799
|
|
|
4799
|
-
|
|
4800
|
+
${childColumnDiv} {
|
|
4800
4801
|
width: var(--column-width-tablet) !important;
|
|
4801
4802
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
4802
4803
|
}
|
|
@@ -4808,7 +4809,7 @@ function Columns(props) {
|
|
|
4808
4809
|
align-items: stretch;
|
|
4809
4810
|
}
|
|
4810
4811
|
|
|
4811
|
-
|
|
4812
|
+
${childColumnDiv} {
|
|
4812
4813
|
width: var(--column-width-mobile) !important;
|
|
4813
4814
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
4814
4815
|
}
|
|
@@ -4829,7 +4830,7 @@ function Columns(props) {
|
|
|
4829
4830
|
const _el$ = _tmpl$3();
|
|
4830
4831
|
spread(_el$, mergeProps({
|
|
4831
4832
|
get ["class"]() {
|
|
4832
|
-
return getColumnsClass(props.builderBlock?.id) + " div-
|
|
4833
|
+
return getColumnsClass(props.builderBlock?.id) + " div-3ff242de";
|
|
4833
4834
|
},
|
|
4834
4835
|
get style() {
|
|
4835
4836
|
return columnsCssVars();
|
|
@@ -4954,16 +4955,16 @@ function getSrcSet(url) {
|
|
|
4954
4955
|
// src/blocks/image/image.tsx
|
|
4955
4956
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
4956
4957
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
4957
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
4958
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
4959
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
4958
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-e3b1053e">`);
|
|
4959
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-e3b1053e-2>`);
|
|
4960
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-e3b1053e {
|
|
4960
4961
|
opacity: 1;
|
|
4961
4962
|
transition: opacity 0.2s ease-in-out;
|
|
4962
|
-
}.div-
|
|
4963
|
+
}.div-e3b1053e {
|
|
4963
4964
|
width: 100%;
|
|
4964
4965
|
pointer-events: none;
|
|
4965
4966
|
font-size: 0;
|
|
4966
|
-
}.div-
|
|
4967
|
+
}.div-e3b1053e-2 {
|
|
4967
4968
|
display: flex;
|
|
4968
4969
|
flex-direction: column;
|
|
4969
4970
|
align-items: stretch;
|
|
@@ -4982,6 +4983,9 @@ function Image(props) {
|
|
|
4982
4983
|
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
4983
4984
|
return props.srcset;
|
|
4984
4985
|
}
|
|
4986
|
+
if (props.noWebp) {
|
|
4987
|
+
return void 0;
|
|
4988
|
+
}
|
|
4985
4989
|
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
4986
4990
|
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
4987
4991
|
console.debug("Removed given srcset");
|
|
@@ -5023,7 +5027,7 @@ function Image(props) {
|
|
|
5023
5027
|
}
|
|
5024
5028
|
}), _el$3);
|
|
5025
5029
|
effect((_p$) => {
|
|
5026
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
5030
|
+
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
|
|
5027
5031
|
"object-position": props.backgroundPosition || "center",
|
|
5028
5032
|
"object-fit": props.backgroundSize || "cover",
|
|
5029
5033
|
...aspectRatioCss()
|
|
@@ -7718,17 +7722,14 @@ var serializeFn = (fnValue) => {
|
|
|
7718
7722
|
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
7719
7723
|
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
7720
7724
|
};
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
}
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
[key]: serializeValue(value)
|
|
7730
|
-
}), {}))
|
|
7731
|
-
});
|
|
7725
|
+
function serializeComponentInfo(info) {
|
|
7726
|
+
return JSON.parse(JSON.stringify(info, (key, value) => {
|
|
7727
|
+
if (typeof value === "function") {
|
|
7728
|
+
return serializeFn(value);
|
|
7729
|
+
}
|
|
7730
|
+
return value;
|
|
7731
|
+
}));
|
|
7732
|
+
}
|
|
7732
7733
|
|
|
7733
7734
|
// src/components/content-variants/inlined-fns.ts
|
|
7734
7735
|
var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
@@ -8294,7 +8295,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
8294
8295
|
}
|
|
8295
8296
|
|
|
8296
8297
|
// src/constants/sdk-version.ts
|
|
8297
|
-
var SDK_VERSION = "2.0.
|
|
8298
|
+
var SDK_VERSION = "2.0.3";
|
|
8298
8299
|
|
|
8299
8300
|
// src/functions/register.ts
|
|
8300
8301
|
var registry = {};
|
|
@@ -8929,7 +8930,15 @@ function ContentComponent(props) {
|
|
|
8929
8930
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8930
8931
|
contentId: props.content?.id
|
|
8931
8932
|
}));
|
|
8932
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents
|
|
8933
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents?.filter(({
|
|
8934
|
+
models
|
|
8935
|
+
}) => {
|
|
8936
|
+
if (!models?.length)
|
|
8937
|
+
return true;
|
|
8938
|
+
if (!props.model)
|
|
8939
|
+
return true;
|
|
8940
|
+
return models.includes(props.model);
|
|
8941
|
+
}) || []].reduce((acc, {
|
|
8933
8942
|
component,
|
|
8934
8943
|
...info
|
|
8935
8944
|
}) => ({
|
|
@@ -8955,7 +8964,15 @@ function ContentComponent(props) {
|
|
|
8955
8964
|
canTrack: props.canTrack,
|
|
8956
8965
|
apiKey: props.apiKey,
|
|
8957
8966
|
apiVersion: props.apiVersion,
|
|
8958
|
-
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents
|
|
8967
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents?.filter(({
|
|
8968
|
+
models
|
|
8969
|
+
}) => {
|
|
8970
|
+
if (!models?.length)
|
|
8971
|
+
return true;
|
|
8972
|
+
if (!props.model)
|
|
8973
|
+
return true;
|
|
8974
|
+
return models.includes(props.model);
|
|
8975
|
+
}) || []].reduce((acc, {
|
|
8959
8976
|
component: _,
|
|
8960
8977
|
...info
|
|
8961
8978
|
}) => ({
|
package/lib/edge/dev.jsx
CHANGED
|
@@ -4612,6 +4612,7 @@ function Columns(props) {
|
|
|
4612
4612
|
return breakpointSizes[size].max;
|
|
4613
4613
|
}
|
|
4614
4614
|
function columnsStyles() {
|
|
4615
|
+
const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
|
|
4615
4616
|
return `
|
|
4616
4617
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
4617
4618
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -4619,7 +4620,7 @@ function Columns(props) {
|
|
|
4619
4620
|
align-items: stretch;
|
|
4620
4621
|
}
|
|
4621
4622
|
|
|
4622
|
-
|
|
4623
|
+
${childColumnDiv} {
|
|
4623
4624
|
width: var(--column-width-tablet) !important;
|
|
4624
4625
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
4625
4626
|
}
|
|
@@ -4631,7 +4632,7 @@ function Columns(props) {
|
|
|
4631
4632
|
align-items: stretch;
|
|
4632
4633
|
}
|
|
4633
4634
|
|
|
4634
|
-
|
|
4635
|
+
${childColumnDiv} {
|
|
4635
4636
|
width: var(--column-width-mobile) !important;
|
|
4636
4637
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
4637
4638
|
}
|
|
@@ -4650,7 +4651,7 @@ function Columns(props) {
|
|
|
4650
4651
|
}
|
|
4651
4652
|
return <>
|
|
4652
4653
|
<div
|
|
4653
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
4654
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-3ff242de"}
|
|
4654
4655
|
style={columnsCssVars()}
|
|
4655
4656
|
{...{}}
|
|
4656
4657
|
>
|
|
@@ -4679,7 +4680,7 @@ function Columns(props) {
|
|
|
4679
4680
|
/></Dynamic_renderer_default>;
|
|
4680
4681
|
}}</For4>
|
|
4681
4682
|
</div>
|
|
4682
|
-
<style>{`.div-
|
|
4683
|
+
<style>{`.div-3ff242de {
|
|
4683
4684
|
display: flex;
|
|
4684
4685
|
line-height: normal;
|
|
4685
4686
|
}`}</style>
|
|
@@ -4753,6 +4754,9 @@ function Image(props) {
|
|
|
4753
4754
|
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
4754
4755
|
return props.srcset;
|
|
4755
4756
|
}
|
|
4757
|
+
if (props.noWebp) {
|
|
4758
|
+
return void 0;
|
|
4759
|
+
}
|
|
4756
4760
|
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
4757
4761
|
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
4758
4762
|
console.debug("Removed given srcset");
|
|
@@ -4786,7 +4790,7 @@ function Image(props) {
|
|
|
4786
4790
|
<picture>
|
|
4787
4791
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
4788
4792
|
<img
|
|
4789
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
4793
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " img-e3b1053e"}
|
|
4790
4794
|
loading={props.highPriority ? "eager" : "lazy"}
|
|
4791
4795
|
fetchpriority={props.highPriority ? "high" : "auto"}
|
|
4792
4796
|
alt={props.altText}
|
|
@@ -4804,22 +4808,22 @@ function Image(props) {
|
|
|
4804
4808
|
<Show7
|
|
4805
4809
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
4806
4810
|
><div
|
|
4807
|
-
class="builder-image-sizer div-
|
|
4811
|
+
class="builder-image-sizer div-e3b1053e"
|
|
4808
4812
|
style={{
|
|
4809
4813
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
4810
4814
|
}}
|
|
4811
4815
|
/></Show7>
|
|
4812
4816
|
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
4813
|
-
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-
|
|
4817
|
+
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-e3b1053e-2">{props.children}</div></Show7>
|
|
4814
4818
|
</>
|
|
4815
|
-
<style>{`.img-
|
|
4819
|
+
<style>{`.img-e3b1053e {
|
|
4816
4820
|
opacity: 1;
|
|
4817
4821
|
transition: opacity 0.2s ease-in-out;
|
|
4818
|
-
}.div-
|
|
4822
|
+
}.div-e3b1053e {
|
|
4819
4823
|
width: 100%;
|
|
4820
4824
|
pointer-events: none;
|
|
4821
4825
|
font-size: 0;
|
|
4822
|
-
}.div-
|
|
4826
|
+
}.div-e3b1053e-2 {
|
|
4823
4827
|
display: flex;
|
|
4824
4828
|
flex-direction: column;
|
|
4825
4829
|
align-items: stretch;
|
|
@@ -4855,16 +4859,10 @@ function SectionComponent(props) {
|
|
|
4855
4859
|
var section_default = SectionComponent;
|
|
4856
4860
|
|
|
4857
4861
|
// src/blocks/symbol/symbol.tsx
|
|
4858
|
-
import { onMount as onMount5, on as
|
|
4862
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
4859
4863
|
|
|
4860
4864
|
// src/components/content-variants/content-variants.tsx
|
|
4861
|
-
import {
|
|
4862
|
-
Show as Show14,
|
|
4863
|
-
For as For9,
|
|
4864
|
-
onMount as onMount4,
|
|
4865
|
-
createMemo as createMemo18,
|
|
4866
|
-
createSignal as createSignal18
|
|
4867
|
-
} from "solid-js";
|
|
4865
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
4868
4866
|
|
|
4869
4867
|
// src/helpers/url.ts
|
|
4870
4868
|
var getTopLevelDomain = (host) => {
|
|
@@ -7237,17 +7235,14 @@ var serializeFn = (fnValue) => {
|
|
|
7237
7235
|
const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
|
|
7238
7236
|
return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
|
|
7239
7237
|
};
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
}
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
[key]: serializeValue(value)
|
|
7249
|
-
}), {}))
|
|
7250
|
-
});
|
|
7238
|
+
function serializeComponentInfo(info) {
|
|
7239
|
+
return JSON.parse(JSON.stringify(info, (key, value) => {
|
|
7240
|
+
if (typeof value === "function") {
|
|
7241
|
+
return serializeFn(value);
|
|
7242
|
+
}
|
|
7243
|
+
return value;
|
|
7244
|
+
}));
|
|
7245
|
+
}
|
|
7251
7246
|
|
|
7252
7247
|
// src/components/content-variants/inlined-fns.ts
|
|
7253
7248
|
var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
@@ -7815,7 +7810,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7815
7810
|
}
|
|
7816
7811
|
|
|
7817
7812
|
// src/constants/sdk-version.ts
|
|
7818
|
-
var SDK_VERSION = "2.0.
|
|
7813
|
+
var SDK_VERSION = "2.0.3";
|
|
7819
7814
|
|
|
7820
7815
|
// src/functions/register.ts
|
|
7821
7816
|
var registry = {};
|
|
@@ -8469,7 +8464,13 @@ function ContentComponent(props) {
|
|
|
8469
8464
|
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
8470
8465
|
[
|
|
8471
8466
|
...getDefaultRegisteredComponents(),
|
|
8472
|
-
...props.customComponents
|
|
8467
|
+
...props.customComponents?.filter(({ models }) => {
|
|
8468
|
+
if (!models?.length)
|
|
8469
|
+
return true;
|
|
8470
|
+
if (!props.model)
|
|
8471
|
+
return true;
|
|
8472
|
+
return models.includes(props.model);
|
|
8473
|
+
}) || []
|
|
8473
8474
|
].reduce(
|
|
8474
8475
|
(acc, { component, ...info }) => ({
|
|
8475
8476
|
...acc,
|
|
@@ -8499,7 +8500,13 @@ function ContentComponent(props) {
|
|
|
8499
8500
|
apiVersion: props.apiVersion,
|
|
8500
8501
|
componentInfos: [
|
|
8501
8502
|
...getDefaultRegisteredComponents(),
|
|
8502
|
-
...props.customComponents
|
|
8503
|
+
...props.customComponents?.filter(({ models }) => {
|
|
8504
|
+
if (!models?.length)
|
|
8505
|
+
return true;
|
|
8506
|
+
if (!props.model)
|
|
8507
|
+
return true;
|
|
8508
|
+
return models.includes(props.model);
|
|
8509
|
+
}) || []
|
|
8503
8510
|
].reduce(
|
|
8504
8511
|
(acc, { component: _, ...info }) => ({
|
|
8505
8512
|
...acc,
|
|
@@ -8725,7 +8732,7 @@ function Symbol2(props) {
|
|
|
8725
8732
|
function onUpdateFn_0() {
|
|
8726
8733
|
setContent();
|
|
8727
8734
|
}
|
|
8728
|
-
|
|
8735
|
+
createEffect3(on3(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8729
8736
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
8730
8737
|
nonce={props.builderContext.nonce}
|
|
8731
8738
|
isNestedRender={true}
|