@builder.io/sdk-react 1.0.23 → 1.0.24
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 +31 -31
- package/lib/browser/blocks-exports.mjs +1036 -820
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-4ca9f249.js → server-entry-85d7f359.js} +1 -1
- package/lib/browser/{server-entry-f69e2b2a.cjs → server-entry-a540d463.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-59950370.cjs +32 -0
- package/lib/edge/{blocks-93608689.js → blocks-e6873db2.js} +614 -617
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/button-8a6ae666.js +31 -0
- package/lib/edge/button-aff4f652.cjs +1 -0
- package/lib/edge/columns-0768e506.js +163 -0
- package/lib/edge/columns-8dca796d.cjs +28 -0
- package/lib/edge/{content-variants-f416bff5.js → content-variants-c8061bc0.js} +404 -262
- package/lib/edge/content-variants-e79859ac.cjs +134 -0
- package/lib/edge/{form-8526db32.js → form-c3d12c27.js} +3 -3
- package/lib/edge/{form-44ceed15.cjs → form-e6847833.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-e85bf7a3.js → get-class-prop-name-a023381f.js} +2 -1
- package/lib/edge/get-class-prop-name-a966a097.cjs +1 -0
- package/lib/edge/image-764070f8.cjs +17 -0
- package/lib/edge/{image-0008c792.js → image-9d24a962.js} +24 -24
- package/lib/edge/{img-5ef224a8.js → img-03949fec.js} +1 -1
- package/lib/edge/{img-a5802e2b.cjs → img-1431a6ab.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-f1aa0191.cjs → input-f420d17a.cjs} +1 -1
- package/lib/edge/{input-3f85283b.js → input-f611f26d.js} +1 -1
- package/lib/edge/{select-d4c018c0.cjs → select-aadf10db.cjs} +1 -1
- package/lib/edge/{select-4fe889b6.js → select-e056d1d3.js} +1 -1
- package/lib/edge/{server-entry-c4b7844d.cjs → server-entry-95f97e05.cjs} +1 -1
- package/lib/edge/{server-entry-e1e18fd2.js → server-entry-bbf65248.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-97599025.js → slot-2f6f1817.js} +3 -3
- package/lib/edge/{slot-2a11e808.cjs → slot-3ed45869.cjs} +1 -1
- package/lib/edge/{symbol-a90a41a3.js → symbol-853c210f.js} +32 -26
- package/lib/edge/symbol-c9d45cc8.cjs +1 -0
- package/lib/edge/tabs-28d0f021.js +69 -0
- package/lib/edge/tabs-34a12e52.cjs +1 -0
- package/lib/node/blocks-exports.cjs +32 -32
- package/lib/node/blocks-exports.mjs +1141 -925
- 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-8062cfb8.js → node-runtime-071b85f9.js} +1 -1
- package/lib/node/{node-runtime-11a8cdfe.cjs → node-runtime-41e3da8e.cjs} +1 -1
- package/lib/node/{server-entry-461bfaf9.cjs → server-entry-b5031981.cjs} +1 -1
- package/lib/node/{server-entry-3e54c767.js → server-entry-fd29e8b4.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/columns/columns.types.d.ts +1 -1
- package/types/blocks/columns/helpers.d.ts +1 -0
- package/types/blocks/tabs/component-info.d.ts +2 -0
- package/types/blocks/tabs/index.d.ts +1 -0
- package/types/blocks/tabs/tabs.d.ts +4 -0
- package/types/blocks/tabs/tabs.types.d.ts +13 -0
- package/types/blocks/text/text.types.d.ts +2 -1
- package/types/components/block/block.helpers.d.ts +2 -0
- package/types/components/content/components/styles.helpers.d.ts +1 -0
- package/types/components/dynamic-div.d.ts +15 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/types/targets.d.ts +1 -1
- package/lib/edge/blocks-5539f58f.cjs +0 -32
- package/lib/edge/button-7e98d8f3.cjs +0 -1
- package/lib/edge/button-8816ab35.js +0 -28
- package/lib/edge/columns-8db639b5.cjs +0 -28
- package/lib/edge/columns-d065e3c4.js +0 -156
- package/lib/edge/content-variants-44d061f2.cjs +0 -134
- package/lib/edge/get-class-prop-name-7b951501.cjs +0 -1
- package/lib/edge/image-ee3dd857.cjs +0 -17
- package/lib/edge/symbol-dbb5c95e.cjs +0 -1
|
@@ -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 l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as u } from "react";
|
|
3
|
+
import { Content as C } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as v } from "./get-class-prop-name-a023381f.js";
|
|
5
|
+
import { fetchOneEntry as h, logger as k } from "./server-entry-bbf65248.js";
|
|
6
|
+
const K = async ({
|
|
7
7
|
builderContextValue: t,
|
|
8
8
|
symbol: e
|
|
9
9
|
}) => {
|
|
10
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
11
|
(t != null && t.apiKey))
|
|
12
|
-
return
|
|
12
|
+
return h({
|
|
13
13
|
model: e.model,
|
|
14
14
|
apiKey: t.apiKey,
|
|
15
15
|
apiVersion: t.apiVersion,
|
|
@@ -18,60 +18,66 @@ const h = async ({
|
|
|
18
18
|
id: e.entry
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
}).catch((
|
|
22
|
-
|
|
21
|
+
}).catch((o) => {
|
|
22
|
+
k.error("Could not fetch symbol content: ", o);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
var
|
|
25
|
+
function j(t) {
|
|
26
|
+
var r, a, c, d;
|
|
27
27
|
function e() {
|
|
28
|
+
return "div";
|
|
29
|
+
}
|
|
30
|
+
function o() {
|
|
31
|
+
return "div";
|
|
32
|
+
}
|
|
33
|
+
function f() {
|
|
28
34
|
var n, m;
|
|
29
35
|
return [
|
|
30
|
-
t.attributes[
|
|
36
|
+
t.attributes[v()],
|
|
31
37
|
"builder-symbol",
|
|
32
38
|
(n = t.symbol) != null && n.inline ? "builder-inline-symbol" : void 0,
|
|
33
39
|
(m = t.symbol) != null && m.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
34
40
|
].filter(Boolean).join(" ");
|
|
35
41
|
}
|
|
36
|
-
const [i,
|
|
42
|
+
const [i, s] = b(() => {
|
|
37
43
|
var n;
|
|
38
44
|
return (n = t.symbol) == null ? void 0 : n.content;
|
|
39
45
|
});
|
|
40
|
-
function
|
|
41
|
-
i ||
|
|
46
|
+
function y() {
|
|
47
|
+
i || K({
|
|
42
48
|
symbol: t.symbol,
|
|
43
49
|
builderContextValue: t.builderContext
|
|
44
50
|
}).then((n) => {
|
|
45
|
-
n &&
|
|
51
|
+
n && s(n);
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
|
-
return
|
|
49
|
-
}, []),
|
|
50
|
-
|
|
51
|
-
}, [t.symbol]), /* @__PURE__ */
|
|
52
|
-
|
|
54
|
+
return u(() => {
|
|
55
|
+
}, []), u(() => {
|
|
56
|
+
y();
|
|
57
|
+
}, [t.symbol]), /* @__PURE__ */ l("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ l(
|
|
58
|
+
C,
|
|
53
59
|
{
|
|
54
60
|
isNestedRender: !0,
|
|
55
61
|
apiVersion: t.builderContext.apiVersion,
|
|
56
62
|
apiKey: t.builderContext.apiKey,
|
|
57
63
|
context: {
|
|
58
64
|
...t.builderContext.context,
|
|
59
|
-
symbolId: (
|
|
65
|
+
symbolId: (r = t.builderBlock) == null ? void 0 : r.id
|
|
60
66
|
},
|
|
61
67
|
customComponents: Object.values(t.builderComponents),
|
|
62
68
|
data: {
|
|
63
69
|
...(a = t.symbol) == null ? void 0 : a.data,
|
|
64
70
|
...t.builderContext.localState,
|
|
65
|
-
...(
|
|
71
|
+
...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
|
|
66
72
|
},
|
|
67
73
|
model: (d = t.symbol) == null ? void 0 : d.model,
|
|
68
74
|
content: i,
|
|
69
75
|
linkComponent: t.builderLinkComponent,
|
|
70
|
-
blocksWrapper:
|
|
71
|
-
contentWrapper:
|
|
76
|
+
blocksWrapper: e(),
|
|
77
|
+
contentWrapper: o()
|
|
72
78
|
}
|
|
73
79
|
) });
|
|
74
80
|
}
|
|
75
81
|
export {
|
|
76
|
-
|
|
82
|
+
j as default
|
|
77
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),v=require("./blocks-exports.cjs"),C=require("./get-class-prop-name-a966a097.cjs"),m=require("./server-entry-95f97e05.cjs"),g=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 h(e){var c,a,d,u;function t(){return"div"}function r(){return"div"}function y(){var n,l;return[e.attributes[C.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||g({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(v.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},model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:r()})})}exports.default=h;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
import { Blocks as c } from "./blocks-e6873db2.js";
|
|
4
|
+
import "./blocks-exports.mjs";
|
|
5
|
+
import "./server-entry-bbf65248.js";
|
|
6
|
+
import "./get-class-prop-name-a023381f.js";
|
|
7
|
+
import "./dynamic-renderer-8b343325.js";
|
|
8
|
+
function h(t) {
|
|
9
|
+
var b;
|
|
10
|
+
const [e, a] = m(
|
|
11
|
+
() => t.defaultActiveTab ? t.defaultActiveTab - 1 : 0
|
|
12
|
+
);
|
|
13
|
+
function o(i) {
|
|
14
|
+
return t.tabs && t.tabs[i].content;
|
|
15
|
+
}
|
|
16
|
+
function r(i) {
|
|
17
|
+
return e === i ? t.activeTabStyle : {};
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
20
|
+
/* @__PURE__ */ l(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: "builder-tabs-wrap",
|
|
24
|
+
style: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "row",
|
|
27
|
+
justifyContent: t.tabHeaderLayout || "flex-start",
|
|
28
|
+
overflow: "auto"
|
|
29
|
+
},
|
|
30
|
+
children: (b = t.tabs) == null ? void 0 : b.map((i, n) => /* @__PURE__ */ l(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: `builder-tab-wrap ${e === n ? "builder-tab-active" : ""}`,
|
|
34
|
+
style: r(n),
|
|
35
|
+
onClick: (d) => {
|
|
36
|
+
n === e && t.collapsible ? a(-1) : a(n);
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ l(
|
|
39
|
+
c,
|
|
40
|
+
{
|
|
41
|
+
parent: t.builderBlock.id,
|
|
42
|
+
path: `component.options.tabs.${n}.label`,
|
|
43
|
+
blocks: i.label,
|
|
44
|
+
context: t.builderContext,
|
|
45
|
+
registeredComponents: t.builderComponents,
|
|
46
|
+
linkComponent: t.builderLinkComponent
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
n
|
|
51
|
+
))
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
o(e) ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
55
|
+
c,
|
|
56
|
+
{
|
|
57
|
+
parent: t.builderBlock.id,
|
|
58
|
+
path: `component.options.tabs.${e}.content`,
|
|
59
|
+
blocks: o(e),
|
|
60
|
+
context: t.builderContext,
|
|
61
|
+
registeredComponents: t.builderComponents,
|
|
62
|
+
linkComponent: t.builderLinkComponent
|
|
63
|
+
}
|
|
64
|
+
) }) : null
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
h as default
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("react"),r=require("./blocks-59950370.cjs");require("./blocks-exports.cjs");require("./server-entry-95f97e05.cjs");require("./get-class-prop-name-a966a097.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var c;const[t,a]=u.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function o(l){return e.tabs&&e.tabs[l].content}function b(l){return t===l?e.activeTabStyle:{}}return i.jsxs("div",{children:[i.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(c=e.tabs)==null?void 0:c.map((l,n)=>i.jsx("span",{className:`builder-tab-wrap ${t===n?"builder-tab-active":""}`,style:b(n),onClick:d=>{n===t&&e.collapsible?a(-1):a(n)},children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${n}.label`,blocks:l.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},n))}),o(t)?i.jsx("div",{children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:o(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|