@domainkit/react 0.22.1 → 0.23.0

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.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/dist/index.d.mts +132 -938
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -145,7 +145,8 @@ another account without naming a domain and lists the ones already connected, ea
145
145
  `label` the provider gave it (`null` when the provider named none), and `Connect.useDomainField` turns a text input into a
146
146
  combobox over those zones: it returns `inputProps`, `listboxProps`, and `optionProps`, moves the
147
147
  highlight with the arrow keys, and completes on Tab or Enter while keeping whatever subdomain was
148
- typed in front of the zone.
148
+ typed in front of the zone. Zones that already hold the typed name are offered on their own, deepest
149
+ first. A finished name that no connected zone holds offers nothing.
149
150
 
150
151
  ```tsx
151
152
  const { zones } = Connect.useZones();
package/dist/index.d.mts CHANGED
@@ -36,206 +36,35 @@ export type Event = Data.TaggedEnum<{
36
36
  readonly error: DomainKit.Error;
37
37
  };
38
38
  }>;
39
- export declare const Event: {
40
- readonly $is: <Tag extends "Applied" | "Cleaned" | "Connected" | "Declined" | "Detached" | "Disconnected" | "Failed">(tag: Tag) => (u: unknown) => u is Extract<{
41
- readonly _tag: "Applied";
42
- readonly domain: string;
43
- readonly receipt: Receipt.Model;
44
- }, {
45
- readonly _tag: Tag;
46
- }> | Extract<{
47
- readonly _tag: "Cleaned";
48
- readonly domain: string;
49
- readonly receipt: Receipt.Model;
50
- }, {
51
- readonly _tag: Tag;
52
- }> | Extract<{
53
- readonly _tag: "Connected";
54
- readonly domain: string;
55
- readonly connectionId: string;
56
- readonly snapshot: Transport.Snapshot;
57
- }, {
58
- readonly _tag: Tag;
59
- }> | Extract<{
60
- readonly _tag: "Declined";
61
- readonly domain: string;
62
- readonly attempt: Transport.Attempt;
63
- }, {
64
- readonly _tag: Tag;
65
- }> | Extract<{
66
- readonly _tag: "Detached";
67
- readonly domain: string;
68
- }, {
69
- readonly _tag: Tag;
70
- }> | Extract<{
71
- readonly _tag: "Disconnected";
72
- readonly domain: string;
73
- readonly connectionId: string;
74
- }, {
75
- readonly _tag: Tag;
76
- }> | Extract<{
77
- readonly _tag: "Failed";
78
- readonly domain: string;
79
- readonly error: DomainKit.Error;
80
- }, {
81
- readonly _tag: Tag;
82
- }>;
83
- readonly $match: {
84
- <Cases extends { readonly [Tag in "Applied" | "Cleaned" | "Connected" | "Declined" | "Detached" | "Disconnected" | "Failed"]: (args: Extract<{
85
- readonly _tag: "Applied";
86
- readonly domain: string;
87
- readonly receipt: Receipt.Model;
88
- } | {
89
- readonly _tag: "Cleaned";
90
- readonly domain: string;
91
- readonly receipt: Receipt.Model;
92
- } | {
93
- readonly _tag: "Connected";
94
- readonly domain: string;
95
- readonly connectionId: string;
96
- readonly snapshot: Transport.Snapshot;
97
- } | {
98
- readonly _tag: "Declined";
99
- readonly domain: string;
100
- readonly attempt: Transport.Attempt;
101
- } | {
102
- readonly _tag: "Detached";
103
- readonly domain: string;
104
- } | {
105
- readonly _tag: "Disconnected";
106
- readonly domain: string;
107
- readonly connectionId: string;
108
- } | {
109
- readonly _tag: "Failed";
110
- readonly domain: string;
111
- readonly error: DomainKit.Error;
112
- }, {
113
- readonly _tag: Tag;
114
- }>) => any; }>(cases: Cases): (value: {
115
- readonly _tag: "Applied";
116
- readonly domain: string;
117
- readonly receipt: Receipt.Model;
118
- } | {
119
- readonly _tag: "Cleaned";
120
- readonly domain: string;
121
- readonly receipt: Receipt.Model;
122
- } | {
123
- readonly _tag: "Connected";
124
- readonly domain: string;
125
- readonly connectionId: string;
126
- readonly snapshot: Transport.Snapshot;
127
- } | {
128
- readonly _tag: "Declined";
129
- readonly domain: string;
130
- readonly attempt: Transport.Attempt;
131
- } | {
132
- readonly _tag: "Detached";
133
- readonly domain: string;
134
- } | {
135
- readonly _tag: "Disconnected";
136
- readonly domain: string;
137
- readonly connectionId: string;
138
- } | {
139
- readonly _tag: "Failed";
140
- readonly domain: string;
141
- readonly error: DomainKit.Error;
142
- }) => import("effect/Unify").Unify<ReturnType<Cases["Applied" | "Cleaned" | "Connected" | "Declined" | "Detached" | "Disconnected" | "Failed"]>>;
143
- <Cases extends { readonly [Tag in "Applied" | "Cleaned" | "Connected" | "Declined" | "Detached" | "Disconnected" | "Failed"]: (args: Extract<{
144
- readonly _tag: "Applied";
145
- readonly domain: string;
146
- readonly receipt: Receipt.Model;
147
- } | {
148
- readonly _tag: "Cleaned";
149
- readonly domain: string;
150
- readonly receipt: Receipt.Model;
151
- } | {
152
- readonly _tag: "Connected";
153
- readonly domain: string;
154
- readonly connectionId: string;
155
- readonly snapshot: Transport.Snapshot;
156
- } | {
157
- readonly _tag: "Declined";
158
- readonly domain: string;
159
- readonly attempt: Transport.Attempt;
160
- } | {
161
- readonly _tag: "Detached";
162
- readonly domain: string;
163
- } | {
164
- readonly _tag: "Disconnected";
165
- readonly domain: string;
166
- readonly connectionId: string;
167
- } | {
168
- readonly _tag: "Failed";
169
- readonly domain: string;
170
- readonly error: DomainKit.Error;
171
- }, {
172
- readonly _tag: Tag;
173
- }>) => any; }>(value: {
174
- readonly _tag: "Applied";
175
- readonly domain: string;
176
- readonly receipt: Receipt.Model;
177
- } | {
178
- readonly _tag: "Cleaned";
179
- readonly domain: string;
180
- readonly receipt: Receipt.Model;
181
- } | {
182
- readonly _tag: "Connected";
183
- readonly domain: string;
184
- readonly connectionId: string;
185
- readonly snapshot: Transport.Snapshot;
186
- } | {
187
- readonly _tag: "Declined";
188
- readonly domain: string;
189
- readonly attempt: Transport.Attempt;
190
- } | {
191
- readonly _tag: "Detached";
192
- readonly domain: string;
193
- } | {
194
- readonly _tag: "Disconnected";
195
- readonly domain: string;
196
- readonly connectionId: string;
197
- } | {
198
- readonly _tag: "Failed";
199
- readonly domain: string;
200
- readonly error: DomainKit.Error;
201
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Applied" | "Cleaned" | "Connected" | "Declined" | "Detached" | "Disconnected" | "Failed"]>>;
202
- };
203
- readonly Applied: Data.TaggedEnum.ConstructorFrom<{
204
- readonly _tag: "Applied";
205
- readonly domain: string;
206
- readonly receipt: Receipt.Model;
207
- }, "_tag">;
208
- readonly Cleaned: Data.TaggedEnum.ConstructorFrom<{
209
- readonly _tag: "Cleaned";
210
- readonly domain: string;
211
- readonly receipt: Receipt.Model;
212
- }, "_tag">;
213
- readonly Connected: Data.TaggedEnum.ConstructorFrom<{
214
- readonly _tag: "Connected";
215
- readonly domain: string;
216
- readonly connectionId: string;
217
- readonly snapshot: Transport.Snapshot;
218
- }, "_tag">;
219
- readonly Declined: Data.TaggedEnum.ConstructorFrom<{
220
- readonly _tag: "Declined";
221
- readonly domain: string;
222
- readonly attempt: Transport.Attempt;
223
- }, "_tag">;
224
- readonly Detached: Data.TaggedEnum.ConstructorFrom<{
225
- readonly _tag: "Detached";
226
- readonly domain: string;
227
- }, "_tag">;
228
- readonly Disconnected: Data.TaggedEnum.ConstructorFrom<{
229
- readonly _tag: "Disconnected";
230
- readonly domain: string;
231
- readonly connectionId: string;
232
- }, "_tag">;
233
- readonly Failed: Data.TaggedEnum.ConstructorFrom<{
234
- readonly _tag: "Failed";
235
- readonly domain: string;
236
- readonly error: DomainKit.Error;
237
- }, "_tag">;
238
- };
39
+ export declare const Event: Data.TaggedEnum.Constructor<{
40
+ readonly _tag: "Applied";
41
+ readonly domain: string;
42
+ readonly receipt: Receipt.Model;
43
+ } | {
44
+ readonly _tag: "Cleaned";
45
+ readonly domain: string;
46
+ readonly receipt: Receipt.Model;
47
+ } | {
48
+ readonly _tag: "Connected";
49
+ readonly domain: string;
50
+ readonly connectionId: string;
51
+ readonly snapshot: Transport.Snapshot;
52
+ } | {
53
+ readonly _tag: "Declined";
54
+ readonly domain: string;
55
+ readonly attempt: Transport.Attempt;
56
+ } | {
57
+ readonly _tag: "Detached";
58
+ readonly domain: string;
59
+ } | {
60
+ readonly _tag: "Disconnected";
61
+ readonly domain: string;
62
+ readonly connectionId: string;
63
+ } | {
64
+ readonly _tag: "Failed";
65
+ readonly domain: string;
66
+ readonly error: DomainKit.Error;
67
+ }>;
239
68
  type Listener = (event: Event) => void;
240
69
  //#endregion
241
70
  //#region src/attempt.d.ts
@@ -267,212 +96,35 @@ type State$2 = Data.TaggedEnum<{
267
96
  readonly error: DomainKit.Error;
268
97
  };
269
98
  }>;
270
- declare const State$2: {
271
- readonly $is: <Tag extends "Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting">(tag: Tag) => (u: unknown) => u is Extract<{
272
- readonly _tag: "Applied";
273
- readonly plan: Plan.Model | null;
274
- readonly receipt: Receipt.Model;
275
- }, {
276
- readonly _tag: Tag;
277
- }> | Extract<{
278
- readonly _tag: "Applying";
279
- readonly plan: Plan.Model;
280
- readonly approval: Approval.Model;
281
- }, {
282
- readonly _tag: Tag;
283
- }> | Extract<{
284
- readonly _tag: "Approving";
285
- readonly plan: Plan.Model;
286
- }, {
287
- readonly _tag: Tag;
288
- }> | Extract<{
289
- readonly _tag: "Failure";
290
- readonly error: DomainKit.Error;
291
- }, {
292
- readonly _tag: Tag;
293
- }> | Extract<{
294
- readonly _tag: "Idle";
295
- }, {
296
- readonly _tag: Tag;
297
- }> | Extract<{
298
- readonly _tag: "Planned";
299
- readonly plan: Plan.Model;
300
- }, {
301
- readonly _tag: Tag;
302
- }> | Extract<{
303
- readonly _tag: "Planning";
304
- }, {
305
- readonly _tag: Tag;
306
- }> | Extract<{
307
- readonly _tag: "Rejected";
308
- readonly plan: Plan.Model;
309
- readonly attempt: Transport.Attempt;
310
- }, {
311
- readonly _tag: Tag;
312
- }> | Extract<{
313
- readonly _tag: "Rejecting";
314
- readonly plan: Plan.Model;
315
- }, {
316
- readonly _tag: Tag;
317
- }>;
318
- readonly $match: {
319
- <Cases extends { readonly [Tag in "Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting"]: (args: Extract<{
320
- readonly _tag: "Applied";
321
- readonly plan: Plan.Model | null;
322
- readonly receipt: Receipt.Model;
323
- } | {
324
- readonly _tag: "Applying";
325
- readonly plan: Plan.Model;
326
- readonly approval: Approval.Model;
327
- } | {
328
- readonly _tag: "Approving";
329
- readonly plan: Plan.Model;
330
- } | {
331
- readonly _tag: "Failure";
332
- readonly error: DomainKit.Error;
333
- } | {
334
- readonly _tag: "Idle";
335
- } | {
336
- readonly _tag: "Planned";
337
- readonly plan: Plan.Model;
338
- } | {
339
- readonly _tag: "Planning";
340
- } | {
341
- readonly _tag: "Rejected";
342
- readonly plan: Plan.Model;
343
- readonly attempt: Transport.Attempt;
344
- } | {
345
- readonly _tag: "Rejecting";
346
- readonly plan: Plan.Model;
347
- }, {
348
- readonly _tag: Tag;
349
- }>) => any; }>(cases: Cases): (value: {
350
- readonly _tag: "Applied";
351
- readonly plan: Plan.Model | null;
352
- readonly receipt: Receipt.Model;
353
- } | {
354
- readonly _tag: "Applying";
355
- readonly plan: Plan.Model;
356
- readonly approval: Approval.Model;
357
- } | {
358
- readonly _tag: "Approving";
359
- readonly plan: Plan.Model;
360
- } | {
361
- readonly _tag: "Failure";
362
- readonly error: DomainKit.Error;
363
- } | {
364
- readonly _tag: "Idle";
365
- } | {
366
- readonly _tag: "Planned";
367
- readonly plan: Plan.Model;
368
- } | {
369
- readonly _tag: "Planning";
370
- } | {
371
- readonly _tag: "Rejected";
372
- readonly plan: Plan.Model;
373
- readonly attempt: Transport.Attempt;
374
- } | {
375
- readonly _tag: "Rejecting";
376
- readonly plan: Plan.Model;
377
- }) => import("effect/Unify").Unify<ReturnType<Cases["Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting"]>>;
378
- <Cases extends { readonly [Tag in "Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting"]: (args: Extract<{
379
- readonly _tag: "Applied";
380
- readonly plan: Plan.Model | null;
381
- readonly receipt: Receipt.Model;
382
- } | {
383
- readonly _tag: "Applying";
384
- readonly plan: Plan.Model;
385
- readonly approval: Approval.Model;
386
- } | {
387
- readonly _tag: "Approving";
388
- readonly plan: Plan.Model;
389
- } | {
390
- readonly _tag: "Failure";
391
- readonly error: DomainKit.Error;
392
- } | {
393
- readonly _tag: "Idle";
394
- } | {
395
- readonly _tag: "Planned";
396
- readonly plan: Plan.Model;
397
- } | {
398
- readonly _tag: "Planning";
399
- } | {
400
- readonly _tag: "Rejected";
401
- readonly plan: Plan.Model;
402
- readonly attempt: Transport.Attempt;
403
- } | {
404
- readonly _tag: "Rejecting";
405
- readonly plan: Plan.Model;
406
- }, {
407
- readonly _tag: Tag;
408
- }>) => any; }>(value: {
409
- readonly _tag: "Applied";
410
- readonly plan: Plan.Model | null;
411
- readonly receipt: Receipt.Model;
412
- } | {
413
- readonly _tag: "Applying";
414
- readonly plan: Plan.Model;
415
- readonly approval: Approval.Model;
416
- } | {
417
- readonly _tag: "Approving";
418
- readonly plan: Plan.Model;
419
- } | {
420
- readonly _tag: "Failure";
421
- readonly error: DomainKit.Error;
422
- } | {
423
- readonly _tag: "Idle";
424
- } | {
425
- readonly _tag: "Planned";
426
- readonly plan: Plan.Model;
427
- } | {
428
- readonly _tag: "Planning";
429
- } | {
430
- readonly _tag: "Rejected";
431
- readonly plan: Plan.Model;
432
- readonly attempt: Transport.Attempt;
433
- } | {
434
- readonly _tag: "Rejecting";
435
- readonly plan: Plan.Model;
436
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting"]>>;
437
- };
438
- readonly Applied: Data.TaggedEnum.ConstructorFrom<{
439
- readonly _tag: "Applied";
440
- readonly plan: Plan.Model | null;
441
- readonly receipt: Receipt.Model;
442
- }, "_tag">;
443
- readonly Applying: Data.TaggedEnum.ConstructorFrom<{
444
- readonly _tag: "Applying";
445
- readonly plan: Plan.Model;
446
- readonly approval: Approval.Model;
447
- }, "_tag">;
448
- readonly Approving: Data.TaggedEnum.ConstructorFrom<{
449
- readonly _tag: "Approving";
450
- readonly plan: Plan.Model;
451
- }, "_tag">;
452
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
453
- readonly _tag: "Failure";
454
- readonly error: DomainKit.Error;
455
- }, "_tag">;
456
- readonly Idle: Data.TaggedEnum.ConstructorFrom<{
457
- readonly _tag: "Idle";
458
- }, "_tag">;
459
- readonly Planned: Data.TaggedEnum.ConstructorFrom<{
460
- readonly _tag: "Planned";
461
- readonly plan: Plan.Model;
462
- }, "_tag">;
463
- readonly Planning: Data.TaggedEnum.ConstructorFrom<{
464
- readonly _tag: "Planning";
465
- }, "_tag">;
466
- readonly Rejected: Data.TaggedEnum.ConstructorFrom<{
467
- readonly _tag: "Rejected";
468
- readonly plan: Plan.Model;
469
- readonly attempt: Transport.Attempt;
470
- }, "_tag">;
471
- readonly Rejecting: Data.TaggedEnum.ConstructorFrom<{
472
- readonly _tag: "Rejecting";
473
- readonly plan: Plan.Model;
474
- }, "_tag">;
475
- };
99
+ declare const State$2: Data.TaggedEnum.Constructor<{
100
+ readonly _tag: "Applied";
101
+ readonly plan: Plan.Model | null;
102
+ readonly receipt: Receipt.Model;
103
+ } | {
104
+ readonly _tag: "Applying";
105
+ readonly plan: Plan.Model;
106
+ readonly approval: Approval.Model;
107
+ } | {
108
+ readonly _tag: "Approving";
109
+ readonly plan: Plan.Model;
110
+ } | {
111
+ readonly _tag: "Failure";
112
+ readonly error: DomainKit.Error;
113
+ } | {
114
+ readonly _tag: "Idle";
115
+ } | {
116
+ readonly _tag: "Planned";
117
+ readonly plan: Plan.Model;
118
+ } | {
119
+ readonly _tag: "Planning";
120
+ } | {
121
+ readonly _tag: "Rejected";
122
+ readonly plan: Plan.Model;
123
+ readonly attempt: Transport.Attempt;
124
+ } | {
125
+ readonly _tag: "Rejecting";
126
+ readonly plan: Plan.Model;
127
+ }>;
476
128
  interface Controller$2 {
477
129
  readonly state: State$2;
478
130
  /** Build a plan. The plan itself rides on the state, from `Planned` through `Applied`. */
@@ -531,86 +183,17 @@ type ZonesState = Data.TaggedEnum<{
531
183
  readonly error: DomainKit.Error;
532
184
  };
533
185
  }>;
534
- declare const ZonesState: {
535
- readonly $is: <Tag extends "Failure" | "Loading" | "Ready">(tag: Tag) => (u: unknown) => u is Extract<{
536
- readonly _tag: "Failure";
537
- readonly error: DomainKit.Error;
538
- }, {
539
- readonly _tag: Tag;
540
- }> | Extract<{
541
- readonly _tag: "Loading";
542
- }, {
543
- readonly _tag: Tag;
544
- }> | Extract<{
545
- readonly _tag: "Ready";
546
- readonly zones: ReadonlyArray<Zone>;
547
- readonly connections: ReadonlyArray<Account>;
548
- readonly providers: ReadonlyArray<Descriptor>;
549
- }, {
550
- readonly _tag: Tag;
551
- }>;
552
- readonly $match: {
553
- <Cases extends { readonly [Tag in "Failure" | "Loading" | "Ready"]: (args: Extract<{
554
- readonly _tag: "Failure";
555
- readonly error: DomainKit.Error;
556
- } | {
557
- readonly _tag: "Loading";
558
- } | {
559
- readonly _tag: "Ready";
560
- readonly zones: ReadonlyArray<Zone>;
561
- readonly connections: ReadonlyArray<Account>;
562
- readonly providers: ReadonlyArray<Descriptor>;
563
- }, {
564
- readonly _tag: Tag;
565
- }>) => any; }>(cases: Cases): (value: {
566
- readonly _tag: "Failure";
567
- readonly error: DomainKit.Error;
568
- } | {
569
- readonly _tag: "Loading";
570
- } | {
571
- readonly _tag: "Ready";
572
- readonly zones: ReadonlyArray<Zone>;
573
- readonly connections: ReadonlyArray<Account>;
574
- readonly providers: ReadonlyArray<Descriptor>;
575
- }) => import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Loading" | "Ready"]>>;
576
- <Cases extends { readonly [Tag in "Failure" | "Loading" | "Ready"]: (args: Extract<{
577
- readonly _tag: "Failure";
578
- readonly error: DomainKit.Error;
579
- } | {
580
- readonly _tag: "Loading";
581
- } | {
582
- readonly _tag: "Ready";
583
- readonly zones: ReadonlyArray<Zone>;
584
- readonly connections: ReadonlyArray<Account>;
585
- readonly providers: ReadonlyArray<Descriptor>;
586
- }, {
587
- readonly _tag: Tag;
588
- }>) => any; }>(value: {
589
- readonly _tag: "Failure";
590
- readonly error: DomainKit.Error;
591
- } | {
592
- readonly _tag: "Loading";
593
- } | {
594
- readonly _tag: "Ready";
595
- readonly zones: ReadonlyArray<Zone>;
596
- readonly connections: ReadonlyArray<Account>;
597
- readonly providers: ReadonlyArray<Descriptor>;
598
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Loading" | "Ready"]>>;
599
- };
600
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
601
- readonly _tag: "Failure";
602
- readonly error: DomainKit.Error;
603
- }, "_tag">;
604
- readonly Loading: Data.TaggedEnum.ConstructorFrom<{
605
- readonly _tag: "Loading";
606
- }, "_tag">;
607
- readonly Ready: Data.TaggedEnum.ConstructorFrom<{
608
- readonly _tag: "Ready";
609
- readonly zones: ReadonlyArray<Zone>;
610
- readonly connections: ReadonlyArray<Account>;
611
- readonly providers: ReadonlyArray<Descriptor>;
612
- }, "_tag">;
613
- };
186
+ declare const ZonesState: Data.TaggedEnum.Constructor<{
187
+ readonly _tag: "Failure";
188
+ readonly error: DomainKit.Error;
189
+ } | {
190
+ readonly _tag: "Loading";
191
+ } | {
192
+ readonly _tag: "Ready";
193
+ readonly zones: ReadonlyArray<Zone>;
194
+ readonly connections: ReadonlyArray<Account>;
195
+ readonly providers: ReadonlyArray<Descriptor>;
196
+ }>;
614
197
  interface ZonesController {
615
198
  readonly state: ZonesState;
616
199
  readonly zones: ReadonlyArray<Zone>;
@@ -647,110 +230,20 @@ type AccountsState = Data.TaggedEnum<{
647
230
  readonly error: DomainKit.Error;
648
231
  };
649
232
  }>;
650
- declare const AccountsState: {
651
- readonly $is: <Tag extends "Failure" | "Loading" | "Ready" | "Redirecting" | "Submitting">(tag: Tag) => (u: unknown) => u is Extract<{
652
- readonly _tag: "Failure";
653
- readonly error: DomainKit.Error;
654
- }, {
655
- readonly _tag: Tag;
656
- }> | Extract<{
657
- readonly _tag: "Loading";
658
- }, {
659
- readonly _tag: Tag;
660
- }> | Extract<{
661
- readonly _tag: "Ready";
662
- }, {
663
- readonly _tag: Tag;
664
- }> | Extract<{
665
- readonly _tag: "Redirecting";
666
- readonly url: string;
667
- }, {
668
- readonly _tag: Tag;
669
- }> | Extract<{
670
- readonly _tag: "Submitting";
671
- readonly provider: string;
672
- }, {
673
- readonly _tag: Tag;
674
- }>;
675
- readonly $match: {
676
- <Cases extends { readonly [Tag in "Failure" | "Loading" | "Ready" | "Redirecting" | "Submitting"]: (args: Extract<{
677
- readonly _tag: "Failure";
678
- readonly error: DomainKit.Error;
679
- } | {
680
- readonly _tag: "Loading";
681
- } | {
682
- readonly _tag: "Ready";
683
- } | {
684
- readonly _tag: "Redirecting";
685
- readonly url: string;
686
- } | {
687
- readonly _tag: "Submitting";
688
- readonly provider: string;
689
- }, {
690
- readonly _tag: Tag;
691
- }>) => any; }>(cases: Cases): (value: {
692
- readonly _tag: "Failure";
693
- readonly error: DomainKit.Error;
694
- } | {
695
- readonly _tag: "Loading";
696
- } | {
697
- readonly _tag: "Ready";
698
- } | {
699
- readonly _tag: "Redirecting";
700
- readonly url: string;
701
- } | {
702
- readonly _tag: "Submitting";
703
- readonly provider: string;
704
- }) => import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Loading" | "Ready" | "Redirecting" | "Submitting"]>>;
705
- <Cases extends { readonly [Tag in "Failure" | "Loading" | "Ready" | "Redirecting" | "Submitting"]: (args: Extract<{
706
- readonly _tag: "Failure";
707
- readonly error: DomainKit.Error;
708
- } | {
709
- readonly _tag: "Loading";
710
- } | {
711
- readonly _tag: "Ready";
712
- } | {
713
- readonly _tag: "Redirecting";
714
- readonly url: string;
715
- } | {
716
- readonly _tag: "Submitting";
717
- readonly provider: string;
718
- }, {
719
- readonly _tag: Tag;
720
- }>) => any; }>(value: {
721
- readonly _tag: "Failure";
722
- readonly error: DomainKit.Error;
723
- } | {
724
- readonly _tag: "Loading";
725
- } | {
726
- readonly _tag: "Ready";
727
- } | {
728
- readonly _tag: "Redirecting";
729
- readonly url: string;
730
- } | {
731
- readonly _tag: "Submitting";
732
- readonly provider: string;
733
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Loading" | "Ready" | "Redirecting" | "Submitting"]>>;
734
- };
735
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
736
- readonly _tag: "Failure";
737
- readonly error: DomainKit.Error;
738
- }, "_tag">;
739
- readonly Loading: Data.TaggedEnum.ConstructorFrom<{
740
- readonly _tag: "Loading";
741
- }, "_tag">;
742
- readonly Ready: Data.TaggedEnum.ConstructorFrom<{
743
- readonly _tag: "Ready";
744
- }, "_tag">;
745
- readonly Redirecting: Data.TaggedEnum.ConstructorFrom<{
746
- readonly _tag: "Redirecting";
747
- readonly url: string;
748
- }, "_tag">;
749
- readonly Submitting: Data.TaggedEnum.ConstructorFrom<{
750
- readonly _tag: "Submitting";
751
- readonly provider: string;
752
- }, "_tag">;
753
- };
233
+ declare const AccountsState: Data.TaggedEnum.Constructor<{
234
+ readonly _tag: "Failure";
235
+ readonly error: DomainKit.Error;
236
+ } | {
237
+ readonly _tag: "Loading";
238
+ } | {
239
+ readonly _tag: "Ready";
240
+ } | {
241
+ readonly _tag: "Redirecting";
242
+ readonly url: string;
243
+ } | {
244
+ readonly _tag: "Submitting";
245
+ readonly provider: string;
246
+ }>;
754
247
  interface AccountsController {
755
248
  readonly state: AccountsState;
756
249
  readonly zones: ReadonlyArray<Zone>;
@@ -925,227 +418,38 @@ type State$1 = Data.TaggedEnum<{
925
418
  readonly attempt: Attempt | null;
926
419
  };
927
420
  }>;
928
- declare const State$1: {
929
- readonly $is: <Tag extends "Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting">(tag: Tag) => (u: unknown) => u is Extract<{
930
- readonly _tag: "Connected";
931
- readonly snapshot: Snapshot;
932
- }, {
933
- readonly _tag: Tag;
934
- }> | Extract<{
935
- readonly _tag: "Disconnected";
936
- readonly snapshot: Snapshot;
937
- readonly discovery: Discovery | null;
938
- }, {
939
- readonly _tag: Tag;
940
- }> | Extract<{
941
- readonly _tag: "Failure";
942
- readonly error: DomainKit.Error;
943
- readonly snapshot: Snapshot | null;
944
- readonly discovery: Discovery | null;
945
- readonly attempt: Attempt | null;
946
- }, {
947
- readonly _tag: Tag;
948
- }> | Extract<{
949
- readonly _tag: "Loading";
950
- readonly snapshot: Snapshot | null;
951
- }, {
952
- readonly _tag: Tag;
953
- }> | Extract<{
954
- readonly _tag: "Reconnect";
955
- readonly snapshot: Snapshot;
956
- }, {
957
- readonly _tag: Tag;
958
- }> | Extract<{
959
- readonly _tag: "Redirecting";
960
- readonly url: string;
961
- }, {
962
- readonly _tag: Tag;
963
- }> | Extract<{
964
- readonly _tag: "SelectionRequired";
965
- readonly snapshot: Snapshot | null;
966
- readonly connectionId: string;
967
- readonly candidates: ReadonlyArray<Candidate>;
968
- }, {
969
- readonly _tag: Tag;
970
- }> | Extract<{
971
- readonly _tag: "Submitting";
972
- readonly snapshot: Snapshot | null;
973
- readonly discovery: Discovery | null;
974
- }, {
975
- readonly _tag: Tag;
976
- }>;
977
- readonly $match: {
978
- <Cases extends { readonly [Tag in "Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]: (args: Extract<{
979
- readonly _tag: "Connected";
980
- readonly snapshot: Snapshot;
981
- } | {
982
- readonly _tag: "Disconnected";
983
- readonly snapshot: Snapshot;
984
- readonly discovery: Discovery | null;
985
- } | {
986
- readonly _tag: "Failure";
987
- readonly error: DomainKit.Error;
988
- readonly snapshot: Snapshot | null;
989
- readonly discovery: Discovery | null;
990
- readonly attempt: Attempt | null;
991
- } | {
992
- readonly _tag: "Loading";
993
- readonly snapshot: Snapshot | null;
994
- } | {
995
- readonly _tag: "Reconnect";
996
- readonly snapshot: Snapshot;
997
- } | {
998
- readonly _tag: "Redirecting";
999
- readonly url: string;
1000
- } | {
1001
- readonly _tag: "SelectionRequired";
1002
- readonly snapshot: Snapshot | null;
1003
- readonly connectionId: string;
1004
- readonly candidates: ReadonlyArray<Candidate>;
1005
- } | {
1006
- readonly _tag: "Submitting";
1007
- readonly snapshot: Snapshot | null;
1008
- readonly discovery: Discovery | null;
1009
- }, {
1010
- readonly _tag: Tag;
1011
- }>) => any; }>(cases: Cases): (value: {
1012
- readonly _tag: "Connected";
1013
- readonly snapshot: Snapshot;
1014
- } | {
1015
- readonly _tag: "Disconnected";
1016
- readonly snapshot: Snapshot;
1017
- readonly discovery: Discovery | null;
1018
- } | {
1019
- readonly _tag: "Failure";
1020
- readonly error: DomainKit.Error;
1021
- readonly snapshot: Snapshot | null;
1022
- readonly discovery: Discovery | null;
1023
- readonly attempt: Attempt | null;
1024
- } | {
1025
- readonly _tag: "Loading";
1026
- readonly snapshot: Snapshot | null;
1027
- } | {
1028
- readonly _tag: "Reconnect";
1029
- readonly snapshot: Snapshot;
1030
- } | {
1031
- readonly _tag: "Redirecting";
1032
- readonly url: string;
1033
- } | {
1034
- readonly _tag: "SelectionRequired";
1035
- readonly snapshot: Snapshot | null;
1036
- readonly connectionId: string;
1037
- readonly candidates: ReadonlyArray<Candidate>;
1038
- } | {
1039
- readonly _tag: "Submitting";
1040
- readonly snapshot: Snapshot | null;
1041
- readonly discovery: Discovery | null;
1042
- }) => import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
1043
- <Cases extends { readonly [Tag in "Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]: (args: Extract<{
1044
- readonly _tag: "Connected";
1045
- readonly snapshot: Snapshot;
1046
- } | {
1047
- readonly _tag: "Disconnected";
1048
- readonly snapshot: Snapshot;
1049
- readonly discovery: Discovery | null;
1050
- } | {
1051
- readonly _tag: "Failure";
1052
- readonly error: DomainKit.Error;
1053
- readonly snapshot: Snapshot | null;
1054
- readonly discovery: Discovery | null;
1055
- readonly attempt: Attempt | null;
1056
- } | {
1057
- readonly _tag: "Loading";
1058
- readonly snapshot: Snapshot | null;
1059
- } | {
1060
- readonly _tag: "Reconnect";
1061
- readonly snapshot: Snapshot;
1062
- } | {
1063
- readonly _tag: "Redirecting";
1064
- readonly url: string;
1065
- } | {
1066
- readonly _tag: "SelectionRequired";
1067
- readonly snapshot: Snapshot | null;
1068
- readonly connectionId: string;
1069
- readonly candidates: ReadonlyArray<Candidate>;
1070
- } | {
1071
- readonly _tag: "Submitting";
1072
- readonly snapshot: Snapshot | null;
1073
- readonly discovery: Discovery | null;
1074
- }, {
1075
- readonly _tag: Tag;
1076
- }>) => any; }>(value: {
1077
- readonly _tag: "Connected";
1078
- readonly snapshot: Snapshot;
1079
- } | {
1080
- readonly _tag: "Disconnected";
1081
- readonly snapshot: Snapshot;
1082
- readonly discovery: Discovery | null;
1083
- } | {
1084
- readonly _tag: "Failure";
1085
- readonly error: DomainKit.Error;
1086
- readonly snapshot: Snapshot | null;
1087
- readonly discovery: Discovery | null;
1088
- readonly attempt: Attempt | null;
1089
- } | {
1090
- readonly _tag: "Loading";
1091
- readonly snapshot: Snapshot | null;
1092
- } | {
1093
- readonly _tag: "Reconnect";
1094
- readonly snapshot: Snapshot;
1095
- } | {
1096
- readonly _tag: "Redirecting";
1097
- readonly url: string;
1098
- } | {
1099
- readonly _tag: "SelectionRequired";
1100
- readonly snapshot: Snapshot | null;
1101
- readonly connectionId: string;
1102
- readonly candidates: ReadonlyArray<Candidate>;
1103
- } | {
1104
- readonly _tag: "Submitting";
1105
- readonly snapshot: Snapshot | null;
1106
- readonly discovery: Discovery | null;
1107
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
1108
- };
1109
- readonly Connected: Data.TaggedEnum.ConstructorFrom<{
1110
- readonly _tag: "Connected";
1111
- readonly snapshot: Snapshot;
1112
- }, "_tag">;
1113
- readonly Disconnected: Data.TaggedEnum.ConstructorFrom<{
1114
- readonly _tag: "Disconnected";
1115
- readonly snapshot: Snapshot;
1116
- readonly discovery: Discovery | null;
1117
- }, "_tag">;
1118
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
1119
- readonly _tag: "Failure";
1120
- readonly error: DomainKit.Error;
1121
- readonly snapshot: Snapshot | null;
1122
- readonly discovery: Discovery | null;
1123
- readonly attempt: Attempt | null;
1124
- }, "_tag">;
1125
- readonly Loading: Data.TaggedEnum.ConstructorFrom<{
1126
- readonly _tag: "Loading";
1127
- readonly snapshot: Snapshot | null;
1128
- }, "_tag">;
1129
- readonly Reconnect: Data.TaggedEnum.ConstructorFrom<{
1130
- readonly _tag: "Reconnect";
1131
- readonly snapshot: Snapshot;
1132
- }, "_tag">;
1133
- readonly Redirecting: Data.TaggedEnum.ConstructorFrom<{
1134
- readonly _tag: "Redirecting";
1135
- readonly url: string;
1136
- }, "_tag">;
1137
- readonly SelectionRequired: Data.TaggedEnum.ConstructorFrom<{
1138
- readonly _tag: "SelectionRequired";
1139
- readonly snapshot: Snapshot | null;
1140
- readonly connectionId: string;
1141
- readonly candidates: ReadonlyArray<Candidate>;
1142
- }, "_tag">;
1143
- readonly Submitting: Data.TaggedEnum.ConstructorFrom<{
1144
- readonly _tag: "Submitting";
1145
- readonly snapshot: Snapshot | null;
1146
- readonly discovery: Discovery | null;
1147
- }, "_tag">;
1148
- };
421
+ declare const State$1: Data.TaggedEnum.Constructor<{
422
+ readonly _tag: "Connected";
423
+ readonly snapshot: Snapshot;
424
+ } | {
425
+ readonly _tag: "Disconnected";
426
+ readonly snapshot: Snapshot;
427
+ readonly discovery: Discovery | null;
428
+ } | {
429
+ readonly _tag: "Failure";
430
+ readonly error: DomainKit.Error;
431
+ readonly snapshot: Snapshot | null;
432
+ readonly discovery: Discovery | null;
433
+ readonly attempt: Attempt | null;
434
+ } | {
435
+ readonly _tag: "Loading";
436
+ readonly snapshot: Snapshot | null;
437
+ } | {
438
+ readonly _tag: "Reconnect";
439
+ readonly snapshot: Snapshot;
440
+ } | {
441
+ readonly _tag: "Redirecting";
442
+ readonly url: string;
443
+ } | {
444
+ readonly _tag: "SelectionRequired";
445
+ readonly snapshot: Snapshot | null;
446
+ readonly connectionId: string;
447
+ readonly candidates: ReadonlyArray<Candidate>;
448
+ } | {
449
+ readonly _tag: "Submitting";
450
+ readonly snapshot: Snapshot | null;
451
+ readonly discovery: Discovery | null;
452
+ }>;
1149
453
  /** Which provider and method the failed command was for, so the form can answer beside it. */
1150
454
  interface Attempt {
1151
455
  readonly provider: string;
@@ -1351,101 +655,19 @@ type State = Data.TaggedEnum<{
1351
655
  readonly readiness: Readiness$1 | null;
1352
656
  };
1353
657
  }>;
1354
- declare const State: {
1355
- readonly $is: <Tag extends "Failure" | "Idle" | "Observed" | "Observing">(tag: Tag) => (u: unknown) => u is Extract<{
1356
- readonly _tag: "Failure";
1357
- readonly error: DomainKit.Error;
1358
- readonly readiness: Readiness$1 | null;
1359
- }, {
1360
- readonly _tag: Tag;
1361
- }> | Extract<{
1362
- readonly _tag: "Idle";
1363
- }, {
1364
- readonly _tag: Tag;
1365
- }> | Extract<{
1366
- readonly _tag: "Observed";
1367
- readonly readiness: Readiness$1;
1368
- }, {
1369
- readonly _tag: Tag;
1370
- }> | Extract<{
1371
- readonly _tag: "Observing";
1372
- readonly readiness: Readiness$1 | null;
1373
- }, {
1374
- readonly _tag: Tag;
1375
- }>;
1376
- readonly $match: {
1377
- <Cases extends { readonly [Tag in "Failure" | "Idle" | "Observed" | "Observing"]: (args: Extract<{
1378
- readonly _tag: "Failure";
1379
- readonly error: DomainKit.Error;
1380
- readonly readiness: Readiness$1 | null;
1381
- } | {
1382
- readonly _tag: "Idle";
1383
- } | {
1384
- readonly _tag: "Observed";
1385
- readonly readiness: Readiness$1;
1386
- } | {
1387
- readonly _tag: "Observing";
1388
- readonly readiness: Readiness$1 | null;
1389
- }, {
1390
- readonly _tag: Tag;
1391
- }>) => any; }>(cases: Cases): (value: {
1392
- readonly _tag: "Failure";
1393
- readonly error: DomainKit.Error;
1394
- readonly readiness: Readiness$1 | null;
1395
- } | {
1396
- readonly _tag: "Idle";
1397
- } | {
1398
- readonly _tag: "Observed";
1399
- readonly readiness: Readiness$1;
1400
- } | {
1401
- readonly _tag: "Observing";
1402
- readonly readiness: Readiness$1 | null;
1403
- }) => import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Idle" | "Observed" | "Observing"]>>;
1404
- <Cases extends { readonly [Tag in "Failure" | "Idle" | "Observed" | "Observing"]: (args: Extract<{
1405
- readonly _tag: "Failure";
1406
- readonly error: DomainKit.Error;
1407
- readonly readiness: Readiness$1 | null;
1408
- } | {
1409
- readonly _tag: "Idle";
1410
- } | {
1411
- readonly _tag: "Observed";
1412
- readonly readiness: Readiness$1;
1413
- } | {
1414
- readonly _tag: "Observing";
1415
- readonly readiness: Readiness$1 | null;
1416
- }, {
1417
- readonly _tag: Tag;
1418
- }>) => any; }>(value: {
1419
- readonly _tag: "Failure";
1420
- readonly error: DomainKit.Error;
1421
- readonly readiness: Readiness$1 | null;
1422
- } | {
1423
- readonly _tag: "Idle";
1424
- } | {
1425
- readonly _tag: "Observed";
1426
- readonly readiness: Readiness$1;
1427
- } | {
1428
- readonly _tag: "Observing";
1429
- readonly readiness: Readiness$1 | null;
1430
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Idle" | "Observed" | "Observing"]>>;
1431
- };
1432
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
1433
- readonly _tag: "Failure";
1434
- readonly error: DomainKit.Error;
1435
- readonly readiness: Readiness$1 | null;
1436
- }, "_tag">;
1437
- readonly Idle: Data.TaggedEnum.ConstructorFrom<{
1438
- readonly _tag: "Idle";
1439
- }, "_tag">;
1440
- readonly Observed: Data.TaggedEnum.ConstructorFrom<{
1441
- readonly _tag: "Observed";
1442
- readonly readiness: Readiness$1;
1443
- }, "_tag">;
1444
- readonly Observing: Data.TaggedEnum.ConstructorFrom<{
1445
- readonly _tag: "Observing";
1446
- readonly readiness: Readiness$1 | null;
1447
- }, "_tag">;
1448
- };
658
+ declare const State: Data.TaggedEnum.Constructor<{
659
+ readonly _tag: "Failure";
660
+ readonly error: DomainKit.Error;
661
+ readonly readiness: Readiness$1 | null;
662
+ } | {
663
+ readonly _tag: "Idle";
664
+ } | {
665
+ readonly _tag: "Observed";
666
+ readonly readiness: Readiness$1;
667
+ } | {
668
+ readonly _tag: "Observing";
669
+ readonly readiness: Readiness$1 | null;
670
+ }>;
1449
671
  interface Controller {
1450
672
  readonly state: State;
1451
673
  /** The latest readiness, kept while a new observation runs. */
@@ -1913,38 +1135,10 @@ export type Failure = Data.TaggedEnum<{
1913
1135
  readonly error: DomainKit.Error;
1914
1136
  };
1915
1137
  }>;
1916
- export declare const Failure: {
1917
- readonly $is: <Tag extends "Failure">(tag: Tag) => (u: unknown) => u is Extract<{
1918
- readonly _tag: "Failure";
1919
- readonly error: DomainKit.Error;
1920
- }, {
1921
- readonly _tag: Tag;
1922
- }>;
1923
- readonly $match: {
1924
- <Cases extends { readonly [Tag in "Failure"]: (args: Extract<{
1925
- readonly _tag: "Failure";
1926
- readonly error: DomainKit.Error;
1927
- }, {
1928
- readonly _tag: Tag;
1929
- }>) => any; }>(cases: Cases): (value: {
1930
- readonly _tag: "Failure";
1931
- readonly error: DomainKit.Error;
1932
- }) => import("effect/Unify").Unify<ReturnType<Cases["Failure"]>>;
1933
- <Cases extends { readonly [Tag in "Failure"]: (args: Extract<{
1934
- readonly _tag: "Failure";
1935
- readonly error: DomainKit.Error;
1936
- }, {
1937
- readonly _tag: Tag;
1938
- }>) => any; }>(value: {
1939
- readonly _tag: "Failure";
1940
- readonly error: DomainKit.Error;
1941
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Failure"]>>;
1942
- };
1943
- readonly Failure: Data.TaggedEnum.ConstructorFrom<{
1944
- readonly _tag: "Failure";
1945
- readonly error: DomainKit.Error;
1946
- }, "_tag">;
1947
- };
1138
+ export declare const Failure: Data.TaggedEnum.Constructor<{
1139
+ readonly _tag: "Failure";
1140
+ readonly error: DomainKit.Error;
1141
+ }>;
1948
1142
  //#endregion
1949
1143
  export { cleanup_d_exports as Cleanup, connect_d_exports as Connect, domain_d_exports as Domain, domain_kit_d_exports as DomainKit, type Listener, messages_d_exports as Messages, outcome_d_exports as Outcome, provision_d_exports as Provision, records_d_exports as Records, testing_d_exports as Testing, verify_d_exports as Verify };
1950
1144
  //# sourceMappingURL=index.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domainkit/react",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "description": "Headless React hooks for custom-domain setup",
5
5
  "keywords": [
6
6
  "custom-domains",
@@ -43,14 +43,14 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "domainkit": "^0.22.0"
46
+ "domainkit": "^0.23.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@testing-library/react": "16.3.3",
50
50
  "@testing-library/user-event": "14.6.7",
51
51
  "@types/react": "19.3.0",
52
52
  "@types/react-dom": "19.3.0",
53
- "effect": "4.0.2",
53
+ "effect": "4.1.2",
54
54
  "jsdom": "30.1.2",
55
55
  "react": "19.3.0",
56
56
  "react-dom": "19.3.0",
@@ -60,7 +60,7 @@
60
60
  "vitest": "5.0.3"
61
61
  },
62
62
  "peerDependencies": {
63
- "effect": ">=4.0.0 <5.0.0",
63
+ "effect": ">=4.1.2 <5.0.0",
64
64
  "react": ">=19.0.0 <20.0.0",
65
65
  "react-dom": ">=19.0.0 <20.0.0"
66
66
  },