svelte 5.45.6 → 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/elements.d.ts CHANGED
@@ -1422,7 +1422,7 @@ export interface HTMLTextareaAttributes extends HTMLAttributes<HTMLTextAreaEleme
1422
1422
  // needs both casing variants because language tools does lowercase names of non-shorthand attributes
1423
1423
  defaultValue?: string | string[] | number | undefined | null;
1424
1424
  defaultvalue?: string | string[] | number | undefined | null;
1425
- wrap?: 'hard' | 'soft' | undefined | null;
1425
+ wrap?: 'hard' | 'soft' | 'off' | undefined | null;
1426
1426
 
1427
1427
  'on:change'?: ChangeEventHandler<HTMLTextAreaElement> | undefined | null;
1428
1428
  onchange?: ChangeEventHandler<HTMLTextAreaElement> | undefined | null;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "svelte",
3
3
  "description": "Cybernetically enhanced web apps",
4
4
  "license": "MIT",
5
- "version": "5.45.6",
5
+ "version": "5.45.7",
6
6
  "type": "module",
7
7
  "types": "./types/index.d.ts",
8
8
  "engines": {
@@ -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
 
@@ -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) => `r(${uneval(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
- p.finally(() => unresolved?.delete(p));
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
@@ -4,5 +4,5 @@
4
4
  * The current version, as set in package.json.
5
5
  * @type {string}
6
6
  */
7
- export const VERSION = '5.45.6';
7
+ export const VERSION = '5.45.7';
8
8
  export const PUBLIC_VERSION = '5';