@builder.io/sdk-react 4.0.7 → 4.0.9
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 +93 -65
- package/lib/browser/blocks-exports.mjs +1721 -1613
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-e70c12ff.js → server-entry-231f8ecd.js} +1 -1
- package/lib/browser/{server-entry-4c650ff5.cjs → server-entry-bdbd3c0d.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-742ca147.js → accordion-b551e135.js} +1 -1
- package/lib/edge/{accordion-c97e6506.cjs → accordion-e3f81e74.cjs} +1 -1
- package/lib/edge/{blocks-2a015bd6.js → blocks-cd1feef2.js} +1014 -1008
- package/lib/edge/{blocks-70894a53.cjs → blocks-eb6fa21f.cjs} +15 -15
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-6a072716.cjs → button-5c6a9392.cjs} +1 -1
- package/lib/edge/{button-deecd9b5.js → button-f390f723.js} +2 -2
- package/lib/edge/{columns-0e9b2bf4.js → columns-7018a027.js} +9 -9
- package/lib/edge/{columns-02352a9f.cjs → columns-ad17139e.cjs} +3 -3
- package/lib/edge/content-variants-c72ca81f.cjs +302 -0
- package/lib/edge/{content-variants-6948115a.js → content-variants-dc54ce4f.js} +650 -367
- package/lib/edge/{custom-code-73f76f76.js → custom-code-0daf1c91.js} +1 -1
- package/lib/edge/{custom-code-77f98605.cjs → custom-code-e87af7b1.cjs} +1 -1
- package/lib/edge/{embed-26470ea1.js → embed-1dfcba43.js} +1 -1
- package/lib/edge/{embed-9aaf87f9.cjs → embed-c695c98e.cjs} +1 -1
- package/lib/edge/{form-652ef8a9.js → form-5a0c89d9.js} +5 -5
- package/lib/edge/{form-0213200e.cjs → form-ba54942c.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-1a003fac.js → get-class-prop-name-5edacc3b.js} +1 -1
- package/lib/edge/{get-class-prop-name-8647a440.cjs → get-class-prop-name-c479656a.cjs} +1 -1
- package/lib/edge/{image-e38bd9e0.cjs → image-cce92f6c.cjs} +2 -2
- package/lib/edge/{image-acc1c00c.js → image-d87761af.js} +18 -18
- package/lib/edge/{img-f0b9e982.cjs → img-6982d6eb.cjs} +1 -1
- package/lib/edge/{img-2d35513d.js → img-882c7222.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-cdd96bc7.js → input-3d4f956b.js} +1 -1
- package/lib/edge/{input-e61cf32f.cjs → input-8c7008b5.cjs} +1 -1
- package/lib/edge/personalization-container-3a8dc18a.js +205 -0
- package/lib/edge/personalization-container-4557a50b.cjs +1 -0
- package/lib/edge/{select-de96bdc0.js → select-153586f8.js} +1 -1
- package/lib/edge/{select-f1165866.cjs → select-2efc7503.cjs} +1 -1
- package/lib/edge/{server-entry-637ed5ff.js → server-entry-8dc3478a.js} +1 -1
- package/lib/edge/{server-entry-10ca8502.cjs → server-entry-9d269960.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-72846242.js → slot-d268693c.js} +3 -3
- package/lib/edge/{slot-3ecf31d9.cjs → slot-f1f7513c.cjs} +1 -1
- package/lib/edge/symbol-0344516c.cjs +1 -0
- package/lib/edge/symbol-378e19ee.js +90 -0
- package/lib/edge/{tabs-ea0258b8.js → tabs-29ff78a0.js} +3 -3
- package/lib/edge/{tabs-788974d9.cjs → tabs-4e931765.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +92 -64
- package/lib/node/blocks-exports.mjs +1608 -1500
- 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-e76904a8.cjs → server-entry-916c726c.cjs} +1 -1
- package/lib/node/{server-entry-7167da7c.js → server-entry-f03c1146.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-72c91afa.js → setIvm-044ce9e7.js} +1 -1
- package/lib/node/{setIvm-e89d1a08.cjs → setIvm-3761bb10.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-b3e23348.cjs → should-force-browser-runtime-in-node-e760d4f2.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-09a401d5.js → should-force-browser-runtime-in-node-f620dcdc.js} +1 -1
- package/package.json +2 -2
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
- package/types/blocks/personalization-container/helpers.d.ts +24 -4
- package/types/blocks/personalization-container/personalization-container.types.d.ts +2 -2
- package/types/components/blocks/blocks-wrapper.d.ts +13 -1
- package/types/components/blocks/blocks.types.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/content-variants-41781d1f.cjs +0 -137
- package/lib/edge/personalization-container-4f73fbdf.cjs +0 -138
- package/lib/edge/personalization-container-e1f03976.js +0 -384
- package/lib/edge/symbol-49ed2192.cjs +0 -1
- package/lib/edge/symbol-61a3651b.js +0 -85
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as f } from "react";
|
|
3
|
+
import { Content as x } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as K } from "./get-class-prop-name-5edacc3b.js";
|
|
5
|
+
import { fetchOneEntry as S, logger as E } from "./server-entry-8dc3478a.js";
|
|
6
|
+
const N = async ({
|
|
7
|
+
builderContextValue: t,
|
|
8
|
+
symbol: n
|
|
9
|
+
}) => {
|
|
10
|
+
if (n != null && n.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 S({
|
|
13
|
+
model: n.model,
|
|
14
|
+
apiKey: t.apiKey,
|
|
15
|
+
apiVersion: t.apiVersion,
|
|
16
|
+
...(n == null ? void 0 : n.entry) && {
|
|
17
|
+
query: {
|
|
18
|
+
id: n.entry
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}).catch((r) => {
|
|
22
|
+
E.error("Could not fetch symbol content: ", r);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function T(t) {
|
|
26
|
+
var a, c, l, m, d;
|
|
27
|
+
function n() {
|
|
28
|
+
return "div";
|
|
29
|
+
}
|
|
30
|
+
function r() {
|
|
31
|
+
return "div";
|
|
32
|
+
}
|
|
33
|
+
function s() {
|
|
34
|
+
var e, o;
|
|
35
|
+
return [
|
|
36
|
+
t.attributes[K()],
|
|
37
|
+
"builder-symbol",
|
|
38
|
+
(e = t.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
|
|
39
|
+
(o = t.symbol) != null && o.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
40
|
+
].filter(Boolean).join(" ");
|
|
41
|
+
}
|
|
42
|
+
const [i, C] = b(() => {
|
|
43
|
+
var e;
|
|
44
|
+
return (e = t.symbol) == null ? void 0 : e.content;
|
|
45
|
+
}), [v, k] = b(() => {
|
|
46
|
+
var e;
|
|
47
|
+
return (e = t.symbol) == null ? void 0 : e.entry;
|
|
48
|
+
});
|
|
49
|
+
function h() {
|
|
50
|
+
var e;
|
|
51
|
+
i && v === ((e = t.symbol) == null ? void 0 : e.entry) || N({
|
|
52
|
+
symbol: t.symbol,
|
|
53
|
+
builderContextValue: t.builderContext
|
|
54
|
+
}).then((o) => {
|
|
55
|
+
var y;
|
|
56
|
+
o && (C(o), k((y = t.symbol) == null ? void 0 : y.entry));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return f(() => {
|
|
60
|
+
}, []), f(() => {
|
|
61
|
+
h();
|
|
62
|
+
}, [t.symbol]), /* @__PURE__ */ u("div", { ...t.attributes, className: s(), children: /* @__PURE__ */ u(
|
|
63
|
+
x,
|
|
64
|
+
{
|
|
65
|
+
nonce: t.builderContext.nonce,
|
|
66
|
+
isNestedRender: !0,
|
|
67
|
+
apiVersion: t.builderContext.apiVersion,
|
|
68
|
+
apiKey: t.builderContext.apiKey,
|
|
69
|
+
context: {
|
|
70
|
+
...t.builderContext.context,
|
|
71
|
+
symbolId: (a = t.builderBlock) == null ? void 0 : a.id
|
|
72
|
+
},
|
|
73
|
+
customComponents: Object.values(t.builderComponents),
|
|
74
|
+
data: {
|
|
75
|
+
...(c = t.symbol) == null ? void 0 : c.data,
|
|
76
|
+
...t.builderContext.localState,
|
|
77
|
+
...(l = i == null ? void 0 : i.data) == null ? void 0 : l.state
|
|
78
|
+
},
|
|
79
|
+
canTrack: t.builderContext.canTrack,
|
|
80
|
+
model: (d = (m = t.symbol) == null ? void 0 : m.model) != null ? d : "",
|
|
81
|
+
content: i,
|
|
82
|
+
linkComponent: t.builderLinkComponent,
|
|
83
|
+
blocksWrapper: n(),
|
|
84
|
+
contentWrapper: r()
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
T as default
|
|
90
|
+
};
|
|
@@ -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-cd1feef2.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-8dc3478a.js";
|
|
6
|
+
import "./get-class-prop-name-5edacc3b.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-eb6fa21f.cjs");require("./blocks-exports.cjs");require("./server-entry-9d269960.cjs");require("./get-class-prop-name-c479656a.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;
|