@builder.io/sdk-solid 0.13.3 → 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 +15 -50
- package/lib/browser/dev.jsx +12 -39
- package/lib/browser/index.js +15 -50
- package/lib/browser/index.jsx +12 -39
- package/lib/edge/dev.js +15 -50
- package/lib/edge/dev.jsx +12 -39
- package/lib/edge/index.js +15 -50
- package/lib/edge/index.jsx +12 -39
- package/lib/node/dev.js +15 -50
- package/lib/node/dev.jsx +12 -39
- package/lib/node/index.js +15 -50
- package/lib/node/index.jsx +12 -39
- package/package.json +1 -1
package/lib/browser/index.jsx
CHANGED
|
@@ -3176,7 +3176,7 @@ var componentInfo16 = {
|
|
|
3176
3176
|
type: "file",
|
|
3177
3177
|
allowedFileTypes: ["mp4"],
|
|
3178
3178
|
bubble: true,
|
|
3179
|
-
defaultValue: "https://
|
|
3179
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
3180
3180
|
required: true
|
|
3181
3181
|
}, {
|
|
3182
3182
|
name: "posterImage",
|
|
@@ -3388,7 +3388,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3388
3388
|
}, ...getExtraComponents()];
|
|
3389
3389
|
|
|
3390
3390
|
// src/functions/register-component.ts
|
|
3391
|
-
var components = [];
|
|
3392
3391
|
var createRegisterComponentMessage = (info) => ({
|
|
3393
3392
|
type: "builder.registerComponent",
|
|
3394
3393
|
data: serializeComponentInfo(info)
|
|
@@ -3553,16 +3552,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3553
3552
|
// src/functions/get-content/generate-content-url.ts
|
|
3554
3553
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3555
3554
|
var generateContentUrl = (options) => {
|
|
3556
|
-
let {
|
|
3557
|
-
noTraverse = false
|
|
3558
|
-
} = options;
|
|
3559
3555
|
const {
|
|
3560
3556
|
limit = 30,
|
|
3561
3557
|
userAttributes,
|
|
3562
3558
|
query,
|
|
3563
3559
|
model,
|
|
3564
3560
|
apiKey,
|
|
3565
|
-
includeRefs = true,
|
|
3566
3561
|
enrich,
|
|
3567
3562
|
locale,
|
|
3568
3563
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -3580,10 +3575,16 @@ var generateContentUrl = (options) => {
|
|
|
3580
3575
|
if (!["v3"].includes(apiVersion)) {
|
|
3581
3576
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
3582
3577
|
}
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3578
|
+
const noTraverse = limit !== 1;
|
|
3579
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
3580
|
+
url.searchParams.set("apiKey", apiKey);
|
|
3581
|
+
url.searchParams.set("limit", String(limit));
|
|
3582
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
3583
|
+
url.searchParams.set("includeRefs", String(true));
|
|
3584
|
+
if (locale)
|
|
3585
|
+
url.searchParams.set("locale", locale);
|
|
3586
|
+
if (enrich)
|
|
3587
|
+
url.searchParams.set("enrich", String(enrich));
|
|
3587
3588
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
3588
3589
|
if (fields) {
|
|
3589
3590
|
url.searchParams.set("fields", fields);
|
|
@@ -3642,7 +3643,6 @@ async function fetchOneEntry(options) {
|
|
|
3642
3643
|
}
|
|
3643
3644
|
return null;
|
|
3644
3645
|
}
|
|
3645
|
-
var getContent = fetchOneEntry;
|
|
3646
3646
|
var _fetchContent = async (options) => {
|
|
3647
3647
|
const url = generateContentUrl(options);
|
|
3648
3648
|
const res = await fetch2(url.href);
|
|
@@ -3696,7 +3696,6 @@ async function fetchEntries(options) {
|
|
|
3696
3696
|
return null;
|
|
3697
3697
|
}
|
|
3698
3698
|
}
|
|
3699
|
-
var getAllContent = fetchEntries;
|
|
3700
3699
|
|
|
3701
3700
|
// src/functions/is-previewing.ts
|
|
3702
3701
|
function isPreviewing() {
|
|
@@ -3953,7 +3952,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
3953
3952
|
}
|
|
3954
3953
|
|
|
3955
3954
|
// src/constants/sdk-version.ts
|
|
3956
|
-
var SDK_VERSION = "0.
|
|
3955
|
+
var SDK_VERSION = "0.14.0";
|
|
3957
3956
|
|
|
3958
3957
|
// src/functions/register.ts
|
|
3959
3958
|
var registry = {};
|
|
@@ -4315,9 +4314,6 @@ function EnableEditor(props) {
|
|
|
4315
4314
|
...props.locale ? {
|
|
4316
4315
|
locale: props.locale
|
|
4317
4316
|
} : {},
|
|
4318
|
-
...props.includeRefs ? {
|
|
4319
|
-
includeRefs: props.includeRefs
|
|
4320
|
-
} : {},
|
|
4321
4317
|
...props.enrich ? {
|
|
4322
4318
|
enrich: props.enrich
|
|
4323
4319
|
} : {},
|
|
@@ -4582,12 +4578,6 @@ function ContentComponent(props) {
|
|
|
4582
4578
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
4583
4579
|
[
|
|
4584
4580
|
...getDefaultRegisteredComponents(),
|
|
4585
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4586
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4587
|
-
// existing usage.
|
|
4588
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4589
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4590
|
-
...components,
|
|
4591
4581
|
...props.customComponents || []
|
|
4592
4582
|
].reduce(
|
|
4593
4583
|
(acc, { component, ...info }) => ({
|
|
@@ -4617,12 +4607,6 @@ function ContentComponent(props) {
|
|
|
4617
4607
|
apiVersion: props.apiVersion,
|
|
4618
4608
|
componentInfos: [
|
|
4619
4609
|
...getDefaultRegisteredComponents(),
|
|
4620
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4621
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4622
|
-
// existing usage.
|
|
4623
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4624
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4625
|
-
...components,
|
|
4626
4610
|
...props.customComponents || []
|
|
4627
4611
|
].reduce(
|
|
4628
4612
|
(acc, { component: _, ...info }) => ({
|
|
@@ -4653,7 +4637,6 @@ function ContentComponent(props) {
|
|
|
4653
4637
|
apiKey={props.apiKey}
|
|
4654
4638
|
canTrack={props.canTrack}
|
|
4655
4639
|
locale={props.locale}
|
|
4656
|
-
includeRefs={props.includeRefs}
|
|
4657
4640
|
enrich={props.enrich}
|
|
4658
4641
|
showContent={props.showContent}
|
|
4659
4642
|
builderContextSignal={builderContextSignal()}
|
|
@@ -4738,7 +4721,6 @@ function ContentVariants(props) {
|
|
|
4738
4721
|
linkComponent={props.linkComponent}
|
|
4739
4722
|
canTrack={props.canTrack}
|
|
4740
4723
|
locale={props.locale}
|
|
4741
|
-
includeRefs={props.includeRefs}
|
|
4742
4724
|
enrich={props.enrich}
|
|
4743
4725
|
isSsrAbTest={shouldRenderVariants()}
|
|
4744
4726
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4762,7 +4744,6 @@ function ContentVariants(props) {
|
|
|
4762
4744
|
linkComponent={props.linkComponent}
|
|
4763
4745
|
canTrack={props.canTrack}
|
|
4764
4746
|
locale={props.locale}
|
|
4765
|
-
includeRefs={props.includeRefs}
|
|
4766
4747
|
enrich={props.enrich}
|
|
4767
4748
|
isSsrAbTest={shouldRenderVariants()}
|
|
4768
4749
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4850,10 +4831,6 @@ function Symbol(props) {
|
|
|
4850
4831
|
}
|
|
4851
4832
|
var symbol_default = Symbol;
|
|
4852
4833
|
|
|
4853
|
-
// src/index-helpers/blocks-exports.ts
|
|
4854
|
-
var RenderBlocks = Blocks_default;
|
|
4855
|
-
var RenderContent = Content_variants_default;
|
|
4856
|
-
|
|
4857
4834
|
// src/functions/set-editor-settings.ts
|
|
4858
4835
|
var settings = {};
|
|
4859
4836
|
function setEditorSettings(newSettings) {
|
|
@@ -4895,8 +4872,6 @@ export {
|
|
|
4895
4872
|
Content_variants_default as Content,
|
|
4896
4873
|
fragment_default as Fragment,
|
|
4897
4874
|
image_default as Image,
|
|
4898
|
-
RenderBlocks,
|
|
4899
|
-
RenderContent,
|
|
4900
4875
|
section_default as Section,
|
|
4901
4876
|
symbol_default as Symbol,
|
|
4902
4877
|
text_default as Text,
|
|
@@ -4906,9 +4881,7 @@ export {
|
|
|
4906
4881
|
fetchBuilderProps,
|
|
4907
4882
|
fetchEntries,
|
|
4908
4883
|
fetchOneEntry,
|
|
4909
|
-
getAllContent,
|
|
4910
4884
|
getBuilderSearchParams,
|
|
4911
|
-
getContent,
|
|
4912
4885
|
isEditing,
|
|
4913
4886
|
isPreviewing,
|
|
4914
4887
|
register,
|
package/lib/edge/dev.js
CHANGED
|
@@ -6729,7 +6729,7 @@ var componentInfo16 = {
|
|
|
6729
6729
|
type: "file",
|
|
6730
6730
|
allowedFileTypes: ["mp4"],
|
|
6731
6731
|
bubble: true,
|
|
6732
|
-
defaultValue: "https://
|
|
6732
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
6733
6733
|
required: true
|
|
6734
6734
|
}, {
|
|
6735
6735
|
name: "posterImage",
|
|
@@ -6971,7 +6971,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
6971
6971
|
}, ...getExtraComponents()];
|
|
6972
6972
|
|
|
6973
6973
|
// src/functions/register-component.ts
|
|
6974
|
-
var components = [];
|
|
6975
6974
|
var createRegisterComponentMessage = (info) => ({
|
|
6976
6975
|
type: "builder.registerComponent",
|
|
6977
6976
|
data: serializeComponentInfo(info)
|
|
@@ -7145,16 +7144,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
7145
7144
|
// src/functions/get-content/generate-content-url.ts
|
|
7146
7145
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
7147
7146
|
var generateContentUrl = (options) => {
|
|
7148
|
-
let {
|
|
7149
|
-
noTraverse = false
|
|
7150
|
-
} = options;
|
|
7151
7147
|
const {
|
|
7152
7148
|
limit = 30,
|
|
7153
7149
|
userAttributes,
|
|
7154
7150
|
query,
|
|
7155
7151
|
model,
|
|
7156
7152
|
apiKey,
|
|
7157
|
-
includeRefs = true,
|
|
7158
7153
|
enrich,
|
|
7159
7154
|
locale,
|
|
7160
7155
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -7172,10 +7167,16 @@ var generateContentUrl = (options) => {
|
|
|
7172
7167
|
if (!["v3"].includes(apiVersion)) {
|
|
7173
7168
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
7174
7169
|
}
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7170
|
+
const noTraverse = limit !== 1;
|
|
7171
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
7172
|
+
url.searchParams.set("apiKey", apiKey);
|
|
7173
|
+
url.searchParams.set("limit", String(limit));
|
|
7174
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
7175
|
+
url.searchParams.set("includeRefs", String(true));
|
|
7176
|
+
if (locale)
|
|
7177
|
+
url.searchParams.set("locale", locale);
|
|
7178
|
+
if (enrich)
|
|
7179
|
+
url.searchParams.set("enrich", String(enrich));
|
|
7179
7180
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
7180
7181
|
if (fields) {
|
|
7181
7182
|
url.searchParams.set("fields", fields);
|
|
@@ -7234,7 +7235,6 @@ async function fetchOneEntry(options) {
|
|
|
7234
7235
|
}
|
|
7235
7236
|
return null;
|
|
7236
7237
|
}
|
|
7237
|
-
var getContent = fetchOneEntry;
|
|
7238
7238
|
var _fetchContent = async (options) => {
|
|
7239
7239
|
const url = generateContentUrl(options);
|
|
7240
7240
|
const res = await fetch2(url.href);
|
|
@@ -7288,7 +7288,6 @@ async function fetchEntries(options) {
|
|
|
7288
7288
|
return null;
|
|
7289
7289
|
}
|
|
7290
7290
|
}
|
|
7291
|
-
var getAllContent = fetchEntries;
|
|
7292
7291
|
|
|
7293
7292
|
// src/functions/is-previewing.ts
|
|
7294
7293
|
function isPreviewing() {
|
|
@@ -7548,7 +7547,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7548
7547
|
}
|
|
7549
7548
|
|
|
7550
7549
|
// src/constants/sdk-version.ts
|
|
7551
|
-
var SDK_VERSION = "0.
|
|
7550
|
+
var SDK_VERSION = "0.14.0";
|
|
7552
7551
|
|
|
7553
7552
|
// src/functions/register.ts
|
|
7554
7553
|
var registry = {};
|
|
@@ -7908,9 +7907,6 @@ function EnableEditor(props) {
|
|
|
7908
7907
|
...props.locale ? {
|
|
7909
7908
|
locale: props.locale
|
|
7910
7909
|
} : {},
|
|
7911
|
-
...props.includeRefs ? {
|
|
7912
|
-
includeRefs: props.includeRefs
|
|
7913
|
-
} : {},
|
|
7914
7910
|
...props.enrich ? {
|
|
7915
7911
|
enrich: props.enrich
|
|
7916
7912
|
} : {},
|
|
@@ -8181,16 +8177,7 @@ function ContentComponent(props) {
|
|
|
8181
8177
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8182
8178
|
contentId: props.content?.id
|
|
8183
8179
|
}));
|
|
8184
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
8185
|
-
...getDefaultRegisteredComponents(),
|
|
8186
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
8187
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
8188
|
-
// existing usage.
|
|
8189
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
8190
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
8191
|
-
...components,
|
|
8192
|
-
...props.customComponents || []
|
|
8193
|
-
].reduce((acc, {
|
|
8180
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
8194
8181
|
component,
|
|
8195
8182
|
...info
|
|
8196
8183
|
}) => ({
|
|
@@ -8215,16 +8202,7 @@ function ContentComponent(props) {
|
|
|
8215
8202
|
context: props.context || {},
|
|
8216
8203
|
apiKey: props.apiKey,
|
|
8217
8204
|
apiVersion: props.apiVersion,
|
|
8218
|
-
componentInfos: [
|
|
8219
|
-
...getDefaultRegisteredComponents(),
|
|
8220
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
8221
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
8222
|
-
// existing usage.
|
|
8223
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
8224
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
8225
|
-
...components,
|
|
8226
|
-
...props.customComponents || []
|
|
8227
|
-
].reduce((acc, {
|
|
8205
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
8228
8206
|
component: _,
|
|
8229
8207
|
...info
|
|
8230
8208
|
}) => ({
|
|
@@ -8270,9 +8248,6 @@ function ContentComponent(props) {
|
|
|
8270
8248
|
get locale() {
|
|
8271
8249
|
return props.locale;
|
|
8272
8250
|
},
|
|
8273
|
-
get includeRefs() {
|
|
8274
|
-
return props.includeRefs;
|
|
8275
|
-
},
|
|
8276
8251
|
get enrich() {
|
|
8277
8252
|
return props.enrich;
|
|
8278
8253
|
},
|
|
@@ -8438,9 +8413,6 @@ function ContentVariants(props) {
|
|
|
8438
8413
|
get locale() {
|
|
8439
8414
|
return props.locale;
|
|
8440
8415
|
},
|
|
8441
|
-
get includeRefs() {
|
|
8442
|
-
return props.includeRefs;
|
|
8443
|
-
},
|
|
8444
8416
|
get enrich() {
|
|
8445
8417
|
return props.enrich;
|
|
8446
8418
|
},
|
|
@@ -8498,9 +8470,6 @@ function ContentVariants(props) {
|
|
|
8498
8470
|
get locale() {
|
|
8499
8471
|
return props.locale;
|
|
8500
8472
|
},
|
|
8501
|
-
get includeRefs() {
|
|
8502
|
-
return props.includeRefs;
|
|
8503
|
-
},
|
|
8504
8473
|
get enrich() {
|
|
8505
8474
|
return props.enrich;
|
|
8506
8475
|
},
|
|
@@ -8622,10 +8591,6 @@ function Symbol2(props) {
|
|
|
8622
8591
|
}
|
|
8623
8592
|
var symbol_default = Symbol2;
|
|
8624
8593
|
|
|
8625
|
-
// src/index-helpers/blocks-exports.ts
|
|
8626
|
-
var RenderBlocks = blocks_default;
|
|
8627
|
-
var RenderContent = content_variants_default;
|
|
8628
|
-
|
|
8629
8594
|
// src/functions/set-editor-settings.ts
|
|
8630
8595
|
var settings = {};
|
|
8631
8596
|
function setEditorSettings(newSettings) {
|
|
@@ -8661,4 +8626,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
8661
8626
|
};
|
|
8662
8627
|
};
|
|
8663
8628
|
|
|
8664
|
-
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,
|
|
8629
|
+
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/edge/dev.jsx
CHANGED
|
@@ -6341,7 +6341,7 @@ var componentInfo16 = {
|
|
|
6341
6341
|
type: "file",
|
|
6342
6342
|
allowedFileTypes: ["mp4"],
|
|
6343
6343
|
bubble: true,
|
|
6344
|
-
defaultValue: "https://
|
|
6344
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
6345
6345
|
required: true
|
|
6346
6346
|
}, {
|
|
6347
6347
|
name: "posterImage",
|
|
@@ -6553,7 +6553,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
6553
6553
|
}, ...getExtraComponents()];
|
|
6554
6554
|
|
|
6555
6555
|
// src/functions/register-component.ts
|
|
6556
|
-
var components = [];
|
|
6557
6556
|
var createRegisterComponentMessage = (info) => ({
|
|
6558
6557
|
type: "builder.registerComponent",
|
|
6559
6558
|
data: serializeComponentInfo(info)
|
|
@@ -6720,16 +6719,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
6720
6719
|
// src/functions/get-content/generate-content-url.ts
|
|
6721
6720
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
6722
6721
|
var generateContentUrl = (options) => {
|
|
6723
|
-
let {
|
|
6724
|
-
noTraverse = false
|
|
6725
|
-
} = options;
|
|
6726
6722
|
const {
|
|
6727
6723
|
limit = 30,
|
|
6728
6724
|
userAttributes,
|
|
6729
6725
|
query,
|
|
6730
6726
|
model,
|
|
6731
6727
|
apiKey,
|
|
6732
|
-
includeRefs = true,
|
|
6733
6728
|
enrich,
|
|
6734
6729
|
locale,
|
|
6735
6730
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -6747,10 +6742,16 @@ var generateContentUrl = (options) => {
|
|
|
6747
6742
|
if (!["v3"].includes(apiVersion)) {
|
|
6748
6743
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
6749
6744
|
}
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6745
|
+
const noTraverse = limit !== 1;
|
|
6746
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
6747
|
+
url.searchParams.set("apiKey", apiKey);
|
|
6748
|
+
url.searchParams.set("limit", String(limit));
|
|
6749
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
6750
|
+
url.searchParams.set("includeRefs", String(true));
|
|
6751
|
+
if (locale)
|
|
6752
|
+
url.searchParams.set("locale", locale);
|
|
6753
|
+
if (enrich)
|
|
6754
|
+
url.searchParams.set("enrich", String(enrich));
|
|
6754
6755
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
6755
6756
|
if (fields) {
|
|
6756
6757
|
url.searchParams.set("fields", fields);
|
|
@@ -6809,7 +6810,6 @@ async function fetchOneEntry(options) {
|
|
|
6809
6810
|
}
|
|
6810
6811
|
return null;
|
|
6811
6812
|
}
|
|
6812
|
-
var getContent = fetchOneEntry;
|
|
6813
6813
|
var _fetchContent = async (options) => {
|
|
6814
6814
|
const url = generateContentUrl(options);
|
|
6815
6815
|
const res = await fetch2(url.href);
|
|
@@ -6863,7 +6863,6 @@ async function fetchEntries(options) {
|
|
|
6863
6863
|
return null;
|
|
6864
6864
|
}
|
|
6865
6865
|
}
|
|
6866
|
-
var getAllContent = fetchEntries;
|
|
6867
6866
|
|
|
6868
6867
|
// src/functions/is-previewing.ts
|
|
6869
6868
|
function isPreviewing() {
|
|
@@ -7123,7 +7122,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7123
7122
|
}
|
|
7124
7123
|
|
|
7125
7124
|
// src/constants/sdk-version.ts
|
|
7126
|
-
var SDK_VERSION = "0.
|
|
7125
|
+
var SDK_VERSION = "0.14.0";
|
|
7127
7126
|
|
|
7128
7127
|
// src/functions/register.ts
|
|
7129
7128
|
var registry = {};
|
|
@@ -7487,9 +7486,6 @@ function EnableEditor(props) {
|
|
|
7487
7486
|
...props.locale ? {
|
|
7488
7487
|
locale: props.locale
|
|
7489
7488
|
} : {},
|
|
7490
|
-
...props.includeRefs ? {
|
|
7491
|
-
includeRefs: props.includeRefs
|
|
7492
|
-
} : {},
|
|
7493
7489
|
...props.enrich ? {
|
|
7494
7490
|
enrich: props.enrich
|
|
7495
7491
|
} : {},
|
|
@@ -7754,12 +7750,6 @@ function ContentComponent(props) {
|
|
|
7754
7750
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
7755
7751
|
[
|
|
7756
7752
|
...getDefaultRegisteredComponents(),
|
|
7757
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
7758
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
7759
|
-
// existing usage.
|
|
7760
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
7761
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
7762
|
-
...components,
|
|
7763
7753
|
...props.customComponents || []
|
|
7764
7754
|
].reduce(
|
|
7765
7755
|
(acc, { component, ...info }) => ({
|
|
@@ -7789,12 +7779,6 @@ function ContentComponent(props) {
|
|
|
7789
7779
|
apiVersion: props.apiVersion,
|
|
7790
7780
|
componentInfos: [
|
|
7791
7781
|
...getDefaultRegisteredComponents(),
|
|
7792
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
7793
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
7794
|
-
// existing usage.
|
|
7795
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
7796
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
7797
|
-
...components,
|
|
7798
7782
|
...props.customComponents || []
|
|
7799
7783
|
].reduce(
|
|
7800
7784
|
(acc, { component: _, ...info }) => ({
|
|
@@ -7825,7 +7809,6 @@ function ContentComponent(props) {
|
|
|
7825
7809
|
apiKey={props.apiKey}
|
|
7826
7810
|
canTrack={props.canTrack}
|
|
7827
7811
|
locale={props.locale}
|
|
7828
|
-
includeRefs={props.includeRefs}
|
|
7829
7812
|
enrich={props.enrich}
|
|
7830
7813
|
showContent={props.showContent}
|
|
7831
7814
|
builderContextSignal={builderContextSignal()}
|
|
@@ -7910,7 +7893,6 @@ function ContentVariants(props) {
|
|
|
7910
7893
|
linkComponent={props.linkComponent}
|
|
7911
7894
|
canTrack={props.canTrack}
|
|
7912
7895
|
locale={props.locale}
|
|
7913
|
-
includeRefs={props.includeRefs}
|
|
7914
7896
|
enrich={props.enrich}
|
|
7915
7897
|
isSsrAbTest={shouldRenderVariants()}
|
|
7916
7898
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -7934,7 +7916,6 @@ function ContentVariants(props) {
|
|
|
7934
7916
|
linkComponent={props.linkComponent}
|
|
7935
7917
|
canTrack={props.canTrack}
|
|
7936
7918
|
locale={props.locale}
|
|
7937
|
-
includeRefs={props.includeRefs}
|
|
7938
7919
|
enrich={props.enrich}
|
|
7939
7920
|
isSsrAbTest={shouldRenderVariants()}
|
|
7940
7921
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -8022,10 +8003,6 @@ function Symbol2(props) {
|
|
|
8022
8003
|
}
|
|
8023
8004
|
var symbol_default = Symbol2;
|
|
8024
8005
|
|
|
8025
|
-
// src/index-helpers/blocks-exports.ts
|
|
8026
|
-
var RenderBlocks = Blocks_default;
|
|
8027
|
-
var RenderContent = Content_variants_default;
|
|
8028
|
-
|
|
8029
8006
|
// src/functions/set-editor-settings.ts
|
|
8030
8007
|
var settings = {};
|
|
8031
8008
|
function setEditorSettings(newSettings) {
|
|
@@ -8067,8 +8044,6 @@ export {
|
|
|
8067
8044
|
Content_variants_default as Content,
|
|
8068
8045
|
fragment_default as Fragment,
|
|
8069
8046
|
image_default as Image,
|
|
8070
|
-
RenderBlocks,
|
|
8071
|
-
RenderContent,
|
|
8072
8047
|
section_default as Section,
|
|
8073
8048
|
symbol_default as Symbol,
|
|
8074
8049
|
text_default as Text,
|
|
@@ -8078,9 +8053,7 @@ export {
|
|
|
8078
8053
|
fetchBuilderProps,
|
|
8079
8054
|
fetchEntries,
|
|
8080
8055
|
fetchOneEntry,
|
|
8081
|
-
getAllContent,
|
|
8082
8056
|
getBuilderSearchParams,
|
|
8083
|
-
getContent,
|
|
8084
8057
|
isEditing,
|
|
8085
8058
|
isPreviewing,
|
|
8086
8059
|
register,
|
package/lib/edge/index.js
CHANGED
|
@@ -6719,7 +6719,7 @@ var componentInfo16 = {
|
|
|
6719
6719
|
type: "file",
|
|
6720
6720
|
allowedFileTypes: ["mp4"],
|
|
6721
6721
|
bubble: true,
|
|
6722
|
-
defaultValue: "https://
|
|
6722
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
6723
6723
|
required: true
|
|
6724
6724
|
}, {
|
|
6725
6725
|
name: "posterImage",
|
|
@@ -6961,7 +6961,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
6961
6961
|
}, ...getExtraComponents()];
|
|
6962
6962
|
|
|
6963
6963
|
// src/functions/register-component.ts
|
|
6964
|
-
var components = [];
|
|
6965
6964
|
var createRegisterComponentMessage = (info) => ({
|
|
6966
6965
|
type: "builder.registerComponent",
|
|
6967
6966
|
data: serializeComponentInfo(info)
|
|
@@ -7133,16 +7132,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
7133
7132
|
// src/functions/get-content/generate-content-url.ts
|
|
7134
7133
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
7135
7134
|
var generateContentUrl = (options) => {
|
|
7136
|
-
let {
|
|
7137
|
-
noTraverse = false
|
|
7138
|
-
} = options;
|
|
7139
7135
|
const {
|
|
7140
7136
|
limit = 30,
|
|
7141
7137
|
userAttributes,
|
|
7142
7138
|
query,
|
|
7143
7139
|
model,
|
|
7144
7140
|
apiKey,
|
|
7145
|
-
includeRefs = true,
|
|
7146
7141
|
enrich,
|
|
7147
7142
|
locale,
|
|
7148
7143
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -7160,10 +7155,16 @@ var generateContentUrl = (options) => {
|
|
|
7160
7155
|
if (!["v3"].includes(apiVersion)) {
|
|
7161
7156
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
7162
7157
|
}
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7158
|
+
const noTraverse = limit !== 1;
|
|
7159
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
7160
|
+
url.searchParams.set("apiKey", apiKey);
|
|
7161
|
+
url.searchParams.set("limit", String(limit));
|
|
7162
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
7163
|
+
url.searchParams.set("includeRefs", String(true));
|
|
7164
|
+
if (locale)
|
|
7165
|
+
url.searchParams.set("locale", locale);
|
|
7166
|
+
if (enrich)
|
|
7167
|
+
url.searchParams.set("enrich", String(enrich));
|
|
7167
7168
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
7168
7169
|
if (fields) {
|
|
7169
7170
|
url.searchParams.set("fields", fields);
|
|
@@ -7222,7 +7223,6 @@ async function fetchOneEntry(options) {
|
|
|
7222
7223
|
}
|
|
7223
7224
|
return null;
|
|
7224
7225
|
}
|
|
7225
|
-
var getContent = fetchOneEntry;
|
|
7226
7226
|
var _fetchContent = async (options) => {
|
|
7227
7227
|
const url = generateContentUrl(options);
|
|
7228
7228
|
const res = await fetch2(url.href);
|
|
@@ -7276,7 +7276,6 @@ async function fetchEntries(options) {
|
|
|
7276
7276
|
return null;
|
|
7277
7277
|
}
|
|
7278
7278
|
}
|
|
7279
|
-
var getAllContent = fetchEntries;
|
|
7280
7279
|
|
|
7281
7280
|
// src/functions/is-previewing.ts
|
|
7282
7281
|
function isPreviewing() {
|
|
@@ -7533,7 +7532,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7533
7532
|
}
|
|
7534
7533
|
|
|
7535
7534
|
// src/constants/sdk-version.ts
|
|
7536
|
-
var SDK_VERSION = "0.
|
|
7535
|
+
var SDK_VERSION = "0.14.0";
|
|
7537
7536
|
|
|
7538
7537
|
// src/functions/register.ts
|
|
7539
7538
|
var registry = {};
|
|
@@ -7891,9 +7890,6 @@ function EnableEditor(props) {
|
|
|
7891
7890
|
...props.locale ? {
|
|
7892
7891
|
locale: props.locale
|
|
7893
7892
|
} : {},
|
|
7894
|
-
...props.includeRefs ? {
|
|
7895
|
-
includeRefs: props.includeRefs
|
|
7896
|
-
} : {},
|
|
7897
7893
|
...props.enrich ? {
|
|
7898
7894
|
enrich: props.enrich
|
|
7899
7895
|
} : {},
|
|
@@ -8164,16 +8160,7 @@ function ContentComponent(props) {
|
|
|
8164
8160
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8165
8161
|
contentId: props.content?.id
|
|
8166
8162
|
}));
|
|
8167
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
8168
|
-
...getDefaultRegisteredComponents(),
|
|
8169
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
8170
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
8171
|
-
// existing usage.
|
|
8172
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
8173
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
8174
|
-
...components,
|
|
8175
|
-
...props.customComponents || []
|
|
8176
|
-
].reduce((acc, {
|
|
8163
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
8177
8164
|
component,
|
|
8178
8165
|
...info
|
|
8179
8166
|
}) => ({
|
|
@@ -8198,16 +8185,7 @@ function ContentComponent(props) {
|
|
|
8198
8185
|
context: props.context || {},
|
|
8199
8186
|
apiKey: props.apiKey,
|
|
8200
8187
|
apiVersion: props.apiVersion,
|
|
8201
|
-
componentInfos: [
|
|
8202
|
-
...getDefaultRegisteredComponents(),
|
|
8203
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
8204
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
8205
|
-
// existing usage.
|
|
8206
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
8207
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
8208
|
-
...components,
|
|
8209
|
-
...props.customComponents || []
|
|
8210
|
-
].reduce((acc, {
|
|
8188
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
8211
8189
|
component: _,
|
|
8212
8190
|
...info
|
|
8213
8191
|
}) => ({
|
|
@@ -8253,9 +8231,6 @@ function ContentComponent(props) {
|
|
|
8253
8231
|
get locale() {
|
|
8254
8232
|
return props.locale;
|
|
8255
8233
|
},
|
|
8256
|
-
get includeRefs() {
|
|
8257
|
-
return props.includeRefs;
|
|
8258
|
-
},
|
|
8259
8234
|
get enrich() {
|
|
8260
8235
|
return props.enrich;
|
|
8261
8236
|
},
|
|
@@ -8421,9 +8396,6 @@ function ContentVariants(props) {
|
|
|
8421
8396
|
get locale() {
|
|
8422
8397
|
return props.locale;
|
|
8423
8398
|
},
|
|
8424
|
-
get includeRefs() {
|
|
8425
|
-
return props.includeRefs;
|
|
8426
|
-
},
|
|
8427
8399
|
get enrich() {
|
|
8428
8400
|
return props.enrich;
|
|
8429
8401
|
},
|
|
@@ -8481,9 +8453,6 @@ function ContentVariants(props) {
|
|
|
8481
8453
|
get locale() {
|
|
8482
8454
|
return props.locale;
|
|
8483
8455
|
},
|
|
8484
|
-
get includeRefs() {
|
|
8485
|
-
return props.includeRefs;
|
|
8486
|
-
},
|
|
8487
8456
|
get enrich() {
|
|
8488
8457
|
return props.enrich;
|
|
8489
8458
|
},
|
|
@@ -8605,10 +8574,6 @@ function Symbol2(props) {
|
|
|
8605
8574
|
}
|
|
8606
8575
|
var symbol_default = Symbol2;
|
|
8607
8576
|
|
|
8608
|
-
// src/index-helpers/blocks-exports.ts
|
|
8609
|
-
var RenderBlocks = blocks_default;
|
|
8610
|
-
var RenderContent = content_variants_default;
|
|
8611
|
-
|
|
8612
8577
|
// src/functions/set-editor-settings.ts
|
|
8613
8578
|
var settings = {};
|
|
8614
8579
|
function setEditorSettings(newSettings) {
|
|
@@ -8644,4 +8609,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
8644
8609
|
};
|
|
8645
8610
|
};
|
|
8646
8611
|
|
|
8647
|
-
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,
|
|
8612
|
+
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 };
|