@builder.io/sdk-svelte 0.6.2 → 0.6.3
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/lib/browser/blocks/raw-text/raw-text.svelte +1 -1
- package/lib/browser/blocks/text/text.svelte +5 -3
- package/lib/browser/components/block/components/block-styles.svelte +16 -8
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/fetch-builder-props.d.ts +13 -0
- package/lib/browser/functions/fetch-builder-props.js +13 -0
- package/lib/browser/types/components.d.ts +0 -1
- package/lib/edge/blocks/raw-text/raw-text.svelte +1 -1
- package/lib/edge/blocks/text/text.svelte +5 -3
- package/lib/edge/components/block/components/block-styles.svelte +16 -8
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/fetch-builder-props.d.ts +13 -0
- package/lib/edge/functions/fetch-builder-props.js +13 -0
- package/lib/edge/types/components.d.ts +0 -1
- package/lib/node/blocks/raw-text/raw-text.svelte +1 -1
- package/lib/node/blocks/text/text.svelte +5 -3
- package/lib/node/components/block/components/block-styles.svelte +16 -8
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/fetch-builder-props.d.ts +13 -0
- package/lib/node/functions/fetch-builder-props.js +13 -0
- package/lib/node/types/components.d.ts +0 -1
- package/package.json +1 -1
- package/src/blocks/raw-text/raw-text.svelte +1 -1
- package/src/blocks/text/text.svelte +5 -3
- package/src/components/block/components/block-styles.svelte +16 -9
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/fetch-builder-props.ts +13 -0
- package/src/types/components.ts +0 -2
|
@@ -13,9 +13,11 @@ function mitosis_styling(node, vars) {
|
|
|
13
13
|
}
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<div
|
|
17
17
|
use:mitosis_styling={{
|
|
18
18
|
outline: "none",
|
|
19
19
|
}}
|
|
20
|
-
class="builder-text"
|
|
21
|
-
>
|
|
20
|
+
class="builder-text"
|
|
21
|
+
>
|
|
22
|
+
{@html text?.toString() || ""}
|
|
23
|
+
</div>
|
|
@@ -9,6 +9,14 @@ import InlinedStyles from "../../inlined-styles.svelte";
|
|
|
9
9
|
export let block;
|
|
10
10
|
export let context;
|
|
11
11
|
$: canShowBlock = () => {
|
|
12
|
+
const processedBlock = getProcessedBlock({
|
|
13
|
+
block: block,
|
|
14
|
+
localState: context.localState,
|
|
15
|
+
rootState: context.rootState,
|
|
16
|
+
rootSetState: context.rootSetState,
|
|
17
|
+
context: context.context,
|
|
18
|
+
shouldEvaluateBindings: true,
|
|
19
|
+
});
|
|
12
20
|
// only render styles for blocks that are visible
|
|
13
21
|
if (checkIsDefined(processedBlock.hide)) {
|
|
14
22
|
return !processedBlock.hide;
|
|
@@ -19,6 +27,14 @@ $: canShowBlock = () => {
|
|
|
19
27
|
return true;
|
|
20
28
|
};
|
|
21
29
|
$: css = () => {
|
|
30
|
+
const processedBlock = getProcessedBlock({
|
|
31
|
+
block: block,
|
|
32
|
+
localState: context.localState,
|
|
33
|
+
rootState: context.rootState,
|
|
34
|
+
rootSetState: context.rootSetState,
|
|
35
|
+
context: context.context,
|
|
36
|
+
shouldEvaluateBindings: true,
|
|
37
|
+
});
|
|
22
38
|
const styles = processedBlock.responsiveStyles;
|
|
23
39
|
const content = context.content;
|
|
24
40
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
@@ -51,14 +67,6 @@ $: css = () => {
|
|
|
51
67
|
: "";
|
|
52
68
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
53
69
|
};
|
|
54
|
-
let processedBlock = getProcessedBlock({
|
|
55
|
-
block: block,
|
|
56
|
-
localState: context.localState,
|
|
57
|
-
rootState: context.rootState,
|
|
58
|
-
rootSetState: context.rootSetState,
|
|
59
|
-
context: context.context,
|
|
60
|
-
shouldEvaluateBindings: true,
|
|
61
|
-
});
|
|
62
70
|
</script>
|
|
63
71
|
|
|
64
72
|
{#if TARGET !== "reactNative" && css() && canShowBlock()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.6.
|
|
1
|
+
export declare const SDK_VERSION = "0.6.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.6.
|
|
1
|
+
export const SDK_VERSION = "0.6.3";
|
|
@@ -35,6 +35,19 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
|
35
35
|
/**
|
|
36
36
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
37
37
|
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```jsx
|
|
40
|
+
* const builderProps = await fetchBuilderProps({
|
|
41
|
+
* apiKey: 'API_KEY',
|
|
42
|
+
* // provide `url`
|
|
43
|
+
* url: yourPageUrl,
|
|
44
|
+
* // OR provide `path` + `searchParams`
|
|
45
|
+
* path: yourPath,
|
|
46
|
+
* searchParams: yourSearchParams,
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* return <Content {...builderProps} />;
|
|
50
|
+
* ```
|
|
38
51
|
*/
|
|
39
52
|
export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
|
|
40
53
|
export {};
|
|
@@ -3,6 +3,19 @@ import { fetchOneEntry } from './get-content/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
5
5
|
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```jsx
|
|
8
|
+
* const builderProps = await fetchBuilderProps({
|
|
9
|
+
* apiKey: 'API_KEY',
|
|
10
|
+
* // provide `url`
|
|
11
|
+
* url: yourPageUrl,
|
|
12
|
+
* // OR provide `path` + `searchParams`
|
|
13
|
+
* path: yourPath,
|
|
14
|
+
* searchParams: yourSearchParams,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* return <Content {...builderProps} />;
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
20
|
export const fetchBuilderProps = async (_args) => {
|
|
8
21
|
const urlPath = _args.path || _args.url?.pathname || _args.userAttributes?.urlPath;
|
|
@@ -13,9 +13,11 @@ function mitosis_styling(node, vars) {
|
|
|
13
13
|
}
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<div
|
|
17
17
|
use:mitosis_styling={{
|
|
18
18
|
outline: "none",
|
|
19
19
|
}}
|
|
20
|
-
class="builder-text"
|
|
21
|
-
>
|
|
20
|
+
class="builder-text"
|
|
21
|
+
>
|
|
22
|
+
{@html text?.toString() || ""}
|
|
23
|
+
</div>
|
|
@@ -9,6 +9,14 @@ import InlinedStyles from "../../inlined-styles.svelte";
|
|
|
9
9
|
export let block;
|
|
10
10
|
export let context;
|
|
11
11
|
$: canShowBlock = () => {
|
|
12
|
+
const processedBlock = getProcessedBlock({
|
|
13
|
+
block: block,
|
|
14
|
+
localState: context.localState,
|
|
15
|
+
rootState: context.rootState,
|
|
16
|
+
rootSetState: context.rootSetState,
|
|
17
|
+
context: context.context,
|
|
18
|
+
shouldEvaluateBindings: true,
|
|
19
|
+
});
|
|
12
20
|
// only render styles for blocks that are visible
|
|
13
21
|
if (checkIsDefined(processedBlock.hide)) {
|
|
14
22
|
return !processedBlock.hide;
|
|
@@ -19,6 +27,14 @@ $: canShowBlock = () => {
|
|
|
19
27
|
return true;
|
|
20
28
|
};
|
|
21
29
|
$: css = () => {
|
|
30
|
+
const processedBlock = getProcessedBlock({
|
|
31
|
+
block: block,
|
|
32
|
+
localState: context.localState,
|
|
33
|
+
rootState: context.rootState,
|
|
34
|
+
rootSetState: context.rootSetState,
|
|
35
|
+
context: context.context,
|
|
36
|
+
shouldEvaluateBindings: true,
|
|
37
|
+
});
|
|
22
38
|
const styles = processedBlock.responsiveStyles;
|
|
23
39
|
const content = context.content;
|
|
24
40
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
@@ -51,14 +67,6 @@ $: css = () => {
|
|
|
51
67
|
: "";
|
|
52
68
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
53
69
|
};
|
|
54
|
-
let processedBlock = getProcessedBlock({
|
|
55
|
-
block: block,
|
|
56
|
-
localState: context.localState,
|
|
57
|
-
rootState: context.rootState,
|
|
58
|
-
rootSetState: context.rootSetState,
|
|
59
|
-
context: context.context,
|
|
60
|
-
shouldEvaluateBindings: true,
|
|
61
|
-
});
|
|
62
70
|
</script>
|
|
63
71
|
|
|
64
72
|
{#if TARGET !== "reactNative" && css() && canShowBlock()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.6.
|
|
1
|
+
export declare const SDK_VERSION = "0.6.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.6.
|
|
1
|
+
export const SDK_VERSION = "0.6.3";
|
|
@@ -35,6 +35,19 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
|
35
35
|
/**
|
|
36
36
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
37
37
|
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```jsx
|
|
40
|
+
* const builderProps = await fetchBuilderProps({
|
|
41
|
+
* apiKey: 'API_KEY',
|
|
42
|
+
* // provide `url`
|
|
43
|
+
* url: yourPageUrl,
|
|
44
|
+
* // OR provide `path` + `searchParams`
|
|
45
|
+
* path: yourPath,
|
|
46
|
+
* searchParams: yourSearchParams,
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* return <Content {...builderProps} />;
|
|
50
|
+
* ```
|
|
38
51
|
*/
|
|
39
52
|
export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
|
|
40
53
|
export {};
|
|
@@ -3,6 +3,19 @@ import { fetchOneEntry } from './get-content/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
5
5
|
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```jsx
|
|
8
|
+
* const builderProps = await fetchBuilderProps({
|
|
9
|
+
* apiKey: 'API_KEY',
|
|
10
|
+
* // provide `url`
|
|
11
|
+
* url: yourPageUrl,
|
|
12
|
+
* // OR provide `path` + `searchParams`
|
|
13
|
+
* path: yourPath,
|
|
14
|
+
* searchParams: yourSearchParams,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* return <Content {...builderProps} />;
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
20
|
export const fetchBuilderProps = async (_args) => {
|
|
8
21
|
const urlPath = _args.path || _args.url?.pathname || _args.userAttributes?.urlPath;
|
|
@@ -13,9 +13,11 @@ function mitosis_styling(node, vars) {
|
|
|
13
13
|
}
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<div
|
|
17
17
|
use:mitosis_styling={{
|
|
18
18
|
outline: "none",
|
|
19
19
|
}}
|
|
20
|
-
class="builder-text"
|
|
21
|
-
>
|
|
20
|
+
class="builder-text"
|
|
21
|
+
>
|
|
22
|
+
{@html text?.toString() || ""}
|
|
23
|
+
</div>
|
|
@@ -9,6 +9,14 @@ import InlinedStyles from "../../inlined-styles.svelte";
|
|
|
9
9
|
export let block;
|
|
10
10
|
export let context;
|
|
11
11
|
$: canShowBlock = () => {
|
|
12
|
+
const processedBlock = getProcessedBlock({
|
|
13
|
+
block: block,
|
|
14
|
+
localState: context.localState,
|
|
15
|
+
rootState: context.rootState,
|
|
16
|
+
rootSetState: context.rootSetState,
|
|
17
|
+
context: context.context,
|
|
18
|
+
shouldEvaluateBindings: true,
|
|
19
|
+
});
|
|
12
20
|
// only render styles for blocks that are visible
|
|
13
21
|
if (checkIsDefined(processedBlock.hide)) {
|
|
14
22
|
return !processedBlock.hide;
|
|
@@ -19,6 +27,14 @@ $: canShowBlock = () => {
|
|
|
19
27
|
return true;
|
|
20
28
|
};
|
|
21
29
|
$: css = () => {
|
|
30
|
+
const processedBlock = getProcessedBlock({
|
|
31
|
+
block: block,
|
|
32
|
+
localState: context.localState,
|
|
33
|
+
rootState: context.rootState,
|
|
34
|
+
rootSetState: context.rootSetState,
|
|
35
|
+
context: context.context,
|
|
36
|
+
shouldEvaluateBindings: true,
|
|
37
|
+
});
|
|
22
38
|
const styles = processedBlock.responsiveStyles;
|
|
23
39
|
const content = context.content;
|
|
24
40
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
@@ -51,14 +67,6 @@ $: css = () => {
|
|
|
51
67
|
: "";
|
|
52
68
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
53
69
|
};
|
|
54
|
-
let processedBlock = getProcessedBlock({
|
|
55
|
-
block: block,
|
|
56
|
-
localState: context.localState,
|
|
57
|
-
rootState: context.rootState,
|
|
58
|
-
rootSetState: context.rootSetState,
|
|
59
|
-
context: context.context,
|
|
60
|
-
shouldEvaluateBindings: true,
|
|
61
|
-
});
|
|
62
70
|
</script>
|
|
63
71
|
|
|
64
72
|
{#if TARGET !== "reactNative" && css() && canShowBlock()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.6.
|
|
1
|
+
export declare const SDK_VERSION = "0.6.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.6.
|
|
1
|
+
export const SDK_VERSION = "0.6.3";
|
|
@@ -35,6 +35,19 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
|
35
35
|
/**
|
|
36
36
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
37
37
|
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```jsx
|
|
40
|
+
* const builderProps = await fetchBuilderProps({
|
|
41
|
+
* apiKey: 'API_KEY',
|
|
42
|
+
* // provide `url`
|
|
43
|
+
* url: yourPageUrl,
|
|
44
|
+
* // OR provide `path` + `searchParams`
|
|
45
|
+
* path: yourPath,
|
|
46
|
+
* searchParams: yourSearchParams,
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* return <Content {...builderProps} />;
|
|
50
|
+
* ```
|
|
38
51
|
*/
|
|
39
52
|
export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
|
|
40
53
|
export {};
|
|
@@ -3,6 +3,19 @@ import { fetchOneEntry } from './get-content/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
5
5
|
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```jsx
|
|
8
|
+
* const builderProps = await fetchBuilderProps({
|
|
9
|
+
* apiKey: 'API_KEY',
|
|
10
|
+
* // provide `url`
|
|
11
|
+
* url: yourPageUrl,
|
|
12
|
+
* // OR provide `path` + `searchParams`
|
|
13
|
+
* path: yourPath,
|
|
14
|
+
* searchParams: yourSearchParams,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* return <Content {...builderProps} />;
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
20
|
export const fetchBuilderProps = async (_args) => {
|
|
8
21
|
const urlPath = _args.path || _args.url?.pathname || _args.userAttributes?.urlPath;
|
package/package.json
CHANGED
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
export let context: BlockStylesProps["context"];
|
|
23
23
|
|
|
24
24
|
$: canShowBlock = () => {
|
|
25
|
+
const processedBlock = getProcessedBlock({
|
|
26
|
+
block: block,
|
|
27
|
+
localState: context.localState,
|
|
28
|
+
rootState: context.rootState,
|
|
29
|
+
rootSetState: context.rootSetState,
|
|
30
|
+
context: context.context,
|
|
31
|
+
shouldEvaluateBindings: true,
|
|
32
|
+
});
|
|
25
33
|
// only render styles for blocks that are visible
|
|
26
34
|
if (checkIsDefined(processedBlock.hide)) {
|
|
27
35
|
return !processedBlock.hide;
|
|
@@ -32,6 +40,14 @@
|
|
|
32
40
|
return true;
|
|
33
41
|
};
|
|
34
42
|
$: css = () => {
|
|
43
|
+
const processedBlock = getProcessedBlock({
|
|
44
|
+
block: block,
|
|
45
|
+
localState: context.localState,
|
|
46
|
+
rootState: context.rootState,
|
|
47
|
+
rootSetState: context.rootSetState,
|
|
48
|
+
context: context.context,
|
|
49
|
+
shouldEvaluateBindings: true,
|
|
50
|
+
});
|
|
35
51
|
const styles = processedBlock.responsiveStyles;
|
|
36
52
|
const content = context.content;
|
|
37
53
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
@@ -72,15 +88,6 @@
|
|
|
72
88
|
: "";
|
|
73
89
|
return [largeStylesClass, mediumStylesClass, smallStylesClass].join(" ");
|
|
74
90
|
};
|
|
75
|
-
|
|
76
|
-
let processedBlock = getProcessedBlock({
|
|
77
|
-
block: block,
|
|
78
|
-
localState: context.localState,
|
|
79
|
-
rootState: context.rootState,
|
|
80
|
-
rootSetState: context.rootSetState,
|
|
81
|
-
context: context.context,
|
|
82
|
-
shouldEvaluateBindings: true,
|
|
83
|
-
});
|
|
84
91
|
</script>
|
|
85
92
|
|
|
86
93
|
{#if TARGET !== "reactNative" && css() && canShowBlock()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.6.
|
|
1
|
+
export const SDK_VERSION = "0.6.3"
|
|
@@ -39,6 +39,19 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
|
39
39
|
/**
|
|
40
40
|
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
41
41
|
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* const builderProps = await fetchBuilderProps({
|
|
45
|
+
* apiKey: 'API_KEY',
|
|
46
|
+
* // provide `url`
|
|
47
|
+
* url: yourPageUrl,
|
|
48
|
+
* // OR provide `path` + `searchParams`
|
|
49
|
+
* path: yourPath,
|
|
50
|
+
* searchParams: yourSearchParams,
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* return <Content {...builderProps} />;
|
|
54
|
+
* ```
|
|
42
55
|
*/
|
|
43
56
|
export const fetchBuilderProps = async (_args: GetBuilderPropsOptions): Promise<ContentVariantsPrps> => {
|
|
44
57
|
const urlPath = _args.path || _args.url?.pathname || _args.userAttributes?.urlPath;
|