svelte 5.45.5 → 5.45.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/compiler/index.js +1 -1
- package/elements.d.ts +2 -1
- package/package.json +1 -1
- package/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js +8 -0
- package/src/compiler/print/index.js +24 -0
- package/src/internal/client/dev/inspect.js +0 -2
- package/src/internal/server/hydratable.js +12 -16
- package/src/version.js +1 -1
package/elements.d.ts
CHANGED
|
@@ -1239,6 +1239,7 @@ export interface HTMLMediaAttributes<T extends HTMLMediaElement> extends HTMLAtt
|
|
|
1239
1239
|
playsinline?: boolean | undefined | null;
|
|
1240
1240
|
preload?: 'auto' | 'none' | 'metadata' | '' | undefined | null;
|
|
1241
1241
|
src?: string | undefined | null;
|
|
1242
|
+
srcobject?: MediaStream | MediaSource | File | Blob;
|
|
1242
1243
|
/**
|
|
1243
1244
|
* a value between 0 and 1
|
|
1244
1245
|
*/
|
|
@@ -1421,7 +1422,7 @@ export interface HTMLTextareaAttributes extends HTMLAttributes<HTMLTextAreaEleme
|
|
|
1421
1422
|
// needs both casing variants because language tools does lowercase names of non-shorthand attributes
|
|
1422
1423
|
defaultValue?: string | string[] | number | undefined | null;
|
|
1423
1424
|
defaultvalue?: string | string[] | number | undefined | null;
|
|
1424
|
-
wrap?: 'hard' | 'soft' | undefined | null;
|
|
1425
|
+
wrap?: 'hard' | 'soft' | 'off' | undefined | null;
|
|
1425
1426
|
|
|
1426
1427
|
'on:change'?: ChangeEventHandler<HTMLTextAreaElement> | undefined | null;
|
|
1427
1428
|
onchange?: ChangeEventHandler<HTMLTextAreaElement> | undefined | null;
|
package/package.json
CHANGED
|
@@ -486,9 +486,17 @@ export function check_element(node, context) {
|
|
|
486
486
|
case 'video': {
|
|
487
487
|
const aria_hidden_attribute = attribute_map.get('aria-hidden');
|
|
488
488
|
const aria_hidden_exist = aria_hidden_attribute && get_static_value(aria_hidden_attribute);
|
|
489
|
+
|
|
489
490
|
if (attribute_map.has('muted') || aria_hidden_exist === 'true' || has_spread) {
|
|
490
491
|
return;
|
|
491
492
|
}
|
|
493
|
+
|
|
494
|
+
if (!attribute_map.has('src')) {
|
|
495
|
+
// don't warn about missing captions if `<video>` has no `src` —
|
|
496
|
+
// could e.g. be playing a MediaStream
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
|
|
492
500
|
let has_caption = false;
|
|
493
501
|
const track = /** @type {AST.RegularElement | undefined} */ (
|
|
494
502
|
node.fragment.nodes.find((i) => i.type === 'RegularElement' && i.name === 'track')
|
|
@@ -181,6 +181,18 @@ const css_visitors = {
|
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
|
|
184
|
+
AttributeSelector(node, context) {
|
|
185
|
+
context.write(`[${node.name}`);
|
|
186
|
+
if (node.matcher) {
|
|
187
|
+
context.write(node.matcher);
|
|
188
|
+
context.write(`"${node.value}"`);
|
|
189
|
+
if (node.flags) {
|
|
190
|
+
context.write(` ${node.flags}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
context.write(']');
|
|
194
|
+
},
|
|
195
|
+
|
|
184
196
|
Block(node, context) {
|
|
185
197
|
context.write('{');
|
|
186
198
|
|
|
@@ -221,10 +233,22 @@ const css_visitors = {
|
|
|
221
233
|
context.write(`${node.property}: ${node.value};`);
|
|
222
234
|
},
|
|
223
235
|
|
|
236
|
+
IdSelector(node, context) {
|
|
237
|
+
context.write(`#${node.name}`);
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
NestingSelector(node, context) {
|
|
241
|
+
context.write('&');
|
|
242
|
+
},
|
|
243
|
+
|
|
224
244
|
Nth(node, context) {
|
|
225
245
|
context.write(node.value);
|
|
226
246
|
},
|
|
227
247
|
|
|
248
|
+
Percentage(node, context) {
|
|
249
|
+
context.write(`${node.value}%`);
|
|
250
|
+
},
|
|
251
|
+
|
|
228
252
|
PseudoClassSelector(node, context) {
|
|
229
253
|
context.write(`:${node.name}`);
|
|
230
254
|
|
|
@@ -34,8 +34,6 @@ export function inspect(get_value, inspector, show_stack = false) {
|
|
|
34
34
|
|
|
35
35
|
if (!initial) {
|
|
36
36
|
const stack = get_error('$inspect(...)');
|
|
37
|
-
// eslint-disable-next-line no-console
|
|
38
|
-
|
|
39
37
|
if (stack) {
|
|
40
38
|
// eslint-disable-next-line no-console
|
|
41
39
|
console.groupCollapsed('stack trace');
|
|
@@ -57,8 +57,16 @@ function encode(key, value, unresolved) {
|
|
|
57
57
|
|
|
58
58
|
entry.serialized = devalue.uneval(entry.value, (value, uneval) => {
|
|
59
59
|
if (is_promise(value)) {
|
|
60
|
+
// we serialize promises as `"${i}"`, because it's impossible for that string
|
|
61
|
+
// to occur 'naturally' (since the quote marks would have to be escaped)
|
|
62
|
+
// this placeholder is returned synchronously from `uneval`, which includes it in the
|
|
63
|
+
// serialized string. Later (at least one microtask from now), when `p.then` runs, it'll
|
|
64
|
+
// be replaced.
|
|
65
|
+
const placeholder = `"${uid++}"`;
|
|
60
66
|
const p = value
|
|
61
|
-
.then((v) =>
|
|
67
|
+
.then((v) => {
|
|
68
|
+
entry.serialized = entry.serialized.replace(placeholder, `r(${uneval(v)})`);
|
|
69
|
+
})
|
|
62
70
|
.catch((devalue_error) =>
|
|
63
71
|
e.hydratable_serialization_failed(
|
|
64
72
|
key,
|
|
@@ -66,23 +74,11 @@ function encode(key, value, unresolved) {
|
|
|
66
74
|
)
|
|
67
75
|
);
|
|
68
76
|
|
|
69
|
-
// prevent unhandled rejections from crashing the server
|
|
70
|
-
p.catch(() => {});
|
|
71
|
-
|
|
72
|
-
// track which promises are still resolving when render is complete
|
|
73
77
|
unresolved?.set(p, key);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// we serialize promises as `"${i}"`, because it's impossible for that string
|
|
77
|
-
// to occur 'naturally' (since the quote marks would have to be escaped)
|
|
78
|
-
const placeholder = `"${uid++}"`;
|
|
79
|
-
|
|
80
|
-
(entry.promises ??= []).push(
|
|
81
|
-
p.then((s) => {
|
|
82
|
-
entry.serialized = entry.serialized.replace(placeholder, s);
|
|
83
|
-
})
|
|
84
|
-
);
|
|
78
|
+
// prevent unhandled rejections from crashing the server, track which promises are still resolving when render is complete
|
|
79
|
+
p.catch(() => {}).finally(() => unresolved?.delete(p));
|
|
85
80
|
|
|
81
|
+
(entry.promises ??= []).push(p);
|
|
86
82
|
return placeholder;
|
|
87
83
|
}
|
|
88
84
|
});
|
package/src/version.js
CHANGED