@builder.io/sdk-solid 2.0.25 → 2.0.28
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/dist/index.d.ts +8 -0
- package/lib/browser/dev.js +41 -13
- package/lib/browser/dev.jsx +33 -17
- package/lib/browser/index.js +41 -13
- package/lib/browser/index.jsx +33 -17
- package/lib/edge/dev.js +41 -13
- package/lib/edge/dev.jsx +33 -17
- package/lib/edge/index.js +41 -13
- package/lib/edge/index.jsx +33 -17
- package/lib/node/dev.js +44 -17
- package/lib/node/dev.jsx +36 -21
- package/lib/node/index.js +44 -17
- package/lib/node/index.jsx +36 -21
- package/package.json +1 -1
package/lib/node/index.jsx
CHANGED
|
@@ -75,7 +75,7 @@ function Button(props) {
|
|
|
75
75
|
var button_default = Button;
|
|
76
76
|
|
|
77
77
|
// src/blocks/columns/columns.tsx
|
|
78
|
-
import { Show as Show7, For as For4,
|
|
78
|
+
import { Show as Show7, For as For4, createMemo as createMemo7 } from "solid-js";
|
|
79
79
|
|
|
80
80
|
// src/components/blocks/blocks.tsx
|
|
81
81
|
import { useContext, Show as Show6, For as For3 } from "solid-js";
|
|
@@ -430,6 +430,8 @@ var getIvm = () => {
|
|
|
430
430
|
function setIsolateContext(options = {
|
|
431
431
|
memoryLimit: 128
|
|
432
432
|
}) {
|
|
433
|
+
if (IVM_CONTEXT)
|
|
434
|
+
return IVM_CONTEXT;
|
|
433
435
|
const ivm = getIvm();
|
|
434
436
|
const isolate = new ivm.Isolate(options);
|
|
435
437
|
const context = isolate.createContextSync();
|
|
@@ -442,10 +444,7 @@ function setIsolateContext(options = {
|
|
|
442
444
|
return context;
|
|
443
445
|
}
|
|
444
446
|
var getIsolateContext = () => {
|
|
445
|
-
|
|
446
|
-
return IVM_CONTEXT;
|
|
447
|
-
const context = setIsolateContext();
|
|
448
|
-
return context;
|
|
447
|
+
return setIsolateContext();
|
|
449
448
|
};
|
|
450
449
|
var runInNode = ({
|
|
451
450
|
code,
|
|
@@ -1615,14 +1614,15 @@ var getColumnsClass = (id) => {
|
|
|
1615
1614
|
|
|
1616
1615
|
// src/blocks/columns/columns.tsx
|
|
1617
1616
|
function Columns(props) {
|
|
1618
|
-
const
|
|
1619
|
-
typeof props.space === "number" ? props.space || 0 : 20
|
|
1620
|
-
);
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1617
|
+
const gutterSize = createMemo7(() => {
|
|
1618
|
+
return typeof props.space === "number" ? props.space || 0 : 20;
|
|
1619
|
+
});
|
|
1620
|
+
const cols = createMemo7(() => {
|
|
1621
|
+
return props.columns || [];
|
|
1622
|
+
});
|
|
1623
|
+
const stackAt = createMemo7(() => {
|
|
1624
|
+
return props.stackColumnsAt || "tablet";
|
|
1625
|
+
});
|
|
1626
1626
|
function getTagName(column) {
|
|
1627
1627
|
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1628
1628
|
}
|
|
@@ -1646,6 +1646,9 @@ function Columns(props) {
|
|
|
1646
1646
|
}) {
|
|
1647
1647
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1648
1648
|
}
|
|
1649
|
+
const flexDir = createMemo7(() => {
|
|
1650
|
+
return props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
1651
|
+
});
|
|
1649
1652
|
function columnsCssVars() {
|
|
1650
1653
|
return {
|
|
1651
1654
|
"--flex-dir": flexDir(),
|
|
@@ -1735,7 +1738,7 @@ function Columns(props) {
|
|
|
1735
1738
|
}
|
|
1736
1739
|
return <>
|
|
1737
1740
|
<div
|
|
1738
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1741
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-a1dad3b8"}
|
|
1739
1742
|
style={columnsCssVars()}
|
|
1740
1743
|
{...{}}
|
|
1741
1744
|
>
|
|
@@ -1764,7 +1767,7 @@ function Columns(props) {
|
|
|
1764
1767
|
/></Dynamic_renderer_default>;
|
|
1765
1768
|
}}</For4>
|
|
1766
1769
|
</div>
|
|
1767
|
-
<style>{`.div-
|
|
1770
|
+
<style>{`.div-a1dad3b8 {
|
|
1768
1771
|
display: flex;
|
|
1769
1772
|
line-height: normal;
|
|
1770
1773
|
}`}</style>
|
|
@@ -4416,7 +4419,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4416
4419
|
}
|
|
4417
4420
|
|
|
4418
4421
|
// src/constants/sdk-version.ts
|
|
4419
|
-
var SDK_VERSION = "2.0.
|
|
4422
|
+
var SDK_VERSION = "2.0.28";
|
|
4420
4423
|
|
|
4421
4424
|
// src/helpers/sdk-headers.ts
|
|
4422
4425
|
var getSdkHeaders = () => ({
|
|
@@ -4526,7 +4529,8 @@ var generateContentUrl = (options) => {
|
|
|
4526
4529
|
cacheSeconds,
|
|
4527
4530
|
staleCacheSeconds,
|
|
4528
4531
|
sort,
|
|
4529
|
-
includeUnpublished
|
|
4532
|
+
includeUnpublished,
|
|
4533
|
+
apiHost
|
|
4530
4534
|
} = options;
|
|
4531
4535
|
if (!apiKey) {
|
|
4532
4536
|
throw new Error("Missing API key");
|
|
@@ -4535,7 +4539,8 @@ var generateContentUrl = (options) => {
|
|
|
4535
4539
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4536
4540
|
}
|
|
4537
4541
|
const noTraverse = limit !== 1;
|
|
4538
|
-
const
|
|
4542
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
4543
|
+
const url = new URL(`${baseUrl}/api/${apiVersion}/content/${model}`);
|
|
4539
4544
|
url.searchParams.set("apiKey", apiKey);
|
|
4540
4545
|
url.searchParams.set("limit", String(limit));
|
|
4541
4546
|
url.searchParams.set("noTraverse", String(noTraverse));
|
|
@@ -4821,7 +4826,10 @@ var createEvent = async ({
|
|
|
4821
4826
|
ownerId: apiKey
|
|
4822
4827
|
}
|
|
4823
4828
|
});
|
|
4824
|
-
async function _track(
|
|
4829
|
+
async function _track({
|
|
4830
|
+
apiHost,
|
|
4831
|
+
...eventProps
|
|
4832
|
+
}) {
|
|
4825
4833
|
if (!eventProps.apiKey) {
|
|
4826
4834
|
logger.error("Missing API key for track call. Please provide your API key.");
|
|
4827
4835
|
return;
|
|
@@ -4835,7 +4843,8 @@ async function _track(eventProps) {
|
|
|
4835
4843
|
if (!(isBrowser() || TARGET === "reactNative")) {
|
|
4836
4844
|
return;
|
|
4837
4845
|
}
|
|
4838
|
-
|
|
4846
|
+
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
4847
|
+
return fetch(`${baseUrl}/api/v1/track`, {
|
|
4839
4848
|
method: "POST",
|
|
4840
4849
|
body: JSON.stringify({
|
|
4841
4850
|
events: [await createEvent(eventProps)]
|
|
@@ -5276,6 +5285,7 @@ function EnableEditor(props) {
|
|
|
5276
5285
|
const variationId = props.builderContextSignal.content?.testVariationId;
|
|
5277
5286
|
const contentId = props.builderContextSignal.content?.id;
|
|
5278
5287
|
_track({
|
|
5288
|
+
apiHost: props.apiHost,
|
|
5279
5289
|
type: "click",
|
|
5280
5290
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5281
5291
|
contentId,
|
|
@@ -5344,7 +5354,7 @@ function EnableEditor(props) {
|
|
|
5344
5354
|
emitStateUpdate();
|
|
5345
5355
|
onMount6(() => {
|
|
5346
5356
|
if (isBrowser()) {
|
|
5347
|
-
if (isEditing()) {
|
|
5357
|
+
if (isEditing() && !props.isNestedRender) {
|
|
5348
5358
|
window.addEventListener("message", processMessage);
|
|
5349
5359
|
registerInsertMenu();
|
|
5350
5360
|
setupBrowserForEditing({
|
|
@@ -5375,6 +5385,7 @@ function EnableEditor(props) {
|
|
|
5375
5385
|
const contentId = props.builderContextSignal.content?.id;
|
|
5376
5386
|
const apiKeyProp = props.apiKey;
|
|
5377
5387
|
_track({
|
|
5388
|
+
apiHost: props.apiHost,
|
|
5378
5389
|
type: "impression",
|
|
5379
5390
|
canTrack: true,
|
|
5380
5391
|
contentId,
|
|
@@ -5614,6 +5625,7 @@ function ContentComponent(props) {
|
|
|
5614
5625
|
registeredComponents: registeredComponents()
|
|
5615
5626
|
}}
|
|
5616
5627
|
><Enable_editor_default
|
|
5628
|
+
apiHost={props.apiHost}
|
|
5617
5629
|
nonce={props.nonce}
|
|
5618
5630
|
content={props.content}
|
|
5619
5631
|
data={props.data}
|
|
@@ -5628,6 +5640,7 @@ function ContentComponent(props) {
|
|
|
5628
5640
|
contentWrapper={props.contentWrapper}
|
|
5629
5641
|
contentWrapperProps={props.contentWrapperProps}
|
|
5630
5642
|
trustedHosts={props.trustedHosts}
|
|
5643
|
+
isNestedRender={props.isNestedRender}
|
|
5631
5644
|
{...{
|
|
5632
5645
|
setBuilderContextSignal
|
|
5633
5646
|
}}
|
|
@@ -5706,6 +5719,7 @@ function ContentVariants(props) {
|
|
|
5706
5719
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5707
5720
|
const index = _index();
|
|
5708
5721
|
return <Content_default
|
|
5722
|
+
apiHost={props.apiHost}
|
|
5709
5723
|
isNestedRender={props.isNestedRender}
|
|
5710
5724
|
key={variant.testVariationId}
|
|
5711
5725
|
nonce={props.nonce}
|
|
@@ -5732,6 +5746,7 @@ function ContentVariants(props) {
|
|
|
5732
5746
|
}}</For9>
|
|
5733
5747
|
</Show15>
|
|
5734
5748
|
<Content_default
|
|
5749
|
+
apiHost={props.apiHost}
|
|
5735
5750
|
nonce={props.nonce}
|
|
5736
5751
|
isNestedRender={props.isNestedRender}
|
|
5737
5752
|
{...{}}
|