@sevenfold/setto-client 0.15.0 → 0.17.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/dist/types.d.ts CHANGED
@@ -17,6 +17,14 @@ export interface SettoConfig {
17
17
  displayName?: string;
18
18
  /** Base URL of setto-server, e.g. 'https://api.setto.no'. */
19
19
  apiUrl: string;
20
+ /**
21
+ * Every language this site speaks, from `setto.config.json`.
22
+ *
23
+ * The primary one is first and is the language the agent writes; the rest
24
+ * are translations of it. One language — the state of every Setto site until
25
+ * now — means no switcher is rendered and nothing changes.
26
+ */
27
+ languages?: string[];
20
28
  /** Supabase project credentials. */
21
29
  supabase: {
22
30
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sevenfold/setto-client",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.7",
@@ -1,13 +0,0 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { DeploymentRow } from '../types';
3
- interface BuildStatusProps {
4
- supabase: SupabaseClient;
5
- deploymentId: string;
6
- onDone?: (status: DeploymentRow['status']) => void;
7
- }
8
- /**
9
- * Subscribes to a single row in `deployments` via Supabase Realtime.
10
- * Renders the three-step progress and an error state on failure.
11
- */
12
- export declare function BuildStatus({ supabase, deploymentId, onDone }: BuildStatusProps): import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,37 +0,0 @@
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
- /** Wait for a deployment row (e.g. webhook backstop) after trackingDeferred publish. */
13
- export declare function waitForDeploymentByCommit(supabase: SupabaseClient, siteId: string, commitSha: string, timeoutMs?: number): Promise<string | null>;
14
- /** Subscribe to a single deployment row via Supabase Realtime. */
15
- export declare function useDeploymentStatus(supabase: SupabaseClient, deploymentId: string | null): {
16
- row: DeploymentRow | null;
17
- status: DeploymentRow['status'] | null;
18
- };
19
- export declare function deploymentStepIndex(status: DeploymentRow['status']): number;
20
- export declare function isDeploymentStepReached(status: DeploymentRow['status'], i: number): boolean;
21
- interface PublishProgressStepsProps {
22
- status: DeploymentRow['status'];
23
- compact?: boolean;
24
- /** Seconds elapsed during the building step (dialog only). */
25
- buildingElapsed?: number;
26
- }
27
- /** Three-step progress with a subtle pulse/shimmer on the active step. */
28
- export declare function PublishProgressSteps({ status, compact, buildingElapsed, }: PublishProgressStepsProps): import("react/jsx-runtime").JSX.Element;
29
- interface PublishProgressBarProps {
30
- status: DeploymentRow['status'];
31
- compact?: boolean;
32
- /** When set, renders as a link to the admin deployment view. */
33
- href?: string;
34
- }
35
- /** Three-step deployment progress — full labels or compact toolbar variant. */
36
- export declare function PublishProgressBar({ status, compact, href }: PublishProgressBarProps): import("react/jsx-runtime").JSX.Element;
37
- export {};
@@ -1,29 +0,0 @@
1
- import { type FormFieldType, type ResolvedFormField } from './fields';
2
- /**
3
- * The chrome an editor sees around each form field: move up/down, settings,
4
- * remove. It exists only in edit mode; the published form has none of it.
5
- *
6
- * Everything here writes through `onChange`, which the form routes into the
7
- * draft store. The toolbar does not know where fields live and does not need
8
- * to — that is the form's business.
9
- */
10
- export interface FieldPatch {
11
- name?: string;
12
- type?: FormFieldType;
13
- required?: boolean;
14
- label?: string;
15
- placeholder?: string;
16
- options?: string;
17
- }
18
- interface FormFieldToolsProps {
19
- field: ResolvedFormField;
20
- index: number;
21
- count: number;
22
- /** Open the settings popover as soon as the tools mount (a field just added). */
23
- autoOpen?: boolean;
24
- onMove: (direction: -1 | 1) => void;
25
- onRemove: () => void;
26
- onChange: (patch: FieldPatch) => void;
27
- }
28
- export declare function FormFieldTools({ field, index, count, autoOpen, onMove, onRemove, onChange, }: FormFieldToolsProps): import("react/jsx-runtime").JSX.Element;
29
- export {};
@@ -1,29 +0,0 @@
1
- /** True when this page is served from a Setto preview address. */
2
- export declare function isPreviewHost(hostname: string): boolean;
3
- export type PreviewBarState = 'hidden' | 'owner' | 'visitor';
4
- /**
5
- * Whether the bar shows at all, and as whom.
6
- *
7
- * Pulled out of the component because the interesting failures are all in this
8
- * decision and none of them are visual: showing «Publiser» to somebody who has
9
- * already paid, showing «Forhåndsvisning» on a site that has been bought, or
10
- * flashing either one during the round trip that would have said otherwise.
11
- *
12
- * Unknown is a state, not a default. Both `sitesLoaded` and `soldPublic` start
13
- * out unresolved, and every unresolved input means `hidden` — the bar arrives
14
- * a moment late rather than asserting something it has to take back.
15
- */
16
- export declare function previewBarState(input: {
17
- onPreview: boolean;
18
- authLoading: boolean;
19
- hasSession: boolean;
20
- /** `sites !== null` — whether this account's site list has come back. */
21
- sitesLoaded: boolean;
22
- hasCurrentSite: boolean;
23
- currentSiteIsLive: boolean;
24
- /** The public answer, null until it arrives or if it never does. */
25
- soldPublic: boolean | null;
26
- /** Stripe's own `?betaling=ok`, which lands before the webhook does. */
27
- paidMarker: boolean;
28
- }): PreviewBarState;
29
- export declare function SettoPreviewBar(): import("react").ReactPortal | null;