@powerhousedao/builder-profile 0.0.9 → 0.0.11
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/actions.d.ts +1 -0
- package/dist/document-models/builder-profile/actions.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/builders/actions.d.ts +6 -2
- package/dist/document-models/builder-profile/gen/builders/actions.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/builders/creators.d.ts +3 -2
- package/dist/document-models/builder-profile/gen/builders/creators.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/builders/creators.js +2 -1
- package/dist/document-models/builder-profile/gen/builders/operations.d.ts +2 -1
- package/dist/document-models/builder-profile/gen/builders/operations.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/document-model.js +16 -5
- package/dist/document-models/builder-profile/gen/document-schema.d.ts +19 -0
- package/dist/document-models/builder-profile/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/ph-factories.js +1 -0
- package/dist/document-models/builder-profile/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/reducer.js +5 -1
- package/dist/document-models/builder-profile/gen/schema/types.d.ts +4 -0
- package/dist/document-models/builder-profile/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/schema/zod.d.ts +2 -1
- package/dist/document-models/builder-profile/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/schema/zod.js +6 -0
- package/dist/document-models/builder-profile/gen/utils.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/utils.js +1 -0
- package/dist/document-models/builder-profile/src/reducers/builders.d.ts.map +1 -1
- package/dist/document-models/builder-profile/src/reducers/builders.js +3 -0
- package/dist/editors/builder-profile/editor.d.ts.map +1 -1
- package/dist/editors/builder-profile/editor.js +58 -5
- package/dist/style.css +809 -0
- package/dist/subgraphs/builder-profile/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/builder-profile/resolvers.js +12 -0
- package/dist/subgraphs/builder-profile/schema.d.ts.map +1 -1
- package/dist/subgraphs/builder-profile/schema.js +8 -34
- package/package.json +2 -1
|
@@ -155,6 +155,14 @@ export default function Editor() {
|
|
|
155
155
|
return;
|
|
156
156
|
dispatch(actions.removeContributor({ contributorPHID }));
|
|
157
157
|
}, [dispatch]);
|
|
158
|
+
// Operator handler
|
|
159
|
+
const handleSetOperator = useCallback((isOperator) => {
|
|
160
|
+
if (!dispatch)
|
|
161
|
+
return;
|
|
162
|
+
dispatch(actions.setOperator({ isOperator }));
|
|
163
|
+
}, [dispatch]);
|
|
164
|
+
// Dynamic role label based on isOperator flag
|
|
165
|
+
const roleLabel = state?.isOperator ? "Operator" : "Builder";
|
|
158
166
|
return (_jsxs("div", { className: "w-full min-h-screen bg-gradient-to-br from-slate-50 via-white to-slate-100", children: [_jsx("style", { children: `
|
|
159
167
|
.builder-editor input, .builder-editor textarea, .builder-editor select {
|
|
160
168
|
font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
@@ -228,12 +236,57 @@ export default function Editor() {
|
|
|
228
236
|
background-size: 1.25em 1.25em;
|
|
229
237
|
padding-right: 2.5rem;
|
|
230
238
|
}
|
|
231
|
-
|
|
239
|
+
.builder-editor .role-toggle {
|
|
240
|
+
display: flex;
|
|
241
|
+
background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
|
|
242
|
+
border-radius: 12px;
|
|
243
|
+
padding: 3px;
|
|
244
|
+
gap: 3px;
|
|
245
|
+
border: 1px solid rgba(0, 0, 0, 0.06);
|
|
246
|
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
247
|
+
}
|
|
248
|
+
.builder-editor .role-toggle button {
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
gap: 6px;
|
|
252
|
+
padding: 0.5rem 0.875rem;
|
|
253
|
+
font-size: 0.8125rem;
|
|
254
|
+
font-weight: 500;
|
|
255
|
+
border-radius: 9px;
|
|
256
|
+
border: none;
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
259
|
+
color: #64748B;
|
|
260
|
+
background: transparent;
|
|
261
|
+
white-space: nowrap;
|
|
262
|
+
}
|
|
263
|
+
.builder-editor .role-toggle button .role-icon {
|
|
264
|
+
font-size: 0.875rem;
|
|
265
|
+
transition: transform 0.2s ease;
|
|
266
|
+
}
|
|
267
|
+
.builder-editor .role-toggle button:hover:not(.active) {
|
|
268
|
+
color: #475569;
|
|
269
|
+
background: rgba(255, 255, 255, 0.6);
|
|
270
|
+
}
|
|
271
|
+
.builder-editor .role-toggle button.active {
|
|
272
|
+
color: white;
|
|
273
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
274
|
+
}
|
|
275
|
+
.builder-editor .role-toggle button.active.builder {
|
|
276
|
+
background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
|
|
277
|
+
}
|
|
278
|
+
.builder-editor .role-toggle button.active.operator {
|
|
279
|
+
background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
|
|
280
|
+
}
|
|
281
|
+
.builder-editor .role-toggle button.active .role-icon {
|
|
282
|
+
transform: scale(1.1);
|
|
283
|
+
}
|
|
284
|
+
` }), _jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsxs("div", { className: "builder-editor p-6 max-w-4xl mx-auto space-y-6 pb-12", children: [_jsx("div", { className: "section-card p-8", children: _jsxs("div", { className: "flex items-start justify-between gap-6", children: [_jsxs("div", { children: [_jsxs("h1", { className: "text-2xl font-semibold text-slate-900 tracking-tight", children: [roleLabel, " Profile"] }), _jsxs("p", { className: "text-slate-500 mt-1 text-sm", children: ["Configure your ", roleLabel.toLowerCase(), " identity and capabilities"] })] }), _jsxs("div", { className: "flex flex-col items-end gap-1.5", children: [_jsxs("div", { className: "role-toggle", children: [_jsxs("button", { type: "button", onClick: () => handleSetOperator(false), className: !state?.isOperator ? "active builder" : "", children: [_jsx("span", { className: "role-icon", children: "\uD83D\uDD28" }), "Builder"] }), _jsxs("button", { type: "button", onClick: () => handleSetOperator(true), className: state?.isOperator ? "active operator" : "", children: [_jsx("span", { className: "role-icon", children: "\u26A1" }), "Operator"] })] }), _jsx("p", { className: "text-xs text-slate-400 text-right max-w-[180px]", children: state?.isOperator ? "Sells & buys services" : "Buys services" })] })] }) }), state && _jsx(ProfilePreview, { state: state }), _jsxs("div", { className: "section-card p-6", children: [_jsxs("h3", { className: "text-lg font-semibold text-slate-900 mb-6 flex items-center gap-2", children: [_jsx("span", { className: "w-8 h-8 rounded-lg bg-slate-100 flex items-center justify-center", children: _jsx(Info, { size: 18, className: "text-slate-600" }) }), "Metadata"] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { children: [_jsxs("label", { className: "field-label", children: [roleLabel, " ID"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "meta-value flex-1 truncate", children: doc?.header.id }), _jsx("button", { type: "button", className: "p-2 rounded-lg border border-slate-200 hover:bg-slate-50 transition-colors", title: `Copy ${roleLabel} ID`, onClick: () => {
|
|
232
285
|
void navigator.clipboard.writeText(doc?.header.id || "");
|
|
233
|
-
toast(
|
|
286
|
+
toast(`Copied ${roleLabel} ID!`, { type: "success" });
|
|
234
287
|
}, children: _jsx(Copy, { size: 16, className: "text-slate-500" }) })] })] }), _jsxs("div", { children: [_jsx("label", { className: "field-label", children: "Last Modified" }), _jsx("div", { className: "meta-value", children: state?.lastModified
|
|
235
288
|
? formatLastModified(state.lastModified)
|
|
236
|
-
: "Never modified" })] })] })] }), _jsxs("div", { className: "section-card p-6", children: [_jsxs("h3", { className: "text-lg font-semibold text-slate-900 mb-6 flex items-center gap-2", children: [_jsx("span", { className: "w-8 h-8 rounded-lg bg-indigo-50 flex items-center justify-center", children: _jsx(User, { size: 18, className: "text-indigo-600" }) }), "Identity"] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { children: [
|
|
289
|
+
: "Never modified" })] })] })] }), _jsxs("div", { className: "section-card p-6", children: [_jsxs("h3", { className: "text-lg font-semibold text-slate-900 mb-6 flex items-center gap-2", children: [_jsx("span", { className: "w-8 h-8 rounded-lg bg-indigo-50 flex items-center justify-center", children: _jsx(User, { size: 18, className: "text-indigo-600" }) }), "Identity"] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { children: [_jsxs("label", { className: "field-label", children: [roleLabel, " Name"] }), _jsx(TextInput, { className: "w-full", defaultValue: state?.name || "", onBlur: (e) => {
|
|
237
290
|
if (e.target.value !== state?.name) {
|
|
238
291
|
handleFieldChange("name", e.target.value);
|
|
239
292
|
}
|
|
@@ -249,7 +302,7 @@ export default function Editor() {
|
|
|
249
302
|
}
|
|
250
303
|
}, children: [_jsx("option", { value: "", disabled: true, children: "Select status..." }), STATUS_OPTIONS.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] })] }), _jsxs("div", { children: [_jsx("label", { className: "field-label", children: "Profile Type" }), _jsxs("div", { className: "type-toggle", children: [_jsx("button", { type: "button", onClick: () => handleTypeChange("INDIVIDUAL"), className: state?.type === "INDIVIDUAL" ? "active" : "", children: _jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx(User, { size: 16 }), "Individual"] }) }), _jsx("button", { type: "button", onClick: () => handleTypeChange("TEAM"), className: state?.type === "TEAM" ? "active" : "", children: _jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx(Users, { size: 16 }), "Team"] }) })] }), _jsx("p", { className: "field-hint", children: state?.type === "TEAM"
|
|
251
304
|
? "Teams can add contributors to their profile"
|
|
252
|
-
:
|
|
305
|
+
: `Individual profiles represent a single ${roleLabel.toLowerCase()}` })] })] })] }), _jsxs("div", { className: "section-card p-6", children: [_jsxs("h3", { className: "text-lg font-semibold text-slate-900 mb-6 flex items-center gap-2", children: [_jsx("span", { className: "w-8 h-8 rounded-lg bg-emerald-50 flex items-center justify-center", children: _jsx(FileText, { size: 18, className: "text-emerald-600" }) }), "Description & About"] }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsx("label", { className: "field-label mb-0", children: "Short Description" }), _jsxs("span", { className: `text-xs font-medium ${descriptionValue.length > DESCRIPTION_MAX_LENGTH
|
|
253
306
|
? "text-red-500"
|
|
254
307
|
: descriptionValue.length > DESCRIPTION_MAX_LENGTH * 0.9
|
|
255
308
|
? "text-amber-500"
|
|
@@ -265,5 +318,5 @@ export default function Editor() {
|
|
|
265
318
|
}
|
|
266
319
|
handleFieldChange("description", e.target.value);
|
|
267
320
|
}
|
|
268
|
-
}, placeholder:
|
|
321
|
+
}, placeholder: `A brief summary of your ${roleLabel.toLowerCase()} profile`, rows: 3, maxLength: DESCRIPTION_MAX_LENGTH + 50 }), descriptionValue.length > DESCRIPTION_MAX_LENGTH && (_jsxs("p", { className: "text-xs text-red-500 mt-1", children: ["Description exceeds ", DESCRIPTION_MAX_LENGTH, " character limit. Please shorten it to save."] })), _jsx("p", { className: "field-hint", children: "A short, plain-text description shown in previews and listings" })] }), _jsxs("div", { children: [_jsx(MarkdownEditor, { label: "About", height: 350, value: state?.about || "", onChange: () => { }, onBlur: (value) => handleFieldChange("about", value) }), _jsx("p", { className: "field-hint", children: "A detailed description with markdown formatting to showcase your capabilities" })] })] })] }), _jsx(SkillsSection, { skills: state?.skills || [], onAddSkill: handleAddSkill, onRemoveSkill: handleRemoveSkill }), _jsx(ScopesSection, { scopes: state?.scopes || [], onAddScope: handleAddScope, onRemoveScope: handleRemoveScope }), _jsx(LinksSection, { links: state?.links || [], onAddLink: handleAddLink, onEditLink: handleEditLink, onRemoveLink: handleRemoveLink }), state?.type === "TEAM" && (_jsx(ContributorsSection, { contributors: state.contributors, onAddContributor: handleAddContributor, onRemoveContributor: handleRemoveContributor })), _jsx(ToastContainer, { position: "bottom-right" })] })] }));
|
|
269
322
|
}
|