@plitzi/plitzi-sdk 0.37.2 → 0.37.3
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 +1159 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.html +2 -1
- package/dist/modules/App/SpaceThemeProvider.d.ts +19 -0
- package/dist/modules/Network/graphqlClient.d.ts +18 -0
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js +294 -0
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js.gz +0 -0
- package/dist/plitzi-sdk-devtools.css +1 -1
- package/dist/plitzi-sdk-devtools.css.gz +0 -0
- package/dist/plitzi-sdk.css +1 -1
- package/dist/plitzi-sdk.css.gz +0 -0
- package/dist/plitzi-sdk.js +146 -614
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +15 -17
- package/dist/modules/App/AppHelper.d.ts +0 -3
- package/dist/modules/Space/SpaceContext.d.ts +0 -2
- package/dist/modules/Space/SpaceContextProvider.d.ts +0 -6
- package/dist/rolldown-runtime-CxhCXM28.js +0 -1
- package/dist/withElement-DOJg5xqo.js +0 -5
- /package/dist/modules/{index.d.ts → Network/graphqlClient.test.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as ComponentProvider } from '@plitzi/sdk-elements/Component/ComponentProvider';
|
|
2
1
|
import { default as sdkComponents } from './modules/Element';
|
|
2
|
+
import { default as ComponentProvider } from '@plitzi/sdk-elements/Component/ComponentProvider';
|
|
3
3
|
import { default as withElement } from '@plitzi/sdk-elements/Element/hocs/withElement';
|
|
4
4
|
import { default as useElement } from '@plitzi/sdk-elements/Element/hooks/useElement';
|
|
5
5
|
import { default as useRscData } from '@plitzi/sdk-elements/Element/hooks/useRscData';
|
|
@@ -8,6 +8,7 @@ import { default as PluginManager } from '@plitzi/sdk-elements/Element/PluginMan
|
|
|
8
8
|
import { default as PluginRemote } from '@plitzi/sdk-elements/Element/PluginRemote';
|
|
9
9
|
import { default as ReplicaProvider } from '@plitzi/sdk-elements/Element/ReplicaProvider';
|
|
10
10
|
import { default as RootElement } from '@plitzi/sdk-elements/Element/RootElement';
|
|
11
|
+
import { default as useChannel, ChannelHandle } from '@plitzi/sdk-elements/realtime/useChannel';
|
|
11
12
|
import { default as ComponentContext } from '@plitzi/sdk-shared/elements/ComponentContext';
|
|
12
13
|
import { PlitziServiceProvider } from '@plitzi/sdk-shared/hooks/usePlitziServiceContext';
|
|
13
14
|
import { default as useRscRefresh } from '@plitzi/sdk-shared/server/rsc/useRscRefresh';
|
|
@@ -16,7 +17,9 @@ import { track } from './modules/Analytics';
|
|
|
16
17
|
import { ElementContextValue } from '@plitzi/sdk-elements/Element/ElementContext';
|
|
17
18
|
import { default as EventBridge } from '@plitzi/sdk-event-bridge';
|
|
18
19
|
import { default as InteractionsManager } from '@plitzi/sdk-interactions/InteractionsManager';
|
|
19
|
-
import { ActionRunSummary, AnalyticsConfig, Element, Schema, Style, ComponentPluginFC, ComponentPlugin, InteractionCallback, InteractionCallbackParamValues, Environment, EventBridgeContextValue, HostActions, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance, Theme, ThemeScope, PlitziServiceContextValue as BasePlitziServiceContextValue } from '@plitzi/sdk-shared';
|
|
20
|
+
import { ActionRunSummary, AnalyticsConfig, Element, Schema, Style, ComponentPluginFC, ComponentPlugin, InteractionCallback, InteractionCallbackParamValues, Environment, EventBridgeContextValue, HostActions, OfflineDataRaw, RenderMode, Server, RuntimeStateInstance, Theme, ThemeScope, PlitziServiceContextValue as BasePlitziServiceContextValue, RealtimeMessage } from '@plitzi/sdk-shared';
|
|
21
|
+
import { PluginDeclaration } from '@plitzi/sdk-shared/authoring/declare';
|
|
22
|
+
import { RealtimeMember } from '@plitzi/sdk-shared/realtime';
|
|
20
23
|
import { ReactNode } from 'react';
|
|
21
24
|
/**
|
|
22
25
|
* A registered plugin is a COMPONENT, not a decorated one.
|
|
@@ -68,6 +71,11 @@ export type PlitziSdkProps = {
|
|
|
68
71
|
debugMode?: boolean;
|
|
69
72
|
/** What the server ran to build this page, for the dev-tools. Only ever sent to a page allowed to debug them. */
|
|
70
73
|
actionRuns?: ActionRunSummary[];
|
|
74
|
+
/**
|
|
75
|
+
* Set by the server that rendered this page: `offlineData.style.cache` was left out of the payload because the
|
|
76
|
+
* page's own stylesheet holds it, and `render()` reads it back from there before hydrating.
|
|
77
|
+
*/
|
|
78
|
+
styleCacheInDocument?: boolean;
|
|
71
79
|
isHydrating?: boolean;
|
|
72
80
|
previewMode?: boolean;
|
|
73
81
|
/** Set by the server that metered this render: the account behind this space is over its quota, so the page says
|
|
@@ -111,8 +119,8 @@ declare const PlitziSdk: {
|
|
|
111
119
|
};
|
|
112
120
|
type PlitziServiceContextValue = BasePlitziServiceContextValue<InstanceType<typeof EventBridge>, InstanceType<typeof InteractionsManager>>;
|
|
113
121
|
declare const usePlitziServiceContext: () => PlitziServiceContextValue;
|
|
114
|
-
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData, useRscRefresh };
|
|
115
|
-
export type { AnalyticsConfig, ElementContextValue, Element, Schema, Style, ComponentPlugin, ComponentPluginFC, PlitziServiceContextValue, OfflineDataRaw, InteractionCallback, InteractionCallbackParamValues };
|
|
122
|
+
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData, useRscRefresh, useChannel };
|
|
123
|
+
export type { AnalyticsConfig, ElementContextValue, Element, Schema, Style, ComponentPlugin, ComponentPluginFC, PlitziServiceContextValue, OfflineDataRaw, InteractionCallback, InteractionCallbackParamValues, PluginDeclaration, ChannelHandle, RealtimeMember, RealtimeMessage };
|
|
116
124
|
export declare const version: string;
|
|
117
125
|
export declare const getStateManager: () => RuntimeStateInstance;
|
|
118
126
|
export declare const getEventBridge: () => EventBridgeContextValue;
|
package/dist/index.html
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"react-dom": "/plitzi-sdk-vendor.js",
|
|
25
25
|
"react-dom/client": "/plitzi-sdk-vendor.js",
|
|
26
26
|
"react/jsx-runtime": "/plitzi-sdk-vendor.js",
|
|
27
|
+
"react/compiler-runtime": "/plitzi-sdk-vendor.js",
|
|
27
28
|
"@plitzi/plitzi-sdk": "/plitzi-sdk.js"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
render(
|
|
58
59
|
'plitzi',
|
|
59
60
|
{
|
|
60
|
-
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
61
|
+
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCIsImh0dHBzOi8vZGV2LnBsaXR6aS5jb20iLCJodHRwczovL3BsaXR6aS5jb20iLCJodHRwczovL3N0Zy5wbGl0emkuY29tIl0sImlzcyI6Imh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImF1ZCI6WyJodHRwczovL3BsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAwIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDEiLCJodHRwczovL2FwaS5wbGl0emkubG9jYWwiLCJodHRwczovL3Nzci5wbGl0emkubG9jYWwiLCJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJodHRwczovL21jcC5wbGl0emkubG9jYWwiLCJodHRwczovL2F1dGgucGxpdHppLmxvY2FsIiwiaHR0cDovLzEyNy4wLjAuMTo1MzAwIiwiaHR0cDovL2xvY2FsaG9zdDo1MTgwIl0sInNjb3BlIjoic3BhY2U6cmVuZGVyIiwiaWF0IjoxNzkwMjEzMjg5LCJqdGkiOiJhZDgyN2EyMjliZjhlMzk3IiwibmJmIjoxNzkwMjEzMjg5fQ.dedpVVA5Nv3Xr7nEOZ8UmEJcIamF9AHGnLgqQyDV8-k',
|
|
61
62
|
environment: 'main',
|
|
62
63
|
revision: 0,
|
|
63
64
|
renderMode: 'raw',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ThemeScope } from '@plitzi/sdk-shared';
|
|
2
|
+
import { Theme } from '@plitzi/sdk-shared/types';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export type SpaceThemeProviderProps = {
|
|
5
|
+
scope: ThemeScope;
|
|
6
|
+
/** A theme the host already settled — the cookie a server read — which wins over everything here. */
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The theme provider, starting where the SPACE says to start.
|
|
12
|
+
*
|
|
13
|
+
* `style.theme.default` is what a space declares a first visit looks like; the provider was mounted with a hard-coded
|
|
14
|
+
* `system`, so the setting was stored, edited in the builder and written by authoring, and never rendered. It is read
|
|
15
|
+
* from the store because a space fetched after mount arrives there late — the provider re-applies its default when
|
|
16
|
+
* it does, and a visitor's own choice (the cookie) still wins.
|
|
17
|
+
*/
|
|
18
|
+
declare const SpaceThemeProvider: ({ scope, theme, children }: SpaceThemeProviderProps) => import('react').JSX.Element;
|
|
19
|
+
export default SpaceThemeProvider;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Where a request stopped: never reached the server, refused by it, or answered with errors in place of data. */
|
|
2
|
+
export type GraphqlFailure = 'network' | 'http' | 'graphql';
|
|
3
|
+
export declare class GraphqlRequestError extends Error {
|
|
4
|
+
readonly failure: GraphqlFailure;
|
|
5
|
+
readonly statusCode?: number;
|
|
6
|
+
constructor(message: string, failure: GraphqlFailure, statusCode?: number);
|
|
7
|
+
}
|
|
8
|
+
export type GraphqlClient = {
|
|
9
|
+
request: <T>(document: string, variables?: Record<string, unknown>) => Promise<T>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* What the SDK sends its server: a handful of queries, always to the network, never cached, never subscribed to. A
|
|
13
|
+
* GraphQL client with a normalized cache would be most of the SDK's weight for that, so this is a `fetch`.
|
|
14
|
+
*
|
|
15
|
+
* A refusal still counts for the session: it goes to the auth-failure channel, the way the builder's Apollo link sends
|
|
16
|
+
* it, so a session revoked elsewhere is noticed by whichever request is refused next.
|
|
17
|
+
*/
|
|
18
|
+
export declare const createGraphqlClient: (uri: string, webKey: string) => GraphqlClient;
|