@domainkit/react 0.9.0 → 0.10.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 +48 -7
- package/dist/index.d.mts +206 -45
- package/dist/index.mjs +581 -158
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +200 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,6 +51,19 @@ the UI did not make.
|
|
|
51
51
|
An interactive provider returns the customer to the page they started from. Pass `returnTo` to name
|
|
52
52
|
a different destination, or `null` to leave the server's `defaultReturnTo` in charge.
|
|
53
53
|
|
|
54
|
+
## The disconnected offer
|
|
55
|
+
|
|
56
|
+
Discovery names the provider whose nameservers serve the domain. `Connect.Prompt` states it beside a
|
|
57
|
+
trigger, and the dialog behind that trigger is narrowed to that provider, with the rest behind a
|
|
58
|
+
disclosure.
|
|
59
|
+
|
|
60
|
+
When no registered provider serves the zone there is nothing DomainKit can connect, so the flow
|
|
61
|
+
offers nothing. Pass `connect="always"` to offer the all-providers dialog anyway:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Domain.Flow domain="app.example.com" requirements={requirements} connect="always" />
|
|
65
|
+
```
|
|
66
|
+
|
|
54
67
|
## Own one piece, keep the rest
|
|
55
68
|
|
|
56
69
|
Every part of the flow is a slot with a default.
|
|
@@ -68,7 +81,7 @@ Every part of the flow is a slot with a default.
|
|
|
68
81
|
|
|
69
82
|
| Slot | Receives | Default |
|
|
70
83
|
| -------------- | ----------------------------------------------- | ---------------------------------------------------------- |
|
|
71
|
-
| `connection` | `{ controller, domain }`
|
|
84
|
+
| `connection` | `{ controller, domain, connect }` | `Connect.Card` once connected, `Connect.Prompt` until then |
|
|
72
85
|
| `records` | `{ records, readiness, controller, domain }` | `Records.Table` |
|
|
73
86
|
| `verification` | `{ controller, domain }` | `Verify.Status` with per-requirement evidence |
|
|
74
87
|
| `actions` | `{ connection, provisioning, cleanup, domain }` | Review changes, Approve, Decline, Remove records |
|
|
@@ -121,17 +134,45 @@ one is gone, and re-runs the failed step otherwise.
|
|
|
121
134
|
## Presentation
|
|
122
135
|
|
|
123
136
|
`DomainKit.Root` takes `messages`, `marks`, `icons`, `theme`, `colorScheme`, and `portalContainer`,
|
|
124
|
-
so branding stays in your app. `Messages.Catalog` holds every user-visible string, including
|
|
125
|
-
|
|
137
|
+
so branding stays in your app. `Messages.Catalog` holds every user-visible string, including a
|
|
138
|
+
title and a description per `DomainKit.Error` reason; nothing renders a tag. Provider artwork comes from `marks`,
|
|
126
139
|
with the provider's initial as the fallback and no request at render time. The stylesheet is
|
|
127
140
|
opt-in and every color is a `--domainkit-*` custom property.
|
|
128
141
|
|
|
129
|
-
Every rule ships inside `@layer domainkit
|
|
130
|
-
|
|
131
|
-
|
|
142
|
+
Every rule ships inside `@layer domainkit`. An unlayered rule of yours already beats every layer, so
|
|
143
|
+
plain CSS needs nothing here.
|
|
144
|
+
|
|
145
|
+
Once your app uses layers, name the order yourself: a layer's priority is its position in that list,
|
|
146
|
+
and a layer you never declare lands wherever it first appears, so `domainkit` can sort under
|
|
147
|
+
Tailwind's preflight and the package's buttons render as bare text.
|
|
148
|
+
|
|
149
|
+
```css
|
|
150
|
+
@layer theme, base, components, domainkit, utilities;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`domainkit` sits after `base` so preflight cannot strip it, and before `utilities` so a utility class
|
|
154
|
+
still wins. Any layer you declare after it wins the same way:
|
|
132
155
|
|
|
133
156
|
```css
|
|
134
|
-
@layer
|
|
157
|
+
@layer utilities {
|
|
158
|
+
[data-domainkit-part="records-panel"] {
|
|
159
|
+
border-radius: 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
A failed step renders as `Outcome`: media, the catalog's title and description, and the retry the
|
|
165
|
+
flow allows, as a card or on one line. Pass your own parts as children and the words still come from
|
|
166
|
+
the catalog.
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<Connect.Outcome controller={connection} layout="inline">
|
|
170
|
+
<Outcome.Media variant="default">
|
|
171
|
+
<MyIcon />
|
|
172
|
+
</Outcome.Media>
|
|
173
|
+
<Outcome.Title />
|
|
174
|
+
<Outcome.Content />
|
|
175
|
+
</Connect.Outcome>
|
|
135
176
|
```
|
|
136
177
|
|
|
137
178
|
Every dialog and popover takes a `render` prop that replaces the surface with your own.
|
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. */
|
|
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;
|
|
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, 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, hostProvider, useController$2 as useController };
|
|
584
646
|
}
|
|
585
647
|
type Snapshot = Transport.Snapshot;
|
|
586
648
|
type Discovery = Transport.Discovery;
|
|
@@ -620,6 +682,10 @@ type State$1 = Data.TaggedEnum<{
|
|
|
620
682
|
};
|
|
621
683
|
Failure: {
|
|
622
684
|
readonly error: DomainKit.Error;
|
|
685
|
+
readonly snapshot: Snapshot | null;
|
|
686
|
+
readonly discovery: Discovery | null;
|
|
687
|
+
/** The provider and method the customer was using, when a command failed rather than a read. */
|
|
688
|
+
readonly attempt: Attempt | null;
|
|
623
689
|
};
|
|
624
690
|
}>;
|
|
625
691
|
declare const State$1: {
|
|
@@ -637,6 +703,9 @@ declare const State$1: {
|
|
|
637
703
|
}> | Extract<{
|
|
638
704
|
readonly _tag: "Failure";
|
|
639
705
|
readonly error: DomainKit.Error;
|
|
706
|
+
readonly snapshot: Snapshot | null;
|
|
707
|
+
readonly discovery: Discovery | null;
|
|
708
|
+
readonly attempt: Attempt | null;
|
|
640
709
|
}, {
|
|
641
710
|
readonly _tag: Tag;
|
|
642
711
|
}> | Extract<{
|
|
@@ -678,6 +747,9 @@ declare const State$1: {
|
|
|
678
747
|
} | {
|
|
679
748
|
readonly _tag: "Failure";
|
|
680
749
|
readonly error: DomainKit.Error;
|
|
750
|
+
readonly snapshot: Snapshot | null;
|
|
751
|
+
readonly discovery: Discovery | null;
|
|
752
|
+
readonly attempt: Attempt | null;
|
|
681
753
|
} | {
|
|
682
754
|
readonly _tag: "Loading";
|
|
683
755
|
readonly snapshot: Snapshot | null;
|
|
@@ -707,6 +779,9 @@ declare const State$1: {
|
|
|
707
779
|
} | {
|
|
708
780
|
readonly _tag: "Failure";
|
|
709
781
|
readonly error: DomainKit.Error;
|
|
782
|
+
readonly snapshot: Snapshot | null;
|
|
783
|
+
readonly discovery: Discovery | null;
|
|
784
|
+
readonly attempt: Attempt | null;
|
|
710
785
|
} | {
|
|
711
786
|
readonly _tag: "Loading";
|
|
712
787
|
readonly snapshot: Snapshot | null;
|
|
@@ -735,6 +810,9 @@ declare const State$1: {
|
|
|
735
810
|
} | {
|
|
736
811
|
readonly _tag: "Failure";
|
|
737
812
|
readonly error: DomainKit.Error;
|
|
813
|
+
readonly snapshot: Snapshot | null;
|
|
814
|
+
readonly discovery: Discovery | null;
|
|
815
|
+
readonly attempt: Attempt | null;
|
|
738
816
|
} | {
|
|
739
817
|
readonly _tag: "Loading";
|
|
740
818
|
readonly snapshot: Snapshot | null;
|
|
@@ -764,6 +842,9 @@ declare const State$1: {
|
|
|
764
842
|
} | {
|
|
765
843
|
readonly _tag: "Failure";
|
|
766
844
|
readonly error: DomainKit.Error;
|
|
845
|
+
readonly snapshot: Snapshot | null;
|
|
846
|
+
readonly discovery: Discovery | null;
|
|
847
|
+
readonly attempt: Attempt | null;
|
|
767
848
|
} | {
|
|
768
849
|
readonly _tag: "Loading";
|
|
769
850
|
readonly snapshot: Snapshot | null;
|
|
@@ -795,6 +876,9 @@ declare const State$1: {
|
|
|
795
876
|
readonly Failure: Data.TaggedEnum.ConstructorFrom<{
|
|
796
877
|
readonly _tag: "Failure";
|
|
797
878
|
readonly error: DomainKit.Error;
|
|
879
|
+
readonly snapshot: Snapshot | null;
|
|
880
|
+
readonly discovery: Discovery | null;
|
|
881
|
+
readonly attempt: Attempt | null;
|
|
798
882
|
}, "_tag">;
|
|
799
883
|
readonly Loading: Data.TaggedEnum.ConstructorFrom<{
|
|
800
884
|
readonly _tag: "Loading";
|
|
@@ -819,6 +903,11 @@ declare const State$1: {
|
|
|
819
903
|
readonly snapshot: Snapshot | null;
|
|
820
904
|
}, "_tag">;
|
|
821
905
|
};
|
|
906
|
+
/** Which provider and method the failed command was for, so the form can answer beside it. */
|
|
907
|
+
interface Attempt {
|
|
908
|
+
readonly provider: string;
|
|
909
|
+
readonly method: Storage.AuthMethod;
|
|
910
|
+
}
|
|
822
911
|
interface ConnectInput {
|
|
823
912
|
readonly provider: string;
|
|
824
913
|
readonly method: Storage.AuthMethod;
|
|
@@ -868,11 +957,24 @@ interface RootProps$5 extends PartProps<"div", RootState$3> {
|
|
|
868
957
|
readonly controller: Controller$1;
|
|
869
958
|
}
|
|
870
959
|
declare function Root$5({ controller, ...props }: RootProps$5): ReactElement;
|
|
871
|
-
|
|
960
|
+
/**
|
|
961
|
+
* Whether a failure is already answered where it was raised: beside the method the customer used.
|
|
962
|
+
* A flow rendering its own `Outcome` beside the dialog skips it, so the failure announces once.
|
|
963
|
+
*/
|
|
964
|
+
declare const answeredInPlace: (controller: Controller$1) => boolean;
|
|
965
|
+
/**
|
|
966
|
+
* The provider whose nameservers serve this domain, as the snapshot describes it. Discovery names
|
|
967
|
+
* it by id; without a descriptor there is nothing to draw, so there is no host.
|
|
968
|
+
*/
|
|
969
|
+
declare const hostProvider: (controller: Controller$1) => Descriptor | null;
|
|
970
|
+
interface OutcomeProps$2 extends RootProps$7 {
|
|
872
971
|
readonly controller: Controller$1;
|
|
873
972
|
}
|
|
874
|
-
/**
|
|
875
|
-
|
|
973
|
+
/**
|
|
974
|
+
* The last failure as a card: media, the catalog's title and description, and the retry the flow
|
|
975
|
+
* allows. Children replace the composition and keep the binding.
|
|
976
|
+
*/
|
|
977
|
+
declare function Outcome$3({ children, controller, ...props }: OutcomeProps$2): ReactElement | null;
|
|
876
978
|
interface StatusProps$3 extends PartProps<"p", RootState$3> {
|
|
877
979
|
readonly controller: Controller$1;
|
|
878
980
|
}
|
|
@@ -898,6 +1000,22 @@ interface DialogProps$1 {
|
|
|
898
1000
|
}
|
|
899
1001
|
/** The connect surface. Without `render` it is a Base UI dialog behind `trigger`. */
|
|
900
1002
|
declare function Dialog$1({ children, controller, render, title, trigger }: DialogProps$1): ReactElement;
|
|
1003
|
+
/** Whether the flow offers a connect surface when discovery names no host. */
|
|
1004
|
+
type Invitation = "always" | "detected";
|
|
1005
|
+
interface PromptProps extends PartProps<"div", RootState$3> {
|
|
1006
|
+
readonly controller: Controller$1;
|
|
1007
|
+
/**
|
|
1008
|
+
* `detected` offers nothing when discovery names no host, which is the honest answer for a
|
|
1009
|
+
* domain DomainKit cannot write to. `always` offers the all-providers dialog anyway.
|
|
1010
|
+
*/
|
|
1011
|
+
readonly connect?: Invitation;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* The disconnected offer: the provider whose nameservers serve the domain, what that means, and
|
|
1015
|
+
* the trigger that connects it. With no host detected there is nothing to offer, so nothing
|
|
1016
|
+
* renders unless the host application asks for the dialog anyway.
|
|
1017
|
+
*/
|
|
1018
|
+
declare function Prompt({ connect, controller, ...props }: PromptProps): ReactElement | null;
|
|
901
1019
|
interface CardProps$1 extends PartProps<"div", RootState$3> {
|
|
902
1020
|
readonly controller: Controller$1;
|
|
903
1021
|
}
|
|
@@ -906,11 +1024,13 @@ declare function Card$1({ controller, ...props }: CardProps$1): ReactElement;
|
|
|
906
1024
|
interface FlowProps$2 extends Omit<RootProps$5, "controller"> {
|
|
907
1025
|
readonly domain: string;
|
|
908
1026
|
readonly returnTo?: string | null;
|
|
1027
|
+
/** Offer the connect dialog even when discovery names no host. Defaults to `detected`. */
|
|
1028
|
+
readonly connect?: Invitation;
|
|
909
1029
|
}
|
|
910
|
-
/** Connection on its own: the card once connected, the
|
|
911
|
-
declare function Flow$2({ domain, returnTo, ...props }: FlowProps$2): ReactElement;
|
|
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;
|
|
912
1032
|
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$
|
|
1033
|
+
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
1034
|
}
|
|
915
1035
|
interface Options$1 {
|
|
916
1036
|
readonly domain: string;
|
|
@@ -919,7 +1039,7 @@ interface Options$1 {
|
|
|
919
1039
|
}
|
|
920
1040
|
declare function useController$1({ domain, onApplied, requirements }: Options$1): Controller$2;
|
|
921
1041
|
interface RootState$2 extends Record<string, unknown> {
|
|
922
|
-
readonly status: State$
|
|
1042
|
+
readonly status: State$3["_tag"];
|
|
923
1043
|
}
|
|
924
1044
|
interface RootProps$4 extends PartProps<"div", RootState$2> {
|
|
925
1045
|
readonly controller: Controller$2;
|
|
@@ -931,7 +1051,7 @@ interface ActionsProps extends Omit<ActionsProps$2, "kind"> {}
|
|
|
931
1051
|
/** Approve and Decline for a plan already under review. */
|
|
932
1052
|
declare function Actions(props: ActionsProps): ReactElement | null;
|
|
933
1053
|
interface OutcomeProps$1 extends Omit<OutcomeProps$4, "kind"> {}
|
|
934
|
-
declare function Outcome$
|
|
1054
|
+
declare function Outcome$2(props: OutcomeProps$1): ReactElement | null;
|
|
935
1055
|
interface StatusProps$2 extends Omit<StatusProps$5, "kind"> {}
|
|
936
1056
|
declare function Status$2(props: StatusProps$2): ReactElement;
|
|
937
1057
|
interface FlowProps$1 extends Omit<RootProps$4, "controller"> {
|
|
@@ -943,7 +1063,7 @@ interface FlowProps$1 extends Omit<RootProps$4, "controller"> {
|
|
|
943
1063
|
/** Provisioning on its own: a trigger that plans, then the review dialog. */
|
|
944
1064
|
declare function Flow$1({ domain, onApplied, requirements, trigger, ...props }: FlowProps$1): import("react/jsx-runtime").JSX.Element;
|
|
945
1065
|
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 };
|
|
1066
|
+
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
1067
|
}
|
|
948
1068
|
type Readiness$1 = Transport.Readiness;
|
|
949
1069
|
type HostEvidence = Readiness$1["host"][number];
|
|
@@ -1102,10 +1222,14 @@ interface EvidenceProps {
|
|
|
1102
1222
|
* anything DomainKit cannot observe but the host feeds in.
|
|
1103
1223
|
*/
|
|
1104
1224
|
declare function Evidence({ readiness }: EvidenceProps): ReactElement;
|
|
1105
|
-
interface OutcomeProps extends
|
|
1225
|
+
interface OutcomeProps extends RootProps$7 {
|
|
1106
1226
|
readonly controller: Controller;
|
|
1107
1227
|
}
|
|
1108
|
-
|
|
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;
|
|
1109
1233
|
interface StatusProps$1 extends Omit<RootProps$3, "render"> {
|
|
1110
1234
|
/** Replace the popover surface with a panel of the host's own. */
|
|
1111
1235
|
readonly render?: (props: {
|
|
@@ -1137,6 +1261,8 @@ interface ActionsSlotProps {
|
|
|
1137
1261
|
interface ConnectionSlotProps {
|
|
1138
1262
|
readonly controller: Controller$1;
|
|
1139
1263
|
readonly domain: string;
|
|
1264
|
+
/** What the flow was told to offer when discovery names no host. */
|
|
1265
|
+
readonly connect: Invitation;
|
|
1140
1266
|
}
|
|
1141
1267
|
/**
|
|
1142
1268
|
* Each slot replaces one part of the flow and keeps the rest. Every slot has a default, so
|
|
@@ -1149,12 +1275,12 @@ interface Slots {
|
|
|
1149
1275
|
readonly verification?: (props: VerificationSlotProps) => ReactNode;
|
|
1150
1276
|
/** Defaults to Approve and Decline, plus cleanup when the transport declares it. */
|
|
1151
1277
|
readonly actions?: (props: ActionsSlotProps) => ReactNode;
|
|
1152
|
-
/** Defaults to `Connect.Card` once connected and `Connect.
|
|
1278
|
+
/** Defaults to `Connect.Card` once connected and `Connect.Prompt` until then. */
|
|
1153
1279
|
readonly connection?: (props: ConnectionSlotProps) => ReactNode;
|
|
1154
1280
|
}
|
|
1155
1281
|
interface FlowState extends Record<string, unknown> {
|
|
1156
1282
|
readonly connection: State$1["_tag"];
|
|
1157
|
-
readonly provisioning: State$
|
|
1283
|
+
readonly provisioning: State$3["_tag"];
|
|
1158
1284
|
}
|
|
1159
1285
|
interface FlowProps extends Omit<PartProps<"div", FlowState>, "children"> {
|
|
1160
1286
|
readonly domain: string;
|
|
@@ -1169,13 +1295,18 @@ interface FlowProps extends Omit<PartProps<"div", FlowState>, "children"> {
|
|
|
1169
1295
|
readonly returnTo?: string | null;
|
|
1170
1296
|
/** Render this domain's state without the controls that change it. Defaults to the root's. */
|
|
1171
1297
|
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;
|
|
1172
1303
|
}
|
|
1173
1304
|
/**
|
|
1174
1305
|
* The whole lifecycle for one domain: connect, review, apply, observe, clean up. The flow renders
|
|
1175
1306
|
* only what the transport declares, and every part of it is a slot with a default. It adds no
|
|
1176
1307
|
* layout containers of its own, so a host's grid can place the slot output directly.
|
|
1177
1308
|
*/
|
|
1178
|
-
declare function Flow({ domain, onApplied, onCleaned, readOnly, requirements, returnTo, slots, ...props }: FlowProps): ReactElement;
|
|
1309
|
+
declare function Flow({ connect, domain, onApplied, onCleaned, readOnly, requirements, returnTo, slots, ...props }: FlowProps): ReactElement;
|
|
1179
1310
|
//#endregion
|
|
1180
1311
|
//#region src/icons.d.ts
|
|
1181
1312
|
/**
|
|
@@ -1191,6 +1322,7 @@ interface Icons {
|
|
|
1191
1322
|
readonly failure: ReactNode;
|
|
1192
1323
|
readonly pending: ReactNode;
|
|
1193
1324
|
readonly success: ReactNode;
|
|
1325
|
+
readonly warning: ReactNode;
|
|
1194
1326
|
}
|
|
1195
1327
|
declare const defaultIcons: {
|
|
1196
1328
|
readonly close: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1201,14 +1333,18 @@ declare const defaultIcons: {
|
|
|
1201
1333
|
readonly failure: import("react/jsx-runtime").JSX.Element;
|
|
1202
1334
|
readonly pending: import("react/jsx-runtime").JSX.Element;
|
|
1203
1335
|
readonly success: import("react/jsx-runtime").JSX.Element;
|
|
1336
|
+
readonly warning: import("react/jsx-runtime").JSX.Element;
|
|
1204
1337
|
};
|
|
1205
1338
|
declare function useIcons(): Icons;
|
|
1206
1339
|
declare namespace messages_d_exports {
|
|
1207
|
-
export { Catalog, EvidenceLike, english, failure, merge };
|
|
1340
|
+
export { Catalog, EvidenceLike, Outcome, OutcomeContext, english, failure, merge, outcome };
|
|
1208
1341
|
}
|
|
1209
1342
|
interface Catalog {
|
|
1210
1343
|
readonly connect: string;
|
|
1211
|
-
|
|
1344
|
+
/** The token method's button, which carries the verb rather than the method's own label. */
|
|
1345
|
+
readonly methodToken: string;
|
|
1346
|
+
readonly methodOAuth: (provider: string) => string;
|
|
1347
|
+
readonly methodIntegration: (provider: string) => string;
|
|
1212
1348
|
readonly disconnect: string;
|
|
1213
1349
|
readonly detach: string;
|
|
1214
1350
|
readonly cancel: string;
|
|
@@ -1221,6 +1357,10 @@ interface Catalog {
|
|
|
1221
1357
|
readonly checkDns: string;
|
|
1222
1358
|
readonly checkAgain: string;
|
|
1223
1359
|
readonly moreActions: string;
|
|
1360
|
+
/** Reveals the fields a provider does not need, such as an account id. */
|
|
1361
|
+
readonly moreOptions: string;
|
|
1362
|
+
/** Reveals the providers the dialog narrowed away. */
|
|
1363
|
+
readonly useAnotherProvider: string;
|
|
1224
1364
|
readonly copy: string;
|
|
1225
1365
|
readonly copied: string;
|
|
1226
1366
|
readonly copyZone: string;
|
|
@@ -1241,8 +1381,10 @@ interface Catalog {
|
|
|
1241
1381
|
readonly cleaning: string;
|
|
1242
1382
|
readonly observing: string;
|
|
1243
1383
|
readonly connectTitle: (provider: string) => string;
|
|
1244
|
-
/** The dialog heading
|
|
1384
|
+
/** The dialog heading, and the trigger, when no provider is named yet. */
|
|
1245
1385
|
readonly connectAnyTitle: string;
|
|
1386
|
+
/** What the disconnected prompt says about the provider whose nameservers serve the domain. */
|
|
1387
|
+
readonly hostOwnsZone: string;
|
|
1246
1388
|
readonly connectDescription: (domain: string) => string;
|
|
1247
1389
|
readonly connectedTo: (provider: string) => string;
|
|
1248
1390
|
/** Shown where a connect control would be when the customer may not connect. */
|
|
@@ -1282,9 +1424,11 @@ interface Catalog {
|
|
|
1282
1424
|
readonly recordType: (record: DnsRecord.Observed) => string;
|
|
1283
1425
|
readonly applied: (receipt: Receipt.Model) => string;
|
|
1284
1426
|
readonly cleaned: (receipt: Receipt.Model) => string;
|
|
1427
|
+
readonly partiallyAppliedTitle: string;
|
|
1285
1428
|
readonly partiallyApplied: string;
|
|
1429
|
+
readonly partiallyCleanedTitle: string;
|
|
1286
1430
|
readonly partiallyCleaned: string;
|
|
1287
|
-
readonly
|
|
1431
|
+
readonly receiptOutcome: (outcome: Receipt.Outcome) => string;
|
|
1288
1432
|
readonly skippedReason: (reason: Receipt.Skipped["reason"]) => string;
|
|
1289
1433
|
readonly requirementStatus: (status: Storage.RequirementStatus) => string;
|
|
1290
1434
|
readonly overall: (overall: Storage.Overall) => string;
|
|
@@ -1299,22 +1443,36 @@ interface Catalog {
|
|
|
1299
1443
|
readonly nextCheckAt: (at: string) => string;
|
|
1300
1444
|
readonly hostEvidence: string;
|
|
1301
1445
|
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) =>
|
|
1446
|
+
readonly invalidInput: (reason: Reason.InvalidInput, context: OutcomeContext) => Outcome;
|
|
1447
|
+
readonly unauthenticated: (reason: Reason.Unauthenticated, context: OutcomeContext) => Outcome;
|
|
1448
|
+
readonly forbidden: (reason: Reason.Forbidden, context: OutcomeContext) => Outcome;
|
|
1449
|
+
readonly notFound: (reason: Reason.NotFound, context: OutcomeContext) => Outcome;
|
|
1450
|
+
readonly conflict: (reason: Reason.Conflict, context: OutcomeContext) => Outcome;
|
|
1451
|
+
readonly stale: (reason: Reason.Stale, context: OutcomeContext) => Outcome;
|
|
1452
|
+
readonly expired: (reason: Reason.Expired, context: OutcomeContext) => Outcome;
|
|
1453
|
+
readonly busy: (reason: Reason.Busy, context: OutcomeContext) => Outcome;
|
|
1454
|
+
readonly providerRejected: (reason: Reason.ProviderRejected, context: OutcomeContext) => Outcome;
|
|
1455
|
+
readonly providerUnavailable: (reason: Reason.ProviderUnavailable, context: OutcomeContext) => Outcome;
|
|
1456
|
+
readonly providerConflict: (reason: Reason.ProviderConflict, context: OutcomeContext) => Outcome;
|
|
1457
|
+
readonly unsupported: (reason: Reason.Unsupported, context: OutcomeContext) => Outcome;
|
|
1458
|
+
readonly reconnect: (reason: Reason.Reconnect, context: OutcomeContext) => Outcome;
|
|
1459
|
+
readonly storageFailed: (reason: Reason.StorageFailed, context: OutcomeContext) => Outcome;
|
|
1460
|
+
readonly cryptoFailed: (reason: Reason.CryptoFailed, context: OutcomeContext) => Outcome;
|
|
1461
|
+
readonly resolverFailed: (reason: Reason.ResolverFailed, context: OutcomeContext) => Outcome;
|
|
1462
|
+
}
|
|
1463
|
+
/** What an outcome says: a heading the customer reads first, then what to do about it. */
|
|
1464
|
+
interface Outcome {
|
|
1465
|
+
readonly title: string;
|
|
1466
|
+
readonly description: string;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* What the flow was doing when it failed. The reason alone cannot name the provider a customer
|
|
1470
|
+
* typed a token for, so the part that renders the outcome supplies it.
|
|
1471
|
+
*/
|
|
1472
|
+
interface OutcomeContext {
|
|
1473
|
+
/** The provider's display name, when the flow knows which one the customer acted on. */
|
|
1474
|
+
readonly provider?: string;
|
|
1475
|
+
readonly domain?: string;
|
|
1318
1476
|
}
|
|
1319
1477
|
/** The evidence shapes `Verify` produces, structurally, so the catalog needs no service import. */
|
|
1320
1478
|
type EvidenceLike = {
|
|
@@ -1330,8 +1488,10 @@ type EvidenceLike = {
|
|
|
1330
1488
|
};
|
|
1331
1489
|
declare const english: Catalog;
|
|
1332
1490
|
declare const merge: (overrides?: Partial<Catalog>) => Catalog;
|
|
1333
|
-
/** The
|
|
1334
|
-
declare const
|
|
1491
|
+
/** The title and description for a failure, chosen by the error's reason. */
|
|
1492
|
+
declare const outcome: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => Outcome;
|
|
1493
|
+
/** The same failure as one sentence, for a host that renders text rather than a card. */
|
|
1494
|
+
declare const failure: (error: DomainKit.Error, catalog: Catalog, context?: OutcomeContext) => string;
|
|
1335
1495
|
declare namespace theme_d_exports {
|
|
1336
1496
|
export { Theme, toStyle };
|
|
1337
1497
|
}
|
|
@@ -1350,6 +1510,7 @@ interface Theme {
|
|
|
1350
1510
|
readonly shadow?: string;
|
|
1351
1511
|
readonly success?: string;
|
|
1352
1512
|
readonly text?: string;
|
|
1513
|
+
readonly warning?: string;
|
|
1353
1514
|
}
|
|
1354
1515
|
declare function toStyle(theme?: Theme): CSSProperties;
|
|
1355
1516
|
declare namespace domain_kit_d_exports {
|
|
@@ -1565,5 +1726,5 @@ declare const Failure: {
|
|
|
1565
1726
|
}, "_tag">;
|
|
1566
1727
|
};
|
|
1567
1728
|
//#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 };
|
|
1729
|
+
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
1730
|
//# sourceMappingURL=index.d.mts.map
|