@sevenfold/setto-client 0.1.0 → 0.2.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 +1 -1
- package/dist/edit-mode/auth-gate.d.ts +3 -2
- package/dist/edit-mode/deployment-status.d.ts +35 -0
- package/dist/edit-mode/onboarding-dialog.d.ts +1 -0
- package/dist/edit-mode/overlay.d.ts +10 -0
- package/dist/edit-mode/publish-dialog.d.ts +18 -0
- package/dist/lib/api.d.ts +4 -0
- package/dist/lib/cookies.d.ts +4 -0
- package/dist/setto-client.js +976 -126
- package/dist/setto-client.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -310,7 +310,7 @@ Drafts are cleared after a successful publish.
|
|
|
310
310
|
|
|
311
311
|
Route: `/admin/*`
|
|
312
312
|
|
|
313
|
-
Provides Supabase email/password login and a dashboard with a link to start editing (`/?setto=edit`). Does not render the inline editor itself.
|
|
313
|
+
Provides Supabase email/password login (invite-only — no self-service sign-up), password reset, and a dashboard with a link to start editing (`/?setto=edit`). Invite links from Supabase land on `/admin` to set a password. Does not render the inline editor itself.
|
|
314
314
|
|
|
315
315
|
---
|
|
316
316
|
|
|
@@ -4,7 +4,8 @@ export interface AuthGateProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Wraps `children` with
|
|
8
|
-
*
|
|
7
|
+
* Wraps `children` with Supabase email/password login. Sign-up is disabled;
|
|
8
|
+
* editors are invited by platform admins. Supports password reset and invite
|
|
9
|
+
* links from Supabase email.
|
|
9
10
|
*/
|
|
10
11
|
export declare function AuthGate({ children }: AuthGateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import type { DeploymentRow } from '../types';
|
|
3
|
+
export declare const IN_PROGRESS_STATUSES: readonly ["pending", "building"];
|
|
4
|
+
export declare function isDeploymentInProgress(status: DeploymentRow['status']): boolean;
|
|
5
|
+
/** Pending with no webhook update — matches server STALE_PENDING_MS (20 min). */
|
|
6
|
+
export declare const STALE_PENDING_MS: number;
|
|
7
|
+
/** Building without progress — matches server STALE_BUILDING_MS (45 min). */
|
|
8
|
+
export declare const STALE_BUILDING_MS: number;
|
|
9
|
+
export declare function isDeploymentStale(row: Pick<DeploymentRow, 'status' | 'started_at' | 'updated_at'>): boolean;
|
|
10
|
+
/** Latest in-flight deployment for a site, if any (ignores stale rows). */
|
|
11
|
+
export declare function fetchInProgressDeploymentId(supabase: SupabaseClient, siteId: string): Promise<string | null>;
|
|
12
|
+
/** Subscribe to a single deployment row via Supabase Realtime. */
|
|
13
|
+
export declare function useDeploymentStatus(supabase: SupabaseClient, deploymentId: string | null): {
|
|
14
|
+
row: DeploymentRow | null;
|
|
15
|
+
status: DeploymentRow['status'] | null;
|
|
16
|
+
};
|
|
17
|
+
export declare function deploymentStepIndex(status: DeploymentRow['status']): number;
|
|
18
|
+
export declare function isDeploymentStepReached(status: DeploymentRow['status'], i: number): boolean;
|
|
19
|
+
interface PublishProgressStepsProps {
|
|
20
|
+
status: DeploymentRow['status'];
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
/** Seconds elapsed during the building step (dialog only). */
|
|
23
|
+
buildingElapsed?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Three-step progress with a subtle pulse/shimmer on the active step. */
|
|
26
|
+
export declare function PublishProgressSteps({ status, compact, buildingElapsed, }: PublishProgressStepsProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
interface PublishProgressBarProps {
|
|
28
|
+
status: DeploymentRow['status'];
|
|
29
|
+
compact?: boolean;
|
|
30
|
+
/** When set, renders as a link to the admin deployment view. */
|
|
31
|
+
href?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Three-step deployment progress — full labels or compact toolbar variant. */
|
|
34
|
+
export declare function PublishProgressBar({ status, compact, href }: PublishProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditOnboardingDialog(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface EditOverlayProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Full-screen overlay with blurred backdrop. Renders above the edit toolbar.
|
|
8
|
+
*/
|
|
9
|
+
export declare function EditOverlay({ children, onClose }: EditOverlayProps): import("react").ReactPortal;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DeploymentRow } from '../types';
|
|
2
|
+
interface PublishDialogProps {
|
|
3
|
+
deploymentId: string;
|
|
4
|
+
row: DeploymentRow | null;
|
|
5
|
+
status: DeploymentRow['status'];
|
|
6
|
+
publishing: boolean;
|
|
7
|
+
/** Closes the dialog; deployment continues in the toolbar. */
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/** Clears the deployment session entirely. */
|
|
10
|
+
onComplete: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
|
|
14
|
+
* Centered modal showing publish progress (Committed → Building → Deployed).
|
|
15
|
+
|
|
16
|
+
*/
|
|
17
|
+
export declare function PublishDialog({ row, status, onClose, onComplete, }: PublishDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -11,5 +11,9 @@ export declare function createApi(args: {
|
|
|
11
11
|
path: string;
|
|
12
12
|
content: string;
|
|
13
13
|
}>, message?: string): Promise<PublishResult>;
|
|
14
|
+
expireStaleDeployments(siteId: string): Promise<{
|
|
15
|
+
expired: number;
|
|
16
|
+
}>;
|
|
17
|
+
cancelDeployment(siteId: string, deploymentId: string): Promise<void>;
|
|
14
18
|
};
|
|
15
19
|
export type SettoApi = ReturnType<typeof createApi>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Read a cookie value by name, or null if missing. */
|
|
2
|
+
export declare function getCookie(name: string): string | null;
|
|
3
|
+
/** Set a cookie with optional max-age in seconds (default: 1 year). */
|
|
4
|
+
export declare function setCookie(name: string, value: string, maxAgeSeconds?: number): void;
|