@powerhousedao/vetra-builder-package 0.0.20 → 0.0.21

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 (59) hide show
  1. package/dist/document-models/builder-team/gen/document-model.js +40 -18
  2. package/dist/document-models/builder-team/gen/packages/actions.d.ts +6 -2
  3. package/dist/document-models/builder-team/gen/packages/creators.d.ts +3 -2
  4. package/dist/document-models/builder-team/gen/packages/creators.js +1 -0
  5. package/dist/document-models/builder-team/gen/packages/object.d.ts +2 -1
  6. package/dist/document-models/builder-team/gen/packages/object.js +4 -1
  7. package/dist/document-models/builder-team/gen/packages/operations.d.ts +2 -1
  8. package/dist/document-models/builder-team/gen/reducer.js +8 -0
  9. package/dist/document-models/builder-team/gen/schema/types.d.ts +9 -14
  10. package/dist/document-models/builder-team/gen/schema/zod.d.ts +3 -1
  11. package/dist/document-models/builder-team/gen/schema/zod.js +13 -0
  12. package/dist/document-models/builder-team/gen/spaces/actions.d.ts +6 -2
  13. package/dist/document-models/builder-team/gen/spaces/creators.d.ts +3 -2
  14. package/dist/document-models/builder-team/gen/spaces/creators.js +1 -0
  15. package/dist/document-models/builder-team/gen/spaces/object.d.ts +2 -1
  16. package/dist/document-models/builder-team/gen/spaces/object.js +4 -1
  17. package/dist/document-models/builder-team/gen/spaces/operations.d.ts +2 -1
  18. package/dist/document-models/builder-team/index.d.ts +2 -0
  19. package/dist/document-models/builder-team/src/reducers/packages.js +21 -0
  20. package/dist/document-models/builder-team/src/reducers/spaces.js +16 -0
  21. package/dist/editors/builder-team-editor/components/MembersSection.d.ts +1 -6
  22. package/dist/editors/builder-team-editor/components/MembersSection.js +24 -88
  23. package/dist/editors/builder-team-editor/components/PackageForm.js +7 -75
  24. package/dist/editors/builder-team-editor/components/PackageItem.js +22 -83
  25. package/dist/editors/builder-team-editor/components/PackagesTable.d.ts +9 -0
  26. package/dist/editors/builder-team-editor/components/PackagesTable.js +80 -0
  27. package/dist/editors/builder-team-editor/components/ProfileSection.js +2 -2
  28. package/dist/editors/builder-team-editor/components/QuickStats.js +2 -1
  29. package/dist/editors/builder-team-editor/components/SpaceItem.d.ts +2 -1
  30. package/dist/editors/builder-team-editor/components/SpaceItem.js +4 -3
  31. package/dist/editors/builder-team-editor/components/SpacesSection.d.ts +3 -1
  32. package/dist/editors/builder-team-editor/components/SpacesSection.js +19 -3
  33. package/dist/editors/builder-team-editor/components/SpacesTable.d.ts +11 -0
  34. package/dist/editors/builder-team-editor/components/SpacesTable.js +71 -0
  35. package/dist/editors/builder-team-editor/config.d.ts +1 -0
  36. package/dist/editors/builder-team-editor/config.js +1 -0
  37. package/dist/editors/builder-team-editor/editor.js +7 -1
  38. package/dist/editors/builder-team-editor/hooks/usePackageHandlers.js +0 -1
  39. package/dist/editors/builder-team-editor/services/renown-api.d.ts +21 -0
  40. package/dist/editors/builder-team-editor/services/renown-api.js +63 -0
  41. package/dist/editors/builder-team-editor/services/vetra-api.d.ts +31 -0
  42. package/dist/editors/builder-team-editor/services/vetra-api.js +70 -0
  43. package/dist/editors/builder-team-editor/types/index.d.ts +33 -0
  44. package/dist/editors/builder-team-editor/types/index.js +1 -0
  45. package/dist/editors/builder-team-editor/utils/format.d.ts +7 -0
  46. package/dist/editors/builder-team-editor/utils/format.js +13 -0
  47. package/dist/editors/builder-team-editor/utils/graphql.d.ts +7 -0
  48. package/dist/editors/builder-team-editor/utils/graphql.js +55 -0
  49. package/dist/powerhouse.manifest.json +3 -3
  50. package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts +2 -0
  51. package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.js +65 -40
  52. package/dist/processors/vetra-builder-relational-db-processor/factory.js +0 -1
  53. package/dist/processors/vetra-builder-relational-db-processor/index.js +0 -1
  54. package/dist/style.css +74 -6
  55. package/dist/subgraphs/builder-team/resolvers.js +48 -4
  56. package/dist/subgraphs/builder-team/schema.js +21 -14
  57. package/dist/subgraphs/vetra-builders/resolvers.js +34 -11
  58. package/dist/subgraphs/vetra-builders/schema.js +2 -14
  59. package/package.json +1 -1
@@ -12,7 +12,7 @@ export const documentModel = {
12
12
  changeLog: [],
13
13
  modules: [
14
14
  {
15
- description: "",
15
+ description: "Builder profile management",
16
16
  id: "84f613e9-80e1-4ee5-bf56-b916e1780845",
17
17
  name: "profile",
18
18
  operations: [
@@ -23,7 +23,7 @@ export const documentModel = {
23
23
  id: "edbdc847-a0d0-40cb-a7cb-c057039e05da",
24
24
  name: "SET_LOGO",
25
25
  reducer: "",
26
- schema: 'input SetLogoInput {\n "Add your inputs here"\n logo: String\n}',
26
+ schema: "input SetLogoInput {\n logo: String\n}",
27
27
  scope: "global",
28
28
  template: "",
29
29
  },
@@ -34,7 +34,7 @@ export const documentModel = {
34
34
  id: "6e0cb4ac-7e9a-4bd7-9310-556a171e2ec0",
35
35
  name: "SET_TEAM_NAME",
36
36
  reducer: "",
37
- schema: 'input SetTeamNameInput {\n "Add your inputs here"\n name: String!\n}',
37
+ schema: "input SetTeamNameInput {\n name: String!\n}",
38
38
  scope: "global",
39
39
  template: "",
40
40
  },
@@ -45,7 +45,7 @@ export const documentModel = {
45
45
  id: "41bc16d9-0d52-4329-b6ca-2d9378c167fb",
46
46
  name: "SET_SLUG",
47
47
  reducer: "",
48
- schema: 'input SetSlugInput {\n "Add your inputs here"\n slug: String!\n}',
48
+ schema: "input SetSlugInput {\n slug: String!\n}",
49
49
  scope: "global",
50
50
  template: "",
51
51
  },
@@ -56,7 +56,7 @@ export const documentModel = {
56
56
  id: "a4ca6f24-1f77-48dc-a8c4-8d9782aaf05f",
57
57
  name: "SET_DESCRIPTION",
58
58
  reducer: "",
59
- schema: 'input SetDescriptionInput {\n "Add your inputs here"\n description: String\n}',
59
+ schema: "input SetDescriptionInput {\n description: String\n}",
60
60
  scope: "global",
61
61
  template: "",
62
62
  },
@@ -67,14 +67,14 @@ export const documentModel = {
67
67
  id: "6389d9b4-2738-4831-9cdb-4ac6f8c32c5f",
68
68
  name: "SET_SOCIALS",
69
69
  reducer: "",
70
- schema: 'input SetSocialsInput {\n "Add your inputs here"\n xProfile: String\n github: String\n website: String\n \n}',
70
+ schema: "input SetSocialsInput {\n xProfile: String\n github: String\n website: String\n}",
71
71
  scope: "global",
72
72
  template: "",
73
73
  },
74
74
  ],
75
75
  },
76
76
  {
77
- description: "",
77
+ description: "Team member management",
78
78
  id: "46f730e9-506a-4e3e-b9af-d5715882e0b9",
79
79
  name: "member",
80
80
  operations: [
@@ -85,7 +85,7 @@ export const documentModel = {
85
85
  id: "029cb62f-d647-427b-9334-64d96e5eb407",
86
86
  name: "ADD_MEMBER",
87
87
  reducer: "",
88
- schema: 'input AddMemberInput {\n "Add your inputs here"\n id: OID!\n}',
88
+ schema: "input AddMemberInput {\n id: OID!\n}",
89
89
  scope: "global",
90
90
  template: "",
91
91
  },
@@ -96,7 +96,7 @@ export const documentModel = {
96
96
  id: "696fe1ed-4570-4e99-9c4a-34a21d909035",
97
97
  name: "UPDATE_MEMBER_INFO",
98
98
  reducer: "",
99
- schema: 'input UpdateMemberInfoInput {\n "Add your inputs here"\n id: OID!\n phid: PHID\n ethAddress: String\n name: String\n profileImage: String\n}',
99
+ schema: "input UpdateMemberInfoInput {\n id: OID!\n phid: PHID\n ethAddress: String\n name: String\n profileImage: String\n}",
100
100
  scope: "global",
101
101
  template: "",
102
102
  },
@@ -107,14 +107,14 @@ export const documentModel = {
107
107
  id: "30ba9a40-a80c-4c4d-8190-5a67ff9dcf95",
108
108
  name: "REMOVE_MEMBER",
109
109
  reducer: "",
110
- schema: 'input RemoveMemberInput {\n "Add your inputs here"\n id: OID!\n}',
110
+ schema: "input RemoveMemberInput {\n id: OID!\n}",
111
111
  scope: "global",
112
112
  template: "",
113
113
  },
114
114
  ],
115
115
  },
116
116
  {
117
- description: "",
117
+ description: "Workspace management",
118
118
  id: "d3d7b51b-6ca4-4f16-a421-a744e81e7f42",
119
119
  name: "spaces",
120
120
  operations: [
@@ -125,7 +125,7 @@ export const documentModel = {
125
125
  id: "9c5d57ab-bf7d-43d9-bb6d-3d29a59ee70c",
126
126
  name: "ADD_SPACE",
127
127
  reducer: "",
128
- schema: 'input AddSpaceInput {\n "Add your inputs here"\n id: OID!\n}',
128
+ schema: "input AddSpaceInput {\n id: OID!\n}",
129
129
  scope: "global",
130
130
  template: "",
131
131
  },
@@ -136,7 +136,7 @@ export const documentModel = {
136
136
  id: "7a19ff1c-7d41-4d6c-9cdb-2a300a523cd0",
137
137
  name: "UPDATE_SPACE_INFO",
138
138
  reducer: "",
139
- schema: 'input UpdateSpaceInfoInput {\n "Add your inputs here"\n id: OID!\n title: String\n description: String\n}',
139
+ schema: "input UpdateSpaceInfoInput {\n id: OID!\n title: String\n description: String\n}",
140
140
  scope: "global",
141
141
  template: "",
142
142
  },
@@ -147,14 +147,25 @@ export const documentModel = {
147
147
  id: "2bea7ddb-ce86-46df-a76b-69d8283ff810",
148
148
  name: "REMOVE_SPACE",
149
149
  reducer: "",
150
- schema: 'input RemoveSpaceInput {\n "Add your inputs here"\n id: OID!\n}',
150
+ schema: "input RemoveSpaceInput {\n id: OID!\n}",
151
151
  scope: "global",
152
152
  template: "",
153
153
  },
154
+ {
155
+ description: "Reorders the spaces array based on provided order",
156
+ errors: [],
157
+ examples: [],
158
+ id: "b3c8e4f2-1a5d-4e9b-8f2a-3d4c5e6f7a8b",
159
+ name: "REORDER_SPACES",
160
+ reducer: "const { spaceIds, targetIndex } = action.input;\n\n// Find the spaces to move\nconst spacesToMove = state.spaces.filter(space => spaceIds.includes(space.id));\nconst remainingSpaces = state.spaces.filter(space => !spaceIds.includes(space.id));\n\n// Insert the spaces at the target index\nremainingSpaces.splice(targetIndex, 0, ...spacesToMove);\nstate.spaces = remainingSpaces;",
161
+ schema: "input ReorderSpacesInput {\n spaceIds: [OID!]!\n targetIndex: Int!\n}",
162
+ scope: "global",
163
+ template: "Reorders the spaces array based on provided order",
164
+ },
154
165
  ],
155
166
  },
156
167
  {
157
- description: "",
168
+ description: "Package management",
158
169
  id: "a42429b5-bf95-4948-b730-dd644bdae5cb",
159
170
  name: "packages",
160
171
  operations: [
@@ -165,7 +176,7 @@ export const documentModel = {
165
176
  id: "a9a26a27-0774-4858-8fc6-750fbf11648a",
166
177
  name: "ADD_PACKAGE",
167
178
  reducer: "",
168
- schema: 'input AddPackageInput {\n "Add your inputs here"\n id: OID!\n spaceId: OID!\n}',
179
+ schema: "input AddPackageInput {\n id: OID!\n spaceId: OID!\n}",
169
180
  scope: "global",
170
181
  template: "",
171
182
  },
@@ -176,7 +187,7 @@ export const documentModel = {
176
187
  id: "327caf73-0e96-47da-aa58-7d90b89c38b6",
177
188
  name: "UPDATE_PACKAGE_INFO",
178
189
  reducer: "",
179
- schema: 'input UpdatePackageInfoInput {\n "Add your inputs here"\n id: OID!\n spaceId: OID\n phid: PHID\n title: String\n description: String\n github: String\n npm: String\n vetraDriveUrl: URL\n}',
190
+ schema: "input UpdatePackageInfoInput {\n id: OID!\n spaceId: OID\n phid: PHID\n title: String\n description: String\n github: String\n npm: String\n vetraDriveUrl: URL\n}",
180
191
  scope: "global",
181
192
  template: "",
182
193
  },
@@ -187,10 +198,21 @@ export const documentModel = {
187
198
  id: "ff08908f-3754-4154-acdd-0f280129f07d",
188
199
  name: "REMOVE_PACKAGE",
189
200
  reducer: "",
190
- schema: 'input RemovePackageInput {\n "Add your inputs here"\n id: OID!\n}',
201
+ schema: "input RemovePackageInput {\n id: OID!\n}",
191
202
  scope: "global",
192
203
  template: "",
193
204
  },
205
+ {
206
+ description: "Reorders the packages array within a space based on provided order",
207
+ errors: [],
208
+ examples: [],
209
+ id: "c7d9e8f3-2b6a-4f1c-9a3d-4e5f6a7b8c9d",
210
+ name: "REORDER_PACKAGES",
211
+ reducer: "const { spaceId, packageIds, targetIndex } = action.input;\n\n// Find the space\nconst space = state.spaces.find(s => s.id === spaceId);\nif (!space) {\n return;\n}\n\n// Find the packages to move\nconst packagesToMove = space.packages.filter(pkg => packageIds.includes(pkg.id));\nconst remainingPackages = space.packages.filter(pkg => !packageIds.includes(pkg.id));\n\n// Insert the packages at the target index\nremainingPackages.splice(targetIndex, 0, ...packagesToMove);\nspace.packages = remainingPackages;",
212
+ schema: "input ReorderPackagesInput {\n spaceId: OID!\n packageIds: [OID!]!\n targetIndex: Int!\n}",
213
+ scope: "global",
214
+ template: "Reorders the packages array within a space based on provided order",
215
+ },
194
216
  ],
195
217
  },
196
218
  ],
@@ -1,5 +1,5 @@
1
1
  import { type Action } from "document-model";
2
- import type { AddPackageInput, UpdatePackageInfoInput, RemovePackageInput } from "../types.js";
2
+ import type { AddPackageInput, UpdatePackageInfoInput, RemovePackageInput, ReorderPackagesInput } from "../types.js";
3
3
  export type AddPackageAction = Action & {
4
4
  type: "ADD_PACKAGE";
5
5
  input: AddPackageInput;
@@ -12,4 +12,8 @@ export type RemovePackageAction = Action & {
12
12
  type: "REMOVE_PACKAGE";
13
13
  input: RemovePackageInput;
14
14
  };
15
- export type BuilderTeamPackagesAction = AddPackageAction | UpdatePackageInfoAction | RemovePackageAction;
15
+ export type ReorderPackagesAction = Action & {
16
+ type: "REORDER_PACKAGES";
17
+ input: ReorderPackagesInput;
18
+ };
19
+ export type BuilderTeamPackagesAction = AddPackageAction | UpdatePackageInfoAction | RemovePackageAction | ReorderPackagesAction;
@@ -1,5 +1,6 @@
1
- import { type AddPackageInput, type UpdatePackageInfoInput, type RemovePackageInput } from "../types.js";
2
- import { type AddPackageAction, type UpdatePackageInfoAction, type RemovePackageAction } from "./actions.js";
1
+ import { type AddPackageInput, type UpdatePackageInfoInput, type RemovePackageInput, type ReorderPackagesInput } from "../types.js";
2
+ import { type AddPackageAction, type UpdatePackageInfoAction, type RemovePackageAction, type ReorderPackagesAction } from "./actions.js";
3
3
  export declare const addPackage: (input: AddPackageInput) => AddPackageAction;
4
4
  export declare const updatePackageInfo: (input: UpdatePackageInfoInput) => UpdatePackageInfoAction;
5
5
  export declare const removePackage: (input: RemovePackageInput) => RemovePackageAction;
6
+ export declare const reorderPackages: (input: ReorderPackagesInput) => ReorderPackagesAction;
@@ -3,3 +3,4 @@ import { z, } from "../types.js";
3
3
  export const addPackage = (input) => createAction("ADD_PACKAGE", { ...input }, undefined, z.AddPackageInputSchema, "global");
4
4
  export const updatePackageInfo = (input) => createAction("UPDATE_PACKAGE_INFO", { ...input }, undefined, z.UpdatePackageInfoInputSchema, "global");
5
5
  export const removePackage = (input) => createAction("REMOVE_PACKAGE", { ...input }, undefined, z.RemovePackageInputSchema, "global");
6
+ export const reorderPackages = (input) => createAction("REORDER_PACKAGES", { ...input }, undefined, z.ReorderPackagesInputSchema, "global");
@@ -1,8 +1,9 @@
1
1
  import { BaseDocumentClass } from "document-model";
2
2
  import { type BuilderTeamPHState } from "../ph-factories.js";
3
- import { type AddPackageInput, type UpdatePackageInfoInput, type RemovePackageInput } from "../types.js";
3
+ import { type AddPackageInput, type UpdatePackageInfoInput, type RemovePackageInput, type ReorderPackagesInput } from "../types.js";
4
4
  export default class BuilderTeam_Packages extends BaseDocumentClass<BuilderTeamPHState> {
5
5
  addPackage(input: AddPackageInput): this;
6
6
  updatePackageInfo(input: UpdatePackageInfoInput): this;
7
7
  removePackage(input: RemovePackageInput): this;
8
+ reorderPackages(input: ReorderPackagesInput): this;
8
9
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseDocumentClass } from "document-model";
2
- import { addPackage, updatePackageInfo, removePackage } from "./creators.js";
2
+ import { addPackage, updatePackageInfo, removePackage, reorderPackages, } from "./creators.js";
3
3
  export default class BuilderTeam_Packages extends BaseDocumentClass {
4
4
  addPackage(input) {
5
5
  return this.dispatch(addPackage(input));
@@ -10,4 +10,7 @@ export default class BuilderTeam_Packages extends BaseDocumentClass {
10
10
  removePackage(input) {
11
11
  return this.dispatch(removePackage(input));
12
12
  }
13
+ reorderPackages(input) {
14
+ return this.dispatch(reorderPackages(input));
15
+ }
13
16
  }
@@ -1,8 +1,9 @@
1
1
  import { type SignalDispatch } from "document-model";
2
- import { type AddPackageAction, type UpdatePackageInfoAction, type RemovePackageAction } from "./actions.js";
2
+ import { type AddPackageAction, type UpdatePackageInfoAction, type RemovePackageAction, type ReorderPackagesAction } from "./actions.js";
3
3
  import { type BuilderTeamState } from "../types.js";
4
4
  export interface BuilderTeamPackagesOperations {
5
5
  addPackageOperation: (state: BuilderTeamState, action: AddPackageAction, dispatch?: SignalDispatch) => void;
6
6
  updatePackageInfoOperation: (state: BuilderTeamState, action: UpdatePackageInfoAction, dispatch?: SignalDispatch) => void;
7
7
  removePackageOperation: (state: BuilderTeamState, action: RemovePackageAction, dispatch?: SignalDispatch) => void;
8
+ reorderPackagesOperation: (state: BuilderTeamState, action: ReorderPackagesAction, dispatch?: SignalDispatch) => void;
8
9
  }
@@ -56,6 +56,10 @@ export const stateReducer = (state, action, dispatch) => {
56
56
  z.RemoveSpaceInputSchema().parse(action.input);
57
57
  SpacesReducer.removeSpaceOperation(state[action.scope], action, dispatch);
58
58
  break;
59
+ case "REORDER_SPACES":
60
+ z.ReorderSpacesInputSchema().parse(action.input);
61
+ SpacesReducer.reorderSpacesOperation(state[action.scope], action, dispatch);
62
+ break;
59
63
  case "ADD_PACKAGE":
60
64
  z.AddPackageInputSchema().parse(action.input);
61
65
  PackagesReducer.addPackageOperation(state[action.scope], action, dispatch);
@@ -68,6 +72,10 @@ export const stateReducer = (state, action, dispatch) => {
68
72
  z.RemovePackageInputSchema().parse(action.input);
69
73
  PackagesReducer.removePackageOperation(state[action.scope], action, dispatch);
70
74
  break;
75
+ case "REORDER_PACKAGES":
76
+ z.ReorderPackagesInputSchema().parse(action.input);
77
+ PackagesReducer.reorderPackagesOperation(state[action.scope], action, dispatch);
78
+ break;
71
79
  default:
72
80
  return state;
73
81
  }
@@ -135,16 +135,13 @@ export type Scalars = {
135
135
  };
136
136
  };
137
137
  export type AddMemberInput = {
138
- /** Add your inputs here */
139
138
  id: Scalars["OID"]["input"];
140
139
  };
141
140
  export type AddPackageInput = {
142
- /** Add your inputs here */
143
141
  id: Scalars["OID"]["input"];
144
142
  spaceId: Scalars["OID"]["input"];
145
143
  };
146
144
  export type AddSpaceInput = {
147
- /** Add your inputs here */
148
145
  id: Scalars["OID"]["input"];
149
146
  };
150
147
  export type BuilderTeamState = {
@@ -153,15 +150,12 @@ export type BuilderTeamState = {
153
150
  spaces: Array<VetraBuilderSpace>;
154
151
  };
155
152
  export type RemoveMemberInput = {
156
- /** Add your inputs here */
157
153
  id: Scalars["OID"]["input"];
158
154
  };
159
155
  export type RemovePackageInput = {
160
- /** Add your inputs here */
161
156
  id: Scalars["OID"]["input"];
162
157
  };
163
158
  export type RemoveSpaceInput = {
164
- /** Add your inputs here */
165
159
  id: Scalars["OID"]["input"];
166
160
  };
167
161
  export type RenownProfileInfo = {
@@ -171,31 +165,34 @@ export type RenownProfileInfo = {
171
165
  phid: Maybe<Scalars["PHID"]["output"]>;
172
166
  profileImage: Maybe<Scalars["String"]["output"]>;
173
167
  };
168
+ export type ReorderPackagesInput = {
169
+ packageIds: Array<Scalars["OID"]["input"]>;
170
+ spaceId: Scalars["OID"]["input"];
171
+ targetIndex: Scalars["Int"]["input"];
172
+ };
173
+ export type ReorderSpacesInput = {
174
+ spaceIds: Array<Scalars["OID"]["input"]>;
175
+ targetIndex: Scalars["Int"]["input"];
176
+ };
174
177
  export type SetDescriptionInput = {
175
- /** Add your inputs here */
176
178
  description?: InputMaybe<Scalars["String"]["input"]>;
177
179
  };
178
180
  export type SetLogoInput = {
179
- /** Add your inputs here */
180
181
  logo?: InputMaybe<Scalars["String"]["input"]>;
181
182
  };
182
183
  export type SetSlugInput = {
183
- /** Add your inputs here */
184
184
  slug: Scalars["String"]["input"];
185
185
  };
186
186
  export type SetSocialsInput = {
187
187
  github?: InputMaybe<Scalars["String"]["input"]>;
188
188
  website?: InputMaybe<Scalars["String"]["input"]>;
189
- /** Add your inputs here */
190
189
  xProfile?: InputMaybe<Scalars["String"]["input"]>;
191
190
  };
192
191
  export type SetTeamNameInput = {
193
- /** Add your inputs here */
194
192
  name: Scalars["String"]["input"];
195
193
  };
196
194
  export type UpdateMemberInfoInput = {
197
195
  ethAddress?: InputMaybe<Scalars["String"]["input"]>;
198
- /** Add your inputs here */
199
196
  id: Scalars["OID"]["input"];
200
197
  name?: InputMaybe<Scalars["String"]["input"]>;
201
198
  phid?: InputMaybe<Scalars["PHID"]["input"]>;
@@ -204,7 +201,6 @@ export type UpdateMemberInfoInput = {
204
201
  export type UpdatePackageInfoInput = {
205
202
  description?: InputMaybe<Scalars["String"]["input"]>;
206
203
  github?: InputMaybe<Scalars["String"]["input"]>;
207
- /** Add your inputs here */
208
204
  id: Scalars["OID"]["input"];
209
205
  npm?: InputMaybe<Scalars["String"]["input"]>;
210
206
  phid?: InputMaybe<Scalars["PHID"]["input"]>;
@@ -214,7 +210,6 @@ export type UpdatePackageInfoInput = {
214
210
  };
215
211
  export type UpdateSpaceInfoInput = {
216
212
  description?: InputMaybe<Scalars["String"]["input"]>;
217
- /** Add your inputs here */
218
213
  id: Scalars["OID"]["input"];
219
214
  title?: InputMaybe<Scalars["String"]["input"]>;
220
215
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { AddMemberInput, AddPackageInput, AddSpaceInput, BuilderTeamState, RemoveMemberInput, RemovePackageInput, RemoveSpaceInput, RenownProfileInfo, SetDescriptionInput, SetLogoInput, SetSlugInput, SetSocialsInput, SetTeamNameInput, UpdateMemberInfoInput, UpdatePackageInfoInput, UpdateSpaceInfoInput, VetraBuilderProfile, VetraBuilderSocials, VetraBuilderSpace, VetraPackageInfo } from "./types.js";
2
+ import type { AddMemberInput, AddPackageInput, AddSpaceInput, BuilderTeamState, RemoveMemberInput, RemovePackageInput, RemoveSpaceInput, RenownProfileInfo, ReorderPackagesInput, ReorderSpacesInput, SetDescriptionInput, SetLogoInput, SetSlugInput, SetSocialsInput, SetTeamNameInput, UpdateMemberInfoInput, UpdatePackageInfoInput, UpdateSpaceInfoInput, VetraBuilderProfile, VetraBuilderSocials, VetraBuilderSpace, VetraPackageInfo } from "./types.js";
3
3
  type Properties<T> = Required<{
4
4
  [K in keyof T]: z.ZodType<T[K], any, T[K]>;
5
5
  }>;
@@ -14,6 +14,8 @@ export declare function RemoveMemberInputSchema(): z.ZodObject<Properties<Remove
14
14
  export declare function RemovePackageInputSchema(): z.ZodObject<Properties<RemovePackageInput>>;
15
15
  export declare function RemoveSpaceInputSchema(): z.ZodObject<Properties<RemoveSpaceInput>>;
16
16
  export declare function RenownProfileInfoSchema(): z.ZodObject<Properties<RenownProfileInfo>>;
17
+ export declare function ReorderPackagesInputSchema(): z.ZodObject<Properties<ReorderPackagesInput>>;
18
+ export declare function ReorderSpacesInputSchema(): z.ZodObject<Properties<ReorderSpacesInput>>;
17
19
  export declare function SetDescriptionInputSchema(): z.ZodObject<Properties<SetDescriptionInput>>;
18
20
  export declare function SetLogoInputSchema(): z.ZodObject<Properties<SetLogoInput>>;
19
21
  export declare function SetSlugInputSchema(): z.ZodObject<Properties<SetSlugInput>>;
@@ -52,6 +52,19 @@ export function RenownProfileInfoSchema() {
52
52
  profileImage: z.string().nullable(),
53
53
  });
54
54
  }
55
+ export function ReorderPackagesInputSchema() {
56
+ return z.object({
57
+ packageIds: z.array(z.string()),
58
+ spaceId: z.string(),
59
+ targetIndex: z.number(),
60
+ });
61
+ }
62
+ export function ReorderSpacesInputSchema() {
63
+ return z.object({
64
+ spaceIds: z.array(z.string()),
65
+ targetIndex: z.number(),
66
+ });
67
+ }
55
68
  export function SetDescriptionInputSchema() {
56
69
  return z.object({
57
70
  description: z.string().nullish(),
@@ -1,5 +1,5 @@
1
1
  import { type Action } from "document-model";
2
- import type { AddSpaceInput, UpdateSpaceInfoInput, RemoveSpaceInput } from "../types.js";
2
+ import type { AddSpaceInput, UpdateSpaceInfoInput, RemoveSpaceInput, ReorderSpacesInput } from "../types.js";
3
3
  export type AddSpaceAction = Action & {
4
4
  type: "ADD_SPACE";
5
5
  input: AddSpaceInput;
@@ -12,4 +12,8 @@ export type RemoveSpaceAction = Action & {
12
12
  type: "REMOVE_SPACE";
13
13
  input: RemoveSpaceInput;
14
14
  };
15
- export type BuilderTeamSpacesAction = AddSpaceAction | UpdateSpaceInfoAction | RemoveSpaceAction;
15
+ export type ReorderSpacesAction = Action & {
16
+ type: "REORDER_SPACES";
17
+ input: ReorderSpacesInput;
18
+ };
19
+ export type BuilderTeamSpacesAction = AddSpaceAction | UpdateSpaceInfoAction | RemoveSpaceAction | ReorderSpacesAction;
@@ -1,5 +1,6 @@
1
- import { type AddSpaceInput, type UpdateSpaceInfoInput, type RemoveSpaceInput } from "../types.js";
2
- import { type AddSpaceAction, type UpdateSpaceInfoAction, type RemoveSpaceAction } from "./actions.js";
1
+ import { type AddSpaceInput, type UpdateSpaceInfoInput, type RemoveSpaceInput, type ReorderSpacesInput } from "../types.js";
2
+ import { type AddSpaceAction, type UpdateSpaceInfoAction, type RemoveSpaceAction, type ReorderSpacesAction } from "./actions.js";
3
3
  export declare const addSpace: (input: AddSpaceInput) => AddSpaceAction;
4
4
  export declare const updateSpaceInfo: (input: UpdateSpaceInfoInput) => UpdateSpaceInfoAction;
5
5
  export declare const removeSpace: (input: RemoveSpaceInput) => RemoveSpaceAction;
6
+ export declare const reorderSpaces: (input: ReorderSpacesInput) => ReorderSpacesAction;
@@ -3,3 +3,4 @@ import { z, } from "../types.js";
3
3
  export const addSpace = (input) => createAction("ADD_SPACE", { ...input }, undefined, z.AddSpaceInputSchema, "global");
4
4
  export const updateSpaceInfo = (input) => createAction("UPDATE_SPACE_INFO", { ...input }, undefined, z.UpdateSpaceInfoInputSchema, "global");
5
5
  export const removeSpace = (input) => createAction("REMOVE_SPACE", { ...input }, undefined, z.RemoveSpaceInputSchema, "global");
6
+ export const reorderSpaces = (input) => createAction("REORDER_SPACES", { ...input }, undefined, z.ReorderSpacesInputSchema, "global");
@@ -1,8 +1,9 @@
1
1
  import { BaseDocumentClass } from "document-model";
2
2
  import { type BuilderTeamPHState } from "../ph-factories.js";
3
- import { type AddSpaceInput, type UpdateSpaceInfoInput, type RemoveSpaceInput } from "../types.js";
3
+ import { type AddSpaceInput, type UpdateSpaceInfoInput, type RemoveSpaceInput, type ReorderSpacesInput } from "../types.js";
4
4
  export default class BuilderTeam_Spaces extends BaseDocumentClass<BuilderTeamPHState> {
5
5
  addSpace(input: AddSpaceInput): this;
6
6
  updateSpaceInfo(input: UpdateSpaceInfoInput): this;
7
7
  removeSpace(input: RemoveSpaceInput): this;
8
+ reorderSpaces(input: ReorderSpacesInput): this;
8
9
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseDocumentClass } from "document-model";
2
- import { addSpace, updateSpaceInfo, removeSpace } from "./creators.js";
2
+ import { addSpace, updateSpaceInfo, removeSpace, reorderSpaces, } from "./creators.js";
3
3
  export default class BuilderTeam_Spaces extends BaseDocumentClass {
4
4
  addSpace(input) {
5
5
  return this.dispatch(addSpace(input));
@@ -10,4 +10,7 @@ export default class BuilderTeam_Spaces extends BaseDocumentClass {
10
10
  removeSpace(input) {
11
11
  return this.dispatch(removeSpace(input));
12
12
  }
13
+ reorderSpaces(input) {
14
+ return this.dispatch(reorderSpaces(input));
15
+ }
13
16
  }
@@ -1,8 +1,9 @@
1
1
  import { type SignalDispatch } from "document-model";
2
- import { type AddSpaceAction, type UpdateSpaceInfoAction, type RemoveSpaceAction } from "./actions.js";
2
+ import { type AddSpaceAction, type UpdateSpaceInfoAction, type RemoveSpaceAction, type ReorderSpacesAction } from "./actions.js";
3
3
  import { type BuilderTeamState } from "../types.js";
4
4
  export interface BuilderTeamSpacesOperations {
5
5
  addSpaceOperation: (state: BuilderTeamState, action: AddSpaceAction, dispatch?: SignalDispatch) => void;
6
6
  updateSpaceInfoOperation: (state: BuilderTeamState, action: UpdateSpaceInfoAction, dispatch?: SignalDispatch) => void;
7
7
  removeSpaceOperation: (state: BuilderTeamState, action: RemoveSpaceAction, dispatch?: SignalDispatch) => void;
8
+ reorderSpacesOperation: (state: BuilderTeamState, action: ReorderSpacesAction, dispatch?: SignalDispatch) => void;
8
9
  }
@@ -27,9 +27,11 @@ declare const actions: {
27
27
  addSpace: (input: import("./index.js").AddSpaceInput) => import("./gen/actions.js").AddSpaceAction;
28
28
  updateSpaceInfo: (input: import("./index.js").UpdateSpaceInfoInput) => import("./gen/actions.js").UpdateSpaceInfoAction;
29
29
  removeSpace: (input: import("./index.js").RemoveSpaceInput) => import("./gen/actions.js").RemoveSpaceAction;
30
+ reorderSpaces: (input: import("./index.js").ReorderSpacesInput) => import("./gen/actions.js").ReorderSpacesAction;
30
31
  addPackage: (input: import("./index.js").AddPackageInput) => import("./gen/actions.js").AddPackageAction;
31
32
  updatePackageInfo: (input: import("./index.js").UpdatePackageInfoInput) => import("./gen/actions.js").UpdatePackageInfoAction;
32
33
  removePackage: (input: import("./index.js").RemovePackageInput) => import("./gen/actions.js").RemovePackageAction;
34
+ reorderPackages: (input: import("./index.js").ReorderPackagesInput) => import("./gen/actions.js").ReorderPackagesAction;
33
35
  };
34
36
  export declare const module: DocumentModelModule<BuilderTeamPHState>;
35
37
  export { reducer, actions, utils, documentModel };
@@ -4,6 +4,8 @@ export const reducer = {
4
4
  if (!space) {
5
5
  return;
6
6
  }
7
+ // Assign sortOrder as the next index
8
+ const sortOrder = space.packages.length;
7
9
  const newPackage = {
8
10
  ...action.input,
9
11
  id: action.input.id,
@@ -13,6 +15,7 @@ export const reducer = {
13
15
  github: null,
14
16
  npm: null,
15
17
  vetraDriveUrl: null,
18
+ sortOrder,
16
19
  };
17
20
  space.packages.push(newPackage);
18
21
  },
@@ -37,4 +40,22 @@ export const reducer = {
37
40
  }
38
41
  state.spaces[spaceIndex].packages = state.spaces[spaceIndex].packages.filter((p) => p.id !== action.input.id);
39
42
  },
43
+ reorderPackagesOperation(state, action, dispatch) {
44
+ const { spaceId, packageIds, targetIndex } = action.input;
45
+ // Find the space
46
+ const space = state.spaces.find(s => s.id === spaceId);
47
+ if (!space) {
48
+ return;
49
+ }
50
+ // Find the packages to move
51
+ const packagesToMove = space.packages.filter(pkg => packageIds.includes(pkg.id));
52
+ const remainingPackages = space.packages.filter(pkg => !packageIds.includes(pkg.id));
53
+ // Insert the packages at the target index
54
+ remainingPackages.splice(targetIndex, 0, ...packagesToMove);
55
+ space.packages = remainingPackages;
56
+ // Update sortOrder for all packages
57
+ space.packages.forEach((pkg, index) => {
58
+ pkg.sortOrder = index;
59
+ });
60
+ },
40
61
  };
@@ -4,11 +4,14 @@ export const reducer = {
4
4
  if (state.spaces.find((space) => space.id === id)) {
5
5
  return;
6
6
  }
7
+ // Assign sortOrder as the next index
8
+ const sortOrder = state.spaces.length;
7
9
  state.spaces.push({
8
10
  id,
9
11
  title: "",
10
12
  description: "",
11
13
  packages: [],
14
+ sortOrder,
12
15
  });
13
16
  },
14
17
  updateSpaceInfoOperation(state, action, dispatch) {
@@ -31,4 +34,17 @@ export const reducer = {
31
34
  }
32
35
  state.spaces.splice(spaceIndex, 1);
33
36
  },
37
+ reorderSpacesOperation(state, action, dispatch) {
38
+ const { spaceIds, targetIndex } = action.input;
39
+ // Find the spaces to move
40
+ const spacesToMove = state.spaces.filter(space => spaceIds.includes(space.id));
41
+ const remainingSpaces = state.spaces.filter(space => !spaceIds.includes(space.id));
42
+ // Insert the spaces at the target index
43
+ remainingSpaces.splice(targetIndex, 0, ...spacesToMove);
44
+ state.spaces = remainingSpaces;
45
+ // Update sortOrder for all spaces
46
+ state.spaces.forEach((space, index) => {
47
+ space.sortOrder = index;
48
+ });
49
+ },
34
50
  };
@@ -1,10 +1,5 @@
1
1
  import type { BuilderTeamDocument } from "../../../document-models/builder-team/index.js";
2
- interface MemberProfileData {
3
- phid: string;
4
- ethAddress: string;
5
- name: string;
6
- profileImage?: string;
7
- }
2
+ import type { MemberProfileData } from "../types/index.js";
8
3
  interface MembersSectionProps {
9
4
  members: BuilderTeamDocument["state"]["global"]["members"];
10
5
  onAddMember: (profileData: MemberProfileData) => boolean;