@powerhousedao/builder-profile 0.0.6 → 0.0.8
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.
- package/dist/document-models/builder-profile/gen/document-schema.d.ts +64 -64
- package/dist/document-models/builder-profile/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/schema/types.d.ts +10 -10
- package/dist/document-models/builder-profile/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/document-models.d.ts.map +1 -1
- package/dist/document-models/document-models.js +1 -3
- package/dist/editors/builder-profile/components/ContributorsSection.d.ts.map +1 -1
- package/dist/editors/builder-profile/components/ContributorsSection.js +141 -32
- package/dist/editors/builder-profile/hooks/useRemoteBuilderProfiles.d.ts +20 -0
- package/dist/editors/builder-profile/hooks/useRemoteBuilderProfiles.d.ts.map +1 -0
- package/dist/editors/builder-profile/hooks/useRemoteBuilderProfiles.js +57 -0
- package/dist/editors/builder-profile/utils/graphql-client.d.ts +41 -0
- package/dist/editors/builder-profile/utils/graphql-client.d.ts.map +1 -0
- package/dist/editors/builder-profile/utils/graphql-client.js +189 -0
- package/package.json +2 -2
|
@@ -39,8 +39,8 @@ export declare const BuilderProfilePHStateSchema: z.ZodObject<{} & {
|
|
|
39
39
|
type: z.ZodType<import("./types.js").TeamType, any, import("./types.js").TeamType>;
|
|
40
40
|
}>, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
41
41
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
42
|
-
type: import("./types.js").TeamType
|
|
43
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
42
|
+
type: import("./types.js").TeamType;
|
|
43
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
44
44
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
45
45
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
46
46
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -48,13 +48,13 @@ export declare const BuilderProfilePHStateSchema: z.ZodObject<{} & {
|
|
|
48
48
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
49
49
|
links: Array<import("./types.js").BuilderLink>;
|
|
50
50
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
51
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
52
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
51
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
52
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
53
53
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
54
54
|
}, {
|
|
55
55
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
56
|
-
type: import("./types.js").TeamType
|
|
57
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
56
|
+
type: import("./types.js").TeamType;
|
|
57
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
58
58
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
59
59
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
60
60
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -62,15 +62,15 @@ export declare const BuilderProfilePHStateSchema: z.ZodObject<{} & {
|
|
|
62
62
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
63
63
|
links: Array<import("./types.js").BuilderLink>;
|
|
64
64
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
65
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
66
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
65
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
66
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
67
67
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
68
68
|
}>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
70
|
global: {
|
|
71
71
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
72
|
-
type: import("./types.js").TeamType
|
|
73
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
72
|
+
type: import("./types.js").TeamType;
|
|
73
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
74
74
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
75
75
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
76
76
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -78,15 +78,15 @@ export declare const BuilderProfilePHStateSchema: z.ZodObject<{} & {
|
|
|
78
78
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
79
79
|
links: Array<import("./types.js").BuilderLink>;
|
|
80
80
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
81
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
82
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
81
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
82
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
83
83
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
84
84
|
};
|
|
85
85
|
}, {
|
|
86
86
|
global: {
|
|
87
87
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
88
|
-
type: import("./types.js").TeamType
|
|
89
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
88
|
+
type: import("./types.js").TeamType;
|
|
89
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
90
90
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
91
91
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
92
92
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -94,8 +94,8 @@ export declare const BuilderProfilePHStateSchema: z.ZodObject<{} & {
|
|
|
94
94
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
95
95
|
links: Array<import("./types.js").BuilderLink>;
|
|
96
96
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
97
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
98
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
97
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
98
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
99
99
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
100
100
|
};
|
|
101
101
|
}>;
|
|
@@ -137,8 +137,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
137
137
|
type: z.ZodType<import("./types.js").TeamType, any, import("./types.js").TeamType>;
|
|
138
138
|
}>, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
139
139
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
140
|
-
type: import("./types.js").TeamType
|
|
141
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
140
|
+
type: import("./types.js").TeamType;
|
|
141
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
142
142
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
143
143
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
144
144
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -146,13 +146,13 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
146
146
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
147
147
|
links: Array<import("./types.js").BuilderLink>;
|
|
148
148
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
149
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
150
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
149
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
150
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
151
151
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
152
152
|
}, {
|
|
153
153
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
154
|
-
type: import("./types.js").TeamType
|
|
155
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
154
|
+
type: import("./types.js").TeamType;
|
|
155
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
156
156
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
157
157
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
158
158
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -160,15 +160,15 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
160
160
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
161
161
|
links: Array<import("./types.js").BuilderLink>;
|
|
162
162
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
163
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
164
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
163
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
164
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
165
165
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
166
166
|
}>;
|
|
167
167
|
}, "strip", z.ZodTypeAny, {
|
|
168
168
|
global: {
|
|
169
169
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
170
|
-
type: import("./types.js").TeamType
|
|
171
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
170
|
+
type: import("./types.js").TeamType;
|
|
171
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
172
172
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
173
173
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
174
174
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -176,15 +176,15 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
176
176
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
177
177
|
links: Array<import("./types.js").BuilderLink>;
|
|
178
178
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
179
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
180
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
179
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
180
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
181
181
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
182
182
|
};
|
|
183
183
|
}, {
|
|
184
184
|
global: {
|
|
185
185
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
186
|
-
type: import("./types.js").TeamType
|
|
187
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
186
|
+
type: import("./types.js").TeamType;
|
|
187
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
188
188
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
189
189
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
190
190
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -192,8 +192,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
192
192
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
193
193
|
links: Array<import("./types.js").BuilderLink>;
|
|
194
194
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
195
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
196
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
195
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
196
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
197
197
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
198
198
|
};
|
|
199
199
|
}>;
|
|
@@ -214,8 +214,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
214
214
|
type: z.ZodType<import("./types.js").TeamType, any, import("./types.js").TeamType>;
|
|
215
215
|
}>, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
216
216
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
217
|
-
type: import("./types.js").TeamType
|
|
218
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
217
|
+
type: import("./types.js").TeamType;
|
|
218
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
219
219
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
220
220
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
221
221
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -223,13 +223,13 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
223
223
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
224
224
|
links: Array<import("./types.js").BuilderLink>;
|
|
225
225
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
226
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
227
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
226
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
227
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
228
228
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
229
229
|
}, {
|
|
230
230
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
231
|
-
type: import("./types.js").TeamType
|
|
232
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
231
|
+
type: import("./types.js").TeamType;
|
|
232
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
233
233
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
234
234
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
235
235
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -237,15 +237,15 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
237
237
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
238
238
|
links: Array<import("./types.js").BuilderLink>;
|
|
239
239
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
240
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
241
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
240
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
241
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
242
242
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
243
243
|
}>;
|
|
244
244
|
}, "strip", z.ZodTypeAny, {
|
|
245
245
|
global: {
|
|
246
246
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
247
|
-
type: import("./types.js").TeamType
|
|
248
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
247
|
+
type: import("./types.js").TeamType;
|
|
248
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
249
249
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
250
250
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
251
251
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -253,15 +253,15 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
253
253
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
254
254
|
links: Array<import("./types.js").BuilderLink>;
|
|
255
255
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
256
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
257
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
256
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
257
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
258
258
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
259
259
|
};
|
|
260
260
|
}, {
|
|
261
261
|
global: {
|
|
262
262
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
263
|
-
type: import("./types.js").TeamType
|
|
264
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
263
|
+
type: import("./types.js").TeamType;
|
|
264
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
265
265
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
266
266
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
267
267
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -269,8 +269,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
269
269
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
270
270
|
links: Array<import("./types.js").BuilderLink>;
|
|
271
271
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
272
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
273
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
272
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
273
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
274
274
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
275
275
|
};
|
|
276
276
|
}>;
|
|
@@ -285,8 +285,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
285
285
|
state: {
|
|
286
286
|
global: {
|
|
287
287
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
288
|
-
type: import("./types.js").TeamType
|
|
289
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
288
|
+
type: import("./types.js").TeamType;
|
|
289
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
290
290
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
291
291
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
292
292
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -294,16 +294,16 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
294
294
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
295
295
|
links: Array<import("./types.js").BuilderLink>;
|
|
296
296
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
297
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
298
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
297
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
298
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
299
299
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
302
|
initialState: {
|
|
303
303
|
global: {
|
|
304
304
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
305
|
-
type: import("./types.js").TeamType
|
|
306
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
305
|
+
type: import("./types.js").TeamType;
|
|
306
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
307
307
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
308
308
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
309
309
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -311,8 +311,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
311
311
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
312
312
|
links: Array<import("./types.js").BuilderLink>;
|
|
313
313
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
314
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
315
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
314
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
315
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
316
316
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
317
317
|
};
|
|
318
318
|
};
|
|
@@ -327,8 +327,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
327
327
|
state: {
|
|
328
328
|
global: {
|
|
329
329
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
330
|
-
type: import("./types.js").TeamType
|
|
331
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
330
|
+
type: import("./types.js").TeamType;
|
|
331
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
332
332
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
333
333
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
334
334
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -336,16 +336,16 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
336
336
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
337
337
|
links: Array<import("./types.js").BuilderLink>;
|
|
338
338
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
339
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
340
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
339
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
340
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
341
341
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
342
342
|
};
|
|
343
343
|
};
|
|
344
344
|
initialState: {
|
|
345
345
|
global: {
|
|
346
346
|
code: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
347
|
-
type: import("./types.js").TeamType
|
|
348
|
-
status: import("./types.js").Maybe<import("./types.js").BuilderStatus
|
|
347
|
+
type: import("./types.js").TeamType;
|
|
348
|
+
status: import("./types.js").Maybe<import("./types.js").BuilderStatus>;
|
|
349
349
|
id: import("./types.js").Maybe<import("./types.js").Scalars["PHID"]["output"]>;
|
|
350
350
|
contributors: Array<import("./types.js").Scalars["PHID"]["output"]>;
|
|
351
351
|
description: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
@@ -353,8 +353,8 @@ export declare const BuilderProfileDocumentSchema: z.ZodObject<{
|
|
|
353
353
|
lastModified: import("./types.js").Maybe<import("./types.js").Scalars["DateTime"]["output"]>;
|
|
354
354
|
links: Array<import("./types.js").BuilderLink>;
|
|
355
355
|
name: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
356
|
-
scopes: Array<import("./types.js").BuilderScope
|
|
357
|
-
skils: Array<import("./types.js").BuilderSkill
|
|
356
|
+
scopes: Array<import("./types.js").BuilderScope>;
|
|
357
|
+
skils: Array<import("./types.js").BuilderSkill>;
|
|
358
358
|
slug: import("./types.js").Maybe<import("./types.js").Scalars["String"]["output"]>;
|
|
359
359
|
};
|
|
360
360
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-schema.d.ts","sourceRoot":"","sources":["../../../../document-models/builder-profile/gen/document-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;EAG3C,CAAC;AAEL,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"document-schema.d.ts","sourceRoot":"","sources":["../../../../document-models/builder-profile/gen/document-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;EAG3C,CAAC;AAEL,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;yCAqCmjB,sCAAiB;;;uCAAuK,oCAAe;4BAAnJ,oCAAe;gDAAkC,sCAAiB;yCAA2B,mCAAc;iDAA2E,wCAAmB;;yCAAwD,sCAAiB;;;yCAAwF,sCAAiB;;yCAA/a,sCAAiB;;;uCAAuK,oCAAe;4BAAnJ,oCAAe;gDAAkC,sCAAiB;yCAA2B,mCAAc;iDAA2E,wCAAmB;;yCAAwD,sCAAiB;;;yCAAwF,sCAAiB;;;;yCAA/a,sCAAiB;;;uCAAuK,oCAAe;4BAAnJ,oCAAe;gDAAkC,sCAAiB;yCAA2B,mCAAc;iDAA2E,wCAAmB;;yC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
|
|
|
143
143
|
url: Scalars["URL"]["input"];
|
|
144
144
|
};
|
|
145
145
|
export type AddScopeInput = {
|
|
146
|
-
scope?: InputMaybe<BuilderScopeInput
|
|
146
|
+
scope?: InputMaybe<BuilderScopeInput>;
|
|
147
147
|
};
|
|
148
148
|
export type AddSkillInput = {
|
|
149
|
-
skill?: InputMaybe<BuilderSkillInput
|
|
149
|
+
skill?: InputMaybe<BuilderSkillInput>;
|
|
150
150
|
};
|
|
151
151
|
export type BuilderLink = {
|
|
152
152
|
id: Scalars["OID"]["output"];
|
|
@@ -162,11 +162,11 @@ export type BuilderProfileState = {
|
|
|
162
162
|
lastModified: Maybe<Scalars["DateTime"]["output"]>;
|
|
163
163
|
links: Array<BuilderLink>;
|
|
164
164
|
name: Maybe<Scalars["String"]["output"]>;
|
|
165
|
-
scopes: Array<BuilderScope
|
|
166
|
-
skils: Array<BuilderSkill
|
|
165
|
+
scopes: Array<BuilderScope>;
|
|
166
|
+
skils: Array<BuilderSkill>;
|
|
167
167
|
slug: Maybe<Scalars["String"]["output"]>;
|
|
168
|
-
status: Maybe<BuilderStatus
|
|
169
|
-
type: TeamType
|
|
168
|
+
status: Maybe<BuilderStatus>;
|
|
169
|
+
type: TeamType;
|
|
170
170
|
};
|
|
171
171
|
export type BuilderScope = "ACC" | "GOVERNANCE_SCOPE" | "PROTOCOL_SCOPE" | "STA" | "STABILITY_SCOPE" | "SUP" | "SUPPORT_SCOPE";
|
|
172
172
|
export type BuilderScopeInput = "ACC" | "GOVERNANCE_SCOPE" | "PROTOCOL_SCOPE" | "STA" | "STABILITY_SCOPE" | "SUP" | "SUPPORT_SCOPE";
|
|
@@ -186,10 +186,10 @@ export type RemoveLinkInput = {
|
|
|
186
186
|
id: Scalars["OID"]["input"];
|
|
187
187
|
};
|
|
188
188
|
export type RemoveScopeInput = {
|
|
189
|
-
scope?: InputMaybe<BuilderScopeInput
|
|
189
|
+
scope?: InputMaybe<BuilderScopeInput>;
|
|
190
190
|
};
|
|
191
191
|
export type RemoveSkillInput = {
|
|
192
|
-
skill?: InputMaybe<BuilderSkillInput
|
|
192
|
+
skill?: InputMaybe<BuilderSkillInput>;
|
|
193
193
|
};
|
|
194
194
|
export type UpdateProfileInput = {
|
|
195
195
|
code?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -198,8 +198,8 @@ export type UpdateProfileInput = {
|
|
|
198
198
|
id?: InputMaybe<Scalars["PHID"]["input"]>;
|
|
199
199
|
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
200
200
|
slug?: InputMaybe<Scalars["String"]["input"]>;
|
|
201
|
-
status?: InputMaybe<BuilderStatusInput
|
|
202
|
-
type?: InputMaybe<TeamTypeInput
|
|
201
|
+
status?: InputMaybe<BuilderStatusInput>;
|
|
202
|
+
type?: InputMaybe<TeamTypeInput>;
|
|
203
203
|
};
|
|
204
204
|
export type TeamType = "INDIVIDUAL" | "TEAM";
|
|
205
205
|
export type TeamTypeInput = "INDIVIDUAL" | "TEAM";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/gen/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAChC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AACjD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,IAAI;KACvD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;KAC3D,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,C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AC,OAAO,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-models.d.ts","sourceRoot":"","sources":["../../document-models/document-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,eAAO,MAAM,cAAc,EAAE,mBAAmB,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"document-models.d.ts","sourceRoot":"","sources":["../../document-models/document-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,eAAO,MAAM,cAAc,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributorsSection.d.ts","sourceRoot":"","sources":["../../../../editors/builder-profile/components/ContributorsSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContributorsSection.d.ts","sourceRoot":"","sources":["../../../../editors/builder-profile/components/ContributorsSection.tsx"],"names":[],"mappings":"AA0JA,UAAU,wBAAwB;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,mBAAmB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD;AAED,wBAAgB,mBAAmB,CAAC,EAClC,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,EAAE,wBAAwB,2CAiR1B"}
|
|
@@ -1,7 +1,89 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useCallback } from "react";
|
|
2
|
+
import { useMemo, useCallback, useState, useEffect } from "react";
|
|
3
3
|
import { useDrives, useGetDocuments } from "@powerhousedao/reactor-browser";
|
|
4
4
|
import { ObjectSetTable, PHIDInput, } from "@powerhousedao/document-engineering";
|
|
5
|
+
import { useRemoteBuilderProfiles } from "../hooks/useRemoteBuilderProfiles.js";
|
|
6
|
+
/**
|
|
7
|
+
* Wrapper component for PHIDInput that properly tracks selected PHID
|
|
8
|
+
* and handles saving on blur/enter with the correct PHID value.
|
|
9
|
+
*
|
|
10
|
+
* Key insight from the PHIDInput library:
|
|
11
|
+
* - onChange is called with the PHID value when user selects from dropdown (click or Enter on highlighted item)
|
|
12
|
+
* - After dropdown selection, the input is re-focused so onBlur doesn't fire
|
|
13
|
+
* - Therefore we must save immediately in onChange when a valid PHID is selected
|
|
14
|
+
*/
|
|
15
|
+
function ContributorPHIDInput({ initialPhid, options, onSave, fetchOptionsCallback, }) {
|
|
16
|
+
// Track the current input text for manual entry lookup
|
|
17
|
+
const [inputText, setInputText] = useState("");
|
|
18
|
+
// Track if we already saved to prevent duplicate saves
|
|
19
|
+
const [hasSaved, setHasSaved] = useState(false);
|
|
20
|
+
// Reset state when initialPhid changes (switching between rows)
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setInputText("");
|
|
23
|
+
setHasSaved(false);
|
|
24
|
+
}, [initialPhid]);
|
|
25
|
+
// Find PHID by name or return the input if it looks like a PHID
|
|
26
|
+
const findPhidByInput = useCallback((input) => {
|
|
27
|
+
const trimmed = input.trim();
|
|
28
|
+
if (!trimmed)
|
|
29
|
+
return null;
|
|
30
|
+
const lowerInput = trimmed.toLowerCase();
|
|
31
|
+
// Check if input matches a profile name exactly (case-insensitive)
|
|
32
|
+
const exactMatchByName = options.find((opt) => opt.label.toLowerCase() === lowerInput);
|
|
33
|
+
if (exactMatchByName)
|
|
34
|
+
return exactMatchByName.id;
|
|
35
|
+
// Check if input matches a profile name partially (first match that starts with input)
|
|
36
|
+
const partialMatchByName = options.find((opt) => opt.label.toLowerCase().startsWith(lowerInput));
|
|
37
|
+
if (partialMatchByName)
|
|
38
|
+
return partialMatchByName.id;
|
|
39
|
+
// Check if only one option contains the input (unambiguous match)
|
|
40
|
+
const containsMatches = options.filter((opt) => opt.label.toLowerCase().includes(lowerInput));
|
|
41
|
+
if (containsMatches.length === 1)
|
|
42
|
+
return containsMatches[0].id;
|
|
43
|
+
// Check if input matches a profile ID
|
|
44
|
+
const matchById = options.find((opt) => opt.id.toLowerCase() === lowerInput);
|
|
45
|
+
if (matchById)
|
|
46
|
+
return matchById.id;
|
|
47
|
+
// If input looks like a UUID, return it directly
|
|
48
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
49
|
+
if (uuidRegex.test(trimmed))
|
|
50
|
+
return trimmed;
|
|
51
|
+
return null;
|
|
52
|
+
}, [options]);
|
|
53
|
+
// Check if a value is a known PHID from options
|
|
54
|
+
const isKnownPhid = useCallback((value) => {
|
|
55
|
+
return options.some((opt) => opt.id === value);
|
|
56
|
+
}, [options]);
|
|
57
|
+
// Save a PHID value (with duplicate prevention)
|
|
58
|
+
const savePhid = useCallback((phid) => {
|
|
59
|
+
if (!hasSaved && phid && phid !== initialPhid) {
|
|
60
|
+
setHasSaved(true);
|
|
61
|
+
onSave(phid);
|
|
62
|
+
}
|
|
63
|
+
}, [hasSaved, initialPhid, onSave]);
|
|
64
|
+
// Handle blur - try to save based on inputText
|
|
65
|
+
const handleBlur = useCallback(() => {
|
|
66
|
+
if (hasSaved)
|
|
67
|
+
return;
|
|
68
|
+
if (inputText) {
|
|
69
|
+
const foundPhid = findPhidByInput(inputText);
|
|
70
|
+
if (foundPhid) {
|
|
71
|
+
savePhid(foundPhid);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, [hasSaved, inputText, findPhidByInput, savePhid]);
|
|
75
|
+
return (_jsx(PHIDInput, { value: initialPhid, onChange: (newValue) => {
|
|
76
|
+
// onChange is called when user selects from dropdown (click or Enter on highlighted item)
|
|
77
|
+
// The newValue is the PHID. Save immediately if it's a valid known PHID.
|
|
78
|
+
if (isKnownPhid(newValue)) {
|
|
79
|
+
savePhid(newValue);
|
|
80
|
+
}
|
|
81
|
+
}, onInput: (e) => {
|
|
82
|
+
// Track the raw input text for manual entry lookup on blur
|
|
83
|
+
const target = e.target;
|
|
84
|
+
setInputText(target.value);
|
|
85
|
+
}, onBlur: handleBlur, placeholder: "Enter PHID or search by name", className: "w-full", variant: "withValueAndTitle", initialOptions: options, fetchOptionsCallback: fetchOptionsCallback }));
|
|
86
|
+
}
|
|
5
87
|
export function ContributorsSection({ contributors, onAddContributor, onRemoveContributor, }) {
|
|
6
88
|
const drives = useDrives();
|
|
7
89
|
// Map all builder profile FileNodes from all drives with their driveId
|
|
@@ -24,8 +106,8 @@ export function ContributorsSection({ contributors, onAddContributor, onRemoveCo
|
|
|
24
106
|
}, [builderProfileNodesWithDriveId]);
|
|
25
107
|
// Fetch all builder profile documents from all drives
|
|
26
108
|
const builderProfileDocuments = useGetDocuments(builderPhids);
|
|
27
|
-
// Create a map of PHID to document for quick lookup
|
|
28
|
-
const
|
|
109
|
+
// Create a map of PHID to document for quick lookup (local drives)
|
|
110
|
+
const localBuilderProfileMap = useMemo(() => {
|
|
29
111
|
const map = new Map();
|
|
30
112
|
if (!builderProfileDocuments)
|
|
31
113
|
return map;
|
|
@@ -36,10 +118,13 @@ export function ContributorsSection({ contributors, onAddContributor, onRemoveCo
|
|
|
36
118
|
});
|
|
37
119
|
return map;
|
|
38
120
|
}, [builderProfileDocuments]);
|
|
39
|
-
//
|
|
121
|
+
// Fetch remote profiles as fallback for contributors not found locally
|
|
122
|
+
const { profileMap: remoteProfileMap, allProfiles: remoteProfiles } = useRemoteBuilderProfiles(localBuilderProfileMap);
|
|
123
|
+
// Helper function to get builder profile documents from all drives (local + remote)
|
|
40
124
|
const getBuilderProfiles = useCallback(() => {
|
|
41
|
-
|
|
42
|
-
|
|
125
|
+
// Start with local profiles
|
|
126
|
+
const profileOptions = builderProfileNodesWithDriveId.map(({ node }) => {
|
|
127
|
+
const doc = localBuilderProfileMap.get(node.id);
|
|
43
128
|
const name = doc?.state?.global?.name || node.name || node.id;
|
|
44
129
|
return {
|
|
45
130
|
id: node.id,
|
|
@@ -48,18 +133,43 @@ export function ContributorsSection({ contributors, onAddContributor, onRemoveCo
|
|
|
48
133
|
title: name,
|
|
49
134
|
};
|
|
50
135
|
});
|
|
51
|
-
|
|
52
|
-
|
|
136
|
+
// Add remote profiles that aren't already in local
|
|
137
|
+
const localIds = new Set(profileOptions.map((p) => p.id));
|
|
138
|
+
for (const remoteProfile of remoteProfiles) {
|
|
139
|
+
if (!localIds.has(remoteProfile.id)) {
|
|
140
|
+
const name = remoteProfile.state?.name || remoteProfile.id;
|
|
141
|
+
profileOptions.push({
|
|
142
|
+
id: remoteProfile.id,
|
|
143
|
+
label: name,
|
|
144
|
+
value: remoteProfile.id,
|
|
145
|
+
title: name,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return profileOptions;
|
|
150
|
+
}, [builderProfileNodesWithDriveId, localBuilderProfileMap, remoteProfiles]);
|
|
151
|
+
// Helper function to get builder profile data by PHID (local first, then remote fallback)
|
|
53
152
|
const getBuilderProfileByPhid = useCallback((phid) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
153
|
+
// Try local first
|
|
154
|
+
const localDoc = localBuilderProfileMap.get(phid);
|
|
155
|
+
if (localDoc) {
|
|
156
|
+
return {
|
|
157
|
+
name: localDoc.state.global?.name || localDoc.header.id,
|
|
158
|
+
slug: localDoc.state.global?.slug || localDoc.header.id,
|
|
159
|
+
icon: localDoc.state.global?.icon || null,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// Fall back to remote
|
|
163
|
+
const remoteProfile = remoteProfileMap.get(phid);
|
|
164
|
+
if (remoteProfile) {
|
|
165
|
+
return {
|
|
166
|
+
name: remoteProfile.state?.name || remoteProfile.id,
|
|
167
|
+
slug: remoteProfile.state?.slug || remoteProfile.id,
|
|
168
|
+
icon: remoteProfile.state?.icon || null,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}, [localBuilderProfileMap, remoteProfileMap]);
|
|
63
173
|
const contributorData = useMemo(() => {
|
|
64
174
|
return contributors.map((phid) => {
|
|
65
175
|
const profile = getBuilderProfileByPhid(phid);
|
|
@@ -89,35 +199,34 @@ export function ContributorsSection({ contributors, onAddContributor, onRemoveCo
|
|
|
89
199
|
}
|
|
90
200
|
return false;
|
|
91
201
|
},
|
|
92
|
-
renderCellEditor: (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const newValue = e.target.value;
|
|
96
|
-
const currentValue = value || "";
|
|
202
|
+
renderCellEditor: (_value, _onChange, context) => {
|
|
203
|
+
const currentPhid = context.row.phid || "";
|
|
204
|
+
const handleSave = (phidValue) => {
|
|
97
205
|
// If a PHID is entered and it's different from current value
|
|
98
|
-
if (
|
|
99
|
-
const existingContributor = contributors.find((contributor) => contributor ===
|
|
206
|
+
if (phidValue && phidValue !== currentPhid) {
|
|
207
|
+
const existingContributor = contributors.find((contributor) => contributor === phidValue);
|
|
100
208
|
if (!existingContributor) {
|
|
101
209
|
// If we're editing an existing row (has an ID), remove the old one first
|
|
102
|
-
if (
|
|
103
|
-
onRemoveContributor(
|
|
210
|
+
if (currentPhid && currentPhid !== phidValue) {
|
|
211
|
+
onRemoveContributor(currentPhid);
|
|
104
212
|
}
|
|
105
213
|
// Add the new contributor
|
|
106
|
-
onAddContributor(
|
|
214
|
+
onAddContributor(phidValue);
|
|
107
215
|
}
|
|
108
216
|
}
|
|
109
|
-
}
|
|
217
|
+
};
|
|
218
|
+
const fetchOptions = (userInput) => {
|
|
110
219
|
const builderProfiles = getBuilderProfiles();
|
|
111
220
|
// Filter profiles based on user input
|
|
112
221
|
if (!userInput.trim()) {
|
|
113
222
|
return Promise.resolve(builderProfiles);
|
|
114
223
|
}
|
|
115
|
-
const filteredProfiles = builderProfiles.filter((profile) => profile.label
|
|
116
|
-
.toLowerCase()
|
|
117
|
-
.includes(userInput.toLowerCase()) ||
|
|
224
|
+
const filteredProfiles = builderProfiles.filter((profile) => profile.label.toLowerCase().includes(userInput.toLowerCase()) ||
|
|
118
225
|
profile.id.toLowerCase().includes(userInput.toLowerCase()));
|
|
119
226
|
return Promise.resolve(filteredProfiles);
|
|
120
|
-
}
|
|
227
|
+
};
|
|
228
|
+
return (_jsx(ContributorPHIDInput, { initialPhid: currentPhid, options: getBuilderProfiles(), onSave: handleSave, fetchOptionsCallback: fetchOptions }, `phid-input-${currentPhid || Date.now()}`));
|
|
229
|
+
},
|
|
121
230
|
renderCell: (value) => {
|
|
122
231
|
if (value === "" || !value) {
|
|
123
232
|
return (_jsx("div", { className: "font-light italic text-gray-500 text-center", children: "+ Double-click to add new contributor (enter or click outside to save)" }));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RemoteBuilderProfile } from "../utils/graphql-client.js";
|
|
2
|
+
interface UseRemoteBuilderProfilesResult {
|
|
3
|
+
/** Map of PHID to remote builder profile data */
|
|
4
|
+
profileMap: Map<string, RemoteBuilderProfile>;
|
|
5
|
+
/** All available remote profiles for selection */
|
|
6
|
+
allProfiles: RemoteBuilderProfile[];
|
|
7
|
+
/** Whether remote data is currently loading */
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
/** Manually refetch all available profiles */
|
|
10
|
+
refetchAll: () => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hook for fetching builder profiles from remote Switchboard drives.
|
|
14
|
+
* Used as a fallback when local drives don't have the builder profile documents.
|
|
15
|
+
*
|
|
16
|
+
* @param localProfileMap - Map of PHIDs that are already resolved locally (to avoid using remote data for those)
|
|
17
|
+
*/
|
|
18
|
+
export declare function useRemoteBuilderProfiles(localProfileMap: Map<string, unknown>): UseRemoteBuilderProfilesResult;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=useRemoteBuilderProfiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRemoteBuilderProfiles.d.ts","sourceRoot":"","sources":["../../../../editors/builder-profile/hooks/useRemoteBuilderProfiles.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,UAAU,8BAA8B;IACtC,iDAAiD;IACjD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC9C,kDAAkD;IAClD,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,8BAA8B,CA8DhC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
+
import { fetchAllRemoteBuilderProfiles, } from "../utils/graphql-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* Hook for fetching builder profiles from remote Switchboard drives.
|
|
5
|
+
* Used as a fallback when local drives don't have the builder profile documents.
|
|
6
|
+
*
|
|
7
|
+
* @param localProfileMap - Map of PHIDs that are already resolved locally (to avoid using remote data for those)
|
|
8
|
+
*/
|
|
9
|
+
export function useRemoteBuilderProfiles(localProfileMap) {
|
|
10
|
+
const [profileMap, setProfileMap] = useState(new Map());
|
|
11
|
+
const [allProfiles, setAllProfiles] = useState([]);
|
|
12
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
+
// Track if we've already started fetching to avoid duplicate requests
|
|
14
|
+
const isFetchingRef = useRef(false);
|
|
15
|
+
const hasFetchedRef = useRef(false);
|
|
16
|
+
// Fetch all available profiles
|
|
17
|
+
const refetchAll = useCallback(async () => {
|
|
18
|
+
// Prevent concurrent fetches
|
|
19
|
+
if (isFetchingRef.current) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
isFetchingRef.current = true;
|
|
23
|
+
setIsLoading(true);
|
|
24
|
+
try {
|
|
25
|
+
const profiles = await fetchAllRemoteBuilderProfiles();
|
|
26
|
+
hasFetchedRef.current = true;
|
|
27
|
+
setAllProfiles(profiles);
|
|
28
|
+
// Build profile map
|
|
29
|
+
const newMap = new Map();
|
|
30
|
+
profiles.forEach((profile) => {
|
|
31
|
+
newMap.set(profile.id, profile);
|
|
32
|
+
});
|
|
33
|
+
setProfileMap(newMap);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.warn("[useRemoteBuilderProfiles] Failed to fetch profiles:", error);
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
setIsLoading(false);
|
|
40
|
+
isFetchingRef.current = false;
|
|
41
|
+
}
|
|
42
|
+
}, []);
|
|
43
|
+
// Auto-fetch all profiles on mount
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (!hasFetchedRef.current && !isFetchingRef.current) {
|
|
46
|
+
void refetchAll();
|
|
47
|
+
}
|
|
48
|
+
}, [refetchAll]);
|
|
49
|
+
// Filter out profiles that exist locally from the returned allProfiles
|
|
50
|
+
const filteredAllProfiles = allProfiles.filter((profile) => !localProfileMap.has(profile.id));
|
|
51
|
+
return {
|
|
52
|
+
profileMap,
|
|
53
|
+
allProfiles: filteredAllProfiles,
|
|
54
|
+
isLoading,
|
|
55
|
+
refetchAll,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL client utility for fetching remote builder profiles from Switchboard.
|
|
3
|
+
* This is used as a fallback when local drives don't have the builder profile documents.
|
|
4
|
+
*/
|
|
5
|
+
export interface RemoteBuilderProfile {
|
|
6
|
+
id: string;
|
|
7
|
+
state: {
|
|
8
|
+
name: string | null;
|
|
9
|
+
slug: string | null;
|
|
10
|
+
icon: string | null;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Fetches all available remote drives
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchRemoteDrives(): Promise<string[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Fetches drive ID by slug
|
|
19
|
+
*/
|
|
20
|
+
export declare function fetchDriveIdBySlug(slug: string): Promise<string | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetches all builder profiles from a specific drive
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchBuilderProfilesFromDrive(driveId: string, options?: {
|
|
25
|
+
silent?: boolean;
|
|
26
|
+
}): Promise<RemoteBuilderProfile[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetches a single builder profile by document ID
|
|
29
|
+
*/
|
|
30
|
+
export declare function fetchBuilderProfileById(docId: string, driveId?: string): Promise<RemoteBuilderProfile | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Fetches all builder profiles from all available remote drives.
|
|
33
|
+
* This aggregates profiles from multiple drives into a single list.
|
|
34
|
+
*/
|
|
35
|
+
export declare function fetchAllRemoteBuilderProfiles(): Promise<RemoteBuilderProfile[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetches multiple builder profiles by their IDs.
|
|
38
|
+
* Tries to find them across all available remote drives.
|
|
39
|
+
*/
|
|
40
|
+
export declare function fetchRemoteBuilderProfilesByIds(phids: string[]): Promise<Map<string, RemoteBuilderProfile>>;
|
|
41
|
+
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/builder-profile/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmIH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,CAAC;CACH;AAcD;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAG3D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM7E;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAOjC;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAC5D,oBAAoB,EAAE,CACvB,CA8BA;AAED;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAiC5C"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL client utility for fetching remote builder profiles from Switchboard.
|
|
3
|
+
* This is used as a fallback when local drives don't have the builder profile documents.
|
|
4
|
+
*/
|
|
5
|
+
function getGraphQLUrl() {
|
|
6
|
+
if (typeof window === "undefined") {
|
|
7
|
+
return "http://localhost:4001/graphql";
|
|
8
|
+
}
|
|
9
|
+
const baseURI = window.document.baseURI;
|
|
10
|
+
if (baseURI.includes("localhost")) {
|
|
11
|
+
return "http://localhost:4001/graphql";
|
|
12
|
+
}
|
|
13
|
+
// Determine the appropriate Switchboard URL based on environment
|
|
14
|
+
if (baseURI.includes("-dev.")) {
|
|
15
|
+
return "https://switchboard-dev.powerhouse.xyz/graphql";
|
|
16
|
+
}
|
|
17
|
+
if (baseURI.includes("-staging.")) {
|
|
18
|
+
return "https://switchboard-staging.powerhouse.xyz/graphql";
|
|
19
|
+
}
|
|
20
|
+
// Production environment
|
|
21
|
+
return "https://switchboard.powerhouse.xyz/graphql";
|
|
22
|
+
}
|
|
23
|
+
async function graphqlRequest(query, variables, options) {
|
|
24
|
+
try {
|
|
25
|
+
const response = await fetch(getGraphQLUrl(), {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
},
|
|
30
|
+
body: JSON.stringify({ query, variables }),
|
|
31
|
+
});
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
if (!options?.silent) {
|
|
34
|
+
console.warn("[graphql-client] Request failed:", response.status, response.statusText);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const result = (await response.json());
|
|
39
|
+
// Return data even if there are errors - partial data might still be useful
|
|
40
|
+
// Only treat as full failure if there's no data at all
|
|
41
|
+
if (result.errors?.length && !result.data) {
|
|
42
|
+
if (!options?.silent) {
|
|
43
|
+
console.warn("[graphql-client] GraphQL errors:", result.errors);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return result.data ?? null;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
// Silently fail - this is a fallback mechanism
|
|
51
|
+
if (!options?.silent) {
|
|
52
|
+
console.warn("[graphql-client] Request error:", error);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Query to get all available drives
|
|
58
|
+
const GET_DRIVES_QUERY = `
|
|
59
|
+
query GetDrives {
|
|
60
|
+
drives
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
// Query to get drive ID by slug
|
|
64
|
+
const GET_DRIVE_ID_BY_SLUG_QUERY = `
|
|
65
|
+
query GetDriveIdBySlug($slug: String!) {
|
|
66
|
+
driveIdBySlug(slug: $slug)
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
// Query to get builder profile documents from a drive
|
|
70
|
+
const GET_BUILDER_PROFILES_QUERY = `
|
|
71
|
+
query GetBuilderProfiles($driveId: String!) {
|
|
72
|
+
BuilderProfile {
|
|
73
|
+
getDocuments(driveId: $driveId) {
|
|
74
|
+
id
|
|
75
|
+
state {
|
|
76
|
+
name
|
|
77
|
+
slug
|
|
78
|
+
icon
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
// Query to get a single builder profile by ID
|
|
85
|
+
const GET_BUILDER_PROFILE_QUERY = `
|
|
86
|
+
query GetBuilderProfile($docId: PHID!, $driveId: PHID) {
|
|
87
|
+
BuilderProfile {
|
|
88
|
+
getDocument(docId: $docId, driveId: $driveId) {
|
|
89
|
+
id
|
|
90
|
+
state {
|
|
91
|
+
name
|
|
92
|
+
slug
|
|
93
|
+
icon
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
/**
|
|
100
|
+
* Fetches all available remote drives
|
|
101
|
+
*/
|
|
102
|
+
export async function fetchRemoteDrives() {
|
|
103
|
+
const data = await graphqlRequest(GET_DRIVES_QUERY);
|
|
104
|
+
return data?.drives ?? [];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Fetches drive ID by slug
|
|
108
|
+
*/
|
|
109
|
+
export async function fetchDriveIdBySlug(slug) {
|
|
110
|
+
const data = await graphqlRequest(GET_DRIVE_ID_BY_SLUG_QUERY, { slug });
|
|
111
|
+
return data?.driveIdBySlug ?? null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Fetches all builder profiles from a specific drive
|
|
115
|
+
*/
|
|
116
|
+
export async function fetchBuilderProfilesFromDrive(driveId, options) {
|
|
117
|
+
const data = await graphqlRequest(GET_BUILDER_PROFILES_QUERY, { driveId }, options);
|
|
118
|
+
return data?.BuilderProfile?.getDocuments ?? [];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Fetches a single builder profile by document ID
|
|
122
|
+
*/
|
|
123
|
+
export async function fetchBuilderProfileById(docId, driveId) {
|
|
124
|
+
const data = await graphqlRequest(GET_BUILDER_PROFILE_QUERY, { docId, driveId });
|
|
125
|
+
return data?.BuilderProfile?.getDocument ?? null;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Fetches all builder profiles from all available remote drives.
|
|
129
|
+
* This aggregates profiles from multiple drives into a single list.
|
|
130
|
+
*/
|
|
131
|
+
export async function fetchAllRemoteBuilderProfiles() {
|
|
132
|
+
try {
|
|
133
|
+
const drives = await fetchRemoteDrives();
|
|
134
|
+
if (!drives.length) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
// Fetch profiles from all drives in parallel (silent to avoid console spam)
|
|
138
|
+
const profilePromises = drives.map((driveSlug) => fetchBuilderProfilesFromDrive(driveSlug, { silent: true }).catch(() => []));
|
|
139
|
+
const profileArrays = await Promise.all(profilePromises);
|
|
140
|
+
// Flatten and dedupe by ID
|
|
141
|
+
const profileMap = new Map();
|
|
142
|
+
for (const profiles of profileArrays) {
|
|
143
|
+
for (const profile of profiles) {
|
|
144
|
+
if (!profileMap.has(profile.id)) {
|
|
145
|
+
profileMap.set(profile.id, profile);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return Array.from(profileMap.values());
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Fetches multiple builder profiles by their IDs.
|
|
157
|
+
* Tries to find them across all available remote drives.
|
|
158
|
+
*/
|
|
159
|
+
export async function fetchRemoteBuilderProfilesByIds(phids) {
|
|
160
|
+
if (!phids.length) {
|
|
161
|
+
return new Map();
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
// First, get all profiles from all drives
|
|
165
|
+
const allProfiles = await fetchAllRemoteBuilderProfiles();
|
|
166
|
+
// Filter to only the ones we need
|
|
167
|
+
const result = new Map();
|
|
168
|
+
for (const profile of allProfiles) {
|
|
169
|
+
if (phids.includes(profile.id)) {
|
|
170
|
+
result.set(profile.id, profile);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// For any missing profiles, try direct fetch
|
|
174
|
+
const missingPhids = phids.filter((phid) => !result.has(phid));
|
|
175
|
+
if (missingPhids.length > 0) {
|
|
176
|
+
const directFetches = missingPhids.map(async (phid) => {
|
|
177
|
+
const profile = await fetchBuilderProfileById(phid);
|
|
178
|
+
if (profile) {
|
|
179
|
+
result.set(phid, profile);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
await Promise.all(directFetches);
|
|
183
|
+
}
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
return new Map();
|
|
188
|
+
}
|
|
189
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/builder-profile",
|
|
3
3
|
"description": "Builder profile document model",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@powerhousedao/builder-tools": "latest",
|
|
66
66
|
"@powerhousedao/common": "latest",
|
|
67
67
|
"@powerhousedao/design-system": "latest",
|
|
68
|
-
"@powerhousedao/document-engineering": "^1.
|
|
68
|
+
"@powerhousedao/document-engineering": "^1.40.0",
|
|
69
69
|
"@uiw/react-md-editor": "^4.0.11",
|
|
70
70
|
"document-model": "latest",
|
|
71
71
|
"error": "^10.4.0",
|