@builder.io/sdk-react 5.1.1 → 5.2.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 +11 -11
- package/lib/browser/blocks-exports.mjs +281 -281
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-85aa99e6.cjs → server-entry-1549d863.cjs} +1 -1
- package/lib/browser/{server-entry-a3b5302c.js → server-entry-81390e9b.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-83f68de4.js → accordion-90d607ca.js} +1 -1
- package/lib/edge/{accordion-1e467b30.cjs → accordion-ba377db1.cjs} +1 -1
- package/lib/edge/{blocks-6b821501.js → blocks-482bd303.js} +2 -2
- package/lib/edge/{blocks-4d57d38f.cjs → blocks-49400750.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-b2eb1d64.cjs → button-1dd20b20.cjs} +1 -1
- package/lib/edge/{button-52af8a54.js → button-76b09bda.js} +2 -2
- package/lib/edge/{columns-e0489b50.js → columns-89f6f5b7.js} +3 -3
- package/lib/edge/{columns-8eb66fad.cjs → columns-ed698360.cjs} +1 -1
- package/lib/edge/{content-variants-5003144d.js → content-variants-6e54d1d8.js} +12 -12
- package/lib/edge/{content-variants-6c1ee307.cjs → content-variants-98b86c90.cjs} +2 -2
- package/lib/edge/{custom-code-4e76fc0d.js → custom-code-3387f2ee.js} +1 -1
- package/lib/edge/{custom-code-bc787526.cjs → custom-code-62511fce.cjs} +1 -1
- package/lib/edge/{embed-8ef248c5.cjs → embed-54bfd2b5.cjs} +1 -1
- package/lib/edge/{embed-fd344d6d.js → embed-e24c574a.js} +1 -1
- package/lib/edge/{form-107c9eae.cjs → form-5c77fb87.cjs} +1 -1
- package/lib/edge/{form-4efa40a5.js → form-b3b23e9b.js} +3 -3
- package/lib/edge/{get-class-prop-name-e6f7321f.js → get-class-prop-name-2e01e11c.js} +1 -1
- package/lib/edge/{get-class-prop-name-2c2513e9.cjs → get-class-prop-name-3347a655.cjs} +1 -1
- package/lib/edge/{img-ab241f22.cjs → img-8430be52.cjs} +1 -1
- package/lib/edge/{img-a32b0723.js → img-d900f0a6.js} +2 -2
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c48fe23a.js → input-6b9d2f0d.js} +1 -1
- package/lib/edge/{input-ada30ffb.cjs → input-e522b3f8.cjs} +1 -1
- package/lib/edge/{personalization-container-ad7cf89c.js → personalization-container-42afbf21.js} +4 -4
- package/lib/edge/{personalization-container-375a1501.cjs → personalization-container-9469f576.cjs} +1 -1
- package/lib/edge/{select-879c52dd.cjs → select-38371935.cjs} +1 -1
- package/lib/edge/{select-a49d819c.js → select-e1a9f4c9.js} +1 -1
- package/lib/edge/{server-entry-68d59577.js → server-entry-954fe774.js} +1 -1
- package/lib/edge/{server-entry-560732da.cjs → server-entry-a2bf7e77.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-5da991d1.cjs → slot-562ee3ff.cjs} +1 -1
- package/lib/edge/{slot-005d6258.js → slot-cc86bcca.js} +3 -3
- package/lib/edge/symbol-099ae199.cjs +1 -0
- package/lib/edge/symbol-6224d576.js +93 -0
- package/lib/edge/{tabs-69a36a5c.js → tabs-51cb7107.js} +3 -3
- package/lib/edge/{tabs-96367bf5.cjs → tabs-e1cf9ee7.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +11 -11
- package/lib/node/blocks-exports.mjs +283 -283
- 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-2529c06e.cjs → server-entry-1c10e3d9.cjs} +1 -1
- package/lib/node/{server-entry-fc7f08d8.js → server-entry-85c98f9a.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-b97cfb8b.cjs → setIvm-a5e6d580.cjs} +1 -1
- package/lib/node/{setIvm-41d8b067.js → setIvm-ed61fc8c.js} +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-fc5c3a06.js → should-force-browser-runtime-in-node-03c2678b.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-1d85a066.cjs → should-force-browser-runtime-in-node-36ea59a2.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/symbol/symbol.helpers.d.ts +2 -0
- package/types/blocks/symbol/symbol.types.d.ts +2 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/symbol-155906ed.js +0 -93
- package/lib/edge/symbol-7e6ac72e.cjs +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useEffect as C } from "react";
|
|
3
|
+
import { Content as K } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as S } from "./get-class-prop-name-2e01e11c.js";
|
|
5
|
+
import { fetchOneEntry as E, logger as N } from "./server-entry-954fe774.js";
|
|
6
|
+
const W = async ({
|
|
7
|
+
builderContextValue: t,
|
|
8
|
+
symbol: e
|
|
9
|
+
}) => {
|
|
10
|
+
if (e != null && e.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
11
|
+
(t != null && t.apiKey))
|
|
12
|
+
return E({
|
|
13
|
+
model: e.model,
|
|
14
|
+
apiKey: e.global && e.ownerId ? e.ownerId : t.apiKey,
|
|
15
|
+
apiVersion: t.apiVersion,
|
|
16
|
+
...(e == null ? void 0 : e.entry) && {
|
|
17
|
+
query: {
|
|
18
|
+
id: e.entry
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}).catch((r) => {
|
|
22
|
+
N.error("Could not fetch symbol content: ", r);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function q(t) {
|
|
26
|
+
var a, c, l, d, m, u, y;
|
|
27
|
+
function e() {
|
|
28
|
+
return "div";
|
|
29
|
+
}
|
|
30
|
+
function r() {
|
|
31
|
+
return "div";
|
|
32
|
+
}
|
|
33
|
+
function v() {
|
|
34
|
+
return Object.values(t.builderComponents);
|
|
35
|
+
}
|
|
36
|
+
function k() {
|
|
37
|
+
var n, i;
|
|
38
|
+
return [
|
|
39
|
+
t.attributes[S()],
|
|
40
|
+
"builder-symbol",
|
|
41
|
+
(n = t.symbol) != null && n.inline ? "builder-inline-symbol" : void 0,
|
|
42
|
+
(i = t.symbol) != null && i.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
43
|
+
].filter(Boolean).join(" ");
|
|
44
|
+
}
|
|
45
|
+
const [o, h] = s(() => {
|
|
46
|
+
var n;
|
|
47
|
+
return (n = t.symbol) == null ? void 0 : n.content;
|
|
48
|
+
}), [x, g] = s(() => {
|
|
49
|
+
var n;
|
|
50
|
+
return (n = t.symbol) == null ? void 0 : n.entry;
|
|
51
|
+
});
|
|
52
|
+
function I() {
|
|
53
|
+
var n;
|
|
54
|
+
o && x === ((n = t.symbol) == null ? void 0 : n.entry) || W({
|
|
55
|
+
symbol: t.symbol,
|
|
56
|
+
builderContextValue: t.builderContext
|
|
57
|
+
}).then((i) => {
|
|
58
|
+
var b;
|
|
59
|
+
i && (h(i), g((b = t.symbol) == null ? void 0 : b.entry));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return C(() => {
|
|
63
|
+
}, []), C(() => {
|
|
64
|
+
I();
|
|
65
|
+
}, [t.symbol]), /* @__PURE__ */ f("div", { ...t.attributes, className: k(), children: /* @__PURE__ */ f(
|
|
66
|
+
K,
|
|
67
|
+
{
|
|
68
|
+
nonce: t.builderContext.nonce,
|
|
69
|
+
isNestedRender: !0,
|
|
70
|
+
apiVersion: t.builderContext.apiVersion,
|
|
71
|
+
apiKey: (a = t.symbol) != null && a.global && ((c = t.symbol) != null && c.ownerId) ? t.symbol.ownerId : t.builderContext.apiKey,
|
|
72
|
+
context: {
|
|
73
|
+
...t.builderContext.context,
|
|
74
|
+
symbolId: (l = t.builderBlock) == null ? void 0 : l.id
|
|
75
|
+
},
|
|
76
|
+
customComponents: v(),
|
|
77
|
+
data: {
|
|
78
|
+
...(d = t.symbol) == null ? void 0 : d.data,
|
|
79
|
+
...t.builderContext.localState,
|
|
80
|
+
...(m = o == null ? void 0 : o.data) == null ? void 0 : m.state
|
|
81
|
+
},
|
|
82
|
+
canTrack: t.builderContext.canTrack,
|
|
83
|
+
model: (y = (u = t.symbol) == null ? void 0 : u.model) != null ? y : "",
|
|
84
|
+
content: o,
|
|
85
|
+
linkComponent: t.builderLinkComponent,
|
|
86
|
+
blocksWrapper: e(),
|
|
87
|
+
contentWrapper: r()
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
q as default
|
|
93
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-482bd303.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-954fe774.js";
|
|
6
|
+
import "./get-class-prop-name-2e01e11c.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function x(t) {
|
|
9
9
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),r=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),r=require("./blocks-49400750.cjs");require("./blocks-exports.cjs");require("./server-entry-a2bf7e77.cjs");require("./get-class-prop-name-3347a655.cjs");require("./dynamic-renderer-b29b45ca.cjs");function d(e){var o;const[n,a]=s.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function c(t){return e.tabs&&e.tabs[t].content}function u(t){return t===n?e.activeTabStyle:{}}function b(t){t===n&&e.collapsible?a(-1):a(t)}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((t,i)=>l.jsx("span",{className:`builder-tab-wrap ${n===i?"builder-tab-active":""}`,style:u(i),onClick:f=>b(i),children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${i}.label`,blocks:t.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},i))}),c(n)?l.jsx("div",{children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${n}.content`,blocks:c(n),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=d;
|