@plitzi/sdk-shared 0.37.8 → 0.37.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/CHANGELOG.md +817 -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 +2 -2
  5. package/dist/actions/index.mjs +6 -6
  6. package/dist/actions/triggerParams.mjs +7 -6
  7. package/dist/actions/validateDocument.d.ts +3 -0
  8. package/dist/actions/validateDocument.mjs +89 -88
  9. package/dist/auth/failureChannel.d.ts +8 -2
  10. package/dist/auth/failureChannel.mjs +1 -3
  11. package/dist/authoring/elementCallbacks.d.ts +65 -0
  12. package/dist/authoring/elementCallbacks.mjs +72 -8
  13. package/dist/authoring/index.mjs +3 -3
  14. package/dist/builder/contexts/BuilderContext.d.ts +18 -7
  15. package/dist/builder/contexts/BuilderContext.mjs +2 -3
  16. package/dist/connectors/index.d.ts +1 -1
  17. package/dist/connectors/index.mjs +2 -2
  18. package/dist/connectors/validateManifest.d.ts +3 -0
  19. package/dist/connectors/validateManifest.mjs +77 -76
  20. package/dist/dataSource/computed.mjs +25 -29
  21. package/dist/dataSource/globalSources.d.ts +15 -0
  22. package/dist/dataSource/globalSources.mjs +13 -0
  23. package/dist/dataSource/index.d.ts +2 -0
  24. package/dist/dataSource/index.mjs +8 -7
  25. package/dist/devTools/DevToolsContext.mjs +2 -3
  26. package/dist/devTools/utils/PlitziConsole.d.ts +9 -0
  27. package/dist/devTools/utils/PlitziConsole.mjs +27 -7
  28. package/dist/elements/ComponentContext.mjs +2 -3
  29. package/dist/flags/flagsCookie.d.ts +26 -0
  30. package/dist/flags/flagsCookie.mjs +20 -0
  31. package/dist/flags/index.d.ts +3 -0
  32. package/dist/flags/index.mjs +4 -0
  33. package/dist/flags/resolveFlags.d.ts +60 -0
  34. package/dist/flags/resolveFlags.mjs +38 -0
  35. package/dist/flags/schemaFlag.d.ts +11 -0
  36. package/dist/flags/schemaFlag.mjs +9 -0
  37. package/dist/flags/useFlagResolution.d.ts +13 -0
  38. package/dist/flags/useFlagResolution.mjs +43 -0
  39. package/dist/helpers/eventTarget.d.ts +10 -0
  40. package/dist/helpers/eventTarget.mjs +4 -0
  41. package/dist/helpers/images.d.ts +18 -0
  42. package/dist/helpers/images.mjs +13 -0
  43. package/dist/helpers/index.d.ts +3 -0
  44. package/dist/helpers/index.mjs +21 -18
  45. package/dist/helpers/interval.d.ts +18 -0
  46. package/dist/helpers/interval.mjs +7 -0
  47. package/dist/helpers/isRecord.d.ts +2 -0
  48. package/dist/helpers/isRecord.mjs +4 -0
  49. package/dist/helpers/scroll.d.ts +42 -0
  50. package/dist/helpers/scroll.mjs +30 -0
  51. package/dist/helpers/sharedContext.d.ts +14 -0
  52. package/dist/helpers/sharedContext.mjs +9 -0
  53. package/dist/helpers/twigWrapper/Evaluator/Evaluator.d.ts +9 -1
  54. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +13 -8
  55. package/dist/helpers/twigWrapper/Evaluator/index.d.ts +1 -1
  56. package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -1
  57. package/dist/helpers/twigWrapper/filters/filters.mjs +38 -2
  58. package/dist/helpers/twigWrapper/index.d.ts +1 -0
  59. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +2 -1
  60. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +3 -3
  61. package/dist/helpers/utils.mjs +4 -2
  62. package/dist/history/describe.mjs +4 -1
  63. package/dist/history/diff.d.ts +1 -1
  64. package/dist/history/diff.mjs +11 -9
  65. package/dist/history/types.d.ts +1 -1
  66. package/dist/hooks/index.mjs +5 -5
  67. package/dist/hooks/usePlitziServiceContext.d.ts +1 -2
  68. package/dist/hooks/usePlitziServiceContext.mjs +3 -4
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.mjs +90 -77
  71. package/dist/navigation/routes.mjs +6 -4
  72. package/dist/network/NetworkContext.mjs +2 -3
  73. package/dist/network/NetworkInternalContext.d.ts +2 -4
  74. package/dist/network/NetworkInternalContext.mjs +2 -3
  75. package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.d.ts +2 -0
  76. package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +4 -0
  77. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.d.ts +4 -0
  78. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +4 -0
  79. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.d.ts +4 -0
  80. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +4 -0
  81. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.d.ts +4 -0
  82. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +4 -0
  83. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.d.ts +4 -0
  84. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +4 -0
  85. package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.d.ts +12 -0
  86. package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +4 -0
  87. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.d.ts +2 -0
  88. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +4 -0
  89. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.d.ts +3 -0
  90. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +4 -0
  91. package/dist/network/graphql/builder/Mutations/index.d.ts +13 -30
  92. package/dist/network/graphql/builder/Mutations/index.mjs +164 -200
  93. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +4 -3
  94. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  95. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +1 -1
  96. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -1
  97. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.d.ts +16 -2
  98. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -1
  99. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.d.ts +7 -0
  100. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +4 -0
  101. package/dist/network/graphql/builder/Queries/index.d.ts +3 -5
  102. package/dist/network/graphql/builder/Queries/index.mjs +36 -38
  103. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.d.ts +1 -1
  104. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +2 -3
  105. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -1
  106. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -4
  107. package/dist/network/graphql/sdk/Queries/index.mjs +2 -8
  108. package/dist/network/index.mjs +8 -7
  109. package/dist/network/spaceEvents.d.ts +25 -195
  110. package/dist/network/spaceEvents.mjs +156 -241
  111. package/dist/realtime/client.mjs +123 -95
  112. package/dist/realtime/topics.mjs +18 -17
  113. package/dist/schema/SchemaContext.mjs +2 -3
  114. package/dist/schema/anchor.d.ts +8 -0
  115. package/dist/schema/anchor.mjs +4 -0
  116. package/dist/schema/index.d.ts +2 -0
  117. package/dist/schema/index.mjs +6 -4
  118. package/dist/schema/schemaConstants.d.ts +2 -0
  119. package/dist/schema/schemaConstants.mjs +4 -3
  120. package/dist/schema/serverElements.d.ts +6 -2
  121. package/dist/schema/serverElements.mjs +17 -16
  122. package/dist/schema/snippet.d.ts +7 -0
  123. package/dist/schema/snippet.mjs +9 -0
  124. package/dist/schema/wire.d.ts +11 -0
  125. package/dist/schema/wire.mjs +27 -0
  126. package/dist/server/actions/useImagesSync.d.ts +9 -0
  127. package/dist/server/actions/useImagesSync.mjs +7 -0
  128. package/dist/server/rsc/refreshRsc.d.ts +3 -1
  129. package/dist/server/rsc/refreshRsc.mjs +17 -16
  130. package/dist/source/export.d.ts +107 -0
  131. package/dist/source/export.mjs +4 -0
  132. package/dist/source/index.d.ts +4 -0
  133. package/dist/source/index.mjs +3 -0
  134. package/dist/source/snapshot.d.ts +51 -0
  135. package/dist/source/snapshot.mjs +81 -0
  136. package/dist/state/paintedState.mjs +13 -12
  137. package/dist/state/runtimeStatePersist.mjs +50 -49
  138. package/dist/store/index.d.ts +45 -45
  139. package/dist/store/renderSettings.d.ts +1 -0
  140. package/dist/store/renderSettings.mjs +9 -5
  141. package/dist/style/breakpoints.d.ts +11 -0
  142. package/dist/style/breakpoints.mjs +8 -0
  143. package/dist/style/displayModes.d.ts +5 -0
  144. package/dist/style/displayModes.mjs +8 -0
  145. package/dist/style/fontValidation.mjs +52 -51
  146. package/dist/style/fonts.d.ts +0 -12
  147. package/dist/style/fonts.mjs +11 -11
  148. package/dist/style/index.d.ts +4 -0
  149. package/dist/style/index.mjs +11 -7
  150. package/dist/style/layoutGrid.d.ts +30 -0
  151. package/dist/style/layoutGrid.mjs +33 -0
  152. package/dist/style/notifications.d.ts +52 -0
  153. package/dist/style/notifications.mjs +55 -0
  154. package/dist/style/snippetStyle.d.ts +23 -0
  155. package/dist/style/snippetStyle.mjs +32 -0
  156. package/dist/style/styleConstants.d.ts +7 -2
  157. package/dist/style/styleConstants.mjs +10 -0
  158. package/dist/style/styleStates.d.ts +11 -2
  159. package/dist/style/styleStates.mjs +12 -9
  160. package/dist/theme/ThemeProvider.mjs +20 -20
  161. package/dist/theme/ThemeScope.mjs +4 -3
  162. package/dist/types/ActionTypes.d.ts +5 -0
  163. package/dist/types/CommonTypes.d.ts +3 -0
  164. package/dist/types/DevToolsTypes.d.ts +29 -4
  165. package/dist/types/ElementTypes.d.ts +6 -5
  166. package/dist/types/EventBridgeTypes.d.ts +2 -2
  167. package/dist/types/FunctionTypes.d.ts +13 -0
  168. package/dist/types/InteractionTypes.d.ts +5 -0
  169. package/dist/types/PluginTypes.d.ts +1 -1
  170. package/dist/types/ResourceTypes.d.ts +2 -2
  171. package/dist/types/SchemaTypes.d.ts +100 -3
  172. package/dist/types/SdkTypes.d.ts +0 -2
  173. package/dist/types/ServerTypes.d.ts +47 -0
  174. package/dist/types/SnippetTypes.d.ts +28 -0
  175. package/dist/types/SpaceTypes.d.ts +36 -0
  176. package/dist/types/StoreTypes.d.ts +39 -3
  177. package/dist/types/StyleTypes.d.ts +1 -1
  178. package/dist/types/index.d.ts +1 -2
  179. package/package.json +143 -138
  180. package/tailwind.config.js +1 -6
  181. package/vite.config.ts +16 -4
  182. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.d.ts +0 -4
  183. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -4
  184. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.d.ts +0 -2
  185. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -4
  186. package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.d.ts +0 -8
  187. package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.mjs +0 -4
  188. package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.d.ts +0 -2
  189. package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.mjs +0 -4
  190. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.d.ts +0 -4
  191. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -4
  192. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.d.ts +0 -2
  193. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -4
  194. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.d.ts +0 -2
  195. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -4
  196. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.d.ts +0 -2
  197. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -4
  198. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.d.ts +0 -2
  199. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -4
  200. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +0 -3
  201. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +0 -4
  202. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.d.ts +0 -2
  203. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -4
  204. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.d.ts +0 -2
  205. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -4
  206. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.d.ts +0 -2
  207. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.mjs +0 -4
  208. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.d.ts +0 -2
  209. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.mjs +0 -4
  210. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.d.ts +0 -2
  211. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.mjs +0 -4
  212. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.d.ts +0 -2
  213. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.mjs +0 -4
  214. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.d.ts +0 -2
  215. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.mjs +0 -4
  216. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.d.ts +0 -2
  217. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.mjs +0 -4
  218. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.d.ts +0 -2
  219. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.mjs +0 -4
  220. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.d.ts +0 -2
  221. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.mjs +0 -4
  222. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.d.ts +0 -2
  223. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.mjs +0 -4
  224. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.d.ts +0 -2
  225. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.mjs +0 -4
  226. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.d.ts +0 -2
  227. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.mjs +0 -4
  228. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.d.ts +0 -2
  229. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.mjs +0 -4
  230. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.d.ts +0 -2
  231. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.mjs +0 -4
  232. package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.d.ts +0 -2
  233. package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +0 -4
  234. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.d.ts +0 -6
  235. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -4
  236. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.d.ts +0 -9
  237. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -4
  238. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +0 -6
  239. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -4
  240. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +0 -9
  241. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -4
  242. package/dist/segments/SegmentsContext.d.ts +0 -2
  243. package/dist/segments/SegmentsContext.mjs +0 -6
  244. package/dist/segments/index.d.ts +0 -3
  245. package/dist/segments/index.mjs +0 -2
  246. package/dist/types/SegmentTypes.d.ts +0 -41
  247. package/dist/types/TemplateTypes.d.ts +0 -20
  248. package/dist/types/TemplateTypes.mjs +0 -0
  249. /package/dist/types/{SegmentTypes.mjs → SnippetTypes.mjs} +0 -0
@@ -1,249 +1,164 @@
1
- import { StyleVariableCategory as e } from "../types/StyleTypes.mjs";
2
- import { STYLE_STATES as t } from "../style/styleStates.mjs";
3
- import { z as n } from "zod";
1
+ import { isRecord as e } from "../helpers/isRecord.mjs";
2
+ import { isSchemaFlag as t } from "../flags/schemaFlag.mjs";
3
+ import { StyleVariableCategory as n } from "../types/StyleTypes.mjs";
4
+ import { DISPLAY_MODES as r } from "../style/displayModes.mjs";
5
+ import { STYLE_STATES as i } from "../style/styleStates.mjs";
6
+ import { elementFromWire as a, schemaFromWire as o, schemaToWire as s } from "../schema/wire.mjs";
7
+ import { z as c } from "zod";
4
8
  //#region src/network/spaceEvents.ts
5
- var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e) => r(e) && typeof e.id == "string", { message: "expected an element with an id" }), a = n.array(i), o = (e) => ({
6
- ...e,
7
- flat: Object.values(e.flat)
8
- }), s = (e) => ({
9
- ...e,
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([
12
- "desktop",
13
- "tablet",
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([
9
+ var l = c.custom((t) => e(t) && typeof t.id == "string", { message: "expected an element with an id" }), u = c.array(l), d = c.custom((t) => e(t) && typeof t.id == "string" && e(t.flat), { message: "expected a component with an id and a flat" }), f = c.custom((t) => e(t) && Array.isArray(t.flat), { message: "expected a schema whose `flat` is a list of elements" }), p = c.custom((t) => e(t) && typeof t.id == "string", { message: "expected a page folder with an id" }), m = c.custom((t) => e(t) && typeof t.name == "string", { message: "expected a variable with a name" }), h = c.custom(t, { message: "expected a flag with a value and its rules" }), g = c.custom(e, { message: "expected a style attributes object" }), _ = c.custom((t) => e(t) && typeof t.family == "string" && typeof t.source == "string", { message: "expected a font with a family and a source" }), v = c.custom((t) => typeof t == "string" || typeof t == "number" || e(t), { message: "expected a style variable value" }), y = c.enum(r), b = c.custom((e) => typeof e == "string", { message: "expected a drop position" }), x = c.custom((e) => typeof e == "string", { message: "expected a style category" }), S = c.enum([
16
10
  "class",
17
11
  "element",
18
12
  "id"
19
- ]), v = n.enum(t), y = n.enum(e), b = n.object({
20
- componentType: n.string().optional(),
21
- styleSelector: n.string().optional(),
22
- styleState: v.optional(),
23
- styleVariant: n.string().optional(),
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,
27
- selector: n.string(),
28
- category: y,
29
- name: n.string(),
30
- value: p
31
- }), T = n.object({
32
- displayMode: m,
33
- selector: n.string(),
34
- category: y,
35
- name: n.string()
36
- }), E = n.object({
37
- category: y,
38
- name: n.string(),
39
- value: p
40
- }), D = n.object({
41
- type: n.string(),
42
- resource: n.string(),
43
- settings: n.custom(r, { message: "expected a plugin settings object" })
44
- }), O = {
45
- SPACE_UPDATED: n.object({ schema: c }),
46
- STYLE_UPDATED: n.object({
47
- platform: n.custom(r),
48
- variables: n.custom(r),
49
- cache: n.string()
50
- }),
51
- SPACE_ADD_PAGE: n.object({ page: i }),
52
- SPACE_UPDATE_PAGE: n.object({ page: i }),
53
- SPACE_SET_HOME_PAGE: n.object({ page: i }),
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 }),
57
- SPACE_REMOVE_PAGE_FOLDER: n.object({ pageFolderId: n.string() }),
58
- SPACE_ADD_VARIABLE: C,
59
- SPACE_UPDATE_VARIABLE: C,
60
- SPACE_REMOVE_VARIABLE: n.object({ name: n.string() }),
61
- SPACE_ADD_ELEMENT: n.object({
62
- element: i,
63
- dropPosition: h,
64
- to: n.string(),
65
- initialItems: a.optional(),
66
- variables: n.array(u).optional()
67
- }),
68
- SPACE_UPDATE_ELEMENT: n.object({ element: i }),
69
- SPACE_RENAME_ELEMENT: n.object({
70
- elementId: n.string(),
71
- id: n.string()
72
- }),
73
- SPACE_UPDATE_ELEMENTS: n.object({ elements: a }),
74
- SPACE_REMOVE_ELEMENT: n.object({ elementId: n.string() }),
75
- SPACE_MOVE_ELEMENT: n.object({
76
- from: n.string(),
77
- to: n.string(),
78
- elementId: n.string(),
79
- dropPosition: h
80
- }),
81
- SPACE_CLONE_ELEMENT: n.object({
82
- to: n.string(),
83
- element: i,
84
- dropPosition: h,
85
- initialItems: a
86
- }),
87
- SPACE_ADD_TEMPLATE: n.object({
88
- element: i,
89
- style: n.custom(r),
90
- to: n.string(),
91
- dropPosition: h,
92
- initialItems: a.optional(),
93
- variables: n.array(u).optional()
94
- }),
95
- SPACE_ADD_PLUGIN: n.object({ plugin: D }),
96
- SPACE_UPDATE_PLUGIN: n.object({ plugin: D }),
97
- SPACE_REMOVE_PLUGIN: n.object({ pluginType: n.string() }),
98
- SPACE_UPDATE_SETTINGS: n.object({
99
- path: n.string(),
100
- value: n.union([
101
- n.string(),
102
- n.number(),
103
- n.boolean()
13
+ ]), C = c.enum(i), w = c.enum(n), T = c.object({
14
+ componentType: c.string().optional(),
15
+ styleSelector: c.string().optional(),
16
+ styleState: C.optional(),
17
+ styleVariant: c.string().optional(),
18
+ styleAncestor: c.string().optional()
19
+ }), E = T.extend({ styleSelector: c.string() }), D = c.object({ variable: m }), O = c.object({
20
+ displayMode: y,
21
+ selector: c.string(),
22
+ category: w,
23
+ name: c.string(),
24
+ value: v
25
+ }), k = c.object({
26
+ displayMode: y,
27
+ selector: c.string(),
28
+ category: w,
29
+ name: c.string()
30
+ }), A = c.object({
31
+ category: w,
32
+ name: c.string(),
33
+ value: v
34
+ }), j = c.object({
35
+ type: c.string(),
36
+ resource: c.string(),
37
+ settings: c.custom(e, { message: "expected a plugin settings object" })
38
+ }), M = {
39
+ SPACE_UPDATED: c.object({ schema: f }),
40
+ STYLE_UPDATED: c.object({
41
+ platform: c.custom(e),
42
+ variables: c.custom(e),
43
+ cache: c.string()
44
+ }),
45
+ SPACE_ADD_PAGE: c.object({ page: l }),
46
+ SPACE_UPDATE_PAGE: c.object({ page: l }),
47
+ SPACE_SET_HOME_PAGE: c.object({ page: l }),
48
+ SPACE_REMOVE_PAGE: c.object({ pageId: c.string() }),
49
+ SPACE_ADD_PAGE_FOLDER: c.object({ pageFolder: p }),
50
+ SPACE_UPDATE_PAGE_FOLDER: c.object({ pageFolder: p }),
51
+ SPACE_REMOVE_PAGE_FOLDER: c.object({ pageFolderId: c.string() }),
52
+ SPACE_ADD_VARIABLE: D,
53
+ SPACE_UPDATE_VARIABLE: D,
54
+ SPACE_REMOVE_VARIABLE: c.object({ name: c.string() }),
55
+ SPACE_SET_FLAG: c.object({
56
+ name: c.string(),
57
+ flag: h
58
+ }),
59
+ SPACE_REMOVE_FLAG: c.object({ name: c.string() }),
60
+ SPACE_ADD_ELEMENT: c.object({
61
+ element: l,
62
+ dropPosition: b,
63
+ to: c.string(),
64
+ initialItems: u.optional(),
65
+ variables: c.array(m).optional()
66
+ }),
67
+ SPACE_UPDATE_ELEMENT: c.object({ element: l }),
68
+ SPACE_RENAME_ELEMENT: c.object({
69
+ elementId: c.string(),
70
+ id: c.string()
71
+ }),
72
+ SPACE_UPDATE_ELEMENTS: c.object({ elements: u }),
73
+ SPACE_REMOVE_ELEMENT: c.object({ elementId: c.string() }),
74
+ SPACE_MOVE_ELEMENT: c.object({
75
+ from: c.string(),
76
+ to: c.string(),
77
+ elementId: c.string(),
78
+ dropPosition: b
79
+ }),
80
+ SPACE_CLONE_ELEMENT: c.object({
81
+ to: c.string(),
82
+ element: l,
83
+ dropPosition: b,
84
+ initialItems: u
85
+ }),
86
+ SPACE_ADD_SNIPPET: c.object({
87
+ element: l,
88
+ style: c.custom(e),
89
+ to: c.string(),
90
+ dropPosition: b,
91
+ initialItems: u.optional(),
92
+ variables: c.array(m).optional()
93
+ }),
94
+ SPACE_ADD_PLUGIN: c.object({ plugin: j }),
95
+ SPACE_UPDATE_PLUGIN: c.object({ plugin: j }),
96
+ SPACE_REMOVE_PLUGIN: c.object({ pluginType: c.string() }),
97
+ SPACE_UPDATE_SETTINGS: c.object({
98
+ path: c.string(),
99
+ value: c.union([
100
+ c.string(),
101
+ c.number(),
102
+ c.boolean()
104
103
  ])
105
104
  }),
106
- STYLE_ADD_SELECTOR: n.object({
107
- displayMode: m,
108
- selector: n.string(),
109
- path: g.optional(),
110
- type: _,
111
- style: d.optional(),
112
- params: b
113
- }),
114
- STYLE_UPDATE_SELECTOR: n.object({
115
- displayMode: m,
116
- selector: n.string(),
117
- path: g.optional(),
118
- style: d.optional(),
119
- params: x
120
- }),
121
- STYLE_REMOVE_SELECTOR: n.object({
122
- displayMode: m,
123
- selector: n.string()
124
- }),
125
- STYLE_REMOVE_SELECTORS: n.object({
126
- displayMode: m,
127
- selectors: n.array(n.string())
128
- }),
129
- STYLE_ADD_SELECTOR_VARIABLE: w,
130
- STYLE_UPDATE_SELECTOR_VARIABLE: w,
131
- STYLE_REMOVE_SELECTOR_VARIABLE: T,
132
- STYLE_ADD_VARIABLE: E,
133
- STYLE_UPDATE_VARIABLE: E,
134
- STYLE_REMOVE_VARIABLE: n.object({
135
- category: y,
136
- name: n.string()
137
- }),
138
- STYLE_UPDATE_SETTINGS: n.object({
139
- path: n.string(),
140
- value: n.string()
141
- }),
142
- STYLE_ADD_FONT: n.object({ font: f }),
143
- STYLE_UPDATE_FONT: n.object({
144
- family: n.string(),
145
- font: f
146
- }),
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
- })
245
- }, k = Object.fromEntries(Object.keys(O).map((e) => [e, e])), A = (e, t) => {
246
- let n = O[e];
105
+ STYLE_ADD_SELECTOR: c.object({
106
+ displayMode: y,
107
+ selector: c.string(),
108
+ path: x.optional(),
109
+ type: S,
110
+ style: g.optional(),
111
+ params: T
112
+ }),
113
+ STYLE_UPDATE_SELECTOR: c.object({
114
+ displayMode: y,
115
+ selector: c.string(),
116
+ path: x.optional(),
117
+ style: g.optional(),
118
+ params: E
119
+ }),
120
+ STYLE_REMOVE_SELECTOR: c.object({
121
+ displayMode: y,
122
+ selector: c.string()
123
+ }),
124
+ STYLE_REMOVE_SELECTORS: c.object({
125
+ displayMode: y,
126
+ selectors: c.array(c.string())
127
+ }),
128
+ STYLE_ADD_SELECTOR_VARIABLE: O,
129
+ STYLE_UPDATE_SELECTOR_VARIABLE: O,
130
+ STYLE_REMOVE_SELECTOR_VARIABLE: k,
131
+ STYLE_ADD_VARIABLE: A,
132
+ STYLE_UPDATE_VARIABLE: A,
133
+ STYLE_REMOVE_VARIABLE: c.object({
134
+ category: w,
135
+ name: c.string()
136
+ }),
137
+ STYLE_UPDATE_SETTINGS: c.object({
138
+ path: c.string(),
139
+ value: c.string()
140
+ }),
141
+ STYLE_ADD_FONT: c.object({ font: _ }),
142
+ STYLE_UPDATE_FONT: c.object({
143
+ family: c.string(),
144
+ font: _
145
+ }),
146
+ STYLE_REMOVE_FONT: c.object({ family: c.string() }),
147
+ SPACE_ADD_COMPONENT: c.object({
148
+ component: d,
149
+ from: c.object({
150
+ elementId: c.string(),
151
+ instanceId: c.string()
152
+ }).optional()
153
+ }),
154
+ SPACE_UPDATE_COMPONENT: c.object({
155
+ componentId: c.string(),
156
+ declaration: c.custom(e)
157
+ }),
158
+ SPACE_REMOVE_COMPONENT: c.object({ componentId: c.string() }),
159
+ SPACE_DETACH_INSTANCE: c.object({ instanceId: c.string() })
160
+ }, N = Object.fromEntries(Object.keys(M).map((e) => [e, e])), P = (e, t) => {
161
+ let n = M[e];
247
162
  if (!n) return {
248
163
  ok: !1,
249
164
  issues: [{
@@ -264,4 +179,4 @@ var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = n.custom((e
264
179
  };
265
180
  };
266
181
  //#endregion
267
- export { k as SpaceEvents, k as default, s as schemaFromWire, o as schemaToWire, O as spaceEventSchemas, A as validateSpaceEvent };
182
+ export { N as SpaceEvents, N as default, a as elementFromWire, o as schemaFromWire, s as schemaToWire, M as spaceEventSchemas, P as validateSpaceEvent };