@plitzi/sdk-shared 0.37.7 → 0.37.9

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 (147) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/dist/actions/functions.d.ts +12 -3
  3. package/dist/actions/functions.mjs +8 -5
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +6 -6
  6. package/dist/auth/failureChannel.d.ts +8 -2
  7. package/dist/auth/failureChannel.mjs +1 -3
  8. package/dist/builder/contexts/BuilderContext.d.ts +1 -1
  9. package/dist/builder/contexts/BuilderContext.mjs +2 -3
  10. package/dist/devTools/DevToolsContext.mjs +2 -3
  11. package/dist/elements/ComponentContext.mjs +2 -3
  12. package/dist/helpers/sharedContext.d.ts +14 -0
  13. package/dist/helpers/sharedContext.mjs +9 -0
  14. package/dist/helpers/twigWrapper/Evaluator/Evaluator.d.ts +9 -1
  15. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +13 -8
  16. package/dist/helpers/twigWrapper/Evaluator/index.d.ts +1 -1
  17. package/dist/helpers/twigWrapper/index.d.ts +1 -0
  18. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +2 -1
  19. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +3 -3
  20. package/dist/helpers/utils.mjs +4 -2
  21. package/dist/history/describe.mjs +1 -0
  22. package/dist/history/diff.d.ts +1 -1
  23. package/dist/history/diff.mjs +10 -9
  24. package/dist/history/types.d.ts +1 -1
  25. package/dist/hooks/usePlitziServiceContext.d.ts +1 -2
  26. package/dist/hooks/usePlitziServiceContext.mjs +3 -4
  27. package/dist/index.d.ts +0 -1
  28. package/dist/index.mjs +12 -13
  29. package/dist/network/NetworkContext.mjs +2 -3
  30. package/dist/network/NetworkInternalContext.d.ts +2 -4
  31. package/dist/network/NetworkInternalContext.mjs +2 -3
  32. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.d.ts +4 -0
  33. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +4 -0
  34. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.d.ts +4 -0
  35. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +4 -0
  36. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.d.ts +4 -0
  37. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +4 -0
  38. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.d.ts +4 -0
  39. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +4 -0
  40. package/dist/network/graphql/builder/Mutations/index.d.ts +8 -29
  41. package/dist/network/graphql/builder/Mutations/index.mjs +158 -200
  42. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +2 -3
  43. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  44. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +1 -1
  45. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -1
  46. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.d.ts +7 -0
  47. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +4 -0
  48. package/dist/network/graphql/builder/Queries/index.d.ts +2 -4
  49. package/dist/network/graphql/builder/Queries/index.mjs +36 -38
  50. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.d.ts +1 -1
  51. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +2 -3
  52. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -1
  53. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -4
  54. package/dist/network/graphql/sdk/Queries/index.mjs +2 -8
  55. package/dist/network/spaceEvents.d.ts +14 -190
  56. package/dist/network/spaceEvents.mjs +48 -132
  57. package/dist/schema/SchemaContext.mjs +2 -3
  58. package/dist/schema/index.mjs +4 -4
  59. package/dist/schema/schemaConstants.d.ts +2 -0
  60. package/dist/schema/schemaConstants.mjs +4 -3
  61. package/dist/server/rsc/refreshRsc.d.ts +3 -1
  62. package/dist/server/rsc/refreshRsc.mjs +15 -14
  63. package/dist/source/export.d.ts +107 -0
  64. package/dist/source/export.mjs +4 -0
  65. package/dist/source/index.d.ts +4 -0
  66. package/dist/source/index.mjs +3 -0
  67. package/dist/source/snapshot.d.ts +51 -0
  68. package/dist/source/snapshot.mjs +80 -0
  69. package/dist/store/index.d.ts +45 -45
  70. package/dist/store/renderSettings.d.ts +1 -0
  71. package/dist/store/renderSettings.mjs +9 -5
  72. package/dist/theme/ThemeScope.mjs +4 -3
  73. package/dist/types/ActionTypes.d.ts +5 -0
  74. package/dist/types/ElementTypes.d.ts +6 -5
  75. package/dist/types/EventBridgeTypes.d.ts +2 -2
  76. package/dist/types/FunctionTypes.d.ts +13 -0
  77. package/dist/types/InteractionTypes.d.ts +5 -0
  78. package/dist/types/SchemaTypes.d.ts +38 -0
  79. package/dist/types/SdkTypes.d.ts +0 -2
  80. package/dist/types/SpaceTypes.d.ts +36 -0
  81. package/dist/types/StoreTypes.d.ts +14 -3
  82. package/dist/types/index.d.ts +0 -1
  83. package/package.json +43 -134
  84. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.d.ts +0 -4
  85. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -4
  86. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.d.ts +0 -2
  87. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -4
  88. package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.d.ts +0 -8
  89. package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.mjs +0 -4
  90. package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.d.ts +0 -2
  91. package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.mjs +0 -4
  92. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.d.ts +0 -4
  93. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -4
  94. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.d.ts +0 -2
  95. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -4
  96. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.d.ts +0 -2
  97. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -4
  98. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.d.ts +0 -2
  99. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -4
  100. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.d.ts +0 -2
  101. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -4
  102. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +0 -3
  103. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +0 -4
  104. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.d.ts +0 -2
  105. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -4
  106. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.d.ts +0 -2
  107. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -4
  108. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.d.ts +0 -2
  109. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.mjs +0 -4
  110. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.d.ts +0 -2
  111. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.mjs +0 -4
  112. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.d.ts +0 -2
  113. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.mjs +0 -4
  114. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.d.ts +0 -2
  115. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.mjs +0 -4
  116. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.d.ts +0 -2
  117. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.mjs +0 -4
  118. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.d.ts +0 -2
  119. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.mjs +0 -4
  120. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.d.ts +0 -2
  121. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.mjs +0 -4
  122. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.d.ts +0 -2
  123. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.mjs +0 -4
  124. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.d.ts +0 -2
  125. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.mjs +0 -4
  126. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.d.ts +0 -2
  127. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.mjs +0 -4
  128. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.d.ts +0 -2
  129. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.mjs +0 -4
  130. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.d.ts +0 -2
  131. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.mjs +0 -4
  132. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.d.ts +0 -2
  133. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.mjs +0 -4
  134. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.d.ts +0 -6
  135. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -4
  136. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.d.ts +0 -9
  137. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -4
  138. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +0 -6
  139. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -4
  140. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +0 -9
  141. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -4
  142. package/dist/segments/SegmentsContext.d.ts +0 -2
  143. package/dist/segments/SegmentsContext.mjs +0 -6
  144. package/dist/segments/index.d.ts +0 -3
  145. package/dist/segments/index.mjs +0 -2
  146. package/dist/types/SegmentTypes.d.ts +0 -41
  147. package/dist/types/SegmentTypes.mjs +0 -0
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { StyleVariableCategory } from '../types/StyleTypes';
3
- import { DropPosition, Element, PageFolder, Schema, SchemaRaw, SchemaVariable, SpaceFont, Style, StyleCategory, StyleItem, StyleVariableValue } from '../types';
3
+ import { DropPosition, Element, PageFolder, Schema, SchemaRaw, SchemaVariable, SpaceComponent, SpaceComponentDeclaration, SpaceFont, Style, StyleCategory, StyleItem, StyleVariableValue } from '../types';
4
4
  /** A schema as the channel carries it: `flat` as a list. What every publisher of a whole schema sends. */
5
5
  export declare const schemaToWire: (schema: Schema) => SchemaRaw;
6
6
  /** A schema off the channel, keyed again by element id: what a receiver stores. */
@@ -245,198 +245,22 @@ export declare const spaceEventSchemas: {
245
245
  readonly STYLE_REMOVE_FONT: z.ZodObject<{
246
246
  family: z.ZodString;
247
247
  }, z.core.$strip>;
248
- readonly SEGMENT_ADD_ELEMENT: z.ZodObject<{
249
- element: z.ZodCustom<Element, Element>;
250
- dropPosition: z.ZodCustom<DropPosition, DropPosition>;
251
- to: z.ZodString;
252
- initialItems: z.ZodOptional<z.ZodArray<z.ZodCustom<Element, Element>>>;
253
- variables: z.ZodOptional<z.ZodArray<z.ZodCustom<SchemaVariable, SchemaVariable>>>;
254
- contextId: z.ZodString;
248
+ readonly SPACE_ADD_COMPONENT: z.ZodObject<{
249
+ component: z.ZodCustom<SpaceComponent, SpaceComponent>;
250
+ from: z.ZodOptional<z.ZodObject<{
251
+ elementId: z.ZodString;
252
+ instanceId: z.ZodString;
253
+ }, z.core.$strip>>;
255
254
  }, z.core.$strip>;
256
- readonly SEGMENT_UPDATE_ELEMENT: z.ZodObject<{
257
- element: z.ZodCustom<Element, Element>;
258
- contextId: z.ZodString;
255
+ readonly SPACE_UPDATE_COMPONENT: z.ZodObject<{
256
+ componentId: z.ZodString;
257
+ declaration: z.ZodCustom<SpaceComponentDeclaration, SpaceComponentDeclaration>;
259
258
  }, z.core.$strip>;
260
- readonly SEGMENT_RENAME_ELEMENT: z.ZodObject<{
261
- elementId: z.ZodString;
262
- id: z.ZodString;
263
- contextId: z.ZodString;
264
- }, z.core.$strip>;
265
- readonly SEGMENT_UPDATE_ELEMENTS: z.ZodObject<{
266
- elements: z.ZodArray<z.ZodCustom<Element, Element>>;
267
- contextId: z.ZodString;
259
+ readonly SPACE_REMOVE_COMPONENT: z.ZodObject<{
260
+ componentId: z.ZodString;
268
261
  }, z.core.$strip>;
269
- readonly SEGMENT_REMOVE_ELEMENT: z.ZodObject<{
270
- elementId: z.ZodString;
271
- contextId: z.ZodString;
272
- }, z.core.$strip>;
273
- readonly SEGMENT_MOVE_ELEMENT: z.ZodObject<{
274
- elementId: z.ZodString;
275
- from: z.ZodString;
276
- to: z.ZodString;
277
- dropPosition: z.ZodCustom<DropPosition, DropPosition>;
278
- contextId: z.ZodString;
279
- }, z.core.$strip>;
280
- readonly SEGMENT_CLONE_ELEMENT: z.ZodObject<{
281
- element: z.ZodCustom<Element, Element>;
282
- dropPosition: z.ZodCustom<DropPosition, DropPosition>;
283
- to: z.ZodString;
284
- initialItems: z.ZodOptional<z.ZodArray<z.ZodCustom<Element, Element>>>;
285
- contextId: z.ZodString;
286
- }, z.core.$strip>;
287
- readonly SEGMENT_ADD_TEMPLATE: z.ZodObject<{
288
- element: z.ZodCustom<Element, Element>;
289
- style: z.ZodCustom<Style, Style>;
290
- to: z.ZodString;
291
- dropPosition: z.ZodCustom<DropPosition, DropPosition>;
292
- initialItems: z.ZodOptional<z.ZodArray<z.ZodCustom<Element, Element>>>;
293
- variables: z.ZodOptional<z.ZodArray<z.ZodCustom<SchemaVariable, SchemaVariable>>>;
294
- contextId: z.ZodString;
295
- }, z.core.$strip>;
296
- readonly SEGMENT_SPACE_ADD_VARIABLE: z.ZodObject<{
297
- variable: z.ZodCustom<SchemaVariable, SchemaVariable>;
298
- contextId: z.ZodString;
299
- }, z.core.$strip>;
300
- readonly SEGMENT_SPACE_UPDATE_VARIABLE: z.ZodObject<{
301
- variable: z.ZodCustom<SchemaVariable, SchemaVariable>;
302
- contextId: z.ZodString;
303
- }, z.core.$strip>;
304
- readonly SEGMENT_SPACE_REMOVE_VARIABLE: z.ZodObject<{
305
- variable: z.ZodObject<{
306
- name: z.ZodString;
307
- }, z.core.$strip>;
308
- contextId: z.ZodString;
309
- }, z.core.$strip>;
310
- readonly SEGMENT_STYLE_ADD_SELECTOR: z.ZodObject<{
311
- displayMode: z.ZodEnum<{
312
- desktop: "desktop";
313
- tablet: "tablet";
314
- mobile: "mobile";
315
- }>;
316
- selector: z.ZodString;
317
- type: z.ZodEnum<{
318
- id: "id";
319
- element: "element";
320
- class: "class";
321
- }>;
322
- path: z.ZodOptional<z.ZodCustom<StyleCategory, StyleCategory>>;
323
- style: z.ZodOptional<z.ZodCustom<import('..').StyleAttributes, import('..').StyleAttributes>>;
324
- params: z.ZodObject<{
325
- componentType: z.ZodOptional<z.ZodString>;
326
- styleSelector: z.ZodOptional<z.ZodString>;
327
- styleState: z.ZodOptional<z.ZodEnum<{
328
- hover: "hover";
329
- focus: "focus";
330
- "focus-visible": "focus-visible";
331
- "focus-within": "focus-within";
332
- active: "active";
333
- disabled: "disabled";
334
- checked: "checked";
335
- visited: "visited";
336
- hidden: "hidden";
337
- }>>;
338
- styleVariant: z.ZodOptional<z.ZodString>;
339
- styleAncestor: z.ZodOptional<z.ZodString>;
340
- }, z.core.$strip>;
341
- contextId: z.ZodString;
342
- }, z.core.$strip>;
343
- readonly SEGMENT_STYLE_UPDATE_SELECTOR: z.ZodObject<{
344
- displayMode: z.ZodEnum<{
345
- desktop: "desktop";
346
- tablet: "tablet";
347
- mobile: "mobile";
348
- }>;
349
- selector: z.ZodString;
350
- path: z.ZodOptional<z.ZodCustom<StyleCategory, StyleCategory>>;
351
- style: z.ZodOptional<z.ZodCustom<import('..').StyleAttributes, import('..').StyleAttributes>>;
352
- params: z.ZodObject<{
353
- componentType: z.ZodOptional<z.ZodString>;
354
- styleState: z.ZodOptional<z.ZodEnum<{
355
- hover: "hover";
356
- focus: "focus";
357
- "focus-visible": "focus-visible";
358
- "focus-within": "focus-within";
359
- active: "active";
360
- disabled: "disabled";
361
- checked: "checked";
362
- visited: "visited";
363
- hidden: "hidden";
364
- }>>;
365
- styleVariant: z.ZodOptional<z.ZodString>;
366
- styleAncestor: z.ZodOptional<z.ZodString>;
367
- styleSelector: z.ZodString;
368
- }, z.core.$strip>;
369
- contextId: z.ZodString;
370
- }, z.core.$strip>;
371
- readonly SEGMENT_STYLE_REMOVE_SELECTOR: z.ZodObject<{
372
- displayMode: z.ZodEnum<{
373
- desktop: "desktop";
374
- tablet: "tablet";
375
- mobile: "mobile";
376
- }>;
377
- selector: z.ZodString;
378
- contextId: z.ZodString;
379
- }, z.core.$strip>;
380
- readonly SEGMENT_STYLE_REMOVE_SELECTORS: z.ZodObject<{
381
- displayMode: z.ZodEnum<{
382
- desktop: "desktop";
383
- tablet: "tablet";
384
- mobile: "mobile";
385
- }>;
386
- selectors: z.ZodArray<z.ZodString>;
387
- contextId: z.ZodString;
388
- }, z.core.$strip>;
389
- readonly SEGMENT_STYLE_ADD_SELECTOR_VARIABLE: z.ZodObject<{
390
- displayMode: z.ZodEnum<{
391
- desktop: "desktop";
392
- tablet: "tablet";
393
- mobile: "mobile";
394
- }>;
395
- selector: z.ZodString;
396
- category: z.ZodEnum<typeof StyleVariableCategory>;
397
- name: z.ZodString;
398
- value: z.ZodCustom<StyleVariableValue, StyleVariableValue>;
399
- contextId: z.ZodString;
400
- }, z.core.$strip>;
401
- readonly SEGMENT_STYLE_UPDATE_SELECTOR_VARIABLE: z.ZodObject<{
402
- displayMode: z.ZodEnum<{
403
- desktop: "desktop";
404
- tablet: "tablet";
405
- mobile: "mobile";
406
- }>;
407
- selector: z.ZodString;
408
- category: z.ZodEnum<typeof StyleVariableCategory>;
409
- name: z.ZodString;
410
- value: z.ZodCustom<StyleVariableValue, StyleVariableValue>;
411
- contextId: z.ZodString;
412
- }, z.core.$strip>;
413
- readonly SEGMENT_STYLE_REMOVE_SELECTOR_VARIABLE: z.ZodObject<{
414
- displayMode: z.ZodEnum<{
415
- desktop: "desktop";
416
- tablet: "tablet";
417
- mobile: "mobile";
418
- }>;
419
- selector: z.ZodString;
420
- category: z.ZodEnum<typeof StyleVariableCategory>;
421
- name: z.ZodString;
422
- contextId: z.ZodString;
423
- }, z.core.$strip>;
424
- readonly SEGMENT_STYLE_ADD_VARIABLE: z.ZodObject<{
425
- category: z.ZodEnum<typeof StyleVariableCategory>;
426
- name: z.ZodString;
427
- value: z.ZodCustom<StyleVariableValue, StyleVariableValue>;
428
- contextId: z.ZodString;
429
- }, z.core.$strip>;
430
- readonly SEGMENT_STYLE_UPDATE_VARIABLE: z.ZodObject<{
431
- category: z.ZodEnum<typeof StyleVariableCategory>;
432
- name: z.ZodString;
433
- value: z.ZodCustom<StyleVariableValue, StyleVariableValue>;
434
- contextId: z.ZodString;
435
- }, z.core.$strip>;
436
- readonly SEGMENT_STYLE_REMOVE_VARIABLE: z.ZodObject<{
437
- category: z.ZodEnum<typeof StyleVariableCategory>;
438
- name: z.ZodString;
439
- contextId: z.ZodString;
262
+ readonly SPACE_DETACH_INSTANCE: z.ZodObject<{
263
+ instanceId: z.ZodString;
440
264
  }, z.core.$strip>;
441
265
  };
442
266
  export type SpaceEventName = keyof typeof spaceEventSchemas;
@@ -8,41 +8,41 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
8
8
  }), s = (e) => ({
9
9
  ...e,
10
10
  flat: Object.fromEntries(e.flat.map((e) => [e.id, e]))
11
- }), c = n.custom((e) => r(e) && Array.isArray(e.flat), { message: "expected a schema whose `flat` is a list of elements" }), l = n.custom((e) => r(e) && typeof e.id == "string", { message: "expected a page folder with an id" }), u = n.custom((e) => r(e) && typeof e.name == "string", { message: "expected a variable with a name" }), d = n.custom(r, { message: "expected a style attributes object" }), f = n.custom((e) => r(e) && typeof e.family == "string" && typeof e.source == "string", { message: "expected a font with a family and a source" }), p = n.custom((e) => typeof e == "string" || typeof e == "number" || r(e), { message: "expected a style variable value" }), m = n.enum([
11
+ }), c = n.custom((e) => r(e) && typeof e.id == "string" && r(e.flat), { message: "expected a component with an id and a flat" }), l = n.custom((e) => r(e) && Array.isArray(e.flat), { message: "expected a schema whose `flat` is a list of elements" }), u = n.custom((e) => r(e) && typeof e.id == "string", { message: "expected a page folder with an id" }), d = n.custom((e) => r(e) && typeof e.name == "string", { message: "expected a variable with a name" }), f = n.custom(r, { message: "expected a style attributes object" }), p = n.custom((e) => r(e) && typeof e.family == "string" && typeof e.source == "string", { message: "expected a font with a family and a source" }), m = n.custom((e) => typeof e == "string" || typeof e == "number" || r(e), { message: "expected a style variable value" }), h = n.enum([
12
12
  "desktop",
13
13
  "tablet",
14
14
  "mobile"
15
- ]), h = n.custom((e) => typeof e == "string", { message: "expected a drop position" }), g = n.custom((e) => typeof e == "string", { message: "expected a style category" }), _ = n.enum([
15
+ ]), g = n.custom((e) => typeof e == "string", { message: "expected a drop position" }), _ = n.custom((e) => typeof e == "string", { message: "expected a style category" }), v = n.enum([
16
16
  "class",
17
17
  "element",
18
18
  "id"
19
- ]), v = n.enum(t), y = n.enum(e), b = n.object({
19
+ ]), y = n.enum(t), b = n.enum(e), x = n.object({
20
20
  componentType: n.string().optional(),
21
21
  styleSelector: n.string().optional(),
22
- styleState: v.optional(),
22
+ styleState: y.optional(),
23
23
  styleVariant: n.string().optional(),
24
24
  styleAncestor: n.string().optional()
25
- }), x = b.extend({ styleSelector: n.string() }), S = { contextId: n.string() }, C = n.object({ variable: u }), w = n.object({
26
- displayMode: m,
25
+ }), S = x.extend({ styleSelector: n.string() }), C = n.object({ variable: d }), w = n.object({
26
+ displayMode: h,
27
27
  selector: n.string(),
28
- category: y,
28
+ category: b,
29
29
  name: n.string(),
30
- value: p
30
+ value: m
31
31
  }), T = n.object({
32
- displayMode: m,
32
+ displayMode: h,
33
33
  selector: n.string(),
34
- category: y,
34
+ category: b,
35
35
  name: n.string()
36
36
  }), E = n.object({
37
- category: y,
37
+ category: b,
38
38
  name: n.string(),
39
- value: p
39
+ value: m
40
40
  }), D = n.object({
41
41
  type: n.string(),
42
42
  resource: n.string(),
43
43
  settings: n.custom(r, { message: "expected a plugin settings object" })
44
44
  }), O = {
45
- SPACE_UPDATED: n.object({ schema: c }),
45
+ SPACE_UPDATED: n.object({ schema: l }),
46
46
  STYLE_UPDATED: n.object({
47
47
  platform: n.custom(r),
48
48
  variables: n.custom(r),
@@ -52,18 +52,18 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
52
52
  SPACE_UPDATE_PAGE: n.object({ page: i }),
53
53
  SPACE_SET_HOME_PAGE: n.object({ page: i }),
54
54
  SPACE_REMOVE_PAGE: n.object({ pageId: n.string() }),
55
- SPACE_ADD_PAGE_FOLDER: n.object({ pageFolder: l }),
56
- SPACE_UPDATE_PAGE_FOLDER: n.object({ pageFolder: l }),
55
+ SPACE_ADD_PAGE_FOLDER: n.object({ pageFolder: u }),
56
+ SPACE_UPDATE_PAGE_FOLDER: n.object({ pageFolder: u }),
57
57
  SPACE_REMOVE_PAGE_FOLDER: n.object({ pageFolderId: n.string() }),
58
58
  SPACE_ADD_VARIABLE: C,
59
59
  SPACE_UPDATE_VARIABLE: C,
60
60
  SPACE_REMOVE_VARIABLE: n.object({ name: n.string() }),
61
61
  SPACE_ADD_ELEMENT: n.object({
62
62
  element: i,
63
- dropPosition: h,
63
+ dropPosition: g,
64
64
  to: n.string(),
65
65
  initialItems: a.optional(),
66
- variables: n.array(u).optional()
66
+ variables: n.array(d).optional()
67
67
  }),
68
68
  SPACE_UPDATE_ELEMENT: n.object({ element: i }),
69
69
  SPACE_RENAME_ELEMENT: n.object({
@@ -76,21 +76,21 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
76
76
  from: n.string(),
77
77
  to: n.string(),
78
78
  elementId: n.string(),
79
- dropPosition: h
79
+ dropPosition: g
80
80
  }),
81
81
  SPACE_CLONE_ELEMENT: n.object({
82
82
  to: n.string(),
83
83
  element: i,
84
- dropPosition: h,
84
+ dropPosition: g,
85
85
  initialItems: a
86
86
  }),
87
87
  SPACE_ADD_TEMPLATE: n.object({
88
88
  element: i,
89
89
  style: n.custom(r),
90
90
  to: n.string(),
91
- dropPosition: h,
91
+ dropPosition: g,
92
92
  initialItems: a.optional(),
93
- variables: n.array(u).optional()
93
+ variables: n.array(d).optional()
94
94
  }),
95
95
  SPACE_ADD_PLUGIN: n.object({ plugin: D }),
96
96
  SPACE_UPDATE_PLUGIN: n.object({ plugin: D }),
@@ -104,26 +104,26 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
104
104
  ])
105
105
  }),
106
106
  STYLE_ADD_SELECTOR: n.object({
107
- displayMode: m,
107
+ displayMode: h,
108
108
  selector: n.string(),
109
- path: g.optional(),
110
- type: _,
111
- style: d.optional(),
112
- params: b
109
+ path: _.optional(),
110
+ type: v,
111
+ style: f.optional(),
112
+ params: x
113
113
  }),
114
114
  STYLE_UPDATE_SELECTOR: n.object({
115
- displayMode: m,
115
+ displayMode: h,
116
116
  selector: n.string(),
117
- path: g.optional(),
118
- style: d.optional(),
119
- params: x
117
+ path: _.optional(),
118
+ style: f.optional(),
119
+ params: S
120
120
  }),
121
121
  STYLE_REMOVE_SELECTOR: n.object({
122
- displayMode: m,
122
+ displayMode: h,
123
123
  selector: n.string()
124
124
  }),
125
125
  STYLE_REMOVE_SELECTORS: n.object({
126
- displayMode: m,
126
+ displayMode: h,
127
127
  selectors: n.array(n.string())
128
128
  }),
129
129
  STYLE_ADD_SELECTOR_VARIABLE: w,
@@ -132,116 +132,32 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
132
132
  STYLE_ADD_VARIABLE: E,
133
133
  STYLE_UPDATE_VARIABLE: E,
134
134
  STYLE_REMOVE_VARIABLE: n.object({
135
- category: y,
135
+ category: b,
136
136
  name: n.string()
137
137
  }),
138
138
  STYLE_UPDATE_SETTINGS: n.object({
139
139
  path: n.string(),
140
140
  value: n.string()
141
141
  }),
142
- STYLE_ADD_FONT: n.object({ font: f }),
142
+ STYLE_ADD_FONT: n.object({ font: p }),
143
143
  STYLE_UPDATE_FONT: n.object({
144
144
  family: n.string(),
145
- font: f
145
+ font: p
146
146
  }),
147
147
  STYLE_REMOVE_FONT: n.object({ family: n.string() }),
148
- SEGMENT_ADD_ELEMENT: n.object({
149
- ...S,
150
- element: i,
151
- dropPosition: h,
152
- to: n.string(),
153
- initialItems: a.optional(),
154
- variables: n.array(u).optional()
155
- }),
156
- SEGMENT_UPDATE_ELEMENT: n.object({
157
- ...S,
158
- element: i
159
- }),
160
- SEGMENT_RENAME_ELEMENT: n.object({
161
- ...S,
162
- elementId: n.string(),
163
- id: n.string()
164
- }),
165
- SEGMENT_UPDATE_ELEMENTS: n.object({
166
- ...S,
167
- elements: a
168
- }),
169
- SEGMENT_REMOVE_ELEMENT: n.object({
170
- ...S,
171
- elementId: n.string()
172
- }),
173
- SEGMENT_MOVE_ELEMENT: n.object({
174
- ...S,
175
- elementId: n.string(),
176
- from: n.string(),
177
- to: n.string(),
178
- dropPosition: h
179
- }),
180
- SEGMENT_CLONE_ELEMENT: n.object({
181
- ...S,
182
- element: i,
183
- dropPosition: h,
184
- to: n.string(),
185
- initialItems: a.optional()
186
- }),
187
- SEGMENT_ADD_TEMPLATE: n.object({
188
- ...S,
189
- element: i,
190
- style: n.custom(r),
191
- to: n.string(),
192
- dropPosition: h,
193
- initialItems: a.optional(),
194
- variables: n.array(u).optional()
195
- }),
196
- SEGMENT_SPACE_ADD_VARIABLE: n.object({
197
- ...S,
198
- variable: u
199
- }),
200
- SEGMENT_SPACE_UPDATE_VARIABLE: n.object({
201
- ...S,
202
- variable: u
203
- }),
204
- SEGMENT_SPACE_REMOVE_VARIABLE: n.object({
205
- ...S,
206
- variable: n.object({ name: n.string() })
207
- }),
208
- SEGMENT_STYLE_ADD_SELECTOR: n.object({
209
- ...S,
210
- displayMode: m,
211
- selector: n.string(),
212
- type: _,
213
- path: g.optional(),
214
- style: d.optional(),
215
- params: b
216
- }),
217
- SEGMENT_STYLE_UPDATE_SELECTOR: n.object({
218
- ...S,
219
- displayMode: m,
220
- selector: n.string(),
221
- path: g.optional(),
222
- style: d.optional(),
223
- params: x
224
- }),
225
- SEGMENT_STYLE_REMOVE_SELECTOR: n.object({
226
- ...S,
227
- displayMode: m,
228
- selector: n.string()
229
- }),
230
- SEGMENT_STYLE_REMOVE_SELECTORS: n.object({
231
- ...S,
232
- displayMode: m,
233
- selectors: n.array(n.string())
234
- }),
235
- SEGMENT_STYLE_ADD_SELECTOR_VARIABLE: w.extend(S),
236
- SEGMENT_STYLE_UPDATE_SELECTOR_VARIABLE: w.extend(S),
237
- SEGMENT_STYLE_REMOVE_SELECTOR_VARIABLE: T.extend(S),
238
- SEGMENT_STYLE_ADD_VARIABLE: E.extend(S),
239
- SEGMENT_STYLE_UPDATE_VARIABLE: E.extend(S),
240
- SEGMENT_STYLE_REMOVE_VARIABLE: n.object({
241
- ...S,
242
- category: y,
243
- name: n.string()
244
- })
148
+ SPACE_ADD_COMPONENT: n.object({
149
+ component: c,
150
+ from: n.object({
151
+ elementId: n.string(),
152
+ instanceId: n.string()
153
+ }).optional()
154
+ }),
155
+ SPACE_UPDATE_COMPONENT: n.object({
156
+ componentId: n.string(),
157
+ declaration: n.custom(r)
158
+ }),
159
+ SPACE_REMOVE_COMPONENT: n.object({ componentId: n.string() }),
160
+ SPACE_DETACH_INSTANCE: n.object({ instanceId: n.string() })
245
161
  }, k = Object.fromEntries(Object.keys(O).map((e) => [e, e])), A = (e, t) => {
246
162
  let n = O[e];
247
163
  if (!n) return {
@@ -1,5 +1,4 @@
1
- import { createContext as e } from "react";
2
- var t = e({ definition: { rootId: "" } });
3
- t.displayName = "SchemaContext";
1
+ import { sharedContext as e } from "../helpers/sharedContext.mjs";
2
+ var t = e("SchemaContext", { definition: { rootId: "" } });
4
3
  //#endregion
5
4
  export { t as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./SchemaContext.mjs";
2
- import { EMPTY_SCHEMA as t, VARIABLE_REGEX as n } from "./schemaConstants.mjs";
3
- import { findLayoutCycle as r, resolveLayoutChain as i } from "./layoutChain.mjs";
4
- import { collectServerElements as a, hasServerElements as o } from "./serverElements.mjs";
5
- export { t as EMPTY_SCHEMA, e as SchemaContext, n as VARIABLE_REGEX, a as collectServerElements, r as findLayoutCycle, o as hasServerElements, i as resolveLayoutChain };
2
+ import { COMPONENT_PROPS_SOURCE as t, EMPTY_SCHEMA as n, VARIABLE_REGEX as r } from "./schemaConstants.mjs";
3
+ import { findLayoutCycle as i, resolveLayoutChain as a } from "./layoutChain.mjs";
4
+ import { collectServerElements as o, hasServerElements as s } from "./serverElements.mjs";
5
+ export { t as COMPONENT_PROPS_SOURCE, n as EMPTY_SCHEMA, e as SchemaContext, r as VARIABLE_REGEX, o as collectServerElements, i as findLayoutCycle, s as hasServerElements, a as resolveLayoutChain };
@@ -1,5 +1,7 @@
1
1
  import { Schema, Style } from '../types';
2
2
  export declare const VARIABLE_REGEX: RegExp;
3
+ /** The source a component's tree reads its props from — `{{ props.title }}` — and the only one it is given. */
4
+ export declare const COMPONENT_PROPS_SOURCE = "props";
3
5
  export declare const EMPTY_SCHEMA: {
4
6
  schema: Schema;
5
7
  style: Style;
@@ -1,6 +1,6 @@
1
1
  import { EMPTY_STYLE_SCHEMA as e } from "../style/styleConstants.mjs";
2
2
  //#region src/schema/schemaConstants.ts
3
- var t = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/, n = {
3
+ var t = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/, n = "props", r = {
4
4
  schema: {
5
5
  definition: {
6
6
  name: "",
@@ -10,10 +10,11 @@ var t = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/, n = {
10
10
  variables: [],
11
11
  settings: { customCss: "" },
12
12
  pages: [],
13
- pageFolders: []
13
+ pageFolders: [],
14
+ components: {}
14
15
  },
15
16
  style: e,
16
17
  definition: { rootId: "" }
17
18
  };
18
19
  //#endregion
19
- export { n as EMPTY_SCHEMA, t as VARIABLE_REGEX };
20
+ export { n as COMPONENT_PROPS_SOURCE, r as EMPTY_SCHEMA, t as VARIABLE_REGEX };
@@ -22,5 +22,7 @@ export declare const refreshRsc: (store: StoreApi<CommonState>, ids?: string[],
22
22
  * navigation asks for the destination BEFORE it commits. Absent means where the visitor already is, which is
23
23
  * every other caller: the initial load, a pager, an element refreshing itself.
24
24
  */
25
- location?: string) => Promise<void>;
25
+ location?: string,
26
+ /** Whether this is the one second asking, after a refusal that renewed the session. */
27
+ retried?: boolean) => Promise<void>;
26
28
  export default refreshRsc;
@@ -7,25 +7,26 @@ var o = (e, t, n) => {
7
7
  if (!e) return;
8
8
  let r = e.pages.reduce((t, n) => (n in e.flat && (t[n] = e.flat[n]), t), {});
9
9
  return a(i(r, e.pageFolders, n), t.split("?")[0], n).pageId;
10
- }, s = (e) => `rsc.data.${e}`, c = () => typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`, l = async (i, a, l, u) => {
11
- let { enabled: d, endpoint: f } = i.get("rsc") ?? {};
12
- if (!d || !f || typeof window > "u") return;
13
- let p = u ?? c(), m = i.get("schema"), h = i.get("runtime.sources.auth"), g = u ? o(m, u, !!h?.details) : i.get("navigation.currentPageId");
14
- if (m && n(m, g)) try {
15
- let n = new URLSearchParams({ location: p });
16
- a?.length && n.set("ids", a.join(",")), Object.entries(l ?? {}).forEach(([e, t]) => n.set(e, t));
17
- let o = await fetch(`${f}?${n.toString()}`, { headers: { Accept: "application/json" } });
10
+ }, s = (e) => `rsc.data.${e}`, c = () => typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`, l = async (i, a, u, d, f = !1) => {
11
+ let { enabled: p, endpoint: m } = i.get("rsc") ?? {};
12
+ if (!p || !m || typeof window > "u") return;
13
+ let h = d ?? c(), g = i.get("schema"), _ = i.get("runtime.sources.auth"), v = d ? o(g, d, !!_?.details) : i.get("navigation.currentPageId");
14
+ if (g && n(g, v)) try {
15
+ let n = new URLSearchParams({ location: h });
16
+ a?.length && n.set("ids", a.join(",")), Object.entries(u ?? {}).forEach(([e, t]) => n.set(e, t));
17
+ let o = await fetch(`${m}?${n.toString()}`, { headers: { Accept: "application/json" } });
18
18
  if (!o.ok) {
19
19
  let n = e(o.status, await o.json().catch(() => void 0));
20
- n && t({
20
+ if (n && await t({
21
21
  reason: n,
22
- url: f
23
- }), i.set("rsc.stale", !0);
22
+ url: m
23
+ }) && !f) return await l(i, a, u, d, !0);
24
+ i.set("rsc.stale", !0);
24
25
  return;
25
26
  }
26
- let { serverData: c, actionRuns: u } = await o.json();
27
- u?.length && r(u), i.batch(() => {
28
- a?.length ? Object.entries(c ?? {}).forEach(([e, t]) => i.set(s(e), t)) : i.set("rsc.data", c ?? {}), i.set("rsc.loaded", !0), i.set("rsc.stale", !1), i.set("rsc.location", p);
27
+ let { serverData: c, actionRuns: p } = await o.json();
28
+ p?.length && r(p), i.batch(() => {
29
+ a?.length ? Object.entries(c ?? {}).forEach(([e, t]) => i.set(s(e), t)) : i.set("rsc.data", c ?? {}), i.set("rsc.loaded", !0), i.set("rsc.stale", !1), i.set("rsc.location", h);
29
30
  });
30
31
  } catch {
31
32
  i.set("rsc.stale", !0);