@plitzi/plitzi-sdk 0.33.1 → 0.34.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/CHANGELOG.md +105 -0
- package/dist/App.d.ts +26 -2
- package/dist/index.d.ts +60 -5
- package/dist/index.html +1 -2
- package/dist/modules/App/AppMain.d.ts +8 -2
- package/dist/modules/App/ThemedRoot.d.ts +20 -0
- package/dist/modules/App/debugPreference/debugPreference.d.ts +5 -0
- package/dist/modules/App/debugPreference/debugPreference.test.d.ts +1 -0
- package/dist/modules/App/debugPreference/index.d.ts +1 -0
- package/dist/modules/App/useDebugShortcut.d.ts +6 -2
- package/dist/modules/Element/elements/PlitziSdk/index.d.ts +1 -4
- package/dist/modules/Fonts/FontFaces/FontFaces.d.ts +14 -0
- package/dist/modules/Fonts/FontFaces/index.d.ts +2 -0
- package/dist/modules/Sdk/components/OverQuotaNotice.d.ts +12 -0
- package/dist/modules/Sdk/components/index.d.ts +2 -1
- package/dist/plitzi-sdk-dev-vendor.js +2350 -831
- package/dist/plitzi-sdk-dev-vendor.js.gz +0 -0
- package/dist/plitzi-sdk-dev-vendor.js.map +1 -1
- package/dist/plitzi-sdk-dev-vendor.js.map.gz +0 -0
- package/dist/plitzi-sdk-devtools.css +1 -1
- package/dist/plitzi-sdk-devtools.css.gz +0 -0
- package/dist/plitzi-sdk-vendor.js +1 -1
- package/dist/plitzi-sdk-vendor.js.gz +0 -0
- package/dist/plitzi-sdk.css +1 -1
- package/dist/plitzi-sdk.css.gz +0 -0
- package/dist/plitzi-sdk.js +402 -373
- package/dist/plitzi-sdk.js.gz +0 -0
- package/dist/rolldown-runtime-CxhCXM28.js +1 -0
- package/dist/withElement-aG4S-kGR.js +5 -0
- package/package.json +41 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# @plitzi/plitzi-sdk
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.34.0
|
|
8
|
+
- 9c3292c: `plitzi create` — a project that renders a space, with nothing to sign up for.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx @plitzi/cli create my-site
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Two decisions shape it: `--mode server|client` (a page server of your own, or the SDK in the browser with no
|
|
15
|
+
server at all) and `--source local|cloud` (the space travels in the project, or is read live out of Plitzi). It
|
|
16
|
+
installs the project and leaves it ready to start.
|
|
17
|
+
|
|
18
|
+
**`--package-manager npm|yarn|pnpm`** says which one the project is written for — what it installs with, and what
|
|
19
|
+
every command in its README and its Playwright config names. Omitted, it is taken from the one that invoked the
|
|
20
|
+
CLI, but that is a guess about the _invocation_: running `npx` once to scaffold a project you then work in with
|
|
21
|
+
Yarn is exactly the case it gets wrong. A Yarn project also gets a `.yarnrc.yml` pinning `nodeLinker:
|
|
22
|
+
node-modules` — Yarn 4 installs Plug'n'Play by default and a server-mode project cannot start under it, since
|
|
23
|
+
`node --import tsx` dies resolving its own entry.
|
|
24
|
+
|
|
25
|
+
**The blank space moved into `@plitzi/sdk-authoring` as a declaration.** It was checked-in JSON inside the
|
|
26
|
+
platform's seeds, which meant anything else that wanted it kept a copy — and a copy of a fixture is a fixture
|
|
27
|
+
that is wrong six months later with nothing to say so. `blankSpaceSpec` is now the source both the platform's
|
|
28
|
+
`POST /spaces` and `plitzi create` author from; `blankSpace()` returns the documents, and `blankSpaceSource()`
|
|
29
|
+
returns the declaration as a file a project can own and edit.
|
|
30
|
+
|
|
31
|
+
A local project therefore gets `src/space.ts` — its own copy of that declaration, complete and self-contained —
|
|
32
|
+
rather than an import. It exports `space`, not `blankSpaceSpec`: whoever receives it is looking at their own site,
|
|
33
|
+
not at Plitzi's blank one.
|
|
34
|
+
|
|
35
|
+
`blankSpaceSource(name)` takes the name the copy should carry, so the scaffold no longer knows which literals the
|
|
36
|
+
declaration happens to contain — a rename that finds nothing to replace throws instead of quietly handing back a
|
|
37
|
+
space still called "New space", and `permanentUrl` is slugged, since it is a DNS label at the platform and what
|
|
38
|
+
every element id and style selector is derived from. The import rewrite reads the block one statement at a time
|
|
39
|
+
rather than by single-line regex (Prettier wraps a long import, and the old one read that as no import at all,
|
|
40
|
+
dropping names the copy uses), and refuses to return a file that still points at anything relative.
|
|
41
|
+
|
|
42
|
+
A browser-rendered project also serves the dev tools' stylesheet. They draw into a shadow root, which cannot see
|
|
43
|
+
the page's styles, so they fetch `/plitzi-sdk-devtools.css` — a path that exists on a server serving the SDK's
|
|
44
|
+
assets and nowhere else, which left the panel unstyled in a Vite app. The generated `vite.config.ts` serves it
|
|
45
|
+
from `node_modules` in development, so it cannot go stale and nothing is copied into the project.
|
|
46
|
+
|
|
47
|
+
**A plugin of the project's own.** `src/plugins/StatCard` is a React component the generated space renders
|
|
48
|
+
through a `custom` element — the one thing about Plitzi a page of built-in elements cannot show, and a project
|
|
49
|
+
with no example of it leaves people assuming the catalogue is the ceiling. A plugin's props ARE the hosting
|
|
50
|
+
element's attributes, so a data source pointed at that element later reaches the component with nothing in
|
|
51
|
+
between; it renders `RootElement`, so the element's id, classes and authored CSS land on what it draws. Server
|
|
52
|
+
mode registers it with `action: 'compile'` and activates it through the deployment's `pluginNames` — registering
|
|
53
|
+
a plugin says it exists, the deployment says which ones a space renders with, and leaving the second half out
|
|
54
|
+
renders "Custom Component … Not Found" with no error anywhere. The blank space in `@plitzi/sdk-authoring` is
|
|
55
|
+
unchanged: `blankSpaceSource({ plugin })` adds the host element only for callers that carry a component to fill
|
|
56
|
+
it, because the platform authors new spaces from the same declaration and hosts nobody's plugins.
|
|
57
|
+
|
|
58
|
+
**`render()`'s third argument takes a component, not a decorated one.** It asked for `ComponentPlugin` — the type
|
|
59
|
+
carrying `type`, `assets`, `origin` and `content`, all of which `App` stamps on itself from the keys of that very
|
|
60
|
+
object. Nobody registering a component of their own could satisfy it without a cast, which is also why
|
|
61
|
+
`<Sdk.Plugin component>` already declared the plain one.
|
|
62
|
+
|
|
63
|
+
**Prettier and ESLint in the generated project**, configured rather than mentioned: type-checked rules scoped to
|
|
64
|
+
the files a type checker can see, Prettier owning layout, and `eslint-config-prettier` last so the two do not
|
|
65
|
+
argue on save. `lint` and `format` are scripts from the first commit, which is the only moment a repository's
|
|
66
|
+
style is cheap to decide.
|
|
67
|
+
|
|
68
|
+
**`render()` now returns `{ unmount }`.** A second `render()` into the same element used to create a second React
|
|
69
|
+
root over the first: two live trees on one node, neither aware of the other. Anything that re-renders on its own
|
|
70
|
+
needs to take the first one down, and hot module replacement is the case that forced it — a generated client
|
|
71
|
+
project swaps the space module and remounts, so a save updates the page without reloading it.
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [5aceda0]
|
|
76
|
+
- Updated dependencies
|
|
77
|
+
- Updated dependencies [5aceda0]
|
|
78
|
+
- @plitzi/sdk-shared@0.34.0
|
|
79
|
+
- @plitzi/sdk-elements@0.34.0
|
|
80
|
+
- @plitzi/sdk-auth@0.34.0
|
|
81
|
+
- @plitzi/sdk-dev-tools@0.34.0
|
|
82
|
+
- @plitzi/sdk-event-bridge@0.34.0
|
|
83
|
+
- @plitzi/sdk-interactions@0.34.0
|
|
84
|
+
- @plitzi/sdk-navigation@0.34.0
|
|
85
|
+
- @plitzi/sdk-plugins@0.34.0
|
|
86
|
+
- @plitzi/sdk-schema@0.34.0
|
|
87
|
+
- @plitzi/sdk-style@0.34.0
|
|
88
|
+
- @plitzi/sdk-variables@0.34.0
|
|
89
|
+
|
|
90
|
+
## 0.33.2
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- v0.33.2
|
|
95
|
+
- Updated dependencies
|
|
96
|
+
- @plitzi/sdk-auth@0.33.2
|
|
97
|
+
- @plitzi/sdk-dev-tools@0.33.2
|
|
98
|
+
- @plitzi/sdk-elements@0.33.2
|
|
99
|
+
- @plitzi/sdk-event-bridge@0.33.2
|
|
100
|
+
- @plitzi/sdk-interactions@0.33.2
|
|
101
|
+
- @plitzi/sdk-navigation@0.33.2
|
|
102
|
+
- @plitzi/sdk-plugins@0.33.2
|
|
103
|
+
- @plitzi/sdk-schema@0.33.2
|
|
104
|
+
- @plitzi/sdk-shared@0.33.2
|
|
105
|
+
- @plitzi/sdk-style@0.33.2
|
|
106
|
+
- @plitzi/sdk-variables@0.33.2
|
|
107
|
+
|
|
3
108
|
## 0.33.1
|
|
4
109
|
|
|
5
110
|
### Patch Changes
|
package/dist/App.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsConfig, Environment, EventBridgeContextValue, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance } from '@plitzi/sdk-shared';
|
|
1
|
+
import { AnalyticsConfig, Theme, ThemeScope, Environment, EventBridgeContextValue, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance } from '@plitzi/sdk-shared';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export type AppProps = {
|
|
4
4
|
className?: string;
|
|
@@ -12,18 +12,42 @@ export type AppProps = {
|
|
|
12
12
|
offlineData?: OfflineDataRaw;
|
|
13
13
|
offlineDataType?: 'json' | 'yaml';
|
|
14
14
|
renderMode?: RenderMode;
|
|
15
|
+
/**
|
|
16
|
+
* Whether this space owns the browser's address bar.
|
|
17
|
+
*
|
|
18
|
+
* `browser` is right for a space that IS the page — it is the site, so its pages are the window's URLs. `memory`
|
|
19
|
+
* is for a space EMBEDDED in an application that has a router of its own: the desktop app, a component mounted
|
|
20
|
+
* in a host. Without it the space's own navigation rewrites the host's location — the desktop window went from
|
|
21
|
+
* `#/spaces/view/day-plan` to `/tasks#/spaces` on the first link followed inside a space, and a reload then
|
|
22
|
+
* landed on the shell's index with the space gone.
|
|
23
|
+
*/
|
|
24
|
+
routing?: 'browser' | 'memory';
|
|
15
25
|
debugMode?: boolean;
|
|
16
26
|
isHydrating?: boolean;
|
|
17
27
|
previewMode?: boolean;
|
|
18
28
|
/** Shows the "Made in Plitzi" link over the rendered space; off for embeds that are not a Plitzi site of their
|
|
19
29
|
* own (an MCP widget rendered inside a chat, a component mounted in a host app). */
|
|
20
30
|
branding?: boolean;
|
|
31
|
+
/** Set by the server that metered this render: the account behind this space is over its quota, so the page says
|
|
32
|
+
* so. Never authored — a space cannot turn it off from its own settings. */
|
|
33
|
+
overQuota?: boolean;
|
|
21
34
|
externalStyle?: string;
|
|
22
35
|
/** Reporting channel for this render — see {@link AnalyticsConfig}. Absent means report nothing. */
|
|
23
36
|
analytics?: AnalyticsConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Whose theme this space follows and repaints.
|
|
39
|
+
*
|
|
40
|
+
* `document` — the default — is a space that IS the page. `container` is a space EMBEDDED in an application with
|
|
41
|
+
* a theme of its own (the desktop window, a component mounted in a host): it wears the class on its own root and
|
|
42
|
+
* keeps a theme store of its own, so toggling it never reaches the application around it, and two spaces in one
|
|
43
|
+
* document do not answer for each other.
|
|
44
|
+
*/
|
|
45
|
+
themeScope?: ThemeScope;
|
|
46
|
+
/** The theme the host already settled — from the cookie a server read before it rendered the document. */
|
|
47
|
+
theme?: Theme;
|
|
24
48
|
state?: Record<string, unknown>;
|
|
25
49
|
onInitStateManager?: (instance: RuntimeStateInstance) => void;
|
|
26
50
|
onInitEventBridge?: (instance: EventBridgeContextValue) => void;
|
|
27
51
|
};
|
|
28
|
-
declare const App: ({ className, children, webKey, server, renderMode, debugMode: debugModeProp, state, ...sdkProps }: AppProps) => import("react").JSX.Element;
|
|
52
|
+
declare const App: ({ className, children, webKey, server, renderMode, routing, debugMode: debugModeProp, themeScope, theme, state, ...sdkProps }: AppProps) => import("react").JSX.Element;
|
|
29
53
|
export default App;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,17 +10,36 @@ import { default as ReplicaProvider } from '@plitzi/sdk-elements/Element/Replica
|
|
|
10
10
|
import { default as RootElement } from '@plitzi/sdk-elements/Element/RootElement';
|
|
11
11
|
import { default as ComponentContext } from '@plitzi/sdk-shared/elements/ComponentContext';
|
|
12
12
|
import { PlitziServiceProvider } from '@plitzi/sdk-shared/hooks/usePlitziServiceContext';
|
|
13
|
+
import { default as useRscRefresh } from '@plitzi/sdk-shared/server/rsc/useRscRefresh';
|
|
13
14
|
import { useSdkStore } from '@plitzi/sdk-shared/store';
|
|
14
15
|
import { track } from './modules/Analytics';
|
|
15
16
|
import { ElementContextValue } from '@plitzi/sdk-elements/Element/ElementContext';
|
|
16
17
|
import { default as EventBridge } from '@plitzi/sdk-event-bridge';
|
|
17
18
|
import { default as InteractionsManager } from '@plitzi/sdk-interactions/InteractionsManager';
|
|
18
|
-
import { AnalyticsConfig, Element, Schema, Style, ComponentPluginFC, ComponentPlugin, InteractionCallback, InteractionCallbackParamValues, Environment, EventBridgeContextValue, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance, PlitziServiceContextValue as BasePlitziServiceContextValue } from '@plitzi/sdk-shared';
|
|
19
|
+
import { AnalyticsConfig, Element, Schema, Style, ComponentPluginFC, ComponentPlugin, InteractionCallback, InteractionCallbackParamValues, Environment, EventBridgeContextValue, HostActions, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance, Theme, ThemeScope, PlitziServiceContextValue as BasePlitziServiceContextValue } from '@plitzi/sdk-shared';
|
|
19
20
|
import { ReactNode } from 'react';
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* A registered plugin is a COMPONENT, not a decorated one.
|
|
23
|
+
*
|
|
24
|
+
* `ComponentPluginFC` and not `ComponentPlugin`, because the metadata the latter carries — `type`, `assets`,
|
|
25
|
+
* `origin`, `content` — is stamped on by `App` when it reads these, from the very keys given here. Asking a
|
|
26
|
+
* caller for it made the parameter impossible to satisfy without a cast: everybody registering a component of
|
|
27
|
+
* their own has a React component and nothing else, which is also exactly what `<Sdk.Plugin component>` declares.
|
|
28
|
+
*/
|
|
29
|
+
export type RenderPlugins = Record<string, {
|
|
30
|
+
/**
|
|
31
|
+
* A plugin's props ARE the hosting element's attributes, which this package cannot know — so the parameter is
|
|
32
|
+
* left open. Narrowed to `ComponentPluginFC` with its default `unknown`, it refuses every component anybody
|
|
33
|
+
* actually writes: a component declaring `{ label?: string }` has nothing in common with the runtime-supplied
|
|
34
|
+
* props alone, and TypeScript reads that as a mistake rather than as the intended widening.
|
|
35
|
+
*/
|
|
36
|
+
component: ComponentPluginFC<any>;
|
|
22
37
|
props?: Record<string, unknown>;
|
|
23
|
-
|
|
38
|
+
clientOnly?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
export declare function render(widgetContainer: string, params?: PlitziSdkProps, plugins?: RenderPlugins, debugMode?: boolean, ssrMode?: boolean): {
|
|
41
|
+
unmount: () => void;
|
|
42
|
+
} | undefined;
|
|
24
43
|
declare global {
|
|
25
44
|
interface Window {
|
|
26
45
|
plitziCache?: PlitziSdkProps;
|
|
@@ -38,18 +57,54 @@ export type PlitziSdkProps = {
|
|
|
38
57
|
offlineData?: OfflineDataRaw;
|
|
39
58
|
offlineDataType?: 'json' | 'yaml';
|
|
40
59
|
renderMode?: RenderMode;
|
|
60
|
+
/**
|
|
61
|
+
* Whether this space owns the browser's address bar. `browser` (the default) is right when the space IS the page.
|
|
62
|
+
*
|
|
63
|
+
* `memory` is for a space EMBEDDED in an application that has a router of its own — the desktop app, a component
|
|
64
|
+
* mounted in a host: without it the space's own navigation rewrites the host's location, and a reload then opens
|
|
65
|
+
* the host's index with the space gone.
|
|
66
|
+
*/
|
|
67
|
+
routing?: 'browser' | 'memory';
|
|
41
68
|
debugMode?: boolean;
|
|
42
69
|
isHydrating?: boolean;
|
|
43
70
|
previewMode?: boolean;
|
|
44
71
|
/** Shows the "Made in Plitzi" link over the rendered space; off for embeds that are not a Plitzi site of their
|
|
45
72
|
* own (an MCP widget rendered inside a chat, a component mounted in a host app). */
|
|
46
73
|
branding?: boolean;
|
|
74
|
+
/** Set by the server that metered this render: the account behind this space is over its quota, so the page says
|
|
75
|
+
* so. Never authored — a space cannot turn it off from its own settings. */
|
|
76
|
+
overQuota?: boolean;
|
|
47
77
|
externalStyle?: string;
|
|
48
78
|
sdkDevToolsStylePath?: string;
|
|
49
79
|
/** Where this render reports SPA navigations and interactions, and with what key. Injected by a server that
|
|
50
80
|
* renders the page; derived from `server` + `webKey` for a client-side render; absent means report nothing. */
|
|
51
81
|
analytics?: AnalyticsConfig;
|
|
52
82
|
state?: Record<string, unknown>;
|
|
83
|
+
/**
|
|
84
|
+
* What the application EMBEDDING this space hands it, published as the `host` data source.
|
|
85
|
+
*
|
|
86
|
+
* The half that makes an application SHELL authorable: a sidebar cannot list the host's screens unless the host
|
|
87
|
+
* can give it the list. Kept current while the space is on screen — unlike `state`, which the space owns from
|
|
88
|
+
* the moment it mounts.
|
|
89
|
+
*/
|
|
90
|
+
hostData?: Record<string, unknown>;
|
|
91
|
+
/**
|
|
92
|
+
* What that application is willing to be asked to do, reached from a flow with the `hostAction` step.
|
|
93
|
+
*
|
|
94
|
+
* The only way out of a space and into its host: opening one of the host's screens, signing out of its keyring,
|
|
95
|
+
* quitting. A name the host does not register does nothing.
|
|
96
|
+
*/
|
|
97
|
+
hostActions?: HostActions;
|
|
98
|
+
/**
|
|
99
|
+
* Whose theme this space follows and repaints. `document` (the default) is a space that IS the page.
|
|
100
|
+
*
|
|
101
|
+
* `container` is a space EMBEDDED in an application with a theme of its own: it wears the class on its own root
|
|
102
|
+
* and keeps a theme store of its own, so toggling it never reaches the application around it, and two spaces in
|
|
103
|
+
* one document do not answer for each other.
|
|
104
|
+
*/
|
|
105
|
+
themeScope?: ThemeScope;
|
|
106
|
+
/** The theme the host already settled — from the cookie a server read before it rendered the document. */
|
|
107
|
+
theme?: Theme;
|
|
53
108
|
};
|
|
54
109
|
declare const PlitziSdk: {
|
|
55
110
|
({ debugMode, isHydrating, children, webKey, environment, renderMode, ...otherProps }: PlitziSdkProps): import("react").JSX.Element;
|
|
@@ -57,7 +112,7 @@ declare const PlitziSdk: {
|
|
|
57
112
|
};
|
|
58
113
|
type PlitziServiceContextValue = BasePlitziServiceContextValue<InstanceType<typeof EventBridge>, InstanceType<typeof InteractionsManager>>;
|
|
59
114
|
declare const usePlitziServiceContext: () => PlitziServiceContextValue;
|
|
60
|
-
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData };
|
|
115
|
+
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData, useRscRefresh };
|
|
61
116
|
export type { AnalyticsConfig, ElementContextValue, Element, Schema, Style, ComponentPlugin, ComponentPluginFC, PlitziServiceContextValue, OfflineDataRaw, InteractionCallback, InteractionCallbackParamValues };
|
|
62
117
|
export declare const version: string;
|
|
63
118
|
export declare const getStateManager: () => RuntimeStateInstance;
|
package/dist/index.html
CHANGED
|
@@ -57,8 +57,7 @@
|
|
|
57
57
|
render(
|
|
58
58
|
'plitzi',
|
|
59
59
|
{
|
|
60
|
-
webKey:
|
|
61
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIl0sInNjb3BlIjoic3BhY2U6cmVuZGVyIiwiaWF0IjoxNzg2NjU5NTg5LCJqdGkiOiJjMjRhZjMwN2Q1YTgzZmNjIiwibmJmIjoxNzg2NjU5NTg5fQ.q3-yIi5TmY8SLghX5q3jpN2qqsGJbDIF9dcVJvfLbfY',
|
|
60
|
+
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hdXRoLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly8xMjcuMC4wLjE6NTMwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6NTE4MCJdLCJzY29wZSI6InNwYWNlOnJlbmRlciIsImlhdCI6MTc4OTI0ODQ3NCwianRpIjoiZDAwNTkyYjNkYzc3ZGZjNSIsIm5iZiI6MTc4OTI0ODQ3NH0.1nXztIRTuKU016ZWahgXokFt8R8uQBnlB2m5oETBPYI',
|
|
62
61
|
environment: 'main',
|
|
63
62
|
revision: 0,
|
|
64
63
|
renderMode: 'raw',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsConfig, Environment, Server, RenderMode, RuntimeStateInstance, EventBridgeContextValue, OfflineDataRaw } from '@plitzi/sdk-shared';
|
|
1
|
+
import { HostActions, AnalyticsConfig, Environment, Server, RenderMode, RuntimeStateInstance, EventBridgeContextValue, OfflineDataRaw } from '@plitzi/sdk-shared';
|
|
2
2
|
export type AppMainProps = {
|
|
3
3
|
revision?: number;
|
|
4
4
|
webKey?: string;
|
|
@@ -17,10 +17,16 @@ export type AppMainProps = {
|
|
|
17
17
|
previewMode?: boolean;
|
|
18
18
|
debugMode?: boolean;
|
|
19
19
|
branding?: boolean;
|
|
20
|
+
/** Set by the server that metered this render: the account behind this space is over its quota. */
|
|
21
|
+
overQuota?: boolean;
|
|
20
22
|
analytics?: AnalyticsConfig;
|
|
21
23
|
state?: Record<string, unknown>;
|
|
24
|
+
/** What the embedding application hands this space — see `PlitziSdkProps`. */
|
|
25
|
+
hostData?: Record<string, unknown>;
|
|
26
|
+
/** What it is willing to be asked to do — see `PlitziSdkProps`. */
|
|
27
|
+
hostActions?: HostActions;
|
|
22
28
|
onInitStateManager?: (instance: RuntimeStateInstance) => void;
|
|
23
29
|
onInitEventBridge?: (instance: EventBridgeContextValue) => void;
|
|
24
30
|
};
|
|
25
|
-
declare const AppMain: ({ revision, webKey, webId, environment, currentPageId, server, isHydrating, offlineMode, offlineData, offlineDataType, instanceId, renderMode, sdkStylePath, sdkDevToolsStylePath, previewMode, debugMode, analytics, onInitEventBridge, onInitStateManager, ...sdkProps }: AppMainProps) => import("react").JSX.Element;
|
|
31
|
+
declare const AppMain: ({ revision, webKey, webId, environment, currentPageId, server, isHydrating, offlineMode, offlineData, offlineDataType, instanceId, renderMode, sdkStylePath, sdkDevToolsStylePath, previewMode, debugMode, overQuota, analytics, onInitEventBridge, hostData, hostActions, onInitStateManager, ...sdkProps }: AppMainProps) => import("react").JSX.Element;
|
|
26
32
|
export default AppMain;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ThemedRootProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** True when this space is embedded in an application with a theme of its own — see `ThemeProvider`'s `scope`. */
|
|
5
|
+
scoped?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The SDK's own root, wearing the theme when the document is not this space's to write on.
|
|
10
|
+
*
|
|
11
|
+
* An embedded space cannot stamp `<html>` — the desktop window's chrome reads that class, and repainting the
|
|
12
|
+
* application around a space is not what toggling the space's theme means. So the class lands here instead, on the
|
|
13
|
+
* element the space actually occupies, which is all its own styles ever needed: `.dark` and `.light` declare
|
|
14
|
+
* `color-scheme` wherever they sit, and Tailwind's `dark:` variant matches any ancestor.
|
|
15
|
+
*
|
|
16
|
+
* `system` writes nothing, here as everywhere else: with no class the space inherits whatever the host document
|
|
17
|
+
* settled on, which for an embedded surface is the right default.
|
|
18
|
+
*/
|
|
19
|
+
declare const ThemedRoot: ({ className, scoped, children }: ThemedRootProps) => import("react").JSX.Element;
|
|
20
|
+
export default ThemedRoot;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shown unless the visitor hid them. Absent means no preference, and no preference means show. */
|
|
2
|
+
export declare const readDebugPreference: (name: string) => boolean;
|
|
3
|
+
/** JSON, because that is the shape `useStorage` wrote for as long as this was a `useStorage` value, and a cookie
|
|
4
|
+
* written before this change still has to read back the same. */
|
|
5
|
+
export declare const writeDebugPreference: (name: string, shown: boolean) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './debugPreference';
|
|
@@ -4,10 +4,14 @@ export type UseDebugShortcutProps = {
|
|
|
4
4
|
onToggle: () => void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Shows or hides the dev tools on a page that was already allowed to show them; it cannot grant that permission.
|
|
8
|
+
* The environment is deliberately not part of the rule — whoever mounts the SDK may well want to debug a
|
|
9
9
|
* production space — but a visitor of a site that never asked for debugging must not reach the panel, the element
|
|
10
10
|
* ids or the store by knowing the shortcut.
|
|
11
|
+
*
|
|
12
|
+
* **Two chords, and the second is not a convenience.** On a Mac the top row is media keys unless the visitor
|
|
13
|
+
* holds `fn` or has changed a system setting, so `shift+F12` is a shortcut a good half of the people reading this
|
|
14
|
+
* cannot press. `shift+alt+D` is typeable on every keyboard, which is what makes the panel actually reachable.
|
|
11
15
|
*/
|
|
12
16
|
declare const useDebugShortcut: ({ authorized, onToggle }: UseDebugShortcutProps) => void;
|
|
13
17
|
export default useDebugShortcut;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FontHead } from '@plitzi/sdk-shared';
|
|
2
|
+
export type FontFacesProps = {
|
|
3
|
+
/** What the space's manifest resolves to — `fontsToHead(style.fonts, ...)`. */
|
|
4
|
+
head: FontHead;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The space's web fonts, in the document, for a render that has no server to have put them there.
|
|
8
|
+
*
|
|
9
|
+
* A component rather than a call inside `Sdk` because the render modes decide who needs it: everything that paints
|
|
10
|
+
* into THIS document, shadow included — where a `@font-face` would be ignored — and not the iframe, whose head is
|
|
11
|
+
* fed through the asset rail instead.
|
|
12
|
+
*/
|
|
13
|
+
declare const FontFaces: ({ head }: FontFacesProps) => null;
|
|
14
|
+
export default FontFaces;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a site says while it is over its plan's quota.
|
|
3
|
+
*
|
|
4
|
+
* The server decides this, not the page: `render.overQuota` is set from what metering answered for THIS render, so
|
|
5
|
+
* a space cannot turn it off from its own settings — the same reason the "Made in Plitzi" badge is forced on while
|
|
6
|
+
* degraded. It renders nothing at all the rest of the time, which is every render of every paid or in-quota space.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately a line and a link rather than a modal or an interstitial: the site still works, its visitors are not
|
|
9
|
+
* the ones who can fix this, and the person who can is the one who recognises their own site.
|
|
10
|
+
*/
|
|
11
|
+
declare const OverQuotaNotice: () => import("react").JSX.Element | null;
|
|
12
|
+
export default OverQuotaNotice;
|