@graphcore/react-kernel 0.2.0 → 0.2.2

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.
@@ -6,9 +6,10 @@ export interface AuthPageProps {
6
6
  title?: string;
7
7
  }
8
8
  /**
9
- * Sends the user to the issuer to sign in or create an account; while a
10
- * stored session is restored or a sign-in starts, it shows only a wait. The app
11
- * reloads signed in; the parent's useAuth().isAuthenticated flip re-renders
12
- * the gate.
9
+ * Sends the user to the issuer to sign in, or to create an account where the
10
+ * issuer has a registration page; while a stored session is restored or a
11
+ * sign-in starts, it shows only a wait. On an invite link it says so, and
12
+ * sign-in returns to the link. The app reloads signed in; the parent's
13
+ * useAuth().isAuthenticated flip re-renders the gate.
13
14
  */
14
15
  export declare const AuthPage: React.FC<AuthPageProps>;
@@ -7,14 +7,15 @@ export type RedeemedInvite = {
7
7
  export interface InviteRouteProps {
8
8
  /** Called once the invite is redeemed. Default: open the resource's entity page. */
9
9
  onRedeemed?: (invite: RedeemedInvite) => void;
10
- /** The app's name on the invite page. Default `graphcore`. */
11
- title?: string;
12
10
  }
13
11
  /** The link to share for an invite `token`. The token rides in the fragment, so it never reaches a server log. */
14
12
  export declare function inviteUrl(token: string): string;
13
+ /** Whether this page is an invite link, so the app's sign-in screen can say why it is asking. */
14
+ export declare function usePendingInvite(): boolean;
15
15
  /**
16
- * Mount at `INVITE_ROUTE`, outside any sign-in gate. Signed out, it offers
17
- * sign-in (and registration where the issuer has a registration page);
18
- * sign-in returns here with the token, and a signed-in visit redeems it.
16
+ * Mount at `INVITE_ROUTE` behind the app's sign-in screen, like any signed-in
17
+ * page. Sign-in returns to the full URL, token included, so an invitee signs in
18
+ * or creates an account on the app's own screen and lands here signed in; this
19
+ * route redeems the invite and hands it to `onRedeemed`.
19
20
  */
20
- export declare function InviteRoute({ onRedeemed, title }: InviteRouteProps): React.JSX.Element;
21
+ export declare function InviteRoute({ onRedeemed }: InviteRouteProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export { INVITE_ROUTE, InviteRoute, inviteUrl } from './InviteRoute';
1
+ export { INVITE_ROUTE, InviteRoute, inviteUrl, usePendingInvite } from './InviteRoute';
2
2
  export type { InviteRouteProps, RedeemedInvite } from './InviteRoute';
@@ -1,9 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  /**
3
- * The default signed-in GraphCore app: the invite page at `INVITE_ROUTE`
4
- * whether or not anyone is signed in, otherwise the sign-in page until a principal
5
- * is signed in, then entity pages full-screen and everything else (home,
6
- * admin, the server's route table) under the top bar. Pass your own layout
3
+ * The default signed-in GraphCore app: the sign-in page until a principal is
4
+ * signed in, then entity pages full-screen and everything else (home, admin,
5
+ * invites, the server's route table) under the top bar. Pass your own layout
7
6
  * to `GraphCoreRouter`'s `app` when this one does not fit.
8
7
  */
9
8
  export declare function GraphCoreApp({ topBar }: {