@builder.io/sdk-react 1.1.2 → 2.0.1
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 +24 -24
- package/lib/browser/blocks-exports.mjs +524 -555
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-754040fc.cjs → server-entry-29c5c31c.cjs} +1 -1
- package/lib/browser/{server-entry-ed2ca723.js → server-entry-f9067095.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-3e3c0eb7.js → accordion-4a70912d.js} +1 -1
- package/lib/edge/{accordion-dfb7894d.cjs → accordion-6ad2cec7.cjs} +1 -1
- package/lib/edge/{blocks-e68d1b90.cjs → blocks-0bd38a83.cjs} +13 -13
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +4 -3
- package/lib/edge/{blocks-b47dedc1.js → blocks-fedde8d2.js} +697 -685
- package/lib/edge/{button-03e45213.js → button-af35e8de.js} +2 -2
- package/lib/edge/{button-eacbdcad.cjs → button-f6426eff.cjs} +1 -1
- package/lib/edge/{columns-858746ca.js → columns-1065c0ae.js} +59 -52
- package/lib/edge/columns-f607250b.cjs +28 -0
- package/lib/edge/{content-variants-c4559dfb.js → content-variants-3d57a82f.js} +183 -235
- package/lib/edge/content-variants-773afb9f.cjs +134 -0
- package/lib/edge/{form-6f2d1077.js → form-0a58d0e4.js} +3 -3
- package/lib/edge/{form-241a699e.cjs → form-5762c22a.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-87b96bca.js → get-class-prop-name-268b0f61.js} +1 -1
- package/lib/edge/{get-class-prop-name-d471c28c.cjs → get-class-prop-name-3061c329.cjs} +1 -1
- package/lib/edge/{img-be88cdbc.js → img-252c9967.js} +1 -1
- package/lib/edge/{img-a7bbfda3.cjs → img-59bb70c7.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-f1fbe38b.cjs → input-2163d4dc.cjs} +1 -1
- package/lib/edge/{input-22d61335.js → input-7ae243e2.js} +1 -1
- package/lib/edge/{select-c58f67e3.cjs → select-39231177.cjs} +1 -1
- package/lib/edge/{select-6371cc39.js → select-cfa0eb8e.js} +1 -1
- package/lib/edge/{server-entry-048c3043.cjs → server-entry-4750de9c.cjs} +1 -1
- package/lib/edge/{server-entry-97c99c4d.js → server-entry-681e8e79.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-7666ffaf.cjs → slot-69da8c56.cjs} +1 -1
- package/lib/edge/{slot-e6c31d6c.js → slot-7c61542f.js} +3 -3
- package/lib/edge/symbol-4a8a6cda.js +85 -0
- package/lib/edge/symbol-bd999a19.cjs +1 -0
- package/lib/edge/{tabs-02f569d1.cjs → tabs-3d0e242e.cjs} +1 -1
- package/lib/edge/{tabs-20114ebb.js → tabs-c3ff0c70.js} +3 -3
- package/lib/node/blocks-exports.cjs +25 -25
- package/lib/node/blocks-exports.mjs +518 -549
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-819e5520.cjs → node-runtime-3bfd8465.cjs} +1 -1
- package/lib/node/{node-runtime-36670c0e.js → node-runtime-78262e65.js} +1 -1
- package/lib/node/{server-entry-2910f126.js → server-entry-5f9f100f.js} +1 -1
- package/lib/node/{server-entry-cc7910d7.cjs → server-entry-63058f3f.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +15 -15
- package/types/components/block/block.helpers.d.ts +8 -8
- package/types/components/content/components/styles.d.ts +2 -1
- package/types/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/components/inlined-script.d.ts +2 -1
- package/types/components/inlined-styles.d.ts +2 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/types.d.ts +1 -0
- package/types/types/builder-props.d.ts +3 -0
- package/lib/edge/columns-26be75b9.cjs +0 -28
- package/lib/edge/content-variants-0c5ae6d6.cjs +0 -134
- package/lib/edge/symbol-8e3447aa.js +0 -84
- package/lib/edge/symbol-a0838c62.cjs +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useState as s, useEffect as u } from "react";
|
|
3
|
-
import { Content as C } from "./blocks-exports.mjs";
|
|
4
|
-
import { getClassPropName as v } from "./get-class-prop-name-87b96bca.js";
|
|
5
|
-
import { fetchOneEntry as k, logger as h } from "./server-entry-97c99c4d.js";
|
|
6
|
-
const x = 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 k({
|
|
13
|
-
model: e.model,
|
|
14
|
-
apiKey: t.apiKey,
|
|
15
|
-
apiVersion: t.apiVersion,
|
|
16
|
-
...(e == null ? void 0 : e.entry) && {
|
|
17
|
-
query: {
|
|
18
|
-
id: e.entry
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}).catch((o) => {
|
|
22
|
-
h.error("Could not fetch symbol content: ", o);
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
function j(t) {
|
|
26
|
-
var r, a, c, d;
|
|
27
|
-
function e() {
|
|
28
|
-
return "div";
|
|
29
|
-
}
|
|
30
|
-
function o() {
|
|
31
|
-
return "div";
|
|
32
|
-
}
|
|
33
|
-
function f() {
|
|
34
|
-
var n, m;
|
|
35
|
-
return [
|
|
36
|
-
t.attributes[v()],
|
|
37
|
-
"builder-symbol",
|
|
38
|
-
(n = t.symbol) != null && n.inline ? "builder-inline-symbol" : void 0,
|
|
39
|
-
(m = t.symbol) != null && m.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
40
|
-
].filter(Boolean).join(" ");
|
|
41
|
-
}
|
|
42
|
-
const [i, y] = s(() => {
|
|
43
|
-
var n;
|
|
44
|
-
return (n = t.symbol) == null ? void 0 : n.content;
|
|
45
|
-
});
|
|
46
|
-
function b() {
|
|
47
|
-
i || x({
|
|
48
|
-
symbol: t.symbol,
|
|
49
|
-
builderContextValue: t.builderContext
|
|
50
|
-
}).then((n) => {
|
|
51
|
-
n && y(n);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return u(() => {
|
|
55
|
-
}, []), u(() => {
|
|
56
|
-
b();
|
|
57
|
-
}, [t.symbol]), /* @__PURE__ */ l("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ l(
|
|
58
|
-
C,
|
|
59
|
-
{
|
|
60
|
-
isNestedRender: !0,
|
|
61
|
-
apiVersion: t.builderContext.apiVersion,
|
|
62
|
-
apiKey: t.builderContext.apiKey,
|
|
63
|
-
context: {
|
|
64
|
-
...t.builderContext.context,
|
|
65
|
-
symbolId: (r = t.builderBlock) == null ? void 0 : r.id
|
|
66
|
-
},
|
|
67
|
-
customComponents: Object.values(t.builderComponents),
|
|
68
|
-
data: {
|
|
69
|
-
...(a = t.symbol) == null ? void 0 : a.data,
|
|
70
|
-
...t.builderContext.localState,
|
|
71
|
-
...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
|
|
72
|
-
},
|
|
73
|
-
canTrack: t.builderContext.canTrack,
|
|
74
|
-
model: (d = t.symbol) == null ? void 0 : d.model,
|
|
75
|
-
content: i,
|
|
76
|
-
linkComponent: t.builderLinkComponent,
|
|
77
|
-
blocksWrapper: e(),
|
|
78
|
-
contentWrapper: o()
|
|
79
|
-
}
|
|
80
|
-
) });
|
|
81
|
-
}
|
|
82
|
-
export {
|
|
83
|
-
j as default
|
|
84
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-d471c28c.cjs"),m=require("./server-entry-048c3043.cjs"),k=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return m.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(r=>{m.logger.error("Could not fetch symbol content: ",r)})};function x(e){var c,a,d,u;function t(){return"div"}function r(){return"div"}function y(){var n,l;return[e.attributes[v.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,b]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function f(){i||k({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&b(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{f()},[e.symbol]),s.jsx("div",{...e.attributes,className:y(),children:s.jsx(C.Content,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(d=i==null?void 0:i.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:r()})})}exports.default=x;
|