@builder.io/sdk-svelte 1.1.2 → 2.0.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/lib/browser/blocks/button/component-info.js +0 -3
- package/lib/browser/blocks/columns/columns.svelte +3 -2
- package/lib/browser/blocks/custom-code/component-info.js +0 -6
- package/lib/browser/blocks/embed/component-info.js +0 -6
- package/lib/browser/blocks/form/input/component-info.js +0 -6
- package/lib/browser/blocks/form/select/component-info.js +0 -6
- package/lib/browser/blocks/form/submit-button/component-info.js +0 -6
- package/lib/browser/blocks/form/textarea/component-info.js +0 -6
- package/lib/browser/blocks/fragment/component-info.js +0 -6
- package/lib/browser/blocks/image/component-info.js +1 -4
- package/lib/browser/blocks/img/component-info.js +0 -6
- package/lib/browser/blocks/raw-text/component-info.js +0 -6
- package/lib/browser/blocks/section/component-info.js +0 -6
- package/lib/browser/blocks/slot/component-info.js +1 -4
- package/lib/browser/blocks/text/component-info.js +1 -4
- package/lib/browser/blocks/video/component-info.js +1 -4
- package/lib/browser/components/block/block.helpers.d.ts +8 -8
- package/lib/browser/components/block/block.helpers.js +20 -43
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/edge/blocks/button/component-info.js +0 -3
- package/lib/edge/blocks/columns/columns.svelte +3 -2
- package/lib/edge/blocks/custom-code/component-info.js +0 -6
- package/lib/edge/blocks/embed/component-info.js +0 -6
- package/lib/edge/blocks/form/input/component-info.js +0 -6
- package/lib/edge/blocks/form/select/component-info.js +0 -6
- package/lib/edge/blocks/form/submit-button/component-info.js +0 -6
- package/lib/edge/blocks/form/textarea/component-info.js +0 -6
- package/lib/edge/blocks/fragment/component-info.js +0 -6
- package/lib/edge/blocks/image/component-info.js +1 -4
- package/lib/edge/blocks/img/component-info.js +0 -6
- package/lib/edge/blocks/raw-text/component-info.js +0 -6
- package/lib/edge/blocks/section/component-info.js +0 -6
- package/lib/edge/blocks/slot/component-info.js +1 -4
- package/lib/edge/blocks/text/component-info.js +1 -4
- package/lib/edge/blocks/video/component-info.js +1 -4
- package/lib/edge/components/block/block.helpers.d.ts +8 -8
- package/lib/edge/components/block/block.helpers.js +20 -43
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/node/blocks/button/component-info.js +0 -3
- package/lib/node/blocks/columns/columns.svelte +3 -2
- package/lib/node/blocks/custom-code/component-info.js +0 -6
- package/lib/node/blocks/embed/component-info.js +0 -6
- package/lib/node/blocks/form/input/component-info.js +0 -6
- package/lib/node/blocks/form/select/component-info.js +0 -6
- package/lib/node/blocks/form/submit-button/component-info.js +0 -6
- package/lib/node/blocks/form/textarea/component-info.js +0 -6
- package/lib/node/blocks/fragment/component-info.js +0 -6
- package/lib/node/blocks/image/component-info.js +1 -4
- package/lib/node/blocks/img/component-info.js +0 -6
- package/lib/node/blocks/raw-text/component-info.js +0 -6
- package/lib/node/blocks/section/component-info.js +0 -6
- package/lib/node/blocks/slot/component-info.js +1 -4
- package/lib/node/blocks/text/component-info.js +1 -4
- package/lib/node/blocks/video/component-info.js +1 -4
- package/lib/node/components/block/block.helpers.d.ts +8 -8
- package/lib/node/components/block/block.helpers.js +20 -43
- 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/blocks/button/component-info.ts +0 -3
- package/src/blocks/columns/columns.svelte +3 -2
- package/src/blocks/custom-code/component-info.ts +0 -6
- package/src/blocks/embed/component-info.ts +0 -6
- package/src/blocks/form/input/component-info.ts +0 -6
- package/src/blocks/form/select/component-info.ts +0 -6
- package/src/blocks/form/submit-button/component-info.ts +0 -6
- package/src/blocks/form/textarea/component-info.ts +0 -6
- package/src/blocks/fragment/component-info.ts +0 -6
- package/src/blocks/image/component-info.ts +1 -4
- package/src/blocks/img/component-info.ts +0 -6
- package/src/blocks/raw-text/component-info.ts +0 -6
- package/src/blocks/section/component-info.ts +0 -6
- package/src/blocks/slot/component-info.ts +1 -4
- package/src/blocks/text/component-info.ts +1 -4
- package/src/blocks/video/component-info.ts +1 -4
- package/src/components/block/block.helpers.ts +8 -28
- package/src/constants/sdk-version.ts +1 -1
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
|
-
shouldReceiveBuilderProps: {
|
|
3
|
-
builderBlock: false,
|
|
4
|
-
builderContext: false,
|
|
5
|
-
builderComponents: false,
|
|
6
|
-
builderLinkComponent: false
|
|
7
|
-
},
|
|
8
2
|
name: 'Form:Input',
|
|
9
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
|
|
10
4
|
inputs: [{
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
|
-
shouldReceiveBuilderProps: {
|
|
3
|
-
builderBlock: false,
|
|
4
|
-
builderContext: false,
|
|
5
|
-
builderComponents: false,
|
|
6
|
-
builderLinkComponent: false
|
|
7
|
-
},
|
|
8
2
|
name: 'Form:Select',
|
|
9
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045',
|
|
10
4
|
defaultStyles: {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
|
-
shouldReceiveBuilderProps: {
|
|
3
|
-
builderBlock: false,
|
|
4
|
-
builderContext: false,
|
|
5
|
-
builderComponents: false,
|
|
6
|
-
builderLinkComponent: false
|
|
7
|
-
},
|
|
8
2
|
name: 'Form:SubmitButton',
|
|
9
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98',
|
|
10
4
|
defaultStyles: {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
|
-
shouldReceiveBuilderProps: {
|
|
3
|
-
builderBlock: false,
|
|
4
|
-
builderContext: false,
|
|
5
|
-
builderComponents: false,
|
|
6
|
-
builderLinkComponent: false
|
|
7
|
-
},
|
|
8
2
|
name: 'Form:TextArea',
|
|
9
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3',
|
|
10
4
|
inputs: [{
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
|
-
shouldReceiveBuilderProps: {
|
|
3
|
-
builderBlock: false,
|
|
4
|
-
builderContext: false,
|
|
5
|
-
builderComponents: false,
|
|
6
|
-
builderLinkComponent: false
|
|
7
|
-
},
|
|
8
2
|
name: 'Core:Section',
|
|
9
3
|
static: true,
|
|
10
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a',
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
export const componentInfo = {
|
|
3
3
|
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: TARGET === 'reactNative' ? true : false
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
4
|
+
builderBlock: TARGET === 'reactNative' ? true : false
|
|
8
5
|
},
|
|
9
6
|
name: 'Text',
|
|
10
7
|
static: true,
|
|
@@ -17,22 +17,22 @@ export declare const getInheritedStyles: ({ block, context }: {
|
|
|
17
17
|
context: BuilderContextInterface;
|
|
18
18
|
}) => Partial<CSSStyleDeclaration>;
|
|
19
19
|
export declare const provideLinkComponent: (block: RegisteredComponent | null | undefined, linkComponent: any) => {
|
|
20
|
-
builderLinkComponent?: undefined;
|
|
21
|
-
} | {
|
|
22
20
|
builderLinkComponent: any;
|
|
21
|
+
} | {
|
|
22
|
+
builderLinkComponent?: undefined;
|
|
23
23
|
};
|
|
24
24
|
export declare const provideRegisteredComponents: (block: RegisteredComponent | null | undefined, registeredComponents: RegisteredComponents) => {
|
|
25
|
-
builderComponents?: undefined;
|
|
26
|
-
} | {
|
|
27
25
|
builderComponents: RegisteredComponents;
|
|
26
|
+
} | {
|
|
27
|
+
builderComponents?: undefined;
|
|
28
28
|
};
|
|
29
29
|
export declare const provideBuilderBlock: (block: RegisteredComponent | null | undefined, builderBlock: BuilderBlock) => {
|
|
30
|
-
builderBlock?: undefined;
|
|
31
|
-
} | {
|
|
32
30
|
builderBlock: BuilderBlock;
|
|
31
|
+
} | {
|
|
32
|
+
builderBlock?: undefined;
|
|
33
33
|
};
|
|
34
34
|
export declare const provideBuilderContext: (block: RegisteredComponent | null | undefined, context: Writable<BuilderContextInterface>) => {
|
|
35
|
-
builderContext?: undefined;
|
|
36
|
-
} | {
|
|
37
35
|
builderContext: Writable<BuilderContextInterface>;
|
|
36
|
+
} | {
|
|
37
|
+
builderContext?: undefined;
|
|
38
38
|
};
|
|
@@ -73,54 +73,31 @@ export const getInheritedStyles = ({ block, context }) => {
|
|
|
73
73
|
}
|
|
74
74
|
return extractTextStyles(style);
|
|
75
75
|
};
|
|
76
|
-
const applyDefaults = (shouldReceiveBuilderProps) => {
|
|
77
|
-
return {
|
|
78
|
-
// once we bump to a major version, toggle this to `false`.
|
|
79
|
-
builderBlock: true,
|
|
80
|
-
// once we bump to a major version, toggle this to `false`.
|
|
81
|
-
builderContext: true,
|
|
82
|
-
builderComponents: false,
|
|
83
|
-
builderLinkComponent: false,
|
|
84
|
-
...shouldReceiveBuilderProps
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
76
|
export const provideLinkComponent = (block, linkComponent) => {
|
|
88
|
-
if (
|
|
89
|
-
return {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return {
|
|
94
|
-
builderLinkComponent: linkComponent
|
|
95
|
-
};
|
|
77
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
78
|
+
return {
|
|
79
|
+
builderLinkComponent: linkComponent
|
|
80
|
+
};
|
|
81
|
+
return {};
|
|
96
82
|
};
|
|
97
83
|
export const provideRegisteredComponents = (block, registeredComponents) => {
|
|
98
|
-
if (
|
|
99
|
-
return {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
builderComponents: registeredComponents
|
|
105
|
-
};
|
|
84
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
85
|
+
return {
|
|
86
|
+
builderComponents: registeredComponents
|
|
87
|
+
};
|
|
88
|
+
return {};
|
|
106
89
|
};
|
|
107
90
|
export const provideBuilderBlock = (block, builderBlock) => {
|
|
108
|
-
if (
|
|
109
|
-
return {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return {
|
|
114
|
-
builderBlock
|
|
115
|
-
};
|
|
91
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
92
|
+
return {
|
|
93
|
+
builderBlock
|
|
94
|
+
};
|
|
95
|
+
return {};
|
|
116
96
|
};
|
|
117
97
|
export const provideBuilderContext = (block, context) => {
|
|
118
|
-
if (
|
|
119
|
-
return {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
builderContext: context
|
|
125
|
-
};
|
|
98
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
99
|
+
return {
|
|
100
|
+
builderContext: context
|
|
101
|
+
};
|
|
102
|
+
return {};
|
|
126
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "2.0.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "2.0.0";
|
package/package.json
CHANGED
|
@@ -45,8 +45,9 @@
|
|
|
45
45
|
return cols[index]?.width || 100 / cols.length;
|
|
46
46
|
}
|
|
47
47
|
function getColumnCssWidth(index: number) {
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const width = getWidth(index);
|
|
49
|
+
const subtractWidth = gutterSize * (cols.length - 1) * (width / 100);
|
|
50
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
50
51
|
}
|
|
51
52
|
function getTabletStyle({
|
|
52
53
|
stackedStyle,
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Custom Code',
|
|
10
4
|
static: true,
|
|
11
5
|
requiredPermissions: ['editCode'],
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Embed',
|
|
10
4
|
static: true,
|
|
11
5
|
inputs: [{
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Form:Input',
|
|
10
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
|
|
11
5
|
inputs: [{
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Form:Select',
|
|
10
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045',
|
|
11
5
|
defaultStyles: {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Form:SubmitButton',
|
|
10
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98',
|
|
11
5
|
defaultStyles: {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Form:TextArea',
|
|
10
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3',
|
|
11
5
|
inputs: [{
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Fragment',
|
|
10
4
|
static: true,
|
|
11
5
|
hidden: true,
|
|
@@ -127,9 +127,6 @@ export const componentInfo: ComponentInfo = {
|
|
|
127
127
|
defaultValue: 0.7041
|
|
128
128
|
}],
|
|
129
129
|
shouldReceiveBuilderProps: {
|
|
130
|
-
builderBlock: true
|
|
131
|
-
builderContext: false,
|
|
132
|
-
builderComponents: false,
|
|
133
|
-
builderLinkComponent: false
|
|
130
|
+
builderBlock: true
|
|
134
131
|
}
|
|
135
132
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
// friendlyName?
|
|
10
4
|
name: 'Raw:Img',
|
|
11
5
|
hideFromInsertMenu: true,
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Builder:RawText',
|
|
10
4
|
hideFromInsertMenu: true,
|
|
11
5
|
inputs: [{
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export const componentInfo: ComponentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock: false,
|
|
5
|
-
builderContext: false,
|
|
6
|
-
builderComponents: false,
|
|
7
|
-
builderLinkComponent: false
|
|
8
|
-
},
|
|
9
3
|
name: 'Core:Section',
|
|
10
4
|
static: true,
|
|
11
5
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a',
|
|
@@ -2,10 +2,7 @@ import { TARGET } from '../../constants/target';
|
|
|
2
2
|
import type { ComponentInfo } from '../../types/components';
|
|
3
3
|
export const componentInfo: ComponentInfo = {
|
|
4
4
|
shouldReceiveBuilderProps: {
|
|
5
|
-
builderBlock: TARGET === 'reactNative' ? true : false
|
|
6
|
-
builderContext: false,
|
|
7
|
-
builderComponents: false,
|
|
8
|
-
builderLinkComponent: false
|
|
5
|
+
builderBlock: TARGET === 'reactNative' ? true : false
|
|
9
6
|
},
|
|
10
7
|
name: 'Text',
|
|
11
8
|
static: true,
|
|
@@ -4,7 +4,6 @@ import { evaluate } from '../../functions/evaluate/index';
|
|
|
4
4
|
import { extractTextStyles } from '../../functions/extract-text-styles';
|
|
5
5
|
import { getProcessedBlock } from '../../functions/get-processed-block';
|
|
6
6
|
import { getStyle } from '../../functions/get-style';
|
|
7
|
-
import type { ComponentInfo } from '../../server-index';
|
|
8
7
|
import type { BuilderBlock } from '../../types/builder-block';
|
|
9
8
|
import type { RepeatData } from './types';
|
|
10
9
|
export const getComponent = ({
|
|
@@ -100,46 +99,27 @@ export const getInheritedStyles = ({
|
|
|
100
99
|
}
|
|
101
100
|
return extractTextStyles(style);
|
|
102
101
|
};
|
|
103
|
-
const applyDefaults = (shouldReceiveBuilderProps: ComponentInfo['shouldReceiveBuilderProps']) => {
|
|
104
|
-
return {
|
|
105
|
-
// once we bump to a major version, toggle this to `false`.
|
|
106
|
-
builderBlock: true,
|
|
107
|
-
// once we bump to a major version, toggle this to `false`.
|
|
108
|
-
builderContext: true,
|
|
109
|
-
builderComponents: false,
|
|
110
|
-
builderLinkComponent: false,
|
|
111
|
-
...shouldReceiveBuilderProps
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
102
|
export const provideLinkComponent = (block: RegisteredComponent | null | undefined, linkComponent: any) => {
|
|
115
|
-
if (
|
|
116
|
-
const shouldReceiveProp = applyDefaults(block.shouldReceiveBuilderProps).builderLinkComponent;
|
|
117
|
-
if (!shouldReceiveProp) return {};
|
|
118
|
-
return {
|
|
103
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent) return {
|
|
119
104
|
builderLinkComponent: linkComponent
|
|
120
105
|
};
|
|
106
|
+
return {};
|
|
121
107
|
};
|
|
122
108
|
export const provideRegisteredComponents = (block: RegisteredComponent | null | undefined, registeredComponents: RegisteredComponents) => {
|
|
123
|
-
if (
|
|
124
|
-
const shouldReceiveProp = applyDefaults(block.shouldReceiveBuilderProps).builderComponents;
|
|
125
|
-
if (!shouldReceiveProp) return {};
|
|
126
|
-
return {
|
|
109
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents) return {
|
|
127
110
|
builderComponents: registeredComponents
|
|
128
111
|
};
|
|
112
|
+
return {};
|
|
129
113
|
};
|
|
130
114
|
export const provideBuilderBlock = (block: RegisteredComponent | null | undefined, builderBlock: BuilderBlock) => {
|
|
131
|
-
if (
|
|
132
|
-
const shouldReceiveProp = applyDefaults(block.shouldReceiveBuilderProps).builderBlock;
|
|
133
|
-
if (!shouldReceiveProp) return {};
|
|
134
|
-
return {
|
|
115
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock) return {
|
|
135
116
|
builderBlock
|
|
136
117
|
};
|
|
118
|
+
return {};
|
|
137
119
|
};
|
|
138
120
|
export const provideBuilderContext = (block: RegisteredComponent | null | undefined, context: Writable<BuilderContextInterface>) => {
|
|
139
|
-
if (
|
|
140
|
-
const shouldReceiveProp = applyDefaults(block.shouldReceiveBuilderProps).builderContext;
|
|
141
|
-
if (!shouldReceiveProp) return {};
|
|
142
|
-
return {
|
|
121
|
+
if (block?.shouldReceiveBuilderProps?.builderContext) return {
|
|
143
122
|
builderContext: context
|
|
144
123
|
};
|
|
124
|
+
return {};
|
|
145
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "2.0.0"
|