@builder.io/sdk-svelte 0.11.0 → 0.11.2
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/components/block/components/component-ref/component-ref.helpers.js +9 -7
- package/lib/browser/components/block/components/interactive-element.svelte +16 -13
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/edge/components/block/components/component-ref/component-ref.helpers.js +9 -7
- package/lib/edge/components/block/components/interactive-element.svelte +16 -13
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/node/components/block/components/component-ref/component-ref.helpers.js +9 -7
- package/lib/node/components/block/components/interactive-element.svelte +16 -13
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/package.json +1 -1
- package/src/components/block/components/component-ref/component-ref.helpers.ts +9 -7
- package/src/components/block/components/interactive-element.svelte +22 -15
- package/src/constants/sdk-version.ts +1 -1
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { getBlockProperties } from '../../../../functions/get-block-properties.js';
|
|
2
2
|
export const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
3
|
-
const
|
|
4
|
-
Wrapper: componentRef,
|
|
5
|
-
block: builderBlock,
|
|
6
|
-
context,
|
|
7
|
-
wrapperProps: componentOptions
|
|
8
|
-
};
|
|
9
|
-
return isInteractive ? interactiveElementProps : {
|
|
3
|
+
const wrapperPropsWithAttributes = {
|
|
10
4
|
...componentOptions,
|
|
11
5
|
/**
|
|
12
6
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -19,4 +13,12 @@ export const getWrapperProps = ({ componentOptions, builderBlock, context, compo
|
|
|
19
13
|
})
|
|
20
14
|
} : {})
|
|
21
15
|
};
|
|
16
|
+
const interactiveElementProps = {
|
|
17
|
+
Wrapper: componentRef,
|
|
18
|
+
block: builderBlock,
|
|
19
|
+
context,
|
|
20
|
+
wrapperProps: componentOptions,
|
|
21
|
+
includeBlockProps
|
|
22
|
+
};
|
|
23
|
+
return isInteractive ? interactiveElementProps : wrapperPropsWithAttributes;
|
|
22
24
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
5
5
|
export let Wrapper;
|
|
6
6
|
export let wrapperProps;
|
|
7
|
+
export let includeBlockProps;
|
|
7
8
|
export let block;
|
|
8
9
|
export let context;
|
|
9
10
|
</script>
|
|
@@ -11,19 +12,21 @@ export let context;
|
|
|
11
12
|
<svelte:component
|
|
12
13
|
this={Wrapper}
|
|
13
14
|
{...wrapperProps}
|
|
14
|
-
attributes={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
attributes={includeBlockProps
|
|
16
|
+
? {
|
|
17
|
+
...getBlockProperties({
|
|
18
|
+
block: block,
|
|
19
|
+
context: $context,
|
|
20
|
+
}),
|
|
21
|
+
...getBlockActions({
|
|
22
|
+
block: block,
|
|
23
|
+
rootState: $context.rootState,
|
|
24
|
+
rootSetState: $context.rootSetState,
|
|
25
|
+
localState: $context.localState,
|
|
26
|
+
context: $context.context,
|
|
27
|
+
}),
|
|
28
|
+
}
|
|
29
|
+
: {}}
|
|
27
30
|
>
|
|
28
31
|
<slot />
|
|
29
32
|
</svelte:component>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.11.
|
|
1
|
+
export const SDK_VERSION = "0.11.2";
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { getBlockProperties } from '../../../../functions/get-block-properties.js';
|
|
2
2
|
export const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
3
|
-
const
|
|
4
|
-
Wrapper: componentRef,
|
|
5
|
-
block: builderBlock,
|
|
6
|
-
context,
|
|
7
|
-
wrapperProps: componentOptions
|
|
8
|
-
};
|
|
9
|
-
return isInteractive ? interactiveElementProps : {
|
|
3
|
+
const wrapperPropsWithAttributes = {
|
|
10
4
|
...componentOptions,
|
|
11
5
|
/**
|
|
12
6
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -19,4 +13,12 @@ export const getWrapperProps = ({ componentOptions, builderBlock, context, compo
|
|
|
19
13
|
})
|
|
20
14
|
} : {})
|
|
21
15
|
};
|
|
16
|
+
const interactiveElementProps = {
|
|
17
|
+
Wrapper: componentRef,
|
|
18
|
+
block: builderBlock,
|
|
19
|
+
context,
|
|
20
|
+
wrapperProps: componentOptions,
|
|
21
|
+
includeBlockProps
|
|
22
|
+
};
|
|
23
|
+
return isInteractive ? interactiveElementProps : wrapperPropsWithAttributes;
|
|
22
24
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
5
5
|
export let Wrapper;
|
|
6
6
|
export let wrapperProps;
|
|
7
|
+
export let includeBlockProps;
|
|
7
8
|
export let block;
|
|
8
9
|
export let context;
|
|
9
10
|
</script>
|
|
@@ -11,19 +12,21 @@ export let context;
|
|
|
11
12
|
<svelte:component
|
|
12
13
|
this={Wrapper}
|
|
13
14
|
{...wrapperProps}
|
|
14
|
-
attributes={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
attributes={includeBlockProps
|
|
16
|
+
? {
|
|
17
|
+
...getBlockProperties({
|
|
18
|
+
block: block,
|
|
19
|
+
context: $context,
|
|
20
|
+
}),
|
|
21
|
+
...getBlockActions({
|
|
22
|
+
block: block,
|
|
23
|
+
rootState: $context.rootState,
|
|
24
|
+
rootSetState: $context.rootSetState,
|
|
25
|
+
localState: $context.localState,
|
|
26
|
+
context: $context.context,
|
|
27
|
+
}),
|
|
28
|
+
}
|
|
29
|
+
: {}}
|
|
27
30
|
>
|
|
28
31
|
<slot />
|
|
29
32
|
</svelte:component>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.11.
|
|
1
|
+
export const SDK_VERSION = "0.11.2";
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { getBlockProperties } from '../../../../functions/get-block-properties.js';
|
|
2
2
|
export const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
3
|
-
const
|
|
4
|
-
Wrapper: componentRef,
|
|
5
|
-
block: builderBlock,
|
|
6
|
-
context,
|
|
7
|
-
wrapperProps: componentOptions
|
|
8
|
-
};
|
|
9
|
-
return isInteractive ? interactiveElementProps : {
|
|
3
|
+
const wrapperPropsWithAttributes = {
|
|
10
4
|
...componentOptions,
|
|
11
5
|
/**
|
|
12
6
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -19,4 +13,12 @@ export const getWrapperProps = ({ componentOptions, builderBlock, context, compo
|
|
|
19
13
|
})
|
|
20
14
|
} : {})
|
|
21
15
|
};
|
|
16
|
+
const interactiveElementProps = {
|
|
17
|
+
Wrapper: componentRef,
|
|
18
|
+
block: builderBlock,
|
|
19
|
+
context,
|
|
20
|
+
wrapperProps: componentOptions,
|
|
21
|
+
includeBlockProps
|
|
22
|
+
};
|
|
23
|
+
return isInteractive ? interactiveElementProps : wrapperPropsWithAttributes;
|
|
22
24
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
5
5
|
export let Wrapper;
|
|
6
6
|
export let wrapperProps;
|
|
7
|
+
export let includeBlockProps;
|
|
7
8
|
export let block;
|
|
8
9
|
export let context;
|
|
9
10
|
</script>
|
|
@@ -11,19 +12,21 @@ export let context;
|
|
|
11
12
|
<svelte:component
|
|
12
13
|
this={Wrapper}
|
|
13
14
|
{...wrapperProps}
|
|
14
|
-
attributes={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
attributes={includeBlockProps
|
|
16
|
+
? {
|
|
17
|
+
...getBlockProperties({
|
|
18
|
+
block: block,
|
|
19
|
+
context: $context,
|
|
20
|
+
}),
|
|
21
|
+
...getBlockActions({
|
|
22
|
+
block: block,
|
|
23
|
+
rootState: $context.rootState,
|
|
24
|
+
rootSetState: $context.rootSetState,
|
|
25
|
+
localState: $context.localState,
|
|
26
|
+
context: $context.context,
|
|
27
|
+
}),
|
|
28
|
+
}
|
|
29
|
+
: {}}
|
|
27
30
|
>
|
|
28
31
|
<slot />
|
|
29
32
|
</svelte:component>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.11.
|
|
1
|
+
export const SDK_VERSION = "0.11.2";
|
package/package.json
CHANGED
|
@@ -31,13 +31,7 @@ export const getWrapperProps = ({
|
|
|
31
31
|
}: Omit<ComponentProps, 'blockChildren' | 'registeredComponents'> & {
|
|
32
32
|
contextValue: BuilderContextInterface;
|
|
33
33
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
Wrapper: componentRef,
|
|
36
|
-
block: builderBlock,
|
|
37
|
-
context,
|
|
38
|
-
wrapperProps: componentOptions
|
|
39
|
-
};
|
|
40
|
-
return isInteractive ? interactiveElementProps : {
|
|
34
|
+
const wrapperPropsWithAttributes = {
|
|
41
35
|
...componentOptions,
|
|
42
36
|
/**
|
|
43
37
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -50,4 +44,12 @@ export const getWrapperProps = ({
|
|
|
50
44
|
})
|
|
51
45
|
} : {})
|
|
52
46
|
};
|
|
47
|
+
const interactiveElementProps: InteractiveElementProps = {
|
|
48
|
+
Wrapper: componentRef,
|
|
49
|
+
block: builderBlock,
|
|
50
|
+
context,
|
|
51
|
+
wrapperProps: componentOptions,
|
|
52
|
+
includeBlockProps
|
|
53
|
+
};
|
|
54
|
+
return isInteractive ? interactiveElementProps : wrapperPropsWithAttributes;
|
|
53
55
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Wrapper: any;
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
context: Writable<BuilderContextInterface>;
|
|
6
|
-
wrapperProps:
|
|
6
|
+
wrapperProps: Dictionary<any>;
|
|
7
|
+
includeBlockProps: boolean;
|
|
7
8
|
};
|
|
8
9
|
</script>
|
|
9
10
|
|
|
@@ -12,11 +13,15 @@
|
|
|
12
13
|
import { getBlockActions } from "../../../functions/get-block-actions.js";
|
|
13
14
|
import { getBlockProperties } from "../../../functions/get-block-properties.js";
|
|
14
15
|
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
15
|
-
import type {
|
|
16
|
+
import type {
|
|
17
|
+
Dictionary,
|
|
18
|
+
PropsWithChildren,
|
|
19
|
+
} from "../../../types/typescript.js";
|
|
16
20
|
import type { Writable } from "svelte/store";
|
|
17
21
|
|
|
18
22
|
export let Wrapper: PropsWithChildren<InteractiveElementProps>["Wrapper"];
|
|
19
23
|
export let wrapperProps: PropsWithChildren<InteractiveElementProps>["wrapperProps"];
|
|
24
|
+
export let includeBlockProps: PropsWithChildren<InteractiveElementProps>["includeBlockProps"];
|
|
20
25
|
export let block: PropsWithChildren<InteractiveElementProps>["block"];
|
|
21
26
|
export let context: PropsWithChildren<InteractiveElementProps>["context"];
|
|
22
27
|
</script>
|
|
@@ -24,19 +29,21 @@
|
|
|
24
29
|
<svelte:component
|
|
25
30
|
this={Wrapper}
|
|
26
31
|
{...wrapperProps}
|
|
27
|
-
attributes={
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
attributes={includeBlockProps
|
|
33
|
+
? {
|
|
34
|
+
...getBlockProperties({
|
|
35
|
+
block: block,
|
|
36
|
+
context: $context,
|
|
37
|
+
}),
|
|
38
|
+
...getBlockActions({
|
|
39
|
+
block: block,
|
|
40
|
+
rootState: $context.rootState,
|
|
41
|
+
rootSetState: $context.rootSetState,
|
|
42
|
+
localState: $context.localState,
|
|
43
|
+
context: $context.context,
|
|
44
|
+
}),
|
|
45
|
+
}
|
|
46
|
+
: {}}
|
|
40
47
|
>
|
|
41
48
|
<slot />
|
|
42
49
|
</svelte:component>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.11.
|
|
1
|
+
export const SDK_VERSION = "0.11.2"
|