@plitzi/sdk-shared 0.33.2 → 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 +58 -0
- package/dist/actions/cron.d.ts +34 -0
- package/dist/actions/cron.mjs +72 -0
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/index.mjs +5 -0
- package/dist/actions/triggerParams.d.ts +41 -0
- package/dist/actions/triggerParams.mjs +40 -0
- package/dist/actions/triggers.d.ts +29 -0
- package/dist/actions/triggers.mjs +4 -0
- package/dist/actions/validateDocument.d.ts +23 -0
- package/dist/actions/validateDocument.mjs +267 -0
- package/dist/auth/failureChannel.d.ts +9 -4
- package/dist/auth/failureChannel.mjs +3 -2
- package/dist/authoring/builder.d.ts +51 -0
- package/dist/authoring/builder.mjs +29 -0
- package/dist/authoring/declare.d.ts +64 -0
- package/dist/authoring/declare.mjs +4 -0
- package/dist/authoring/elementCallbacks.d.ts +13 -0
- package/dist/authoring/elementCallbacks.mjs +71 -0
- package/dist/authoring/index.d.ts +21 -0
- package/dist/authoring/index.mjs +6 -0
- package/dist/authoring/paramSpec.d.ts +51 -0
- package/dist/authoring/paramSpec.mjs +40 -0
- package/dist/authoring/spaceCallbacks.d.ts +10 -0
- package/dist/authoring/spaceCallbacks.mjs +51 -0
- package/dist/builder/contexts/BuilderContext.d.ts +2 -4
- package/dist/dataSource/getBindingsDetails.mjs +1 -1
- package/dist/dataSource/helpers/getSourceName.d.ts +1 -3
- package/dist/dataSource/helpers/getSourceName.mjs +1 -1
- package/dist/dataSource/index.d.ts +2 -0
- package/dist/dataSource/index.mjs +6 -5
- package/dist/dataSource/resolveVariables.d.ts +22 -0
- package/dist/dataSource/resolveVariables.mjs +16 -0
- package/dist/dataSource/utility/index.mjs +15 -13
- package/dist/dataSource/utility/not.d.ts +11 -0
- package/dist/dataSource/utility/not.mjs +15 -0
- package/dist/devTools/debugCookie.d.ts +16 -0
- package/dist/devTools/debugCookie.mjs +7 -0
- package/dist/devTools/index.d.ts +6 -2
- package/dist/devTools/index.mjs +4 -2
- package/dist/devTools/interactionLog.d.ts +14 -0
- package/dist/devTools/interactionLog.mjs +4 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.mjs +11 -9
- package/dist/helpers/reducerOrigin.d.ts +15 -0
- package/dist/helpers/reducerOrigin.mjs +4 -0
- package/dist/helpers/ruleEvaluator.d.ts +14 -0
- package/dist/helpers/ruleEvaluator.mjs +5 -0
- package/dist/helpers/twigWrapper/AST.d.ts +12 -1
- package/dist/helpers/twigWrapper/AST.mjs +0 -0
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +7 -0
- package/dist/helpers/twigWrapper/Parser/Cursor.d.ts +7 -0
- package/dist/helpers/twigWrapper/Parser/Cursor.mjs +5 -0
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +46 -8
- package/dist/helpers/twigWrapper/Parser/types.mjs +0 -0
- package/dist/helpers/twigWrapper/charClass.d.ts +7 -0
- package/dist/helpers/twigWrapper/charClass.mjs +16 -12
- package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +2 -2
- package/dist/helpers/utils.d.ts +0 -2
- package/dist/helpers/utils.mjs +16 -19
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.mjs +4 -3
- package/dist/hooks/useFontHead.d.ts +3 -0
- package/dist/hooks/useFontHead.mjs +23 -0
- package/dist/hooks/usePlitziServiceContext.d.ts +3 -2
- package/dist/index.mjs +61 -45
- package/dist/navigation/index.d.ts +1 -1
- package/dist/navigation/index.mjs +2 -2
- package/dist/navigation/routes.d.ts +8 -0
- package/dist/navigation/routes.mjs +39 -39
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +3 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +2 -3
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +24 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +150 -132
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -1
- package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +30 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +16 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +25 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +17 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.d.ts +30 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +40 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +16 -0
- package/dist/network/graphql/builder/Queries/index.mjs +24 -14
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +4 -0
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +5 -2
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -1
- package/dist/network/spaceEvents.d.ts +20 -1
- package/dist/network/spaceEvents.mjs +89 -74
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.mjs +2 -1
- package/dist/schema/serverElements.d.ts +16 -0
- package/dist/schema/serverElements.mjs +18 -0
- package/dist/server/actions/useActionsSync.d.ts +10 -0
- package/dist/server/actions/useActionsSync.mjs +7 -0
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.mjs +5 -4
- package/dist/server/rsc/refreshRsc.d.ts +11 -1
- package/dist/server/rsc/refreshRsc.mjs +30 -12
- package/dist/server/rsc/useRscSync.mjs +20 -13
- package/dist/state/runtimeStatePersist.mjs +4 -3
- package/dist/store/actionRuns/actionRunsRecorder.d.ts +36 -0
- package/dist/store/actionRuns/actionRunsRecorder.mjs +39 -0
- package/dist/store/actionRuns/actionRunsStore.d.ts +16 -0
- package/dist/store/actionRuns/actionRunsStore.mjs +5 -0
- package/dist/store/actionRuns/index.d.ts +6 -0
- package/dist/store/actionRuns/index.mjs +4 -0
- package/dist/store/actionRuns/useActionRuns.d.ts +13 -0
- package/dist/store/actionRuns/useActionRuns.mjs +10 -0
- package/dist/store/index.d.ts +46 -45
- package/dist/store/index.mjs +6 -3
- package/dist/store/renderSettings.d.ts +3 -0
- package/dist/store/renderSettings.mjs +17 -5
- package/dist/store/tracing/tracingCollector.d.ts +1 -1
- package/dist/store/tracing/tracingCollector.mjs +37 -35
- package/dist/store/tracing/tracingStore.d.ts +13 -0
- package/dist/store/tracing/tracingStore.mjs +3 -3
- package/dist/style/fontAssets.d.ts +12 -0
- package/dist/style/fontAssets.mjs +18 -0
- package/dist/style/fontValidation.d.ts +8 -0
- package/dist/style/fontValidation.mjs +107 -0
- package/dist/style/fonts.d.ts +74 -0
- package/dist/style/fonts.mjs +198 -0
- package/dist/style/fontsFromCss.d.ts +27 -0
- package/dist/style/fontsFromCss.mjs +43 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.mjs +5 -1
- package/dist/style/styleConstants.d.ts +2 -2
- package/dist/style/styleConstants.mjs +1 -0
- package/dist/theme/ThemeProvider.d.ts +36 -6
- package/dist/theme/ThemeProvider.mjs +49 -35
- package/dist/theme/ThemeScope.d.ts +16 -0
- package/dist/theme/ThemeScope.mjs +6 -0
- package/dist/theme/index.d.ts +7 -1
- package/dist/theme/index.mjs +6 -2
- package/dist/theme/themeCookie.d.ts +30 -0
- package/dist/theme/themeCookie.mjs +24 -0
- package/dist/theme/themeStore.d.ts +40 -0
- package/dist/theme/themeStore.mjs +17 -0
- package/dist/theme/useTheme.d.ts +29 -0
- package/dist/theme/useTheme.mjs +20 -0
- package/dist/types/ActionTypes.d.ts +396 -0
- package/dist/types/ActionTypes.mjs +0 -0
- package/dist/types/AuthTypes.d.ts +23 -2
- package/dist/types/BuilderTypes.d.ts +0 -12
- package/dist/types/CommonTypes.d.ts +13 -0
- package/dist/types/DevToolsTypes.d.ts +57 -14
- package/dist/types/EventBridgeTypes.d.ts +1 -1
- package/dist/types/InteractionTypes.d.ts +23 -3
- package/dist/types/PluginTypes.d.ts +0 -3
- package/dist/types/SchemaTypes.d.ts +29 -4
- package/dist/types/ServerTypes.d.ts +390 -46
- package/dist/types/SpaceTypes.d.ts +16 -0
- package/dist/types/StoreTypes.d.ts +181 -3
- package/dist/types/StyleTypes.d.ts +83 -4
- package/dist/types/TemplateTypes.d.ts +20 -0
- package/dist/types/TemplateTypes.mjs +0 -0
- package/dist/types/ThemeTypes.d.ts +28 -1
- package/dist/types/index.d.ts +2 -0
- package/eslint.config.mjs +2 -0
- package/package.json +244 -29
- package/vite.config.ts +27 -7
|
@@ -5,6 +5,10 @@ export type TInitQuery = {
|
|
|
5
5
|
schema: SchemaRaw;
|
|
6
6
|
style: Style;
|
|
7
7
|
segments?: SegmentRaw[];
|
|
8
|
+
/** What the server decided about this render. Server-side facts the space cannot author away. */
|
|
9
|
+
render?: {
|
|
10
|
+
overQuota: boolean;
|
|
11
|
+
};
|
|
8
12
|
};
|
|
9
13
|
};
|
|
10
14
|
declare const InitQuery: import('graphql').DocumentNode;
|
|
@@ -7,7 +7,6 @@ var t = e`
|
|
|
7
7
|
settings
|
|
8
8
|
flat {
|
|
9
9
|
id
|
|
10
|
-
idRef
|
|
11
10
|
definition {
|
|
12
11
|
label
|
|
13
12
|
type
|
|
@@ -55,7 +54,6 @@ var t = e`
|
|
|
55
54
|
}
|
|
56
55
|
flat {
|
|
57
56
|
id
|
|
58
|
-
idRef
|
|
59
57
|
definition {
|
|
60
58
|
label
|
|
61
59
|
type
|
|
@@ -83,6 +81,11 @@ var t = e`
|
|
|
83
81
|
variables
|
|
84
82
|
cache
|
|
85
83
|
}
|
|
84
|
+
# The schema fetch is the one moment a client-side render hears from the server at all, so the decision it
|
|
85
|
+
# would have been handed in an SSR bootstrap travels here instead.
|
|
86
|
+
render {
|
|
87
|
+
overQuota
|
|
88
|
+
}
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { StyleVariableCategory } from '../types/StyleTypes';
|
|
3
|
-
import { DropPosition, Element, PageFolder, SchemaRaw, SchemaVariable, Style, StyleCategory, StyleItem, StyleVariableValue } from '../types';
|
|
3
|
+
import { DropPosition, Element, PageFolder, SchemaRaw, SchemaVariable, SpaceFont, Style, StyleCategory, StyleItem, StyleVariableValue } from '../types';
|
|
4
4
|
export declare const spaceEventSchemas: {
|
|
5
5
|
readonly SPACE_UPDATED: z.ZodObject<{
|
|
6
6
|
schema: z.ZodCustom<SchemaRaw, SchemaRaw>;
|
|
@@ -50,6 +50,10 @@ export declare const spaceEventSchemas: {
|
|
|
50
50
|
readonly SPACE_UPDATE_ELEMENT: z.ZodObject<{
|
|
51
51
|
element: z.ZodCustom<Element, Element>;
|
|
52
52
|
}, z.core.$strip>;
|
|
53
|
+
readonly SPACE_RENAME_ELEMENT: z.ZodObject<{
|
|
54
|
+
elementId: z.ZodString;
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
}, z.core.$strip>;
|
|
53
57
|
readonly SPACE_UPDATE_ELEMENTS: z.ZodObject<{
|
|
54
58
|
elements: z.ZodArray<z.ZodCustom<Element, Element>>;
|
|
55
59
|
}, z.core.$strip>;
|
|
@@ -197,6 +201,16 @@ export declare const spaceEventSchemas: {
|
|
|
197
201
|
path: z.ZodString;
|
|
198
202
|
value: z.ZodString;
|
|
199
203
|
}, z.core.$strip>;
|
|
204
|
+
readonly STYLE_ADD_FONT: z.ZodObject<{
|
|
205
|
+
font: z.ZodCustom<SpaceFont, SpaceFont>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
readonly STYLE_UPDATE_FONT: z.ZodObject<{
|
|
208
|
+
family: z.ZodString;
|
|
209
|
+
font: z.ZodCustom<SpaceFont, SpaceFont>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
readonly STYLE_REMOVE_FONT: z.ZodObject<{
|
|
212
|
+
family: z.ZodString;
|
|
213
|
+
}, z.core.$strip>;
|
|
200
214
|
readonly SEGMENT_ADD_ELEMENT: z.ZodObject<{
|
|
201
215
|
element: z.ZodCustom<Element, Element>;
|
|
202
216
|
dropPosition: z.ZodCustom<DropPosition, DropPosition>;
|
|
@@ -209,6 +223,11 @@ export declare const spaceEventSchemas: {
|
|
|
209
223
|
element: z.ZodCustom<Element, Element>;
|
|
210
224
|
contextId: z.ZodString;
|
|
211
225
|
}, z.core.$strip>;
|
|
226
|
+
readonly SEGMENT_RENAME_ELEMENT: z.ZodObject<{
|
|
227
|
+
elementId: z.ZodString;
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
contextId: z.ZodString;
|
|
230
|
+
}, z.core.$strip>;
|
|
212
231
|
readonly SEGMENT_UPDATE_ELEMENTS: z.ZodObject<{
|
|
213
232
|
elements: z.ZodArray<z.ZodCustom<Element, Element>>;
|
|
214
233
|
contextId: z.ZodString;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { StyleVariableCategory as e } from "../types/StyleTypes.mjs";
|
|
2
2
|
import { z as t } from "zod";
|
|
3
3
|
//#region src/network/spaceEvents.ts
|
|
4
|
-
var n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = t.custom((e) => n(e) && typeof e.id == "string", { message: "expected an element with an id" }), i = t.array(r), a = t.custom((e) => n(e) && Array.isArray(e.flat), { message: "expected a schema whose `flat` is a list of elements" }), o = t.custom((e) => n(e) && typeof e.id == "string", { message: "expected a page folder with an id" }), s = t.custom((e) => n(e) && typeof e.name == "string", { message: "expected a variable with a name" }), c = t.custom(n, { message: "expected a style attributes object" }), l = t.custom((e) => typeof e == "string" || typeof e == "number" || n(e), { message: "expected a style variable value" }),
|
|
4
|
+
var n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = t.custom((e) => n(e) && typeof e.id == "string", { message: "expected an element with an id" }), i = t.array(r), a = t.custom((e) => n(e) && Array.isArray(e.flat), { message: "expected a schema whose `flat` is a list of elements" }), o = t.custom((e) => n(e) && typeof e.id == "string", { message: "expected a page folder with an id" }), s = t.custom((e) => n(e) && typeof e.name == "string", { message: "expected a variable with a name" }), c = t.custom(n, { message: "expected a style attributes object" }), l = t.custom((e) => n(e) && typeof e.family == "string" && typeof e.source == "string", { message: "expected a font with a family and a source" }), u = t.custom((e) => typeof e == "string" || typeof e == "number" || n(e), { message: "expected a style variable value" }), d = t.enum([
|
|
5
5
|
"desktop",
|
|
6
6
|
"tablet",
|
|
7
7
|
"mobile"
|
|
8
|
-
]),
|
|
8
|
+
]), f = t.custom((e) => typeof e == "string", { message: "expected a drop position" }), p = t.custom((e) => typeof e == "string", { message: "expected a style category" }), m = t.enum([
|
|
9
9
|
"class",
|
|
10
10
|
"element",
|
|
11
11
|
"id"
|
|
12
|
-
]),
|
|
12
|
+
]), h = t.enum([
|
|
13
13
|
"hover",
|
|
14
14
|
"active",
|
|
15
15
|
"focus",
|
|
16
16
|
"disabled",
|
|
17
17
|
"checked",
|
|
18
18
|
"visited"
|
|
19
|
-
]),
|
|
19
|
+
]), g = t.enum(e), _ = t.object({
|
|
20
20
|
componentType: t.string().optional(),
|
|
21
21
|
styleSelector: t.string().optional(),
|
|
22
|
-
styleState:
|
|
22
|
+
styleState: h.optional(),
|
|
23
23
|
styleVariant: t.string().optional()
|
|
24
|
-
}),
|
|
25
|
-
displayMode:
|
|
24
|
+
}), v = _.extend({ styleSelector: t.string() }), y = { contextId: t.string() }, b = t.object({ variable: s }), x = t.object({
|
|
25
|
+
displayMode: d,
|
|
26
26
|
selector: t.string(),
|
|
27
|
-
category:
|
|
27
|
+
category: g,
|
|
28
28
|
name: t.string(),
|
|
29
|
-
value:
|
|
30
|
-
}),
|
|
31
|
-
displayMode:
|
|
29
|
+
value: u
|
|
30
|
+
}), S = t.object({
|
|
31
|
+
displayMode: d,
|
|
32
32
|
selector: t.string(),
|
|
33
|
-
category:
|
|
33
|
+
category: g,
|
|
34
34
|
name: t.string()
|
|
35
|
-
}),
|
|
36
|
-
category:
|
|
35
|
+
}), C = t.object({
|
|
36
|
+
category: g,
|
|
37
37
|
name: t.string(),
|
|
38
|
-
value:
|
|
39
|
-
}),
|
|
38
|
+
value: u
|
|
39
|
+
}), w = {
|
|
40
40
|
SPACE_UPDATED: t.object({ schema: a }),
|
|
41
41
|
STYLE_UPDATED: t.object({
|
|
42
42
|
platform: t.custom(n),
|
|
@@ -50,36 +50,40 @@ var n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = t.custom((e
|
|
|
50
50
|
SPACE_ADD_PAGE_FOLDER: t.object({ pageFolder: o }),
|
|
51
51
|
SPACE_UPDATE_PAGE_FOLDER: t.object({ pageFolder: o }),
|
|
52
52
|
SPACE_REMOVE_PAGE_FOLDER: t.object({ pageFolderId: t.string() }),
|
|
53
|
-
SPACE_ADD_VARIABLE:
|
|
54
|
-
SPACE_UPDATE_VARIABLE:
|
|
53
|
+
SPACE_ADD_VARIABLE: b,
|
|
54
|
+
SPACE_UPDATE_VARIABLE: b,
|
|
55
55
|
SPACE_REMOVE_VARIABLE: t.object({ name: t.string() }),
|
|
56
56
|
SPACE_ADD_ELEMENT: t.object({
|
|
57
57
|
element: r,
|
|
58
|
-
dropPosition:
|
|
58
|
+
dropPosition: f,
|
|
59
59
|
to: t.string(),
|
|
60
60
|
initialItems: i.optional(),
|
|
61
61
|
variables: t.array(s).optional()
|
|
62
62
|
}),
|
|
63
63
|
SPACE_UPDATE_ELEMENT: t.object({ element: r }),
|
|
64
|
+
SPACE_RENAME_ELEMENT: t.object({
|
|
65
|
+
elementId: t.string(),
|
|
66
|
+
id: t.string()
|
|
67
|
+
}),
|
|
64
68
|
SPACE_UPDATE_ELEMENTS: t.object({ elements: i }),
|
|
65
69
|
SPACE_REMOVE_ELEMENT: t.object({ elementId: t.string() }),
|
|
66
70
|
SPACE_MOVE_ELEMENT: t.object({
|
|
67
71
|
from: t.string(),
|
|
68
72
|
to: t.string(),
|
|
69
73
|
elementId: t.string(),
|
|
70
|
-
dropPosition:
|
|
74
|
+
dropPosition: f
|
|
71
75
|
}),
|
|
72
76
|
SPACE_CLONE_ELEMENT: t.object({
|
|
73
77
|
to: t.string(),
|
|
74
78
|
element: r,
|
|
75
|
-
dropPosition:
|
|
79
|
+
dropPosition: f,
|
|
76
80
|
initialItems: i
|
|
77
81
|
}),
|
|
78
82
|
SPACE_ADD_TEMPLATE: t.object({
|
|
79
83
|
element: r,
|
|
80
84
|
style: t.custom(n),
|
|
81
85
|
to: t.string(),
|
|
82
|
-
dropPosition:
|
|
86
|
+
dropPosition: f,
|
|
83
87
|
initialItems: i.optional(),
|
|
84
88
|
variables: t.array(s).optional()
|
|
85
89
|
}),
|
|
@@ -92,135 +96,146 @@ var n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = t.custom((e
|
|
|
92
96
|
])
|
|
93
97
|
}),
|
|
94
98
|
STYLE_ADD_SELECTOR: t.object({
|
|
95
|
-
displayMode:
|
|
99
|
+
displayMode: d,
|
|
96
100
|
selector: t.string(),
|
|
97
|
-
path:
|
|
98
|
-
type:
|
|
101
|
+
path: p.optional(),
|
|
102
|
+
type: m,
|
|
99
103
|
style: c.optional(),
|
|
100
|
-
params:
|
|
104
|
+
params: _
|
|
101
105
|
}),
|
|
102
106
|
STYLE_UPDATE_SELECTOR: t.object({
|
|
103
|
-
displayMode:
|
|
107
|
+
displayMode: d,
|
|
104
108
|
selector: t.string(),
|
|
105
|
-
path:
|
|
109
|
+
path: p.optional(),
|
|
106
110
|
style: c.optional(),
|
|
107
|
-
params:
|
|
111
|
+
params: v
|
|
108
112
|
}),
|
|
109
113
|
STYLE_REMOVE_SELECTOR: t.object({
|
|
110
|
-
displayMode:
|
|
114
|
+
displayMode: d,
|
|
111
115
|
selector: t.string()
|
|
112
116
|
}),
|
|
113
117
|
STYLE_REMOVE_SELECTORS: t.object({
|
|
114
|
-
displayMode:
|
|
118
|
+
displayMode: d,
|
|
115
119
|
selectors: t.array(t.string())
|
|
116
120
|
}),
|
|
117
|
-
STYLE_ADD_SELECTOR_VARIABLE:
|
|
118
|
-
STYLE_UPDATE_SELECTOR_VARIABLE:
|
|
119
|
-
STYLE_REMOVE_SELECTOR_VARIABLE:
|
|
120
|
-
STYLE_ADD_VARIABLE:
|
|
121
|
-
STYLE_UPDATE_VARIABLE:
|
|
121
|
+
STYLE_ADD_SELECTOR_VARIABLE: x,
|
|
122
|
+
STYLE_UPDATE_SELECTOR_VARIABLE: x,
|
|
123
|
+
STYLE_REMOVE_SELECTOR_VARIABLE: S,
|
|
124
|
+
STYLE_ADD_VARIABLE: C,
|
|
125
|
+
STYLE_UPDATE_VARIABLE: C,
|
|
122
126
|
STYLE_REMOVE_VARIABLE: t.object({
|
|
123
|
-
category:
|
|
127
|
+
category: g,
|
|
124
128
|
name: t.string()
|
|
125
129
|
}),
|
|
126
130
|
STYLE_UPDATE_SETTINGS: t.object({
|
|
127
131
|
path: t.string(),
|
|
128
132
|
value: t.string()
|
|
129
133
|
}),
|
|
134
|
+
STYLE_ADD_FONT: t.object({ font: l }),
|
|
135
|
+
STYLE_UPDATE_FONT: t.object({
|
|
136
|
+
family: t.string(),
|
|
137
|
+
font: l
|
|
138
|
+
}),
|
|
139
|
+
STYLE_REMOVE_FONT: t.object({ family: t.string() }),
|
|
130
140
|
SEGMENT_ADD_ELEMENT: t.object({
|
|
131
|
-
...
|
|
141
|
+
...y,
|
|
132
142
|
element: r,
|
|
133
|
-
dropPosition:
|
|
143
|
+
dropPosition: f,
|
|
134
144
|
to: t.string(),
|
|
135
145
|
initialItems: i.optional(),
|
|
136
146
|
variables: t.array(s).optional()
|
|
137
147
|
}),
|
|
138
148
|
SEGMENT_UPDATE_ELEMENT: t.object({
|
|
139
|
-
...
|
|
149
|
+
...y,
|
|
140
150
|
element: r
|
|
141
151
|
}),
|
|
152
|
+
SEGMENT_RENAME_ELEMENT: t.object({
|
|
153
|
+
...y,
|
|
154
|
+
elementId: t.string(),
|
|
155
|
+
id: t.string()
|
|
156
|
+
}),
|
|
142
157
|
SEGMENT_UPDATE_ELEMENTS: t.object({
|
|
143
|
-
...
|
|
158
|
+
...y,
|
|
144
159
|
elements: i
|
|
145
160
|
}),
|
|
146
161
|
SEGMENT_REMOVE_ELEMENT: t.object({
|
|
147
|
-
...
|
|
162
|
+
...y,
|
|
148
163
|
elementId: t.string()
|
|
149
164
|
}),
|
|
150
165
|
SEGMENT_MOVE_ELEMENT: t.object({
|
|
151
|
-
...
|
|
166
|
+
...y,
|
|
152
167
|
elementId: t.string(),
|
|
153
168
|
from: t.string(),
|
|
154
169
|
to: t.string(),
|
|
155
|
-
dropPosition:
|
|
170
|
+
dropPosition: f
|
|
156
171
|
}),
|
|
157
172
|
SEGMENT_CLONE_ELEMENT: t.object({
|
|
158
|
-
...
|
|
173
|
+
...y,
|
|
159
174
|
element: r,
|
|
160
|
-
dropPosition:
|
|
175
|
+
dropPosition: f,
|
|
161
176
|
to: t.string(),
|
|
162
177
|
initialItems: i.optional()
|
|
163
178
|
}),
|
|
164
179
|
SEGMENT_ADD_TEMPLATE: t.object({
|
|
165
|
-
...
|
|
180
|
+
...y,
|
|
166
181
|
element: r,
|
|
167
182
|
style: t.custom(n),
|
|
168
183
|
to: t.string(),
|
|
169
|
-
dropPosition:
|
|
184
|
+
dropPosition: f,
|
|
170
185
|
initialItems: i.optional(),
|
|
171
186
|
variables: t.array(s).optional()
|
|
172
187
|
}),
|
|
173
188
|
SEGMENT_SPACE_ADD_VARIABLE: t.object({
|
|
174
|
-
...
|
|
189
|
+
...y,
|
|
175
190
|
variable: s
|
|
176
191
|
}),
|
|
177
192
|
SEGMENT_SPACE_UPDATE_VARIABLE: t.object({
|
|
178
|
-
...
|
|
193
|
+
...y,
|
|
179
194
|
variable: s
|
|
180
195
|
}),
|
|
181
196
|
SEGMENT_SPACE_REMOVE_VARIABLE: t.object({
|
|
182
|
-
...
|
|
197
|
+
...y,
|
|
183
198
|
variable: t.object({ name: t.string() })
|
|
184
199
|
}),
|
|
185
200
|
SEGMENT_STYLE_ADD_SELECTOR: t.object({
|
|
186
|
-
...
|
|
187
|
-
displayMode:
|
|
201
|
+
...y,
|
|
202
|
+
displayMode: d,
|
|
188
203
|
selector: t.string(),
|
|
189
|
-
type:
|
|
190
|
-
path:
|
|
204
|
+
type: m,
|
|
205
|
+
path: p.optional(),
|
|
191
206
|
style: c.optional(),
|
|
192
|
-
params:
|
|
207
|
+
params: _
|
|
193
208
|
}),
|
|
194
209
|
SEGMENT_STYLE_UPDATE_SELECTOR: t.object({
|
|
195
|
-
...
|
|
196
|
-
displayMode:
|
|
210
|
+
...y,
|
|
211
|
+
displayMode: d,
|
|
197
212
|
selector: t.string(),
|
|
198
|
-
path:
|
|
213
|
+
path: p.optional(),
|
|
199
214
|
style: c.optional(),
|
|
200
|
-
params:
|
|
215
|
+
params: v
|
|
201
216
|
}),
|
|
202
217
|
SEGMENT_STYLE_REMOVE_SELECTOR: t.object({
|
|
203
|
-
...
|
|
204
|
-
displayMode:
|
|
218
|
+
...y,
|
|
219
|
+
displayMode: d,
|
|
205
220
|
selector: t.string()
|
|
206
221
|
}),
|
|
207
222
|
SEGMENT_STYLE_REMOVE_SELECTORS: t.object({
|
|
208
|
-
...
|
|
209
|
-
displayMode:
|
|
223
|
+
...y,
|
|
224
|
+
displayMode: d,
|
|
210
225
|
selectors: t.array(t.string())
|
|
211
226
|
}),
|
|
212
|
-
SEGMENT_STYLE_ADD_SELECTOR_VARIABLE:
|
|
213
|
-
SEGMENT_STYLE_UPDATE_SELECTOR_VARIABLE:
|
|
214
|
-
SEGMENT_STYLE_REMOVE_SELECTOR_VARIABLE:
|
|
215
|
-
SEGMENT_STYLE_ADD_VARIABLE:
|
|
216
|
-
SEGMENT_STYLE_UPDATE_VARIABLE:
|
|
227
|
+
SEGMENT_STYLE_ADD_SELECTOR_VARIABLE: x.extend(y),
|
|
228
|
+
SEGMENT_STYLE_UPDATE_SELECTOR_VARIABLE: x.extend(y),
|
|
229
|
+
SEGMENT_STYLE_REMOVE_SELECTOR_VARIABLE: S.extend(y),
|
|
230
|
+
SEGMENT_STYLE_ADD_VARIABLE: C.extend(y),
|
|
231
|
+
SEGMENT_STYLE_UPDATE_VARIABLE: C.extend(y),
|
|
217
232
|
SEGMENT_STYLE_REMOVE_VARIABLE: t.object({
|
|
218
|
-
...
|
|
219
|
-
category:
|
|
233
|
+
...y,
|
|
234
|
+
category: g,
|
|
220
235
|
name: t.string()
|
|
221
236
|
})
|
|
222
|
-
},
|
|
223
|
-
let n =
|
|
237
|
+
}, T = Object.fromEntries(Object.keys(w).map((e) => [e, e])), E = (e, t) => {
|
|
238
|
+
let n = w[e];
|
|
224
239
|
if (!n) return {
|
|
225
240
|
ok: !1,
|
|
226
241
|
issues: [{
|
|
@@ -241,4 +256,4 @@ var n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = t.custom((e
|
|
|
241
256
|
};
|
|
242
257
|
};
|
|
243
258
|
//#endregion
|
|
244
|
-
export {
|
|
259
|
+
export { T as SpaceEvents, T as default, w as spaceEventSchemas, E as validateSpaceEvent };
|
package/dist/schema/index.d.ts
CHANGED
package/dist/schema/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import e from "./SchemaContext.mjs";
|
|
2
2
|
import { EMPTY_SCHEMA as t, VARIABLE_REGEX as n } from "./schemaConstants.mjs";
|
|
3
|
-
|
|
3
|
+
import { collectServerElements as r, hasServerElements as i } from "./serverElements.mjs";
|
|
4
|
+
export { t as EMPTY_SCHEMA, e as SchemaContext, n as VARIABLE_REGEX, r as collectServerElements, i as hasServerElements };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Element, Schema } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Which elements of a page want data from the server — the one definition of it, because both sides of RSC have to
|
|
4
|
+
* agree on the answer. The rendering server asks before calling its `getRscData` adapter, and the client asks before
|
|
5
|
+
* spending a request on `/_rsc`: a page whose subtree holds no `runtime: 'server'` element has nobody to give a
|
|
6
|
+
* payload to, so resolving one costs an API call, a connector read or a round trip that nothing will ever read.
|
|
7
|
+
*
|
|
8
|
+
* Page-scoped and not schema-scoped on purpose. A space is normally a mix — one page backed by a CMS, the next one
|
|
9
|
+
* static — and the whole point is that rendering the static one must not pay for the other one's providers.
|
|
10
|
+
*
|
|
11
|
+
* The walk is iterative to stay safe on deeply nested schemas, and follows `definition.items`, so a server element
|
|
12
|
+
* nested under any number of plain containers is still found.
|
|
13
|
+
*/
|
|
14
|
+
export declare const collectServerElements: (schema: Schema, pageId: string | undefined, ids?: string[]) => Element[];
|
|
15
|
+
/** Whether anything on this page consumes server data at all — the question both RSC gates actually ask. */
|
|
16
|
+
export declare const hasServerElements: (schema: Schema, pageId: string | undefined) => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/schema/serverElements.ts
|
|
2
|
+
var e = (e, t, n) => {
|
|
3
|
+
if (t === void 0) return [];
|
|
4
|
+
let r = n ? new Set(n) : void 0, i = [], a = /* @__PURE__ */ new Set(), o = [t];
|
|
5
|
+
for (; o.length > 0;) {
|
|
6
|
+
let t = o.pop();
|
|
7
|
+
if (t === void 0 || a.has(t)) continue;
|
|
8
|
+
a.add(t);
|
|
9
|
+
let n = e.flat[t];
|
|
10
|
+
if (!n) continue;
|
|
11
|
+
n.definition.runtime === "server" && (!r || r.has(n.id)) && i.push(n);
|
|
12
|
+
let { items: s } = n.definition;
|
|
13
|
+
s && o.push(...s);
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}, t = (t, n) => e(t, n).length > 0;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as collectServerElements, t as hasServerElements };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ServerSSR } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Seeds where this origin runs server actions, once, at the SDK root.
|
|
4
|
+
*
|
|
5
|
+
* The same shape as `useRscSync` and for the same reason: only a server that mounts the endpoint publishes the
|
|
6
|
+
* path, so a client-only render — an embed, the builder, an offline widget — leaves every `serverAction` step
|
|
7
|
+
* inert rather than posting to a guaranteed 404 against whatever origin the page happens to live on.
|
|
8
|
+
*/
|
|
9
|
+
declare const useActionsSync: (ssr?: ServerSSR) => void;
|
|
10
|
+
export default useActionsSync;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as useActionsSync } from './actions/useActionsSync';
|
|
1
2
|
import { default as refreshRsc } from './rsc/refreshRsc';
|
|
2
3
|
import { default as useRscRefresh } from './rsc/useRscRefresh';
|
|
3
4
|
import { default as useRscSync } from './rsc/useRscSync';
|
|
4
5
|
export * from './rsc/refreshRsc';
|
|
5
|
-
export { refreshRsc, useRscRefresh, useRscSync };
|
|
6
|
+
export { refreshRsc, useActionsSync, useRscRefresh, useRscSync };
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import e
|
|
2
|
-
import n from "./rsc/
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import e from "./actions/useActionsSync.mjs";
|
|
2
|
+
import t, { currentRscLocation as n, rscDataPath as r } from "./rsc/refreshRsc.mjs";
|
|
3
|
+
import i from "./rsc/useRscRefresh.mjs";
|
|
4
|
+
import a from "./rsc/useRscSync.mjs";
|
|
5
|
+
export { n as currentRscLocation, t as refreshRsc, r as rscDataPath, e as useActionsSync, i as useRscRefresh, a as useRscSync };
|
|
@@ -12,5 +12,15 @@ export declare const rscDataPath: (id: string) => PathOf<CommonState>;
|
|
|
12
12
|
* refresh, which replaces it. `params` ride along on the query string; that is how a provider asks for a different
|
|
13
13
|
* page window.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
/** Where the visitor is, spelled the way the server reads it back. */
|
|
16
|
+
export declare const currentRscLocation: () => string;
|
|
17
|
+
export declare const refreshRsc: (store: StoreApi<CommonState>, ids?: string[], params?: Record<string, string>,
|
|
18
|
+
/**
|
|
19
|
+
* Resolve for somewhere the visitor is not yet.
|
|
20
|
+
*
|
|
21
|
+
* A route change that renders first and fetches after paints a page whose sections have no answer, so the
|
|
22
|
+
* navigation asks for the destination BEFORE it commits. Absent means where the visitor already is, which is
|
|
23
|
+
* every other caller: the initial load, a pager, an element refreshing itself.
|
|
24
|
+
*/
|
|
25
|
+
location?: string) => Promise<void>;
|
|
16
26
|
export default refreshRsc;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
+
import { authFailureFromResponse as e, reportAuthFailure as t } from "../../auth/failureChannel.mjs";
|
|
2
|
+
import { hasServerElements as n } from "../../schema/serverElements.mjs";
|
|
3
|
+
import { getPaths as r, matchRoutePath as i } from "../../navigation/routes.mjs";
|
|
1
4
|
//#region src/server/rsc/refreshRsc.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
var a = (e, t, n) => {
|
|
6
|
+
if (!e) return;
|
|
7
|
+
let a = e.pages.reduce((t, n) => (n in e.flat && (t[n] = e.flat[n]), t), {});
|
|
8
|
+
return i(r(a, e.pageFolders, n), t.split("?")[0], n).pageId;
|
|
9
|
+
}, o = (e) => `rsc.data.${e}`, s = () => typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`, c = async (r, i, c, l) => {
|
|
10
|
+
let { enabled: u, endpoint: d } = r.get("rsc") ?? {};
|
|
11
|
+
if (!u || !d || typeof window > "u") return;
|
|
12
|
+
let f = l ?? s(), p = r.get("schema"), m = r.get("runtime.sources.auth"), h = l ? a(p, l, !!m?.details) : r.get("navigation.currentPageId");
|
|
13
|
+
if (p && n(p, h)) try {
|
|
14
|
+
let n = new URLSearchParams({ location: f });
|
|
15
|
+
i?.length && n.set("ids", i.join(",")), Object.entries(c ?? {}).forEach(([e, t]) => n.set(e, t));
|
|
16
|
+
let a = await fetch(`${d}?${n.toString()}`, { headers: { Accept: "application/json" } });
|
|
17
|
+
if (!a.ok) {
|
|
18
|
+
let n = e(a.status, await a.json().catch(() => void 0));
|
|
19
|
+
n && t({
|
|
20
|
+
reason: n,
|
|
21
|
+
url: d
|
|
22
|
+
}), r.set("rsc.stale", !0);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let { serverData: s } = await a.json();
|
|
26
|
+
r.batch(() => {
|
|
27
|
+
i?.length ? Object.entries(s ?? {}).forEach(([e, t]) => r.set(o(e), t)) : r.set("rsc.data", s ?? {}), r.set("rsc.loaded", !0), r.set("rsc.stale", !1), r.set("rsc.location", f);
|
|
12
28
|
});
|
|
13
|
-
} catch {
|
|
29
|
+
} catch {
|
|
30
|
+
r.set("rsc.stale", !0);
|
|
31
|
+
}
|
|
14
32
|
};
|
|
15
33
|
//#endregion
|
|
16
|
-
export {
|
|
34
|
+
export { s as currentRscLocation, c as default, c as refreshRsc, o as rscDataPath };
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { useStoreById as
|
|
1
|
+
import { useCommonStore as e, useCommonStoreSync as t } from "../../store/index.mjs";
|
|
2
|
+
import n, { currentRscLocation as r } from "./refreshRsc.mjs";
|
|
3
|
+
import { useEffect as i, useRef as a } from "react";
|
|
4
|
+
import { useStoreById as o } from "@plitzi/nexus/react";
|
|
5
5
|
//#region src/server/rsc/useRscSync.ts
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var s = (s) => {
|
|
7
|
+
let c = o(), [l] = e("schema.rsc", { mode: "mount" }), [u] = e("runtime.sources.navigation"), { rscData: d, rscPath: f } = s ?? {}, p = (l?.enabled ?? !1) && !!f;
|
|
8
|
+
t(["rsc.enabled", "rsc.endpoint"], [p, f]), t([
|
|
9
|
+
"rsc.data",
|
|
10
|
+
"rsc.loaded",
|
|
11
|
+
"rsc.location"
|
|
12
|
+
], [
|
|
13
|
+
d?.serverData ?? {},
|
|
14
|
+
d !== void 0,
|
|
15
|
+
r()
|
|
16
|
+
], { mode: "mount" });
|
|
17
|
+
let m = JSON.stringify(u ?? {}), h = a(d === void 0 ? void 0 : m);
|
|
18
|
+
i(() => {
|
|
19
|
+
p && m !== h.current && (h.current = m, n(c));
|
|
12
20
|
}, [
|
|
13
|
-
f,
|
|
14
21
|
p,
|
|
15
22
|
m,
|
|
16
|
-
|
|
23
|
+
c
|
|
17
24
|
]);
|
|
18
25
|
};
|
|
19
26
|
//#endregion
|
|
20
|
-
export {
|
|
27
|
+
export { s as default };
|
|
@@ -3,9 +3,10 @@ import { persistMiddleware as e } from "@plitzi/nexus";
|
|
|
3
3
|
var t = (t) => e({
|
|
4
4
|
key: `plitzi_${t}_state`,
|
|
5
5
|
paths: ["runtime.state"],
|
|
6
|
-
storage: ({ schema: e }) => {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
storage: ({ schema: e, render: t }) => {
|
|
7
|
+
if (t?.isHydrating && !t.hydrated) return !1;
|
|
8
|
+
let n = e?.settings;
|
|
9
|
+
return n?.keepState ? n.stateStorage === "sessionStorage" ? "session" : "local" : !1;
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
12
|
//#endregion
|