@domainkit/react 0.9.1 → 0.11.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 +52 -4
- package/dist/index.d.mts +333 -50
- package/dist/index.mjs +1121 -248
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +580 -50
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -240,7 +240,7 @@ declare const Event: {
|
|
|
240
240
|
type Listener = (event: Event) => void;
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/attempt.d.ts
|
|
243
|
-
type State$
|
|
243
|
+
type State$3 = Data.TaggedEnum<{
|
|
244
244
|
Idle: {};
|
|
245
245
|
Planning: {};
|
|
246
246
|
Planned: {
|
|
@@ -268,7 +268,7 @@ type State$2 = Data.TaggedEnum<{
|
|
|
268
268
|
readonly error: DomainKit.Error;
|
|
269
269
|
};
|
|
270
270
|
}>;
|
|
271
|
-
declare const State$
|
|
271
|
+
declare const State$3: {
|
|
272
272
|
readonly $is: <Tag extends "Applied" | "Applying" | "Approving" | "Failure" | "Idle" | "Planned" | "Planning" | "Rejected" | "Rejecting">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
273
273
|
readonly _tag: "Applied";
|
|
274
274
|
readonly plan: Plan.Model | null;
|
|
@@ -475,7 +475,7 @@ declare const State$2: {
|
|
|
475
475
|
}, "_tag">;
|
|
476
476
|
};
|
|
477
477
|
interface Controller$2 {
|
|
478
|
-
readonly state: State$
|
|
478
|
+
readonly state: State$3;
|
|
479
479
|
/** Build a plan. The plan itself rides on the state, from `Planned` through `Applied`. */
|
|
480
480
|
readonly plan: () => void;
|
|
481
481
|
/** Authorize the digest and apply it. Pass `operationIds` to approve part of the plan. */
|
|
@@ -501,6 +501,68 @@ type PartProps<Tag extends ElementType = "div", State extends Record<string, unk
|
|
|
501
501
|
readonly render?: useRender.RenderProp<State>;
|
|
502
502
|
readonly style?: Style<State>;
|
|
503
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
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* The outcome itself. It announces, so a customer reading with assistive tech hears it. A `tone`
|
|
539
|
+
* or `layout` of its own reaches every part below it, so the glyph and the words agree with the
|
|
540
|
+
* root's own attributes.
|
|
541
|
+
*/
|
|
542
|
+
declare function Root$7({ layout, tone, ...props }: RootProps$7): ReactElement;
|
|
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. An outcome whose title says everything renders none. */
|
|
557
|
+
declare function Description(props: DescriptionProps): ReactElement | null;
|
|
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;
|
|
504
566
|
//#endregion
|
|
505
567
|
//#region src/review.d.ts
|
|
506
568
|
interface ReviewState extends Record<string, unknown> {
|
|
@@ -511,7 +573,7 @@ interface KindProps {
|
|
|
511
573
|
readonly kind: Plan.Kind;
|
|
512
574
|
}
|
|
513
575
|
interface StatusProps$5 extends PartProps<"p", ReviewState>, KindProps {}
|
|
514
|
-
interface OutcomeProps$4 extends
|
|
576
|
+
interface OutcomeProps$4 extends RootProps$7, KindProps {}
|
|
515
577
|
interface ActionsProps$2 extends PartProps<"div", ReviewState>, KindProps {}
|
|
516
578
|
interface DialogProps$3 extends KindProps {
|
|
517
579
|
readonly children?: ReactNode;
|
|
@@ -525,7 +587,7 @@ interface DialogProps$3 extends KindProps {
|
|
|
525
587
|
readonly trigger?: ReactNode;
|
|
526
588
|
}
|
|
527
589
|
declare namespace cleanup_d_exports {
|
|
528
|
-
export { Actions$1 as Actions, ActionsProps$1 as ActionsProps, Controller$2 as Controller, Dialog$2 as Dialog, DialogProps$2 as DialogProps, Flow$3 as Flow, FlowProps$3 as FlowProps, Options$3 as Options, Outcome$
|
|
590
|
+
export { Actions$1 as Actions, ActionsProps$1 as ActionsProps, Controller$2 as Controller, Dialog$2 as Dialog, DialogProps$2 as DialogProps, Flow$3 as Flow, FlowProps$3 as FlowProps, Options$3 as Options, Outcome$4 as Outcome, OutcomeProps$3 as OutcomeProps, Root$6 as Root, RootProps$6 as RootProps, RootState$4 as RootState, State$3 as State, Status$4 as Status, StatusProps$4 as StatusProps, useController$3 as useController };
|
|
529
591
|
}
|
|
530
592
|
interface Options$3 {
|
|
531
593
|
readonly domain: string;
|
|
@@ -539,7 +601,7 @@ interface Options$3 {
|
|
|
539
601
|
*/
|
|
540
602
|
declare function useController$3({ domain, onCleaned, receiptId }: Options$3): Controller$2;
|
|
541
603
|
interface RootState$4 extends Record<string, unknown> {
|
|
542
|
-
readonly status: State$
|
|
604
|
+
readonly status: State$3["_tag"];
|
|
543
605
|
}
|
|
544
606
|
interface RootProps$6 extends PartProps<"div", RootState$4> {
|
|
545
607
|
readonly controller: Controller$2;
|
|
@@ -550,7 +612,7 @@ declare function Dialog$2(props: DialogProps$2): ReactElement;
|
|
|
550
612
|
interface ActionsProps$1 extends Omit<ActionsProps$2, "kind"> {}
|
|
551
613
|
declare function Actions$1(props: ActionsProps$1): ReactElement | null;
|
|
552
614
|
interface OutcomeProps$3 extends Omit<OutcomeProps$4, "kind"> {}
|
|
553
|
-
declare function Outcome$
|
|
615
|
+
declare function Outcome$4(props: OutcomeProps$3): ReactElement | null;
|
|
554
616
|
interface StatusProps$4 extends Omit<StatusProps$5, "kind"> {}
|
|
555
617
|
declare function Status$4(props: StatusProps$4): ReactElement;
|
|
556
618
|
interface FlowProps$3 extends Omit<RootProps$6, "controller"> {
|
|
@@ -580,7 +642,7 @@ interface MarkProps extends PartProps<"span", MarkState> {
|
|
|
580
642
|
*/
|
|
581
643
|
declare function Mark({ provider, ...props }: MarkProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
582
644
|
declare namespace connect_d_exports {
|
|
583
|
-
export { Candidate, Card$1 as Card, CardProps$1 as CardProps, ConnectInput, Controller$1 as Controller, Descriptor, Dialog$1 as Dialog, DialogProps$1 as DialogProps, Discovery, Field, Flow$2 as Flow, FlowProps$2 as FlowProps, Form, FormProps, MethodDescriptor, Options$2 as Options, Outcome$
|
|
645
|
+
export { Attempt, Candidate, Card$1 as Card, CardProps$1 as CardProps, ConnectInput, Controller$1 as Controller, Descriptor, Dialog$1 as Dialog, DialogProps$1 as DialogProps, DisconnectDialog, DisconnectDialogProps, Discovery, Field, Flow$2 as Flow, FlowProps$2 as FlowProps, Form, FormProps, Invitation, MethodDescriptor, Options$2 as Options, Outcome$3 as Outcome, OutcomeProps$2 as OutcomeProps, Prompt, PromptProps, Root$5 as Root, RootProps$5 as RootProps, RootState$3 as RootState, Snapshot, State$1 as State, Status$3 as Status, StatusProps$3 as StatusProps, answeredInPlace, holdsConnection, hostProvider, offering, useController$2 as useController };
|
|
584
646
|
}
|
|
585
647
|
type Snapshot = Transport.Snapshot;
|
|
586
648
|
type Discovery = Transport.Discovery;
|
|
@@ -609,6 +671,7 @@ type State$1 = Data.TaggedEnum<{
|
|
|
609
671
|
};
|
|
610
672
|
Submitting: {
|
|
611
673
|
readonly snapshot: Snapshot | null;
|
|
674
|
+
readonly discovery: Discovery | null;
|
|
612
675
|
};
|
|
613
676
|
Redirecting: {
|
|
614
677
|
readonly url: string;
|
|
@@ -620,6 +683,10 @@ type State$1 = Data.TaggedEnum<{
|
|
|
620
683
|
};
|
|
621
684
|
Failure: {
|
|
622
685
|
readonly error: DomainKit.Error;
|
|
686
|
+
readonly snapshot: Snapshot | null;
|
|
687
|
+
readonly discovery: Discovery | null;
|
|
688
|
+
/** The provider and method the customer was using, when a command failed rather than a read. */
|
|
689
|
+
readonly attempt: Attempt | null;
|
|
623
690
|
};
|
|
624
691
|
}>;
|
|
625
692
|
declare const State$1: {
|
|
@@ -637,6 +704,9 @@ declare const State$1: {
|
|
|
637
704
|
}> | Extract<{
|
|
638
705
|
readonly _tag: "Failure";
|
|
639
706
|
readonly error: DomainKit.Error;
|
|
707
|
+
readonly snapshot: Snapshot | null;
|
|
708
|
+
readonly discovery: Discovery | null;
|
|
709
|
+
readonly attempt: Attempt | null;
|
|
640
710
|
}, {
|
|
641
711
|
readonly _tag: Tag;
|
|
642
712
|
}> | Extract<{
|
|
@@ -664,6 +734,7 @@ declare const State$1: {
|
|
|
664
734
|
}> | Extract<{
|
|
665
735
|
readonly _tag: "Submitting";
|
|
666
736
|
readonly snapshot: Snapshot | null;
|
|
737
|
+
readonly discovery: Discovery | null;
|
|
667
738
|
}, {
|
|
668
739
|
readonly _tag: Tag;
|
|
669
740
|
}>;
|
|
@@ -678,6 +749,9 @@ declare const State$1: {
|
|
|
678
749
|
} | {
|
|
679
750
|
readonly _tag: "Failure";
|
|
680
751
|
readonly error: DomainKit.Error;
|
|
752
|
+
readonly snapshot: Snapshot | null;
|
|
753
|
+
readonly discovery: Discovery | null;
|
|
754
|
+
readonly attempt: Attempt | null;
|
|
681
755
|
} | {
|
|
682
756
|
readonly _tag: "Loading";
|
|
683
757
|
readonly snapshot: Snapshot | null;
|
|
@@ -695,6 +769,7 @@ declare const State$1: {
|
|
|
695
769
|
} | {
|
|
696
770
|
readonly _tag: "Submitting";
|
|
697
771
|
readonly snapshot: Snapshot | null;
|
|
772
|
+
readonly discovery: Discovery | null;
|
|
698
773
|
}, {
|
|
699
774
|
readonly _tag: Tag;
|
|
700
775
|
}>) => any; }>(cases: Cases): (value: {
|
|
@@ -707,6 +782,9 @@ declare const State$1: {
|
|
|
707
782
|
} | {
|
|
708
783
|
readonly _tag: "Failure";
|
|
709
784
|
readonly error: DomainKit.Error;
|
|
785
|
+
readonly snapshot: Snapshot | null;
|
|
786
|
+
readonly discovery: Discovery | null;
|
|
787
|
+
readonly attempt: Attempt | null;
|
|
710
788
|
} | {
|
|
711
789
|
readonly _tag: "Loading";
|
|
712
790
|
readonly snapshot: Snapshot | null;
|
|
@@ -724,6 +802,7 @@ declare const State$1: {
|
|
|
724
802
|
} | {
|
|
725
803
|
readonly _tag: "Submitting";
|
|
726
804
|
readonly snapshot: Snapshot | null;
|
|
805
|
+
readonly discovery: Discovery | null;
|
|
727
806
|
}) => import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
|
|
728
807
|
<Cases extends { readonly [Tag in "Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]: (args: Extract<{
|
|
729
808
|
readonly _tag: "Connected";
|
|
@@ -735,6 +814,9 @@ declare const State$1: {
|
|
|
735
814
|
} | {
|
|
736
815
|
readonly _tag: "Failure";
|
|
737
816
|
readonly error: DomainKit.Error;
|
|
817
|
+
readonly snapshot: Snapshot | null;
|
|
818
|
+
readonly discovery: Discovery | null;
|
|
819
|
+
readonly attempt: Attempt | null;
|
|
738
820
|
} | {
|
|
739
821
|
readonly _tag: "Loading";
|
|
740
822
|
readonly snapshot: Snapshot | null;
|
|
@@ -752,6 +834,7 @@ declare const State$1: {
|
|
|
752
834
|
} | {
|
|
753
835
|
readonly _tag: "Submitting";
|
|
754
836
|
readonly snapshot: Snapshot | null;
|
|
837
|
+
readonly discovery: Discovery | null;
|
|
755
838
|
}, {
|
|
756
839
|
readonly _tag: Tag;
|
|
757
840
|
}>) => any; }>(value: {
|
|
@@ -764,6 +847,9 @@ declare const State$1: {
|
|
|
764
847
|
} | {
|
|
765
848
|
readonly _tag: "Failure";
|
|
766
849
|
readonly error: DomainKit.Error;
|
|
850
|
+
readonly snapshot: Snapshot | null;
|
|
851
|
+
readonly discovery: Discovery | null;
|
|
852
|
+
readonly attempt: Attempt | null;
|
|
767
853
|
} | {
|
|
768
854
|
readonly _tag: "Loading";
|
|
769
855
|
readonly snapshot: Snapshot | null;
|
|
@@ -781,6 +867,7 @@ declare const State$1: {
|
|
|
781
867
|
} | {
|
|
782
868
|
readonly _tag: "Submitting";
|
|
783
869
|
readonly snapshot: Snapshot | null;
|
|
870
|
+
readonly discovery: Discovery | null;
|
|
784
871
|
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Disconnected" | "Failure" | "Loading" | "Reconnect" | "Redirecting" | "SelectionRequired" | "Submitting"]>>;
|
|
785
872
|
};
|
|
786
873
|
readonly Connected: Data.TaggedEnum.ConstructorFrom<{
|
|
@@ -795,6 +882,9 @@ declare const State$1: {
|
|
|
795
882
|
readonly Failure: Data.TaggedEnum.ConstructorFrom<{
|
|
796
883
|
readonly _tag: "Failure";
|
|
797
884
|
readonly error: DomainKit.Error;
|
|
885
|
+
readonly snapshot: Snapshot | null;
|
|
886
|
+
readonly discovery: Discovery | null;
|
|
887
|
+
readonly attempt: Attempt | null;
|
|
798
888
|
}, "_tag">;
|
|
799
889
|
readonly Loading: Data.TaggedEnum.ConstructorFrom<{
|
|
800
890
|
readonly _tag: "Loading";
|
|
@@ -817,8 +907,14 @@ declare const State$1: {
|
|
|
817
907
|
readonly Submitting: Data.TaggedEnum.ConstructorFrom<{
|
|
818
908
|
readonly _tag: "Submitting";
|
|
819
909
|
readonly snapshot: Snapshot | null;
|
|
910
|
+
readonly discovery: Discovery | null;
|
|
820
911
|
}, "_tag">;
|
|
821
912
|
};
|
|
913
|
+
/** Which provider and method the failed command was for, so the form can answer beside it. */
|
|
914
|
+
interface Attempt {
|
|
915
|
+
readonly provider: string;
|
|
916
|
+
readonly method: Storage.AuthMethod;
|
|
917
|
+
}
|
|
822
918
|
interface ConnectInput {
|
|
823
919
|
readonly provider: string;
|
|
824
920
|
readonly method: Storage.AuthMethod;
|
|
@@ -828,6 +924,13 @@ interface ConnectInput {
|
|
|
828
924
|
readonly returnTo?: string;
|
|
829
925
|
}
|
|
830
926
|
interface Controller$1 {
|
|
927
|
+
readonly domain: string;
|
|
928
|
+
/**
|
|
929
|
+
* How many times a connection has been established for this domain on this surface: a token
|
|
930
|
+
* connect that landed, or a load that followed this library's own redirect back. It only ever
|
|
931
|
+
* grows, so a flow acts on a change rather than on a state that would fire again every render.
|
|
932
|
+
*/
|
|
933
|
+
readonly established: number;
|
|
831
934
|
readonly state: State$1;
|
|
832
935
|
readonly snapshot: Snapshot | null;
|
|
833
936
|
readonly discovery: Discovery | null;
|
|
@@ -868,23 +971,47 @@ interface RootProps$5 extends PartProps<"div", RootState$3> {
|
|
|
868
971
|
readonly controller: Controller$1;
|
|
869
972
|
}
|
|
870
973
|
declare function Root$5({ controller, ...props }: RootProps$5): ReactElement;
|
|
871
|
-
|
|
974
|
+
/**
|
|
975
|
+
* Whether a failure is already answered where it was raised: beside the method the customer used.
|
|
976
|
+
* A flow rendering its own `Outcome` beside the dialog skips it, so the failure announces once.
|
|
977
|
+
*/
|
|
978
|
+
declare const answeredInPlace: (controller: Controller$1) => boolean;
|
|
979
|
+
/**
|
|
980
|
+
* Whether the surface should read as connected: it is, or a command it started is in flight over a
|
|
981
|
+
* connection that was. The card and the dialog it opened stay on screen for the length of the
|
|
982
|
+
* command rather than vanishing under the customer half way through it.
|
|
983
|
+
*/
|
|
984
|
+
declare const holdsConnection: (controller: Controller$1) => boolean;
|
|
985
|
+
/**
|
|
986
|
+
* The provider whose nameservers serve this domain, as the snapshot describes it. Discovery names
|
|
987
|
+
* it by id; without a descriptor there is nothing to draw, so there is no host.
|
|
988
|
+
*/
|
|
989
|
+
declare const hostProvider: (controller: Controller$1) => Descriptor | null;
|
|
990
|
+
interface OutcomeProps$2 extends RootProps$7 {
|
|
872
991
|
readonly controller: Controller$1;
|
|
873
992
|
}
|
|
874
|
-
/**
|
|
875
|
-
|
|
993
|
+
/**
|
|
994
|
+
* The last failure as a card: media, the catalog's title and description, and the retry the flow
|
|
995
|
+
* allows. Children replace the composition and keep the binding.
|
|
996
|
+
*/
|
|
997
|
+
declare function Outcome$3({ children, controller, ...props }: OutcomeProps$2): ReactElement | null;
|
|
876
998
|
interface StatusProps$3 extends PartProps<"p", RootState$3> {
|
|
877
999
|
readonly controller: Controller$1;
|
|
878
1000
|
}
|
|
879
1001
|
declare function Status$3({ controller, ...props }: StatusProps$3): ReactElement;
|
|
880
1002
|
interface FormProps extends PartProps<"div", RootState$3> {
|
|
881
1003
|
readonly controller: Controller$1;
|
|
1004
|
+
/**
|
|
1005
|
+
* Narrow to this provider whatever discovery found. The dialog's header menu sets it, so a
|
|
1006
|
+
* customer who picks another provider gets the same one-decision surface for it.
|
|
1007
|
+
*/
|
|
1008
|
+
readonly provider?: string;
|
|
882
1009
|
}
|
|
883
1010
|
/**
|
|
884
1011
|
* Everything a disconnected domain can do: a connection discovery already found, the connections
|
|
885
1012
|
* this owner already has, then each provider's declared methods.
|
|
886
1013
|
*/
|
|
887
|
-
declare function Form({ controller, ...props }: FormProps): ReactElement;
|
|
1014
|
+
declare function Form({ controller, provider: narrowed, ...props }: FormProps): ReactElement;
|
|
888
1015
|
interface DialogProps$1 {
|
|
889
1016
|
readonly controller: Controller$1;
|
|
890
1017
|
readonly children?: ReactNode;
|
|
@@ -898,19 +1025,72 @@ interface DialogProps$1 {
|
|
|
898
1025
|
}
|
|
899
1026
|
/** The connect surface. Without `render` it is a Base UI dialog behind `trigger`. */
|
|
900
1027
|
declare function Dialog$1({ children, controller, render, title, trigger }: DialogProps$1): ReactElement;
|
|
1028
|
+
/**
|
|
1029
|
+
* Whether the flow offers a connect surface: only when discovery names a host, always, or never.
|
|
1030
|
+
* `never` is a host that decides for itself, such as a domain already ready without DomainKit; a
|
|
1031
|
+
* connected domain keeps its status and its disconnect either way.
|
|
1032
|
+
*/
|
|
1033
|
+
type Invitation = "always" | "detected" | "never";
|
|
1034
|
+
/**
|
|
1035
|
+
* Whether the connect surface has anything to offer for this domain: a provider that serves the
|
|
1036
|
+
* zone, a connection discovery already found, one the owner already holds, or a command already
|
|
1037
|
+
* running. Never while a connection is held, which is what `holdsConnection` answers. `Prompt`
|
|
1038
|
+
* renders on this, and `Domain.Flow` reports it so a host can order its own offers beside
|
|
1039
|
+
* DomainKit's rather than competing with them.
|
|
1040
|
+
*/
|
|
1041
|
+
declare const offering: (controller: Controller$1, connect?: Invitation) => boolean;
|
|
1042
|
+
interface PromptProps extends PartProps<"div", RootState$3> {
|
|
1043
|
+
readonly controller: Controller$1;
|
|
1044
|
+
/**
|
|
1045
|
+
* `detected` offers nothing when discovery names no host, which is the honest answer for a
|
|
1046
|
+
* domain DomainKit cannot write to. `always` offers the all-providers dialog anyway, and
|
|
1047
|
+
* `never` offers none.
|
|
1048
|
+
*/
|
|
1049
|
+
readonly connect?: Invitation;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* The disconnected offer: the provider whose nameservers serve the domain, what that means, and
|
|
1053
|
+
* the trigger that connects it. With no host detected there is nothing to offer, so nothing
|
|
1054
|
+
* renders unless the host application asks for the dialog anyway.
|
|
1055
|
+
*/
|
|
1056
|
+
declare function Prompt({ connect, controller, ...props }: PromptProps): ReactElement | null;
|
|
1057
|
+
interface DisconnectDialogProps {
|
|
1058
|
+
readonly controller: Controller$1;
|
|
1059
|
+
/** The receipt the cleanup this dialog ran produced, for a host that tracks its own state. */
|
|
1060
|
+
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
1061
|
+
readonly trigger?: ReactNode;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Letting a provider go, with the records DomainKit added as one decision rather than two.
|
|
1065
|
+
* Confirming removes what the domain's apply receipt proves DomainKit created, then releases the
|
|
1066
|
+
* connection; a plan with nothing in it is not a failure, so it goes straight to the release.
|
|
1067
|
+
*
|
|
1068
|
+
* The cleanup is this dialog's own, so nothing re-reads the snapshot in between: the disconnect
|
|
1069
|
+
* needs the connection the cleanup just used.
|
|
1070
|
+
*/
|
|
1071
|
+
declare function DisconnectDialog({ controller, onCleaned, trigger }: DisconnectDialogProps): ReactElement;
|
|
901
1072
|
interface CardProps$1 extends PartProps<"div", RootState$3> {
|
|
902
1073
|
readonly controller: Controller$1;
|
|
1074
|
+
/** The receipt a cleanup run from the disconnect dialog produced. */
|
|
1075
|
+
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
903
1076
|
}
|
|
904
|
-
/**
|
|
905
|
-
|
|
1077
|
+
/**
|
|
1078
|
+
* A connected domain, with the prompt card's anatomy: the provider's mark, the name the customer
|
|
1079
|
+
* knows it by, where the connection stands, and the one action that ends it.
|
|
1080
|
+
*/
|
|
1081
|
+
declare function Card$1({ controller, onCleaned, ...props }: CardProps$1): ReactElement;
|
|
906
1082
|
interface FlowProps$2 extends Omit<RootProps$5, "controller"> {
|
|
907
1083
|
readonly domain: string;
|
|
908
1084
|
readonly returnTo?: string | null;
|
|
1085
|
+
/** Offer the connect dialog even when discovery names no host. Defaults to `detected`. */
|
|
1086
|
+
readonly connect?: Invitation;
|
|
1087
|
+
/** The receipt a cleanup run from the disconnect dialog produced. */
|
|
1088
|
+
readonly onCleaned?: (receipt: Receipt.Model) => void;
|
|
909
1089
|
}
|
|
910
|
-
/** Connection on its own: the card once connected, the
|
|
911
|
-
declare function Flow$2({ domain, returnTo, ...props }: FlowProps$2): ReactElement;
|
|
1090
|
+
/** Connection on its own: the card once connected, the prompt until then. */
|
|
1091
|
+
declare function Flow$2({ connect, domain, onCleaned, returnTo, ...props }: FlowProps$2): ReactElement;
|
|
912
1092
|
declare namespace provision_d_exports {
|
|
913
|
-
export { Actions, ActionsProps, Controller$2 as Controller, Dialog, DialogProps, Flow$1 as Flow, FlowProps$1 as FlowProps, Options$1 as Options, Outcome$
|
|
1093
|
+
export { Actions, ActionsProps, Controller$2 as Controller, Dialog, DialogProps, Flow$1 as Flow, FlowProps$1 as FlowProps, Options$1 as Options, Outcome$2 as Outcome, OutcomeProps$1 as OutcomeProps, Root$4 as Root, RootProps$4 as RootProps, RootState$2 as RootState, State$3 as State, Status$2 as Status, StatusProps$2 as StatusProps, useController$1 as useController };
|
|
914
1094
|
}
|
|
915
1095
|
interface Options$1 {
|
|
916
1096
|
readonly domain: string;
|
|
@@ -919,7 +1099,7 @@ interface Options$1 {
|
|
|
919
1099
|
}
|
|
920
1100
|
declare function useController$1({ domain, onApplied, requirements }: Options$1): Controller$2;
|
|
921
1101
|
interface RootState$2 extends Record<string, unknown> {
|
|
922
|
-
readonly status: State$
|
|
1102
|
+
readonly status: State$3["_tag"];
|
|
923
1103
|
}
|
|
924
1104
|
interface RootProps$4 extends PartProps<"div", RootState$2> {
|
|
925
1105
|
readonly controller: Controller$2;
|
|
@@ -931,7 +1111,7 @@ interface ActionsProps extends Omit<ActionsProps$2, "kind"> {}
|
|
|
931
1111
|
/** Approve and Decline for a plan already under review. */
|
|
932
1112
|
declare function Actions(props: ActionsProps): ReactElement | null;
|
|
933
1113
|
interface OutcomeProps$1 extends Omit<OutcomeProps$4, "kind"> {}
|
|
934
|
-
declare function Outcome$
|
|
1114
|
+
declare function Outcome$2(props: OutcomeProps$1): ReactElement | null;
|
|
935
1115
|
interface StatusProps$2 extends Omit<StatusProps$5, "kind"> {}
|
|
936
1116
|
declare function Status$2(props: StatusProps$2): ReactElement;
|
|
937
1117
|
interface FlowProps$1 extends Omit<RootProps$4, "controller"> {
|
|
@@ -943,7 +1123,7 @@ interface FlowProps$1 extends Omit<RootProps$4, "controller"> {
|
|
|
943
1123
|
/** Provisioning on its own: a trigger that plans, then the review dialog. */
|
|
944
1124
|
declare function Flow$1({ domain, onApplied, requirements, trigger, ...props }: FlowProps$1): import("react/jsx-runtime").JSX.Element;
|
|
945
1125
|
declare namespace verify_d_exports {
|
|
946
|
-
export { Controller, Evidence, EvidenceProps, HostEvidence, ObserveAction, ObserveActionProps, Options, Outcome, OutcomeProps, Readiness$1 as Readiness, Requirement, Root$3 as Root, RootProps$3 as RootProps, RootState$1 as RootState, State, Status$1 as Status, StatusProps$1 as StatusProps, useController };
|
|
1126
|
+
export { Controller, Evidence, EvidenceProps, HostEvidence, ObserveAction, ObserveActionProps, Options, Outcome$1 as Outcome, OutcomeProps, Readiness$1 as Readiness, Requirement, Root$3 as Root, RootProps$3 as RootProps, RootState$1 as RootState, State, Status$1 as Status, StatusProps$1 as StatusProps, useController };
|
|
947
1127
|
}
|
|
948
1128
|
type Readiness$1 = Transport.Readiness;
|
|
949
1129
|
type HostEvidence = Readiness$1["host"][number];
|
|
@@ -1102,10 +1282,14 @@ interface EvidenceProps {
|
|
|
1102
1282
|
* anything DomainKit cannot observe but the host feeds in.
|
|
1103
1283
|
*/
|
|
1104
1284
|
declare function Evidence({ readiness }: EvidenceProps): ReactElement;
|
|
1105
|
-
interface OutcomeProps extends
|
|
1285
|
+
interface OutcomeProps extends RootProps$7 {
|
|
1106
1286
|
readonly controller: Controller;
|
|
1107
1287
|
}
|
|
1108
|
-
|
|
1288
|
+
/**
|
|
1289
|
+
* The last observation that failed. Observing reads the world rather than changing the domain, so
|
|
1290
|
+
* the retry stays even in read-only.
|
|
1291
|
+
*/
|
|
1292
|
+
declare function Outcome$1({ children, controller, ...props }: OutcomeProps): ReactElement | null;
|
|
1109
1293
|
interface StatusProps$1 extends Omit<RootProps$3, "render"> {
|
|
1110
1294
|
/** Replace the popover surface with a panel of the host's own. */
|
|
1111
1295
|
readonly render?: (props: {
|
|
@@ -1116,7 +1300,7 @@ interface StatusProps$1 extends Omit<RootProps$3, "render"> {
|
|
|
1116
1300
|
/** The default verification slot: a button that observes, with the evidence behind it. */
|
|
1117
1301
|
declare function Status$1({ controller, render, ...props }: StatusProps$1): ReactElement;
|
|
1118
1302
|
declare namespace domain_d_exports {
|
|
1119
|
-
export { ActionsSlotProps, ConnectionSlotProps, Flow, FlowProps, FlowState, RecordsSlotProps, Slots, VerificationSlotProps };
|
|
1303
|
+
export { ActionsSlotProps, ConnectionSlotProps, Flow, FlowProps, FlowState, RecordsSlotProps, Review, Slots, VerificationSlotProps };
|
|
1120
1304
|
}
|
|
1121
1305
|
interface RecordsSlotProps {
|
|
1122
1306
|
readonly records: ReadonlyArray<DnsRecord.Model>;
|
|
@@ -1137,6 +1321,8 @@ interface ActionsSlotProps {
|
|
|
1137
1321
|
interface ConnectionSlotProps {
|
|
1138
1322
|
readonly controller: Controller$1;
|
|
1139
1323
|
readonly domain: string;
|
|
1324
|
+
/** What the flow was told to offer when discovery names no host. */
|
|
1325
|
+
readonly connect: Invitation;
|
|
1140
1326
|
}
|
|
1141
1327
|
/**
|
|
1142
1328
|
* Each slot replaces one part of the flow and keeps the rest. Every slot has a default, so
|
|
@@ -1149,12 +1335,34 @@ interface Slots {
|
|
|
1149
1335
|
readonly verification?: (props: VerificationSlotProps) => ReactNode;
|
|
1150
1336
|
/** Defaults to Approve and Decline, plus cleanup when the transport declares it. */
|
|
1151
1337
|
readonly actions?: (props: ActionsSlotProps) => ReactNode;
|
|
1152
|
-
/** Defaults to `Connect.Card` once connected and `Connect.
|
|
1338
|
+
/** Defaults to `Connect.Card` once connected and `Connect.Prompt` until then. */
|
|
1153
1339
|
readonly connection?: (props: ConnectionSlotProps) => ReactNode;
|
|
1154
1340
|
}
|
|
1341
|
+
/**
|
|
1342
|
+
* What DomainKit has to say about this domain, on the part's data attributes, in `className` and
|
|
1343
|
+
* `style` callbacks, and through `onState`. A host reads `connected` and `offering` to order its
|
|
1344
|
+
* own offers beside DomainKit's: an offer of its own competes while `offering` is true, and a
|
|
1345
|
+
* domain DomainKit holds needs none.
|
|
1346
|
+
*/
|
|
1155
1347
|
interface FlowState extends Record<string, unknown> {
|
|
1156
1348
|
readonly connection: State$1["_tag"];
|
|
1157
|
-
readonly provisioning: State$
|
|
1349
|
+
readonly provisioning: State$3["_tag"];
|
|
1350
|
+
/**
|
|
1351
|
+
* DomainKit holds a connection for this domain, including while a command it started over that
|
|
1352
|
+
* connection is still running. `offering` is never true at the same time.
|
|
1353
|
+
*/
|
|
1354
|
+
readonly connected: boolean;
|
|
1355
|
+
/** The connect surface has something to offer, so a host's own offer would compete with it. */
|
|
1356
|
+
readonly offering: boolean;
|
|
1357
|
+
/** Who holds the connection, or whose nameservers serve the zone. */
|
|
1358
|
+
readonly provider: string | null;
|
|
1359
|
+
/**
|
|
1360
|
+
* The apply receipt this domain's latest provisioning attempt produced, which is what cleanup
|
|
1361
|
+
* plans from. A host's own "remove this domain" surface offers cleanup only when there is one.
|
|
1362
|
+
*/
|
|
1363
|
+
readonly receiptId: Receipt.ReceiptId | null;
|
|
1364
|
+
/** `receiptId !== null`: DomainKit applied records here and can prove which. */
|
|
1365
|
+
readonly applied: boolean;
|
|
1158
1366
|
}
|
|
1159
1367
|
interface FlowProps extends Omit<PartProps<"div", FlowState>, "children"> {
|
|
1160
1368
|
readonly domain: string;
|
|
@@ -1169,13 +1377,28 @@ interface FlowProps extends Omit<PartProps<"div", FlowState>, "children"> {
|
|
|
1169
1377
|
readonly returnTo?: string | null;
|
|
1170
1378
|
/** Render this domain's state without the controls that change it. Defaults to the root's. */
|
|
1171
1379
|
readonly readOnly?: boolean;
|
|
1380
|
+
/**
|
|
1381
|
+
* Offer the connect dialog even when discovery names no host, for a host application that lets
|
|
1382
|
+
* a customer connect a provider the domain's nameservers do not point at, or `never` for a
|
|
1383
|
+
* domain the host has already settled another way. Defaults to `detected`.
|
|
1384
|
+
*/
|
|
1385
|
+
readonly connect?: Invitation;
|
|
1386
|
+
/** Fires whenever what DomainKit has to say about this domain changes, and once on mount. */
|
|
1387
|
+
readonly onState?: (state: FlowState) => void;
|
|
1388
|
+
/**
|
|
1389
|
+
* `auto` plans and opens the review the moment a connection lands, so connecting and adding the
|
|
1390
|
+
* records is one pass rather than three. `manual` waits for the trigger.
|
|
1391
|
+
*/
|
|
1392
|
+
readonly review?: Review;
|
|
1172
1393
|
}
|
|
1394
|
+
/** Whether the flow opens the plan itself once a connection lands, or waits to be asked. */
|
|
1395
|
+
type Review = "auto" | "manual";
|
|
1173
1396
|
/**
|
|
1174
1397
|
* The whole lifecycle for one domain: connect, review, apply, observe, clean up. The flow renders
|
|
1175
1398
|
* only what the transport declares, and every part of it is a slot with a default. It adds no
|
|
1176
1399
|
* layout containers of its own, so a host's grid can place the slot output directly.
|
|
1177
1400
|
*/
|
|
1178
|
-
declare function Flow({ domain, onApplied, onCleaned, readOnly, requirements, returnTo, slots, ...props }: FlowProps): ReactElement;
|
|
1401
|
+
declare function Flow({ connect, domain, onApplied, onCleaned, onState, readOnly, requirements, returnTo, review, slots, ...props }: FlowProps): ReactElement;
|
|
1179
1402
|
//#endregion
|
|
1180
1403
|
//#region src/icons.d.ts
|
|
1181
1404
|
/**
|
|
@@ -1183,6 +1406,8 @@ declare function Flow({ domain, onApplied, onCleaned, readOnly, requirements, re
|
|
|
1183
1406
|
* an icon prop of its own, so a host swaps the whole set once on `DomainKit.Root`.
|
|
1184
1407
|
*/
|
|
1185
1408
|
interface Icons {
|
|
1409
|
+
/** Points at what a control opens: the provider menu's own marker. */
|
|
1410
|
+
readonly chevron: ReactNode;
|
|
1186
1411
|
readonly close: ReactNode;
|
|
1187
1412
|
readonly copied: ReactNode;
|
|
1188
1413
|
readonly copy: ReactNode;
|
|
@@ -1191,8 +1416,10 @@ interface Icons {
|
|
|
1191
1416
|
readonly failure: ReactNode;
|
|
1192
1417
|
readonly pending: ReactNode;
|
|
1193
1418
|
readonly success: ReactNode;
|
|
1419
|
+
readonly warning: ReactNode;
|
|
1194
1420
|
}
|
|
1195
1421
|
declare const defaultIcons: {
|
|
1422
|
+
readonly chevron: import("react/jsx-runtime").JSX.Element;
|
|
1196
1423
|
readonly close: import("react/jsx-runtime").JSX.Element;
|
|
1197
1424
|
readonly copied: import("react/jsx-runtime").JSX.Element;
|
|
1198
1425
|
readonly copy: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1201,26 +1428,49 @@ declare const defaultIcons: {
|
|
|
1201
1428
|
readonly failure: import("react/jsx-runtime").JSX.Element;
|
|
1202
1429
|
readonly pending: import("react/jsx-runtime").JSX.Element;
|
|
1203
1430
|
readonly success: import("react/jsx-runtime").JSX.Element;
|
|
1431
|
+
readonly warning: import("react/jsx-runtime").JSX.Element;
|
|
1204
1432
|
};
|
|
1205
1433
|
declare function useIcons(): Icons;
|
|
1206
1434
|
declare namespace messages_d_exports {
|
|
1207
|
-
export { Catalog, EvidenceLike, english, failure, merge };
|
|
1435
|
+
export { Catalog, EvidenceLike, Outcome, OutcomeContext, english, failure, merge, outcome };
|
|
1208
1436
|
}
|
|
1209
1437
|
interface Catalog {
|
|
1210
1438
|
readonly connect: string;
|
|
1211
|
-
|
|
1439
|
+
/** The token method's button, which carries the verb rather than the method's own label. */
|
|
1440
|
+
readonly methodToken: string;
|
|
1441
|
+
readonly methodOAuth: (provider: string) => string;
|
|
1442
|
+
readonly methodIntegration: (provider: string) => string;
|
|
1212
1443
|
readonly disconnect: string;
|
|
1213
1444
|
readonly detach: string;
|
|
1214
1445
|
readonly cancel: string;
|
|
1215
1446
|
readonly close: string;
|
|
1216
1447
|
readonly retry: string;
|
|
1217
1448
|
readonly approve: string;
|
|
1449
|
+
/** The provisioning dialog's primary action: what it adds, and how many. */
|
|
1450
|
+
readonly addRecords: (count: number) => string;
|
|
1218
1451
|
readonly decline: string;
|
|
1452
|
+
/** Why the primary action is unavailable: every operation the plan holds is blocked. */
|
|
1453
|
+
readonly everyRecordConflicts: string;
|
|
1219
1454
|
readonly reviewChanges: string;
|
|
1220
1455
|
readonly cleanUp: string;
|
|
1221
1456
|
readonly checkDns: string;
|
|
1222
1457
|
readonly checkAgain: string;
|
|
1223
1458
|
readonly moreActions: string;
|
|
1459
|
+
/** Reveals the fields a provider does not need, such as an account id. */
|
|
1460
|
+
readonly moreOptions: string;
|
|
1461
|
+
/** Reveals the providers the dialog narrowed away. */
|
|
1462
|
+
readonly useAnotherProvider: string;
|
|
1463
|
+
/** Opens the token form where a provider also offers a method the customer clicks through. */
|
|
1464
|
+
readonly useTokenInstead: string;
|
|
1465
|
+
/** Returns from one method's form to the provider's methods. */
|
|
1466
|
+
readonly back: string;
|
|
1467
|
+
/** The connected card's own line, beside the provider's name. */
|
|
1468
|
+
readonly connected: string;
|
|
1469
|
+
readonly needsReconnect: string;
|
|
1470
|
+
/** The disconnect dialog's scope question, when the connection serves other domains too. */
|
|
1471
|
+
readonly disconnectScope: string;
|
|
1472
|
+
readonly disconnectThisDomain: string;
|
|
1473
|
+
readonly disconnectEveryDomain: (count: number) => string;
|
|
1224
1474
|
readonly copy: string;
|
|
1225
1475
|
readonly copied: string;
|
|
1226
1476
|
readonly copyZone: string;
|
|
@@ -1241,15 +1491,28 @@ interface Catalog {
|
|
|
1241
1491
|
readonly cleaning: string;
|
|
1242
1492
|
readonly observing: string;
|
|
1243
1493
|
readonly connectTitle: (provider: string) => string;
|
|
1244
|
-
/** The dialog heading
|
|
1494
|
+
/** The dialog heading, and the trigger, when no provider is named yet. */
|
|
1245
1495
|
readonly connectAnyTitle: string;
|
|
1496
|
+
/** What the disconnected prompt says about the provider whose nameservers serve the domain. */
|
|
1497
|
+
readonly hostOwnsZone: string;
|
|
1246
1498
|
readonly connectDescription: (domain: string) => string;
|
|
1247
1499
|
readonly connectedTo: (provider: string) => string;
|
|
1248
1500
|
/** Shown where a connect control would be when the customer may not connect. */
|
|
1249
1501
|
readonly notConnected: string;
|
|
1250
1502
|
readonly reconnectRequired: (provider: string) => string;
|
|
1251
1503
|
readonly disconnectTitle: (provider: string) => string;
|
|
1252
|
-
|
|
1504
|
+
/**
|
|
1505
|
+
* What disconnecting means, in the present. The default names DomainKit as what stops managing
|
|
1506
|
+
* the records; a host application overrides the key to name itself.
|
|
1507
|
+
*/
|
|
1508
|
+
readonly disconnectConsent: (domain: string, provider: string) => string;
|
|
1509
|
+
/**
|
|
1510
|
+
* The option inside the disconnect dialog, over the records it would remove. Only this domain's
|
|
1511
|
+
* apply receipt proves what DomainKit created, so the words say which records go.
|
|
1512
|
+
*/
|
|
1513
|
+
readonly disconnectWithCleanup: (count: number) => string;
|
|
1514
|
+
/** What the listed records do when that option is off. */
|
|
1515
|
+
readonly disconnectKeepsRecords: (provider: string) => string;
|
|
1253
1516
|
readonly detachConsent: string;
|
|
1254
1517
|
readonly detached: string;
|
|
1255
1518
|
readonly reusableConnections: string;
|
|
@@ -1282,9 +1545,11 @@ interface Catalog {
|
|
|
1282
1545
|
readonly recordType: (record: DnsRecord.Observed) => string;
|
|
1283
1546
|
readonly applied: (receipt: Receipt.Model) => string;
|
|
1284
1547
|
readonly cleaned: (receipt: Receipt.Model) => string;
|
|
1548
|
+
readonly partiallyAppliedTitle: string;
|
|
1285
1549
|
readonly partiallyApplied: string;
|
|
1550
|
+
readonly partiallyCleanedTitle: string;
|
|
1286
1551
|
readonly partiallyCleaned: string;
|
|
1287
|
-
readonly
|
|
1552
|
+
readonly receiptOutcome: (outcome: Receipt.Outcome) => string;
|
|
1288
1553
|
readonly skippedReason: (reason: Receipt.Skipped["reason"]) => string;
|
|
1289
1554
|
readonly requirementStatus: (status: Storage.RequirementStatus) => string;
|
|
1290
1555
|
readonly overall: (overall: Storage.Overall) => string;
|
|
@@ -1299,22 +1564,37 @@ interface Catalog {
|
|
|
1299
1564
|
readonly nextCheckAt: (at: string) => string;
|
|
1300
1565
|
readonly hostEvidence: string;
|
|
1301
1566
|
readonly noEvidence: string;
|
|
1302
|
-
readonly invalidInput: (reason: Reason.InvalidInput) =>
|
|
1303
|
-
readonly unauthenticated: (reason: Reason.Unauthenticated) =>
|
|
1304
|
-
readonly forbidden: (reason: Reason.Forbidden) =>
|
|
1305
|
-
readonly notFound: (reason: Reason.NotFound) =>
|
|
1306
|
-
readonly conflict: (reason: Reason.Conflict) =>
|
|
1307
|
-
readonly stale: (reason: Reason.Stale) =>
|
|
1308
|
-
readonly expired: (reason: Reason.Expired) =>
|
|
1309
|
-
readonly busy: (reason: Reason.Busy) =>
|
|
1310
|
-
readonly providerRejected: (reason: Reason.ProviderRejected) =>
|
|
1311
|
-
readonly providerUnavailable: (reason: Reason.ProviderUnavailable) =>
|
|
1312
|
-
readonly providerConflict: (reason: Reason.ProviderConflict) =>
|
|
1313
|
-
readonly unsupported: (reason: Reason.Unsupported) =>
|
|
1314
|
-
readonly reconnect: (reason: Reason.Reconnect) =>
|
|
1315
|
-
readonly storageFailed: (reason: Reason.StorageFailed) =>
|
|
1316
|
-
readonly cryptoFailed: (reason: Reason.CryptoFailed) =>
|
|
1317
|
-
readonly resolverFailed: (reason: Reason.ResolverFailed) =>
|
|
1567
|
+
readonly invalidInput: (reason: Reason.InvalidInput, context: OutcomeContext) => Outcome;
|
|
1568
|
+
readonly unauthenticated: (reason: Reason.Unauthenticated, context: OutcomeContext) => Outcome;
|
|
1569
|
+
readonly forbidden: (reason: Reason.Forbidden, context: OutcomeContext) => Outcome;
|
|
1570
|
+
readonly notFound: (reason: Reason.NotFound, context: OutcomeContext) => Outcome;
|
|
1571
|
+
readonly conflict: (reason: Reason.Conflict, context: OutcomeContext) => Outcome;
|
|
1572
|
+
readonly stale: (reason: Reason.Stale, context: OutcomeContext) => Outcome;
|
|
1573
|
+
readonly expired: (reason: Reason.Expired, context: OutcomeContext) => Outcome;
|
|
1574
|
+
readonly busy: (reason: Reason.Busy, context: OutcomeContext) => Outcome;
|
|
1575
|
+
readonly providerRejected: (reason: Reason.ProviderRejected, context: OutcomeContext) => Outcome;
|
|
1576
|
+
readonly providerUnavailable: (reason: Reason.ProviderUnavailable, context: OutcomeContext) => Outcome;
|
|
1577
|
+
readonly providerConflict: (reason: Reason.ProviderConflict, context: OutcomeContext) => Outcome;
|
|
1578
|
+
readonly unsupported: (reason: Reason.Unsupported, context: OutcomeContext) => Outcome;
|
|
1579
|
+
readonly reconnect: (reason: Reason.Reconnect, context: OutcomeContext) => Outcome;
|
|
1580
|
+
readonly storageFailed: (reason: Reason.StorageFailed, context: OutcomeContext) => Outcome;
|
|
1581
|
+
readonly cryptoFailed: (reason: Reason.CryptoFailed, context: OutcomeContext) => Outcome;
|
|
1582
|
+
readonly resolverFailed: (reason: Reason.ResolverFailed, context: OutcomeContext) => Outcome;
|
|
1583
|
+
}
|
|
1584
|
+
/** What an outcome says: a heading the customer reads first, then what to do about it. */
|
|
1585
|
+
interface Outcome {
|
|
1586
|
+
readonly title: string;
|
|
1587
|
+
/** What to do about it. Absent where the title has already said the whole of it. */
|
|
1588
|
+
readonly description?: string;
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* What the flow was doing when it failed. The reason alone cannot name the provider a customer
|
|
1592
|
+
* typed a token for, so the part that renders the outcome supplies it.
|
|
1593
|
+
*/
|
|
1594
|
+
interface OutcomeContext {
|
|
1595
|
+
/** The provider's display name, when the flow knows which one the customer acted on. */
|
|
1596
|
+
readonly provider?: string;
|
|
1597
|
+
readonly domain?: string;
|
|
1318
1598
|
}
|
|
1319
1599
|
/** The evidence shapes `Verify` produces, structurally, so the catalog needs no service import. */
|
|
1320
1600
|
type EvidenceLike = {
|
|
@@ -1330,8 +1610,10 @@ type EvidenceLike = {
|
|
|
1330
1610
|
};
|
|
1331
1611
|
declare const english: Catalog;
|
|
1332
1612
|
declare const merge: (overrides?: Partial<Catalog>) => Catalog;
|
|
1333
|
-
/** The
|
|
1334
|
-
declare const
|
|
1613
|
+
/** The title and description for a failure, chosen by the error's reason. */
|
|
1614
|
+
declare const outcome: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => Outcome;
|
|
1615
|
+
/** The same failure as one sentence, for a host that renders text rather than a card. */
|
|
1616
|
+
declare const failure: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => string;
|
|
1335
1617
|
declare namespace theme_d_exports {
|
|
1336
1618
|
export { Theme, toStyle };
|
|
1337
1619
|
}
|
|
@@ -1350,6 +1632,7 @@ interface Theme {
|
|
|
1350
1632
|
readonly shadow?: string;
|
|
1351
1633
|
readonly success?: string;
|
|
1352
1634
|
readonly text?: string;
|
|
1635
|
+
readonly warning?: string;
|
|
1353
1636
|
}
|
|
1354
1637
|
declare function toStyle(theme?: Theme): CSSProperties;
|
|
1355
1638
|
declare namespace domain_kit_d_exports {
|
|
@@ -1565,5 +1848,5 @@ declare const Failure: {
|
|
|
1565
1848
|
}, "_tag">;
|
|
1566
1849
|
};
|
|
1567
1850
|
//#endregion
|
|
1568
|
-
export { type ClassName, cleanup_d_exports as Cleanup, connect_d_exports as Connect, domain_d_exports as Domain, domain_kit_d_exports as DomainKit, Event, Failure, type Icons, type Listener, messages_d_exports as Messages, operations_d_exports as Operations, type PartProps, provider_d_exports as Provider, provision_d_exports as Provision, records_d_exports as Records, type Style, testing_d_exports as Testing, theme_d_exports as Theme, verify_d_exports as Verify, defaultIcons, useIcons };
|
|
1851
|
+
export { type ClassName, cleanup_d_exports as Cleanup, connect_d_exports as Connect, domain_d_exports as Domain, domain_kit_d_exports as DomainKit, Event, Failure, type Icons, type Listener, messages_d_exports as Messages, operations_d_exports as Operations, outcome_d_exports as Outcome, type PartProps, provider_d_exports as Provider, provision_d_exports as Provision, records_d_exports as Records, type Style, testing_d_exports as Testing, theme_d_exports as Theme, verify_d_exports as Verify, defaultIcons, useIcons };
|
|
1569
1852
|
//# sourceMappingURL=index.d.mts.map
|