@builder.io/sdk-react-nextjs 0.18.10 → 0.18.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks/image/image.cjs +4 -4
- package/lib/browser/blocks/image/image.mjs +19 -17
- package/lib/browser/blocks/text/component-info.cjs +1 -1
- package/lib/browser/blocks/text/component-info.mjs +1 -4
- package/lib/browser/components/block/block.cjs +1 -1
- package/lib/browser/components/block/block.helpers.cjs +2 -2
- package/lib/browser/components/block/block.helpers.mjs +19 -18
- package/lib/browser/components/block/block.mjs +34 -34
- package/lib/browser/components/block/components/interactive-element.cjs +1 -1
- package/lib/browser/components/block/components/interactive-element.mjs +10 -7
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/edge/blocks/image/image.cjs +4 -4
- package/lib/edge/blocks/image/image.mjs +19 -17
- package/lib/edge/blocks/text/component-info.cjs +1 -1
- package/lib/edge/blocks/text/component-info.mjs +1 -4
- package/lib/edge/components/block/block.cjs +1 -1
- package/lib/edge/components/block/block.helpers.cjs +2 -2
- package/lib/edge/components/block/block.helpers.mjs +19 -18
- package/lib/edge/components/block/block.mjs +34 -34
- package/lib/edge/components/block/components/interactive-element.cjs +1 -1
- package/lib/edge/components/block/components/interactive-element.mjs +10 -7
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/node/blocks/image/image.cjs +4 -4
- package/lib/node/blocks/image/image.mjs +19 -17
- package/lib/node/blocks/text/component-info.cjs +1 -1
- package/lib/node/blocks/text/component-info.mjs +1 -4
- package/lib/node/components/block/block.cjs +1 -1
- package/lib/node/components/block/block.helpers.cjs +2 -2
- package/lib/node/components/block/block.helpers.mjs +19 -18
- package/lib/node/components/block/block.mjs +34 -34
- package/lib/node/components/block/components/interactive-element.cjs +1 -1
- package/lib/node/components/block/components/interactive-element.mjs +10 -7
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/package.json +1 -1
- package/types/cjs/components/block/block.helpers.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/components/block/block.helpers.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),f=require("react"),c=require("./image.helpers.cjs");function b(e){var s,r,u,o,d,g;function n(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(i)}else if(e.image&&!e.srcset)return c.getSrcSet(i);return c.getSrcSet(i)}}function l(){var a;return(a=n==null?void 0:n())!=null&&a.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const a={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?a:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[l()?t.jsx("source",{type:"image/webp",srcSet:l()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0aa95e74",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-0aa95e74",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(o=(u=e.builderBlock)==null?void 0:u.children)!=null&&o.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(d=e.builderBlock)==null?void 0:d.children)!=null&&g.length)?t.jsx("div",{className:"div-0aa95e74-2",children:e.children}):null]}),t.jsx("style",{children:`.img-0aa95e74 {
|
|
2
2
|
opacity: 1;
|
|
3
3
|
transition: opacity 0.2s ease-in-out;
|
|
4
|
-
}.div-
|
|
4
|
+
}.div-0aa95e74 {
|
|
5
5
|
width: 100%;
|
|
6
6
|
pointer-events: none;
|
|
7
7
|
font-size: 0;
|
|
8
|
-
}.div-
|
|
8
|
+
}.div-0aa95e74-2 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
left: 0;
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 100%;
|
|
17
|
-
}`})]})}module.exports=
|
|
17
|
+
}`})]})}module.exports=b;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as l, Fragment as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as v } from "react";
|
|
3
4
|
import { getSrcSet as o } from "./image.helpers.mjs";
|
|
4
|
-
function
|
|
5
|
-
var d, u, s, g,
|
|
5
|
+
function w(e) {
|
|
6
|
+
var d, u, s, g, m, h;
|
|
6
7
|
function n() {
|
|
7
8
|
var f;
|
|
8
9
|
const i = e.image || e.src;
|
|
@@ -20,22 +21,23 @@ function x(e) {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
function r() {
|
|
23
|
-
var
|
|
24
|
-
return (
|
|
24
|
+
var a;
|
|
25
|
+
return (a = n == null ? void 0 : n()) != null && a.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
|
|
25
26
|
}
|
|
26
27
|
function b() {
|
|
27
|
-
const
|
|
28
|
+
const a = {
|
|
28
29
|
position: "absolute",
|
|
29
30
|
height: "100%",
|
|
30
31
|
width: "100%",
|
|
31
32
|
left: "0px",
|
|
32
33
|
top: "0px"
|
|
33
34
|
};
|
|
34
|
-
return e.aspectRatio ?
|
|
35
|
+
return e.aspectRatio ? a : void 0;
|
|
35
36
|
}
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
return v(() => {
|
|
38
|
+
}, []), /* @__PURE__ */ l(c, { children: [
|
|
39
|
+
/* @__PURE__ */ l(c, { children: [
|
|
40
|
+
/* @__PURE__ */ l("picture", { children: [
|
|
39
41
|
r() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: r() }) : null,
|
|
40
42
|
/* @__PURE__ */ t(
|
|
41
43
|
"img",
|
|
@@ -50,7 +52,7 @@ function x(e) {
|
|
|
50
52
|
objectFit: e.backgroundSize || "cover",
|
|
51
53
|
...b()
|
|
52
54
|
},
|
|
53
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
55
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-0aa95e74",
|
|
54
56
|
src: e.image,
|
|
55
57
|
srcSet: n(),
|
|
56
58
|
sizes: e.sizes
|
|
@@ -60,23 +62,23 @@ function x(e) {
|
|
|
60
62
|
e.aspectRatio && !((u = (d = e.builderBlock) == null ? void 0 : d.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
|
|
61
63
|
"div",
|
|
62
64
|
{
|
|
63
|
-
className: "builder-image-sizer div-
|
|
65
|
+
className: "builder-image-sizer div-0aa95e74",
|
|
64
66
|
style: {
|
|
65
67
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
) : null,
|
|
69
71
|
(g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length && e.fitContent ? /* @__PURE__ */ t(c, { children: e.children }) : null,
|
|
70
|
-
!e.fitContent && ((
|
|
72
|
+
!e.fitContent && ((h = (m = e.builderBlock) == null ? void 0 : m.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-0aa95e74-2", children: e.children }) : null
|
|
71
73
|
] }),
|
|
72
|
-
/* @__PURE__ */ t("style", { children: `.img-
|
|
74
|
+
/* @__PURE__ */ t("style", { children: `.img-0aa95e74 {
|
|
73
75
|
opacity: 1;
|
|
74
76
|
transition: opacity 0.2s ease-in-out;
|
|
75
|
-
}.div-
|
|
77
|
+
}.div-0aa95e74 {
|
|
76
78
|
width: 100%;
|
|
77
79
|
pointer-events: none;
|
|
78
80
|
font-size: 0;
|
|
79
|
-
}.div-
|
|
81
|
+
}.div-0aa95e74-2 {
|
|
80
82
|
display: flex;
|
|
81
83
|
flex-direction: column;
|
|
82
84
|
align-items: stretch;
|
|
@@ -89,5 +91,5 @@ function x(e) {
|
|
|
89
91
|
] });
|
|
90
92
|
}
|
|
91
93
|
export {
|
|
92
|
-
|
|
94
|
+
w as default
|
|
93
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};exports.componentInfo=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),S=require("../../functions/get-block-component-options.cjs"),j=require("../../functions/get-processed-block.cjs"),P=require("../../functions/is-previewing.cjs");require("../../functions/get-fetch.cjs");const
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),S=require("../../functions/get-block-component-options.cjs"),j=require("../../functions/get-processed-block.cjs"),P=require("../../functions/is-previewing.cjs");require("../../functions/get-fetch.cjs");const d=require("./block.helpers.cjs"),q=require("./components/block-styles.cjs"),O=require("./components/block-wrapper.cjs"),h=require("./components/component-ref/component-ref.cjs"),p=require("./components/repeated-block.cjs");function b(e){var a,C,x,g;const m=function(){return d.getRepeatItemData({block:e.block,context:e.context})},u={value:null,update:!1},c=function(){var i;if(u.value&&!u.update&&!P.isPreviewing())return u.value;const r=(i=e.block.repeat)!=null&&i.collection?e.block:j.getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return u.value=r,u.update=!1,r},l=function(){return d.getComponent({block:c(),registeredComponents:e.registeredComponents,model:e.context.model})},f=function(){var i;return e.block.tagName==="a"||((i=c().properties)==null?void 0:i.href)||c().href?e.linkComponent||"a":e.block.tagName||"div"},B=function(){var s,k;if((s=e.block.repeat)!=null&&s.collection)return!!((k=m())!=null&&k.length);const r="hide"in c()?c().hide:!1;return("show"in c()?c().show:!0)&&!r},R=function(){var i,s;return!((i=l())!=null&&i.component)&&!m()?(s=c().children)!=null?s:[]:[]},n=function(){var r,i,s,k;return{blockChildren:(r=c().children)!=null?r:[],componentRef:(i=l())==null?void 0:i.component,componentOptions:{...S.getBlockComponentOptions(c(),e.context),...d.provideBuilderBlock(l(),c()),...d.provideBuilderContext(l(),e.context),...d.provideLinkComponent(l(),e.linkComponent),...d.provideRegisteredComponents(l(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:c(),includeBlockProps:((s=l())==null?void 0:s.noWrap)===!0,isInteractive:!((k=l())!=null&&k.isRSC&&v.TARGET==="rsc")}};return t.jsx(t.Fragment,{children:B()?t.jsxs(t.Fragment,{children:[t.jsx(q,{block:c(),context:e.context}),(a=l())!=null&&a.noWrap?m()?t.jsx(t.Fragment,{children:(g=m())==null?void 0:g.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}):t.jsx(t.Fragment,{children:m()?t.jsx(t.Fragment,{children:(x=m())==null?void 0:x.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsxs(O,{Wrapper:f(),block:c(),context:e.context,children:[t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}),(C=R())==null?void 0:C.map(o=>t.jsx(b,{block:o,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},o.id))]})})]}):null})}module.exports=b;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../functions/evaluate/evaluate.cjs"),a=(e,t)=>e?t?e.models&&e.models.length>0&&!e.models.includes(t):!1:!0,p=({block:e,registeredComponents:t,model:r})=>{var i;const o=(i=e.component)==null?void 0:i.name;if(!o)return null;const n=t[o];if(!n||a(n,r)){console.warn(`
|
|
2
2
|
Could not find a registered component named "${o}".
|
|
3
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return n},m=({block:e,context:t})=>{const{repeat:r,...o}=e;if(!(r!=null&&r.collection))return;const n=
|
|
3
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return n},m=({block:e,context:t})=>{const{repeat:r,...o}=e;if(!(r!=null&&r.collection))return;const n=l.evaluate({code:r.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(n))return;const i=r.collection.split(".").pop(),s=r.itemName||(i?i+"Item":"item");return n.map((d,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:d,[s]:d,[`$${s}Index`]:u}},block:o}))},c=(e,t)=>{var r;return(r=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&r.builderLinkComponent?{builderLinkComponent:t}:{}},f=(e,t,r)=>{var o;return(o=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&o.builderComponents?{builderComponents:Object.fromEntries(Object.entries(t).filter(([i,s])=>!a(s,r)))}:{}},v=(e,t)=>{var r;return(r=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&r.builderBlock?{builderBlock:t}:{}},C=(e,t)=>{var r;return(r=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&r.builderContext?{builderContext:t}:{}},g=e=>e.toString();exports.generateKey=g;exports.getComponent=p;exports.getRepeatItemData=m;exports.provideBuilderBlock=v;exports.provideBuilderContext=C;exports.provideLinkComponent=c;exports.provideRegisteredComponents=f;
|
|
@@ -5,38 +5,38 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
|
|
|
5
5
|
model: r
|
|
6
6
|
}) => {
|
|
7
7
|
var i;
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
8
|
+
const n = (i = e.component) == null ? void 0 : i.name;
|
|
9
|
+
if (!n)
|
|
10
10
|
return null;
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
11
|
+
const o = t[n];
|
|
12
|
+
if (!o || l(o, r)) {
|
|
13
13
|
console.warn(`
|
|
14
|
-
Could not find a registered component named "${
|
|
14
|
+
Could not find a registered component named "${n}".
|
|
15
15
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
16
16
|
return;
|
|
17
17
|
} else
|
|
18
|
-
return
|
|
18
|
+
return o;
|
|
19
19
|
}, f = ({
|
|
20
20
|
block: e,
|
|
21
21
|
context: t
|
|
22
22
|
}) => {
|
|
23
23
|
const {
|
|
24
24
|
repeat: r,
|
|
25
|
-
...
|
|
25
|
+
...n
|
|
26
26
|
} = e;
|
|
27
27
|
if (!(r != null && r.collection))
|
|
28
28
|
return;
|
|
29
|
-
const
|
|
29
|
+
const o = a({
|
|
30
30
|
code: r.collection,
|
|
31
31
|
localState: t.localState,
|
|
32
32
|
rootState: t.rootState,
|
|
33
33
|
rootSetState: t.rootSetState,
|
|
34
34
|
context: t.context
|
|
35
35
|
});
|
|
36
|
-
if (!Array.isArray(
|
|
36
|
+
if (!Array.isArray(o))
|
|
37
37
|
return;
|
|
38
38
|
const i = r.collection.split(".").pop(), s = r.itemName || (i ? i + "Item" : "item");
|
|
39
|
-
return
|
|
39
|
+
return o.map((d, u) => ({
|
|
40
40
|
context: {
|
|
41
41
|
...t,
|
|
42
42
|
localState: {
|
|
@@ -47,7 +47,7 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
|
|
|
47
47
|
[`$${s}Index`]: u
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
block:
|
|
50
|
+
block: n
|
|
51
51
|
}));
|
|
52
52
|
}, C = (e, t) => {
|
|
53
53
|
var r;
|
|
@@ -55,26 +55,27 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
|
|
|
55
55
|
builderLinkComponent: t
|
|
56
56
|
} : {};
|
|
57
57
|
}, v = (e, t, r) => {
|
|
58
|
-
var
|
|
59
|
-
return (
|
|
58
|
+
var n;
|
|
59
|
+
return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderComponents ? {
|
|
60
60
|
builderComponents: Object.fromEntries(Object.entries(t).filter(([i, s]) => !l(s, r)))
|
|
61
61
|
} : {};
|
|
62
|
-
},
|
|
62
|
+
}, g = (e, t) => {
|
|
63
63
|
var r;
|
|
64
64
|
return (r = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && r.builderBlock ? {
|
|
65
65
|
builderBlock: t
|
|
66
66
|
} : {};
|
|
67
|
-
},
|
|
67
|
+
}, h = (e, t) => {
|
|
68
68
|
var r;
|
|
69
69
|
return (r = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && r.builderContext ? {
|
|
70
70
|
builderContext: t
|
|
71
71
|
} : {};
|
|
72
|
-
};
|
|
72
|
+
}, S = (e) => e.toString();
|
|
73
73
|
export {
|
|
74
|
+
S as generateKey,
|
|
74
75
|
c as getComponent,
|
|
75
76
|
f as getRepeatItemData,
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
g as provideBuilderBlock,
|
|
78
|
+
h as provideBuilderContext,
|
|
78
79
|
C as provideLinkComponent,
|
|
79
80
|
v as provideRegisteredComponents
|
|
80
81
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as l, Fragment as u, jsxs as h } from "react/jsx-runtime";
|
|
2
|
-
import { TARGET as
|
|
3
|
-
import { getBlockComponentOptions as
|
|
4
|
-
import { getProcessedBlock as
|
|
5
|
-
import { isPreviewing as
|
|
2
|
+
import { TARGET as S } from "../../constants/target.mjs";
|
|
3
|
+
import { getBlockComponentOptions as P } from "../../functions/get-block-component-options.mjs";
|
|
4
|
+
import { getProcessedBlock as I } from "../../functions/get-processed-block.mjs";
|
|
5
|
+
import { isPreviewing as O } from "../../functions/is-previewing.mjs";
|
|
6
6
|
import "../../functions/get-fetch.mjs";
|
|
7
|
-
import { getRepeatItemData as
|
|
8
|
-
import
|
|
7
|
+
import { generateKey as x, getRepeatItemData as w, getComponent as W, provideBuilderBlock as T, provideBuilderContext as L, provideLinkComponent as U, provideRegisteredComponents as j } from "./block.helpers.mjs";
|
|
8
|
+
import y from "./components/block-styles.mjs";
|
|
9
9
|
import N from "./components/block-wrapper.mjs";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
function
|
|
10
|
+
import b from "./components/component-ref/component-ref.mjs";
|
|
11
|
+
import g from "./components/repeated-block.mjs";
|
|
12
|
+
function A(e) {
|
|
13
13
|
var a, C, p, f;
|
|
14
14
|
const d = function() {
|
|
15
|
-
return
|
|
15
|
+
return w({
|
|
16
16
|
block: e.block,
|
|
17
17
|
context: e.context
|
|
18
18
|
});
|
|
@@ -21,9 +21,9 @@ function y(e) {
|
|
|
21
21
|
update: !1
|
|
22
22
|
}, n = function() {
|
|
23
23
|
var i;
|
|
24
|
-
if (s.value && !s.update && !
|
|
24
|
+
if (s.value && !s.update && !O())
|
|
25
25
|
return s.value;
|
|
26
|
-
const c = (i = e.block.repeat) != null && i.collection ? e.block :
|
|
26
|
+
const c = (i = e.block.repeat) != null && i.collection ? e.block : I({
|
|
27
27
|
block: e.block,
|
|
28
28
|
localState: e.context.localState,
|
|
29
29
|
rootState: e.context.rootState,
|
|
@@ -32,21 +32,21 @@ function y(e) {
|
|
|
32
32
|
});
|
|
33
33
|
return s.value = c, s.update = !1, c;
|
|
34
34
|
}, r = function() {
|
|
35
|
-
return
|
|
35
|
+
return W({
|
|
36
36
|
block: n(),
|
|
37
37
|
registeredComponents: e.registeredComponents,
|
|
38
38
|
model: e.context.model
|
|
39
39
|
});
|
|
40
|
-
},
|
|
40
|
+
}, B = function() {
|
|
41
41
|
var i;
|
|
42
42
|
return e.block.tagName === "a" || ((i = n().properties) == null ? void 0 : i.href) || n().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
43
|
-
},
|
|
43
|
+
}, R = function() {
|
|
44
44
|
var m, k;
|
|
45
45
|
if ((m = e.block.repeat) != null && m.collection)
|
|
46
46
|
return !!((k = d()) != null && k.length);
|
|
47
47
|
const c = "hide" in n() ? n().hide : !1;
|
|
48
48
|
return ("show" in n() ? n().show : !0) && !c;
|
|
49
|
-
},
|
|
49
|
+
}, v = function() {
|
|
50
50
|
var i, m;
|
|
51
51
|
return !((i = r()) != null && i.component) && !d() ? (m = n().children) != null ? m : [] : [];
|
|
52
52
|
}, o = function() {
|
|
@@ -55,11 +55,11 @@ function y(e) {
|
|
|
55
55
|
blockChildren: (c = n().children) != null ? c : [],
|
|
56
56
|
componentRef: (i = r()) == null ? void 0 : i.component,
|
|
57
57
|
componentOptions: {
|
|
58
|
-
...
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
...
|
|
62
|
-
...
|
|
58
|
+
...P(n(), e.context),
|
|
59
|
+
...T(r(), n()),
|
|
60
|
+
...L(r(), e.context),
|
|
61
|
+
...U(r(), e.linkComponent),
|
|
62
|
+
...j(
|
|
63
63
|
r(),
|
|
64
64
|
e.registeredComponents,
|
|
65
65
|
e.context.model
|
|
@@ -70,22 +70,22 @@ function y(e) {
|
|
|
70
70
|
registeredComponents: e.registeredComponents,
|
|
71
71
|
builderBlock: n(),
|
|
72
72
|
includeBlockProps: ((m = r()) == null ? void 0 : m.noWrap) === !0,
|
|
73
|
-
isInteractive: !((k = r()) != null && k.isRSC &&
|
|
73
|
+
isInteractive: !((k = r()) != null && k.isRSC && S === "rsc")
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
return /* @__PURE__ */ l(u, { children:
|
|
77
|
-
/* @__PURE__ */ l(
|
|
76
|
+
return /* @__PURE__ */ l(u, { children: R() ? /* @__PURE__ */ h(u, { children: [
|
|
77
|
+
/* @__PURE__ */ l(y, { block: n(), context: e.context }),
|
|
78
78
|
(a = r()) != null && a.noWrap ? d() ? /* @__PURE__ */ l(u, { children: (f = d()) == null ? void 0 : f.map((t, c) => /* @__PURE__ */ l(
|
|
79
|
-
|
|
79
|
+
g,
|
|
80
80
|
{
|
|
81
81
|
repeatContext: t.context,
|
|
82
82
|
block: t.block,
|
|
83
83
|
registeredComponents: e.registeredComponents,
|
|
84
84
|
linkComponent: e.linkComponent
|
|
85
85
|
},
|
|
86
|
-
c
|
|
86
|
+
x(c)
|
|
87
87
|
)) }) : /* @__PURE__ */ l(
|
|
88
|
-
|
|
88
|
+
b,
|
|
89
89
|
{
|
|
90
90
|
componentRef: o().componentRef,
|
|
91
91
|
componentOptions: o().componentOptions,
|
|
@@ -98,23 +98,23 @@ function y(e) {
|
|
|
98
98
|
isInteractive: o().isInteractive
|
|
99
99
|
}
|
|
100
100
|
) : /* @__PURE__ */ l(u, { children: d() ? /* @__PURE__ */ l(u, { children: (p = d()) == null ? void 0 : p.map((t, c) => /* @__PURE__ */ l(
|
|
101
|
-
|
|
101
|
+
g,
|
|
102
102
|
{
|
|
103
103
|
repeatContext: t.context,
|
|
104
104
|
block: t.block,
|
|
105
105
|
registeredComponents: e.registeredComponents,
|
|
106
106
|
linkComponent: e.linkComponent
|
|
107
107
|
},
|
|
108
|
-
c
|
|
108
|
+
x(c)
|
|
109
109
|
)) }) : /* @__PURE__ */ h(
|
|
110
110
|
N,
|
|
111
111
|
{
|
|
112
|
-
Wrapper:
|
|
112
|
+
Wrapper: B(),
|
|
113
113
|
block: n(),
|
|
114
114
|
context: e.context,
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ l(
|
|
117
|
-
|
|
117
|
+
b,
|
|
118
118
|
{
|
|
119
119
|
componentRef: o().componentRef,
|
|
120
120
|
componentOptions: o().componentOptions,
|
|
@@ -127,8 +127,8 @@ function y(e) {
|
|
|
127
127
|
isInteractive: o().isInteractive
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
(C =
|
|
131
|
-
|
|
130
|
+
(C = v()) == null ? void 0 : C.map((t) => /* @__PURE__ */ l(
|
|
131
|
+
A,
|
|
132
132
|
{
|
|
133
133
|
block: t,
|
|
134
134
|
registeredComponents: e.registeredComponents,
|
|
@@ -143,5 +143,5 @@ function y(e) {
|
|
|
143
143
|
] }) : null });
|
|
144
144
|
}
|
|
145
145
|
export {
|
|
146
|
-
|
|
146
|
+
A as default
|
|
147
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const e=require("react/jsx-runtime"),n=require("../../../functions/get-block-actions.cjs"),o=require("../../../functions/get-block-properties.cjs"),a=require("../../awaiter.cjs");function l(t){function r(){return t.includeBlockProps?{...o.getBlockProperties({block:t.block,context:t.context}),...n.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}function c(){return t.wrapperProps}return e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(a,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:r(),children:t.children})}):e.jsx(t.Wrapper,{...c(),attributes:r(),children:t.children})})}module.exports=l;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, Fragment as c } from "react/jsx-runtime";
|
|
3
|
-
import { getBlockActions as
|
|
4
|
-
import { getBlockProperties as
|
|
3
|
+
import { getBlockActions as a } from "../../../functions/get-block-actions.mjs";
|
|
4
|
+
import { getBlockProperties as n } from "../../../functions/get-block-properties.mjs";
|
|
5
5
|
import l from "../../awaiter.mjs";
|
|
6
|
-
function
|
|
6
|
+
function m(t) {
|
|
7
7
|
function r() {
|
|
8
8
|
return t.includeBlockProps ? {
|
|
9
|
-
...
|
|
9
|
+
...n({
|
|
10
10
|
block: t.block,
|
|
11
11
|
context: t.context
|
|
12
12
|
}),
|
|
13
|
-
...
|
|
13
|
+
...a({
|
|
14
14
|
block: t.block,
|
|
15
15
|
rootState: t.context.rootState,
|
|
16
16
|
rootSetState: t.context.rootSetState,
|
|
@@ -19,6 +19,9 @@ function u(t) {
|
|
|
19
19
|
})
|
|
20
20
|
} : {};
|
|
21
21
|
}
|
|
22
|
+
function o() {
|
|
23
|
+
return t.wrapperProps;
|
|
24
|
+
}
|
|
22
25
|
return /* @__PURE__ */ e(c, { children: t.Wrapper.load ? /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
|
|
23
26
|
l,
|
|
24
27
|
{
|
|
@@ -28,8 +31,8 @@ function u(t) {
|
|
|
28
31
|
attributes: r(),
|
|
29
32
|
children: t.children
|
|
30
33
|
}
|
|
31
|
-
) }) : /* @__PURE__ */ e(t.Wrapper, { ...
|
|
34
|
+
) }) : /* @__PURE__ */ e(t.Wrapper, { ...o(), attributes: r(), children: t.children }) });
|
|
32
35
|
}
|
|
33
36
|
export {
|
|
34
|
-
|
|
37
|
+
m as default
|
|
35
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.18.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.18.11";exports.SDK_VERSION=e;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),f=require("react"),c=require("./image.helpers.cjs");function b(e){var s,r,u,o,d,g;function n(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(i)}else if(e.image&&!e.srcset)return c.getSrcSet(i);return c.getSrcSet(i)}}function l(){var a;return(a=n==null?void 0:n())!=null&&a.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const a={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?a:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[l()?t.jsx("source",{type:"image/webp",srcSet:l()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0aa95e74",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-0aa95e74",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(o=(u=e.builderBlock)==null?void 0:u.children)!=null&&o.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(d=e.builderBlock)==null?void 0:d.children)!=null&&g.length)?t.jsx("div",{className:"div-0aa95e74-2",children:e.children}):null]}),t.jsx("style",{children:`.img-0aa95e74 {
|
|
2
2
|
opacity: 1;
|
|
3
3
|
transition: opacity 0.2s ease-in-out;
|
|
4
|
-
}.div-
|
|
4
|
+
}.div-0aa95e74 {
|
|
5
5
|
width: 100%;
|
|
6
6
|
pointer-events: none;
|
|
7
7
|
font-size: 0;
|
|
8
|
-
}.div-
|
|
8
|
+
}.div-0aa95e74-2 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
left: 0;
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 100%;
|
|
17
|
-
}`})]})}module.exports=
|
|
17
|
+
}`})]})}module.exports=b;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as l, Fragment as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as v } from "react";
|
|
3
4
|
import { getSrcSet as o } from "./image.helpers.mjs";
|
|
4
|
-
function
|
|
5
|
-
var d, u, s, g,
|
|
5
|
+
function w(e) {
|
|
6
|
+
var d, u, s, g, m, h;
|
|
6
7
|
function n() {
|
|
7
8
|
var f;
|
|
8
9
|
const i = e.image || e.src;
|
|
@@ -20,22 +21,23 @@ function x(e) {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
function r() {
|
|
23
|
-
var
|
|
24
|
-
return (
|
|
24
|
+
var a;
|
|
25
|
+
return (a = n == null ? void 0 : n()) != null && a.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
|
|
25
26
|
}
|
|
26
27
|
function b() {
|
|
27
|
-
const
|
|
28
|
+
const a = {
|
|
28
29
|
position: "absolute",
|
|
29
30
|
height: "100%",
|
|
30
31
|
width: "100%",
|
|
31
32
|
left: "0px",
|
|
32
33
|
top: "0px"
|
|
33
34
|
};
|
|
34
|
-
return e.aspectRatio ?
|
|
35
|
+
return e.aspectRatio ? a : void 0;
|
|
35
36
|
}
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
return v(() => {
|
|
38
|
+
}, []), /* @__PURE__ */ l(c, { children: [
|
|
39
|
+
/* @__PURE__ */ l(c, { children: [
|
|
40
|
+
/* @__PURE__ */ l("picture", { children: [
|
|
39
41
|
r() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: r() }) : null,
|
|
40
42
|
/* @__PURE__ */ t(
|
|
41
43
|
"img",
|
|
@@ -50,7 +52,7 @@ function x(e) {
|
|
|
50
52
|
objectFit: e.backgroundSize || "cover",
|
|
51
53
|
...b()
|
|
52
54
|
},
|
|
53
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
55
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-0aa95e74",
|
|
54
56
|
src: e.image,
|
|
55
57
|
srcSet: n(),
|
|
56
58
|
sizes: e.sizes
|
|
@@ -60,23 +62,23 @@ function x(e) {
|
|
|
60
62
|
e.aspectRatio && !((u = (d = e.builderBlock) == null ? void 0 : d.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
|
|
61
63
|
"div",
|
|
62
64
|
{
|
|
63
|
-
className: "builder-image-sizer div-
|
|
65
|
+
className: "builder-image-sizer div-0aa95e74",
|
|
64
66
|
style: {
|
|
65
67
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
) : null,
|
|
69
71
|
(g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length && e.fitContent ? /* @__PURE__ */ t(c, { children: e.children }) : null,
|
|
70
|
-
!e.fitContent && ((
|
|
72
|
+
!e.fitContent && ((h = (m = e.builderBlock) == null ? void 0 : m.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-0aa95e74-2", children: e.children }) : null
|
|
71
73
|
] }),
|
|
72
|
-
/* @__PURE__ */ t("style", { children: `.img-
|
|
74
|
+
/* @__PURE__ */ t("style", { children: `.img-0aa95e74 {
|
|
73
75
|
opacity: 1;
|
|
74
76
|
transition: opacity 0.2s ease-in-out;
|
|
75
|
-
}.div-
|
|
77
|
+
}.div-0aa95e74 {
|
|
76
78
|
width: 100%;
|
|
77
79
|
pointer-events: none;
|
|
78
80
|
font-size: 0;
|
|
79
|
-
}.div-
|
|
81
|
+
}.div-0aa95e74-2 {
|
|
80
82
|
display: flex;
|
|
81
83
|
flex-direction: column;
|
|
82
84
|
align-items: stretch;
|
|
@@ -89,5 +91,5 @@ function x(e) {
|
|
|
89
91
|
] });
|
|
90
92
|
}
|
|
91
93
|
export {
|
|
92
|
-
|
|
94
|
+
w as default
|
|
93
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};exports.componentInfo=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),S=require("../../functions/get-block-component-options.cjs"),j=require("../../functions/get-processed-block.cjs"),P=require("../../functions/is-previewing.cjs");require("../../functions/get-fetch.cjs");const
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),S=require("../../functions/get-block-component-options.cjs"),j=require("../../functions/get-processed-block.cjs"),P=require("../../functions/is-previewing.cjs");require("../../functions/get-fetch.cjs");const d=require("./block.helpers.cjs"),q=require("./components/block-styles.cjs"),O=require("./components/block-wrapper.cjs"),h=require("./components/component-ref/component-ref.cjs"),p=require("./components/repeated-block.cjs");function b(e){var a,C,x,g;const m=function(){return d.getRepeatItemData({block:e.block,context:e.context})},u={value:null,update:!1},c=function(){var i;if(u.value&&!u.update&&!P.isPreviewing())return u.value;const r=(i=e.block.repeat)!=null&&i.collection?e.block:j.getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return u.value=r,u.update=!1,r},l=function(){return d.getComponent({block:c(),registeredComponents:e.registeredComponents,model:e.context.model})},f=function(){var i;return e.block.tagName==="a"||((i=c().properties)==null?void 0:i.href)||c().href?e.linkComponent||"a":e.block.tagName||"div"},B=function(){var s,k;if((s=e.block.repeat)!=null&&s.collection)return!!((k=m())!=null&&k.length);const r="hide"in c()?c().hide:!1;return("show"in c()?c().show:!0)&&!r},R=function(){var i,s;return!((i=l())!=null&&i.component)&&!m()?(s=c().children)!=null?s:[]:[]},n=function(){var r,i,s,k;return{blockChildren:(r=c().children)!=null?r:[],componentRef:(i=l())==null?void 0:i.component,componentOptions:{...S.getBlockComponentOptions(c(),e.context),...d.provideBuilderBlock(l(),c()),...d.provideBuilderContext(l(),e.context),...d.provideLinkComponent(l(),e.linkComponent),...d.provideRegisteredComponents(l(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:c(),includeBlockProps:((s=l())==null?void 0:s.noWrap)===!0,isInteractive:!((k=l())!=null&&k.isRSC&&v.TARGET==="rsc")}};return t.jsx(t.Fragment,{children:B()?t.jsxs(t.Fragment,{children:[t.jsx(q,{block:c(),context:e.context}),(a=l())!=null&&a.noWrap?m()?t.jsx(t.Fragment,{children:(g=m())==null?void 0:g.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}):t.jsx(t.Fragment,{children:m()?t.jsx(t.Fragment,{children:(x=m())==null?void 0:x.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsxs(O,{Wrapper:f(),block:c(),context:e.context,children:[t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}),(C=R())==null?void 0:C.map(o=>t.jsx(b,{block:o,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},o.id))]})})]}):null})}module.exports=b;
|