@plitzi/sdk-shared 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.
Files changed (205) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/actions/cron.d.ts +34 -0
  3. package/dist/actions/cron.mjs +72 -0
  4. package/dist/actions/index.d.ts +6 -0
  5. package/dist/actions/index.mjs +5 -0
  6. package/dist/actions/triggerParams.d.ts +41 -0
  7. package/dist/actions/triggerParams.mjs +40 -0
  8. package/dist/actions/triggers.d.ts +29 -0
  9. package/dist/actions/triggers.mjs +4 -0
  10. package/dist/actions/validateDocument.d.ts +23 -0
  11. package/dist/actions/validateDocument.mjs +267 -0
  12. package/dist/auth/failureChannel.d.ts +9 -4
  13. package/dist/auth/failureChannel.mjs +3 -2
  14. package/dist/authoring/builder.d.ts +51 -0
  15. package/dist/authoring/builder.mjs +29 -0
  16. package/dist/authoring/declare.d.ts +64 -0
  17. package/dist/authoring/declare.mjs +4 -0
  18. package/dist/authoring/elementCallbacks.d.ts +13 -0
  19. package/dist/authoring/elementCallbacks.mjs +71 -0
  20. package/dist/authoring/index.d.ts +21 -0
  21. package/dist/authoring/index.mjs +6 -0
  22. package/dist/authoring/paramSpec.d.ts +51 -0
  23. package/dist/authoring/paramSpec.mjs +40 -0
  24. package/dist/authoring/spaceCallbacks.d.ts +10 -0
  25. package/dist/authoring/spaceCallbacks.mjs +51 -0
  26. package/dist/builder/contexts/BuilderContext.d.ts +2 -4
  27. package/dist/dataSource/getBindingsDetails.mjs +2 -2
  28. package/dist/dataSource/helpers/getSourceName.d.ts +1 -3
  29. package/dist/dataSource/helpers/getSourceName.mjs +1 -1
  30. package/dist/dataSource/index.d.ts +2 -0
  31. package/dist/dataSource/index.mjs +6 -5
  32. package/dist/dataSource/resolveVariables.d.ts +22 -0
  33. package/dist/dataSource/resolveVariables.mjs +16 -0
  34. package/dist/dataSource/utility/index.mjs +15 -13
  35. package/dist/dataSource/utility/not.d.ts +11 -0
  36. package/dist/dataSource/utility/not.mjs +15 -0
  37. package/dist/dataSource/utility/styleVariant.mjs +1 -1
  38. package/dist/devTools/debugCookie.d.ts +16 -0
  39. package/dist/devTools/debugCookie.mjs +7 -0
  40. package/dist/devTools/index.d.ts +6 -2
  41. package/dist/devTools/index.mjs +4 -2
  42. package/dist/devTools/interactionLog.d.ts +14 -0
  43. package/dist/devTools/interactionLog.mjs +4 -0
  44. package/dist/helpers/index.d.ts +2 -0
  45. package/dist/helpers/index.mjs +11 -9
  46. package/dist/helpers/reducerOrigin.d.ts +15 -0
  47. package/dist/helpers/reducerOrigin.mjs +4 -0
  48. package/dist/helpers/ruleEvaluator.d.ts +14 -0
  49. package/dist/helpers/ruleEvaluator.mjs +5 -0
  50. package/dist/helpers/twigWrapper/AST.d.ts +12 -1
  51. package/dist/helpers/twigWrapper/AST.mjs +0 -0
  52. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +7 -0
  53. package/dist/helpers/twigWrapper/Parser/Cursor.d.ts +7 -0
  54. package/dist/helpers/twigWrapper/Parser/Cursor.mjs +5 -0
  55. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +46 -8
  56. package/dist/helpers/twigWrapper/Parser/types.mjs +0 -0
  57. package/dist/helpers/twigWrapper/charClass.d.ts +7 -0
  58. package/dist/helpers/twigWrapper/charClass.mjs +16 -12
  59. package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +2 -2
  60. package/dist/helpers/utils.d.ts +0 -2
  61. package/dist/helpers/utils.mjs +16 -19
  62. package/dist/hooks/index.d.ts +2 -1
  63. package/dist/hooks/index.mjs +4 -3
  64. package/dist/hooks/useFontHead.d.ts +3 -0
  65. package/dist/hooks/useFontHead.mjs +23 -0
  66. package/dist/hooks/usePlitziServiceContext.d.ts +3 -2
  67. package/dist/index.mjs +61 -45
  68. package/dist/navigation/index.d.ts +1 -1
  69. package/dist/navigation/index.mjs +2 -2
  70. package/dist/navigation/routes.d.ts +8 -0
  71. package/dist/navigation/routes.mjs +39 -39
  72. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -1
  73. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -1
  74. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -1
  75. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -1
  76. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -1
  77. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -1
  78. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -1
  79. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +3 -0
  80. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +9 -0
  81. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -1
  82. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -1
  83. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +0 -1
  84. package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +0 -1
  85. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +0 -1
  86. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +0 -1
  87. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +0 -1
  88. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.d.ts +5 -0
  89. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +9 -0
  90. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +0 -1
  91. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +0 -1
  92. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +0 -1
  93. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +0 -1
  94. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.d.ts +8 -0
  95. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +16 -0
  96. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.d.ts +4 -0
  97. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +16 -0
  98. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.d.ts +4 -0
  99. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +14 -0
  100. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.d.ts +4 -0
  101. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +16 -0
  102. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +2 -3
  103. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +0 -1
  104. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.d.ts +2 -0
  105. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +11 -0
  106. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.d.ts +2 -0
  107. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +11 -0
  108. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.d.ts +2 -0
  109. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +11 -0
  110. package/dist/network/graphql/builder/Mutations/index.d.ts +24 -0
  111. package/dist/network/graphql/builder/Mutations/index.mjs +150 -132
  112. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
  113. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -1
  114. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -1
  115. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.d.ts +9 -0
  116. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +30 -0
  117. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +6 -0
  118. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +16 -0
  119. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.d.ts +9 -0
  120. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +25 -0
  121. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.d.ts +6 -0
  122. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +17 -0
  123. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.d.ts +30 -0
  124. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +40 -0
  125. package/dist/network/graphql/builder/Queries/index.d.ts +16 -0
  126. package/dist/network/graphql/builder/Queries/index.mjs +24 -14
  127. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +4 -0
  128. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +5 -2
  129. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -1
  130. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -1
  131. package/dist/network/spaceEvents.d.ts +20 -1
  132. package/dist/network/spaceEvents.mjs +89 -74
  133. package/dist/schema/index.d.ts +1 -0
  134. package/dist/schema/index.mjs +2 -1
  135. package/dist/schema/serverElements.d.ts +16 -0
  136. package/dist/schema/serverElements.mjs +18 -0
  137. package/dist/server/actions/useActionsSync.d.ts +10 -0
  138. package/dist/server/actions/useActionsSync.mjs +7 -0
  139. package/dist/server/index.d.ts +2 -1
  140. package/dist/server/index.mjs +5 -4
  141. package/dist/server/rsc/refreshRsc.d.ts +11 -1
  142. package/dist/server/rsc/refreshRsc.mjs +30 -12
  143. package/dist/server/rsc/useRscSync.mjs +20 -13
  144. package/dist/state/runtimeStatePersist.mjs +4 -3
  145. package/dist/store/actionRuns/actionRunsRecorder.d.ts +36 -0
  146. package/dist/store/actionRuns/actionRunsRecorder.mjs +39 -0
  147. package/dist/store/actionRuns/actionRunsStore.d.ts +16 -0
  148. package/dist/store/actionRuns/actionRunsStore.mjs +5 -0
  149. package/dist/store/actionRuns/index.d.ts +6 -0
  150. package/dist/store/actionRuns/index.mjs +4 -0
  151. package/dist/store/actionRuns/useActionRuns.d.ts +13 -0
  152. package/dist/store/actionRuns/useActionRuns.mjs +10 -0
  153. package/dist/store/index.d.ts +46 -45
  154. package/dist/store/index.mjs +6 -3
  155. package/dist/store/renderSettings.d.ts +3 -0
  156. package/dist/store/renderSettings.mjs +17 -5
  157. package/dist/store/tracing/tracingCollector.d.ts +1 -1
  158. package/dist/store/tracing/tracingCollector.mjs +37 -35
  159. package/dist/store/tracing/tracingStore.d.ts +13 -0
  160. package/dist/store/tracing/tracingStore.mjs +3 -3
  161. package/dist/style/fontAssets.d.ts +12 -0
  162. package/dist/style/fontAssets.mjs +18 -0
  163. package/dist/style/fontValidation.d.ts +8 -0
  164. package/dist/style/fontValidation.mjs +107 -0
  165. package/dist/style/fonts.d.ts +74 -0
  166. package/dist/style/fonts.mjs +198 -0
  167. package/dist/style/fontsFromCss.d.ts +27 -0
  168. package/dist/style/fontsFromCss.mjs +43 -0
  169. package/dist/style/index.d.ts +4 -0
  170. package/dist/style/index.mjs +5 -1
  171. package/dist/style/styleConstants.d.ts +2 -2
  172. package/dist/style/styleConstants.mjs +1 -0
  173. package/dist/theme/ThemeProvider.d.ts +36 -6
  174. package/dist/theme/ThemeProvider.mjs +49 -35
  175. package/dist/theme/ThemeScope.d.ts +16 -0
  176. package/dist/theme/ThemeScope.mjs +6 -0
  177. package/dist/theme/index.d.ts +7 -1
  178. package/dist/theme/index.mjs +6 -2
  179. package/dist/theme/themeCookie.d.ts +30 -0
  180. package/dist/theme/themeCookie.mjs +24 -0
  181. package/dist/theme/themeStore.d.ts +40 -0
  182. package/dist/theme/themeStore.mjs +17 -0
  183. package/dist/theme/useTheme.d.ts +29 -0
  184. package/dist/theme/useTheme.mjs +20 -0
  185. package/dist/types/ActionTypes.d.ts +396 -0
  186. package/dist/types/ActionTypes.mjs +0 -0
  187. package/dist/types/AuthTypes.d.ts +23 -2
  188. package/dist/types/BuilderTypes.d.ts +0 -12
  189. package/dist/types/CommonTypes.d.ts +13 -0
  190. package/dist/types/DevToolsTypes.d.ts +57 -14
  191. package/dist/types/EventBridgeTypes.d.ts +1 -1
  192. package/dist/types/InteractionTypes.d.ts +23 -3
  193. package/dist/types/PluginTypes.d.ts +0 -3
  194. package/dist/types/SchemaTypes.d.ts +29 -4
  195. package/dist/types/ServerTypes.d.ts +390 -46
  196. package/dist/types/SpaceTypes.d.ts +16 -0
  197. package/dist/types/StoreTypes.d.ts +181 -3
  198. package/dist/types/StyleTypes.d.ts +83 -4
  199. package/dist/types/TemplateTypes.d.ts +20 -0
  200. package/dist/types/TemplateTypes.mjs +0 -0
  201. package/dist/types/ThemeTypes.d.ts +28 -1
  202. package/dist/types/index.d.ts +2 -0
  203. package/eslint.config.mjs +2 -0
  204. package/package.json +244 -29
  205. package/vite.config.ts +27 -7
@@ -0,0 +1,40 @@
1
+ import { gql as e } from "@apollo/client/core";
2
+ //#region src/network/graphql/builder/Queries/Space/SpaceQuotaQuery.ts
3
+ var t = e`
4
+ query SpaceQuotaQuery {
5
+ SpaceQuota {
6
+ planName
7
+ tier
8
+ isFree
9
+ periodStart
10
+ periodEnd
11
+ space {
12
+ views
13
+ viewsQuota
14
+ viewsUnlimited
15
+ viewsPercent
16
+ viewsRemaining
17
+ elements
18
+ elementsQuota
19
+ elementsUnlimited
20
+ elementsPercent
21
+ overLimit
22
+ }
23
+ account {
24
+ views
25
+ viewsQuota
26
+ viewsUnlimited
27
+ viewsPercent
28
+ viewsRemaining
29
+ elements
30
+ elementsQuota
31
+ elementsUnlimited
32
+ elementsPercent
33
+ overLimit
34
+ }
35
+ overLimit
36
+ }
37
+ }
38
+ `;
39
+ //#endregion
40
+ export { t as default };
@@ -2,18 +2,29 @@ import { TInitQuery } from './InitQuery';
2
2
  import { TPluginsQuery } from './PluginsQuery';
3
3
  import { TSegmentQuery } from './Segment/SegmentQuery';
4
4
  import { TSegmentsQuery } from './Segment/SegmentsQuery';
5
+ import { TSpaceActionEventsQuery } from './Space/SpaceActionEventsQuery';
6
+ import { TSpaceActionsQuery } from './Space/SpaceActionsQuery';
7
+ import { TSpaceActionTasksQuery } from './Space/SpaceActionTasksQuery';
5
8
  import { TSpaceCdnsQuery } from './Space/SpaceCdnsQuery';
9
+ import { TSpaceCheckActionQuery } from './Space/SpaceCheckActionQuery';
6
10
  import { TSpaceConnectorsQuery } from './Space/SpaceConnectorsQuery';
7
11
  import { TSpaceCredentialsQuery } from './Space/SpaceCredentialsQuery';
8
12
  import { TSpaceDeploymentsQuery } from './Space/SpaceDeploymentsQuery';
9
13
  import { TSpaceLatestRevisionQuery } from './Space/SpaceLatestRevisionQuery';
14
+ import { TSpaceQuotaQuery } from './Space/SpaceQuotaQuery';
10
15
  import { TSpaceResourcesQuery } from './Space/SpaceResourcesQuery';
16
+ export type { TQuotaPlane, TSpaceQuota } from './Space/SpaceQuotaQuery';
11
17
  export type BuilderQueriesMap = {
12
18
  Init: TInitQuery;
13
19
  SpaceLatestRevision: TSpaceLatestRevisionQuery;
20
+ SpaceQuota: TSpaceQuotaQuery;
14
21
  SpaceResources: TSpaceResourcesQuery;
15
22
  SpaceDeployments: TSpaceDeploymentsQuery;
16
23
  SpaceCdns: TSpaceCdnsQuery;
24
+ SpaceActions: TSpaceActionsQuery;
25
+ SpaceActionEvents: TSpaceActionEventsQuery;
26
+ SpaceCheckAction: TSpaceCheckActionQuery;
27
+ SpaceActionTasks: TSpaceActionTasksQuery;
17
28
  SpaceConnectors: TSpaceConnectorsQuery;
18
29
  SpaceCredentials: TSpaceCredentialsQuery;
19
30
  Plugins: TPluginsQuery;
@@ -23,9 +34,14 @@ export type BuilderQueriesMap = {
23
34
  declare const BuilderQueries: {
24
35
  Init: import('graphql').DocumentNode;
25
36
  SpaceLatestRevision: import('graphql').DocumentNode;
37
+ SpaceQuota: import('graphql').DocumentNode;
26
38
  SpaceResources: import('graphql').DocumentNode;
27
39
  SpaceDeployments: import('graphql').DocumentNode;
28
40
  SpaceCdns: import('graphql').DocumentNode;
41
+ SpaceActions: import('graphql').DocumentNode;
42
+ SpaceActionEvents: import('graphql').DocumentNode;
43
+ SpaceCheckAction: import('graphql').DocumentNode;
44
+ SpaceActionTasks: import('graphql').DocumentNode;
29
45
  SpaceConnectors: import('graphql').DocumentNode;
30
46
  SpaceCredentials: import('graphql').DocumentNode;
31
47
  Plugins: import('graphql').DocumentNode;
@@ -2,24 +2,34 @@ import e from "./InitQuery.mjs";
2
2
  import t from "./PluginsQuery.mjs";
3
3
  import n from "./Segment/SegmentQuery.mjs";
4
4
  import r from "./Segment/SegmentsQuery.mjs";
5
- import i from "./Space/SpaceCdnsQuery.mjs";
6
- import a from "./Space/SpaceConnectorsQuery.mjs";
7
- import o from "./Space/SpaceCredentialsQuery.mjs";
8
- import s from "./Space/SpaceDeploymentsQuery.mjs";
9
- import c from "./Space/SpaceLatestRevisionQuery.mjs";
10
- import l from "./Space/SpaceResourcesQuery.mjs";
5
+ import i from "./Space/SpaceActionEventsQuery.mjs";
6
+ import a from "./Space/SpaceActionsQuery.mjs";
7
+ import o from "./Space/SpaceActionTasksQuery.mjs";
8
+ import s from "./Space/SpaceCdnsQuery.mjs";
9
+ import c from "./Space/SpaceCheckActionQuery.mjs";
10
+ import l from "./Space/SpaceConnectorsQuery.mjs";
11
+ import u from "./Space/SpaceCredentialsQuery.mjs";
12
+ import d from "./Space/SpaceDeploymentsQuery.mjs";
13
+ import f from "./Space/SpaceLatestRevisionQuery.mjs";
14
+ import p from "./Space/SpaceQuotaQuery.mjs";
15
+ import m from "./Space/SpaceResourcesQuery.mjs";
11
16
  //#region src/network/graphql/builder/Queries/index.ts
12
- var u = {
17
+ var h = {
13
18
  Init: e,
14
- SpaceLatestRevision: c,
15
- SpaceResources: l,
16
- SpaceDeployments: s,
17
- SpaceCdns: i,
18
- SpaceConnectors: a,
19
- SpaceCredentials: o,
19
+ SpaceLatestRevision: f,
20
+ SpaceQuota: p,
21
+ SpaceResources: m,
22
+ SpaceDeployments: d,
23
+ SpaceCdns: s,
24
+ SpaceActions: a,
25
+ SpaceActionEvents: i,
26
+ SpaceCheckAction: c,
27
+ SpaceActionTasks: o,
28
+ SpaceConnectors: l,
29
+ SpaceCredentials: u,
20
30
  Plugins: t,
21
31
  Segment: n,
22
32
  Segments: r
23
33
  };
24
34
  //#endregion
25
- export { u as default };
35
+ export { h as default };
@@ -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
  `;
@@ -19,7 +19,6 @@ var t = e`
19
19
  }
20
20
  flat {
21
21
  id
22
- idRef
23
22
  definition {
24
23
  label
25
24
  type
@@ -20,7 +20,6 @@ var t = e`
20
20
  }
21
21
  flat {
22
22
  id
23
- idRef
24
23
  definition {
25
24
  label
26
25
  type
@@ -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" }), u = t.enum([
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
- ]), d = t.custom((e) => typeof e == "string", { message: "expected a drop position" }), f = t.custom((e) => typeof e == "string", { message: "expected a style category" }), p = t.enum([
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
- ]), m = t.enum([
12
+ ]), h = t.enum([
13
13
  "hover",
14
14
  "active",
15
15
  "focus",
16
16
  "disabled",
17
17
  "checked",
18
18
  "visited"
19
- ]), h = t.enum(e), g = t.object({
19
+ ]), g = t.enum(e), _ = t.object({
20
20
  componentType: t.string().optional(),
21
21
  styleSelector: t.string().optional(),
22
- styleState: m.optional(),
22
+ styleState: h.optional(),
23
23
  styleVariant: t.string().optional()
24
- }), _ = g.extend({ styleSelector: t.string() }), v = { contextId: t.string() }, y = t.object({ variable: s }), b = t.object({
25
- displayMode: u,
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: h,
27
+ category: g,
28
28
  name: t.string(),
29
- value: l
30
- }), x = t.object({
31
- displayMode: u,
29
+ value: u
30
+ }), S = t.object({
31
+ displayMode: d,
32
32
  selector: t.string(),
33
- category: h,
33
+ category: g,
34
34
  name: t.string()
35
- }), S = t.object({
36
- category: h,
35
+ }), C = t.object({
36
+ category: g,
37
37
  name: t.string(),
38
- value: l
39
- }), C = {
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: y,
54
- SPACE_UPDATE_VARIABLE: y,
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: d,
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: d
74
+ dropPosition: f
71
75
  }),
72
76
  SPACE_CLONE_ELEMENT: t.object({
73
77
  to: t.string(),
74
78
  element: r,
75
- dropPosition: d,
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: d,
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: u,
99
+ displayMode: d,
96
100
  selector: t.string(),
97
- path: f.optional(),
98
- type: p,
101
+ path: p.optional(),
102
+ type: m,
99
103
  style: c.optional(),
100
- params: g
104
+ params: _
101
105
  }),
102
106
  STYLE_UPDATE_SELECTOR: t.object({
103
- displayMode: u,
107
+ displayMode: d,
104
108
  selector: t.string(),
105
- path: f.optional(),
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: u,
114
+ displayMode: d,
111
115
  selector: t.string()
112
116
  }),
113
117
  STYLE_REMOVE_SELECTORS: t.object({
114
- displayMode: u,
118
+ displayMode: d,
115
119
  selectors: t.array(t.string())
116
120
  }),
117
- STYLE_ADD_SELECTOR_VARIABLE: b,
118
- STYLE_UPDATE_SELECTOR_VARIABLE: b,
119
- STYLE_REMOVE_SELECTOR_VARIABLE: x,
120
- STYLE_ADD_VARIABLE: S,
121
- STYLE_UPDATE_VARIABLE: S,
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: h,
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
- ...v,
141
+ ...y,
132
142
  element: r,
133
- dropPosition: d,
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
- ...v,
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
- ...v,
158
+ ...y,
144
159
  elements: i
145
160
  }),
146
161
  SEGMENT_REMOVE_ELEMENT: t.object({
147
- ...v,
162
+ ...y,
148
163
  elementId: t.string()
149
164
  }),
150
165
  SEGMENT_MOVE_ELEMENT: t.object({
151
- ...v,
166
+ ...y,
152
167
  elementId: t.string(),
153
168
  from: t.string(),
154
169
  to: t.string(),
155
- dropPosition: d
170
+ dropPosition: f
156
171
  }),
157
172
  SEGMENT_CLONE_ELEMENT: t.object({
158
- ...v,
173
+ ...y,
159
174
  element: r,
160
- dropPosition: d,
175
+ dropPosition: f,
161
176
  to: t.string(),
162
177
  initialItems: i.optional()
163
178
  }),
164
179
  SEGMENT_ADD_TEMPLATE: t.object({
165
- ...v,
180
+ ...y,
166
181
  element: r,
167
182
  style: t.custom(n),
168
183
  to: t.string(),
169
- dropPosition: d,
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
- ...v,
189
+ ...y,
175
190
  variable: s
176
191
  }),
177
192
  SEGMENT_SPACE_UPDATE_VARIABLE: t.object({
178
- ...v,
193
+ ...y,
179
194
  variable: s
180
195
  }),
181
196
  SEGMENT_SPACE_REMOVE_VARIABLE: t.object({
182
- ...v,
197
+ ...y,
183
198
  variable: t.object({ name: t.string() })
184
199
  }),
185
200
  SEGMENT_STYLE_ADD_SELECTOR: t.object({
186
- ...v,
187
- displayMode: u,
201
+ ...y,
202
+ displayMode: d,
188
203
  selector: t.string(),
189
- type: p,
190
- path: f.optional(),
204
+ type: m,
205
+ path: p.optional(),
191
206
  style: c.optional(),
192
- params: g
207
+ params: _
193
208
  }),
194
209
  SEGMENT_STYLE_UPDATE_SELECTOR: t.object({
195
- ...v,
196
- displayMode: u,
210
+ ...y,
211
+ displayMode: d,
197
212
  selector: t.string(),
198
- path: f.optional(),
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
- ...v,
204
- displayMode: u,
218
+ ...y,
219
+ displayMode: d,
205
220
  selector: t.string()
206
221
  }),
207
222
  SEGMENT_STYLE_REMOVE_SELECTORS: t.object({
208
- ...v,
209
- displayMode: u,
223
+ ...y,
224
+ displayMode: d,
210
225
  selectors: t.array(t.string())
211
226
  }),
212
- SEGMENT_STYLE_ADD_SELECTOR_VARIABLE: b.extend(v),
213
- SEGMENT_STYLE_UPDATE_SELECTOR_VARIABLE: b.extend(v),
214
- SEGMENT_STYLE_REMOVE_SELECTOR_VARIABLE: x.extend(v),
215
- SEGMENT_STYLE_ADD_VARIABLE: S.extend(v),
216
- SEGMENT_STYLE_UPDATE_VARIABLE: S.extend(v),
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
- ...v,
219
- category: h,
233
+ ...y,
234
+ category: g,
220
235
  name: t.string()
221
236
  })
222
- }, w = Object.fromEntries(Object.keys(C).map((e) => [e, e])), T = (e, t) => {
223
- let n = C[e];
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 { w as SpaceEvents, w as default, C as spaceEventSchemas, T as validateSpaceEvent };
259
+ export { T as SpaceEvents, T as default, w as spaceEventSchemas, E as validateSpaceEvent };
@@ -1,4 +1,5 @@
1
1
  import { default as SchemaContext } from './SchemaContext';
2
2
  export * from './schemaConstants';
3
3
  export * from './SchemaContext';
4
+ export * from './serverElements';
4
5
  export { SchemaContext };
@@ -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
- export { t as EMPTY_SCHEMA, e as SchemaContext, n as VARIABLE_REGEX };
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;
@@ -0,0 +1,7 @@
1
+ import { useCommonStoreSync as e } from "../../store/index.mjs";
2
+ //#region src/server/actions/useActionsSync.ts
3
+ var t = (t) => {
4
+ e(["actions.endpoint"], [t?.actionPath]);
5
+ };
6
+ //#endregion
7
+ export { t as default };
@@ -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 };
@@ -1,4 +1,5 @@
1
- import e, { rscDataPath as t } from "./rsc/refreshRsc.mjs";
2
- import n from "./rsc/useRscRefresh.mjs";
3
- import r from "./rsc/useRscSync.mjs";
4
- export { e as refreshRsc, t as rscDataPath, n as useRscRefresh, r as useRscSync };
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
- export declare const refreshRsc: (store: StoreApi<CommonState>, ids?: string[], params?: Record<string, string>) => Promise<void>;
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;