@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/dist/index.d.ts
CHANGED
|
@@ -639,8 +639,6 @@ interface ContentVariantsPrps {
|
|
|
639
639
|
* If provided, the API will auto-resolve localized objects to the value of this `locale` key (optional).
|
|
640
640
|
*/
|
|
641
641
|
locale?: string;
|
|
642
|
-
/** @deprecated use `enrich` instead */
|
|
643
|
-
includeRefs?: boolean;
|
|
644
642
|
/**
|
|
645
643
|
* A boolean to enable or disable enriching API content (optional).
|
|
646
644
|
*
|
|
@@ -678,15 +676,6 @@ type VariantsProviderProps = ContentVariantsPrps & {
|
|
|
678
676
|
|
|
679
677
|
declare function ContentVariants(props: VariantsProviderProps): solid_js.JSX.Element;
|
|
680
678
|
|
|
681
|
-
/**
|
|
682
|
-
* @deprecated Renamed to `Blocks`.
|
|
683
|
-
*/
|
|
684
|
-
declare const RenderBlocks: typeof Blocks;
|
|
685
|
-
/**
|
|
686
|
-
* @deprecated Renamed to `Content`.
|
|
687
|
-
*/
|
|
688
|
-
declare const RenderContent: typeof ContentVariants;
|
|
689
|
-
|
|
690
679
|
declare function isEditing(): boolean;
|
|
691
680
|
|
|
692
681
|
declare function isPreviewing(): boolean;
|
|
@@ -849,12 +838,6 @@ interface GetContentOptions {
|
|
|
849
838
|
* Accepts both a key/value object or a `URLSearchParams` instance
|
|
850
839
|
* */
|
|
851
840
|
options?: Record<string, any> | URLSearchParams;
|
|
852
|
-
/**
|
|
853
|
-
* If set to `true`, it will lazy load symbols/references.
|
|
854
|
-
* If set to `false`, it will render the entire content tree eagerly.
|
|
855
|
-
* @deprecated use `enrich` instead
|
|
856
|
-
*/
|
|
857
|
-
noTraverse?: boolean;
|
|
858
841
|
/**
|
|
859
842
|
* If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
|
|
860
843
|
* only the default variation will be returned to every user.
|
|
@@ -862,11 +845,6 @@ interface GetContentOptions {
|
|
|
862
845
|
* Defaults to `true`.
|
|
863
846
|
*/
|
|
864
847
|
canTrack?: boolean;
|
|
865
|
-
/**
|
|
866
|
-
* Include content of references in the response. Defaults to `true`.
|
|
867
|
-
* @deprecated use `enrich` instead
|
|
868
|
-
*/
|
|
869
|
-
includeRefs?: boolean;
|
|
870
848
|
/**
|
|
871
849
|
* Include multilevel references in the response.
|
|
872
850
|
*/
|
|
@@ -997,12 +975,6 @@ declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<Cont
|
|
|
997
975
|
* Returns the first content entry that matches the given options.
|
|
998
976
|
*/
|
|
999
977
|
declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
1000
|
-
/**
|
|
1001
|
-
* @deprecated `getContent` was renamed to `fetchOneEntry`. This is a temporary alias to avoid breaking changes.
|
|
1002
|
-
*
|
|
1003
|
-
* NOTE: consider using `fetchBuilderProps` instead for easier setup.
|
|
1004
|
-
*/
|
|
1005
|
-
declare const getContent: typeof fetchOneEntry;
|
|
1006
978
|
type ContentResults = {
|
|
1007
979
|
results: BuilderContent[];
|
|
1008
980
|
};
|
|
@@ -1014,9 +986,5 @@ declare const _processContentResult: (options: GetContentOptions, content: Conte
|
|
|
1014
986
|
* Returns a paginated array of entries that match the given options.
|
|
1015
987
|
*/
|
|
1016
988
|
declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[]>;
|
|
1017
|
-
/**
|
|
1018
|
-
* @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
|
|
1019
|
-
*/
|
|
1020
|
-
declare const getAllContent: typeof fetchEntries;
|
|
1021
989
|
|
|
1022
|
-
export { Blocks, BlocksProps, BuilderBlock, BuilderContent, Button, ButtonProps, ColumnProps, Columns, ComponentInfo, ContentVariants as Content, ContentVariantsPrps as ContentProps, FragmentComponent as Fragment, FragmentProps, Image, ImageProps, InsertMenuConfig, InsertMenuItem, RegisteredComponent,
|
|
990
|
+
export { Blocks, BlocksProps, BuilderBlock, BuilderContent, Button, ButtonProps, ColumnProps, Columns, ComponentInfo, ContentVariants as Content, ContentVariantsPrps as ContentProps, FragmentComponent as Fragment, FragmentProps, Image, ImageProps, InsertMenuConfig, InsertMenuItem, RegisteredComponent, SectionComponent as Section, SectionProps, Settings, Symbol, SymbolProps, Text, TextProps, Video, VideoProps, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
|
package/lib/browser/dev.js
CHANGED
|
@@ -3818,7 +3818,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3818
3818
|
}, ...getExtraComponents()];
|
|
3819
3819
|
|
|
3820
3820
|
// src/functions/register-component.ts
|
|
3821
|
-
var components = [];
|
|
3822
3821
|
var createRegisterComponentMessage = (info) => ({
|
|
3823
3822
|
type: "builder.registerComponent",
|
|
3824
3823
|
data: serializeComponentInfo(info)
|
|
@@ -3992,16 +3991,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3992
3991
|
// src/functions/get-content/generate-content-url.ts
|
|
3993
3992
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3994
3993
|
var generateContentUrl = (options) => {
|
|
3995
|
-
let {
|
|
3996
|
-
noTraverse = false
|
|
3997
|
-
} = options;
|
|
3998
3994
|
const {
|
|
3999
3995
|
limit = 30,
|
|
4000
3996
|
userAttributes,
|
|
4001
3997
|
query,
|
|
4002
3998
|
model,
|
|
4003
3999
|
apiKey,
|
|
4004
|
-
includeRefs = true,
|
|
4005
4000
|
enrich,
|
|
4006
4001
|
locale,
|
|
4007
4002
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -4019,10 +4014,16 @@ var generateContentUrl = (options) => {
|
|
|
4019
4014
|
if (!["v3"].includes(apiVersion)) {
|
|
4020
4015
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4021
4016
|
}
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4017
|
+
const noTraverse = limit !== 1;
|
|
4018
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
4019
|
+
url.searchParams.set("apiKey", apiKey);
|
|
4020
|
+
url.searchParams.set("limit", String(limit));
|
|
4021
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
4022
|
+
url.searchParams.set("includeRefs", String(true));
|
|
4023
|
+
if (locale)
|
|
4024
|
+
url.searchParams.set("locale", locale);
|
|
4025
|
+
if (enrich)
|
|
4026
|
+
url.searchParams.set("enrich", String(enrich));
|
|
4026
4027
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
4027
4028
|
if (fields) {
|
|
4028
4029
|
url.searchParams.set("fields", fields);
|
|
@@ -4081,7 +4082,6 @@ async function fetchOneEntry(options) {
|
|
|
4081
4082
|
}
|
|
4082
4083
|
return null;
|
|
4083
4084
|
}
|
|
4084
|
-
var getContent = fetchOneEntry;
|
|
4085
4085
|
var _fetchContent = async (options) => {
|
|
4086
4086
|
const url = generateContentUrl(options);
|
|
4087
4087
|
const res = await fetch2(url.href);
|
|
@@ -4135,7 +4135,6 @@ async function fetchEntries(options) {
|
|
|
4135
4135
|
return null;
|
|
4136
4136
|
}
|
|
4137
4137
|
}
|
|
4138
|
-
var getAllContent = fetchEntries;
|
|
4139
4138
|
|
|
4140
4139
|
// src/functions/is-previewing.ts
|
|
4141
4140
|
function isPreviewing() {
|
|
@@ -4395,7 +4394,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4395
4394
|
}
|
|
4396
4395
|
|
|
4397
4396
|
// src/constants/sdk-version.ts
|
|
4398
|
-
var SDK_VERSION = "0.
|
|
4397
|
+
var SDK_VERSION = "0.14.0";
|
|
4399
4398
|
|
|
4400
4399
|
// src/functions/register.ts
|
|
4401
4400
|
var registry = {};
|
|
@@ -4755,9 +4754,6 @@ function EnableEditor(props) {
|
|
|
4755
4754
|
...props.locale ? {
|
|
4756
4755
|
locale: props.locale
|
|
4757
4756
|
} : {},
|
|
4758
|
-
...props.includeRefs ? {
|
|
4759
|
-
includeRefs: props.includeRefs
|
|
4760
|
-
} : {},
|
|
4761
4757
|
...props.enrich ? {
|
|
4762
4758
|
enrich: props.enrich
|
|
4763
4759
|
} : {},
|
|
@@ -5028,16 +5024,7 @@ function ContentComponent(props) {
|
|
|
5028
5024
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5029
5025
|
contentId: props.content?.id
|
|
5030
5026
|
}));
|
|
5031
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
5032
|
-
...getDefaultRegisteredComponents(),
|
|
5033
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5034
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5035
|
-
// existing usage.
|
|
5036
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5037
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5038
|
-
...components,
|
|
5039
|
-
...props.customComponents || []
|
|
5040
|
-
].reduce((acc, {
|
|
5027
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5041
5028
|
component,
|
|
5042
5029
|
...info
|
|
5043
5030
|
}) => ({
|
|
@@ -5062,16 +5049,7 @@ function ContentComponent(props) {
|
|
|
5062
5049
|
context: props.context || {},
|
|
5063
5050
|
apiKey: props.apiKey,
|
|
5064
5051
|
apiVersion: props.apiVersion,
|
|
5065
|
-
componentInfos: [
|
|
5066
|
-
...getDefaultRegisteredComponents(),
|
|
5067
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5068
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5069
|
-
// existing usage.
|
|
5070
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5071
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5072
|
-
...components,
|
|
5073
|
-
...props.customComponents || []
|
|
5074
|
-
].reduce((acc, {
|
|
5052
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5075
5053
|
component: _,
|
|
5076
5054
|
...info
|
|
5077
5055
|
}) => ({
|
|
@@ -5117,9 +5095,6 @@ function ContentComponent(props) {
|
|
|
5117
5095
|
get locale() {
|
|
5118
5096
|
return props.locale;
|
|
5119
5097
|
},
|
|
5120
|
-
get includeRefs() {
|
|
5121
|
-
return props.includeRefs;
|
|
5122
|
-
},
|
|
5123
5098
|
get enrich() {
|
|
5124
5099
|
return props.enrich;
|
|
5125
5100
|
},
|
|
@@ -5285,9 +5260,6 @@ function ContentVariants(props) {
|
|
|
5285
5260
|
get locale() {
|
|
5286
5261
|
return props.locale;
|
|
5287
5262
|
},
|
|
5288
|
-
get includeRefs() {
|
|
5289
|
-
return props.includeRefs;
|
|
5290
|
-
},
|
|
5291
5263
|
get enrich() {
|
|
5292
5264
|
return props.enrich;
|
|
5293
5265
|
},
|
|
@@ -5345,9 +5317,6 @@ function ContentVariants(props) {
|
|
|
5345
5317
|
get locale() {
|
|
5346
5318
|
return props.locale;
|
|
5347
5319
|
},
|
|
5348
|
-
get includeRefs() {
|
|
5349
|
-
return props.includeRefs;
|
|
5350
|
-
},
|
|
5351
5320
|
get enrich() {
|
|
5352
5321
|
return props.enrich;
|
|
5353
5322
|
},
|
|
@@ -5469,10 +5438,6 @@ function Symbol(props) {
|
|
|
5469
5438
|
}
|
|
5470
5439
|
var symbol_default = Symbol;
|
|
5471
5440
|
|
|
5472
|
-
// src/index-helpers/blocks-exports.ts
|
|
5473
|
-
var RenderBlocks = blocks_default;
|
|
5474
|
-
var RenderContent = content_variants_default;
|
|
5475
|
-
|
|
5476
5441
|
// src/functions/set-editor-settings.ts
|
|
5477
5442
|
var settings = {};
|
|
5478
5443
|
function setEditorSettings(newSettings) {
|
|
@@ -5508,4 +5473,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
5508
5473
|
};
|
|
5509
5474
|
};
|
|
5510
5475
|
|
|
5511
|
-
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,
|
|
5476
|
+
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/browser/dev.jsx
CHANGED
|
@@ -3398,7 +3398,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3398
3398
|
}, ...getExtraComponents()];
|
|
3399
3399
|
|
|
3400
3400
|
// src/functions/register-component.ts
|
|
3401
|
-
var components = [];
|
|
3402
3401
|
var createRegisterComponentMessage = (info) => ({
|
|
3403
3402
|
type: "builder.registerComponent",
|
|
3404
3403
|
data: serializeComponentInfo(info)
|
|
@@ -3565,16 +3564,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3565
3564
|
// src/functions/get-content/generate-content-url.ts
|
|
3566
3565
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3567
3566
|
var generateContentUrl = (options) => {
|
|
3568
|
-
let {
|
|
3569
|
-
noTraverse = false
|
|
3570
|
-
} = options;
|
|
3571
3567
|
const {
|
|
3572
3568
|
limit = 30,
|
|
3573
3569
|
userAttributes,
|
|
3574
3570
|
query,
|
|
3575
3571
|
model,
|
|
3576
3572
|
apiKey,
|
|
3577
|
-
includeRefs = true,
|
|
3578
3573
|
enrich,
|
|
3579
3574
|
locale,
|
|
3580
3575
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -3592,10 +3587,16 @@ var generateContentUrl = (options) => {
|
|
|
3592
3587
|
if (!["v3"].includes(apiVersion)) {
|
|
3593
3588
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
3594
3589
|
}
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3590
|
+
const noTraverse = limit !== 1;
|
|
3591
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
3592
|
+
url.searchParams.set("apiKey", apiKey);
|
|
3593
|
+
url.searchParams.set("limit", String(limit));
|
|
3594
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
3595
|
+
url.searchParams.set("includeRefs", String(true));
|
|
3596
|
+
if (locale)
|
|
3597
|
+
url.searchParams.set("locale", locale);
|
|
3598
|
+
if (enrich)
|
|
3599
|
+
url.searchParams.set("enrich", String(enrich));
|
|
3599
3600
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
3600
3601
|
if (fields) {
|
|
3601
3602
|
url.searchParams.set("fields", fields);
|
|
@@ -3654,7 +3655,6 @@ async function fetchOneEntry(options) {
|
|
|
3654
3655
|
}
|
|
3655
3656
|
return null;
|
|
3656
3657
|
}
|
|
3657
|
-
var getContent = fetchOneEntry;
|
|
3658
3658
|
var _fetchContent = async (options) => {
|
|
3659
3659
|
const url = generateContentUrl(options);
|
|
3660
3660
|
const res = await fetch2(url.href);
|
|
@@ -3708,7 +3708,6 @@ async function fetchEntries(options) {
|
|
|
3708
3708
|
return null;
|
|
3709
3709
|
}
|
|
3710
3710
|
}
|
|
3711
|
-
var getAllContent = fetchEntries;
|
|
3712
3711
|
|
|
3713
3712
|
// src/functions/is-previewing.ts
|
|
3714
3713
|
function isPreviewing() {
|
|
@@ -3968,7 +3967,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
3968
3967
|
}
|
|
3969
3968
|
|
|
3970
3969
|
// src/constants/sdk-version.ts
|
|
3971
|
-
var SDK_VERSION = "0.
|
|
3970
|
+
var SDK_VERSION = "0.14.0";
|
|
3972
3971
|
|
|
3973
3972
|
// src/functions/register.ts
|
|
3974
3973
|
var registry = {};
|
|
@@ -4332,9 +4331,6 @@ function EnableEditor(props) {
|
|
|
4332
4331
|
...props.locale ? {
|
|
4333
4332
|
locale: props.locale
|
|
4334
4333
|
} : {},
|
|
4335
|
-
...props.includeRefs ? {
|
|
4336
|
-
includeRefs: props.includeRefs
|
|
4337
|
-
} : {},
|
|
4338
4334
|
...props.enrich ? {
|
|
4339
4335
|
enrich: props.enrich
|
|
4340
4336
|
} : {},
|
|
@@ -4599,12 +4595,6 @@ function ContentComponent(props) {
|
|
|
4599
4595
|
const [registeredComponents, setRegisteredComponents] = createSignal13(
|
|
4600
4596
|
[
|
|
4601
4597
|
...getDefaultRegisteredComponents(),
|
|
4602
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4603
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4604
|
-
// existing usage.
|
|
4605
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4606
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4607
|
-
...components,
|
|
4608
4598
|
...props.customComponents || []
|
|
4609
4599
|
].reduce(
|
|
4610
4600
|
(acc, { component, ...info }) => ({
|
|
@@ -4634,12 +4624,6 @@ function ContentComponent(props) {
|
|
|
4634
4624
|
apiVersion: props.apiVersion,
|
|
4635
4625
|
componentInfos: [
|
|
4636
4626
|
...getDefaultRegisteredComponents(),
|
|
4637
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
4638
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
4639
|
-
// existing usage.
|
|
4640
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
4641
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
4642
|
-
...components,
|
|
4643
4627
|
...props.customComponents || []
|
|
4644
4628
|
].reduce(
|
|
4645
4629
|
(acc, { component: _, ...info }) => ({
|
|
@@ -4670,7 +4654,6 @@ function ContentComponent(props) {
|
|
|
4670
4654
|
apiKey={props.apiKey}
|
|
4671
4655
|
canTrack={props.canTrack}
|
|
4672
4656
|
locale={props.locale}
|
|
4673
|
-
includeRefs={props.includeRefs}
|
|
4674
4657
|
enrich={props.enrich}
|
|
4675
4658
|
showContent={props.showContent}
|
|
4676
4659
|
builderContextSignal={builderContextSignal()}
|
|
@@ -4755,7 +4738,6 @@ function ContentVariants(props) {
|
|
|
4755
4738
|
linkComponent={props.linkComponent}
|
|
4756
4739
|
canTrack={props.canTrack}
|
|
4757
4740
|
locale={props.locale}
|
|
4758
|
-
includeRefs={props.includeRefs}
|
|
4759
4741
|
enrich={props.enrich}
|
|
4760
4742
|
isSsrAbTest={shouldRenderVariants()}
|
|
4761
4743
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4779,7 +4761,6 @@ function ContentVariants(props) {
|
|
|
4779
4761
|
linkComponent={props.linkComponent}
|
|
4780
4762
|
canTrack={props.canTrack}
|
|
4781
4763
|
locale={props.locale}
|
|
4782
|
-
includeRefs={props.includeRefs}
|
|
4783
4764
|
enrich={props.enrich}
|
|
4784
4765
|
isSsrAbTest={shouldRenderVariants()}
|
|
4785
4766
|
blocksWrapper={props.blocksWrapper}
|
|
@@ -4867,10 +4848,6 @@ function Symbol(props) {
|
|
|
4867
4848
|
}
|
|
4868
4849
|
var symbol_default = Symbol;
|
|
4869
4850
|
|
|
4870
|
-
// src/index-helpers/blocks-exports.ts
|
|
4871
|
-
var RenderBlocks = Blocks_default;
|
|
4872
|
-
var RenderContent = Content_variants_default;
|
|
4873
|
-
|
|
4874
4851
|
// src/functions/set-editor-settings.ts
|
|
4875
4852
|
var settings = {};
|
|
4876
4853
|
function setEditorSettings(newSettings) {
|
|
@@ -4912,8 +4889,6 @@ export {
|
|
|
4912
4889
|
Content_variants_default as Content,
|
|
4913
4890
|
fragment_default as Fragment,
|
|
4914
4891
|
image_default as Image,
|
|
4915
|
-
RenderBlocks,
|
|
4916
|
-
RenderContent,
|
|
4917
4892
|
section_default as Section,
|
|
4918
4893
|
symbol_default as Symbol,
|
|
4919
4894
|
text_default as Text,
|
|
@@ -4923,9 +4898,7 @@ export {
|
|
|
4923
4898
|
fetchBuilderProps,
|
|
4924
4899
|
fetchEntries,
|
|
4925
4900
|
fetchOneEntry,
|
|
4926
|
-
getAllContent,
|
|
4927
4901
|
getBuilderSearchParams,
|
|
4928
|
-
getContent,
|
|
4929
4902
|
isEditing,
|
|
4930
4903
|
isPreviewing,
|
|
4931
4904
|
register,
|
package/lib/browser/index.js
CHANGED
|
@@ -3808,7 +3808,6 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3808
3808
|
}, ...getExtraComponents()];
|
|
3809
3809
|
|
|
3810
3810
|
// src/functions/register-component.ts
|
|
3811
|
-
var components = [];
|
|
3812
3811
|
var createRegisterComponentMessage = (info) => ({
|
|
3813
3812
|
type: "builder.registerComponent",
|
|
3814
3813
|
data: serializeComponentInfo(info)
|
|
@@ -3980,16 +3979,12 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
|
|
|
3980
3979
|
// src/functions/get-content/generate-content-url.ts
|
|
3981
3980
|
var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
|
|
3982
3981
|
var generateContentUrl = (options) => {
|
|
3983
|
-
let {
|
|
3984
|
-
noTraverse = false
|
|
3985
|
-
} = options;
|
|
3986
3982
|
const {
|
|
3987
3983
|
limit = 30,
|
|
3988
3984
|
userAttributes,
|
|
3989
3985
|
query,
|
|
3990
3986
|
model,
|
|
3991
3987
|
apiKey,
|
|
3992
|
-
includeRefs = true,
|
|
3993
3988
|
enrich,
|
|
3994
3989
|
locale,
|
|
3995
3990
|
apiVersion = DEFAULT_API_VERSION,
|
|
@@ -4007,10 +4002,16 @@ var generateContentUrl = (options) => {
|
|
|
4007
4002
|
if (!["v3"].includes(apiVersion)) {
|
|
4008
4003
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${apiVersion}'`);
|
|
4009
4004
|
}
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4005
|
+
const noTraverse = limit !== 1;
|
|
4006
|
+
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}`);
|
|
4007
|
+
url.searchParams.set("apiKey", apiKey);
|
|
4008
|
+
url.searchParams.set("limit", String(limit));
|
|
4009
|
+
url.searchParams.set("noTraverse", String(noTraverse));
|
|
4010
|
+
url.searchParams.set("includeRefs", String(true));
|
|
4011
|
+
if (locale)
|
|
4012
|
+
url.searchParams.set("locale", locale);
|
|
4013
|
+
if (enrich)
|
|
4014
|
+
url.searchParams.set("enrich", String(enrich));
|
|
4014
4015
|
url.searchParams.set("omit", omit || "meta.componentsUsed");
|
|
4015
4016
|
if (fields) {
|
|
4016
4017
|
url.searchParams.set("fields", fields);
|
|
@@ -4069,7 +4070,6 @@ async function fetchOneEntry(options) {
|
|
|
4069
4070
|
}
|
|
4070
4071
|
return null;
|
|
4071
4072
|
}
|
|
4072
|
-
var getContent = fetchOneEntry;
|
|
4073
4073
|
var _fetchContent = async (options) => {
|
|
4074
4074
|
const url = generateContentUrl(options);
|
|
4075
4075
|
const res = await fetch2(url.href);
|
|
@@ -4123,7 +4123,6 @@ async function fetchEntries(options) {
|
|
|
4123
4123
|
return null;
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
|
-
var getAllContent = fetchEntries;
|
|
4127
4126
|
|
|
4128
4127
|
// src/functions/is-previewing.ts
|
|
4129
4128
|
function isPreviewing() {
|
|
@@ -4380,7 +4379,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4380
4379
|
}
|
|
4381
4380
|
|
|
4382
4381
|
// src/constants/sdk-version.ts
|
|
4383
|
-
var SDK_VERSION = "0.
|
|
4382
|
+
var SDK_VERSION = "0.14.0";
|
|
4384
4383
|
|
|
4385
4384
|
// src/functions/register.ts
|
|
4386
4385
|
var registry = {};
|
|
@@ -4738,9 +4737,6 @@ function EnableEditor(props) {
|
|
|
4738
4737
|
...props.locale ? {
|
|
4739
4738
|
locale: props.locale
|
|
4740
4739
|
} : {},
|
|
4741
|
-
...props.includeRefs ? {
|
|
4742
|
-
includeRefs: props.includeRefs
|
|
4743
|
-
} : {},
|
|
4744
4740
|
...props.enrich ? {
|
|
4745
4741
|
enrich: props.enrich
|
|
4746
4742
|
} : {},
|
|
@@ -5011,16 +5007,7 @@ function ContentComponent(props) {
|
|
|
5011
5007
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5012
5008
|
contentId: props.content?.id
|
|
5013
5009
|
}));
|
|
5014
|
-
const [registeredComponents, setRegisteredComponents] = createSignal([
|
|
5015
|
-
...getDefaultRegisteredComponents(),
|
|
5016
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5017
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5018
|
-
// existing usage.
|
|
5019
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5020
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5021
|
-
...components,
|
|
5022
|
-
...props.customComponents || []
|
|
5023
|
-
].reduce((acc, {
|
|
5010
|
+
const [registeredComponents, setRegisteredComponents] = createSignal([...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5024
5011
|
component,
|
|
5025
5012
|
...info
|
|
5026
5013
|
}) => ({
|
|
@@ -5045,16 +5032,7 @@ function ContentComponent(props) {
|
|
|
5045
5032
|
context: props.context || {},
|
|
5046
5033
|
apiKey: props.apiKey,
|
|
5047
5034
|
apiVersion: props.apiVersion,
|
|
5048
|
-
componentInfos: [
|
|
5049
|
-
...getDefaultRegisteredComponents(),
|
|
5050
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
5051
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
5052
|
-
// existing usage.
|
|
5053
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
5054
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
5055
|
-
...components,
|
|
5056
|
-
...props.customComponents || []
|
|
5057
|
-
].reduce((acc, {
|
|
5035
|
+
componentInfos: [...getDefaultRegisteredComponents(), ...props.customComponents || []].reduce((acc, {
|
|
5058
5036
|
component: _,
|
|
5059
5037
|
...info
|
|
5060
5038
|
}) => ({
|
|
@@ -5100,9 +5078,6 @@ function ContentComponent(props) {
|
|
|
5100
5078
|
get locale() {
|
|
5101
5079
|
return props.locale;
|
|
5102
5080
|
},
|
|
5103
|
-
get includeRefs() {
|
|
5104
|
-
return props.includeRefs;
|
|
5105
|
-
},
|
|
5106
5081
|
get enrich() {
|
|
5107
5082
|
return props.enrich;
|
|
5108
5083
|
},
|
|
@@ -5268,9 +5243,6 @@ function ContentVariants(props) {
|
|
|
5268
5243
|
get locale() {
|
|
5269
5244
|
return props.locale;
|
|
5270
5245
|
},
|
|
5271
|
-
get includeRefs() {
|
|
5272
|
-
return props.includeRefs;
|
|
5273
|
-
},
|
|
5274
5246
|
get enrich() {
|
|
5275
5247
|
return props.enrich;
|
|
5276
5248
|
},
|
|
@@ -5328,9 +5300,6 @@ function ContentVariants(props) {
|
|
|
5328
5300
|
get locale() {
|
|
5329
5301
|
return props.locale;
|
|
5330
5302
|
},
|
|
5331
|
-
get includeRefs() {
|
|
5332
|
-
return props.includeRefs;
|
|
5333
|
-
},
|
|
5334
5303
|
get enrich() {
|
|
5335
5304
|
return props.enrich;
|
|
5336
5305
|
},
|
|
@@ -5452,10 +5421,6 @@ function Symbol(props) {
|
|
|
5452
5421
|
}
|
|
5453
5422
|
var symbol_default = Symbol;
|
|
5454
5423
|
|
|
5455
|
-
// src/index-helpers/blocks-exports.ts
|
|
5456
|
-
var RenderBlocks = blocks_default;
|
|
5457
|
-
var RenderContent = content_variants_default;
|
|
5458
|
-
|
|
5459
5424
|
// src/functions/set-editor-settings.ts
|
|
5460
5425
|
var settings = {};
|
|
5461
5426
|
function setEditorSettings(newSettings) {
|
|
@@ -5491,4 +5456,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
5491
5456
|
};
|
|
5492
5457
|
};
|
|
5493
5458
|
|
|
5494
|
-
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,
|
|
5459
|
+
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 };
|