@plitzi/plitzi-sdk 0.37.8 → 0.37.10
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 +843 -0
- package/dist/App.d.ts +14 -1
- package/dist/index.d.ts +15 -1
- package/dist/modules/App/AppMain.d.ts +7 -1
- package/dist/modules/App/ThemedRoot.d.ts +4 -0
- package/dist/modules/Element/elements/PlitziSdk/index.d.ts +1 -1
- package/dist/modules/Navigation/useScrollToHash.d.ts +16 -0
- package/dist/plitzi-sdk-devtools-VG-namO1.js +376 -0
- package/dist/plitzi-sdk-devtools-VG-namO1.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 +123 -122
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +14 -14
- package/dist/modules/Segments/SegmentsContextProvider.d.ts +0 -6
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js +0 -294
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js.gz +0 -0
- /package/dist/modules/{Segments/index.d.ts → Navigation/useScrollToHash.test.d.ts} +0 -0
package/dist/App.d.ts
CHANGED
|
@@ -43,8 +43,21 @@ export type AppProps = {
|
|
|
43
43
|
/** The theme the host already settled — from the cookie a server read before it rendered the document. */
|
|
44
44
|
theme?: Theme;
|
|
45
45
|
state?: Record<string, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* The feature flags this embedding decides, by name: `{ newCheckout: true }`. Above whatever the space and the server
|
|
48
|
+
* rendering it say, below a tester with the dev tools. Only for flags the space declares — anything else is ignored,
|
|
49
|
+
* with a warning in the console.
|
|
50
|
+
*/
|
|
51
|
+
flags?: Record<string, boolean>;
|
|
52
|
+
/** Set by the server that rendered this page: the flags its deployment decides (`createServer({ flags })`). */
|
|
53
|
+
serverFlags?: Record<string, boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Set by the server that rendered this page for somebody allowed to debug it: the flags a tester forced, read from
|
|
56
|
+
* the cookie the dev tools write — so the page hydrates drawn the way the server drew it.
|
|
57
|
+
*/
|
|
58
|
+
forcedFlags?: Record<string, boolean>;
|
|
46
59
|
onInitStateManager?: (instance: RuntimeStateInstance) => void;
|
|
47
60
|
onInitEventBridge?: (instance: EventBridgeContextValue) => void;
|
|
48
61
|
};
|
|
49
|
-
declare const App: ({ className, children, webKey, server, renderMode, routing, debugMode: debugModeProp, themeScope, theme, state, ...sdkProps }: AppProps) => import('react').JSX.Element;
|
|
62
|
+
declare const App: ({ className, children, webKey, server, renderMode, routing, debugMode: debugModeProp, themeScope, theme, state, forcedFlags, ...sdkProps }: AppProps) => import('react').JSX.Element;
|
|
50
63
|
export default App;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as sdkComponents } from './modules/Element';
|
|
2
2
|
import { default as ComponentProvider } from '@plitzi/sdk-elements/Component/ComponentProvider';
|
|
3
|
+
import { default as useFlag } from '@plitzi/sdk-elements/dataSource/useFlag';
|
|
3
4
|
import { default as withElement } from '@plitzi/sdk-elements/Element/hocs/withElement';
|
|
4
5
|
import { default as useElement } from '@plitzi/sdk-elements/Element/hooks/useElement';
|
|
5
6
|
import { default as useRscData } from '@plitzi/sdk-elements/Element/hooks/useRscData';
|
|
@@ -71,6 +72,19 @@ export type PlitziSdkProps = {
|
|
|
71
72
|
debugMode?: boolean;
|
|
72
73
|
/** What the server ran to build this page, for the dev-tools. Only ever sent to a page allowed to debug them. */
|
|
73
74
|
actionRuns?: ActionRunSummary[];
|
|
75
|
+
/**
|
|
76
|
+
* The feature flags this embedding decides, by name: `{ newCheckout: true }`. Above whatever the space and the server
|
|
77
|
+
* rendering it say, below a tester with the dev tools. Only for flags the space declares — anything else is ignored,
|
|
78
|
+
* with a warning in the console.
|
|
79
|
+
*/
|
|
80
|
+
flags?: Record<string, boolean>;
|
|
81
|
+
/** Set by the server that rendered this page: the flags its deployment decides (`createServer({ flags })`). */
|
|
82
|
+
serverFlags?: Record<string, boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Set by the server that rendered this page for somebody allowed to debug it: the flags a tester forced, read from
|
|
85
|
+
* the cookie the dev tools write — so the page hydrates drawn the way the server drew it.
|
|
86
|
+
*/
|
|
87
|
+
forcedFlags?: Record<string, boolean>;
|
|
74
88
|
/**
|
|
75
89
|
* Set by the server that rendered this page: `offlineData.style.cache` was left out of the payload because the
|
|
76
90
|
* page's own stylesheet holds it, and `render()` reads it back from there before hydrating.
|
|
@@ -119,7 +133,7 @@ declare const PlitziSdk: {
|
|
|
119
133
|
};
|
|
120
134
|
type PlitziServiceContextValue = BasePlitziServiceContextValue<InstanceType<typeof EventBridge>, InstanceType<typeof InteractionsManager>>;
|
|
121
135
|
declare const usePlitziServiceContext: () => PlitziServiceContextValue;
|
|
122
|
-
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData, useRscRefresh, useChannel };
|
|
136
|
+
export { track, useSdkStore as useStore, ComponentProvider, ComponentContext, usePlitziServiceContext, PlitziServiceProvider, RootElement, withElement, JsxManager, PluginManager, sdkComponents, PluginRemote, ReplicaProvider, useElement, useRscData, useRscRefresh, useChannel, useFlag };
|
|
123
137
|
export type { AnalyticsConfig, ElementContextValue, Element, Schema, Style, ComponentPlugin, ComponentPluginFC, PlitziServiceContextValue, OfflineDataRaw, InteractionCallback, InteractionCallbackParamValues, PluginDeclaration, ChannelHandle, RealtimeMember, RealtimeMessage };
|
|
124
138
|
export declare const version: string;
|
|
125
139
|
export declare const getStateManager: () => RuntimeStateInstance;
|
|
@@ -20,6 +20,12 @@ export type AppMainProps = {
|
|
|
20
20
|
overQuota?: boolean;
|
|
21
21
|
analytics?: AnalyticsConfig;
|
|
22
22
|
state?: Record<string, unknown>;
|
|
23
|
+
/** The flags this embedding decides — see `PlitziSdkProps`. */
|
|
24
|
+
flags?: Record<string, boolean>;
|
|
25
|
+
/** The flags the rendering server decides — see `PlitziSdkProps`. */
|
|
26
|
+
serverFlags?: Record<string, boolean>;
|
|
27
|
+
/** The flags a tester forced, already settled against whether this page may debug. */
|
|
28
|
+
forcedFlags?: Record<string, boolean>;
|
|
23
29
|
/** What the embedding application hands this space — see `PlitziSdkProps`. */
|
|
24
30
|
hostData?: Record<string, unknown>;
|
|
25
31
|
/** What it is willing to be asked to do — see `PlitziSdkProps`. */
|
|
@@ -27,5 +33,5 @@ export type AppMainProps = {
|
|
|
27
33
|
onInitStateManager?: (instance: RuntimeStateInstance) => void;
|
|
28
34
|
onInitEventBridge?: (instance: EventBridgeContextValue) => void;
|
|
29
35
|
};
|
|
30
|
-
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;
|
|
36
|
+
declare const AppMain: ({ revision, webKey, webId, environment, currentPageId, server, isHydrating, offlineMode, offlineData, offlineDataType, instanceId, renderMode, sdkStylePath, sdkDevToolsStylePath, previewMode, debugMode, overQuota, analytics, onInitEventBridge, hostData, hostActions, flags, serverFlags, forcedFlags, onInitStateManager, ...sdkProps }: AppMainProps) => import('react').JSX.Element;
|
|
31
37
|
export default AppMain;
|
|
@@ -15,6 +15,10 @@ export type ThemedRootProps = {
|
|
|
15
15
|
*
|
|
16
16
|
* `system` writes nothing, here as everywhere else: with no class the space inherits whatever the host document
|
|
17
17
|
* settled on, which for an embedded surface is the right default.
|
|
18
|
+
*
|
|
19
|
+
* It also says when the page is interactive: `data-hydrated` appears once React has taken over the server's markup
|
|
20
|
+
* (at once for a page rendered in the browser). A space's CSS keys decorative motion that repaints every frame off it
|
|
21
|
+
* — `[data-hydrated] .glow { animation-play-state: running; }` — so the load has the main thread to itself.
|
|
18
22
|
*/
|
|
19
23
|
declare const ThemedRoot: ({ className, scoped, children }: ThemedRootProps) => import('react').JSX.Element;
|
|
20
24
|
export default ThemedRoot;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** How long a fragment waits for its element: a section behind a provider appears once its data does. */
|
|
2
|
+
export declare const HASH_WAIT_MS = 3000;
|
|
3
|
+
/**
|
|
4
|
+
* Lands on the element a URL's `#fragment` names, after each navigation that carries one — on arrival too.
|
|
5
|
+
*
|
|
6
|
+
* The browser does this by itself only for a page it loaded whole, and only for what is in it at that moment: a
|
|
7
|
+
* client-side navigation never asks it to, and a section that renders once its data arrives is not there yet. So the
|
|
8
|
+
* element is looked for now and, if absent, as the page fills in, for {@link HASH_WAIT_MS}; somebody who scrolls in the
|
|
9
|
+
* meantime has gone somewhere else, and is left there. `navigationKey` makes a second click on the same link land again.
|
|
10
|
+
*/
|
|
11
|
+
declare const useScrollToHash: ({ hash, navigationKey, enabled }: {
|
|
12
|
+
hash: string;
|
|
13
|
+
navigationKey?: string;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
export default useScrollToHash;
|