@plitzi/sdk-shared 0.38.3 → 0.38.5

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 (86) hide show
  1. package/CHANGELOG.md +522 -0
  2. package/dist/actions/functions.d.ts +10 -0
  3. package/dist/actions/functions.mjs +10 -10
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +6 -6
  6. package/dist/authoring/elementCallbacks.d.ts +2 -2
  7. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  8. package/dist/devTools/chrome.d.ts +8 -0
  9. package/dist/devTools/chrome.mjs +4 -0
  10. package/dist/devTools/index.d.ts +1 -0
  11. package/dist/devTools/index.mjs +5 -4
  12. package/dist/helpers/images.d.ts +5 -0
  13. package/dist/helpers/images.mjs +2 -2
  14. package/dist/helpers/twigWrapper/inspectTemplate.mjs +14 -7
  15. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +4 -3
  16. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +32 -22
  17. package/dist/history/types.d.ts +4 -4
  18. package/dist/index.mjs +56 -54
  19. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.d.ts +10 -0
  20. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +4 -0
  21. package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
  22. package/dist/network/graphql/builder/Mutations/index.mjs +124 -122
  23. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -3
  24. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  25. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.d.ts +6 -0
  26. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +4 -0
  27. package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
  28. package/dist/network/graphql/builder/Queries/index.mjs +22 -20
  29. package/dist/network/spaceEvents.d.ts +2 -2
  30. package/dist/plugins/bundle.d.ts +26 -0
  31. package/dist/plugins/bundle.mjs +62 -0
  32. package/dist/plugins/declaration.d.ts +12 -0
  33. package/dist/plugins/declaration.mjs +9 -0
  34. package/dist/queries/queryCache.d.ts +7 -0
  35. package/dist/queries/queryCache.mjs +14 -7
  36. package/dist/queries/useQuery.d.ts +2 -0
  37. package/dist/queries/useQuery.mjs +5 -2
  38. package/dist/schema/anchor.d.ts +11 -0
  39. package/dist/schema/anchor.mjs +6 -2
  40. package/dist/schema/index.mjs +6 -6
  41. package/dist/schema/markdownHeadings.d.ts +13 -0
  42. package/dist/schema/markdownHeadings.mjs +24 -0
  43. package/dist/schema/motion.d.ts +47 -15
  44. package/dist/schema/motion.mjs +208 -32
  45. package/dist/schema/motionReveal.d.ts +10 -0
  46. package/dist/schema/motionReveal.mjs +23 -0
  47. package/dist/schema/pageElements.d.ts +12 -0
  48. package/dist/schema/pageElements.mjs +41 -0
  49. package/dist/schema/wire.mjs +4 -3
  50. package/dist/server/index.mjs +4 -4
  51. package/dist/server/rsc/projectData.d.ts +6 -0
  52. package/dist/server/rsc/projectData.mjs +4 -0
  53. package/dist/server/rsc/refreshRsc.d.ts +18 -5
  54. package/dist/server/rsc/refreshRsc.mjs +80 -20
  55. package/dist/server/rsc/useRscSync.mjs +26 -15
  56. package/dist/server/usePluginRoute.d.ts +18 -0
  57. package/dist/server/usePluginRoute.mjs +14 -0
  58. package/dist/source/export.d.ts +18 -0
  59. package/dist/source/import.d.ts +55 -0
  60. package/dist/source/import.mjs +4 -0
  61. package/dist/source/index.d.ts +2 -0
  62. package/dist/source/index.mjs +3 -2
  63. package/dist/store/index.d.ts +45 -45
  64. package/dist/style/cssLayers.d.ts +18 -0
  65. package/dist/style/cssLayers.mjs +14 -0
  66. package/dist/style/index.d.ts +1 -0
  67. package/dist/style/index.mjs +11 -10
  68. package/dist/style/styleConstants.d.ts +10 -2
  69. package/dist/style/styleConstants.mjs +16 -0
  70. package/dist/style/useDisplayMode.d.ts +11 -0
  71. package/dist/style/useDisplayMode.mjs +18 -0
  72. package/dist/types/ActionTypes.d.ts +3 -3
  73. package/dist/types/ComponentTypes.d.ts +13 -0
  74. package/dist/types/DataTypes.d.ts +36 -0
  75. package/dist/types/InteractionTypes.d.ts +16 -2
  76. package/dist/types/SchemaTypes.d.ts +10 -2
  77. package/dist/types/SchemaTypes.mjs +2 -1
  78. package/dist/types/ServerTypes.d.ts +60 -8
  79. package/dist/types/StoreTypes.d.ts +19 -6
  80. package/dist/types/index.d.ts +1 -2
  81. package/package.json +58 -28
  82. package/setupTests.ts +16 -13
  83. package/dist/types/AITypes.d.ts +0 -80
  84. package/dist/types/McpTypes/index.d.ts +0 -56
  85. package/dist/types/McpTypes/index.mjs +0 -0
  86. /package/dist/types/{AITypes.mjs → DataTypes.mjs} +0 -0
@@ -19,100 +19,101 @@ import _ from "./Space/connectors/SpaceUpdateConnectorMutation.mjs";
19
19
  import v from "./Space/credentials/SpaceAddCredentialMutation.mjs";
20
20
  import y from "./Space/credentials/SpaceRemoveCredentialMutation.mjs";
21
21
  import b from "./Space/credentials/SpaceUpdateCredentialMutation.mjs";
22
- import x from "./Space/flags/SpacePublishFlagsMutation.mjs";
23
- import S from "./Space/flags/SpaceRemoveFlagMutation.mjs";
24
- import C from "./Space/flags/SpaceSetFlagMutation.mjs";
25
- import w from "./Space/folders/SpaceAddPageFolderMutation.mjs";
26
- import T from "./Space/folders/SpaceRemovePageFolderMutation.mjs";
27
- import E from "./Space/folders/SpaceUpdatePageFolderMutation.mjs";
28
- import D from "./Space/functions/SpaceInstallTemplateFunctionsMutation.mjs";
29
- import O from "./Space/functions/SpaceRemoveFunctionsMutation.mjs";
30
- import k from "./Space/functions/SpaceSaveFunctionsMutation.mjs";
31
- import A from "./Space/functions/SpaceTryFunctionMutation.mjs";
32
- import j from "./Space/pages/SpaceAddPageMutation.mjs";
33
- import M from "./Space/pages/SpaceHomePageMutation.mjs";
34
- import N from "./Space/pages/SpaceRemovePageMutation.mjs";
35
- import P from "./Space/pages/SpaceUpdatePageMutation.mjs";
36
- import F from "./Space/resources/SpaceAddResourceMutation.mjs";
37
- import I from "./Space/resources/SpaceMoveResourceMutation.mjs";
38
- import L from "./Space/resources/SpaceRemoveResourceMutation.mjs";
39
- import R from "./Space/runtime/SpaceRemoveRuntimeMutation.mjs";
40
- import z from "./Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs";
41
- import B from "./Space/runtime/SpaceSetRuntimeSizeMutation.mjs";
42
- import V from "./Space/runtime/SpaceSetRuntimeVariableMutation.mjs";
43
- import H from "./Space/runtime/SpaceStartRuntimeMutation.mjs";
44
- import U from "./Space/runtime/SpaceStopRuntimeMutation.mjs";
45
- import W from "./Space/SpaceAddElementMutation.mjs";
46
- import G from "./Space/SpaceAddPluginMutation.mjs";
47
- import K from "./Space/SpaceAddSnippetMutation.mjs";
48
- import q from "./Space/SpaceCloneElementMutation.mjs";
49
- import J from "./Space/SpaceDeployMutation.mjs";
50
- import Y from "./Space/SpaceFixIssuesMutation.mjs";
51
- import X from "./Space/SpaceMoveElementMutation.mjs";
52
- import Z from "./Space/SpacePublishMutation.mjs";
53
- import Q from "./Space/SpaceRemoveElementMutation.mjs";
54
- import $ from "./Space/SpaceRemovePluginMutation.mjs";
55
- import ee from "./Space/SpaceRenameElementMutation.mjs";
56
- import te from "./Space/SpaceUpdateElementMutation.mjs";
57
- import ne from "./Space/SpaceUpdateElementsMutation.mjs";
58
- import re from "./Space/SpaceUpdateMutation.mjs";
59
- import ie from "./Space/SpaceUpdatePluginMutation.mjs";
60
- import ae from "./Space/SpaceUpdateSchemaMutation.mjs";
61
- import oe from "./Space/SpaceUpdateSettingsMutation.mjs";
62
- import se from "./Space/variables/SpaceAddVariableMutation.mjs";
63
- import ce from "./Space/variables/SpaceRemoveVariableMutation.mjs";
64
- import le from "./Space/variables/SpaceUpdateVariableMutation.mjs";
65
- import ue from "./Space/visitors/SpaceAddVisitorMutation.mjs";
66
- import de from "./Space/visitors/SpaceRemoveVisitorMutation.mjs";
67
- import fe from "./Style/fonts/StyleAddFontMutation.mjs";
68
- import pe from "./Style/fonts/StyleRemoveFontMutation.mjs";
69
- import me from "./Style/fonts/StyleUpdateFontMutation.mjs";
70
- import he from "./Style/selectors/StyleAddSelectorMutation.mjs";
71
- import ge from "./Style/selectors/StyleRemoveSelectorMutation.mjs";
72
- import _e from "./Style/selectors/StyleRemoveSelectorsMutation.mjs";
73
- import ve from "./Style/selectors/StyleUpdateSelectorMutation.mjs";
74
- import ye from "./Style/selectorVariables/StyleAddSelectorVariableMutation.mjs";
75
- import be from "./Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs";
76
- import xe from "./Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs";
77
- import Se from "./Style/StyleUpdateMutation.mjs";
78
- import Ce from "./Style/StyleUpdateSettingsMutation.mjs";
79
- import we from "./Style/variables/StyleAddVariableMutation.mjs";
80
- import Te from "./Style/variables/StyleRemoveVariableMutation.mjs";
81
- import Ee from "./Style/variables/StyleUpdateVariableMutation.mjs";
22
+ import x from "./Space/data/SpaceSaveDataMutation.mjs";
23
+ import S from "./Space/flags/SpacePublishFlagsMutation.mjs";
24
+ import C from "./Space/flags/SpaceRemoveFlagMutation.mjs";
25
+ import w from "./Space/flags/SpaceSetFlagMutation.mjs";
26
+ import T from "./Space/folders/SpaceAddPageFolderMutation.mjs";
27
+ import E from "./Space/folders/SpaceRemovePageFolderMutation.mjs";
28
+ import D from "./Space/folders/SpaceUpdatePageFolderMutation.mjs";
29
+ import O from "./Space/functions/SpaceInstallTemplateFunctionsMutation.mjs";
30
+ import k from "./Space/functions/SpaceRemoveFunctionsMutation.mjs";
31
+ import A from "./Space/functions/SpaceSaveFunctionsMutation.mjs";
32
+ import j from "./Space/functions/SpaceTryFunctionMutation.mjs";
33
+ import M from "./Space/pages/SpaceAddPageMutation.mjs";
34
+ import N from "./Space/pages/SpaceHomePageMutation.mjs";
35
+ import P from "./Space/pages/SpaceRemovePageMutation.mjs";
36
+ import F from "./Space/pages/SpaceUpdatePageMutation.mjs";
37
+ import I from "./Space/resources/SpaceAddResourceMutation.mjs";
38
+ import L from "./Space/resources/SpaceMoveResourceMutation.mjs";
39
+ import R from "./Space/resources/SpaceRemoveResourceMutation.mjs";
40
+ import z from "./Space/runtime/SpaceRemoveRuntimeMutation.mjs";
41
+ import B from "./Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs";
42
+ import V from "./Space/runtime/SpaceSetRuntimeSizeMutation.mjs";
43
+ import H from "./Space/runtime/SpaceSetRuntimeVariableMutation.mjs";
44
+ import U from "./Space/runtime/SpaceStartRuntimeMutation.mjs";
45
+ import W from "./Space/runtime/SpaceStopRuntimeMutation.mjs";
46
+ import G from "./Space/SpaceAddElementMutation.mjs";
47
+ import K from "./Space/SpaceAddPluginMutation.mjs";
48
+ import q from "./Space/SpaceAddSnippetMutation.mjs";
49
+ import J from "./Space/SpaceCloneElementMutation.mjs";
50
+ import Y from "./Space/SpaceDeployMutation.mjs";
51
+ import X from "./Space/SpaceFixIssuesMutation.mjs";
52
+ import Z from "./Space/SpaceMoveElementMutation.mjs";
53
+ import Q from "./Space/SpacePublishMutation.mjs";
54
+ import $ from "./Space/SpaceRemoveElementMutation.mjs";
55
+ import ee from "./Space/SpaceRemovePluginMutation.mjs";
56
+ import te from "./Space/SpaceRenameElementMutation.mjs";
57
+ import ne from "./Space/SpaceUpdateElementMutation.mjs";
58
+ import re from "./Space/SpaceUpdateElementsMutation.mjs";
59
+ import ie from "./Space/SpaceUpdateMutation.mjs";
60
+ import ae from "./Space/SpaceUpdatePluginMutation.mjs";
61
+ import oe from "./Space/SpaceUpdateSchemaMutation.mjs";
62
+ import se from "./Space/SpaceUpdateSettingsMutation.mjs";
63
+ import ce from "./Space/variables/SpaceAddVariableMutation.mjs";
64
+ import le from "./Space/variables/SpaceRemoveVariableMutation.mjs";
65
+ import ue from "./Space/variables/SpaceUpdateVariableMutation.mjs";
66
+ import de from "./Space/visitors/SpaceAddVisitorMutation.mjs";
67
+ import fe from "./Space/visitors/SpaceRemoveVisitorMutation.mjs";
68
+ import pe from "./Style/fonts/StyleAddFontMutation.mjs";
69
+ import me from "./Style/fonts/StyleRemoveFontMutation.mjs";
70
+ import he from "./Style/fonts/StyleUpdateFontMutation.mjs";
71
+ import ge from "./Style/selectors/StyleAddSelectorMutation.mjs";
72
+ import _e from "./Style/selectors/StyleRemoveSelectorMutation.mjs";
73
+ import ve from "./Style/selectors/StyleRemoveSelectorsMutation.mjs";
74
+ import ye from "./Style/selectors/StyleUpdateSelectorMutation.mjs";
75
+ import be from "./Style/selectorVariables/StyleAddSelectorVariableMutation.mjs";
76
+ import xe from "./Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs";
77
+ import Se from "./Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs";
78
+ import Ce from "./Style/StyleUpdateMutation.mjs";
79
+ import we from "./Style/StyleUpdateSettingsMutation.mjs";
80
+ import Te from "./Style/variables/StyleAddVariableMutation.mjs";
81
+ import Ee from "./Style/variables/StyleRemoveVariableMutation.mjs";
82
+ import De from "./Style/variables/StyleUpdateVariableMutation.mjs";
82
83
  //#region src/network/graphql/builder/Mutations/index.ts
83
- var De = {
84
- SpaceUpdate: re,
85
- SpaceUpdateSchema: ae,
86
- SpaceAddPage: j,
87
- SpaceHomePage: M,
88
- SpaceUpdatePage: P,
89
- SpaceRemovePage: N,
90
- SpaceAddPageFolder: w,
91
- SpaceUpdatePageFolder: E,
92
- SpaceRemovePageFolder: T,
93
- SpaceAddVariable: se,
94
- SpaceUpdateVariable: le,
95
- SpaceRemoveVariable: ce,
96
- SpaceSetFlag: C,
97
- SpaceRemoveFlag: S,
98
- SpaceAddElement: W,
99
- SpaceUpdateElement: te,
100
- SpaceRenameElement: ee,
101
- SpaceUpdateElements: ne,
102
- SpaceRemoveElement: Q,
103
- SpaceMoveElement: X,
104
- SpaceCloneElement: q,
84
+ var Oe = {
85
+ SpaceUpdate: ie,
86
+ SpaceUpdateSchema: oe,
87
+ SpaceAddPage: M,
88
+ SpaceHomePage: N,
89
+ SpaceUpdatePage: F,
90
+ SpaceRemovePage: P,
91
+ SpaceAddPageFolder: T,
92
+ SpaceUpdatePageFolder: D,
93
+ SpaceRemovePageFolder: E,
94
+ SpaceAddVariable: ce,
95
+ SpaceUpdateVariable: ue,
96
+ SpaceRemoveVariable: le,
97
+ SpaceSetFlag: w,
98
+ SpaceRemoveFlag: C,
99
+ SpaceAddElement: G,
100
+ SpaceUpdateElement: ne,
101
+ SpaceRenameElement: te,
102
+ SpaceUpdateElements: re,
103
+ SpaceRemoveElement: $,
104
+ SpaceMoveElement: Z,
105
+ SpaceCloneElement: J,
105
106
  SpaceAddComponent: d,
106
107
  SpaceUpdateComponent: m,
107
108
  SpaceRemoveComponent: p,
108
109
  SpaceDetachInstance: f,
109
- SpaceAddSnippet: K,
110
- SpaceAddPlugin: G,
111
- SpaceUpdatePlugin: ie,
112
- SpaceRemovePlugin: $,
113
- SpaceAddResource: F,
114
- SpaceMoveResource: I,
115
- SpaceRemoveResource: L,
110
+ SpaceAddSnippet: q,
111
+ SpaceAddPlugin: K,
112
+ SpaceUpdatePlugin: ae,
113
+ SpaceRemovePlugin: ee,
114
+ SpaceAddResource: I,
115
+ SpaceMoveResource: L,
116
+ SpaceRemoveResource: R,
116
117
  SpaceAddCdn: a,
117
118
  SpaceUpdateCdn: u,
118
119
  SpaceSetCdnCredential: c,
@@ -124,44 +125,45 @@ var De = {
124
125
  SpaceUpdateAction: r,
125
126
  SpaceRemoveAction: t,
126
127
  SpaceRunAction: n,
127
- SpaceSaveFunctions: k,
128
- SpaceRemoveFunctions: O,
129
- SpaceInstallTemplateFunctions: D,
130
- SpaceTryFunction: A,
128
+ SpaceSaveData: x,
129
+ SpaceSaveFunctions: A,
130
+ SpaceRemoveFunctions: k,
131
+ SpaceInstallTemplateFunctions: O,
132
+ SpaceTryFunction: j,
131
133
  SpaceAddConnector: h,
132
134
  SpaceUpdateConnector: _,
133
135
  SpaceRemoveConnector: g,
134
136
  SpaceAddCredential: v,
135
137
  SpaceUpdateCredential: b,
136
138
  SpaceRemoveCredential: y,
137
- SpaceAddVisitor: ue,
138
- SpaceRemoveVisitor: de,
139
- SpaceSetRuntimeVariable: V,
140
- SpaceSetRuntimeSize: B,
141
- SpaceStartRuntime: H,
142
- SpaceStopRuntime: U,
143
- SpaceRemoveRuntimeVariable: z,
144
- SpaceRemoveRuntime: R,
145
- SpacePublish: Z,
146
- SpacePublishFlags: x,
147
- SpaceFixIssues: Y,
148
- SpaceDeploy: J,
149
- SpaceUpdateSettings: oe,
150
- StyleAddSelector: he,
151
- StyleUpdateSelector: ve,
152
- StyleRemoveSelector: ge,
153
- StyleRemoveSelectors: _e,
154
- StyleAddSelectorVariable: ye,
155
- StyleUpdateSelectorVariable: xe,
156
- StyleRemoveSelectorVariable: be,
157
- StyleAddFont: fe,
158
- StyleUpdateFont: me,
159
- StyleRemoveFont: pe,
160
- StyleAddVariable: we,
161
- StyleUpdateVariable: Ee,
162
- StyleRemoveVariable: Te,
163
- StyleUpdate: Se,
164
- StyleUpdateSettings: Ce
139
+ SpaceAddVisitor: de,
140
+ SpaceRemoveVisitor: fe,
141
+ SpaceSetRuntimeVariable: H,
142
+ SpaceSetRuntimeSize: V,
143
+ SpaceStartRuntime: U,
144
+ SpaceStopRuntime: W,
145
+ SpaceRemoveRuntimeVariable: B,
146
+ SpaceRemoveRuntime: z,
147
+ SpacePublish: Q,
148
+ SpacePublishFlags: S,
149
+ SpaceFixIssues: X,
150
+ SpaceDeploy: Y,
151
+ SpaceUpdateSettings: se,
152
+ StyleAddSelector: ge,
153
+ StyleUpdateSelector: ye,
154
+ StyleRemoveSelector: _e,
155
+ StyleRemoveSelectors: ve,
156
+ StyleAddSelectorVariable: be,
157
+ StyleUpdateSelectorVariable: Se,
158
+ StyleRemoveSelectorVariable: xe,
159
+ StyleAddFont: pe,
160
+ StyleUpdateFont: he,
161
+ StyleRemoveFont: me,
162
+ StyleAddVariable: Te,
163
+ StyleUpdateVariable: De,
164
+ StyleRemoveVariable: Ee,
165
+ StyleUpdate: Ce,
166
+ StyleUpdateSettings: we
165
167
  };
166
168
  //#endregion
167
- export { De as default };
169
+ export { Oe as default };
@@ -1,7 +1,5 @@
1
1
  import { PluginRaw, SchemaRaw, Style } from '../../../../types';
2
2
  export type TInitQuery = {
3
- /** The editor's own feature flags, resolved by the platform for whoever opened it. */
4
- PlatformFlags?: Record<string, boolean>;
5
3
  Space?: {
6
4
  definition: SchemaRaw['definition'];
7
5
  plugins: PluginRaw[];
@@ -9,5 +7,5 @@ export type TInitQuery = {
9
7
  style: Style;
10
8
  };
11
9
  };
12
- declare const InitQuery = "\n query InitQuery($environment: String!, $revision: Int) {\n PlatformFlags\n Space(environment: $environment, revision: $revision) {\n definition {\n name\n permanentUrl\n }\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n category\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n id\n platform\n variables\n mode\n fonts\n cache\n }\n }\n }\n";
10
+ declare const InitQuery = "\n query InitQuery($environment: String!, $revision: Int) {\n Space(environment: $environment, revision: $revision) {\n definition {\n name\n permanentUrl\n }\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n quiet\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n category\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n id\n platform\n variables\n mode\n fonts\n cache\n }\n }\n }\n";
13
11
  export default InitQuery;
@@ -1,4 +1,4 @@
1
1
  //#region src/network/graphql/builder/Queries/InitQuery.ts
2
- var e = "\n query InitQuery($environment: String!, $revision: Int) {\n PlatformFlags\n Space(environment: $environment, revision: $revision) {\n definition {\n name\n permanentUrl\n }\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n category\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n id\n platform\n variables\n mode\n fonts\n cache\n }\n }\n }\n";
2
+ var e = "\n query InitQuery($environment: String!, $revision: Int) {\n Space(environment: $environment, revision: $revision) {\n definition {\n name\n permanentUrl\n }\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n quiet\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n category\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n id\n platform\n variables\n mode\n fonts\n cache\n }\n }\n }\n";
3
3
  //#endregion
4
4
  export { e as default };
@@ -0,0 +1,6 @@
1
+ import { DataDraft } from '../../../../../types';
2
+ export type TSpaceDataQuery = {
3
+ SpaceData: DataDraft;
4
+ };
5
+ declare const SpaceDataQuery = "\n query SpaceDataQuery {\n SpaceData {\n files\n version\n }\n }\n";
6
+ export default SpaceDataQuery;
@@ -0,0 +1,4 @@
1
+ //#region src/network/graphql/builder/Queries/Space/SpaceDataQuery.ts
2
+ var e = "\n query SpaceDataQuery {\n SpaceData {\n files\n version\n }\n }\n";
3
+ //#endregion
4
+ export { e as default };
@@ -7,6 +7,7 @@ import { TSpaceChangesQuery } from './Space/SpaceChangesQuery';
7
7
  import { TSpaceCheckActionQuery } from './Space/SpaceCheckActionQuery';
8
8
  import { TSpaceConnectorsQuery } from './Space/SpaceConnectorsQuery';
9
9
  import { TSpaceCredentialsQuery } from './Space/SpaceCredentialsQuery';
10
+ import { TSpaceDataQuery } from './Space/SpaceDataQuery';
10
11
  import { TSpaceDeploymentsQuery } from './Space/SpaceDeploymentsQuery';
11
12
  import { TSpaceFunctionsQuery } from './Space/SpaceFunctionsQuery';
12
13
  import { TSpaceIssuesQuery } from './Space/SpaceIssuesQuery';
@@ -32,6 +33,7 @@ export type BuilderQueriesMap = {
32
33
  SpaceActionEvents: TSpaceActionEventsQuery;
33
34
  SpaceCheckAction: TSpaceCheckActionQuery;
34
35
  SpaceActionTasks: TSpaceActionTasksQuery;
36
+ SpaceData: TSpaceDataQuery;
35
37
  SpaceFunctions: TSpaceFunctionsQuery;
36
38
  SpaceConnectors: TSpaceConnectorsQuery;
37
39
  SpaceCredentials: TSpaceCredentialsQuery;
@@ -7,35 +7,37 @@ import a from "./Space/SpaceChangesQuery.mjs";
7
7
  import o from "./Space/SpaceCheckActionQuery.mjs";
8
8
  import s from "./Space/SpaceConnectorsQuery.mjs";
9
9
  import c from "./Space/SpaceCredentialsQuery.mjs";
10
- import l from "./Space/SpaceDeploymentsQuery.mjs";
11
- import u from "./Space/SpaceFunctionsQuery.mjs";
12
- import d from "./Space/SpaceIssuesQuery.mjs";
13
- import f from "./Space/SpaceLatestRevisionQuery.mjs";
14
- import p from "./Space/SpaceQuotaQuery.mjs";
15
- import m from "./Space/SpaceResourcesQuery.mjs";
16
- import h from "./Space/SpaceRuntimeQuery.mjs";
17
- import g from "./Space/SpaceVersionContentsQuery.mjs";
18
- import _ from "./Space/SpaceVisitorsQuery.mjs";
10
+ import l from "./Space/SpaceDataQuery.mjs";
11
+ import u from "./Space/SpaceDeploymentsQuery.mjs";
12
+ import d from "./Space/SpaceFunctionsQuery.mjs";
13
+ import f from "./Space/SpaceIssuesQuery.mjs";
14
+ import p from "./Space/SpaceLatestRevisionQuery.mjs";
15
+ import m from "./Space/SpaceQuotaQuery.mjs";
16
+ import h from "./Space/SpaceResourcesQuery.mjs";
17
+ import g from "./Space/SpaceRuntimeQuery.mjs";
18
+ import _ from "./Space/SpaceVersionContentsQuery.mjs";
19
+ import v from "./Space/SpaceVisitorsQuery.mjs";
19
20
  //#region src/network/graphql/builder/Queries/index.ts
20
- var v = {
21
+ var y = {
21
22
  Init: e,
22
- SpaceLatestRevision: f,
23
- SpaceQuota: p,
24
- SpaceIssues: d,
23
+ SpaceLatestRevision: p,
24
+ SpaceQuota: m,
25
+ SpaceIssues: f,
25
26
  SpaceChanges: a,
26
- SpaceResources: m,
27
- SpaceDeployments: l,
27
+ SpaceResources: h,
28
+ SpaceDeployments: u,
28
29
  SpaceCdns: i,
29
30
  SpaceActions: n,
30
31
  SpaceActionEvents: t,
31
32
  SpaceCheckAction: o,
32
33
  SpaceActionTasks: r,
33
- SpaceFunctions: u,
34
+ SpaceData: l,
35
+ SpaceFunctions: d,
34
36
  SpaceConnectors: s,
35
37
  SpaceCredentials: c,
36
- SpaceVersionContents: g,
37
- SpaceVisitors: _,
38
- SpaceRuntime: h
38
+ SpaceVersionContents: _,
39
+ SpaceVisitors: v,
40
+ SpaceRuntime: g
39
41
  };
40
42
  //#endregion
41
- export { v as default };
43
+ export { y as default };
@@ -132,12 +132,12 @@ export declare const spaceEventSchemas: {
132
132
  componentType: z.ZodOptional<z.ZodString>;
133
133
  styleSelector: z.ZodOptional<z.ZodString>;
134
134
  styleState: z.ZodOptional<z.ZodEnum<{
135
+ disabled: "disabled";
135
136
  hover: "hover";
136
137
  focus: "focus";
137
138
  "focus-visible": "focus-visible";
138
139
  "focus-within": "focus-within";
139
140
  active: "active";
140
- disabled: "disabled";
141
141
  checked: "checked";
142
142
  visited: "visited";
143
143
  current: "current";
@@ -159,12 +159,12 @@ export declare const spaceEventSchemas: {
159
159
  params: z.ZodObject<{
160
160
  componentType: z.ZodOptional<z.ZodString>;
161
161
  styleState: z.ZodOptional<z.ZodEnum<{
162
+ disabled: "disabled";
162
163
  hover: "hover";
163
164
  focus: "focus";
164
165
  "focus-visible": "focus-visible";
165
166
  "focus-within": "focus-within";
166
167
  active: "active";
167
- disabled: "disabled";
168
168
  checked: "checked";
169
169
  visited: "visited";
170
170
  current: "current";
@@ -0,0 +1,26 @@
1
+ import { Plugin } from 'esbuild';
2
+ /**
3
+ * What a plugin's bundle carries INSIDE it, as data URIs: the images and fonts a library's stylesheet drags in (a map,
4
+ * a date picker, an editor). Inlined rather than emitted beside the bundle, because a plugin travels as its module and
5
+ * its stylesheet — through `plitzi pack`, an upload, a server's `copy` or `download` — and a third file nothing carries
6
+ * would leave a stylesheet with broken references in it.
7
+ *
8
+ * One list for every builder of a plugin (`plitzi pack`, a server compiling one), so a plugin that builds in one builds
9
+ * in the other.
10
+ */
11
+ export declare const PLUGIN_INLINED_ASSETS: readonly [".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".avif", ".woff", ".woff2", ".ttf", ".otf"];
12
+ /** `PLUGIN_INLINED_ASSETS` as esbuild's `loader` option takes it. */
13
+ export declare const pluginAssetLoaders: () => Record<string, "dataurl">;
14
+ /**
15
+ * A file a plugin needs whole, imported the way Vite imports it — so the same line works in a client-mode project's
16
+ * dev server and in every bundle built for a plugin:
17
+ *
18
+ * - `import source from 'maplibre-gl/dist/maplibre-gl-csp-worker.js?raw'` — the file's text: a library's worker, made
19
+ * with `URL.createObjectURL(new Blob([source], { type: 'text/javascript' }))`.
20
+ * - `import url from './engine.wasm?inline'` — the file as a data URI: a WebAssembly module, `fetch(url)` and instantiate.
21
+ *
22
+ * Both are carried inside the bundle, for the reason `PLUGIN_INLINED_ASSETS` is: a plugin travels as its module and its
23
+ * stylesheet. The cost is the bundle's size — right for a worker or a small module, wrong for a 20 MB model, which
24
+ * belongs on a CDN the plugin reads from.
25
+ */
26
+ export declare const pluginImportQueries: () => Plugin;
@@ -0,0 +1,62 @@
1
+ import e from "node:fs/promises";
2
+ import t from "node:path";
3
+ //#region src/plugins/bundle.ts
4
+ var n = [
5
+ ".png",
6
+ ".jpg",
7
+ ".jpeg",
8
+ ".gif",
9
+ ".svg",
10
+ ".webp",
11
+ ".avif",
12
+ ".woff",
13
+ ".woff2",
14
+ ".ttf",
15
+ ".otf"
16
+ ], r = () => Object.fromEntries(n.map((e) => [e, "dataurl"])), i = /\?(raw|inline)$/, a = {
17
+ ".wasm": "application/wasm",
18
+ ".js": "text/javascript",
19
+ ".mjs": "text/javascript",
20
+ ".json": "application/json",
21
+ ".css": "text/css",
22
+ ".svg": "image/svg+xml",
23
+ ".png": "image/png",
24
+ ".jpg": "image/jpeg",
25
+ ".jpeg": "image/jpeg",
26
+ ".webp": "image/webp",
27
+ ".woff2": "font/woff2"
28
+ }, o = () => ({
29
+ name: "plitzi-import-queries",
30
+ setup: (n) => {
31
+ n.onResolve({ filter: i }, async (e) => {
32
+ let t = i.exec(e.path)?.[1] ?? "raw", r = await n.resolve(e.path.replace(i, ""), {
33
+ kind: e.kind,
34
+ importer: e.importer,
35
+ resolveDir: e.resolveDir
36
+ });
37
+ return r.errors.length > 0 ? { errors: r.errors } : {
38
+ path: r.path,
39
+ namespace: `plitzi-${t}`
40
+ };
41
+ }), n.onLoad({
42
+ filter: /.*/,
43
+ namespace: "plitzi-raw"
44
+ }, async (t) => ({
45
+ contents: await e.readFile(t.path),
46
+ loader: "text",
47
+ watchFiles: [t.path]
48
+ })), n.onLoad({
49
+ filter: /.*/,
50
+ namespace: "plitzi-inline"
51
+ }, async (n) => {
52
+ let r = a[t.extname(n.path).toLowerCase()] ?? "application/octet-stream", i = (await e.readFile(n.path)).toString("base64");
53
+ return {
54
+ contents: `export default ${JSON.stringify(`data:${r};base64,${i}`)};`,
55
+ loader: "js",
56
+ watchFiles: [n.path]
57
+ };
58
+ });
59
+ }
60
+ });
61
+ //#endregion
62
+ export { n as PLUGIN_INLINED_ASSETS, r as pluginAssetLoaders, o as pluginImportQueries };
@@ -0,0 +1,12 @@
1
+ import { ComponentDefinition, PluginDeclaration } from '../types';
2
+ import { FC } from 'react';
3
+ /** A plugin as its bundle exports it: the component, with the declaration its `index.ts` assigned onto it. */
4
+ export type DeclaredPlugin = FC<never> & {
5
+ content?: ComponentDefinition;
6
+ version?: string;
7
+ initialItems?: string[];
8
+ plugins?: Record<string, DeclaredPlugin>;
9
+ };
10
+ export declare const pluginDeclarationOf: (plugin: DeclaredPlugin) => PluginDeclaration;
11
+ /** The element types a plugin registered under `type` renders: its own and its sub-plugins', at any depth. */
12
+ export declare const pluginTypesOf: (type: string, declaration: PluginDeclaration) => string[];
@@ -0,0 +1,9 @@
1
+ //#region src/plugins/declaration.ts
2
+ var e = (e) => typeof e == "object" && !!e && "$$typeof" in e, t = (t) => JSON.parse(JSON.stringify(t, (t, n) => typeof n == "function" || e(n) ? void 0 : n)), n = (e) => ({
3
+ ...e.content ? { content: t(e.content) } : {},
4
+ ...e.version ? { version: e.version } : {},
5
+ ...e.initialItems ? { initialItems: [...e.initialItems] } : {},
6
+ ...e.plugins ? { plugins: Object.fromEntries(Object.entries(e.plugins).map(([e, t]) => [e, n(t)])) } : {}
7
+ }), r = (e, t) => [e, ...Object.entries(t.plugins ?? {}).flatMap(([e, t]) => r(e, t))];
8
+ //#endregion
9
+ export { n as pluginDeclarationOf, r as pluginTypesOf };
@@ -100,6 +100,13 @@ export declare class QueryCache {
100
100
  fetchQuery<T>(key: string, options: QueryObserverOptions<T> & {
101
101
  gcTime?: number;
102
102
  }): Promise<T | undefined>;
103
+ /**
104
+ * Stops the request out for `key`: the answer it would have brought lands nowhere, and what is held stays on screen.
105
+ *
106
+ * What a STOP is — the visitor is done waiting. The query is left as it was before it asked, so the next reader, or
107
+ * the next `refetch`, asks again.
108
+ */
109
+ cancel(key: string): boolean;
103
110
  /** Asks again for `key` now, whatever the age of what is held — the explicit "reload this". */
104
111
  refetch(key: string): Promise<void>;
105
112
  /**
@@ -67,6 +67,13 @@ var t = 3e5, n = (e) => {
67
67
  let a = this.getEntry(e)?.data;
68
68
  return this.scheduleGc(n), a;
69
69
  }
70
+ cancel(e) {
71
+ let t = this.runtimes.get(n(e));
72
+ if (!t?.controller) return !1;
73
+ t.controller.abort(), t.controller = void 0, t.inFlight = void 0;
74
+ let i = r(e);
75
+ return this.getEntry(e) ? this.store.setState(`${i}.isFetching`, !1) : this.markUnasked(t), !0;
76
+ }
70
77
  refetch(e) {
71
78
  let t = this.runtimes.get(n(e));
72
79
  return t ? this.invalidateOne(t) : Promise.resolve();
@@ -121,10 +128,10 @@ var t = 3e5, n = (e) => {
121
128
  tags: o,
122
129
  isFetching: !0
123
130
  });
124
- let c = this.epochValue, l = e.version, u = (r) => {
125
- if (c !== this.epochValue || this.runtimes.get(n(i)) !== e) return Promise.resolve();
131
+ let c = this.epochValue, l = e.version, u = new AbortController(), d = (r) => {
132
+ if (c !== this.epochValue || this.runtimes.get(n(i)) !== e || e.controller !== u) return Promise.resolve();
126
133
  e.inFlight = void 0, e.controller = void 0;
127
- let u = l !== e.version;
134
+ let d = l !== e.version;
128
135
  if ("error" in r) {
129
136
  let e = this.getEntry(i);
130
137
  this.store.setState(s, {
@@ -136,7 +143,7 @@ var t = 3e5, n = (e) => {
136
143
  isFetching: !1
137
144
  }, { ttl: 0 });
138
145
  } else {
139
- let n = !u && (t.isCacheable?.(r.data) ?? !0);
146
+ let n = !d && (t.isCacheable?.(r.data) ?? !0);
140
147
  this.store.setState(s, {
141
148
  key: i,
142
149
  url: a,
@@ -145,9 +152,9 @@ var t = 3e5, n = (e) => {
145
152
  isFetching: !1
146
153
  }, { ttl: n ? this.ttlOf(e, t) : 0 });
147
154
  }
148
- return u ? this.fetchActive(e) : Promise.resolve();
149
- }, d = new AbortController();
150
- return e.controller = d, e.inFlight = t.fetcher(d.signal).then((e) => u({ data: e }), (e) => u({ error: e })), e.inFlight;
155
+ return d ? this.fetchActive(e) : Promise.resolve();
156
+ };
157
+ return e.controller = u, e.inFlight = t.fetcher(u.signal).then((e) => d({ data: e }), (e) => d({ error: e })), e.inFlight;
151
158
  }
152
159
  ttlOf(e, t) {
153
160
  let n = e.observers.size > 0 ? Infinity : t.staleTime;
@@ -18,6 +18,8 @@ export type UseQueryResult<T> = {
18
18
  /** Nothing to render with yet — as opposed to a refresh of something already on screen. */
19
19
  isLoading: boolean;
20
20
  refetch: () => void;
21
+ /** Stops the request out, if there is one: what is held stays, and nothing is asked until the next reader or refetch. */
22
+ cancel: () => void;
21
23
  };
22
24
  declare const useQuery: <T>({ key, meta, fetcher, enabled, staleTime, gcTime, isCacheable }: UseQueryOptions<T>) => UseQueryResult<T>;
23
25
  export default useQuery;
@@ -35,12 +35,15 @@ var { useStore: s } = o(), c = ({ key: o, meta: c, fetcher: l, enabled: u = !0,
35
35
  };
36
36
  let w = S ?? C.current?.data, T = (g?.isFetching ?? !1) || u && m && !_, E = r(() => {
37
37
  u && o !== void 0 && e.refetch(o);
38
- }, [u, o]);
38
+ }, [u, o]), D = r(() => {
39
+ o !== void 0 && e.cancel(o);
40
+ }, [o]);
39
41
  return {
40
42
  data: w,
41
43
  isFetching: T,
42
44
  isLoading: T && w === void 0,
43
- refetch: E
45
+ refetch: E,
46
+ cancel: D
44
47
  };
45
48
  };
46
49
  //#endregion