@@ -1079,7 +1079,9 @@ exports[`Svelte > jsx > Javascript Test > Image State 1`] = `
1079
1079
1080
1080
<div>
1081
1081
{#each images as item, itemIndex}
1082
- <img class=\\"custom-class\\" src={item} key={itemIndex} />
1082
+ {#key itemIndex}
1083
+ <img class=\\"custom-class\\" src={item} />
1084
+ {/key}
1083
1085
{/each}
1084
1086
</div>"
1085
1087
`;
@@ -1105,16 +1107,17 @@ exports[`Svelte > jsx > Javascript Test > Img 1`] = `
1105
1107
}
1106
1108
</script>
1107
1109
1108
- <img
1109
- style={stringifyStyles({
1110
- objectFit: backgroundSize || \\"cover\\",
1111
- objectPosition: backgroundPosition || \\"center\\",
1112
- })}
1113
- {...attributes}
1114
- key={(Builder.isEditing && imgSrc) || \\"default-key\\"}
1115
- alt={altText}
1116
- src={imgSrc}
1117
- />"
1110
+ {#key (Builder.isEditing && imgSrc) || \\"default-key\\"}
1111
+ <img
1112
+ style={stringifyStyles({
1113
+ objectFit: backgroundSize || \\"cover\\",
1114
+ objectPosition: backgroundPosition || \\"center\\",
1115
+ })}
1116
+ {...attributes}
1117
+ alt={altText}
1118
+ src={imgSrc}
1119
+ />
1120
+ {/key}"
1118
1121
`;
1119
1122
1120
1123
exports[`Svelte > jsx > Javascript Test > Input 1`] = `
@@ -1131,19 +1134,20 @@ exports[`Svelte > jsx > Javascript Test > Input 1`] = `
1131
1134
export let onChange;
1132
1135
</script>
1133
1136
1134
- <input
1135
- {...attributes}
1136
- key={Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
1137
- {placeholder}
1138
- {type}
1139
- {name}
1140
- {value}
1141
- {defaultValue}
1142
- {required}
1143
- on:change={(event) => {
1144
- onChange?.(event.target.value);
1145
- }}
1146
- />"
1137
+ {#key Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
1138
+ <input
1139
+ {...attributes}
1140
+ {placeholder}
1141
+ {type}
1142
+ {name}
1143
+ {value}
1144
+ {defaultValue}
1145
+ {required}
1146
+ on:change={(event) => {
1147
+ onChange?.(event.target.value);
1148
+ }}
1149
+ />
1150
+ {/key}"
1147
1151
`;
1148
1152
1149
1153
exports[`Svelte > jsx > Javascript Test > InputParent 1`] = `
@@ -1261,19 +1265,15 @@ exports[`Svelte > jsx > Javascript Test > Select 1`] = `
1261
1265
export let options;
1262
1266
</script>
1263
1267
1264
- <select
1265
- {...attributes}
1266
- {value}
1267
- key={Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
1268
- {defaultValue}
1269
- {name}
1270
- >
1271
- {#each options as option, index}
1272
- <option value={option.value} data-index={index}
1273
- >{option.name || option.value}</option
1274
- >
1275
- {/each}
1276
- </select>"
1268
+ {#key Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
1269
+ <select {...attributes} {value} {defaultValue} {name}>
1270
+ {#each options as option, index}
1271
+ <option value={option.value} data-index={index}
1272
+ >{option.name || option.value}</option
1273
+ >
1274
+ {/each}
1275
+ </select>
1276
+ {/key}"
1277
1277
`;
1278
1278
1279
1279
exports[`Svelte > jsx > Javascript Test > SlotDefault 1`] = `"<div><slot><div class=\\"default-slot\\">Default content</div></slot></div>"`;
@@ -1554,26 +1554,27 @@ exports[`Svelte > jsx > Javascript Test > Video 1`] = `
1554
1554
}
1555
1555
</script>
1556
1556
1557
- <video
1558
- style={stringifyStyles({
1559
- width: \\"100%\\",
1560
- height: \\"100%\\",
1561
- ...attributes?.style,
1562
- objectFit: fit,
1563
- objectPosition: position,
1564
- // Hack to get object fit to work as expected and
1565
- // not have the video overflow
1566
- borderRadius: 1,
1567
- })}
1568
- preload=\\"none\\"
1569
- {...attributes}
1570
- key={video || \\"no-src\\"}
1571
- poster={posterImage}
1572
- autoplay={autoPlay}
1573
- {muted}
1574
- {controls}
1575
- {loop}
1576
- />"
1557
+ {#key video || \\"no-src\\"}
1558
+ <video
1559
+ style={stringifyStyles({
1560
+ width: \\"100%\\",
1561
+ height: \\"100%\\",
1562
+ ...attributes?.style,
1563
+ objectFit: fit,
1564
+ objectPosition: position,
1565
+ // Hack to get object fit to work as expected and
1566
+ // not have the video overflow
1567
+ borderRadius: 1,
1568
+ })}
1569
+ preload=\\"none\\"
1570
+ {...attributes}
1571
+ poster={posterImage}
1572
+ autoplay={autoPlay}
1573
+ {muted}
1574
+ {controls}
1575
+ {loop}
1576
+ />
1577
+ {/key}"
1577
1578
`;
1578
1579
1579
1580
exports[`Svelte > jsx > Javascript Test > arrowFunctionInUseStore 1`] = `
@@ -4670,7 +4671,9 @@ exports[`Svelte > jsx > Typescript Test > Image State 1`] = `
4670
4671
4671
4672
<div>
4672
4673
{#each images as item, itemIndex}
4673
- <img class=\\"custom-class\\" src={item} key={itemIndex} />
4674
+ {#key itemIndex}
4675
+ <img class=\\"custom-class\\" src={item} />
4676
+ {/key}
4674
4677
{/each}
4675
4678
</div>"
4676
4679
`;
@@ -4715,16 +4718,17 @@ exports[`Svelte > jsx > Typescript Test > Img 1`] = `
4715
4718
}
4716
4719
</script>
4717
4720
4718
- <img
4719
- style={stringifyStyles({
4720
- objectFit: backgroundSize || \\"cover\\",
4721
- objectPosition: backgroundPosition || \\"center\\",
4722
- })}
4723
- {...attributes}
4724
- key={(Builder.isEditing && imgSrc) || \\"default-key\\"}
4725
- alt={altText}
4726
- src={imgSrc}
4727
- />"
4721
+ {#key (Builder.isEditing && imgSrc) || \\"default-key\\"}
4722
+ <img
4723
+ style={stringifyStyles({
4724
+ objectFit: backgroundSize || \\"cover\\",
4725
+ objectPosition: backgroundPosition || \\"center\\",
4726
+ })}
4727
+ {...attributes}
4728
+ alt={altText}
4729
+ src={imgSrc}
4730
+ />
4731
+ {/key}"
4728
4732
`;
4729
4733
4730
4734
exports[`Svelte > jsx > Typescript Test > Input 1`] = `
@@ -4754,19 +4758,20 @@ exports[`Svelte > jsx > Typescript Test > Input 1`] = `
4754
4758
export let onChange: FormInputProps[\\"onChange\\"] = undefined;
4755
4759
</script>
4756
4760
4757
- <input
4758
- {...attributes}
4759
- key={Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
4760
- {placeholder}
4761
- {type}
4762
- {name}
4763
- {value}
4764
- {defaultValue}
4765
- {required}
4766
- on:change={(event) => {
4767
- onChange?.(event.target.value);
4768
- }}
4769
- />"
4761
+ {#key Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
4762
+ <input
4763
+ {...attributes}
4764
+ {placeholder}
4765
+ {type}
4766
+ {name}
4767
+ {value}
4768
+ {defaultValue}
4769
+ {required}
4770
+ on:change={(event) => {
4771
+ onChange?.(event.target.value);
4772
+ }}
4773
+ />
4774
+ {/key}"
4770
4775
`;
4771
4776
4772
4777
exports[`Svelte > jsx > Typescript Test > InputParent 1`] = `
@@ -4927,19 +4932,15 @@ exports[`Svelte > jsx > Typescript Test > Select 1`] = `
4927
4932
export let options: FormSelectProps[\\"options\\"] = undefined;
4928
4933
</script>
4929
4934
4930
- <select
4931
- {...attributes}
4932
- {value}
4933
- key={Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
4934
- {defaultValue}
4935
- {name}
4936
- >
4937
- {#each options as option, index}
4938
- <option value={option.value} data-index={index}
4939
- >{option.name || option.value}</option
4940
- >
4941
- {/each}
4942
- </select>"
4935
+ {#key Builder.isEditing && defaultValue ? defaultValue : \\"default-key\\"}
4936
+ <select {...attributes} {value} {defaultValue} {name}>
4937
+ {#each options as option, index}
4938
+ <option value={option.value} data-index={index}
4939
+ >{option.name || option.value}</option
4940
+ >
4941
+ {/each}
4942
+ </select>
4943
+ {/key}"
4943
4944
`;
4944
4945
4945
4946
exports[`Svelte > jsx > Typescript Test > SlotDefault 1`] = `
@@ -5329,26 +5330,27 @@ exports[`Svelte > jsx > Typescript Test > Video 1`] = `
5329
5330
}
5330
5331
</script>
5331
5332
5332
- <video
5333
- style={stringifyStyles({
5334
- width: \\"100%\\",
5335
- height: \\"100%\\",
5336
- ...attributes?.style,
5337
- objectFit: fit,
5338
- objectPosition: position,
5339
- // Hack to get object fit to work as expected and
5340
- // not have the video overflow
5341
- borderRadius: 1,
5342
- })}
5343
- preload=\\"none\\"
5344
- {...attributes}
5345
- key={video || \\"no-src\\"}
5346
- poster={posterImage}
5347
- autoplay={autoPlay}
5348
- {muted}
5349
- {controls}
5350
- {loop}
5351
- />"
5333
+ {#key video || \\"no-src\\"}
5334
+ <video
5335
+ style={stringifyStyles({
5336
+ width: \\"100%\\",
5337
+ height: \\"100%\\",
5338
+ ...attributes?.style,
5339
+ objectFit: fit,
5340
+ objectPosition: position,
5341
+ // Hack to get object fit to work as expected and
5342
+ // not have the video overflow
5343
+ borderRadius: 1,
5344
+ })}
5345
+ preload=\\"none\\"
5346
+ {...attributes}
5347
+ poster={posterImage}
5348
+ autoplay={autoPlay}
5349
+ {muted}
5350
+ {controls}
5351
+ {loop}
5352
+ />
5353
+ {/key}"
5352
5354
`;
5353
5355
5354
5356
exports[`Svelte > jsx > Typescript Test > arrowFunctionInUseStore 1`] = `
0 commit comments