@sevenfold/setto-client 0.8.5 → 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.
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import * as ReactDOM from 'react-dom';
3
+ /** What the chrome is handed. Additive changes only; nothing may be removed. */
4
+ export interface SettoChromeHandshake {
5
+ contract: number;
6
+ /** The host's React, so the chrome bundle ships no framework of its own. */
7
+ react: typeof React;
8
+ reactDom: typeof ReactDOM;
9
+ config: {
10
+ siteId: string;
11
+ apiUrl: string;
12
+ displayName?: string;
13
+ };
14
+ /** Read the current state. Live: call it, never cache what it returned. */
15
+ getState: () => {
16
+ hasSession: boolean;
17
+ accessToken: string | null;
18
+ currentSite: {
19
+ id: string;
20
+ display_name?: string;
21
+ status?: string;
22
+ } | null;
23
+ sitesLoaded: boolean;
24
+ editMode: boolean;
25
+ authLoading: boolean;
26
+ };
27
+ /** Told whenever that state changes. Returns an unsubscribe. */
28
+ subscribe: (listener: () => void) => () => void;
29
+ }
30
+ declare global {
31
+ interface Window {
32
+ __setto__?: SettoChromeHandshake;
33
+ __settoChromeLoaded__?: boolean;
34
+ }
35
+ }
36
+ export declare function SettoChrome(): null;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { SettoProvider, useSetto } from './provider';
2
2
  export { GuestEditProvider, useGuestEdit } from './guest-edit';
3
- export { SettoPreviewBar, isPreviewHost } from './preview-bar';
3
+ export { SettoPreviewBar, isPreviewHost, previewBarState } from './preview-bar';
4
+ export { SettoChrome } from './chrome';
5
+ export type { SettoChromeHandshake } from './chrome';
4
6
  export { T } from './T';
5
7
  export { SettoSection } from './SettoSection';
6
8
  export { SettoBlock } from './SettoBlock';
@@ -0,0 +1,3 @@
1
+ export declare function DomainView({ siteId }: {
2
+ siteId: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { SettoModule } from '../module';
2
+ /**
3
+ * The customer's own domain.
4
+ *
5
+ * A dashboard tab rather than a step in the conversation: a domain is a
6
+ * setting somebody returns to — when they finally buy the name, when they move
7
+ * registrar, when a record gets deleted by accident — and the conversation
8
+ * that built the site is not somewhere anybody goes back to.
9
+ */
10
+ export declare const domainModule: SettoModule;
11
+ export { DomainView } from './DomainView';