@builder.io/sdk-react 3.0.7 → 4.0.0
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-exports.cjs +32 -32
- package/lib/browser/blocks-exports.mjs +946 -908
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-20c79b90.js → server-entry-422fad84.js} +26 -16
- package/lib/browser/server-entry-916191b4.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-071aa4f9.cjs → accordion-2f83fc75.cjs} +1 -1
- package/lib/edge/{accordion-22c2c037.js → accordion-e1b77652.js} +1 -1
- package/lib/edge/{blocks-2989e629.js → blocks-0885e182.js} +2 -2
- package/lib/edge/{blocks-d3f37507.cjs → blocks-5165c164.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-a2cc6565.cjs → button-d7197e96.cjs} +1 -1
- package/lib/edge/{button-2b5270c4.js → button-d878f35c.js} +2 -2
- package/lib/edge/{columns-b7240242.cjs → columns-46729516.cjs} +1 -1
- package/lib/edge/{columns-21b9be25.js → columns-b365c86a.js} +3 -3
- package/lib/edge/{content-variants-88f4dc64.js → content-variants-1594c868.js} +281 -279
- package/lib/edge/content-variants-c6cab1c3.cjs +134 -0
- package/lib/edge/{form-77687883.cjs → form-9844766c.cjs} +1 -1
- package/lib/edge/{form-d29f3cc0.js → form-b66c20a3.js} +3 -3
- package/lib/edge/{get-class-prop-name-f597545d.cjs → get-class-prop-name-0b992cfb.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-dbc5d99c.js → get-class-prop-name-dac81472.js} +1 -1
- package/lib/edge/{img-fed70928.js → img-c4a772a8.js} +1 -1
- package/lib/edge/{img-03f9002b.cjs → img-fb35350a.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-1e548fd0.cjs → input-122768ac.cjs} +1 -1
- package/lib/edge/{input-083c3c35.js → input-57c5b097.js} +1 -1
- package/lib/edge/{personalization-container-bcff3433.js → personalization-container-7e63edce.js} +4 -4
- package/lib/edge/{personalization-container-dde10a09.cjs → personalization-container-a17ae615.cjs} +1 -1
- package/lib/edge/{select-9f22c2ba.js → select-3d4324ef.js} +1 -1
- package/lib/edge/{select-21e33225.cjs → select-7f750b70.cjs} +1 -1
- package/lib/edge/server-entry-77166102.cjs +2 -0
- package/lib/edge/{server-entry-43a6f5be.js → server-entry-c1673af2.js} +28 -18
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-ca171e8c.js → slot-05ef18a0.js} +3 -3
- package/lib/edge/{slot-a9f5d6c0.cjs → slot-123c0993.cjs} +1 -1
- package/lib/edge/symbol-ee314d5a.cjs +1 -0
- package/lib/edge/{symbol-8f6ff028.js → symbol-f488bea0.js} +25 -25
- package/lib/edge/{tabs-6b67fca2.js → tabs-244d53fa.js} +3 -3
- package/lib/edge/{tabs-880c9088.cjs → tabs-edb82022.cjs} +1 -1
- package/lib/edge/{video-a3f10439.js → video-52df64e2.js} +54 -17
- package/lib/edge/video-cc58dd83.cjs +1 -0
- package/lib/node/blocks-exports.cjs +32 -32
- package/lib/node/blocks-exports.mjs +781 -743
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-6626257d.js → server-entry-4df60fc5.js} +26 -16
- package/lib/node/server-entry-8ab8c78b.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-5cb298bf.js → setIvm-0edfc727.js} +1 -1
- package/lib/node/{setIvm-49abbae6.cjs → setIvm-6405aa63.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-11e8399e.cjs → should-force-browser-runtime-in-node-6d4dbff9.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-94f1a5b3.js → should-force-browser-runtime-in-node-7a39b073.js} +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +2 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +13 -13
- package/types/scripts/init-editing.d.ts +3 -1
- package/lib/browser/server-entry-762e29e0.cjs +0 -2
- package/lib/edge/content-variants-fdd5ee50.cjs +0 -134
- package/lib/edge/server-entry-ac35a5c8.cjs +0 -2
- package/lib/edge/symbol-a2015c7e.cjs +0 -1
- package/lib/edge/video-4ecfd08b.cjs +0 -1
- package/lib/node/server-entry-0b433783.cjs +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Content as
|
|
4
|
-
import { getClassPropName as
|
|
5
|
-
import { fetchOneEntry as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useEffect as f } from "react";
|
|
3
|
+
import { Content as v } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as k } from "./get-class-prop-name-dac81472.js";
|
|
5
|
+
import { fetchOneEntry as h, logger as x } from "./server-entry-c1673af2.js";
|
|
6
|
+
const K = async ({
|
|
7
7
|
builderContextValue: e,
|
|
8
8
|
symbol: t
|
|
9
9
|
}) => {
|
|
10
10
|
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
11
11
|
(e != null && e.apiKey))
|
|
12
|
-
return
|
|
12
|
+
return h({
|
|
13
13
|
model: t.model,
|
|
14
14
|
apiKey: e.apiKey,
|
|
15
15
|
apiVersion: e.apiVersion,
|
|
@@ -19,43 +19,43 @@ const x = async ({
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}).catch((o) => {
|
|
22
|
-
|
|
22
|
+
x.error("Could not fetch symbol content: ", o);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
var r, a, c, d;
|
|
25
|
+
function B(e) {
|
|
26
|
+
var r, a, c, d, l;
|
|
27
27
|
function t() {
|
|
28
28
|
return "div";
|
|
29
29
|
}
|
|
30
30
|
function o() {
|
|
31
31
|
return "div";
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
var n,
|
|
33
|
+
function b() {
|
|
34
|
+
var n, m;
|
|
35
35
|
return [
|
|
36
|
-
e.attributes[
|
|
36
|
+
e.attributes[k()],
|
|
37
37
|
"builder-symbol",
|
|
38
38
|
(n = e.symbol) != null && n.inline ? "builder-inline-symbol" : void 0,
|
|
39
|
-
(
|
|
39
|
+
(m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
40
40
|
].filter(Boolean).join(" ");
|
|
41
41
|
}
|
|
42
|
-
const [i,
|
|
42
|
+
const [i, y] = C(() => {
|
|
43
43
|
var n;
|
|
44
44
|
return (n = e.symbol) == null ? void 0 : n.content;
|
|
45
45
|
});
|
|
46
|
-
function
|
|
47
|
-
i ||
|
|
46
|
+
function s() {
|
|
47
|
+
i || K({
|
|
48
48
|
symbol: e.symbol,
|
|
49
49
|
builderContextValue: e.builderContext
|
|
50
50
|
}).then((n) => {
|
|
51
|
-
n &&
|
|
51
|
+
n && y(n);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
return
|
|
55
|
-
}, []),
|
|
56
|
-
|
|
57
|
-
}, [e.symbol]), /* @__PURE__ */
|
|
58
|
-
|
|
54
|
+
return f(() => {
|
|
55
|
+
}, []), f(() => {
|
|
56
|
+
s();
|
|
57
|
+
}, [e.symbol]), /* @__PURE__ */ u("div", { ...e.attributes, className: b(), children: /* @__PURE__ */ u(
|
|
58
|
+
v,
|
|
59
59
|
{
|
|
60
60
|
nonce: e.builderContext.nonce,
|
|
61
61
|
isNestedRender: !0,
|
|
@@ -72,7 +72,7 @@ function j(e) {
|
|
|
72
72
|
...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
|
|
73
73
|
},
|
|
74
74
|
canTrack: e.builderContext.canTrack,
|
|
75
|
-
model: (d = e.symbol) == null ? void 0 : d.model,
|
|
75
|
+
model: (l = (d = e.symbol) == null ? void 0 : d.model) != null ? l : "",
|
|
76
76
|
content: i,
|
|
77
77
|
linkComponent: e.builderLinkComponent,
|
|
78
78
|
blocksWrapper: t(),
|
|
@@ -81,5 +81,5 @@ function j(e) {
|
|
|
81
81
|
) });
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
B as default
|
|
85
85
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-0885e182.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-c1673af2.js";
|
|
6
|
+
import "./get-class-prop-name-dac81472.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function y(t) {
|
|
9
9
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("react"),b=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("react"),b=require("./blocks-5165c164.cjs");require("./blocks-exports.cjs");require("./server-entry-77166102.cjs");require("./get-class-prop-name-0b992cfb.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var o;const[t,a]=u.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function c(n){return e.tabs&&e.tabs[n].content}function r(n){n===t&&e.collapsible?a(-1):a(n)}return l.jsxs("div",{children:[l.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(o=e.tabs)==null?void 0:o.map((n,i)=>l.jsx("span",{className:`builder-tab-wrap ${t===i?"builder-tab-active":""}`,style:{...t===i?e.activeTabStyle:{}},onClick:d=>r(i),children:l.jsx(b.Blocks,{parent:e.builderBlock.id,path:`tabs.${i}.label`,blocks:n.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},i))}),c(t)?l.jsx("div",{children:l.jsx(b.Blocks,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:c(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsxs as z, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useState as R, useEffect as m } from "react";
|
|
3
|
+
function j(e) {
|
|
4
|
+
var a, c, d, u, s, f, h;
|
|
5
|
+
const n = I(null);
|
|
6
|
+
function b() {
|
|
5
7
|
return {
|
|
6
8
|
...e.autoPlay === !0 ? {
|
|
7
9
|
autoPlay: !0
|
|
@@ -20,28 +22,54 @@ function f(e) {
|
|
|
20
22
|
} : {}
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
|
-
function
|
|
25
|
+
function g() {
|
|
24
26
|
return {
|
|
25
|
-
...
|
|
27
|
+
...b()
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
const [r, x] = R(() => {
|
|
31
|
+
});
|
|
32
|
+
return m(() => {
|
|
33
|
+
if (e.lazyLoad) {
|
|
34
|
+
const l = new IntersectionObserver(function(E) {
|
|
35
|
+
E.forEach(function(v) {
|
|
36
|
+
if (!v.isIntersecting)
|
|
37
|
+
return;
|
|
38
|
+
const o = v.target;
|
|
39
|
+
try {
|
|
40
|
+
Array.from(o.children).filter(
|
|
41
|
+
(t) => t instanceof HTMLElement && t.tagName === "SOURCE"
|
|
42
|
+
).forEach((t) => {
|
|
43
|
+
const y = t.dataset.src;
|
|
44
|
+
y && (t.src = y);
|
|
45
|
+
}), o.load(), l.unobserve(o);
|
|
46
|
+
} catch (t) {
|
|
47
|
+
console.error("Error loading lazy video:", t);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
n.current && l.observe(n.current), x(l);
|
|
52
|
+
}
|
|
53
|
+
}, []), m(() => () => {
|
|
54
|
+
r && r.disconnect();
|
|
55
|
+
}, []), /* @__PURE__ */ z(
|
|
29
56
|
"div",
|
|
30
57
|
{
|
|
31
58
|
style: {
|
|
32
59
|
position: "relative"
|
|
33
60
|
},
|
|
34
61
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ i(
|
|
36
63
|
"video",
|
|
37
64
|
{
|
|
38
65
|
className: "builder-video",
|
|
39
|
-
...
|
|
40
|
-
|
|
66
|
+
...g(),
|
|
67
|
+
ref: n,
|
|
68
|
+
preload: e.lazyLoad ? "none" : e.preload || "metadata",
|
|
41
69
|
style: {
|
|
42
70
|
width: "100%",
|
|
43
71
|
height: "100%",
|
|
44
|
-
...(
|
|
72
|
+
...(a = e.attributes) == null ? void 0 : a.style,
|
|
45
73
|
objectFit: e.fit,
|
|
46
74
|
objectPosition: e.position,
|
|
47
75
|
// Hack to get object fit to work as expected and
|
|
@@ -51,12 +79,21 @@ function f(e) {
|
|
|
51
79
|
position: "absolute"
|
|
52
80
|
} : null
|
|
53
81
|
},
|
|
54
|
-
src: e.video || "no-src",
|
|
55
82
|
poster: e.posterImage,
|
|
56
|
-
children:
|
|
83
|
+
children: /* @__PURE__ */ i(
|
|
84
|
+
"source",
|
|
85
|
+
{
|
|
86
|
+
type: "video/mp4",
|
|
87
|
+
...e.lazyLoad ? {
|
|
88
|
+
"data-src": e.video
|
|
89
|
+
} : {
|
|
90
|
+
src: e.video
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
)
|
|
57
94
|
}
|
|
58
95
|
),
|
|
59
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
96
|
+
e.aspectRatio && !(e.fitContent && ((d = (c = e.builderBlock) == null ? void 0 : c.children) != null && d.length)) ? /* @__PURE__ */ i(
|
|
60
97
|
"div",
|
|
61
98
|
{
|
|
62
99
|
style: {
|
|
@@ -67,7 +104,7 @@ function f(e) {
|
|
|
67
104
|
}
|
|
68
105
|
}
|
|
69
106
|
) : null,
|
|
70
|
-
(
|
|
107
|
+
(s = (u = e.builderBlock) == null ? void 0 : u.children) != null && s.length && e.fitContent ? /* @__PURE__ */ i(
|
|
71
108
|
"div",
|
|
72
109
|
{
|
|
73
110
|
style: {
|
|
@@ -78,7 +115,7 @@ function f(e) {
|
|
|
78
115
|
children: e.children
|
|
79
116
|
}
|
|
80
117
|
) : null,
|
|
81
|
-
(
|
|
118
|
+
(h = (f = e.builderBlock) == null ? void 0 : f.children) != null && h.length && !e.fitContent ? /* @__PURE__ */ i(
|
|
82
119
|
"div",
|
|
83
120
|
{
|
|
84
121
|
style: {
|
|
@@ -100,5 +137,5 @@ function f(e) {
|
|
|
100
137
|
);
|
|
101
138
|
}
|
|
102
139
|
export {
|
|
103
|
-
|
|
140
|
+
j as default
|
|
104
141
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react");function E(e){var a,d,u,s,f,h,v;const l=n.useRef(null);function m(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...m()}}const[c,x]=n.useState(()=>{});return n.useEffect(()=>{if(e.lazyLoad){const o=new IntersectionObserver(function(j){j.forEach(function(y){if(!y.isIntersecting)return;const r=y.target;try{Array.from(r.children).filter(t=>t instanceof HTMLElement&&t.tagName==="SOURCE").forEach(t=>{const b=t.dataset.src;b&&(t.src=b)}),r.load(),o.unobserve(r)}catch(t){console.error("Error loading lazy video:",t)}})});l.current&&o.observe(l.current),x(o)}},[]),n.useEffect(()=>()=>{c&&c.disconnect()},[]),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("video",{className:"builder-video",...g(),ref:l,preload:e.lazyLoad?"none":e.preload||"metadata",style:{width:"100%",height:"100%",...(a=e.attributes)==null?void 0:a.style,objectFit:e.fit,objectPosition:e.position,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},poster:e.posterImage,children:i.jsx("source",{type:"video/mp4",...e.lazyLoad?{"data-src":e.video}:{src:e.video}})}),e.aspectRatio&&!(e.fitContent&&((u=(d=e.builderBlock)==null?void 0:d.children)!=null&&u.length))?i.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length&&e.fitContent?i.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&!e.fitContent?i.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}exports.default=E;
|