@builder.io/sdk-solid 0.13.4 → 0.14.0
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 +14 -49
- package/lib/browser/dev.jsx +11 -38
- package/lib/browser/index.js +14 -49
- package/lib/browser/index.jsx +11 -38
- package/lib/edge/dev.js +14 -49
- package/lib/edge/dev.jsx +11 -38
- package/lib/edge/index.js +14 -49
- package/lib/edge/index.jsx +11 -38
- package/lib/node/dev.js +14 -49
- package/lib/node/dev.jsx +11 -38
- package/lib/node/index.js +14 -49
- package/lib/node/index.jsx +11 -38
- package/package.json +1 -1
package/lib/edge/index.jsx
CHANGED
|
@@ -6543,7 +6543,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
6543
6543
|
}, ...getExtraComponents()];
|
|
6544
6544
|
|
|
6545
6545
|
// src/functions/register-component.ts
|
|
6546
|
-
var components = [];
|
|
6547
6546
|
var createRegisterComponentMessage = (info) => ({
|
|
6548
6547
|
type: "builder.registerComponent",
|
|
6549
6548
|
data: serializeComponentInfo(info)
|
|
@@ -6708,16 +6707,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
6708
6707
|
// src/functions/get-content/generate-content-url.ts
|
|
6709
6708
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
6710
6709
|
var generateContentUrl = (options) => {
|
|
6711
|
-
let {
|
|
6712
|
-
noTraverse = false
|
|
6713
|
-
} = options;
|
|
6714
6710
|
const {
|
|
6715
6711
|
limit = 30,
|
|
6716
6712
|
userAttributes,
|
|
6717
6713
|
query,
|
|
6718
6714
|
model,
|
|
6719
6715
|
apiKey,
|
|
6720
|
-
includeRefs = true,
|
|
6721
6716
|
enrich,
|
|
6722
6717
|
locale,
|
|
6723
6718
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -6735,10 +6730,16 @@ var generateContentUrl = (options) => {
|
|
|
6735
6730
|
if (!["v3"].includes(apiVersion)) {
|
|
6736
6731
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
6737
6732
|
}
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6733
|
+
const noTraverse = limit !== 1;
|
|
6734
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
6735
|
+
url.searchParams.set("apiKey", apiKey);
|
|
6736
|
+
url.searchParams.set("limit", String(limit));
|
|
6737
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
6738
|
+
url.searchParams.set("includeRefs", String(true));
|
|
6739
|
+
if (locale)
|
|
6740
|
+
url.searchParams.set("locale", locale);
|
|
6741
|
+
if (enrich)
|
|
6742
|
+
url.searchParams.set("enrich", String(enrich));
|
|
6742
6743
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
6743
6744
|
if (fields) {
|
|
6744
6745
|
url.searchParams.set("fields", fields);
|
|
@@ -6797,7 +6798,6 @@ async function fetchOneEntry(options) {
|
|
|
6797
6798
|
}
|
|
6798
6799
|
return null;
|
|
6799
6800
|
}
|
|
6800
|
-
var getContent = fetchOneEntry;
|
|
6801
6801
|
var _fetchContent = async (options) => {
|
|
6802
6802
|
const url = generateContentUrl(options);
|
|
6803
6803
|
const res = await fetch2(url.href);
|
|
@@ -6851,7 +6851,6 @@ async function fetchEntries(options) {
|
|
|
6851
6851
|
return null;
|
|
6852
6852
|
}
|
|
6853
6853
|
}
|
|
6854
|
-
var getAllContent = fetchEntries;
|
|
6855
6854
|
|
|
6856
6855
|
// src/functions/is-previewing.ts
|
|
6857
6856
|
function isPreviewing() {
|
|
@@ -7108,7 +7107,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7108
7107
|
}
|
|
7109
7108
|
|
|
7110
7109
|
// src/constants/sdk-version.ts
|
|
7111
|
-
var SDK_VERSION = "0.
|
|
7110
|
+
var SDK_VERSION = "0.14.0";
|
|
7112
7111
|
|
|
7113
7112
|
// src/functions/register.ts
|
|
7114
7113
|
var registry = {};
|
|
@@ -7470,9 +7469,6 @@ function EnableEditor(props) {
|
|
|
7470
7469
|
...props.locale ? {
|
|
7471
7470
|
locale: props.locale
|
|
7472
7471
|
} : {},
|
|
7473
|
-
...props.includeRefs ? {
|
|
7474
|
-
includeRefs: props.includeRefs
|
|
7475
|
-
} : {},
|
|
7476
7472
|
...props.enrich ? {
|
|
7477
7473
|
enrich: props.enrich
|
|
7478
7474
|
} : {},
|
|
@@ -7737,12 +7733,6 @@ function ContentComponent(props) {
|
|
|
7737
7733
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
7738
7734
|
[
|
|
7739
7735
|
...getDefaultRegisteredComponents(),
|
|
7740
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
7741
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
7742
|
-
// existing usage.
|
|
7743
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
7744
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
7745
|
-
...components,
|
|
7746
7736
|
...props.customComponents || []
|
|
7747
7737
|
].reduce(
|
|
7748
7738
|
(acc, { component, ...info }) => ({
|
|
@@ -7772,12 +7762,6 @@ function ContentComponent(props) {
|
|
|
7772
7762
|
apiVersion: props.apiVersion,
|
|
7773
7763
|
componentInfos: [
|
|
7774
7764
|
...getDefaultRegisteredComponents(),
|
|
7775
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
7776
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
7777
|
-
// existing usage.
|
|
7778
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
7779
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
7780
|
-
...components,
|
|
7781
7765
|
...props.customComponents || []
|
|
7782
7766
|
].reduce(
|
|
7783
7767
|
(acc, { component: _, ...info }) => ({
|
|
@@ -7808,7 +7792,6 @@ function ContentComponent(props) {
|
|
|
7808
7792
|
apiKey={props.apiKey}
|
|
7809
7793
|
canTrack={props.canTrack}
|
|
7810
7794
|
locale={props.locale}
|
|
7811
|
-
includeRefs={props.includeRefs}
|
|
7812
7795
|
enrich={props.enrich}
|
|
7813
7796
|
showContent={props.showContent}
|
|
7814
7797
|
builderContextSignal={builderContextSignal()}
|
|
@@ -7893,7 +7876,6 @@ function ContentVariants(props) {
|
|
|
7893
7876
|
linkComponent={props.linkComponent}
|
|
7894
7877
|
canTrack={props.canTrack}
|
|
7895
7878
|
locale={props.locale}
|
|
7896
|
-
includeRefs={props.includeRefs}
|
|
7897
7879
|
enrich={props.enrich}
|
|
7898
7880
|
isSsrAbTest={shouldRenderVariants()}
|
|
7899
7881
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -7917,7 +7899,6 @@ function ContentVariants(props) {
|
|
|
7917
7899
|
linkComponent={props.linkComponent}
|
|
7918
7900
|
canTrack={props.canTrack}
|
|
7919
7901
|
locale={props.locale}
|
|
7920
|
-
includeRefs={props.includeRefs}
|
|
7921
7902
|
enrich={props.enrich}
|
|
7922
7903
|
isSsrAbTest={shouldRenderVariants()}
|
|
7923
7904
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -8005,10 +7986,6 @@ function Symbol2(props) {
|
|
|
8005
7986
|
}
|
|
8006
7987
|
var symbol_default = Symbol2;
|
|
8007
7988
|
|
|
8008
|
-
// src/index-helpers/blocks-exports.ts
|
|
8009
|
-
var RenderBlocks = Blocks_default;
|
|
8010
|
-
var RenderContent = Content_variants_default;
|
|
8011
|
-
|
|
8012
7989
|
// src/functions/set-editor-settings.ts
|
|
8013
7990
|
var settings = {};
|
|
8014
7991
|
function setEditorSettings(newSettings) {
|
|
@@ -8050,8 +8027,6 @@ export {
|
|
|
8050
8027
|
Content_variants_default as Content,
|
|
8051
8028
|
fragment_default as Fragment,
|
|
8052
8029
|
image_default as Image,
|
|
8053
|
-
RenderBlocks,
|
|
8054
|
-
RenderContent,
|
|
8055
8030
|
section_default as Section,
|
|
8056
8031
|
symbol_default as Symbol,
|
|
8057
8032
|
text_default as Text,
|
|
@@ -8061,9 +8036,7 @@ export {
|
|
|
8061
8036
|
fetchBuilderProps,
|
|
8062
8037
|
fetchEntries,
|
|
8063
8038
|
fetchOneEntry,
|
|
8064
|
-
getAllContent,
|
|
8065
8039
|
getBuilderSearchParams,
|
|
8066
|
-
getContent,
|
|
8067
8040
|
isEditing,
|
|
8068
8041
|
isPreviewing,
|
|
8069
8042
|
register,
|
package/lib/node/dev.js
CHANGED
|
@@ -3942,7 +3942,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3942
3942
|
}, ...getExtraComponents()];
|
|
3943
3943
|
|
|
3944
3944
|
// src/functions/register-component.ts
|
|
3945
|
-
var components = [];
|
|
3946
3945
|
var createRegisterComponentMessage = (info) => ({
|
|
3947
3946
|
type: "builder.registerComponent",
|
|
3948
3947
|
data: serializeComponentInfo(info)
|
|
@@ -4116,16 +4115,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
4116
4115
|
// src/functions/get-content/generate-content-url.ts
|
|
4117
4116
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
4118
4117
|
var generateContentUrl = (options) => {
|
|
4119
|
-
let {
|
|
4120
|
-
noTraverse = false
|
|
4121
|
-
} = options;
|
|
4122
4118
|
const {
|
|
4123
4119
|
limit = 30,
|
|
4124
4120
|
userAttributes,
|
|
4125
4121
|
query,
|
|
4126
4122
|
model,
|
|
4127
4123
|
apiKey,
|
|
4128
|
-
includeRefs = true,
|
|
4129
4124
|
enrich,
|
|
4130
4125
|
locale,
|
|
4131
4126
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -4143,10 +4138,16 @@ var generateContentUrl = (options) => {
|
|
|
4143
4138
|
if (!["v3"].includes(apiVersion)) {
|
|
4144
4139
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4145
4140
|
}
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4141
|
+
const noTraverse = limit !== 1;
|
|
4142
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
4143
|
+
url.searchParams.set("apiKey", apiKey);
|
|
4144
|
+
url.searchParams.set("limit", String(limit));
|
|
4145
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
4146
|
+
url.searchParams.set("includeRefs", String(true));
|
|
4147
|
+
if (locale)
|
|
4148
|
+
url.searchParams.set("locale", locale);
|
|
4149
|
+
if (enrich)
|
|
4150
|
+
url.searchParams.set("enrich", String(enrich));
|
|
4150
4151
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
4151
4152
|
if (fields) {
|
|
4152
4153
|
url.searchParams.set("fields", fields);
|
|
@@ -4205,7 +4206,6 @@ async function fetchOneEntry(options) {
|
|
|
4205
4206
|
}
|
|
4206
4207
|
return null;
|
|
4207
4208
|
}
|
|
4208
|
-
var getContent = fetchOneEntry;
|
|
4209
4209
|
var _fetchContent = async (options) => {
|
|
4210
4210
|
const url = generateContentUrl(options);
|
|
4211
4211
|
const res = await fetch2(url.href);
|
|
@@ -4259,7 +4259,6 @@ async function fetchEntries(options) {
|
|
|
4259
4259
|
return null;
|
|
4260
4260
|
}
|
|
4261
4261
|
}
|
|
4262
|
-
var getAllContent = fetchEntries;
|
|
4263
4262
|
|
|
4264
4263
|
// src/functions/is-previewing.ts
|
|
4265
4264
|
function isPreviewing() {
|
|
@@ -4519,7 +4518,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4519
4518
|
}
|
|
4520
4519
|
|
|
4521
4520
|
// src/constants/sdk-version.ts
|
|
4522
|
-
var SDK_VERSION = "0.
|
|
4521
|
+
var SDK_VERSION = "0.14.0";
|
|
4523
4522
|
|
|
4524
4523
|
// src/functions/register.ts
|
|
4525
4524
|
var registry = {};
|
|
@@ -4879,9 +4878,6 @@ function EnableEditor(props) {
|
|
|
4879
4878
|
...props.locale ? {
|
|
4880
4879
|
locale: props.locale
|
|
4881
4880
|
} : {},
|
|
4882
|
-
...props.includeRefs ? {
|
|
4883
|
-
includeRefs: props.includeRefs
|
|
4884
|
-
} : {},
|
|
4885
4881
|
...props.enrich ? {
|
|
4886
4882
|
enrich: props.enrich
|
|
4887
4883
|
} : {},
|
|
@@ -5152,16 +5148,7 @@ function ContentComponent(props) {
|
|
|
5152
5148
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5153
5149
|
contentId: props.content?.id
|
|
5154
5150
|
}));
|
|
5155
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
5156
|
-
...getDefaultRegisteredComponents(),
|
|
5157
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5158
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5159
|
-
// existing usage.
|
|
5160
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5161
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5162
|
-
...components,
|
|
5163
|
-
...props.customComponents || []
|
|
5164
|
-
].reduce((acc, {
|
|
5151
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5165
5152
|
component,
|
|
5166
5153
|
...info
|
|
5167
5154
|
}) => ({
|
|
@@ -5186,16 +5173,7 @@ function ContentComponent(props) {
|
|
|
5186
5173
|
context: props.context || {},
|
|
5187
5174
|
apiKey: props.apiKey,
|
|
5188
5175
|
apiVersion: props.apiVersion,
|
|
5189
|
-
componentInfos: [
|
|
5190
|
-
...getDefaultRegisteredComponents(),
|
|
5191
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5192
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5193
|
-
// existing usage.
|
|
5194
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5195
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5196
|
-
...components,
|
|
5197
|
-
...props.customComponents || []
|
|
5198
|
-
].reduce((acc, {
|
|
5176
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5199
5177
|
component: _,
|
|
5200
5178
|
...info
|
|
5201
5179
|
}) => ({
|
|
@@ -5241,9 +5219,6 @@ function ContentComponent(props) {
|
|
|
5241
5219
|
get locale() {
|
|
5242
5220
|
return props.locale;
|
|
5243
5221
|
},
|
|
5244
|
-
get includeRefs() {
|
|
5245
|
-
return props.includeRefs;
|
|
5246
|
-
},
|
|
5247
5222
|
get enrich() {
|
|
5248
5223
|
return props.enrich;
|
|
5249
5224
|
},
|
|
@@ -5409,9 +5384,6 @@ function ContentVariants(props) {
|
|
|
5409
5384
|
get locale() {
|
|
5410
5385
|
return props.locale;
|
|
5411
5386
|
},
|
|
5412
|
-
get includeRefs() {
|
|
5413
|
-
return props.includeRefs;
|
|
5414
|
-
},
|
|
5415
5387
|
get enrich() {
|
|
5416
5388
|
return props.enrich;
|
|
5417
5389
|
},
|
|
@@ -5469,9 +5441,6 @@ function ContentVariants(props) {
|
|
|
5469
5441
|
get locale() {
|
|
5470
5442
|
return props.locale;
|
|
5471
5443
|
},
|
|
5472
|
-
get includeRefs() {
|
|
5473
|
-
return props.includeRefs;
|
|
5474
|
-
},
|
|
5475
5444
|
get enrich() {
|
|
5476
5445
|
return props.enrich;
|
|
5477
5446
|
},
|
|
@@ -5593,10 +5562,6 @@ function Symbol(props) {
|
|
|
5593
5562
|
}
|
|
5594
5563
|
var symbol_default = Symbol;
|
|
5595
5564
|
|
|
5596
|
-
// src/index-helpers/blocks-exports.ts
|
|
5597
|
-
var RenderBlocks = blocks_default;
|
|
5598
|
-
var RenderContent = content_variants_default;
|
|
5599
|
-
|
|
5600
5565
|
// src/functions/set-editor-settings.ts
|
|
5601
5566
|
var settings = {};
|
|
5602
5567
|
function setEditorSettings(newSettings) {
|
|
@@ -5632,4 +5597,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
5632
5597
|
};
|
|
5633
5598
|
};
|
|
5634
5599
|
|
|
5635
|
-
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,
|
|
5600
|
+
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/dev.jsx
CHANGED
|
@@ -3524,7 +3524,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3524
3524
|
}, ...getExtraComponents()];
|
|
3525
3525
|
|
|
3526
3526
|
// src/functions/register-component.ts
|
|
3527
|
-
var components = [];
|
|
3528
3527
|
var createRegisterComponentMessage = (info) => ({
|
|
3529
3528
|
type: "builder.registerComponent",
|
|
3530
3529
|
data: serializeComponentInfo(info)
|
|
@@ -3691,16 +3690,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3691
3690
|
// src/functions/get-content/generate-content-url.ts
|
|
3692
3691
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3693
3692
|
var generateContentUrl = (options) => {
|
|
3694
|
-
let {
|
|
3695
|
-
noTraverse = false
|
|
3696
|
-
} = options;
|
|
3697
3693
|
const {
|
|
3698
3694
|
limit = 30,
|
|
3699
3695
|
userAttributes,
|
|
3700
3696
|
query,
|
|
3701
3697
|
model,
|
|
3702
3698
|
apiKey,
|
|
3703
|
-
includeRefs = true,
|
|
3704
3699
|
enrich,
|
|
3705
3700
|
locale,
|
|
3706
3701
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -3718,10 +3713,16 @@ var generateContentUrl = (options) => {
|
|
|
3718
3713
|
if (!["v3"].includes(apiVersion)) {
|
|
3719
3714
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
3720
3715
|
}
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3716
|
+
const noTraverse = limit !== 1;
|
|
3717
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
3718
|
+
url.searchParams.set("apiKey", apiKey);
|
|
3719
|
+
url.searchParams.set("limit", String(limit));
|
|
3720
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
3721
|
+
url.searchParams.set("includeRefs", String(true));
|
|
3722
|
+
if (locale)
|
|
3723
|
+
url.searchParams.set("locale", locale);
|
|
3724
|
+
if (enrich)
|
|
3725
|
+
url.searchParams.set("enrich", String(enrich));
|
|
3725
3726
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
3726
3727
|
if (fields) {
|
|
3727
3728
|
url.searchParams.set("fields", fields);
|
|
@@ -3780,7 +3781,6 @@ async function fetchOneEntry(options) {
|
|
|
3780
3781
|
}
|
|
3781
3782
|
return null;
|
|
3782
3783
|
}
|
|
3783
|
-
var getContent = fetchOneEntry;
|
|
3784
3784
|
var _fetchContent = async (options) => {
|
|
3785
3785
|
const url = generateContentUrl(options);
|
|
3786
3786
|
const res = await fetch2(url.href);
|
|
@@ -3834,7 +3834,6 @@ async function fetchEntries(options) {
|
|
|
3834
3834
|
return null;
|
|
3835
3835
|
}
|
|
3836
3836
|
}
|
|
3837
|
-
var getAllContent = fetchEntries;
|
|
3838
3837
|
|
|
3839
3838
|
// src/functions/is-previewing.ts
|
|
3840
3839
|
function isPreviewing() {
|
|
@@ -4094,7 +4093,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4094
4093
|
}
|
|
4095
4094
|
|
|
4096
4095
|
// src/constants/sdk-version.ts
|
|
4097
|
-
var SDK_VERSION = "0.
|
|
4096
|
+
var SDK_VERSION = "0.14.0";
|
|
4098
4097
|
|
|
4099
4098
|
// src/functions/register.ts
|
|
4100
4099
|
var registry = {};
|
|
@@ -4458,9 +4457,6 @@ function EnableEditor(props) {
|
|
|
4458
4457
|
...props.locale ? {
|
|
4459
4458
|
locale: props.locale
|
|
4460
4459
|
} : {},
|
|
4461
|
-
...props.includeRefs ? {
|
|
4462
|
-
includeRefs: props.includeRefs
|
|
4463
|
-
} : {},
|
|
4464
4460
|
...props.enrich ? {
|
|
4465
4461
|
enrich: props.enrich
|
|
4466
4462
|
} : {},
|
|
@@ -4725,12 +4721,6 @@ function ContentComponent(props) {
|
|
|
4725
4721
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
4726
4722
|
[
|
|
4727
4723
|
...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
4724
|
...props.customComponents || []
|
|
4735
4725
|
].reduce(
|
|
4736
4726
|
(acc, { component, ...info }) => ({
|
|
@@ -4760,12 +4750,6 @@ function ContentComponent(props) {
|
|
|
4760
4750
|
apiVersion: props.apiVersion,
|
|
4761
4751
|
componentInfos: [
|
|
4762
4752
|
...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
4753
|
...props.customComponents || []
|
|
4770
4754
|
].reduce(
|
|
4771
4755
|
(acc, { component: _, ...info }) => ({
|
|
@@ -4796,7 +4780,6 @@ function ContentComponent(props) {
|
|
|
4796
4780
|
apiKey={props.apiKey}
|
|
4797
4781
|
canTrack={props.canTrack}
|
|
4798
4782
|
locale={props.locale}
|
|
4799
|
-
includeRefs={props.includeRefs}
|
|
4800
4783
|
enrich={props.enrich}
|
|
4801
4784
|
showContent={props.showContent}
|
|
4802
4785
|
builderContextSignal={builderContextSignal()}
|
|
@@ -4881,7 +4864,6 @@ function ContentVariants(props) {
|
|
|
4881
4864
|
linkComponent={props.linkComponent}
|
|
4882
4865
|
canTrack={props.canTrack}
|
|
4883
4866
|
locale={props.locale}
|
|
4884
|
-
includeRefs={props.includeRefs}
|
|
4885
4867
|
enrich={props.enrich}
|
|
4886
4868
|
isSsrAbTest={shouldRenderVariants()}
|
|
4887
4869
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4905,7 +4887,6 @@ function ContentVariants(props) {
|
|
|
4905
4887
|
linkComponent={props.linkComponent}
|
|
4906
4888
|
canTrack={props.canTrack}
|
|
4907
4889
|
locale={props.locale}
|
|
4908
|
-
includeRefs={props.includeRefs}
|
|
4909
4890
|
enrich={props.enrich}
|
|
4910
4891
|
isSsrAbTest={shouldRenderVariants()}
|
|
4911
4892
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4993,10 +4974,6 @@ function Symbol(props) {
|
|
|
4993
4974
|
}
|
|
4994
4975
|
var symbol_default = Symbol;
|
|
4995
4976
|
|
|
4996
|
-
// src/index-helpers/blocks-exports.ts
|
|
4997
|
-
var RenderBlocks = Blocks_default;
|
|
4998
|
-
var RenderContent = Content_variants_default;
|
|
4999
|
-
|
|
5000
4977
|
// src/functions/set-editor-settings.ts
|
|
5001
4978
|
var settings = {};
|
|
5002
4979
|
function setEditorSettings(newSettings) {
|
|
@@ -5038,8 +5015,6 @@ export {
|
|
|
5038
5015
|
Content_variants_default as Content,
|
|
5039
5016
|
fragment_default as Fragment,
|
|
5040
5017
|
image_default as Image,
|
|
5041
|
-
RenderBlocks,
|
|
5042
|
-
RenderContent,
|
|
5043
5018
|
section_default as Section,
|
|
5044
5019
|
symbol_default as Symbol,
|
|
5045
5020
|
text_default as Text,
|
|
@@ -5049,9 +5024,7 @@ export {
|
|
|
5049
5024
|
fetchBuilderProps,
|
|
5050
5025
|
fetchEntries,
|
|
5051
5026
|
fetchOneEntry,
|
|
5052
|
-
getAllContent,
|
|
5053
5027
|
getBuilderSearchParams,
|
|
5054
|
-
getContent,
|
|
5055
5028
|
isEditing,
|
|
5056
5029
|
isPreviewing,
|
|
5057
5030
|
register,
|
package/lib/node/index.js
CHANGED
|
@@ -3931,7 +3931,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3931
3931
|
}, ...getExtraComponents()];
|
|
3932
3932
|
|
|
3933
3933
|
// src/functions/register-component.ts
|
|
3934
|
-
var components = [];
|
|
3935
3934
|
var createRegisterComponentMessage = (info) => ({
|
|
3936
3935
|
type: "builder.registerComponent",
|
|
3937
3936
|
data: serializeComponentInfo(info)
|
|
@@ -4103,16 +4102,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
4103
4102
|
// src/functions/get-content/generate-content-url.ts
|
|
4104
4103
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
4105
4104
|
var generateContentUrl = (options) => {
|
|
4106
|
-
let {
|
|
4107
|
-
noTraverse = false
|
|
4108
|
-
} = options;
|
|
4109
4105
|
const {
|
|
4110
4106
|
limit = 30,
|
|
4111
4107
|
userAttributes,
|
|
4112
4108
|
query,
|
|
4113
4109
|
model,
|
|
4114
4110
|
apiKey,
|
|
4115
|
-
includeRefs = true,
|
|
4116
4111
|
enrich,
|
|
4117
4112
|
locale,
|
|
4118
4113
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -4130,10 +4125,16 @@ var generateContentUrl = (options) => {
|
|
|
4130
4125
|
if (!["v3"].includes(apiVersion)) {
|
|
4131
4126
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4132
4127
|
}
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4128
|
+
const noTraverse = limit !== 1;
|
|
4129
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
4130
|
+
url.searchParams.set("apiKey", apiKey);
|
|
4131
|
+
url.searchParams.set("limit", String(limit));
|
|
4132
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
4133
|
+
url.searchParams.set("includeRefs", String(true));
|
|
4134
|
+
if (locale)
|
|
4135
|
+
url.searchParams.set("locale", locale);
|
|
4136
|
+
if (enrich)
|
|
4137
|
+
url.searchParams.set("enrich", String(enrich));
|
|
4137
4138
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
4138
4139
|
if (fields) {
|
|
4139
4140
|
url.searchParams.set("fields", fields);
|
|
@@ -4192,7 +4193,6 @@ async function fetchOneEntry(options) {
|
|
|
4192
4193
|
}
|
|
4193
4194
|
return null;
|
|
4194
4195
|
}
|
|
4195
|
-
var getContent = fetchOneEntry;
|
|
4196
4196
|
var _fetchContent = async (options) => {
|
|
4197
4197
|
const url = generateContentUrl(options);
|
|
4198
4198
|
const res = await fetch2(url.href);
|
|
@@ -4246,7 +4246,6 @@ async function fetchEntries(options) {
|
|
|
4246
4246
|
return null;
|
|
4247
4247
|
}
|
|
4248
4248
|
}
|
|
4249
|
-
var getAllContent = fetchEntries;
|
|
4250
4249
|
|
|
4251
4250
|
// src/functions/is-previewing.ts
|
|
4252
4251
|
function isPreviewing() {
|
|
@@ -4503,7 +4502,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4503
4502
|
}
|
|
4504
4503
|
|
|
4505
4504
|
// src/constants/sdk-version.ts
|
|
4506
|
-
var SDK_VERSION = "0.
|
|
4505
|
+
var SDK_VERSION = "0.14.0";
|
|
4507
4506
|
|
|
4508
4507
|
// src/functions/register.ts
|
|
4509
4508
|
var registry = {};
|
|
@@ -4861,9 +4860,6 @@ function EnableEditor(props) {
|
|
|
4861
4860
|
...props.locale ? {
|
|
4862
4861
|
locale: props.locale
|
|
4863
4862
|
} : {},
|
|
4864
|
-
...props.includeRefs ? {
|
|
4865
|
-
includeRefs: props.includeRefs
|
|
4866
|
-
} : {},
|
|
4867
4863
|
...props.enrich ? {
|
|
4868
4864
|
enrich: props.enrich
|
|
4869
4865
|
} : {},
|
|
@@ -5134,16 +5130,7 @@ function ContentComponent(props) {
|
|
|
5134
5130
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5135
5131
|
contentId: props.content?.id
|
|
5136
5132
|
}));
|
|
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, {
|
|
5133
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5147
5134
|
component,
|
|
5148
5135
|
...info
|
|
5149
5136
|
}) => ({
|
|
@@ -5168,16 +5155,7 @@ function ContentComponent(props) {
|
|
|
5168
5155
|
context: props.context || {},
|
|
5169
5156
|
apiKey: props.apiKey,
|
|
5170
5157
|
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, {
|
|
5158
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5181
5159
|
component: _,
|
|
5182
5160
|
...info
|
|
5183
5161
|
}) => ({
|
|
@@ -5223,9 +5201,6 @@ function ContentComponent(props) {
|
|
|
5223
5201
|
get locale() {
|
|
5224
5202
|
return props.locale;
|
|
5225
5203
|
},
|
|
5226
|
-
get includeRefs() {
|
|
5227
|
-
return props.includeRefs;
|
|
5228
|
-
},
|
|
5229
5204
|
get enrich() {
|
|
5230
5205
|
return props.enrich;
|
|
5231
5206
|
},
|
|
@@ -5391,9 +5366,6 @@ function ContentVariants(props) {
|
|
|
5391
5366
|
get locale() {
|
|
5392
5367
|
return props.locale;
|
|
5393
5368
|
},
|
|
5394
|
-
get includeRefs() {
|
|
5395
|
-
return props.includeRefs;
|
|
5396
|
-
},
|
|
5397
5369
|
get enrich() {
|
|
5398
5370
|
return props.enrich;
|
|
5399
5371
|
},
|
|
@@ -5451,9 +5423,6 @@ function ContentVariants(props) {
|
|
|
5451
5423
|
get locale() {
|
|
5452
5424
|
return props.locale;
|
|
5453
5425
|
},
|
|
5454
|
-
get includeRefs() {
|
|
5455
|
-
return props.includeRefs;
|
|
5456
|
-
},
|
|
5457
5426
|
get enrich() {
|
|
5458
5427
|
return props.enrich;
|
|
5459
5428
|
},
|
|
@@ -5575,10 +5544,6 @@ function Symbol(props) {
|
|
|
5575
5544
|
}
|
|
5576
5545
|
var symbol_default = Symbol;
|
|
5577
5546
|
|
|
5578
|
-
// src/index-helpers/blocks-exports.ts
|
|
5579
|
-
var RenderBlocks = blocks_default;
|
|
5580
|
-
var RenderContent = content_variants_default;
|
|
5581
|
-
|
|
5582
5547
|
// src/functions/set-editor-settings.ts
|
|
5583
5548
|
var settings = {};
|
|
5584
5549
|
function setEditorSettings(newSettings) {
|
|
@@ -5614,4 +5579,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
5614
5579
|
};
|
|
5615
5580
|
};
|
|
5616
5581
|
|
|
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,
|
|
5582
|
+
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 };
|