@nil-/xit 0.4.15 → 0.4.17

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.
@@ -0,0 +1,481 @@
1
+ var le = Object.getPrototypeOf;
2
+ var de = Reflect.get;
3
+ var ee = (o) => {
4
+ throw TypeError(o);
5
+ };
6
+ var H = (o, a, e) => a.has(o) || ee("Cannot " + e);
7
+ var s = (o, a, e) => (H(o, a, "read from private field"), e ? e.call(o) : a.get(o)), n = (o, a, e) => a.has(o) ? ee("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(o) : a.set(o, e), b = (o, a, e, t) => (H(o, a, "write to private field"), t ? t.call(o, e) : a.set(o, e), e), d = (o, a, e) => (H(o, a, "access private method"), e);
8
+ var se = (o, a, e) => de(le(o), e, a);
9
+ import { b as p, f as te, g as r, d as re, k as ve, a as u, o as me } from "./index.js";
10
+ import "./internal/client.js";
11
+ import { i as f, c as ge } from "./store.js";
12
+ var ie = !1, k, N, Q, V, oe;
13
+ const X = class X extends Date {
14
+ /** @param {any[]} params */
15
+ constructor(...e) {
16
+ super(...e);
17
+ n(this, V);
18
+ n(this, k, p(super.getTime()));
19
+ /** @type {Map<keyof Date, Source<unknown>>} */
20
+ n(this, N, /* @__PURE__ */ new Map());
21
+ n(this, Q, te);
22
+ ie || d(this, V, oe).call(this);
23
+ }
24
+ };
25
+ k = new WeakMap(), N = new WeakMap(), Q = new WeakMap(), V = new WeakSet(), oe = function() {
26
+ ie = !0;
27
+ var e = X.prototype, t = Date.prototype, i = (
28
+ /** @type {Array<keyof Date & string>} */
29
+ Object.getOwnPropertyNames(t)
30
+ );
31
+ for (const h of i)
32
+ (h.startsWith("get") || h.startsWith("to") || h === "valueOf") && (e[h] = function(...z) {
33
+ if (z.length > 0)
34
+ return r(s(this, k)), t[h].apply(this, z);
35
+ var _ = s(this, N).get(h);
36
+ if (_ === void 0) {
37
+ const M = te;
38
+ re(s(this, Q)), _ = ve(() => (r(s(this, k)), t[h].apply(this, z))), s(this, N).set(h, _), re(M);
39
+ }
40
+ return r(_);
41
+ }), h.startsWith("set") && (e[h] = function(...z) {
42
+ var _ = t[h].apply(this, z);
43
+ return u(s(this, k), t.getTime.call(this)), _;
44
+ });
45
+ };
46
+ let he = X;
47
+ var we = ["forEach", "isDisjointFrom", "isSubsetOf", "isSupersetOf"], ze = ["difference", "intersection", "symmetricDifference", "union"], ue = !1, D, l, P, B, pe;
48
+ const G = class G extends Set {
49
+ /**
50
+ * @param {Iterable<T> | null | undefined} [value]
51
+ */
52
+ constructor(e) {
53
+ super();
54
+ n(this, B);
55
+ /** @type {Map<T, Source<boolean>>} */
56
+ n(this, D, /* @__PURE__ */ new Map());
57
+ n(this, l, p(0));
58
+ n(this, P, p(0));
59
+ if (e) {
60
+ for (var t of e)
61
+ super.add(t);
62
+ s(this, P).v = super.size;
63
+ }
64
+ ue || d(this, B, pe).call(this);
65
+ }
66
+ /** @param {T} value */
67
+ has(e) {
68
+ var t = super.has(e), i = s(this, D), h = i.get(e);
69
+ if (h === void 0) {
70
+ if (!t)
71
+ return r(s(this, l)), !1;
72
+ h = p(!0), i.set(e, h);
73
+ }
74
+ return r(h), t;
75
+ }
76
+ /** @param {T} value */
77
+ add(e) {
78
+ return super.has(e) || (super.add(e), u(s(this, P), super.size), f(s(this, l))), this;
79
+ }
80
+ /** @param {T} value */
81
+ delete(e) {
82
+ var t = super.delete(e), i = s(this, D), h = i.get(e);
83
+ return h !== void 0 && (i.delete(e), u(h, !1)), t && (u(s(this, P), super.size), f(s(this, l))), t;
84
+ }
85
+ clear() {
86
+ if (super.size !== 0) {
87
+ super.clear();
88
+ var e = s(this, D);
89
+ for (var t of e.values())
90
+ u(t, !1);
91
+ e.clear(), u(s(this, P), 0), f(s(this, l));
92
+ }
93
+ }
94
+ keys() {
95
+ return this.values();
96
+ }
97
+ values() {
98
+ return r(s(this, l)), super.values();
99
+ }
100
+ entries() {
101
+ return r(s(this, l)), super.entries();
102
+ }
103
+ [Symbol.iterator]() {
104
+ return this.keys();
105
+ }
106
+ get size() {
107
+ return r(s(this, P));
108
+ }
109
+ };
110
+ D = new WeakMap(), l = new WeakMap(), P = new WeakMap(), B = new WeakSet(), // We init as part of the first instance so that we can treeshake this class
111
+ pe = function() {
112
+ ue = !0;
113
+ var e = G.prototype, t = Set.prototype;
114
+ for (const i of we)
115
+ e[i] = function(...h) {
116
+ return r(s(this, l)), t[i].apply(this, h);
117
+ };
118
+ for (const i of ze)
119
+ e[i] = function(...h) {
120
+ r(s(this, l));
121
+ var z = (
122
+ /** @type {Set<T>} */
123
+ t[i].apply(this, h)
124
+ );
125
+ return new G(z);
126
+ };
127
+ };
128
+ let ae = G;
129
+ var v, m, y, W, J;
130
+ const Y = class Y extends Map {
131
+ /**
132
+ * @param {Iterable<readonly [K, V]> | null | undefined} [value]
133
+ */
134
+ constructor(e) {
135
+ super();
136
+ n(this, W);
137
+ /** @type {Map<K, Source<number>>} */
138
+ n(this, v, /* @__PURE__ */ new Map());
139
+ n(this, m, p(0));
140
+ n(this, y, p(0));
141
+ if (e) {
142
+ for (var [t, i] of e)
143
+ super.set(t, i);
144
+ s(this, y).v = super.size;
145
+ }
146
+ }
147
+ /** @param {K} key */
148
+ has(e) {
149
+ var t = s(this, v), i = t.get(e);
150
+ if (i === void 0) {
151
+ var h = super.get(e);
152
+ if (h !== void 0)
153
+ i = p(0), t.set(e, i);
154
+ else
155
+ return r(s(this, m)), !1;
156
+ }
157
+ return r(i), !0;
158
+ }
159
+ /**
160
+ * @param {(value: V, key: K, map: Map<K, V>) => void} callbackfn
161
+ * @param {any} [this_arg]
162
+ */
163
+ forEach(e, t) {
164
+ d(this, W, J).call(this), super.forEach(e, t);
165
+ }
166
+ /** @param {K} key */
167
+ get(e) {
168
+ var t = s(this, v), i = t.get(e);
169
+ if (i === void 0) {
170
+ var h = super.get(e);
171
+ if (h !== void 0)
172
+ i = p(0), t.set(e, i);
173
+ else {
174
+ r(s(this, m));
175
+ return;
176
+ }
177
+ }
178
+ return r(i), super.get(e);
179
+ }
180
+ /**
181
+ * @param {K} key
182
+ * @param {V} value
183
+ * */
184
+ set(e, t) {
185
+ var q;
186
+ var i = s(this, v), h = i.get(e), z = super.get(e), _ = super.set(e, t), M = s(this, m);
187
+ if (h === void 0)
188
+ i.set(e, p(0)), u(s(this, y), super.size), f(M);
189
+ else if (z !== t) {
190
+ f(h);
191
+ var Z = M.reactions === null ? null : new Set(M.reactions), ce = Z === null || !((q = h.reactions) != null && q.every(
192
+ (fe) => (
193
+ /** @type {NonNullable<typeof v_reactions>} */
194
+ Z.has(fe)
195
+ )
196
+ ));
197
+ ce && f(M);
198
+ }
199
+ return _;
200
+ }
201
+ /** @param {K} key */
202
+ delete(e) {
203
+ var t = s(this, v), i = t.get(e), h = super.delete(e);
204
+ return i !== void 0 && (t.delete(e), u(s(this, y), super.size), u(i, -1), f(s(this, m))), h;
205
+ }
206
+ clear() {
207
+ if (super.size !== 0) {
208
+ super.clear();
209
+ var e = s(this, v);
210
+ u(s(this, y), 0);
211
+ for (var t of e.values())
212
+ u(t, -1);
213
+ f(s(this, m)), e.clear();
214
+ }
215
+ }
216
+ keys() {
217
+ return r(s(this, m)), super.keys();
218
+ }
219
+ values() {
220
+ return d(this, W, J).call(this), super.values();
221
+ }
222
+ entries() {
223
+ return d(this, W, J).call(this), super.entries();
224
+ }
225
+ [Symbol.iterator]() {
226
+ return this.entries();
227
+ }
228
+ get size() {
229
+ return r(s(this, y)), super.size;
230
+ }
231
+ };
232
+ v = new WeakMap(), m = new WeakMap(), y = new WeakMap(), W = new WeakSet(), J = function() {
233
+ r(s(this, m));
234
+ var e = s(this, v);
235
+ if (s(this, y).v !== e.size)
236
+ for (var t of se(Y.prototype, this, "keys").call(this))
237
+ e.has(t) || e.set(t, p(0));
238
+ for (var [, i] of s(this, v))
239
+ r(i);
240
+ };
241
+ let ne = Y;
242
+ const I = Symbol();
243
+ var c, T, S, R, $;
244
+ class ye extends URLSearchParams {
245
+ constructor() {
246
+ super(...arguments);
247
+ n(this, R);
248
+ n(this, c, p(0));
249
+ n(this, T, Se());
250
+ n(this, S, !1);
251
+ }
252
+ /**
253
+ * @param {URLSearchParams} params
254
+ * @internal
255
+ */
256
+ [I](e) {
257
+ if (!s(this, S)) {
258
+ b(this, S, !0);
259
+ for (const t of [...super.keys()])
260
+ super.delete(t);
261
+ for (const [t, i] of e)
262
+ super.append(t, i);
263
+ f(s(this, c)), b(this, S, !1);
264
+ }
265
+ }
266
+ /**
267
+ * @param {string} name
268
+ * @param {string} value
269
+ * @returns {void}
270
+ */
271
+ append(e, t) {
272
+ super.append(e, t), d(this, R, $).call(this), f(s(this, c));
273
+ }
274
+ /**
275
+ * @param {string} name
276
+ * @param {string=} value
277
+ * @returns {void}
278
+ */
279
+ delete(e, t) {
280
+ var i = super.has(e, t);
281
+ super.delete(e, t), i && (d(this, R, $).call(this), f(s(this, c)));
282
+ }
283
+ /**
284
+ * @param {string} name
285
+ * @returns {string|null}
286
+ */
287
+ get(e) {
288
+ return r(s(this, c)), super.get(e);
289
+ }
290
+ /**
291
+ * @param {string} name
292
+ * @returns {string[]}
293
+ */
294
+ getAll(e) {
295
+ return r(s(this, c)), super.getAll(e);
296
+ }
297
+ /**
298
+ * @param {string} name
299
+ * @param {string=} value
300
+ * @returns {boolean}
301
+ */
302
+ has(e, t) {
303
+ return r(s(this, c)), super.has(e, t);
304
+ }
305
+ keys() {
306
+ return r(s(this, c)), super.keys();
307
+ }
308
+ /**
309
+ * @param {string} name
310
+ * @param {string} value
311
+ * @returns {void}
312
+ */
313
+ set(e, t) {
314
+ var i = super.getAll(e).join("");
315
+ super.set(e, t), i !== super.getAll(e).join("") && (d(this, R, $).call(this), f(s(this, c)));
316
+ }
317
+ sort() {
318
+ super.sort(), d(this, R, $).call(this), f(s(this, c));
319
+ }
320
+ toString() {
321
+ return r(s(this, c)), super.toString();
322
+ }
323
+ values() {
324
+ return r(s(this, c)), super.values();
325
+ }
326
+ entries() {
327
+ return r(s(this, c)), super.entries();
328
+ }
329
+ [Symbol.iterator]() {
330
+ return this.entries();
331
+ }
332
+ get size() {
333
+ return r(s(this, c)), super.size;
334
+ }
335
+ }
336
+ c = new WeakMap(), T = new WeakMap(), S = new WeakMap(), R = new WeakSet(), $ = function() {
337
+ if (!s(this, T) || s(this, S)) return;
338
+ b(this, S, !0);
339
+ const e = this.toString();
340
+ s(this, T).search = e && `?${e}`, b(this, S, !1);
341
+ };
342
+ let K = null;
343
+ function Se() {
344
+ return K;
345
+ }
346
+ var x, L, O, g, w, A, E, U, j;
347
+ class Ae extends URL {
348
+ /**
349
+ * @param {string | URL} url
350
+ * @param {string | URL} [base]
351
+ */
352
+ constructor(e, t) {
353
+ e = new URL(e, t);
354
+ super(e);
355
+ n(this, x, p(super.protocol));
356
+ n(this, L, p(super.username));
357
+ n(this, O, p(super.password));
358
+ n(this, g, p(super.hostname));
359
+ n(this, w, p(super.port));
360
+ n(this, A, p(super.pathname));
361
+ n(this, E, p(super.hash));
362
+ n(this, U, p(super.search));
363
+ n(this, j);
364
+ K = this, b(this, j, new ye(e.searchParams)), K = null;
365
+ }
366
+ get hash() {
367
+ return r(s(this, E));
368
+ }
369
+ set hash(e) {
370
+ super.hash = e, u(s(this, E), super.hash);
371
+ }
372
+ get host() {
373
+ return r(s(this, g)), r(s(this, w)), super.host;
374
+ }
375
+ set host(e) {
376
+ super.host = e, u(s(this, g), super.hostname), u(s(this, w), super.port);
377
+ }
378
+ get hostname() {
379
+ return r(s(this, g));
380
+ }
381
+ set hostname(e) {
382
+ super.hostname = e, u(s(this, g), super.hostname);
383
+ }
384
+ get href() {
385
+ return r(s(this, x)), r(s(this, L)), r(s(this, O)), r(s(this, g)), r(s(this, w)), r(s(this, A)), r(s(this, E)), r(s(this, U)), super.href;
386
+ }
387
+ set href(e) {
388
+ super.href = e, u(s(this, x), super.protocol), u(s(this, L), super.username), u(s(this, O), super.password), u(s(this, g), super.hostname), u(s(this, w), super.port), u(s(this, A), super.pathname), u(s(this, E), super.hash), u(s(this, U), super.search), s(this, j)[I](super.searchParams);
389
+ }
390
+ get password() {
391
+ return r(s(this, O));
392
+ }
393
+ set password(e) {
394
+ super.password = e, u(s(this, O), super.password);
395
+ }
396
+ get pathname() {
397
+ return r(s(this, A));
398
+ }
399
+ set pathname(e) {
400
+ super.pathname = e, u(s(this, A), super.pathname);
401
+ }
402
+ get port() {
403
+ return r(s(this, w));
404
+ }
405
+ set port(e) {
406
+ super.port = e, u(s(this, w), super.port);
407
+ }
408
+ get protocol() {
409
+ return r(s(this, x));
410
+ }
411
+ set protocol(e) {
412
+ super.protocol = e, u(s(this, x), super.protocol);
413
+ }
414
+ get search() {
415
+ return r(s(this, U));
416
+ }
417
+ set search(e) {
418
+ super.search = e, u(s(this, U), e), s(this, j)[I](super.searchParams);
419
+ }
420
+ get username() {
421
+ return r(s(this, L));
422
+ }
423
+ set username(e) {
424
+ super.username = e, u(s(this, L), super.username);
425
+ }
426
+ get origin() {
427
+ return r(s(this, x)), r(s(this, g)), r(s(this, w)), super.origin;
428
+ }
429
+ get searchParams() {
430
+ return s(this, j);
431
+ }
432
+ toString() {
433
+ return this.href;
434
+ }
435
+ toJSON() {
436
+ return this.href;
437
+ }
438
+ }
439
+ x = new WeakMap(), L = new WeakMap(), O = new WeakMap(), g = new WeakMap(), w = new WeakMap(), A = new WeakMap(), E = new WeakMap(), U = new WeakMap(), j = new WeakMap();
440
+ var C, F;
441
+ class _e {
442
+ /**
443
+ *
444
+ * @param {() => T} fn
445
+ * @param {(update: () => void) => void} onsubscribe
446
+ */
447
+ constructor(a, e) {
448
+ n(this, C);
449
+ n(this, F);
450
+ b(this, C, a), b(this, F, ge(e));
451
+ }
452
+ get current() {
453
+ return s(this, F).call(this), s(this, C).call(this);
454
+ }
455
+ }
456
+ C = new WeakMap(), F = new WeakMap();
457
+ const be = /\(.+\)/, Pe = /* @__PURE__ */ new Set(["all", "print", "screen", "and", "or", "not", "only"]);
458
+ class Ee extends _e {
459
+ /**
460
+ * @param {string} query A media query string
461
+ * @param {boolean} [fallback] Fallback value for the server
462
+ */
463
+ constructor(a, e) {
464
+ let t = be.test(a) || // we need to use `some` here because technically this `window.matchMedia('random,screen')` still returns true
465
+ a.split(/[\s,]+/).some((h) => Pe.has(h.trim())) ? a : `(${a})`;
466
+ const i = window.matchMedia(t);
467
+ super(
468
+ () => i.matches,
469
+ (h) => me(i, "change", h)
470
+ );
471
+ }
472
+ }
473
+ export {
474
+ Ee as MediaQuery,
475
+ he as SvelteDate,
476
+ ne as SvelteMap,
477
+ ae as SvelteSet,
478
+ Ae as SvelteURL,
479
+ ye as SvelteURLSearchParams,
480
+ ge as createSubscriber
481
+ };
@@ -165,9 +165,10 @@ const N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
165
165
  writable: v
166
166
  }, Symbol.toStringTag, { value: "Module" }));
167
167
  export {
168
+ N as a,
168
169
  H as c,
169
170
  z as g,
170
- N as i,
171
+ G as i,
171
172
  q as s,
172
173
  v as w
173
174
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nil-/xit",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "peerDependencies": {
5
5
  "svelte": "^5.7.1"
6
6
  },
package/test/Frame.svelte CHANGED
@@ -19,6 +19,7 @@
19
19
  tags: string[];
20
20
  inputs: ActionItem[];
21
21
  outputs: ActionItem[];
22
+ expects: ActionItem[];
22
23
  }
23
24
  ]
24
25
  >;
@@ -33,9 +34,7 @@
33
34
  const load = async (key: string) => {
34
35
  const v = values.json(key, [] as string[], {
35
36
  decode: decoder,
36
- encode: () => {
37
- return new Uint8Array();
38
- }
37
+ encode: () => { return new Uint8Array(); }
39
38
  });
40
39
  return Promise.all(
41
40
  get(v)
@@ -65,9 +64,9 @@
65
64
  .filter((v) => v != null)
66
65
  );
67
66
  };
68
- const [inputs, outputs] = await Promise.all([load("inputs"), load("outputs")]);
67
+ const [inputs, outputs, expects] = await Promise.all([load("inputs"), load("outputs"), load("expects")]);
69
68
  unsub();
70
- return { inputs, outputs };
69
+ return { inputs, outputs, expects };
71
70
  };
72
71
 
73
72
  const tags = values.json("tags", [] as string[], {
@@ -83,15 +82,18 @@
83
82
 
84
83
  let a_inputs = $state([] as ActionItem[]);
85
84
  let a_outputs = $state([] as ActionItem[]);
85
+ let a_expects = $state([] as ActionItem[]);
86
86
  let title = $derived(selected > $tags.length ? "" : $tags[selected]);
87
87
  const update = async (v: number) => {
88
88
  a_inputs = [];
89
89
  a_outputs = [];
90
+ a_expects = [];
90
91
  const t = $tags;
91
92
  if (0 <= v && v < t.length) {
92
- const { inputs, outputs } = await frame_info(t[v], decoder);
93
+ const { inputs, outputs, expects } = await frame_info(t[v], decoder);
93
94
  a_inputs = inputs;
94
95
  a_outputs = outputs;
96
+ a_expects = expects
95
97
  }
96
98
  };
97
99
 
@@ -105,7 +107,7 @@
105
107
  </svelte:head>
106
108
 
107
109
  <svelte:window
108
- onkeydown={(event) => {
110
+ onkeydowncapture={(event) => {
109
111
  if ((event.ctrlKey || event.metaKey) && event.key === "s") {
110
112
  if (0 <= selected && selected < $tags.length) {
111
113
  finalize($tags[selected]);
@@ -115,4 +117,4 @@
115
117
  }}
116
118
  />
117
119
 
118
- {@render load({ tags: $tags.sort(), inputs: a_inputs, outputs: a_outputs })}
120
+ {@render load({ tags: $tags.sort(), inputs: a_inputs, outputs: a_outputs, expects: a_expects })}
@@ -13,6 +13,7 @@ type Props = {
13
13
  tags: string[];
14
14
  inputs: ActionItem[];
15
15
  outputs: ActionItem[];
16
+ expects: ActionItem[];
16
17
  }
17
18
  ]>;
18
19
  };
package/test/Main.svelte CHANGED
@@ -9,16 +9,17 @@
9
9
 
10
10
  type Props = {
11
11
  children?: Snippet<[string]>,
12
- input: Snippet<[{name: string; url: string;}]>
12
+ input?: Snippet<[{name: string; url: string;}]>,
13
+ expect?: Snippet<[{name: string; url: string;}]>,
13
14
  };
14
15
 
15
- let { children, input }: Props = $props();
16
+ let { children, input, expect }: Props = $props();
16
17
 
17
18
  let selected = $state(-1);
18
19
  </script>
19
20
 
20
21
  <TestFrame decoder={config.codec.decode} bind:selected>
21
- {#snippet load({ tags, inputs, outputs })}
22
+ {#snippet load({ tags, inputs, outputs, expects })}
22
23
  <Scrollable>
23
24
  <Split vertical offset={200}>
24
25
  {#snippet side_a()}
@@ -31,16 +32,16 @@
31
32
  </Scrollable>
32
33
  {/snippet}
33
34
  {#snippet side_b()}
34
- <div class="combo">
35
- <select bind:value={selected}>
36
- {#each tags as id, i}
37
- <option value={i}>{id}</option>
38
- {/each}
39
- </select>
40
- </div>
41
- {#if 0 <= selected && selected < tags.length }
42
- {@render children?.(tags[selected])}
43
- <div style="display: flex; flex-direction: column;">
35
+ <div style="display: flex; flex-direction: column;">
36
+ <div class="combo">
37
+ <select bind:value={selected}>
38
+ {#each tags as id, i}
39
+ <option value={i}>{id}</option>
40
+ {/each}
41
+ </select>
42
+ </div>
43
+ {#if 0 <= selected && selected < tags.length }
44
+ {@render children?.(tags[selected])}
44
45
  {#each inputs as { name, url }}
45
46
  {#if input != null}
46
47
  {@render input({ name, url: url(tags[selected]) })}
@@ -48,8 +49,15 @@
48
49
  <a href={url(tags[selected])} target="_blank">{name}</a>
49
50
  {/if}
50
51
  {/each}
51
- </div>
52
- {/if}
52
+ {#each expects as { name, url }}
53
+ {#if expect != null}
54
+ {@render expect({ name, url: url(tags[selected]) })}
55
+ {:else}
56
+ <a href={url(tags[selected])} target="_blank">{name}</a>
57
+ {/if}
58
+ {/each}
59
+ {/if}
60
+ </div>
53
61
  {/snippet}
54
62
  </Split>
55
63
  </Scrollable>
@@ -1,7 +1,11 @@
1
1
  import type { Snippet } from "svelte";
2
2
  type Props = {
3
3
  children?: Snippet<[string]>;
4
- input: Snippet<[{
4
+ input?: Snippet<[{
5
+ name: string;
6
+ url: string;
7
+ }]>;
8
+ expect?: Snippet<[{
5
9
  name: string;
6
10
  url: string;
7
11
  }]>;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { xit } from "..";
3
+ const { signals } = xit();
4
+ const finalize = signals.none("finalize");
5
+ </script>
6
+
7
+ <svelte:window
8
+ onkeydowncapture={(event) => {
9
+ if ((event.ctrlKey || event.metaKey) && event.key === "s") {
10
+ finalize();
11
+ event.preventDefault();
12
+ }
13
+ }}
14
+ />
15
+
16
+ <!--
17
+ @component
18
+ This component is intended to be added inside a Frame.
19
+ Once instantiated, pressing ctrl+s will finalize the Frame.
20
+ -->
@@ -0,0 +1,22 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ /**
15
+ * This component is intended to be added inside a Frame.
16
+ * Once instantiated, pressing ctrl+s will finalize the Frame.
17
+ */
18
+ declare const Save: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type Save = InstanceType<typeof Save>;
22
+ export default Save;