@builder.io/sdk-svelte 4.0.6 → 4.0.7
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/form/input/input.svelte +12 -11
- package/lib/browser/blocks/form/select/select.svelte +14 -13
- package/lib/browser/blocks/image/image.svelte +3 -1
- package/lib/browser/blocks/img/img.svelte +12 -11
- package/lib/browser/blocks/text/component-info.js +3 -3
- package/lib/browser/components/block/block.helpers.d.ts +1 -0
- package/lib/browser/components/block/block.helpers.js +4 -0
- package/lib/browser/components/block/block.svelte +3 -3
- package/lib/browser/components/block/components/interactive-element.svelte +8 -3
- package/lib/browser/components/block/components/repeated-block.svelte +4 -0
- package/lib/browser/components/blocks/blocks-wrapper.svelte +2 -2
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/edge/blocks/form/input/input.svelte +12 -11
- package/lib/edge/blocks/form/select/select.svelte +14 -13
- package/lib/edge/blocks/image/image.svelte +3 -1
- package/lib/edge/blocks/img/img.svelte +12 -11
- package/lib/edge/blocks/text/component-info.js +3 -3
- package/lib/edge/components/block/block.helpers.d.ts +1 -0
- package/lib/edge/components/block/block.helpers.js +4 -0
- package/lib/edge/components/block/block.svelte +3 -3
- package/lib/edge/components/block/components/interactive-element.svelte +8 -3
- package/lib/edge/components/block/components/repeated-block.svelte +4 -0
- package/lib/edge/components/blocks/blocks-wrapper.svelte +2 -2
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/node/blocks/form/input/input.svelte +12 -11
- package/lib/node/blocks/form/select/select.svelte +14 -13
- package/lib/node/blocks/image/image.svelte +3 -1
- package/lib/node/blocks/img/img.svelte +12 -11
- package/lib/node/blocks/text/component-info.js +3 -3
- package/lib/node/components/block/block.helpers.d.ts +1 -0
- package/lib/node/components/block/block.helpers.js +4 -0
- package/lib/node/components/block/block.svelte +3 -3
- package/lib/node/components/block/components/interactive-element.svelte +8 -3
- package/lib/node/components/block/components/repeated-block.svelte +4 -0
- package/lib/node/components/blocks/blocks-wrapper.svelte +2 -2
- 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/form/input/input.svelte +12 -11
- package/src/blocks/form/select/select.svelte +14 -13
- package/src/blocks/image/image.svelte +4 -0
- package/src/blocks/img/img.svelte +12 -11
- package/src/blocks/text/component-info.ts +3 -3
- package/src/components/block/block.helpers.ts +4 -0
- package/src/components/block/block.svelte +3 -2
- package/src/components/block/components/interactive-element.svelte +8 -3
- package/src/components/block/components/repeated-block.svelte +6 -0
- package/src/components/blocks/blocks-wrapper.svelte +2 -2
- package/src/constants/sdk-version.ts +1 -1
|
@@ -15,14 +15,15 @@ export let value = undefined;
|
|
|
15
15
|
export let required = undefined;
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
18
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
19
|
+
<input
|
|
20
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
21
|
+
{placeholder}
|
|
22
|
+
{type}
|
|
23
|
+
{name}
|
|
24
|
+
{value}
|
|
25
|
+
{defaultValue}
|
|
26
|
+
{required}
|
|
27
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
28
|
+
/>
|
|
29
|
+
{/key}
|
|
@@ -14,16 +14,17 @@ export let required = undefined;
|
|
|
14
14
|
export let options = undefined;
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</select>
|
|
17
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
18
|
+
<select
|
|
19
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
20
|
+
{value}
|
|
21
|
+
{defaultValue}
|
|
22
|
+
{name}
|
|
23
|
+
{required}
|
|
24
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
25
|
+
>
|
|
26
|
+
{#each options as option, index (`${option.name}-${index}`)}
|
|
27
|
+
<option value={option.value}>{option.name || option.value}</option>
|
|
28
|
+
{/each}
|
|
29
|
+
</select>
|
|
30
|
+
{/key}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import { getSrcSet } from "./image.helpers";
|
|
2
3
|
export let image;
|
|
3
4
|
export let src = undefined;
|
|
4
5
|
export let srcset = undefined;
|
|
@@ -66,6 +67,7 @@ $: aspectRatioCss = () => {
|
|
|
66
67
|
const out = aspectRatio ? aspectRatioStyles : undefined;
|
|
67
68
|
return out;
|
|
68
69
|
};
|
|
70
|
+
onMount(() => { });
|
|
69
71
|
</script>
|
|
70
72
|
|
|
71
73
|
<picture>
|
|
@@ -24,14 +24,15 @@ function stringifyStyles(stylesObj) {
|
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/>
|
|
27
|
+
{#key (isEditing() && imgSrc) || "default-key"}
|
|
28
|
+
<img
|
|
29
|
+
style={stringifyStyles({
|
|
30
|
+
objectFit: backgroundSize || "cover",
|
|
31
|
+
objectPosition: backgroundPosition || "center",
|
|
32
|
+
})}
|
|
33
|
+
alt={altText}
|
|
34
|
+
src={imgSrc || image}
|
|
35
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
36
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
37
|
+
/>
|
|
38
|
+
{/key}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
export const componentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock:
|
|
3
|
+
shouldReceiveBuilderProps: TARGET === 'reactNative' ? {
|
|
4
|
+
builderBlock: true,
|
|
5
5
|
builderContext: true
|
|
6
|
-
},
|
|
6
|
+
} : {},
|
|
7
7
|
name: 'Text',
|
|
8
8
|
static: true,
|
|
9
9
|
isRSC: true,
|
|
@@ -7,7 +7,7 @@ import { getProcessedBlock } from "../../functions/get-processed-block";
|
|
|
7
7
|
import "../../server-index";
|
|
8
8
|
import "../dynamic-div.svelte";
|
|
9
9
|
import { bindAnimations } from "./animator";
|
|
10
|
-
import { getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
10
|
+
import { generateKey, getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
11
11
|
import BlockStyles from "./components/block-styles.svelte";
|
|
12
12
|
import BlockWrapper from "./components/block-wrapper.svelte";
|
|
13
13
|
import ComponentRef from "./components/component-ref/component-ref.svelte";
|
|
@@ -135,7 +135,7 @@ afterUpdate(() => { });
|
|
|
135
135
|
{/each}
|
|
136
136
|
</BlockWrapper>
|
|
137
137
|
{:else}
|
|
138
|
-
{#each repeatItem() as data, index (index)}
|
|
138
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
139
139
|
<RepeatedBlock
|
|
140
140
|
repeatContext={data.context}
|
|
141
141
|
block={data.block}
|
|
@@ -157,7 +157,7 @@ afterUpdate(() => { });
|
|
|
157
157
|
isInteractive={componentRefProps().isInteractive}
|
|
158
158
|
/>
|
|
159
159
|
{:else}
|
|
160
|
-
{#each repeatItem() as data, index (index)}
|
|
160
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
161
161
|
<RepeatedBlock
|
|
162
162
|
repeatContext={data.context}
|
|
163
163
|
block={data.block}
|
|
@@ -6,8 +6,8 @@ import Awaiter from "../../awaiter.svelte";
|
|
|
6
6
|
export let includeBlockProps;
|
|
7
7
|
export let block;
|
|
8
8
|
export let context;
|
|
9
|
-
export let Wrapper;
|
|
10
9
|
export let wrapperProps;
|
|
10
|
+
export let Wrapper;
|
|
11
11
|
$: attributes = () => {
|
|
12
12
|
return includeBlockProps
|
|
13
13
|
? {
|
|
@@ -25,6 +25,9 @@ $: attributes = () => {
|
|
|
25
25
|
}
|
|
26
26
|
: {};
|
|
27
27
|
};
|
|
28
|
+
$: targetWrapperProps = () => {
|
|
29
|
+
return wrapperProps;
|
|
30
|
+
};
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
{#if Wrapper.load}
|
|
@@ -35,7 +38,9 @@ $: attributes = () => {
|
|
|
35
38
|
attributes={attributes()}><slot /></Awaiter
|
|
36
39
|
>
|
|
37
40
|
{:else}
|
|
38
|
-
<svelte:component
|
|
39
|
-
|
|
41
|
+
<svelte:component
|
|
42
|
+
this={Wrapper}
|
|
43
|
+
{...targetWrapperProps()}
|
|
44
|
+
attributes={attributes()}><slot /></svelte:component
|
|
40
45
|
>
|
|
41
46
|
{/if}
|
|
@@ -9,6 +9,10 @@ export let block;
|
|
|
9
9
|
export let registeredComponents;
|
|
10
10
|
export let linkComponent;
|
|
11
11
|
let store = writable(repeatContext);
|
|
12
|
+
function onUpdateFn_0(..._args) {
|
|
13
|
+
$store = repeatContext;
|
|
14
|
+
}
|
|
15
|
+
$: onUpdateFn_0(...[repeatContext]);
|
|
12
16
|
setContext(BuilderContext.key, store);
|
|
13
17
|
</script>
|
|
14
18
|
|
|
@@ -69,7 +69,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
69
69
|
this={BlocksWrapper}
|
|
70
70
|
style={stringifyStyles(styleProp)}
|
|
71
71
|
bind:this={blocksWrapperRef}
|
|
72
|
-
class={className() + "
|
|
72
|
+
class={className() + " svelteelement"}
|
|
73
73
|
builder-path={dataPath()}
|
|
74
74
|
builder-parent-id={parent}
|
|
75
75
|
{...{}}
|
|
@@ -86,7 +86,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
86
86
|
>
|
|
87
87
|
|
|
88
88
|
<style>
|
|
89
|
-
.
|
|
89
|
+
.svelteelement {
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.7";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.7";
|
|
@@ -15,14 +15,15 @@ export let value = undefined;
|
|
|
15
15
|
export let required = undefined;
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
18
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
19
|
+
<input
|
|
20
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
21
|
+
{placeholder}
|
|
22
|
+
{type}
|
|
23
|
+
{name}
|
|
24
|
+
{value}
|
|
25
|
+
{defaultValue}
|
|
26
|
+
{required}
|
|
27
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
28
|
+
/>
|
|
29
|
+
{/key}
|
|
@@ -14,16 +14,17 @@ export let required = undefined;
|
|
|
14
14
|
export let options = undefined;
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</select>
|
|
17
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
18
|
+
<select
|
|
19
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
20
|
+
{value}
|
|
21
|
+
{defaultValue}
|
|
22
|
+
{name}
|
|
23
|
+
{required}
|
|
24
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
25
|
+
>
|
|
26
|
+
{#each options as option, index (`${option.name}-${index}`)}
|
|
27
|
+
<option value={option.value}>{option.name || option.value}</option>
|
|
28
|
+
{/each}
|
|
29
|
+
</select>
|
|
30
|
+
{/key}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import { getSrcSet } from "./image.helpers";
|
|
2
3
|
export let image;
|
|
3
4
|
export let src = undefined;
|
|
4
5
|
export let srcset = undefined;
|
|
@@ -66,6 +67,7 @@ $: aspectRatioCss = () => {
|
|
|
66
67
|
const out = aspectRatio ? aspectRatioStyles : undefined;
|
|
67
68
|
return out;
|
|
68
69
|
};
|
|
70
|
+
onMount(() => { });
|
|
69
71
|
</script>
|
|
70
72
|
|
|
71
73
|
<picture>
|
|
@@ -24,14 +24,15 @@ function stringifyStyles(stylesObj) {
|
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/>
|
|
27
|
+
{#key (isEditing() && imgSrc) || "default-key"}
|
|
28
|
+
<img
|
|
29
|
+
style={stringifyStyles({
|
|
30
|
+
objectFit: backgroundSize || "cover",
|
|
31
|
+
objectPosition: backgroundPosition || "center",
|
|
32
|
+
})}
|
|
33
|
+
alt={altText}
|
|
34
|
+
src={imgSrc || image}
|
|
35
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
36
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
37
|
+
/>
|
|
38
|
+
{/key}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
export const componentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock:
|
|
3
|
+
shouldReceiveBuilderProps: TARGET === 'reactNative' ? {
|
|
4
|
+
builderBlock: true,
|
|
5
5
|
builderContext: true
|
|
6
|
-
},
|
|
6
|
+
} : {},
|
|
7
7
|
name: 'Text',
|
|
8
8
|
static: true,
|
|
9
9
|
isRSC: true,
|
|
@@ -7,7 +7,7 @@ import { getProcessedBlock } from "../../functions/get-processed-block";
|
|
|
7
7
|
import "../../server-index";
|
|
8
8
|
import "../dynamic-div.svelte";
|
|
9
9
|
import { bindAnimations } from "./animator";
|
|
10
|
-
import { getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
10
|
+
import { generateKey, getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
11
11
|
import BlockStyles from "./components/block-styles.svelte";
|
|
12
12
|
import BlockWrapper from "./components/block-wrapper.svelte";
|
|
13
13
|
import ComponentRef from "./components/component-ref/component-ref.svelte";
|
|
@@ -135,7 +135,7 @@ afterUpdate(() => { });
|
|
|
135
135
|
{/each}
|
|
136
136
|
</BlockWrapper>
|
|
137
137
|
{:else}
|
|
138
|
-
{#each repeatItem() as data, index (index)}
|
|
138
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
139
139
|
<RepeatedBlock
|
|
140
140
|
repeatContext={data.context}
|
|
141
141
|
block={data.block}
|
|
@@ -157,7 +157,7 @@ afterUpdate(() => { });
|
|
|
157
157
|
isInteractive={componentRefProps().isInteractive}
|
|
158
158
|
/>
|
|
159
159
|
{:else}
|
|
160
|
-
{#each repeatItem() as data, index (index)}
|
|
160
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
161
161
|
<RepeatedBlock
|
|
162
162
|
repeatContext={data.context}
|
|
163
163
|
block={data.block}
|
|
@@ -6,8 +6,8 @@ import Awaiter from "../../awaiter.svelte";
|
|
|
6
6
|
export let includeBlockProps;
|
|
7
7
|
export let block;
|
|
8
8
|
export let context;
|
|
9
|
-
export let Wrapper;
|
|
10
9
|
export let wrapperProps;
|
|
10
|
+
export let Wrapper;
|
|
11
11
|
$: attributes = () => {
|
|
12
12
|
return includeBlockProps
|
|
13
13
|
? {
|
|
@@ -25,6 +25,9 @@ $: attributes = () => {
|
|
|
25
25
|
}
|
|
26
26
|
: {};
|
|
27
27
|
};
|
|
28
|
+
$: targetWrapperProps = () => {
|
|
29
|
+
return wrapperProps;
|
|
30
|
+
};
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
{#if Wrapper.load}
|
|
@@ -35,7 +38,9 @@ $: attributes = () => {
|
|
|
35
38
|
attributes={attributes()}><slot /></Awaiter
|
|
36
39
|
>
|
|
37
40
|
{:else}
|
|
38
|
-
<svelte:component
|
|
39
|
-
|
|
41
|
+
<svelte:component
|
|
42
|
+
this={Wrapper}
|
|
43
|
+
{...targetWrapperProps()}
|
|
44
|
+
attributes={attributes()}><slot /></svelte:component
|
|
40
45
|
>
|
|
41
46
|
{/if}
|
|
@@ -9,6 +9,10 @@ export let block;
|
|
|
9
9
|
export let registeredComponents;
|
|
10
10
|
export let linkComponent;
|
|
11
11
|
let store = writable(repeatContext);
|
|
12
|
+
function onUpdateFn_0(..._args) {
|
|
13
|
+
$store = repeatContext;
|
|
14
|
+
}
|
|
15
|
+
$: onUpdateFn_0(...[repeatContext]);
|
|
12
16
|
setContext(BuilderContext.key, store);
|
|
13
17
|
</script>
|
|
14
18
|
|
|
@@ -69,7 +69,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
69
69
|
this={BlocksWrapper}
|
|
70
70
|
style={stringifyStyles(styleProp)}
|
|
71
71
|
bind:this={blocksWrapperRef}
|
|
72
|
-
class={className() + "
|
|
72
|
+
class={className() + " svelteelement"}
|
|
73
73
|
builder-path={dataPath()}
|
|
74
74
|
builder-parent-id={parent}
|
|
75
75
|
{...{}}
|
|
@@ -86,7 +86,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
86
86
|
>
|
|
87
87
|
|
|
88
88
|
<style>
|
|
89
|
-
.
|
|
89
|
+
.svelteelement {
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.7";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.7";
|
|
@@ -15,14 +15,15 @@ export let value = undefined;
|
|
|
15
15
|
export let required = undefined;
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
18
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
19
|
+
<input
|
|
20
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
21
|
+
{placeholder}
|
|
22
|
+
{type}
|
|
23
|
+
{name}
|
|
24
|
+
{value}
|
|
25
|
+
{defaultValue}
|
|
26
|
+
{required}
|
|
27
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
28
|
+
/>
|
|
29
|
+
{/key}
|
|
@@ -14,16 +14,17 @@ export let required = undefined;
|
|
|
14
14
|
export let options = undefined;
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</select>
|
|
17
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
18
|
+
<select
|
|
19
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
20
|
+
{value}
|
|
21
|
+
{defaultValue}
|
|
22
|
+
{name}
|
|
23
|
+
{required}
|
|
24
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
25
|
+
>
|
|
26
|
+
{#each options as option, index (`${option.name}-${index}`)}
|
|
27
|
+
<option value={option.value}>{option.name || option.value}</option>
|
|
28
|
+
{/each}
|
|
29
|
+
</select>
|
|
30
|
+
{/key}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import { getSrcSet } from "./image.helpers";
|
|
2
3
|
export let image;
|
|
3
4
|
export let src = undefined;
|
|
4
5
|
export let srcset = undefined;
|
|
@@ -66,6 +67,7 @@ $: aspectRatioCss = () => {
|
|
|
66
67
|
const out = aspectRatio ? aspectRatioStyles : undefined;
|
|
67
68
|
return out;
|
|
68
69
|
};
|
|
70
|
+
onMount(() => { });
|
|
69
71
|
</script>
|
|
70
72
|
|
|
71
73
|
<picture>
|
|
@@ -24,14 +24,15 @@ function stringifyStyles(stylesObj) {
|
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/>
|
|
27
|
+
{#key (isEditing() && imgSrc) || "default-key"}
|
|
28
|
+
<img
|
|
29
|
+
style={stringifyStyles({
|
|
30
|
+
objectFit: backgroundSize || "cover",
|
|
31
|
+
objectPosition: backgroundPosition || "center",
|
|
32
|
+
})}
|
|
33
|
+
alt={altText}
|
|
34
|
+
src={imgSrc || image}
|
|
35
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
36
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
37
|
+
/>
|
|
38
|
+
{/key}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
export const componentInfo = {
|
|
3
|
-
shouldReceiveBuilderProps: {
|
|
4
|
-
builderBlock:
|
|
3
|
+
shouldReceiveBuilderProps: TARGET === 'reactNative' ? {
|
|
4
|
+
builderBlock: true,
|
|
5
5
|
builderContext: true
|
|
6
|
-
},
|
|
6
|
+
} : {},
|
|
7
7
|
name: 'Text',
|
|
8
8
|
static: true,
|
|
9
9
|
isRSC: true,
|
|
@@ -7,7 +7,7 @@ import { getProcessedBlock } from "../../functions/get-processed-block";
|
|
|
7
7
|
import "../../server-index";
|
|
8
8
|
import "../dynamic-div.svelte";
|
|
9
9
|
import { bindAnimations } from "./animator";
|
|
10
|
-
import { getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
10
|
+
import { generateKey, getComponent, getRepeatItemData, provideBuilderBlock, provideBuilderContext, provideLinkComponent, provideRegisteredComponents, } from "./block.helpers";
|
|
11
11
|
import BlockStyles from "./components/block-styles.svelte";
|
|
12
12
|
import BlockWrapper from "./components/block-wrapper.svelte";
|
|
13
13
|
import ComponentRef from "./components/component-ref/component-ref.svelte";
|
|
@@ -135,7 +135,7 @@ afterUpdate(() => { });
|
|
|
135
135
|
{/each}
|
|
136
136
|
</BlockWrapper>
|
|
137
137
|
{:else}
|
|
138
|
-
{#each repeatItem() as data, index (index)}
|
|
138
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
139
139
|
<RepeatedBlock
|
|
140
140
|
repeatContext={data.context}
|
|
141
141
|
block={data.block}
|
|
@@ -157,7 +157,7 @@ afterUpdate(() => { });
|
|
|
157
157
|
isInteractive={componentRefProps().isInteractive}
|
|
158
158
|
/>
|
|
159
159
|
{:else}
|
|
160
|
-
{#each repeatItem() as data, index (index)}
|
|
160
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
161
161
|
<RepeatedBlock
|
|
162
162
|
repeatContext={data.context}
|
|
163
163
|
block={data.block}
|
|
@@ -6,8 +6,8 @@ import Awaiter from "../../awaiter.svelte";
|
|
|
6
6
|
export let includeBlockProps;
|
|
7
7
|
export let block;
|
|
8
8
|
export let context;
|
|
9
|
-
export let Wrapper;
|
|
10
9
|
export let wrapperProps;
|
|
10
|
+
export let Wrapper;
|
|
11
11
|
$: attributes = () => {
|
|
12
12
|
return includeBlockProps
|
|
13
13
|
? {
|
|
@@ -25,6 +25,9 @@ $: attributes = () => {
|
|
|
25
25
|
}
|
|
26
26
|
: {};
|
|
27
27
|
};
|
|
28
|
+
$: targetWrapperProps = () => {
|
|
29
|
+
return wrapperProps;
|
|
30
|
+
};
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
{#if Wrapper.load}
|
|
@@ -35,7 +38,9 @@ $: attributes = () => {
|
|
|
35
38
|
attributes={attributes()}><slot /></Awaiter
|
|
36
39
|
>
|
|
37
40
|
{:else}
|
|
38
|
-
<svelte:component
|
|
39
|
-
|
|
41
|
+
<svelte:component
|
|
42
|
+
this={Wrapper}
|
|
43
|
+
{...targetWrapperProps()}
|
|
44
|
+
attributes={attributes()}><slot /></svelte:component
|
|
40
45
|
>
|
|
41
46
|
{/if}
|
|
@@ -9,6 +9,10 @@ export let block;
|
|
|
9
9
|
export let registeredComponents;
|
|
10
10
|
export let linkComponent;
|
|
11
11
|
let store = writable(repeatContext);
|
|
12
|
+
function onUpdateFn_0(..._args) {
|
|
13
|
+
$store = repeatContext;
|
|
14
|
+
}
|
|
15
|
+
$: onUpdateFn_0(...[repeatContext]);
|
|
12
16
|
setContext(BuilderContext.key, store);
|
|
13
17
|
</script>
|
|
14
18
|
|
|
@@ -69,7 +69,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
69
69
|
this={BlocksWrapper}
|
|
70
70
|
style={stringifyStyles(styleProp)}
|
|
71
71
|
bind:this={blocksWrapperRef}
|
|
72
|
-
class={className() + "
|
|
72
|
+
class={className() + " svelteelement"}
|
|
73
73
|
builder-path={dataPath()}
|
|
74
74
|
builder-parent-id={parent}
|
|
75
75
|
{...{}}
|
|
@@ -86,7 +86,7 @@ $: onUpdateFn_0(...[blocks]);
|
|
|
86
86
|
>
|
|
87
87
|
|
|
88
88
|
<style>
|
|
89
|
-
.
|
|
89
|
+
.svelteelement {
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.7";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.7";
|
package/package.json
CHANGED
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
export let required: FormInputProps["required"] = undefined;
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/>
|
|
31
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
32
|
+
<input
|
|
33
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
34
|
+
{placeholder}
|
|
35
|
+
{type}
|
|
36
|
+
{name}
|
|
37
|
+
{value}
|
|
38
|
+
{defaultValue}
|
|
39
|
+
{required}
|
|
40
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
41
|
+
/>
|
|
42
|
+
{/key}
|
|
@@ -29,16 +29,17 @@
|
|
|
29
29
|
export let options: FormSelectProps["options"] = undefined;
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</select>
|
|
32
|
+
{#key isEditing() && defaultValue ? defaultValue : "default-key"}
|
|
33
|
+
<select
|
|
34
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
35
|
+
{value}
|
|
36
|
+
{defaultValue}
|
|
37
|
+
{name}
|
|
38
|
+
{required}
|
|
39
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
40
|
+
>
|
|
41
|
+
{#each options as option, index (`${option.name}-${index}`)}
|
|
42
|
+
<option value={option.value}>{option.name || option.value}</option>
|
|
43
|
+
{/each}
|
|
44
|
+
</select>
|
|
45
|
+
{/key}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
|
|
2
4
|
import { getSrcSet } from "./image.helpers";
|
|
3
5
|
import type { ImageProps } from "./image.types";
|
|
4
6
|
|
|
@@ -73,6 +75,8 @@
|
|
|
73
75
|
const out = aspectRatio ? aspectRatioStyles : undefined;
|
|
74
76
|
return out;
|
|
75
77
|
};
|
|
78
|
+
|
|
79
|
+
onMount(() => {});
|
|
76
80
|
</script>
|
|
77
81
|
|
|
78
82
|
<picture>
|
|
@@ -45,14 +45,15 @@
|
|
|
45
45
|
}
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/>
|
|
48
|
+
{#key (isEditing() && imgSrc) || "default-key"}
|
|
49
|
+
<img
|
|
50
|
+
style={stringifyStyles({
|
|
51
|
+
objectFit: backgroundSize || "cover",
|
|
52
|
+
objectPosition: backgroundPosition || "center",
|
|
53
|
+
})}
|
|
54
|
+
alt={altText}
|
|
55
|
+
src={imgSrc || image}
|
|
56
|
+
{...filterAttrs(attributes, "on:", false)}
|
|
57
|
+
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
58
|
+
/>
|
|
59
|
+
{/key}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
import type { ComponentInfo } from '../../types/components';
|
|
3
3
|
export const componentInfo: ComponentInfo = {
|
|
4
|
-
shouldReceiveBuilderProps: {
|
|
5
|
-
builderBlock:
|
|
4
|
+
shouldReceiveBuilderProps: TARGET === 'reactNative' ? {
|
|
5
|
+
builderBlock: true,
|
|
6
6
|
builderContext: true
|
|
7
|
-
},
|
|
7
|
+
} : {},
|
|
8
8
|
name: 'Text',
|
|
9
9
|
static: true,
|
|
10
10
|
isRSC: true,
|
|
@@ -123,4 +123,8 @@ export const provideBuilderContext = (block: RegisteredComponent | null | undefi
|
|
|
123
123
|
builderContext: context
|
|
124
124
|
};
|
|
125
125
|
return {};
|
|
126
|
+
};
|
|
127
|
+
export const generateKey = (index: number) => {
|
|
128
|
+
//This does not handle the case in Qwik
|
|
129
|
+
return index.toString();
|
|
126
130
|
}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import DynamicDiv from "../dynamic-div.svelte";
|
|
23
23
|
import { bindAnimations } from "./animator";
|
|
24
24
|
import {
|
|
25
|
+
generateKey,
|
|
25
26
|
getComponent,
|
|
26
27
|
getInheritedStyles,
|
|
27
28
|
getRepeatItemData,
|
|
@@ -173,7 +174,7 @@
|
|
|
173
174
|
{/each}
|
|
174
175
|
</BlockWrapper>
|
|
175
176
|
{:else}
|
|
176
|
-
{#each repeatItem() as data, index (index)}
|
|
177
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
177
178
|
<RepeatedBlock
|
|
178
179
|
repeatContext={data.context}
|
|
179
180
|
block={data.block}
|
|
@@ -195,7 +196,7 @@
|
|
|
195
196
|
isInteractive={componentRefProps().isInteractive}
|
|
196
197
|
/>
|
|
197
198
|
{:else}
|
|
198
|
-
{#each repeatItem() as data, index (index)}
|
|
199
|
+
{#each repeatItem() as data, index (generateKey(index))}
|
|
199
200
|
<RepeatedBlock
|
|
200
201
|
repeatContext={data.context}
|
|
201
202
|
block={data.block}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
export let includeBlockProps: InteractiveElementProps["includeBlockProps"];
|
|
22
22
|
export let block: InteractiveElementProps["block"];
|
|
23
23
|
export let context: InteractiveElementProps["context"];
|
|
24
|
-
export let Wrapper: InteractiveElementProps["Wrapper"];
|
|
25
24
|
export let wrapperProps: InteractiveElementProps["wrapperProps"];
|
|
25
|
+
export let Wrapper: InteractiveElementProps["Wrapper"];
|
|
26
26
|
|
|
27
27
|
$: attributes = () => {
|
|
28
28
|
return includeBlockProps
|
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
: {};
|
|
43
43
|
};
|
|
44
|
+
$: targetWrapperProps = () => {
|
|
45
|
+
return wrapperProps;
|
|
46
|
+
};
|
|
44
47
|
</script>
|
|
45
48
|
|
|
46
49
|
{#if Wrapper.load}
|
|
@@ -51,7 +54,9 @@
|
|
|
51
54
|
attributes={attributes()}><slot /></Awaiter
|
|
52
55
|
>
|
|
53
56
|
{:else}
|
|
54
|
-
<svelte:component
|
|
55
|
-
|
|
57
|
+
<svelte:component
|
|
58
|
+
this={Wrapper}
|
|
59
|
+
{...targetWrapperProps()}
|
|
60
|
+
attributes={attributes()}><slot /></svelte:component
|
|
56
61
|
>
|
|
57
62
|
{/if}
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
this={BlocksWrapper}
|
|
104
104
|
style={stringifyStyles(styleProp)}
|
|
105
105
|
bind:this={blocksWrapperRef}
|
|
106
|
-
class={className() + "
|
|
106
|
+
class={className() + " svelteelement"}
|
|
107
107
|
builder-path={dataPath()}
|
|
108
108
|
builder-parent-id={parent}
|
|
109
109
|
{...{}}
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
>
|
|
121
121
|
|
|
122
122
|
<style>
|
|
123
|
-
.
|
|
123
|
+
.svelteelement {
|
|
124
124
|
display: flex;
|
|
125
125
|
flex-direction: column;
|
|
126
126
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.7"
|