@builder.io/sdk-solid 0.13.4 → 0.14.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/dist/index.d.ts +1 -33
- package/lib/browser/dev.js +17 -52
- package/lib/browser/dev.jsx +12 -39
- package/lib/browser/index.js +17 -52
- package/lib/browser/index.jsx +12 -39
- package/lib/edge/dev.js +17 -52
- package/lib/edge/dev.jsx +12 -39
- package/lib/edge/index.js +17 -52
- package/lib/edge/index.jsx +12 -39
- package/lib/node/dev.js +19 -53
- package/lib/node/dev.jsx +14 -40
- package/lib/node/index.js +19 -53
- package/lib/node/index.jsx +14 -40
- package/package.json +1 -1
package/lib/node/dev.jsx
CHANGED
|
@@ -53,7 +53,6 @@ var getClassPropName = () => {
|
|
|
53
53
|
// src/blocks/button/button.tsx
|
|
54
54
|
function Button(props) {
|
|
55
55
|
return <Dynamic_renderer_default
|
|
56
|
-
TagName={props.link ? props.builderLinkComponent || "a" : "button"}
|
|
57
56
|
attributes={{
|
|
58
57
|
...props.attributes,
|
|
59
58
|
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
@@ -65,6 +64,7 @@ function Button(props) {
|
|
|
65
64
|
role: "button"
|
|
66
65
|
}
|
|
67
66
|
}}
|
|
67
|
+
TagName={props.link ? props.builderLinkComponent || "a" : "button"}
|
|
68
68
|
actionAttributes={{}}
|
|
69
69
|
>{props.text}</Dynamic_renderer_default>;
|
|
70
70
|
}
|
|
@@ -301,7 +301,6 @@ try {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
// src/functions/evaluate/node-runtime/node-runtime.ts
|
|
304
|
-
var ivm = safeDynamicRequire("isolated-vm");
|
|
305
304
|
var getSyncValName = (key) => `bldr_${key}_sync`;
|
|
306
305
|
var BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
|
|
307
306
|
var INJECTED_IVM_GLOBAL = "BUILDER_IVM";
|
|
@@ -354,6 +353,7 @@ output;
|
|
|
354
353
|
`;
|
|
355
354
|
};
|
|
356
355
|
var getIsolateContext = () => {
|
|
356
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
357
357
|
const isolate = new ivm.Isolate({
|
|
358
358
|
memoryLimit: 128
|
|
359
359
|
});
|
|
@@ -368,6 +368,7 @@ var runInNode = ({
|
|
|
368
368
|
rootSetState,
|
|
369
369
|
rootState
|
|
370
370
|
}) => {
|
|
371
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
371
372
|
const state = fastClone({
|
|
372
373
|
...rootState,
|
|
373
374
|
...localState
|
|
@@ -3524,7 +3525,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3524
3525
|
}, ...getExtraComponents()];
|
|
3525
3526
|
|
|
3526
3527
|
// src/functions/register-component.ts
|
|
3527
|
-
var components = [];
|
|
3528
3528
|
var createRegisterComponentMessage = (info) => ({
|
|
3529
3529
|
type: "builder.registerComponent",
|
|
3530
3530
|
data: serializeComponentInfo(info)
|
|
@@ -3691,16 +3691,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3691
3691
|
// src/functions/get-content/generate-content-url.ts
|
|
3692
3692
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3693
3693
|
var generateContentUrl = (options) => {
|
|
3694
|
-
let {
|
|
3695
|
-
noTraverse = false
|
|
3696
|
-
} = options;
|
|
3697
3694
|
const {
|
|
3698
3695
|
limit = 30,
|
|
3699
3696
|
userAttributes,
|
|
3700
3697
|
query,
|
|
3701
3698
|
model,
|
|
3702
3699
|
apiKey,
|
|
3703
|
-
includeRefs = true,
|
|
3704
3700
|
enrich,
|
|
3705
3701
|
locale,
|
|
3706
3702
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -3718,10 +3714,16 @@ var generateContentUrl = (options) => {
|
|
|
3718
3714
|
if (!["v3"].includes(apiVersion)) {
|
|
3719
3715
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
3720
3716
|
}
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3717
|
+
const noTraverse = limit !== 1;
|
|
3718
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
3719
|
+
url.searchParams.set("apiKey", apiKey);
|
|
3720
|
+
url.searchParams.set("limit", String(limit));
|
|
3721
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
3722
|
+
url.searchParams.set("includeRefs", String(true));
|
|
3723
|
+
if (locale)
|
|
3724
|
+
url.searchParams.set("locale", locale);
|
|
3725
|
+
if (enrich)
|
|
3726
|
+
url.searchParams.set("enrich", String(enrich));
|
|
3725
3727
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
3726
3728
|
if (fields) {
|
|
3727
3729
|
url.searchParams.set("fields", fields);
|
|
@@ -3780,7 +3782,6 @@ async function fetchOneEntry(options) {
|
|
|
3780
3782
|
}
|
|
3781
3783
|
return null;
|
|
3782
3784
|
}
|
|
3783
|
-
var getContent = fetchOneEntry;
|
|
3784
3785
|
var _fetchContent = async (options) => {
|
|
3785
3786
|
const url = generateContentUrl(options);
|
|
3786
3787
|
const res = await fetch2(url.href);
|
|
@@ -3834,7 +3835,6 @@ async function fetchEntries(options) {
|
|
|
3834
3835
|
return null;
|
|
3835
3836
|
}
|
|
3836
3837
|
}
|
|
3837
|
-
var getAllContent = fetchEntries;
|
|
3838
3838
|
|
|
3839
3839
|
// src/functions/is-previewing.ts
|
|
3840
3840
|
function isPreviewing() {
|
|
@@ -4094,7 +4094,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4094
4094
|
}
|
|
4095
4095
|
|
|
4096
4096
|
// src/constants/sdk-version.ts
|
|
4097
|
-
var SDK_VERSION = "0.
|
|
4097
|
+
var SDK_VERSION = "0.14.1";
|
|
4098
4098
|
|
|
4099
4099
|
// src/functions/register.ts
|
|
4100
4100
|
var registry = {};
|
|
@@ -4458,9 +4458,6 @@ function EnableEditor(props) {
|
|
|
4458
4458
|
...props.locale ? {
|
|
4459
4459
|
locale: props.locale
|
|
4460
4460
|
} : {},
|
|
4461
|
-
...props.includeRefs ? {
|
|
4462
|
-
includeRefs: props.includeRefs
|
|
4463
|
-
} : {},
|
|
4464
4461
|
...props.enrich ? {
|
|
4465
4462
|
enrich: props.enrich
|
|
4466
4463
|
} : {},
|
|
@@ -4725,12 +4722,6 @@ function ContentComponent(props) {
|
|
|
4725
4722
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
4726
4723
|
[
|
|
4727
4724
|
...getDefaultRegisteredComponents(),
|
|
4728
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4729
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4730
|
-
// existing usage.
|
|
4731
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4732
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4733
|
-
...components,
|
|
4734
4725
|
...props.customComponents || []
|
|
4735
4726
|
].reduce(
|
|
4736
4727
|
(acc, { component, ...info }) => ({
|
|
@@ -4760,12 +4751,6 @@ function ContentComponent(props) {
|
|
|
4760
4751
|
apiVersion: props.apiVersion,
|
|
4761
4752
|
componentInfos: [
|
|
4762
4753
|
...getDefaultRegisteredComponents(),
|
|
4763
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4764
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4765
|
-
// existing usage.
|
|
4766
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4767
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4768
|
-
...components,
|
|
4769
4754
|
...props.customComponents || []
|
|
4770
4755
|
].reduce(
|
|
4771
4756
|
(acc, { component: _, ...info }) => ({
|
|
@@ -4796,7 +4781,6 @@ function ContentComponent(props) {
|
|
|
4796
4781
|
apiKey={props.apiKey}
|
|
4797
4782
|
canTrack={props.canTrack}
|
|
4798
4783
|
locale={props.locale}
|
|
4799
|
-
includeRefs={props.includeRefs}
|
|
4800
4784
|
enrich={props.enrich}
|
|
4801
4785
|
showContent={props.showContent}
|
|
4802
4786
|
builderContextSignal={builderContextSignal()}
|
|
@@ -4881,7 +4865,6 @@ function ContentVariants(props) {
|
|
|
4881
4865
|
linkComponent={props.linkComponent}
|
|
4882
4866
|
canTrack={props.canTrack}
|
|
4883
4867
|
locale={props.locale}
|
|
4884
|
-
includeRefs={props.includeRefs}
|
|
4885
4868
|
enrich={props.enrich}
|
|
4886
4869
|
isSsrAbTest={shouldRenderVariants()}
|
|
4887
4870
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4905,7 +4888,6 @@ function ContentVariants(props) {
|
|
|
4905
4888
|
linkComponent={props.linkComponent}
|
|
4906
4889
|
canTrack={props.canTrack}
|
|
4907
4890
|
locale={props.locale}
|
|
4908
|
-
includeRefs={props.includeRefs}
|
|
4909
4891
|
enrich={props.enrich}
|
|
4910
4892
|
isSsrAbTest={shouldRenderVariants()}
|
|
4911
4893
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4993,10 +4975,6 @@ function Symbol(props) {
|
|
|
4993
4975
|
}
|
|
4994
4976
|
var symbol_default = Symbol;
|
|
4995
4977
|
|
|
4996
|
-
// src/index-helpers/blocks-exports.ts
|
|
4997
|
-
var RenderBlocks = Blocks_default;
|
|
4998
|
-
var RenderContent = Content_variants_default;
|
|
4999
|
-
|
|
5000
4978
|
// src/functions/set-editor-settings.ts
|
|
5001
4979
|
var settings = {};
|
|
5002
4980
|
function setEditorSettings(newSettings) {
|
|
@@ -5038,8 +5016,6 @@ export {
|
|
|
5038
5016
|
Content_variants_default as Content,
|
|
5039
5017
|
fragment_default as Fragment,
|
|
5040
5018
|
image_default as Image,
|
|
5041
|
-
RenderBlocks,
|
|
5042
|
-
RenderContent,
|
|
5043
5019
|
section_default as Section,
|
|
5044
5020
|
symbol_default as Symbol,
|
|
5045
5021
|
text_default as Text,
|
|
@@ -5049,9 +5025,7 @@ export {
|
|
|
5049
5025
|
fetchBuilderProps,
|
|
5050
5026
|
fetchEntries,
|
|
5051
5027
|
fetchOneEntry,
|
|
5052
|
-
getAllContent,
|
|
5053
5028
|
getBuilderSearchParams,
|
|
5054
|
-
getContent,
|
|
5055
5029
|
isEditing,
|
|
5056
5030
|
isPreviewing,
|
|
5057
5031
|
register,
|
package/lib/node/index.js
CHANGED
|
@@ -76,9 +76,6 @@ var getClassPropName = () => {
|
|
|
76
76
|
// src/blocks/button/button.tsx
|
|
77
77
|
function Button(props) {
|
|
78
78
|
return createComponent(dynamic_renderer_default, {
|
|
79
|
-
get TagName() {
|
|
80
|
-
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
81
|
-
},
|
|
82
79
|
get attributes() {
|
|
83
80
|
return {
|
|
84
81
|
...props.attributes,
|
|
@@ -92,6 +89,9 @@ function Button(props) {
|
|
|
92
89
|
}
|
|
93
90
|
};
|
|
94
91
|
},
|
|
92
|
+
get TagName() {
|
|
93
|
+
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
94
|
+
},
|
|
95
95
|
actionAttributes: {},
|
|
96
96
|
get children() {
|
|
97
97
|
return props.text;
|
|
@@ -310,7 +310,6 @@ try {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// src/functions/evaluate/node-runtime/node-runtime.ts
|
|
313
|
-
var ivm = safeDynamicRequire("isolated-vm");
|
|
314
313
|
var getSyncValName = (key) => `bldr_${key}_sync`;
|
|
315
314
|
var BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
|
|
316
315
|
var INJECTED_IVM_GLOBAL = "BUILDER_IVM";
|
|
@@ -363,6 +362,7 @@ output;
|
|
|
363
362
|
`;
|
|
364
363
|
};
|
|
365
364
|
var getIsolateContext = () => {
|
|
365
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
366
366
|
const isolate = new ivm.Isolate({
|
|
367
367
|
memoryLimit: 128
|
|
368
368
|
});
|
|
@@ -377,6 +377,7 @@ var runInNode = ({
|
|
|
377
377
|
rootSetState,
|
|
378
378
|
rootState
|
|
379
379
|
}) => {
|
|
380
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
380
381
|
const state = fastClone({
|
|
381
382
|
...rootState,
|
|
382
383
|
...localState
|
|
@@ -3931,7 +3932,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3931
3932
|
}, ...getExtraComponents()];
|
|
3932
3933
|
|
|
3933
3934
|
// src/functions/register-component.ts
|
|
3934
|
-
var components = [];
|
|
3935
3935
|
var createRegisterComponentMessage = (info) => ({
|
|
3936
3936
|
type: "builder.registerComponent",
|
|
3937
3937
|
data: serializeComponentInfo(info)
|
|
@@ -4103,16 +4103,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
4103
4103
|
// src/functions/get-content/generate-content-url.ts
|
|
4104
4104
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
4105
4105
|
var generateContentUrl = (options) => {
|
|
4106
|
-
let {
|
|
4107
|
-
noTraverse = false
|
|
4108
|
-
} = options;
|
|
4109
4106
|
const {
|
|
4110
4107
|
limit = 30,
|
|
4111
4108
|
userAttributes,
|
|
4112
4109
|
query,
|
|
4113
4110
|
model,
|
|
4114
4111
|
apiKey,
|
|
4115
|
-
includeRefs = true,
|
|
4116
4112
|
enrich,
|
|
4117
4113
|
locale,
|
|
4118
4114
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -4130,10 +4126,16 @@ var generateContentUrl = (options) => {
|
|
|
4130
4126
|
if (!["v3"].includes(apiVersion)) {
|
|
4131
4127
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4132
4128
|
}
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4129
|
+
const noTraverse = limit !== 1;
|
|
4130
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
4131
|
+
url.searchParams.set("apiKey", apiKey);
|
|
4132
|
+
url.searchParams.set("limit", String(limit));
|
|
4133
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
4134
|
+
url.searchParams.set("includeRefs", String(true));
|
|
4135
|
+
if (locale)
|
|
4136
|
+
url.searchParams.set("locale", locale);
|
|
4137
|
+
if (enrich)
|
|
4138
|
+
url.searchParams.set("enrich", String(enrich));
|
|
4137
4139
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
4138
4140
|
if (fields) {
|
|
4139
4141
|
url.searchParams.set("fields", fields);
|
|
@@ -4192,7 +4194,6 @@ async function fetchOneEntry(options) {
|
|
|
4192
4194
|
}
|
|
4193
4195
|
return null;
|
|
4194
4196
|
}
|
|
4195
|
-
var getContent = fetchOneEntry;
|
|
4196
4197
|
var _fetchContent = async (options) => {
|
|
4197
4198
|
const url = generateContentUrl(options);
|
|
4198
4199
|
const res = await fetch2(url.href);
|
|
@@ -4246,7 +4247,6 @@ async function fetchEntries(options) {
|
|
|
4246
4247
|
return null;
|
|
4247
4248
|
}
|
|
4248
4249
|
}
|
|
4249
|
-
var getAllContent = fetchEntries;
|
|
4250
4250
|
|
|
4251
4251
|
// src/functions/is-previewing.ts
|
|
4252
4252
|
function isPreviewing() {
|
|
@@ -4503,7 +4503,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
|
|
4505
4505
|
// src/constants/sdk-version.ts
|
|
4506
|
-
var SDK_VERSION = "0.
|
|
4506
|
+
var SDK_VERSION = "0.14.1";
|
|
4507
4507
|
|
|
4508
4508
|
// src/functions/register.ts
|
|
4509
4509
|
var registry = {};
|
|
@@ -4861,9 +4861,6 @@ function EnableEditor(props) {
|
|
|
4861
4861
|
...props.locale ? {
|
|
4862
4862
|
locale: props.locale
|
|
4863
4863
|
} : {},
|
|
4864
|
-
...props.includeRefs ? {
|
|
4865
|
-
includeRefs: props.includeRefs
|
|
4866
|
-
} : {},
|
|
4867
4864
|
...props.enrich ? {
|
|
4868
4865
|
enrich: props.enrich
|
|
4869
4866
|
} : {},
|
|
@@ -5134,16 +5131,7 @@ function ContentComponent(props) {
|
|
|
5134
5131
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5135
5132
|
contentId: props.content?.id
|
|
5136
5133
|
}));
|
|
5137
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
5138
|
-
...getDefaultRegisteredComponents(),
|
|
5139
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5140
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5141
|
-
// existing usage.
|
|
5142
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5143
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5144
|
-
...components,
|
|
5145
|
-
...props.customComponents || []
|
|
5146
|
-
].reduce((acc, {
|
|
5134
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5147
5135
|
component,
|
|
5148
5136
|
...info
|
|
5149
5137
|
}) => ({
|
|
@@ -5168,16 +5156,7 @@ function ContentComponent(props) {
|
|
|
5168
5156
|
context: props.context || {},
|
|
5169
5157
|
apiKey: props.apiKey,
|
|
5170
5158
|
apiVersion: props.apiVersion,
|
|
5171
|
-
componentInfos: [
|
|
5172
|
-
...getDefaultRegisteredComponents(),
|
|
5173
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5174
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5175
|
-
// existing usage.
|
|
5176
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5177
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5178
|
-
...components,
|
|
5179
|
-
...props.customComponents || []
|
|
5180
|
-
].reduce((acc, {
|
|
5159
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5181
5160
|
component: _,
|
|
5182
5161
|
...info
|
|
5183
5162
|
}) => ({
|
|
@@ -5223,9 +5202,6 @@ function ContentComponent(props) {
|
|
|
5223
5202
|
get locale() {
|
|
5224
5203
|
return props.locale;
|
|
5225
5204
|
},
|
|
5226
|
-
get includeRefs() {
|
|
5227
|
-
return props.includeRefs;
|
|
5228
|
-
},
|
|
5229
5205
|
get enrich() {
|
|
5230
5206
|
return props.enrich;
|
|
5231
5207
|
},
|
|
@@ -5391,9 +5367,6 @@ function ContentVariants(props) {
|
|
|
5391
5367
|
get locale() {
|
|
5392
5368
|
return props.locale;
|
|
5393
5369
|
},
|
|
5394
|
-
get includeRefs() {
|
|
5395
|
-
return props.includeRefs;
|
|
5396
|
-
},
|
|
5397
5370
|
get enrich() {
|
|
5398
5371
|
return props.enrich;
|
|
5399
5372
|
},
|
|
@@ -5451,9 +5424,6 @@ function ContentVariants(props) {
|
|
|
5451
5424
|
get locale() {
|
|
5452
5425
|
return props.locale;
|
|
5453
5426
|
},
|
|
5454
|
-
get includeRefs() {
|
|
5455
|
-
return props.includeRefs;
|
|
5456
|
-
},
|
|
5457
5427
|
get enrich() {
|
|
5458
5428
|
return props.enrich;
|
|
5459
5429
|
},
|
|
@@ -5575,10 +5545,6 @@ function Symbol(props) {
|
|
|
5575
5545
|
}
|
|
5576
5546
|
var symbol_default = Symbol;
|
|
5577
5547
|
|
|
5578
|
-
// src/index-helpers/blocks-exports.ts
|
|
5579
|
-
var RenderBlocks = blocks_default;
|
|
5580
|
-
var RenderContent = content_variants_default;
|
|
5581
|
-
|
|
5582
5548
|
// src/functions/set-editor-settings.ts
|
|
5583
5549
|
var settings = {};
|
|
5584
5550
|
function setEditorSettings(newSettings) {
|
|
@@ -5614,4 +5580,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
5614
5580
|
};
|
|
5615
5581
|
};
|
|
5616
5582
|
|
|
5617
|
-
export { blocks_default as Blocks, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image,
|
|
5583
|
+
export { blocks_default as Blocks, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
|
package/lib/node/index.jsx
CHANGED
|
@@ -53,7 +53,6 @@ var getClassPropName = () => {
|
|
|
53
53
|
// src/blocks/button/button.tsx
|
|
54
54
|
function Button(props) {
|
|
55
55
|
return <Dynamic_renderer_default
|
|
56
|
-
TagName={props.link ? props.builderLinkComponent || "a" : "button"}
|
|
57
56
|
attributes={{
|
|
58
57
|
...props.attributes,
|
|
59
58
|
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
@@ -65,6 +64,7 @@ function Button(props) {
|
|
|
65
64
|
role: "button"
|
|
66
65
|
}
|
|
67
66
|
}}
|
|
67
|
+
TagName={props.link ? props.builderLinkComponent || "a" : "button"}
|
|
68
68
|
actionAttributes={{}}
|
|
69
69
|
>{props.text}</Dynamic_renderer_default>;
|
|
70
70
|
}
|
|
@@ -299,7 +299,6 @@ try {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// src/functions/evaluate/node-runtime/node-runtime.ts
|
|
302
|
-
var ivm = safeDynamicRequire("isolated-vm");
|
|
303
302
|
var getSyncValName = (key) => `bldr_${key}_sync`;
|
|
304
303
|
var BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
|
|
305
304
|
var INJECTED_IVM_GLOBAL = "BUILDER_IVM";
|
|
@@ -352,6 +351,7 @@ output;
|
|
|
352
351
|
`;
|
|
353
352
|
};
|
|
354
353
|
var getIsolateContext = () => {
|
|
354
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
355
355
|
const isolate = new ivm.Isolate({
|
|
356
356
|
memoryLimit: 128
|
|
357
357
|
});
|
|
@@ -366,6 +366,7 @@ var runInNode = ({
|
|
|
366
366
|
rootSetState,
|
|
367
367
|
rootState
|
|
368
368
|
}) => {
|
|
369
|
+
const ivm = safeDynamicRequire("isolated-vm");
|
|
369
370
|
const state = fastClone({
|
|
370
371
|
...rootState,
|
|
371
372
|
...localState
|
|
@@ -3513,7 +3514,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3513
3514
|
}, ...getExtraComponents()];
|
|
3514
3515
|
|
|
3515
3516
|
// src/functions/register-component.ts
|
|
3516
|
-
var components = [];
|
|
3517
3517
|
var createRegisterComponentMessage = (info) => ({
|
|
3518
3518
|
type: "builder.registerComponent",
|
|
3519
3519
|
data: serializeComponentInfo(info)
|
|
@@ -3678,16 +3678,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3678
3678
|
// src/functions/get-content/generate-content-url.ts
|
|
3679
3679
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3680
3680
|
var generateContentUrl = (options) => {
|
|
3681
|
-
let {
|
|
3682
|
-
noTraverse = false
|
|
3683
|
-
} = options;
|
|
3684
3681
|
const {
|
|
3685
3682
|
limit = 30,
|
|
3686
3683
|
userAttributes,
|
|
3687
3684
|
query,
|
|
3688
3685
|
model,
|
|
3689
3686
|
apiKey,
|
|
3690
|
-
includeRefs = true,
|
|
3691
3687
|
enrich,
|
|
3692
3688
|
locale,
|
|
3693
3689
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -3705,10 +3701,16 @@ var generateContentUrl = (options) => {
|
|
|
3705
3701
|
if (!["v3"].includes(apiVersion)) {
|
|
3706
3702
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
3707
3703
|
}
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3704
|
+
const noTraverse = limit !== 1;
|
|
3705
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
3706
|
+
url.searchParams.set("apiKey", apiKey);
|
|
3707
|
+
url.searchParams.set("limit", String(limit));
|
|
3708
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
3709
|
+
url.searchParams.set("includeRefs", String(true));
|
|
3710
|
+
if (locale)
|
|
3711
|
+
url.searchParams.set("locale", locale);
|
|
3712
|
+
if (enrich)
|
|
3713
|
+
url.searchParams.set("enrich", String(enrich));
|
|
3712
3714
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
3713
3715
|
if (fields) {
|
|
3714
3716
|
url.searchParams.set("fields", fields);
|
|
@@ -3767,7 +3769,6 @@ async function fetchOneEntry(options) {
|
|
|
3767
3769
|
}
|
|
3768
3770
|
return null;
|
|
3769
3771
|
}
|
|
3770
|
-
var getContent = fetchOneEntry;
|
|
3771
3772
|
var _fetchContent = async (options) => {
|
|
3772
3773
|
const url = generateContentUrl(options);
|
|
3773
3774
|
const res = await fetch2(url.href);
|
|
@@ -3821,7 +3822,6 @@ async function fetchEntries(options) {
|
|
|
3821
3822
|
return null;
|
|
3822
3823
|
}
|
|
3823
3824
|
}
|
|
3824
|
-
var getAllContent = fetchEntries;
|
|
3825
3825
|
|
|
3826
3826
|
// src/functions/is-previewing.ts
|
|
3827
3827
|
function isPreviewing() {
|
|
@@ -4078,7 +4078,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4078
4078
|
}
|
|
4079
4079
|
|
|
4080
4080
|
// src/constants/sdk-version.ts
|
|
4081
|
-
var SDK_VERSION = "0.
|
|
4081
|
+
var SDK_VERSION = "0.14.1";
|
|
4082
4082
|
|
|
4083
4083
|
// src/functions/register.ts
|
|
4084
4084
|
var registry = {};
|
|
@@ -4440,9 +4440,6 @@ function EnableEditor(props) {
|
|
|
4440
4440
|
...props.locale ? {
|
|
4441
4441
|
locale: props.locale
|
|
4442
4442
|
} : {},
|
|
4443
|
-
...props.includeRefs ? {
|
|
4444
|
-
includeRefs: props.includeRefs
|
|
4445
|
-
} : {},
|
|
4446
4443
|
...props.enrich ? {
|
|
4447
4444
|
enrich: props.enrich
|
|
4448
4445
|
} : {},
|
|
@@ -4707,12 +4704,6 @@ function ContentComponent(props) {
|
|
|
4707
4704
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
4708
4705
|
[
|
|
4709
4706
|
...getDefaultRegisteredComponents(),
|
|
4710
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4711
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4712
|
-
// existing usage.
|
|
4713
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4714
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4715
|
-
...components,
|
|
4716
4707
|
...props.customComponents || []
|
|
4717
4708
|
].reduce(
|
|
4718
4709
|
(acc, { component, ...info }) => ({
|
|
@@ -4742,12 +4733,6 @@ function ContentComponent(props) {
|
|
|
4742
4733
|
apiVersion: props.apiVersion,
|
|
4743
4734
|
componentInfos: [
|
|
4744
4735
|
...getDefaultRegisteredComponents(),
|
|
4745
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4746
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4747
|
-
// existing usage.
|
|
4748
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4749
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4750
|
-
...components,
|
|
4751
4736
|
...props.customComponents || []
|
|
4752
4737
|
].reduce(
|
|
4753
4738
|
(acc, { component: _, ...info }) => ({
|
|
@@ -4778,7 +4763,6 @@ function ContentComponent(props) {
|
|
|
4778
4763
|
apiKey={props.apiKey}
|
|
4779
4764
|
canTrack={props.canTrack}
|
|
4780
4765
|
locale={props.locale}
|
|
4781
|
-
includeRefs={props.includeRefs}
|
|
4782
4766
|
enrich={props.enrich}
|
|
4783
4767
|
showContent={props.showContent}
|
|
4784
4768
|
builderContextSignal={builderContextSignal()}
|
|
@@ -4863,7 +4847,6 @@ function ContentVariants(props) {
|
|
|
4863
4847
|
linkComponent={props.linkComponent}
|
|
4864
4848
|
canTrack={props.canTrack}
|
|
4865
4849
|
locale={props.locale}
|
|
4866
|
-
includeRefs={props.includeRefs}
|
|
4867
4850
|
enrich={props.enrich}
|
|
4868
4851
|
isSsrAbTest={shouldRenderVariants()}
|
|
4869
4852
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4887,7 +4870,6 @@ function ContentVariants(props) {
|
|
|
4887
4870
|
linkComponent={props.linkComponent}
|
|
4888
4871
|
canTrack={props.canTrack}
|
|
4889
4872
|
locale={props.locale}
|
|
4890
|
-
includeRefs={props.includeRefs}
|
|
4891
4873
|
enrich={props.enrich}
|
|
4892
4874
|
isSsrAbTest={shouldRenderVariants()}
|
|
4893
4875
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4975,10 +4957,6 @@ function Symbol(props) {
|
|
|
4975
4957
|
}
|
|
4976
4958
|
var symbol_default = Symbol;
|
|
4977
4959
|
|
|
4978
|
-
// src/index-helpers/blocks-exports.ts
|
|
4979
|
-
var RenderBlocks = Blocks_default;
|
|
4980
|
-
var RenderContent = Content_variants_default;
|
|
4981
|
-
|
|
4982
4960
|
// src/functions/set-editor-settings.ts
|
|
4983
4961
|
var settings = {};
|
|
4984
4962
|
function setEditorSettings(newSettings) {
|
|
@@ -5020,8 +4998,6 @@ export {
|
|
|
5020
4998
|
Content_variants_default as Content,
|
|
5021
4999
|
fragment_default as Fragment,
|
|
5022
5000
|
image_default as Image,
|
|
5023
|
-
RenderBlocks,
|
|
5024
|
-
RenderContent,
|
|
5025
5001
|
section_default as Section,
|
|
5026
5002
|
symbol_default as Symbol,
|
|
5027
5003
|
text_default as Text,
|
|
@@ -5031,9 +5007,7 @@ export {
|
|
|
5031
5007
|
fetchBuilderProps,
|
|
5032
5008
|
fetchEntries,
|
|
5033
5009
|
fetchOneEntry,
|
|
5034
|
-
getAllContent,
|
|
5035
5010
|
getBuilderSearchParams,
|
|
5036
|
-
getContent,
|
|
5037
5011
|
isEditing,
|
|
5038
5012
|
isPreviewing,
|
|
5039
5013
|
register,
|