@domainkit/react 0.10.0 → 0.12.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.
- package/README.md +100 -101
- package/dist/index.d.mts +612 -466
- package/dist/index.mjs +814 -1751
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -12
- package/dist/styles.css +0 -1530
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Approval, DnsRecord, DomainKit, Plan, Reason, Receipt, Storage } from "domainkit";
|
|
2
2
|
import "effect/Effect";
|
|
3
|
-
import {
|
|
3
|
+
import { AriaAttributes, FocusEventHandler, FormEventHandler, KeyboardEventHandler, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
4
4
|
import * as Data from "effect/Data";
|
|
5
5
|
import { Transport } from "domainkit/client";
|
|
6
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
7
6
|
import { Testing } from "domainkit/testing";
|
|
8
7
|
//#region src/events.d.ts
|
|
9
8
|
/** What a customer finished doing, for host notifications, analytics, and audit trails. */
|
|
@@ -240,7 +239,7 @@ declare const Event: {
|
|
|
240
239
|
type Listener = (event: Event) => void;
|
|
241
240
|
//#endregion
|
|
242
241
|
//#region src/attempt.d.ts
|
|
243
|
-
type State$
|
|
242
|
+
type State$2 = Data.TaggedEnum<{
|
|
244
243
|
Idle: {};
|
|
245
244
|
Planning: {};
|
|
246
245
|
Planned: {
|
|
@@ -268,7 +267,7 @@ type State$3 = Data.TaggedEnum<{
|
|
|
268
267
|
readonly error: DomainKit.Error;
|
|
269
268
|
};
|
|
270
269
|
}>;
|
|
271
|
-
declare const State$
|
|
270
|
+
declare const State$2: {
|
|
272
271
|
readonly $is: <Tag extends "Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
273
272
|
readonly _tag: "Applied";
|
|
274
273
|
readonly plan: Plan.Model | null;
|
|
@@ -475,7 +474,7 @@ declare const State$3: {
|
|
|
475
474
|
}, "_tag">;
|
|
476
475
|
};
|
|
477
476
|
interface Controller$2 {
|
|
478
|
-
readonly state: State$
|
|
477
|
+
readonly state: State$2;
|
|
479
478
|
/** Build a plan. The plan itself rides on the state, from `Planned` through `Applied`. */
|
|
480
479
|
readonly plan: () => void;
|
|
481
480
|
/** Authorize the digest and apply it. Pass `operationIds` to approve part of the plan. */
|
|
@@ -488,166 +487,386 @@ interface Controller$2 {
|
|
|
488
487
|
readonly retry: () => void;
|
|
489
488
|
readonly reset: () => void;
|
|
490
489
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
type ClassName<State> = string | ((state: State) => string | undefined);
|
|
494
|
-
type Style<State> = CSSProperties | ((state: State) => CSSProperties | undefined);
|
|
495
|
-
/**
|
|
496
|
-
* What every rendered part accepts: the element's own props, a state-aware `className` and
|
|
497
|
-
* `style`, and Base UI's `render` for replacing the element outright.
|
|
498
|
-
*/
|
|
499
|
-
type PartProps<Tag extends ElementType = "div", State extends Record<string, unknown> = Record<string, unknown>> = Omit<useRender.ElementProps<Tag>, "className" | "style"> & {
|
|
500
|
-
readonly className?: ClassName<State>;
|
|
501
|
-
readonly render?: useRender.RenderProp<State>;
|
|
502
|
-
readonly style?: Style<State>;
|
|
503
|
-
};
|
|
504
|
-
declare namespace outcome_d_exports {
|
|
505
|
-
export { Composition, Content, ContentProps, Description, DescriptionProps, Header$1 as Header, HeaderProps, Layout, Media, MediaProps, Provider, Root$7 as Root, RootProps$7 as RootProps, State$2 as State, Title, TitleProps, Tone, Value$1 as Value, useOutcome };
|
|
506
|
-
}
|
|
507
|
-
/** How the outcome reads: a problem, a caution, or a step that went through. */
|
|
508
|
-
type Tone = "danger" | "success" | "warning";
|
|
509
|
-
/** `card` is the panel a flow shows on its own; `inline` sits under a field or in a busy row. */
|
|
510
|
-
type Layout = "card" | "inline";
|
|
511
|
-
/** What a flow resolved for the outcome its parts render. */
|
|
512
|
-
interface Value$1 {
|
|
513
|
-
readonly tone: Tone;
|
|
514
|
-
readonly layout: Layout;
|
|
515
|
-
readonly title: string;
|
|
516
|
-
readonly description: string;
|
|
517
|
-
/** The retry the flow allows, or `null` when it allows none. */
|
|
518
|
-
readonly retry: (() => void) | null;
|
|
519
|
-
/** The part name the flow's retry carries, so a host's selectors keep working. */
|
|
520
|
-
readonly retryPart: string;
|
|
521
|
-
}
|
|
522
|
-
/** What the surrounding flow resolved, for a part of your own inside `X.Outcome`. */
|
|
523
|
-
declare function useOutcome(): Value$1;
|
|
524
|
-
/** Binds a resolved outcome to the parts below it. Flows render this; hosts rarely do. */
|
|
525
|
-
declare function Provider({ children, value }: {
|
|
526
|
-
readonly children: ReactNode;
|
|
527
|
-
readonly value: Value$1;
|
|
528
|
-
}): ReactElement;
|
|
529
|
-
interface State$2 extends Record<string, unknown> {
|
|
530
|
-
readonly tone: Tone;
|
|
531
|
-
readonly layout: Layout;
|
|
532
|
-
}
|
|
533
|
-
interface RootProps$7 extends PartProps<"div", State$2> {
|
|
534
|
-
readonly tone?: Tone;
|
|
535
|
-
readonly layout?: Layout;
|
|
536
|
-
}
|
|
490
|
+
/** The plan an attempt holds, whatever step it is on; `null` before there is one. */
|
|
491
|
+
declare const planOf: (state: State$2) => Plan.Model | null;
|
|
537
492
|
/**
|
|
538
|
-
* The
|
|
539
|
-
*
|
|
540
|
-
* root's own attributes.
|
|
493
|
+
* The plan still awaiting its apply, which is what a row of records reports; `null` once one has
|
|
494
|
+
* landed, because from then on an observation answers instead.
|
|
541
495
|
*/
|
|
542
|
-
declare
|
|
543
|
-
interface HeaderProps extends PartProps<"div", State$2> {}
|
|
544
|
-
/** Media, title, and description together, so the action below them can move on its own. */
|
|
545
|
-
declare function Header$1(props: HeaderProps): ReactElement;
|
|
546
|
-
interface MediaProps extends PartProps<"div", State$2> {
|
|
547
|
-
/** `icon` frames the glyph the way shadcn's `EmptyMedia` does; `default` draws it bare. */
|
|
548
|
-
readonly variant?: "default" | "icon";
|
|
549
|
-
}
|
|
550
|
-
/** The glyph for the tone. Children replace it; `icons` on `DomainKit.Root` replaces the set. */
|
|
551
|
-
declare function Media({ variant, ...props }: MediaProps): ReactElement;
|
|
552
|
-
interface TitleProps extends PartProps<"div", State$2> {}
|
|
553
|
-
/** The heading from the catalog. Children win, for a host that words it itself. */
|
|
554
|
-
declare function Title(props: TitleProps): ReactElement;
|
|
555
|
-
interface DescriptionProps extends PartProps<"p", State$2> {}
|
|
556
|
-
/** What to do about it, from the catalog. */
|
|
557
|
-
declare function Description(props: DescriptionProps): ReactElement;
|
|
558
|
-
interface ContentProps extends PartProps<"div", State$2> {}
|
|
559
|
-
/**
|
|
560
|
-
* The actions under the header. Without children it is the flow's retry, and a flow that allows
|
|
561
|
-
* none renders nothing: read-only hides every control that would start a write again.
|
|
562
|
-
*/
|
|
563
|
-
declare function Content(props: ContentProps): ReactElement | null;
|
|
564
|
-
/** Media, title, and description in a header, then the action. What `X.Outcome` renders alone. */
|
|
565
|
-
declare function Composition(): ReactElement;
|
|
566
|
-
//#endregion
|
|
567
|
-
//#region src/review.d.ts
|
|
568
|
-
interface ReviewState extends Record<string, unknown> {
|
|
569
|
-
readonly status: Controller$2["state"]["_tag"];
|
|
570
|
-
}
|
|
571
|
-
interface KindProps {
|
|
572
|
-
readonly controller: Controller$2;
|
|
573
|
-
readonly kind: Plan.Kind;
|
|
574
|
-
}
|
|
575
|
-
interface StatusProps$5 extends PartProps<"p", ReviewState>, KindProps {}
|
|
576
|
-
interface OutcomeProps$4 extends RootProps$7, KindProps {}
|
|
577
|
-
interface ActionsProps$2 extends PartProps<"div", ReviewState>, KindProps {}
|
|
578
|
-
interface DialogProps$3 extends KindProps {
|
|
579
|
-
readonly children?: ReactNode;
|
|
580
|
-
readonly onOpenChange?: (open: boolean) => void;
|
|
581
|
-
readonly open?: boolean;
|
|
582
|
-
/** Replace the dialog surface entirely: a drawer, an inline panel, a host modal. */
|
|
583
|
-
readonly render?: (props: {
|
|
584
|
-
readonly open: boolean;
|
|
585
|
-
readonly children: ReactNode;
|
|
586
|
-
}) => ReactNode;
|
|
587
|
-
readonly trigger?: ReactNode;
|
|
588
|
-
}
|
|
496
|
+
declare const pendingPlan: (state: State$2) => Plan.Model | null;
|
|
589
497
|
declare namespace cleanup_d_exports {
|
|
590
|
-
export {
|
|
498
|
+
export { Controller$2 as Controller, Options$3 as Options, State$2 as State, pendingPlan, planOf, useController$3 as useController };
|
|
591
499
|
}
|
|
592
500
|
interface Options$3 {
|
|
593
501
|
readonly domain: string;
|
|
594
502
|
/** Which apply to undo. Without it, the domain's latest provisioning receipt. */
|
|
595
503
|
readonly receiptId?: Receipt.ReceiptId;
|
|
596
504
|
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
505
|
+
/** Refuse every step. Defaults to the surrounding `readOnly`. */
|
|
506
|
+
readonly readOnly?: boolean;
|
|
597
507
|
}
|
|
598
508
|
/**
|
|
599
509
|
* Cleanup is bound to a receipt: it removes only what an apply proved DomainKit created. When the
|
|
600
510
|
* host does not name one, the controller reads the domain's latest from the snapshot.
|
|
601
511
|
*/
|
|
602
|
-
declare function useController$3({ domain, onCleaned, receiptId }: Options$3): Controller$2;
|
|
603
|
-
|
|
604
|
-
|
|
512
|
+
declare function useController$3({ domain, onCleaned, readOnly, receiptId }: Options$3): Controller$2;
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/domain-field.d.ts
|
|
515
|
+
type Zone = Transport.Zone;
|
|
516
|
+
type Account = Transport.Zones["connections"][number];
|
|
517
|
+
type AuthMethod = Descriptor["methods"][number];
|
|
518
|
+
/** Where a domain's records would go: the connection that serves it, and in which zone. */
|
|
519
|
+
interface Placement {
|
|
520
|
+
readonly connectionId: string;
|
|
521
|
+
readonly zone: string;
|
|
522
|
+
}
|
|
523
|
+
type ZonesState = Data.TaggedEnum<{
|
|
524
|
+
Loading: {};
|
|
525
|
+
Ready: {
|
|
526
|
+
readonly zones: ReadonlyArray<Zone>;
|
|
527
|
+
readonly connections: ReadonlyArray<Account>;
|
|
528
|
+
readonly providers: ReadonlyArray<Descriptor>;
|
|
529
|
+
};
|
|
530
|
+
Failure: {
|
|
531
|
+
readonly error: DomainKit.Error;
|
|
532
|
+
};
|
|
533
|
+
}>;
|
|
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
|
+
};
|
|
614
|
+
interface ZonesController {
|
|
615
|
+
readonly state: ZonesState;
|
|
616
|
+
readonly zones: ReadonlyArray<Zone>;
|
|
617
|
+
readonly connections: ReadonlyArray<Account>;
|
|
618
|
+
readonly providers: ReadonlyArray<Descriptor>;
|
|
619
|
+
readonly refresh: () => void;
|
|
605
620
|
}
|
|
606
|
-
interface
|
|
607
|
-
|
|
621
|
+
interface ZonesOptions {
|
|
622
|
+
/** Only this provider's connections. Omit for every connection this owner holds. */
|
|
623
|
+
readonly provider?: string;
|
|
608
624
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
readonly
|
|
620
|
-
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
621
|
-
readonly receiptId?: Receipt.ReceiptId;
|
|
622
|
-
readonly trigger?: ReactNode;
|
|
625
|
+
/**
|
|
626
|
+
* Every zone this owner's connections reach. A connection whose credential the provider turned
|
|
627
|
+
* down is listed in `connections` as `reconnect` and contributes no zones, so one dead account
|
|
628
|
+
* never costs the customer the others.
|
|
629
|
+
*/
|
|
630
|
+
declare function useZones({ provider }?: ZonesOptions): ZonesController;
|
|
631
|
+
interface ConnectAccountInput {
|
|
632
|
+
readonly provider: string;
|
|
633
|
+
readonly method: AuthMethod["kind"];
|
|
634
|
+
/** Keyed by the descriptor's field names. Ignored by the interactive methods. */
|
|
635
|
+
readonly values?: Readonly<Record<string, string>>;
|
|
623
636
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
637
|
+
type AccountsState = Data.TaggedEnum<{
|
|
638
|
+
Loading: {};
|
|
639
|
+
Ready: {};
|
|
640
|
+
Submitting: {
|
|
641
|
+
readonly provider: string;
|
|
642
|
+
};
|
|
643
|
+
Redirecting: {
|
|
644
|
+
readonly url: string;
|
|
645
|
+
};
|
|
646
|
+
Failure: {
|
|
647
|
+
readonly error: DomainKit.Error;
|
|
648
|
+
};
|
|
649
|
+
}>;
|
|
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
|
+
};
|
|
754
|
+
interface AccountsController {
|
|
755
|
+
readonly state: AccountsState;
|
|
756
|
+
readonly zones: ReadonlyArray<Zone>;
|
|
757
|
+
readonly connections: ReadonlyArray<Account>;
|
|
758
|
+
readonly providers: ReadonlyArray<Descriptor>;
|
|
759
|
+
/** Connect a provider with no domain attached. The account is what the customer is granting. */
|
|
760
|
+
readonly connect: (input: ConnectAccountInput) => void;
|
|
761
|
+
/**
|
|
762
|
+
* Prove an account again for a connection the owner already holds. The connection and its
|
|
763
|
+
* domains stay; only the credential behind it is replaced.
|
|
764
|
+
*/
|
|
765
|
+
readonly reconnect: (input: ConnectAccountInput & {
|
|
766
|
+
readonly connectionId: string;
|
|
767
|
+
}) => void;
|
|
768
|
+
readonly refresh: () => void;
|
|
628
769
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
readonly providerId: string;
|
|
770
|
+
interface AccountsOptions {
|
|
771
|
+
/** Where an interactive method returns the customer. Defaults to the page they started from. */
|
|
772
|
+
readonly returnTo?: string | null;
|
|
773
|
+
/** Refuse the commands that grant an account. Defaults to the surrounding `readOnly`. */
|
|
774
|
+
readonly readOnly?: boolean;
|
|
635
775
|
}
|
|
636
|
-
|
|
637
|
-
|
|
776
|
+
/**
|
|
777
|
+
* The accounts this owner holds, and the one way to add another: connect a provider without naming
|
|
778
|
+
* a domain. A token method finishes in place; an interactive one redirects and comes back through
|
|
779
|
+
* the library's own callback, which lands on `returnTo`.
|
|
780
|
+
*/
|
|
781
|
+
declare function useAccounts({ readOnly: refused, returnTo }?: AccountsOptions): AccountsController;
|
|
782
|
+
/**
|
|
783
|
+
* The zone a value already sits in: the longest listed zone the value is at or under. Two accounts
|
|
784
|
+
* can serve the same zone, so `preferred` names the one the customer picked and wins among equals;
|
|
785
|
+
* without it the first listed account answers.
|
|
786
|
+
*/
|
|
787
|
+
declare const placementOf: (value: string, zones: ReadonlyArray<Zone>, preferred?: Placement | null) => {
|
|
788
|
+
readonly zone: Zone;
|
|
789
|
+
readonly placement: Placement;
|
|
790
|
+
} | null;
|
|
791
|
+
/** Zones the typed value is reaching for: a prefix of the zone, or a subdomain of one. */
|
|
792
|
+
declare const suggestionsFor: (value: string, zones: ReadonlyArray<Zone>) => ReadonlyArray<Zone>;
|
|
793
|
+
/** The value a suggestion completes to: whatever subdomain was typed, then the zone. */
|
|
794
|
+
declare const completionOf: (value: string, zone: Zone) => string;
|
|
795
|
+
interface DomainFieldOptions {
|
|
796
|
+
/** Every zone the surface offers, which `useZones` or `useAccounts` already holds. */
|
|
797
|
+
readonly zones: ReadonlyArray<Zone>;
|
|
798
|
+
readonly value: string;
|
|
799
|
+
readonly onChange: (value: string) => void;
|
|
800
|
+
/**
|
|
801
|
+
* Fires when the value or the account it resolves to changes, so a host holds the two together
|
|
802
|
+
* and submits them together. It reports the value as typed, not only the placement, because a
|
|
803
|
+
* form needs the name the customer is on as well as where its records would go.
|
|
804
|
+
*/
|
|
805
|
+
readonly onResolve?: (input: {
|
|
806
|
+
readonly domain: string;
|
|
807
|
+
readonly connection: Placement | null;
|
|
808
|
+
}) => void;
|
|
809
|
+
/** The input's id. The listbox and its options are named from it; one is generated otherwise. */
|
|
810
|
+
readonly id?: string;
|
|
811
|
+
}
|
|
812
|
+
/** The props one suggestion carries, so the option is a listbox option to a screen reader. */
|
|
813
|
+
interface OptionProps {
|
|
814
|
+
readonly "aria-selected": boolean;
|
|
815
|
+
readonly id: string;
|
|
816
|
+
readonly onMouseDown: MouseEventHandler<Element>;
|
|
817
|
+
readonly role: "option";
|
|
818
|
+
}
|
|
819
|
+
interface DomainFieldController {
|
|
820
|
+
/** Whether the listbox is showing: the customer opened it and there is something in it. */
|
|
821
|
+
readonly open: boolean;
|
|
822
|
+
/** The zones the typed value is reaching for, in the order they were listed. */
|
|
823
|
+
readonly suggestions: ReadonlyArray<Zone>;
|
|
824
|
+
/** The suggestion Tab and Enter would complete, or `null` when the list is empty. */
|
|
825
|
+
readonly highlighted: Zone | null;
|
|
826
|
+
/** The zone the value already sits in, with the account its records would go to. */
|
|
827
|
+
readonly found: {
|
|
828
|
+
readonly zone: Zone;
|
|
829
|
+
readonly placement: Placement;
|
|
830
|
+
} | null;
|
|
831
|
+
/** Finish the name from one suggestion, keeping whatever subdomain was typed in front of it. */
|
|
832
|
+
readonly complete: (zone: Zone) => void;
|
|
833
|
+
readonly close: () => void;
|
|
834
|
+
readonly inputProps: {
|
|
835
|
+
readonly "aria-activedescendant": AriaAttributes["aria-activedescendant"];
|
|
836
|
+
readonly "aria-autocomplete": "list";
|
|
837
|
+
readonly "aria-controls": string;
|
|
838
|
+
readonly "aria-expanded": boolean;
|
|
839
|
+
readonly autoComplete: "off";
|
|
840
|
+
readonly id: string;
|
|
841
|
+
readonly onChange: FormEventHandler<HTMLInputElement>;
|
|
842
|
+
readonly onFocus: FocusEventHandler<HTMLInputElement>;
|
|
843
|
+
readonly onKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
844
|
+
readonly role: "combobox";
|
|
845
|
+
readonly type: "text";
|
|
846
|
+
readonly value: string;
|
|
847
|
+
};
|
|
848
|
+
readonly listboxProps: {
|
|
849
|
+
readonly "aria-label": string;
|
|
850
|
+
readonly hidden: boolean;
|
|
851
|
+
readonly id: string;
|
|
852
|
+
readonly role: "listbox";
|
|
853
|
+
};
|
|
854
|
+
readonly optionProps: (zone: Zone) => OptionProps;
|
|
638
855
|
}
|
|
639
856
|
/**
|
|
640
|
-
*
|
|
641
|
-
*
|
|
857
|
+
* One input over every zone the workspace's accounts reach, as props rather than markup. Arrow
|
|
858
|
+
* keys move the highlight, Tab or Enter completes it, Escape closes the list, and `found` says
|
|
859
|
+
* where the records will go.
|
|
642
860
|
*/
|
|
643
|
-
declare function
|
|
861
|
+
declare function useDomainField({ id, onChange, onResolve, value, zones }: DomainFieldOptions): DomainFieldController;
|
|
644
862
|
declare namespace connect_d_exports {
|
|
645
|
-
export {
|
|
863
|
+
export { Account, AccountsController, AccountsOptions, AccountsState, Attempt, Candidate, ConnectAccountInput, ConnectInput, Controller$1 as Controller, DescribedMethod, DescribedMethods, Descriptor, Discovery, DomainFieldController, DomainFieldOptions, Field, Invitation, MethodDescriptor, MethodFields, Options$2 as Options, Placement, Reusable, Snapshot, State$1 as State, Zone, ZonesController, ZonesOptions, ZonesState, answeredInPlace, attempted, completionOf, describeMethods, displayName, holdsConnection, hostProvider, offering, placementOf, providerOf, reconnect, rejectedField, reusableConnections, suggestionsFor, useAccounts, useController$2 as useController, useDomainField, useZones };
|
|
646
864
|
}
|
|
647
865
|
type Snapshot = Transport.Snapshot;
|
|
648
866
|
type Discovery = Transport.Discovery;
|
|
649
867
|
type Candidate = Transport.Candidate;
|
|
650
|
-
|
|
868
|
+
/** A provider as the snapshot describes it: an id, a display name, and its auth methods. */
|
|
869
|
+
type Descriptor = Transport.Snapshot["providers"][number];
|
|
651
870
|
type MethodDescriptor = Descriptor["methods"][number];
|
|
652
871
|
type Field = NonNullable<MethodDescriptor["fields"]>[number];
|
|
653
872
|
/**
|
|
@@ -671,6 +890,7 @@ type State$1 = Data.TaggedEnum<{
|
|
|
671
890
|
};
|
|
672
891
|
Submitting: {
|
|
673
892
|
readonly snapshot: Snapshot | null;
|
|
893
|
+
readonly discovery: Discovery | null;
|
|
674
894
|
};
|
|
675
895
|
Redirecting: {
|
|
676
896
|
readonly url: string;
|
|
@@ -733,6 +953,7 @@ declare const State$1: {
|
|
|
733
953
|
}> | Extract<{
|
|
734
954
|
readonly _tag: "Submitting";
|
|
735
955
|
readonly snapshot: Snapshot | null;
|
|
956
|
+
readonly discovery: Discovery | null;
|
|
736
957
|
}, {
|
|
737
958
|
readonly _tag: Tag;
|
|
738
959
|
}>;
|
|
@@ -767,6 +988,7 @@ declare const State$1: {
|
|
|
767
988
|
} | {
|
|
768
989
|
readonly _tag: "Submitting";
|
|
769
990
|
readonly snapshot: Snapshot | null;
|
|
991
|
+
readonly discovery: Discovery | null;
|
|
770
992
|
}, {
|
|
771
993
|
readonly _tag: Tag;
|
|
772
994
|
}>) => any; }>(cases: Cases): (value: {
|
|
@@ -799,6 +1021,7 @@ declare const State$1: {
|
|
|
799
1021
|
} | {
|
|
800
1022
|
readonly _tag: "Submitting";
|
|
801
1023
|
readonly snapshot: Snapshot | null;
|
|
1024
|
+
readonly discovery: Discovery | null;
|
|
802
1025
|
}) => import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
|
|
803
1026
|
<Cases extends { readonly [Tag in "Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]: (args: Extract<{
|
|
804
1027
|
readonly _tag: "Connected";
|
|
@@ -830,6 +1053,7 @@ declare const State$1: {
|
|
|
830
1053
|
} | {
|
|
831
1054
|
readonly _tag: "Submitting";
|
|
832
1055
|
readonly snapshot: Snapshot | null;
|
|
1056
|
+
readonly discovery: Discovery | null;
|
|
833
1057
|
}, {
|
|
834
1058
|
readonly _tag: Tag;
|
|
835
1059
|
}>) => any; }>(value: {
|
|
@@ -862,6 +1086,7 @@ declare const State$1: {
|
|
|
862
1086
|
} | {
|
|
863
1087
|
readonly _tag: "Submitting";
|
|
864
1088
|
readonly snapshot: Snapshot | null;
|
|
1089
|
+
readonly discovery: Discovery | null;
|
|
865
1090
|
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
|
|
866
1091
|
};
|
|
867
1092
|
readonly Connected: Data.TaggedEnum.ConstructorFrom<{
|
|
@@ -901,6 +1126,7 @@ declare const State$1: {
|
|
|
901
1126
|
readonly Submitting: Data.TaggedEnum.ConstructorFrom<{
|
|
902
1127
|
readonly _tag: "Submitting";
|
|
903
1128
|
readonly snapshot: Snapshot | null;
|
|
1129
|
+
readonly discovery: Discovery | null;
|
|
904
1130
|
}, "_tag">;
|
|
905
1131
|
};
|
|
906
1132
|
/** Which provider and method the failed command was for, so the form can answer beside it. */
|
|
@@ -917,6 +1143,18 @@ interface ConnectInput {
|
|
|
917
1143
|
readonly returnTo?: string;
|
|
918
1144
|
}
|
|
919
1145
|
interface Controller$1 {
|
|
1146
|
+
readonly domain: string;
|
|
1147
|
+
/**
|
|
1148
|
+
* What this domain's last apply landed, read once per receipt id and held here. `null` until
|
|
1149
|
+
* the snapshot names a receipt, or when the transport carries no provisioning group.
|
|
1150
|
+
*/
|
|
1151
|
+
readonly receipt: Receipt.Model | null;
|
|
1152
|
+
/**
|
|
1153
|
+
* How many times a connection has been established for this domain on this surface: a token
|
|
1154
|
+
* connect that landed, or a load that followed this library's own redirect back. It only ever
|
|
1155
|
+
* grows, so a flow acts on a change rather than on a state that would fire again every render.
|
|
1156
|
+
*/
|
|
1157
|
+
readonly established: number;
|
|
920
1158
|
readonly state: State$1;
|
|
921
1159
|
readonly snapshot: Snapshot | null;
|
|
922
1160
|
readonly discovery: Discovery | null;
|
|
@@ -943,132 +1181,130 @@ interface Options$2 {
|
|
|
943
1181
|
* pass `null` to send none and let the server's `defaultReturnTo` decide.
|
|
944
1182
|
*/
|
|
945
1183
|
readonly returnTo?: string | null;
|
|
1184
|
+
/**
|
|
1185
|
+
* Refuse every command that changes the connection. Defaults to the surrounding `readOnly`,
|
|
1186
|
+
* which is `DomainKit.Root`'s unless a `DomainKit.ReadOnly` narrows it.
|
|
1187
|
+
*/
|
|
1188
|
+
readonly readOnly?: boolean;
|
|
946
1189
|
}
|
|
947
1190
|
/**
|
|
948
1191
|
* The domain's connection, and the four ways to change it. Discovery runs on mount whenever the
|
|
949
1192
|
* transport declares it and the domain has no connection yet; a discovery failure is not the
|
|
950
1193
|
* customer's problem, so the provider list still renders.
|
|
951
1194
|
*/
|
|
952
|
-
declare function useController$2({ domain, returnTo }: Options$2): Controller$1;
|
|
953
|
-
interface RootState$3 extends Record<string, unknown> {
|
|
954
|
-
readonly status: State$1["_tag"];
|
|
955
|
-
}
|
|
956
|
-
interface RootProps$5 extends PartProps<"div", RootState$3> {
|
|
957
|
-
readonly controller: Controller$1;
|
|
958
|
-
}
|
|
959
|
-
declare function Root$5({ controller, ...props }: RootProps$5): ReactElement;
|
|
1195
|
+
declare function useController$2({ domain, readOnly: refused, returnTo }: Options$2): Controller$1;
|
|
960
1196
|
/**
|
|
961
1197
|
* Whether a failure is already answered where it was raised: beside the method the customer used.
|
|
962
|
-
* A
|
|
1198
|
+
* A surface rendering one outcome for the whole flow skips it, so the failure announces once.
|
|
963
1199
|
*/
|
|
964
1200
|
declare const answeredInPlace: (controller: Controller$1) => boolean;
|
|
1201
|
+
/**
|
|
1202
|
+
* Whether the surface should read as connected: it is, or a command it started is in flight over a
|
|
1203
|
+
* connection that was. The provider row and the dialog it opened stay on screen for the length of
|
|
1204
|
+
* the command rather than vanishing under the customer half way through it.
|
|
1205
|
+
*/
|
|
1206
|
+
declare const holdsConnection: (controller: Controller$1) => boolean;
|
|
1207
|
+
/**
|
|
1208
|
+
* Whether the provider turned the credential down, so the customer must prove the account again.
|
|
1209
|
+
* Proving it re-credits the connection the workspace already holds and leaves its domains where
|
|
1210
|
+
* they are, which is why the surface offers a reconnect rather than a second account.
|
|
1211
|
+
*/
|
|
1212
|
+
declare const reconnect: (controller: Controller$1) => boolean;
|
|
965
1213
|
/**
|
|
966
1214
|
* The provider whose nameservers serve this domain, as the snapshot describes it. Discovery names
|
|
967
1215
|
* it by id; without a descriptor there is nothing to draw, so there is no host.
|
|
968
1216
|
*/
|
|
969
1217
|
declare const hostProvider: (controller: Controller$1) => Descriptor | null;
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1218
|
+
/** The descriptor for one provider id, or `null` when the snapshot describes no such provider. */
|
|
1219
|
+
declare const providerOf: (controller: Controller$1, providerId: string | null | undefined) => Descriptor | null;
|
|
1220
|
+
/** The provider as the customer knows it, falling back to the id when the snapshot has no name. */
|
|
1221
|
+
declare const displayName: (controller: Controller$1, providerId: string) => string;
|
|
973
1222
|
/**
|
|
974
|
-
*
|
|
975
|
-
*
|
|
1223
|
+
* Whether the flow offers a connect surface: only when discovery names a host, always, or never.
|
|
1224
|
+
* `never` is a host that decides for itself, such as a domain already ready without DomainKit; a
|
|
1225
|
+
* connected domain keeps its status and its disconnect either way.
|
|
976
1226
|
*/
|
|
977
|
-
|
|
978
|
-
interface StatusProps$3 extends PartProps<"p", RootState$3> {
|
|
979
|
-
readonly controller: Controller$1;
|
|
980
|
-
}
|
|
981
|
-
declare function Status$3({ controller, ...props }: StatusProps$3): ReactElement;
|
|
982
|
-
interface FormProps extends PartProps<"div", RootState$3> {
|
|
983
|
-
readonly controller: Controller$1;
|
|
984
|
-
}
|
|
1227
|
+
type Invitation = "always" | "detected" | "never";
|
|
985
1228
|
/**
|
|
986
|
-
*
|
|
987
|
-
*
|
|
1229
|
+
* Whether the connect surface has anything to offer for this domain: a provider that serves the
|
|
1230
|
+
* zone, a connection discovery already found, one the owner already holds, or a command already
|
|
1231
|
+
* running. Never while a connection is held, which is what `holdsConnection` answers. A host reads
|
|
1232
|
+
* it to order its own offers beside DomainKit's rather than competing with them.
|
|
988
1233
|
*/
|
|
989
|
-
declare
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
readonly
|
|
993
|
-
/**
|
|
994
|
-
readonly
|
|
995
|
-
|
|
996
|
-
readonly children: ReactNode;
|
|
997
|
-
}) => ReactNode;
|
|
998
|
-
readonly title?: ReactNode;
|
|
999
|
-
readonly trigger?: ReactNode;
|
|
1234
|
+
declare const offering: (controller: Controller$1, connect?: Invitation) => boolean;
|
|
1235
|
+
/** A connection this owner already holds that would serve the domain, as one list to offer. */
|
|
1236
|
+
interface Reusable {
|
|
1237
|
+
readonly connectionId: string;
|
|
1238
|
+
/** The zone the connection would attach, when discovery named one. */
|
|
1239
|
+
readonly zone: string | undefined;
|
|
1240
|
+
readonly label: string;
|
|
1000
1241
|
}
|
|
1001
|
-
/**
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1242
|
+
/**
|
|
1243
|
+
* Every connection the customer can attach without proving anything: the one discovery resolved,
|
|
1244
|
+
* the candidates a zone choice is between, and the connections the snapshot lists as reusable.
|
|
1245
|
+
*/
|
|
1246
|
+
declare const reusableConnections: (controller: Controller$1) => ReadonlyArray<Reusable>;
|
|
1247
|
+
/** The fields one token method declares, split into what the surface asks for and what it hides. */
|
|
1248
|
+
interface MethodFields {
|
|
1249
|
+
readonly required: ReadonlyArray<Field>;
|
|
1250
|
+
/** The fields a provider does not need, which the surface keeps behind a disclosure. */
|
|
1251
|
+
readonly optional: ReadonlyArray<Field>;
|
|
1252
|
+
/** The field the provider's documentation link explains: the first secret, else the first field. */
|
|
1253
|
+
readonly explains: string | null;
|
|
1254
|
+
}
|
|
1255
|
+
/** One declared auth method, with the fields it asks for already arranged. */
|
|
1256
|
+
interface DescribedMethod {
|
|
1257
|
+
readonly kind: Storage.AuthMethod;
|
|
1258
|
+
readonly descriptor: MethodDescriptor;
|
|
1259
|
+
/** `null` for a method the customer clicks through, which asks for nothing on the page. */
|
|
1260
|
+
readonly fields: MethodFields | null;
|
|
1261
|
+
}
|
|
1262
|
+
/** What one provider offers, in the order the descriptor declares it. */
|
|
1263
|
+
interface DescribedMethods {
|
|
1264
|
+
/** The methods the customer clicks through: OAuth and the provider's own integration. */
|
|
1265
|
+
readonly interactive: ReadonlyArray<DescribedMethod>;
|
|
1266
|
+
/** The methods that ask for credentials on the page. */
|
|
1267
|
+
readonly typed: ReadonlyArray<DescribedMethod>;
|
|
1007
1268
|
/**
|
|
1008
|
-
*
|
|
1009
|
-
*
|
|
1269
|
+
* Both kinds are on offer, so the surface shows the interactive one and a control that opens the
|
|
1270
|
+
* token form in its place: one decision at a time rather than a wall of alternatives.
|
|
1010
1271
|
*/
|
|
1011
|
-
readonly
|
|
1272
|
+
readonly alternate: boolean;
|
|
1012
1273
|
}
|
|
1274
|
+
/** One provider's auth methods, arranged for a surface that asks for one decision at a time. */
|
|
1275
|
+
declare const describeMethods: (provider: Descriptor) => DescribedMethods;
|
|
1013
1276
|
/**
|
|
1014
|
-
* The
|
|
1015
|
-
* the
|
|
1016
|
-
*
|
|
1277
|
+
* The one field a rejected command was about, if any. A provider that turns down credentials is
|
|
1278
|
+
* answering the secret it was given, and it names no field, so the first secret carries the
|
|
1279
|
+
* answer; anything else is about the request rather than one input.
|
|
1017
1280
|
*/
|
|
1018
|
-
declare
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}
|
|
1022
|
-
/** A connected domain: which provider holds it, and how to let it go. */
|
|
1023
|
-
declare function Card$1({ controller, ...props }: CardProps$1): ReactElement;
|
|
1024
|
-
interface FlowProps$2 extends Omit<RootProps$5, "controller"> {
|
|
1025
|
-
readonly domain: string;
|
|
1026
|
-
readonly returnTo?: string | null;
|
|
1027
|
-
/** Offer the connect dialog even when discovery names no host. Defaults to `detected`. */
|
|
1028
|
-
readonly connect?: Invitation;
|
|
1029
|
-
}
|
|
1030
|
-
/** Connection on its own: the card once connected, the prompt until then. */
|
|
1031
|
-
declare function Flow$2({ connect, domain, returnTo, ...props }: FlowProps$2): ReactElement;
|
|
1281
|
+
declare const rejectedField: (error: DomainKit.Error | null, fields: ReadonlyArray<Field>) => string | null;
|
|
1282
|
+
/** Whether a failure was raised by this provider's method, so the form answers beside it. */
|
|
1283
|
+
declare const attempted: (controller: Controller$1, provider: string, method: Storage.AuthMethod) => DomainKit.Error | null;
|
|
1032
1284
|
declare namespace provision_d_exports {
|
|
1033
|
-
export {
|
|
1285
|
+
export { Controller$2 as Controller, Options$1 as Options, State$2 as State, pendingPlan, planOf, useController$1 as useController };
|
|
1034
1286
|
}
|
|
1035
1287
|
interface Options$1 {
|
|
1036
1288
|
readonly domain: string;
|
|
1037
1289
|
readonly requirements: ReadonlyArray<DnsRecord.Model>;
|
|
1038
1290
|
readonly onApplied?: (receipt: Receipt.Model) => void;
|
|
1291
|
+
/** Refuse every step. Defaults to the surrounding `readOnly`. */
|
|
1292
|
+
readonly readOnly?: boolean;
|
|
1039
1293
|
}
|
|
1040
|
-
declare function useController$1({ domain, onApplied, requirements }: Options$1): Controller$2;
|
|
1041
|
-
interface RootState$2 extends Record<string, unknown> {
|
|
1042
|
-
readonly status: State$3["_tag"];
|
|
1043
|
-
}
|
|
1044
|
-
interface RootProps$4 extends PartProps<"div", RootState$2> {
|
|
1045
|
-
readonly controller: Controller$2;
|
|
1046
|
-
}
|
|
1047
|
-
declare function Root$4({ controller, ...props }: RootProps$4): ReactElement;
|
|
1048
|
-
interface DialogProps extends Omit<DialogProps$3, "kind"> {}
|
|
1049
|
-
declare function Dialog(props: DialogProps): ReactElement;
|
|
1050
|
-
interface ActionsProps extends Omit<ActionsProps$2, "kind"> {}
|
|
1051
|
-
/** Approve and Decline for a plan already under review. */
|
|
1052
|
-
declare function Actions(props: ActionsProps): ReactElement | null;
|
|
1053
|
-
interface OutcomeProps$1 extends Omit<OutcomeProps$4, "kind"> {}
|
|
1054
|
-
declare function Outcome$2(props: OutcomeProps$1): ReactElement | null;
|
|
1055
|
-
interface StatusProps$2 extends Omit<StatusProps$5, "kind"> {}
|
|
1056
|
-
declare function Status$2(props: StatusProps$2): ReactElement;
|
|
1057
|
-
interface FlowProps$1 extends Omit<RootProps$4, "controller"> {
|
|
1058
|
-
readonly domain: string;
|
|
1059
|
-
readonly onApplied?: (receipt: Receipt.Model) => void;
|
|
1060
|
-
readonly requirements: ReadonlyArray<DnsRecord.Model>;
|
|
1061
|
-
readonly trigger?: ReactNode;
|
|
1062
|
-
}
|
|
1063
|
-
/** Provisioning on its own: a trigger that plans, then the review dialog. */
|
|
1064
|
-
declare function Flow$1({ domain, onApplied, requirements, trigger, ...props }: FlowProps$1): import("react/jsx-runtime").JSX.Element;
|
|
1294
|
+
declare function useController$1({ domain, onApplied, readOnly, requirements }: Options$1): Controller$2;
|
|
1065
1295
|
declare namespace verify_d_exports {
|
|
1066
|
-
export { Controller, Evidence,
|
|
1296
|
+
export { Controller, Evidence, HostEvidence, Options, Readiness$1 as Readiness, Requirement, State, useController, valuesOf };
|
|
1067
1297
|
}
|
|
1068
1298
|
type Readiness$1 = Transport.Readiness;
|
|
1069
1299
|
type HostEvidence = Readiness$1["host"][number];
|
|
1070
1300
|
type Requirement = Readiness$1["requirements"][number];
|
|
1071
1301
|
type Evidence = Requirement["evidence"][number];
|
|
1302
|
+
/**
|
|
1303
|
+
* What the observer read back for the requirement's name, or `null` when it read nothing back at
|
|
1304
|
+
* all. Host evidence reports a status the host reached rather than values read off a name, and an
|
|
1305
|
+
* `unknown` observation is a lookup that never answered, which is not the same as finding nothing.
|
|
1306
|
+
*/
|
|
1307
|
+
declare const valuesOf: (evidence: Evidence) => ReadonlyArray<string> | null;
|
|
1072
1308
|
/**
|
|
1073
1309
|
* Readiness rides on the state rather than a ref, so it can never outlive the render that
|
|
1074
1310
|
* produced it: a controller pointed at a new domain has no readiness in the very first frame.
|
|
@@ -1203,89 +1439,53 @@ interface Options {
|
|
|
1203
1439
|
}
|
|
1204
1440
|
/** Observe once on mount, then follow the readiness's own `nextCheckAt` while polling is on. */
|
|
1205
1441
|
declare function useController({ domain, polling, requirements }: Options): Controller;
|
|
1206
|
-
interface RootState$1 extends Record<string, unknown> {
|
|
1207
|
-
readonly status: State["_tag"];
|
|
1208
|
-
}
|
|
1209
|
-
interface RootProps$3 extends PartProps<"div", RootState$1> {
|
|
1210
|
-
readonly controller: Controller;
|
|
1211
|
-
}
|
|
1212
|
-
declare function Root$3({ controller, ...props }: RootProps$3): ReactElement;
|
|
1213
|
-
interface ObserveActionProps extends PartProps<"button", RootState$1> {
|
|
1214
|
-
readonly controller: Controller;
|
|
1215
|
-
}
|
|
1216
|
-
declare function ObserveAction({ controller, ...props }: ObserveActionProps): ReactElement;
|
|
1217
|
-
interface EvidenceProps {
|
|
1218
|
-
readonly readiness: Readiness$1;
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Per-requirement readiness and, below it, the host's own evidence: an SES identity, a certificate,
|
|
1222
|
-
* anything DomainKit cannot observe but the host feeds in.
|
|
1223
|
-
*/
|
|
1224
|
-
declare function Evidence({ readiness }: EvidenceProps): ReactElement;
|
|
1225
|
-
interface OutcomeProps extends RootProps$7 {
|
|
1226
|
-
readonly controller: Controller;
|
|
1227
|
-
}
|
|
1228
|
-
/**
|
|
1229
|
-
* The last observation that failed. Observing reads the world rather than changing the domain, so
|
|
1230
|
-
* the retry stays even in read-only.
|
|
1231
|
-
*/
|
|
1232
|
-
declare function Outcome$1({ children, controller, ...props }: OutcomeProps): ReactElement | null;
|
|
1233
|
-
interface StatusProps$1 extends Omit<RootProps$3, "render"> {
|
|
1234
|
-
/** Replace the popover surface with a panel of the host's own. */
|
|
1235
|
-
readonly render?: (props: {
|
|
1236
|
-
readonly open: boolean;
|
|
1237
|
-
readonly children: ReactNode;
|
|
1238
|
-
}) => ReactNode;
|
|
1239
|
-
}
|
|
1240
|
-
/** The default verification slot: a button that observes, with the evidence behind it. */
|
|
1241
|
-
declare function Status$1({ controller, render, ...props }: StatusProps$1): ReactElement;
|
|
1242
1442
|
declare namespace domain_d_exports {
|
|
1243
|
-
export {
|
|
1244
|
-
}
|
|
1245
|
-
interface RecordsSlotProps {
|
|
1246
|
-
readonly records: ReadonlyArray<DnsRecord.Model>;
|
|
1247
|
-
readonly readiness: Readiness$1 | null;
|
|
1248
|
-
readonly controller: Controller;
|
|
1249
|
-
readonly domain: string;
|
|
1250
|
-
}
|
|
1251
|
-
interface VerificationSlotProps {
|
|
1252
|
-
readonly controller: Controller;
|
|
1253
|
-
readonly domain: string;
|
|
1254
|
-
}
|
|
1255
|
-
interface ActionsSlotProps {
|
|
1256
|
-
readonly connection: Controller$1;
|
|
1257
|
-
readonly provisioning: Controller$2;
|
|
1258
|
-
readonly cleanup: Controller$2;
|
|
1259
|
-
readonly domain: string;
|
|
1260
|
-
}
|
|
1261
|
-
interface ConnectionSlotProps {
|
|
1262
|
-
readonly controller: Controller$1;
|
|
1263
|
-
readonly domain: string;
|
|
1264
|
-
/** What the flow was told to offer when discovery names no host. */
|
|
1265
|
-
readonly connect: Invitation;
|
|
1443
|
+
export { Flow, FlowOptions, FlowState, useFlow };
|
|
1266
1444
|
}
|
|
1267
1445
|
/**
|
|
1268
|
-
*
|
|
1269
|
-
*
|
|
1446
|
+
* What DomainKit has to say about this domain. A host reads `connected` and `offering` to order
|
|
1447
|
+
* its own offers beside DomainKit's: an offer of its own competes while `offering` is true, and a
|
|
1448
|
+
* domain DomainKit holds needs none.
|
|
1270
1449
|
*/
|
|
1271
|
-
interface
|
|
1272
|
-
/** The requirements table. Defaults to `Records.Table` with readiness when there is any. */
|
|
1273
|
-
readonly records?: (props: RecordsSlotProps) => ReactNode;
|
|
1274
|
-
/** Defaults to `Verify.Status`. Rendered only when the transport declares `verification`. */
|
|
1275
|
-
readonly verification?: (props: VerificationSlotProps) => ReactNode;
|
|
1276
|
-
/** Defaults to Approve and Decline, plus cleanup when the transport declares it. */
|
|
1277
|
-
readonly actions?: (props: ActionsSlotProps) => ReactNode;
|
|
1278
|
-
/** Defaults to `Connect.Card` once connected and `Connect.Prompt` until then. */
|
|
1279
|
-
readonly connection?: (props: ConnectionSlotProps) => ReactNode;
|
|
1280
|
-
}
|
|
1281
|
-
interface FlowState extends Record<string, unknown> {
|
|
1450
|
+
interface FlowState {
|
|
1282
1451
|
readonly connection: State$1["_tag"];
|
|
1283
|
-
readonly provisioning: State$
|
|
1452
|
+
readonly provisioning: State$2["_tag"];
|
|
1453
|
+
/**
|
|
1454
|
+
* DomainKit holds a connection for this domain, including while a command it started over that
|
|
1455
|
+
* connection is still running. `offering` is never true at the same time.
|
|
1456
|
+
*/
|
|
1457
|
+
readonly connected: boolean;
|
|
1458
|
+
/** The connect surface has something to offer, so a host's own offer would compete with it. */
|
|
1459
|
+
readonly offering: boolean;
|
|
1460
|
+
/** Who holds the connection, or whose nameservers serve the zone. */
|
|
1461
|
+
readonly provider: string | null;
|
|
1462
|
+
/**
|
|
1463
|
+
* The account the records go to, as the provider labelled the zone when the domain was attached.
|
|
1464
|
+
* `null` until there is an attachment.
|
|
1465
|
+
*/
|
|
1466
|
+
readonly label: string | null;
|
|
1467
|
+
/**
|
|
1468
|
+
* The apply receipt this domain's latest provisioning attempt produced, which is what cleanup
|
|
1469
|
+
* plans from. A host's own "remove this domain" surface offers cleanup only when there is one.
|
|
1470
|
+
*/
|
|
1471
|
+
readonly receiptId: Receipt.ReceiptId | null;
|
|
1472
|
+
/** `receiptId !== null`: DomainKit applied records here and can prove which. */
|
|
1473
|
+
readonly applied: boolean;
|
|
1474
|
+
/**
|
|
1475
|
+
* The surface may read this domain but not write to it, so a host can say why rather than
|
|
1476
|
+
* leaving a customer in front of a page with nothing on it.
|
|
1477
|
+
*/
|
|
1478
|
+
readonly readOnly: boolean;
|
|
1284
1479
|
}
|
|
1285
|
-
interface
|
|
1480
|
+
interface FlowOptions {
|
|
1286
1481
|
readonly domain: string;
|
|
1287
1482
|
readonly requirements: ReadonlyArray<DnsRecord.Model>;
|
|
1288
|
-
|
|
1483
|
+
/**
|
|
1484
|
+
* Offer the connect surface even when discovery names no host, for a host application that lets
|
|
1485
|
+
* a customer connect a provider the domain's nameservers do not point at, or `never` for a
|
|
1486
|
+
* domain the host has already settled another way. Defaults to `detected`.
|
|
1487
|
+
*/
|
|
1488
|
+
readonly connect?: Invitation;
|
|
1289
1489
|
readonly onApplied?: (receipt: Receipt.Model) => void;
|
|
1290
1490
|
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
1291
1491
|
/**
|
|
@@ -1293,49 +1493,28 @@ interface FlowProps extends Omit<PartProps<"div", FlowState>, "children"> {
|
|
|
1293
1493
|
* from; pass `null` to let the server's `defaultReturnTo` decide.
|
|
1294
1494
|
*/
|
|
1295
1495
|
readonly returnTo?: string | null;
|
|
1296
|
-
/**
|
|
1496
|
+
/** Report this domain's state without the controls that change it. Defaults to the root's. */
|
|
1297
1497
|
readonly readOnly?: boolean;
|
|
1298
|
-
/**
|
|
1299
|
-
* Offer the connect dialog even when discovery names no host, for a host application that lets
|
|
1300
|
-
* a customer connect a provider the domain's nameservers do not point at. Defaults to `detected`.
|
|
1301
|
-
*/
|
|
1302
|
-
readonly connect?: Invitation;
|
|
1303
1498
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
readonly
|
|
1319
|
-
|
|
1320
|
-
readonly
|
|
1321
|
-
readonly external: ReactNode;
|
|
1322
|
-
readonly failure: ReactNode;
|
|
1323
|
-
readonly pending: ReactNode;
|
|
1324
|
-
readonly success: ReactNode;
|
|
1325
|
-
readonly warning: ReactNode;
|
|
1499
|
+
interface Flow {
|
|
1500
|
+
readonly domain: string;
|
|
1501
|
+
/** What the host asked for, as the surface renders it row by row. */
|
|
1502
|
+
readonly requirements: ReadonlyArray<DnsRecord.Model>;
|
|
1503
|
+
readonly state: FlowState;
|
|
1504
|
+
readonly connection: Controller$1;
|
|
1505
|
+
readonly provisioning: Controller$2;
|
|
1506
|
+
/** Bound to the domain's latest apply receipt, which is the only thing cleanup may undo. */
|
|
1507
|
+
readonly cleanup: Controller$2;
|
|
1508
|
+
readonly verification: Controller;
|
|
1509
|
+
/** The plan the rows report, which is one still awaiting its apply. */
|
|
1510
|
+
readonly plan: Plan.Model | null;
|
|
1511
|
+
readonly readiness: Readiness$1 | null;
|
|
1512
|
+
/** Which capability groups the transport declares, so a surface renders only what it can run. */
|
|
1513
|
+
readonly capabilities: ReadonlyArray<Transport.Capability>;
|
|
1514
|
+
/** What the flow was told to offer when discovery names no host. */
|
|
1515
|
+
readonly invitation: Invitation;
|
|
1326
1516
|
}
|
|
1327
|
-
declare
|
|
1328
|
-
readonly close: import("react/jsx-runtime").JSX.Element;
|
|
1329
|
-
readonly copied: import("react/jsx-runtime").JSX.Element;
|
|
1330
|
-
readonly copy: import("react/jsx-runtime").JSX.Element;
|
|
1331
|
-
readonly download: import("react/jsx-runtime").JSX.Element;
|
|
1332
|
-
readonly external: import("react/jsx-runtime").JSX.Element;
|
|
1333
|
-
readonly failure: import("react/jsx-runtime").JSX.Element;
|
|
1334
|
-
readonly pending: import("react/jsx-runtime").JSX.Element;
|
|
1335
|
-
readonly success: import("react/jsx-runtime").JSX.Element;
|
|
1336
|
-
readonly warning: import("react/jsx-runtime").JSX.Element;
|
|
1337
|
-
};
|
|
1338
|
-
declare function useIcons(): Icons;
|
|
1517
|
+
declare function useFlow({ connect, domain, onApplied, onCleaned, readOnly, requirements, returnTo }: FlowOptions): Flow;
|
|
1339
1518
|
declare namespace messages_d_exports {
|
|
1340
1519
|
export { Catalog, EvidenceLike, Outcome, OutcomeContext, english, failure, merge, outcome };
|
|
1341
1520
|
}
|
|
@@ -1351,7 +1530,11 @@ interface Catalog {
|
|
|
1351
1530
|
readonly close: string;
|
|
1352
1531
|
readonly retry: string;
|
|
1353
1532
|
readonly approve: string;
|
|
1533
|
+
/** The provisioning dialog's primary action: what it adds, and how many. */
|
|
1534
|
+
readonly addRecords: (count: number) => string;
|
|
1354
1535
|
readonly decline: string;
|
|
1536
|
+
/** Why the primary action is unavailable: every operation the plan holds is blocked. */
|
|
1537
|
+
readonly everyRecordConflicts: string;
|
|
1355
1538
|
readonly reviewChanges: string;
|
|
1356
1539
|
readonly cleanUp: string;
|
|
1357
1540
|
readonly checkDns: string;
|
|
@@ -1361,12 +1544,33 @@ interface Catalog {
|
|
|
1361
1544
|
readonly moreOptions: string;
|
|
1362
1545
|
/** Reveals the providers the dialog narrowed away. */
|
|
1363
1546
|
readonly useAnotherProvider: string;
|
|
1547
|
+
/** Opens the token form where a provider also offers a method the customer clicks through. */
|
|
1548
|
+
readonly useTokenInstead: string;
|
|
1549
|
+
/** Returns from one method's form to the provider's methods. */
|
|
1550
|
+
readonly back: string;
|
|
1551
|
+
/** The connected card's identity: who holds the connection and which account it reaches. */
|
|
1552
|
+
readonly connectedAccount: (provider: string, account: string) => string;
|
|
1553
|
+
/** How many records this domain's apply receipt proves DomainKit added. */
|
|
1554
|
+
readonly recordsAdded: (count: number) => string;
|
|
1555
|
+
readonly needsReconnect: string;
|
|
1556
|
+
/** The disconnect dialog's scope question, when the connection serves other domains too. */
|
|
1557
|
+
readonly disconnectScope: string;
|
|
1558
|
+
readonly disconnectThisDomain: string;
|
|
1559
|
+
readonly disconnectEveryDomain: (count: number) => string;
|
|
1364
1560
|
readonly copy: string;
|
|
1365
1561
|
readonly copied: string;
|
|
1366
1562
|
readonly copyZone: string;
|
|
1367
1563
|
readonly download: string;
|
|
1368
1564
|
readonly useConnection: (label: string) => string;
|
|
1369
1565
|
readonly chooseZone: string;
|
|
1566
|
+
/** The domain field's listbox, named for a customer reading it with assistive technology. */
|
|
1567
|
+
readonly zoneSuggestions: string;
|
|
1568
|
+
/** Which account a typed domain's records will go to. */
|
|
1569
|
+
readonly recordsGoTo: (provider: string, account: string) => string;
|
|
1570
|
+
/** A typed domain no connected account reaches; the customer adds the records by hand. */
|
|
1571
|
+
readonly notInConnectedAccount: string;
|
|
1572
|
+
/** A held connection whose credential the provider turned down. */
|
|
1573
|
+
readonly reconnectAccount: (account: string) => string;
|
|
1370
1574
|
readonly getToken: string;
|
|
1371
1575
|
readonly loading: string;
|
|
1372
1576
|
readonly connecting: string;
|
|
@@ -1384,14 +1588,30 @@ interface Catalog {
|
|
|
1384
1588
|
/** The dialog heading, and the trigger, when no provider is named yet. */
|
|
1385
1589
|
readonly connectAnyTitle: string;
|
|
1386
1590
|
/** What the disconnected prompt says about the provider whose nameservers serve the domain. */
|
|
1387
|
-
readonly
|
|
1591
|
+
readonly hostDetected: (provider: string) => string;
|
|
1388
1592
|
readonly connectDescription: (domain: string) => string;
|
|
1389
1593
|
readonly connectedTo: (provider: string) => string;
|
|
1390
1594
|
/** Shown where a connect control would be when the customer may not connect. */
|
|
1391
1595
|
readonly notConnected: string;
|
|
1596
|
+
/**
|
|
1597
|
+
* What a customer who may read the domain but not write to it is told in place of the connect
|
|
1598
|
+
* control, so the surface explains the gap rather than leaving an empty row.
|
|
1599
|
+
*/
|
|
1600
|
+
readonly administratorConnects: (provider: string) => string;
|
|
1392
1601
|
readonly reconnectRequired: (provider: string) => string;
|
|
1393
1602
|
readonly disconnectTitle: (provider: string) => string;
|
|
1394
|
-
|
|
1603
|
+
/**
|
|
1604
|
+
* What disconnecting means, in the present. The default names DomainKit as what stops managing
|
|
1605
|
+
* the records; a host application overrides the key to name itself.
|
|
1606
|
+
*/
|
|
1607
|
+
readonly disconnectConsent: (domain: string, provider: string) => string;
|
|
1608
|
+
/**
|
|
1609
|
+
* The option inside the disconnect dialog, over the records it would remove. Only this domain's
|
|
1610
|
+
* apply receipt proves what DomainKit created, so the words say which records go.
|
|
1611
|
+
*/
|
|
1612
|
+
readonly disconnectWithCleanup: (count: number) => string;
|
|
1613
|
+
/** What the listed records do when that option is off. */
|
|
1614
|
+
readonly disconnectKeepsRecords: (provider: string) => string;
|
|
1395
1615
|
readonly detachConsent: string;
|
|
1396
1616
|
readonly detached: string;
|
|
1397
1617
|
readonly reusableConnections: string;
|
|
@@ -1412,6 +1632,10 @@ interface Catalog {
|
|
|
1412
1632
|
readonly declineReason: (reason: string) => string;
|
|
1413
1633
|
readonly operation: (operation: Plan.Operation) => string;
|
|
1414
1634
|
readonly conflictReason: (reason: Plan.Conflict["reason"]) => string;
|
|
1635
|
+
/** What to do about a conflict, in the row that reports it. */
|
|
1636
|
+
readonly conflictAdvice: (reason: Plan.Conflict["reason"]) => string;
|
|
1637
|
+
/** What a pending plan holds for one row: a write, a record already there, or a blocker. */
|
|
1638
|
+
readonly planStatus: (operation: Plan.Operation) => string;
|
|
1415
1639
|
readonly attemptStatus: (status: Storage.AttemptStatus) => string;
|
|
1416
1640
|
readonly recordsCaption: (domain: string) => string;
|
|
1417
1641
|
readonly headingType: string;
|
|
@@ -1463,7 +1687,8 @@ interface Catalog {
|
|
|
1463
1687
|
/** What an outcome says: a heading the customer reads first, then what to do about it. */
|
|
1464
1688
|
interface Outcome {
|
|
1465
1689
|
readonly title: string;
|
|
1466
|
-
|
|
1690
|
+
/** What to do about it. Absent where the title has already said the whole of it. */
|
|
1691
|
+
readonly description?: string;
|
|
1467
1692
|
}
|
|
1468
1693
|
/**
|
|
1469
1694
|
* What the flow was doing when it failed. The reason alone cannot name the provider a customer
|
|
@@ -1492,74 +1717,49 @@ declare const merge: (overrides?: Partial<Catalog>) => Catalog;
|
|
|
1492
1717
|
declare const outcome: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => Outcome;
|
|
1493
1718
|
/** The same failure as one sentence, for a host that renders text rather than a card. */
|
|
1494
1719
|
declare const failure: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => string;
|
|
1495
|
-
declare namespace theme_d_exports {
|
|
1496
|
-
export { Theme, toStyle };
|
|
1497
|
-
}
|
|
1498
|
-
interface Theme {
|
|
1499
|
-
readonly accent?: string;
|
|
1500
|
-
readonly accentContrast?: string;
|
|
1501
|
-
readonly backdrop?: string;
|
|
1502
|
-
readonly background?: string;
|
|
1503
|
-
readonly border?: string;
|
|
1504
|
-
readonly danger?: string;
|
|
1505
|
-
readonly dangerContrast?: string;
|
|
1506
|
-
readonly fill?: string;
|
|
1507
|
-
readonly fontFamily?: string;
|
|
1508
|
-
readonly muted?: string;
|
|
1509
|
-
readonly radius?: string;
|
|
1510
|
-
readonly shadow?: string;
|
|
1511
|
-
readonly success?: string;
|
|
1512
|
-
readonly text?: string;
|
|
1513
|
-
readonly warning?: string;
|
|
1514
|
-
}
|
|
1515
|
-
declare function toStyle(theme?: Theme): CSSProperties;
|
|
1516
1720
|
declare namespace domain_kit_d_exports {
|
|
1517
|
-
export { ReadOnly, Root
|
|
1518
|
-
}
|
|
1519
|
-
interface RootState extends Record<string, unknown> {
|
|
1520
|
-
readonly colorScheme: "dark" | "inherit" | "light";
|
|
1721
|
+
export { ReadOnly, Root, RootProps, StableTransport, useCapabilities, useDomainKit, useMessages, useReadOnly, useTransport };
|
|
1521
1722
|
}
|
|
1522
|
-
interface RootProps
|
|
1723
|
+
interface RootProps {
|
|
1523
1724
|
readonly children: ReactNode;
|
|
1524
|
-
readonly colorScheme?: RootState["colorScheme"];
|
|
1525
|
-
readonly icons?: Partial<Icons>;
|
|
1526
|
-
readonly marks?: Marks;
|
|
1527
1725
|
readonly messages?: Partial<Catalog>;
|
|
1528
1726
|
/** Where an interactive provider flow sends the customer. Defaults to `window.location`. */
|
|
1529
1727
|
readonly navigate?: (url: string) => void;
|
|
1530
1728
|
readonly onEvent?: Listener;
|
|
1531
|
-
readonly portalContainer?: HTMLElement | null;
|
|
1532
1729
|
/**
|
|
1533
|
-
*
|
|
1534
|
-
* but not write to it. Capability gating already hides a group the transport does
|
|
1535
|
-
* this covers authorization the transport cannot express, such as a member of an
|
|
1730
|
+
* Report the domain's state without the controls that change it, for a customer who may read
|
|
1731
|
+
* the domain but not write to it. Capability gating already hides a group the transport does
|
|
1732
|
+
* not declare; this covers authorization the transport cannot express, such as a member of an
|
|
1733
|
+
* organisation. Every flow carries it on `FlowState.readOnly`, so a surface can explain it.
|
|
1536
1734
|
*/
|
|
1537
1735
|
readonly readOnly?: boolean;
|
|
1538
1736
|
/** Bump to re-inspect every mounted domain after a change the UI did not make. */
|
|
1539
1737
|
readonly revision?: number;
|
|
1540
|
-
readonly theme?: Theme;
|
|
1541
1738
|
/** The transport, by value. Rebuilding it inline on every render does not restart controllers. */
|
|
1542
1739
|
readonly transport: Transport.Interface;
|
|
1543
1740
|
}
|
|
1544
1741
|
interface ContextValue {
|
|
1545
1742
|
readonly capabilities: ReadonlyArray<Transport.Capability>;
|
|
1546
|
-
readonly colorScheme: RootState["colorScheme"];
|
|
1547
1743
|
readonly emit: Listener;
|
|
1548
|
-
readonly marks: Marks;
|
|
1549
1744
|
readonly messages: Catalog;
|
|
1550
1745
|
readonly navigate: (url: string) => void;
|
|
1551
|
-
readonly portalContainer: RefObject<HTMLElement | null>;
|
|
1552
1746
|
readonly readOnly: boolean;
|
|
1553
1747
|
readonly revision: number;
|
|
1554
|
-
readonly themeStyle: ReturnType<typeof toStyle>;
|
|
1555
1748
|
readonly transport: Transport.Interface;
|
|
1556
1749
|
}
|
|
1557
1750
|
interface StableTransport {
|
|
1558
1751
|
readonly transport: Transport.Interface;
|
|
1559
1752
|
readonly capabilities: ReadonlyArray<Transport.Capability>;
|
|
1560
1753
|
}
|
|
1561
|
-
|
|
1754
|
+
/**
|
|
1755
|
+
* The transport, the catalog, and the two host callbacks every hook below reads. It renders no
|
|
1756
|
+
* element of its own: `@domainkit/react` supplies behaviour, state, copy, and accessibility, and
|
|
1757
|
+
* the host application supplies the markup.
|
|
1758
|
+
*/
|
|
1759
|
+
declare function Root({ children, messages, navigate, onEvent, readOnly, revision, transport }: RootProps): ReactElement;
|
|
1562
1760
|
declare function useDomainKit(): ContextValue;
|
|
1761
|
+
/** The catalog `DomainKit.Root` holds, with the host's overrides already merged in. */
|
|
1762
|
+
declare function useMessages(): Catalog;
|
|
1563
1763
|
/** The transport `DomainKit.Root` holds, with the identity it keeps for the whole mount. */
|
|
1564
1764
|
declare function useTransport(): Transport.Interface;
|
|
1565
1765
|
/** Narrow one subtree to read-only without touching the rest of the page. */
|
|
@@ -1567,39 +1767,22 @@ declare function ReadOnly({ children, value }: {
|
|
|
1567
1767
|
readonly children: ReactNode;
|
|
1568
1768
|
readonly value: boolean;
|
|
1569
1769
|
}): import("react/jsx-runtime").JSX.Element;
|
|
1570
|
-
/** Whether this
|
|
1770
|
+
/** Whether this surface may offer controls that change the domain. */
|
|
1571
1771
|
declare function useReadOnly(): boolean;
|
|
1572
|
-
/** Which capability groups the host's transport declares, for gating a
|
|
1772
|
+
/** Which capability groups the host's transport declares, for gating a surface of your own. */
|
|
1573
1773
|
declare function useCapabilities(): ReadonlyArray<Transport.Capability>;
|
|
1574
|
-
declare namespace
|
|
1575
|
-
export {
|
|
1576
|
-
}
|
|
1577
|
-
declare const Kind: (props: PartProps<"span", Record$1<string, unknown>>) => ReactElement;
|
|
1578
|
-
declare const Type: (props: PartProps<"strong", Record$1<string, unknown>>) => ReactElement;
|
|
1579
|
-
declare const Record$1: (props: PartProps<"span", Record$1<string, unknown>>) => ReactElement;
|
|
1580
|
-
declare const Name: (props: PartProps<"span", Record$1<string, unknown>>) => ReactElement;
|
|
1581
|
-
declare const Reason$1: (props: PartProps<"span", Record$1<string, unknown>>) => ReactElement;
|
|
1582
|
-
interface ItemProps extends PartProps<"li", {
|
|
1583
|
-
readonly operation: Plan.Operation["_tag"];
|
|
1584
|
-
}> {
|
|
1585
|
-
readonly operation: Plan.Operation;
|
|
1586
|
-
}
|
|
1587
|
-
declare function Item({ operation, ...props }: ItemProps): ReactElement;
|
|
1588
|
-
interface RootProps$1 extends PartProps<"ul", {
|
|
1589
|
-
readonly count: number;
|
|
1590
|
-
readonly kind: Plan.Kind;
|
|
1591
|
-
}> {
|
|
1592
|
-
readonly count?: number;
|
|
1593
|
-
readonly kind: Plan.Kind;
|
|
1594
|
-
}
|
|
1595
|
-
declare function Root$1({ count, kind, ...props }: RootProps$1): ReactElement;
|
|
1596
|
-
interface ListProps extends Omit<RootProps$1, "children" | "count" | "kind"> {
|
|
1597
|
-
readonly plan: Plan.Model;
|
|
1774
|
+
declare namespace outcome_d_exports {
|
|
1775
|
+
export { Outcome, OutcomeContext, describe, useDescribe };
|
|
1598
1776
|
}
|
|
1599
|
-
/**
|
|
1600
|
-
declare
|
|
1777
|
+
/** The catalog's title and description for one failure. */
|
|
1778
|
+
declare const describe: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => Outcome;
|
|
1779
|
+
/**
|
|
1780
|
+
* `describe` bound to the catalog `DomainKit.Root` holds. The reason alone cannot name the
|
|
1781
|
+
* provider a customer typed a token for, so the surface supplies it in the context.
|
|
1782
|
+
*/
|
|
1783
|
+
declare function useDescribe(): (error: DomainKit.Error, context?: OutcomeContext) => Outcome;
|
|
1601
1784
|
declare namespace records_d_exports {
|
|
1602
|
-
export {
|
|
1785
|
+
export { CopyController, Readiness, RequirementStatus, Sources, Standing, copyText, downloadZoneFile, identity, requirementsKey, statusOf, toZoneFile, useCopy };
|
|
1603
1786
|
}
|
|
1604
1787
|
type Readiness = Transport.Readiness;
|
|
1605
1788
|
type RequirementStatus = Readiness["requirements"][number]["status"];
|
|
@@ -1611,45 +1794,24 @@ interface CopyController {
|
|
|
1611
1794
|
readonly copy: () => void;
|
|
1612
1795
|
}
|
|
1613
1796
|
declare function useCopy(value: string, resetAfter?: number): CopyController;
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
readonly domain: string;
|
|
1624
|
-
readonly records: ReadonlyArray<DnsRecord.Model>;
|
|
1625
|
-
}
|
|
1626
|
-
declare function ZoneFile({ domain, records, ...props }: ZoneFileProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
1627
|
-
/** The readiness this record reached, or `null` when nothing has observed it. */
|
|
1628
|
-
declare const statusOf: (record: DnsRecord.Model, readiness: Readiness | null | undefined) => RequirementStatus | null;
|
|
1629
|
-
interface StatusProps extends PartProps<"span", {
|
|
1630
|
-
readonly status: RequirementStatus;
|
|
1631
|
-
}> {
|
|
1797
|
+
/**
|
|
1798
|
+
* What a row has to say about one record: while a plan is pending it is what the plan will do to
|
|
1799
|
+
* it, and otherwise what the last observation read back.
|
|
1800
|
+
*/
|
|
1801
|
+
type Standing = {
|
|
1802
|
+
readonly _tag: "Operation";
|
|
1803
|
+
readonly operation: Plan.Operation;
|
|
1804
|
+
} | {
|
|
1805
|
+
readonly _tag: "Readiness";
|
|
1632
1806
|
readonly status: RequirementStatus;
|
|
1807
|
+
};
|
|
1808
|
+
interface Sources {
|
|
1809
|
+
/** A plan still awaiting its apply. Pass `null` once one has landed; readiness answers then. */
|
|
1810
|
+
readonly plan?: Plan.Model | null | undefined;
|
|
1811
|
+
readonly readiness?: Readiness | null | undefined;
|
|
1633
1812
|
}
|
|
1634
|
-
|
|
1635
|
-
declare const
|
|
1636
|
-
declare const Body: (props: PartProps<"tbody", Record<string, unknown>>) => ReactElement;
|
|
1637
|
-
declare const Footer: (props: PartProps<"tfoot", Record<string, unknown>>) => ReactElement;
|
|
1638
|
-
declare const Row: (props: PartProps<"tr", Record<string, unknown>>) => ReactElement;
|
|
1639
|
-
declare const Head: (props: PartProps<"th", Record<string, unknown>>) => ReactElement;
|
|
1640
|
-
declare const Cell: (props: PartProps<"td", Record<string, unknown>>) => ReactElement;
|
|
1641
|
-
declare const Caption: (props: PartProps<"caption", Record<string, unknown>>) => ReactElement;
|
|
1642
|
-
declare const Value: (props: PartProps<"span", Record<string, unknown>>) => ReactElement;
|
|
1643
|
-
declare const Purpose: (props: PartProps<"span", Record<string, unknown>>) => ReactElement;
|
|
1644
|
-
declare const CardHeader: (props: PartProps<"div", Record<string, unknown>>) => ReactElement;
|
|
1645
|
-
declare const CardTitle: (props: PartProps<"strong", Record<string, unknown>>) => ReactElement;
|
|
1646
|
-
declare const CardContent: (props: PartProps<"dl", Record<string, unknown>>) => ReactElement;
|
|
1647
|
-
interface RootProps extends PartProps<"table", {
|
|
1648
|
-
readonly count: number;
|
|
1649
|
-
}> {
|
|
1650
|
-
readonly count?: number;
|
|
1651
|
-
}
|
|
1652
|
-
declare function Root({ count, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
1813
|
+
/** The row's standing, or `null` when neither a plan nor an observation covers the record. */
|
|
1814
|
+
declare const statusOf: (record: DnsRecord.Model, sources: Sources) => Standing | null;
|
|
1653
1815
|
/** A stable React key for a requirement: type, name, and data identify a record. */
|
|
1654
1816
|
declare const identity: (record: DnsRecord.Model) => string;
|
|
1655
1817
|
/**
|
|
@@ -1659,22 +1821,6 @@ declare const identity: (record: DnsRecord.Model) => string;
|
|
|
1659
1821
|
* particular decides whether a name may hold anything else, so readiness turns on it.
|
|
1660
1822
|
*/
|
|
1661
1823
|
declare const requirementsKey: (records: ReadonlyArray<DnsRecord.Model>) => string;
|
|
1662
|
-
interface CardProps extends PartProps<"section", {
|
|
1663
|
-
readonly record: string;
|
|
1664
|
-
}> {
|
|
1665
|
-
readonly readiness?: Readiness | null;
|
|
1666
|
-
readonly record: DnsRecord.Model;
|
|
1667
|
-
}
|
|
1668
|
-
declare function Card({ readiness, record, ...props }: CardProps): ReactElement;
|
|
1669
|
-
interface TableProps extends PartProps<"table", {
|
|
1670
|
-
readonly count: number;
|
|
1671
|
-
}> {
|
|
1672
|
-
readonly caption?: string;
|
|
1673
|
-
readonly readiness?: Readiness | null;
|
|
1674
|
-
readonly records: ReadonlyArray<DnsRecord.Model>;
|
|
1675
|
-
}
|
|
1676
|
-
/** The default records presentation: one row per requirement, with readiness when there is any. */
|
|
1677
|
-
declare function Table({ caption, readiness, records, ...props }: TableProps): ReactElement;
|
|
1678
1824
|
declare namespace testing_d_exports {
|
|
1679
1825
|
export { RecordedCall, RecordingTransport, TransportOptions, transport$1 as transport };
|
|
1680
1826
|
}
|
|
@@ -1726,5 +1872,5 @@ declare const Failure: {
|
|
|
1726
1872
|
}, "_tag">;
|
|
1727
1873
|
};
|
|
1728
1874
|
//#endregion
|
|
1729
|
-
export {
|
|
1875
|
+
export { cleanup_d_exports as Cleanup, connect_d_exports as Connect, domain_d_exports as Domain, domain_kit_d_exports as DomainKit, Event, Failure, 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 };
|
|
1730
1876
|
//# sourceMappingURL=index.d.mts.map
|