@builder.io/sdk-svelte 0.11.5 → 0.12.1
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/slot/component-info.d.ts +2 -0
- package/lib/browser/blocks/slot/component-info.js +14 -0
- package/lib/browser/blocks/slot/slot.svelte +33 -0
- package/lib/browser/blocks/slot/slot.svelte.d.ts +26 -0
- package/lib/browser/blocks/symbol/symbol.svelte +5 -1
- package/lib/browser/blocks/symbol/symbol.svelte.d.ts +1 -0
- package/lib/browser/constants/builder-registered-components.js +5 -0
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/edge/blocks/slot/component-info.d.ts +2 -0
- package/lib/edge/blocks/slot/component-info.js +14 -0
- package/lib/edge/blocks/slot/slot.svelte +33 -0
- package/lib/edge/blocks/slot/slot.svelte.d.ts +26 -0
- package/lib/edge/blocks/symbol/symbol.svelte +5 -1
- package/lib/edge/blocks/symbol/symbol.svelte.d.ts +1 -0
- package/lib/edge/constants/builder-registered-components.js +5 -0
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/node/blocks/slot/component-info.d.ts +2 -0
- package/lib/node/blocks/slot/component-info.js +14 -0
- package/lib/node/blocks/slot/slot.svelte +33 -0
- package/lib/node/blocks/slot/slot.svelte.d.ts +26 -0
- package/lib/node/blocks/symbol/symbol.svelte +5 -1
- package/lib/node/blocks/symbol/symbol.svelte.d.ts +1 -0
- package/lib/node/constants/builder-registered-components.js +5 -0
- 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/slot/component-info.ts +15 -0
- package/src/blocks/slot/slot.svelte +45 -0
- package/src/blocks/symbol/symbol.svelte +5 -1
- package/src/constants/builder-registered-components.ts +5 -0
- package/src/constants/sdk-version.ts +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const componentInfo = {
|
|
2
|
+
name: 'Slot',
|
|
3
|
+
isRSC: true,
|
|
4
|
+
description: 'Allow child blocks to be inserted into this content when used as a Symbol',
|
|
5
|
+
docsLink: 'https://www.builder.io/c/docs/symbols-with-blocks',
|
|
6
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56',
|
|
7
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
8
|
+
inputs: [{
|
|
9
|
+
name: 'name',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
defaultValue: 'children'
|
|
13
|
+
}]
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import Blocks from "../../components/blocks/blocks.svelte";
|
|
4
|
+
import "../../functions/deopt.js";
|
|
5
|
+
export let builderContext;
|
|
6
|
+
export let name;
|
|
7
|
+
function mitosis_styling(node, vars) {
|
|
8
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
9
|
+
if (p.startsWith("--")) {
|
|
10
|
+
node.style.setProperty(p, v);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
node.style[p] = v;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
use:mitosis_styling={{
|
|
21
|
+
pointerEvents: "auto",
|
|
22
|
+
}}
|
|
23
|
+
{...!$builderContext.context?.symbolId && {
|
|
24
|
+
"builder-slot": name,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<Blocks
|
|
28
|
+
parent={$builderContext.context?.symbolId}
|
|
29
|
+
path={`symbol.data.${name}`}
|
|
30
|
+
context={builderContext}
|
|
31
|
+
blocks={$builderContext.rootState?.[name]}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
export interface DropzoneProps {
|
|
3
|
+
name: string;
|
|
4
|
+
builderBlock: BuilderBlock;
|
|
5
|
+
builderContext: Writable<BuilderContextInterface>;
|
|
6
|
+
attributes: any;
|
|
7
|
+
}
|
|
8
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
9
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
10
|
+
import type { Writable } from "svelte/store";
|
|
11
|
+
declare const __propDef: {
|
|
12
|
+
props: {
|
|
13
|
+
builderContext: DropzoneProps["builderContext"];
|
|
14
|
+
name: DropzoneProps["name"];
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type SlotProps = typeof __propDef.props;
|
|
22
|
+
export type SlotEvents = typeof __propDef.events;
|
|
23
|
+
export type SlotSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Slot extends SvelteComponent<SlotProps, SlotEvents, SlotSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export let attributes = undefined;
|
|
|
8
8
|
export let symbol = undefined;
|
|
9
9
|
export let dynamic = undefined;
|
|
10
10
|
export let builderContext;
|
|
11
|
+
export let builderBlock;
|
|
11
12
|
export let builderComponents;
|
|
12
13
|
function setContent() {
|
|
13
14
|
if (contentToUse)
|
|
@@ -51,7 +52,10 @@ $: onUpdateFn_0(...[symbol]);
|
|
|
51
52
|
__isNestedRender={true}
|
|
52
53
|
apiVersion={$builderContext.apiVersion}
|
|
53
54
|
apiKey={$builderContext.apiKey}
|
|
54
|
-
context={
|
|
55
|
+
context={{
|
|
56
|
+
...$builderContext.context,
|
|
57
|
+
symbolId: builderBlock?.id,
|
|
58
|
+
}}
|
|
55
59
|
customComponents={Object.values(builderComponents)}
|
|
56
60
|
data={{
|
|
57
61
|
...symbol?.data,
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
symbol?: PropsWithBuilderData<SymbolProps>["symbol"];
|
|
9
9
|
dynamic?: PropsWithBuilderData<SymbolProps>["dynamic"];
|
|
10
10
|
builderContext: PropsWithBuilderData<SymbolProps>["builderContext"];
|
|
11
|
+
builderBlock: PropsWithBuilderData<SymbolProps>["builderBlock"];
|
|
11
12
|
builderComponents: PropsWithBuilderData<SymbolProps>["builderComponents"];
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
@@ -14,6 +14,8 @@ import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.
|
|
|
14
14
|
import { default as Img } from '../blocks/img/img.svelte';
|
|
15
15
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
16
16
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
17
|
+
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
|
|
18
|
+
import { default as Slot } from '../blocks/slot/slot.svelte';
|
|
17
19
|
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info.js';
|
|
18
20
|
import { default as Symbol } from '../blocks/symbol/symbol.svelte';
|
|
19
21
|
import { componentInfo as textComponentInfo } from '../blocks/text/component-info.js';
|
|
@@ -57,4 +59,7 @@ export const getDefaultRegisteredComponents = () => [{
|
|
|
57
59
|
}, {
|
|
58
60
|
component: Video,
|
|
59
61
|
...videoComponentInfo
|
|
62
|
+
}, {
|
|
63
|
+
component: Slot,
|
|
64
|
+
...slotComponentInfo
|
|
60
65
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.12.1";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const componentInfo = {
|
|
2
|
+
name: 'Slot',
|
|
3
|
+
isRSC: true,
|
|
4
|
+
description: 'Allow child blocks to be inserted into this content when used as a Symbol',
|
|
5
|
+
docsLink: 'https://www.builder.io/c/docs/symbols-with-blocks',
|
|
6
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56',
|
|
7
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
8
|
+
inputs: [{
|
|
9
|
+
name: 'name',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
defaultValue: 'children'
|
|
13
|
+
}]
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import Blocks from "../../components/blocks/blocks.svelte";
|
|
4
|
+
import "../../functions/deopt.js";
|
|
5
|
+
export let builderContext;
|
|
6
|
+
export let name;
|
|
7
|
+
function mitosis_styling(node, vars) {
|
|
8
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
9
|
+
if (p.startsWith("--")) {
|
|
10
|
+
node.style.setProperty(p, v);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
node.style[p] = v;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
use:mitosis_styling={{
|
|
21
|
+
pointerEvents: "auto",
|
|
22
|
+
}}
|
|
23
|
+
{...!$builderContext.context?.symbolId && {
|
|
24
|
+
"builder-slot": name,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<Blocks
|
|
28
|
+
parent={$builderContext.context?.symbolId}
|
|
29
|
+
path={`symbol.data.${name}`}
|
|
30
|
+
context={builderContext}
|
|
31
|
+
blocks={$builderContext.rootState?.[name]}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
export interface DropzoneProps {
|
|
3
|
+
name: string;
|
|
4
|
+
builderBlock: BuilderBlock;
|
|
5
|
+
builderContext: Writable<BuilderContextInterface>;
|
|
6
|
+
attributes: any;
|
|
7
|
+
}
|
|
8
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
9
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
10
|
+
import type { Writable } from "svelte/store";
|
|
11
|
+
declare const __propDef: {
|
|
12
|
+
props: {
|
|
13
|
+
builderContext: DropzoneProps["builderContext"];
|
|
14
|
+
name: DropzoneProps["name"];
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type SlotProps = typeof __propDef.props;
|
|
22
|
+
export type SlotEvents = typeof __propDef.events;
|
|
23
|
+
export type SlotSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Slot extends SvelteComponent<SlotProps, SlotEvents, SlotSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export let attributes = undefined;
|
|
|
8
8
|
export let symbol = undefined;
|
|
9
9
|
export let dynamic = undefined;
|
|
10
10
|
export let builderContext;
|
|
11
|
+
export let builderBlock;
|
|
11
12
|
export let builderComponents;
|
|
12
13
|
function setContent() {
|
|
13
14
|
if (contentToUse)
|
|
@@ -51,7 +52,10 @@ $: onUpdateFn_0(...[symbol]);
|
|
|
51
52
|
__isNestedRender={true}
|
|
52
53
|
apiVersion={$builderContext.apiVersion}
|
|
53
54
|
apiKey={$builderContext.apiKey}
|
|
54
|
-
context={
|
|
55
|
+
context={{
|
|
56
|
+
...$builderContext.context,
|
|
57
|
+
symbolId: builderBlock?.id,
|
|
58
|
+
}}
|
|
55
59
|
customComponents={Object.values(builderComponents)}
|
|
56
60
|
data={{
|
|
57
61
|
...symbol?.data,
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
symbol?: PropsWithBuilderData<SymbolProps>["symbol"];
|
|
9
9
|
dynamic?: PropsWithBuilderData<SymbolProps>["dynamic"];
|
|
10
10
|
builderContext: PropsWithBuilderData<SymbolProps>["builderContext"];
|
|
11
|
+
builderBlock: PropsWithBuilderData<SymbolProps>["builderBlock"];
|
|
11
12
|
builderComponents: PropsWithBuilderData<SymbolProps>["builderComponents"];
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
@@ -14,6 +14,8 @@ import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.
|
|
|
14
14
|
import { default as Img } from '../blocks/img/img.svelte';
|
|
15
15
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
16
16
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
17
|
+
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
|
|
18
|
+
import { default as Slot } from '../blocks/slot/slot.svelte';
|
|
17
19
|
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info.js';
|
|
18
20
|
import { default as Symbol } from '../blocks/symbol/symbol.svelte';
|
|
19
21
|
import { componentInfo as textComponentInfo } from '../blocks/text/component-info.js';
|
|
@@ -57,4 +59,7 @@ export const getDefaultRegisteredComponents = () => [{
|
|
|
57
59
|
}, {
|
|
58
60
|
component: Video,
|
|
59
61
|
...videoComponentInfo
|
|
62
|
+
}, {
|
|
63
|
+
component: Slot,
|
|
64
|
+
...slotComponentInfo
|
|
60
65
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.12.1";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const componentInfo = {
|
|
2
|
+
name: 'Slot',
|
|
3
|
+
isRSC: true,
|
|
4
|
+
description: 'Allow child blocks to be inserted into this content when used as a Symbol',
|
|
5
|
+
docsLink: 'https://www.builder.io/c/docs/symbols-with-blocks',
|
|
6
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56',
|
|
7
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
8
|
+
inputs: [{
|
|
9
|
+
name: 'name',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
defaultValue: 'children'
|
|
13
|
+
}]
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import Blocks from "../../components/blocks/blocks.svelte";
|
|
4
|
+
import "../../functions/deopt.js";
|
|
5
|
+
export let builderContext;
|
|
6
|
+
export let name;
|
|
7
|
+
function mitosis_styling(node, vars) {
|
|
8
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
9
|
+
if (p.startsWith("--")) {
|
|
10
|
+
node.style.setProperty(p, v);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
node.style[p] = v;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
use:mitosis_styling={{
|
|
21
|
+
pointerEvents: "auto",
|
|
22
|
+
}}
|
|
23
|
+
{...!$builderContext.context?.symbolId && {
|
|
24
|
+
"builder-slot": name,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<Blocks
|
|
28
|
+
parent={$builderContext.context?.symbolId}
|
|
29
|
+
path={`symbol.data.${name}`}
|
|
30
|
+
context={builderContext}
|
|
31
|
+
blocks={$builderContext.rootState?.[name]}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
export interface DropzoneProps {
|
|
3
|
+
name: string;
|
|
4
|
+
builderBlock: BuilderBlock;
|
|
5
|
+
builderContext: Writable<BuilderContextInterface>;
|
|
6
|
+
attributes: any;
|
|
7
|
+
}
|
|
8
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
9
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
10
|
+
import type { Writable } from "svelte/store";
|
|
11
|
+
declare const __propDef: {
|
|
12
|
+
props: {
|
|
13
|
+
builderContext: DropzoneProps["builderContext"];
|
|
14
|
+
name: DropzoneProps["name"];
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type SlotProps = typeof __propDef.props;
|
|
22
|
+
export type SlotEvents = typeof __propDef.events;
|
|
23
|
+
export type SlotSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Slot extends SvelteComponent<SlotProps, SlotEvents, SlotSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export let attributes = undefined;
|
|
|
8
8
|
export let symbol = undefined;
|
|
9
9
|
export let dynamic = undefined;
|
|
10
10
|
export let builderContext;
|
|
11
|
+
export let builderBlock;
|
|
11
12
|
export let builderComponents;
|
|
12
13
|
function setContent() {
|
|
13
14
|
if (contentToUse)
|
|
@@ -51,7 +52,10 @@ $: onUpdateFn_0(...[symbol]);
|
|
|
51
52
|
__isNestedRender={true}
|
|
52
53
|
apiVersion={$builderContext.apiVersion}
|
|
53
54
|
apiKey={$builderContext.apiKey}
|
|
54
|
-
context={
|
|
55
|
+
context={{
|
|
56
|
+
...$builderContext.context,
|
|
57
|
+
symbolId: builderBlock?.id,
|
|
58
|
+
}}
|
|
55
59
|
customComponents={Object.values(builderComponents)}
|
|
56
60
|
data={{
|
|
57
61
|
...symbol?.data,
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
symbol?: PropsWithBuilderData<SymbolProps>["symbol"];
|
|
9
9
|
dynamic?: PropsWithBuilderData<SymbolProps>["dynamic"];
|
|
10
10
|
builderContext: PropsWithBuilderData<SymbolProps>["builderContext"];
|
|
11
|
+
builderBlock: PropsWithBuilderData<SymbolProps>["builderBlock"];
|
|
11
12
|
builderComponents: PropsWithBuilderData<SymbolProps>["builderComponents"];
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
@@ -14,6 +14,8 @@ import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.
|
|
|
14
14
|
import { default as Img } from '../blocks/img/img.svelte';
|
|
15
15
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
16
16
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
17
|
+
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
|
|
18
|
+
import { default as Slot } from '../blocks/slot/slot.svelte';
|
|
17
19
|
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info.js';
|
|
18
20
|
import { default as Symbol } from '../blocks/symbol/symbol.svelte';
|
|
19
21
|
import { componentInfo as textComponentInfo } from '../blocks/text/component-info.js';
|
|
@@ -57,4 +59,7 @@ export const getDefaultRegisteredComponents = () => [{
|
|
|
57
59
|
}, {
|
|
58
60
|
component: Video,
|
|
59
61
|
...videoComponentInfo
|
|
62
|
+
}, {
|
|
63
|
+
component: Slot,
|
|
64
|
+
...slotComponentInfo
|
|
60
65
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.12.1";
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentInfo } from '../../types/components.js';
|
|
2
|
+
export const componentInfo: ComponentInfo = {
|
|
3
|
+
name: 'Slot',
|
|
4
|
+
isRSC: true,
|
|
5
|
+
description: 'Allow child blocks to be inserted into this content when used as a Symbol',
|
|
6
|
+
docsLink: 'https://www.builder.io/c/docs/symbols-with-blocks',
|
|
7
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56',
|
|
8
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
9
|
+
inputs: [{
|
|
10
|
+
name: 'name',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
defaultValue: 'children'
|
|
14
|
+
}]
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export interface DropzoneProps {
|
|
3
|
+
name: string;
|
|
4
|
+
builderBlock: BuilderBlock;
|
|
5
|
+
builderContext: Writable<BuilderContextInterface>;
|
|
6
|
+
attributes: any;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import Blocks from "../../components/blocks/blocks.svelte";
|
|
12
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
13
|
+
import { deoptSignal } from "../../functions/deopt.js";
|
|
14
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
+
import type { Writable } from "svelte/store";
|
|
16
|
+
|
|
17
|
+
export let builderContext: DropzoneProps["builderContext"];
|
|
18
|
+
export let name: DropzoneProps["name"];
|
|
19
|
+
|
|
20
|
+
function mitosis_styling(node, vars) {
|
|
21
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
22
|
+
if (p.startsWith("--")) {
|
|
23
|
+
node.style.setProperty(p, v);
|
|
24
|
+
} else {
|
|
25
|
+
node.style[p] = v;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
use:mitosis_styling={{
|
|
33
|
+
pointerEvents: "auto",
|
|
34
|
+
}}
|
|
35
|
+
{...!$builderContext.context?.symbolId && {
|
|
36
|
+
"builder-slot": name,
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Blocks
|
|
40
|
+
parent={$builderContext.context?.symbolId}
|
|
41
|
+
path={`symbol.data.${name}`}
|
|
42
|
+
context={builderContext}
|
|
43
|
+
blocks={$builderContext.rootState?.[name]}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export let symbol: PropsWithBuilderData<SymbolProps>["symbol"] = undefined;
|
|
17
17
|
export let dynamic: PropsWithBuilderData<SymbolProps>["dynamic"] = undefined;
|
|
18
18
|
export let builderContext: PropsWithBuilderData<SymbolProps>["builderContext"];
|
|
19
|
+
export let builderBlock: PropsWithBuilderData<SymbolProps>["builderBlock"];
|
|
19
20
|
export let builderComponents: PropsWithBuilderData<SymbolProps>["builderComponents"];
|
|
20
21
|
|
|
21
22
|
function setContent() {
|
|
@@ -62,7 +63,10 @@
|
|
|
62
63
|
__isNestedRender={true}
|
|
63
64
|
apiVersion={$builderContext.apiVersion}
|
|
64
65
|
apiKey={$builderContext.apiKey}
|
|
65
|
-
context={
|
|
66
|
+
context={{
|
|
67
|
+
...$builderContext.context,
|
|
68
|
+
symbolId: builderBlock?.id,
|
|
69
|
+
}}
|
|
66
70
|
customComponents={Object.values(builderComponents)}
|
|
67
71
|
data={{
|
|
68
72
|
...symbol?.data,
|
|
@@ -14,6 +14,8 @@ import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.
|
|
|
14
14
|
import { default as Img } from '../blocks/img/img.svelte';
|
|
15
15
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
16
16
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
17
|
+
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
|
|
18
|
+
import { default as Slot } from '../blocks/slot/slot.svelte';
|
|
17
19
|
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info.js';
|
|
18
20
|
import { default as Symbol } from '../blocks/symbol/symbol.svelte';
|
|
19
21
|
import { componentInfo as textComponentInfo } from '../blocks/text/component-info.js';
|
|
@@ -59,4 +61,7 @@ export const getDefaultRegisteredComponents: () => RegisteredComponent[] = () =>
|
|
|
59
61
|
}, {
|
|
60
62
|
component: Video,
|
|
61
63
|
...videoComponentInfo
|
|
64
|
+
}, {
|
|
65
|
+
component: Slot,
|
|
66
|
+
...slotComponentInfo
|
|
62
67
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.12.1"
|