@sevenfold/setto-client 0.12.1 → 0.14.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/admin/App.d.ts +12 -7
- package/dist/chrome.d.ts +22 -6
- package/dist/edit-mode/toolbar-fallback.d.ts +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/lib/i18n-store.d.ts +24 -1
- package/dist/modules/domain/index.d.ts +3 -1
- package/dist/modules/forms/index.d.ts +3 -3
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/module.d.ts +7 -11
- package/dist/setto-client.js +2226 -3695
- package/dist/setto-client.js.map +1 -1
- package/package.json +1 -1
- package/dist/admin/DeploymentsView.d.ts +0 -5
- package/dist/edit-mode/onboarding-dialog.d.ts +0 -1
- package/dist/edit-mode/overlay.d.ts +0 -10
- package/dist/edit-mode/publish-dialog.d.ts +0 -16
- package/dist/edit-mode/publish-utils.d.ts +0 -4
- package/dist/edit-mode/toolbar.d.ts +0 -1
- package/dist/edit-mode/use-edit-baseline.d.ts +0 -2
- package/dist/lib/cookies.d.ts +0 -4
- package/dist/modules/domain/DomainView.d.ts +0 -3
- package/dist/modules/forms/FormsView.d.ts +0 -17
package/dist/admin/App.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The page at `/setto`. Mount it under a route like `<Route path="/setto/*" …>`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* What draws it lives in setto-server now, not here. The chrome bundle offers a
|
|
5
|
+
* dashboard at runtime — publish history, the forms inbox, the domain panel —
|
|
6
|
+
* and that is what fills this route, so changing any of it is one deploy of
|
|
7
|
+
* Setto rather than a rebuild of every site it has ever made.
|
|
8
|
+
*
|
|
9
|
+
* What stays behind is the door: sign in, and get back to the site to edit.
|
|
10
|
+
* That much has to work from the site's own bundle, because it is the only way
|
|
11
|
+
* in and because the bug that takes the chrome down could be mine. Everything
|
|
12
|
+
* past the door is Setto's, needs Setto to be reachable to do anything at all,
|
|
13
|
+
* and is better absent than drawn from a copy that has been quietly rotting in
|
|
14
|
+
* a pinned version since the day the site was built.
|
|
10
15
|
*/
|
|
11
16
|
export declare function SettoAdminApp(): import("react/jsx-runtime").JSX.Element;
|
package/dist/chrome.d.ts
CHANGED
|
@@ -24,12 +24,25 @@ export interface SettoChromeHandshake {
|
|
|
24
24
|
/**
|
|
25
25
|
* The same, for the page at `/setto`.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* fails to load from taking the admin down with it.
|
|
27
|
+
* @deprecated Use `mountSlot('admin', …)`. Kept because a chrome bundle
|
|
28
|
+
* older than this file may still call it, and the whole point of this file
|
|
29
|
+
* is that it never has to change again.
|
|
31
30
|
*/
|
|
32
31
|
mountAdmin: (Component: React.ComponentType) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Offer a component for a named place in the host: `admin` for the page at
|
|
34
|
+
* `/setto`, `toolbar` for the editor's floating menu.
|
|
35
|
+
*
|
|
36
|
+
* Named rather than one method per surface, because every new method here
|
|
37
|
+
* costs a re-pin of the whole fleet — the exact price this file exists to
|
|
38
|
+
* avoid paying. A new surface is now a string the host already understands,
|
|
39
|
+
* or one it will simply ignore.
|
|
40
|
+
*
|
|
41
|
+
* Registering nothing leaves the host's own version in place. That is what
|
|
42
|
+
* keeps a chrome bundle that fails to load, or throws while rendering, from
|
|
43
|
+
* taking the editor down with it.
|
|
44
|
+
*/
|
|
45
|
+
mountSlot: (name: string, Component: React.ComponentType) => void;
|
|
33
46
|
/**
|
|
34
47
|
* The host's own `useSetto`, callable from the chrome.
|
|
35
48
|
*
|
|
@@ -70,8 +83,11 @@ declare global {
|
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
/**
|
|
73
|
-
* What the host should render
|
|
74
|
-
* offered
|
|
86
|
+
* What the host should render in a named place, or null while the chrome has
|
|
87
|
+
* offered nothing — including after it offered something that threw. Callers
|
|
88
|
+
* render their own version when this is null; every one of them must have one.
|
|
75
89
|
*/
|
|
90
|
+
export declare function useSettoChromeSlot(name: string): React.ComponentType | null;
|
|
91
|
+
/** @deprecated Use `useSettoChromeSlot('admin')`. */
|
|
76
92
|
export declare function useSettoAdminChrome(): React.ComponentType | null;
|
|
77
93
|
export declare function SettoChrome(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ToolbarUnavailable(): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { SettoProvider, useSetto } from './provider';
|
|
2
2
|
export { GuestEditProvider, useGuestEdit } from './guest-edit';
|
|
3
3
|
export { SettoPreviewBar, isPreviewHost, previewBarState } from './preview-bar';
|
|
4
|
-
export { SettoChrome } from './chrome';
|
|
4
|
+
export { SettoChrome, useSettoChromeSlot } from './chrome';
|
|
5
5
|
export type { SettoChromeHandshake } from './chrome';
|
|
6
6
|
export { T } from './T';
|
|
7
7
|
export { SettoSection } from './SettoSection';
|
|
@@ -35,4 +35,8 @@ export { extractContentKeys, type ContentKeyRequirements, } from './block-tree/e
|
|
|
35
35
|
export { BLOCK_REGISTRY, BLOCK_TYPES, nodeChildren } from './block-tree/registry';
|
|
36
36
|
export type { BlockTypeMeta } from './block-tree/registry';
|
|
37
37
|
export { SETTO_BASE, siteHomeUrl, isAdminRoute, isAdminDeploymentView, adminViewUrl, currentAdminView, isAdminPanelView, adminRedirectUrl, CHECKOUT_INTENT, checkoutIntentUrl, wantsCheckout, withoutCheckoutIntent, } from './lib/urls';
|
|
38
|
-
export {
|
|
38
|
+
export { SettoMark } from './edit-mode/setto-mark';
|
|
39
|
+
export { FAB_SIZE, FAB_INSET } from './edit-mode/constants';
|
|
40
|
+
export { EMPTY_I18N_STORE_SNAPSHOT } from './lib/i18n-store';
|
|
41
|
+
export type { I18nStoreSnapshot } from './lib/i18n-store';
|
|
42
|
+
export { IN_PROGRESS_STATUSES, isDeploymentInProgress, isDeploymentStale, STALE_PENDING_MS, STALE_BUILDING_MS, fetchInProgressDeploymentId, waitForDeploymentByCommit, useDeploymentStatus, PublishProgressBar, PublishProgressSteps, } from './edit-mode/deployment-status';
|
package/dist/lib/i18n-store.d.ts
CHANGED
|
@@ -56,6 +56,16 @@ export declare class I18nStore {
|
|
|
56
56
|
namespace?: string;
|
|
57
57
|
});
|
|
58
58
|
snapshot(): I18nStoreSnapshot;
|
|
59
|
+
/**
|
|
60
|
+
* Put a locale file into i18next as the published baseline.
|
|
61
|
+
*
|
|
62
|
+
* Same reason as `languages`: the editor chrome cannot reach the live
|
|
63
|
+
* i18next instance from its own bundle, and this store already holds it.
|
|
64
|
+
* Deep and overwriting, which is what seeding a baseline means — the file
|
|
65
|
+
* from the repository is the truth, and any draft on top of it lives here,
|
|
66
|
+
* not in i18next.
|
|
67
|
+
*/
|
|
68
|
+
addBaselineBundle(lng: string, resources: Record<string, unknown>): void;
|
|
59
69
|
subscribe(listener: Listener): () => void;
|
|
60
70
|
/**
|
|
61
71
|
* Returns the current rendered value for a key in a given language,
|
|
@@ -111,7 +121,20 @@ export declare class I18nStore {
|
|
|
111
121
|
serialiseBundles(): Record<string, unknown>;
|
|
112
122
|
/** Runs `fn` and notifies consumers once, however many edits it makes. */
|
|
113
123
|
batch(fn: () => void): void;
|
|
114
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Every language this site has content for, in i18next's own order.
|
|
126
|
+
*
|
|
127
|
+
* Public because the editor chrome needs it and cannot get it the usual way:
|
|
128
|
+
* that code runs in a second bundle whose `react-i18next` is a different
|
|
129
|
+
* module instance from the host's, so its `useTranslation` finds no
|
|
130
|
+
* initialised i18next and reports no languages at all. This store is the
|
|
131
|
+
* host's own object, handed across by reference, and it already holds the
|
|
132
|
+
* live instance.
|
|
133
|
+
*
|
|
134
|
+
* Deduplicated, because i18next appends its fallback chain and every caller
|
|
135
|
+
* was doing that itself.
|
|
136
|
+
*/
|
|
137
|
+
languages(fallback: string): string[];
|
|
115
138
|
private valueOrUndefined;
|
|
116
139
|
private setOrDelete;
|
|
117
140
|
/** Every string key under `prefix`, nested to any depth. */
|
|
@@ -6,6 +6,8 @@ import type { SettoModule } from '../module';
|
|
|
6
6
|
* setting somebody returns to — when they finally buy the name, when they move
|
|
7
7
|
* registrar, when a record gets deleted by accident — and the conversation
|
|
8
8
|
* that built the site is not somewhere anybody goes back to.
|
|
9
|
+
*
|
|
10
|
+
* Only the tab is here. The panel behind it is served from setto-server, which
|
|
11
|
+
* is also where the DNS instructions are worked out.
|
|
9
12
|
*/
|
|
10
13
|
export declare const domainModule: SettoModule;
|
|
11
|
-
export { DomainView } from './DomainView';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SettoModule } from '../module';
|
|
2
2
|
/**
|
|
3
|
-
* The forms module: a form primitive the site renders,
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The forms module: a form primitive the site renders, and the api segment
|
|
4
|
+
* behind it. Server side lives in setto-server `src/modules/forms`, and so
|
|
5
|
+
* does the inbox the customer reads submissions in.
|
|
6
6
|
*/
|
|
7
7
|
export declare const formsModule: SettoModule;
|
|
8
8
|
export { SettoForm } from './SettoForm';
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SettoModule } from './module';
|
|
2
2
|
export type { SettoModule } from './module';
|
|
3
|
-
/** Every module the dashboard shows, in tab order. */
|
|
3
|
+
/** Every module the dashboard shows, in tab order. Setto draws the tabs. */
|
|
4
4
|
export declare const SETTO_MODULES: readonly SettoModule[];
|
|
5
5
|
export declare function findModule(id: string | null): SettoModule | undefined;
|
package/dist/modules/module.d.ts
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* What a Setto module is, from the client's side.
|
|
4
3
|
*
|
|
5
4
|
* A module is a capability a site gets by using the library — forms today;
|
|
6
5
|
* bookings, newsletters, reviews later. Each one is a directory under
|
|
7
|
-
* `src/modules/<id>` that owns
|
|
6
|
+
* `src/modules/<id>` that owns the two faces the customer's own bundle has to
|
|
7
|
+
* carry:
|
|
8
8
|
*
|
|
9
9
|
* - a primitive the site renders (`SettoForm`), with edit chrome for the
|
|
10
10
|
* owner and content that lives in the locale so it publishes with the
|
|
11
11
|
* rest of the site;
|
|
12
|
-
* - a panel in the dashboard at `/setto?view=<id>` (`AdminView`), reached
|
|
13
|
-
* from the editor toolbar's settings item;
|
|
14
12
|
* - an api segment (`createFormsApi`) that `createApi` mounts under its id,
|
|
15
13
|
* against routes setto-server keeps under `src/modules/<id>`.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* The third face — the panel at `/setto?view=<id>` — is not here. It lives in
|
|
16
|
+
* setto-server under `chrome/src/admin/modules`, and arrives at runtime, so a
|
|
17
|
+
* new module's panel ships in a deploy instead of a rebuild of every site.
|
|
18
|
+
* What this list is still for is the editor toolbar, which links to those
|
|
19
|
+
* panels from the customer's page and needs their ids and labels to do it.
|
|
20
20
|
*/
|
|
21
21
|
export interface SettoModule {
|
|
22
22
|
/** Stable id — also the dashboard view name and the api segment name. */
|
|
23
23
|
id: string;
|
|
24
24
|
/** Tab label in the dashboard, in Norwegian. */
|
|
25
25
|
label: string;
|
|
26
|
-
/** The dashboard panel for the current site. */
|
|
27
|
-
AdminView: ComponentType<{
|
|
28
|
-
siteId: string;
|
|
29
|
-
}>;
|
|
30
26
|
}
|