@powerhousedao/builder-profile 0.0.2 → 0.0.3
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 +13 -0
- package/dist/document-models/builder-profile/actions.d.ts.map +1 -0
- package/dist/document-models/builder-profile/actions.js +4 -0
- package/dist/document-models/builder-profile/gen/builder/actions.js +1 -1
- package/dist/document-models/builder-profile/gen/builder/creators.d.ts +2 -2
- package/dist/document-models/builder-profile/gen/builder/creators.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/builder/creators.js +3 -3
- package/dist/document-models/builder-profile/gen/builder/operations.js +3 -1
- package/dist/document-models/builder-profile/gen/creators.d.ts +1 -0
- package/dist/document-models/builder-profile/gen/creators.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/creators.js +1 -0
- package/dist/document-models/builder-profile/gen/document-model.d.ts +2 -2
- package/dist/document-models/builder-profile/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/document-model.js +23 -23
- package/dist/document-models/builder-profile/gen/document-schema.d.ts +218 -0
- package/dist/document-models/builder-profile/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/document-schema.js +33 -0
- package/dist/document-models/builder-profile/gen/document-type.d.ts +2 -0
- package/dist/document-models/builder-profile/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/document-type.js +1 -0
- package/dist/document-models/builder-profile/gen/index.d.ts +7 -3
- package/dist/document-models/builder-profile/gen/index.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/index.js +7 -2
- package/dist/document-models/builder-profile/gen/ph-factories.d.ts +6 -10
- 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 -4
- package/dist/document-models/builder-profile/gen/reducer.d.ts +1 -3
- package/dist/document-models/builder-profile/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/reducer.js +6 -9
- package/dist/document-models/builder-profile/gen/schema/index.d.ts +1 -1
- package/dist/document-models/builder-profile/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/schema/index.js +1 -1
- package/dist/document-models/builder-profile/gen/types.d.ts +9 -7
- package/dist/document-models/builder-profile/gen/types.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/types.js +1 -1
- package/dist/document-models/builder-profile/gen/utils.d.ts +13 -20
- package/dist/document-models/builder-profile/gen/utils.d.ts.map +1 -1
- package/dist/document-models/builder-profile/gen/utils.js +45 -36
- package/dist/document-models/builder-profile/hooks.d.ts +11 -0
- package/dist/document-models/builder-profile/hooks.d.ts.map +1 -0
- package/dist/document-models/builder-profile/hooks.js +26 -0
- package/dist/document-models/builder-profile/index.d.ts +5 -20
- package/dist/document-models/builder-profile/index.d.ts.map +1 -1
- package/dist/document-models/builder-profile/index.js +5 -17
- package/dist/document-models/builder-profile/module.d.ts +5 -0
- package/dist/document-models/builder-profile/module.d.ts.map +1 -0
- package/dist/document-models/builder-profile/module.js +10 -0
- package/dist/document-models/builder-profile/src/index.d.ts +2 -0
- package/dist/document-models/builder-profile/src/index.d.ts.map +1 -0
- package/dist/document-models/builder-profile/src/index.js +1 -0
- package/dist/document-models/builder-profile/src/reducers/builder.d.ts +2 -2
- package/dist/document-models/builder-profile/src/reducers/builder.d.ts.map +1 -1
- package/dist/document-models/builder-profile/src/reducers/builder.js +2 -2
- package/dist/document-models/builder-profile/src/tests/builder.test.d.ts +4 -0
- package/dist/document-models/builder-profile/src/tests/builder.test.d.ts.map +1 -1
- package/dist/document-models/builder-profile/src/tests/builder.test.js +14 -111
- package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/builder-profile/src/tests/document-model.test.js +91 -5
- package/dist/document-models/builder-profile/utils.d.ts +14 -0
- package/dist/document-models/builder-profile/utils.d.ts.map +1 -0
- package/dist/document-models/builder-profile/utils.js +7 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +2 -0
- package/dist/document-models/index.d.ts +5 -2
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +5 -1
- package/dist/editors/builder-profile/editor.d.ts +0 -2
- package/dist/editors/builder-profile/editor.d.ts.map +1 -1
- package/dist/editors/builder-profile/editor.js +26 -19
- package/dist/editors/builder-profile/module.d.ts +4 -0
- package/dist/editors/builder-profile/module.d.ts.map +1 -0
- package/dist/editors/builder-profile/module.js +10 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +2 -0
- package/dist/editors/index.d.ts +5 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +5 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/powerhouse.manifest.json +7 -20
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/style.css +108 -5029
- package/dist/subgraphs/builder-profile/index.d.ts +2 -2
- package/dist/subgraphs/builder-profile/index.d.ts.map +1 -1
- package/dist/subgraphs/builder-profile/index.js +2 -2
- package/dist/subgraphs/builder-profile/resolvers.d.ts +2 -2
- package/dist/subgraphs/builder-profile/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/builder-profile/resolvers.js +4 -4
- package/dist/subgraphs/builder-profile/schema.d.ts.map +1 -1
- package/dist/subgraphs/builder-profile/schema.js +1 -12
- package/dist/subgraphs/index.d.ts +0 -1
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vite.config.js +13 -0
- package/package.json +55 -45
- package/dist/document-models/builder-profile/gen/builder/object.d.ts +0 -7
- package/dist/document-models/builder-profile/gen/builder/object.d.ts.map +0 -1
- package/dist/document-models/builder-profile/gen/builder/object.js +0 -7
- package/dist/document-models/builder-profile/gen/object.d.ts +0 -15
- package/dist/document-models/builder-profile/gen/object.d.ts.map +0 -1
- package/dist/document-models/builder-profile/gen/object.js +0 -25
- package/dist/editors/builder-profile/index.d.ts +0 -3
- package/dist/editors/builder-profile/index.d.ts.map +0 -1
- package/dist/editors/builder-profile/index.js +0 -11
- package/dist/editors/hooks/useBuilderProfileDocument.d.ts +0 -4
- package/dist/editors/hooks/useBuilderProfileDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useBuilderProfileDocument.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/builder-profile/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/builder-profile/editor.tsx"],"names":[],"mappings":"AAkMA,MAAM,CAAC,OAAO,UAAU,MAAM,4CAwN7B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { TextInput, Textarea, Icon } from "@powerhousedao/document-engineering";
|
|
3
|
-
import { toast, ToastContainer } from "@powerhousedao/design-system";
|
|
3
|
+
import { toast, ToastContainer, DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
4
4
|
import { actions } from "../../document-models/builder-profile/index.js";
|
|
5
5
|
import { useCallback, useState, useEffect, useRef } from "react";
|
|
6
|
-
import { useSelectedBuilderProfileDocument } from "
|
|
6
|
+
import { useSelectedBuilderProfileDocument } from "../../document-models/builder-profile/hooks.js";
|
|
7
|
+
import { setSelectedNode, useParentFolderForSelectedNode } from "@powerhousedao/reactor-browser";
|
|
7
8
|
// Image Modal Component
|
|
8
9
|
function ImageModal({ isOpen, onClose, imageUrl, imageAlt, }) {
|
|
9
10
|
const [imageLoaded, setImageLoaded] = useState(false);
|
|
@@ -65,7 +66,13 @@ function ImageUrlInput({ label, value, onChange, placeholder, fileSize = "200KB"
|
|
|
65
66
|
export default function Editor() {
|
|
66
67
|
// Getting dispatch from selected document
|
|
67
68
|
const [doc, dispatch] = useSelectedBuilderProfileDocument();
|
|
68
|
-
const state = doc
|
|
69
|
+
const state = doc?.state.global;
|
|
70
|
+
// Get the parent folder node for the currently selected node
|
|
71
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
72
|
+
// Set the selected node to the parent folder node (close the editor)
|
|
73
|
+
function handleClose() {
|
|
74
|
+
setSelectedNode(parentFolder?.id);
|
|
75
|
+
}
|
|
69
76
|
// Track if we've already attempted to generate an ID
|
|
70
77
|
const idGeneratedRef = useRef(false);
|
|
71
78
|
// Auto-generate ID if not present (only once)
|
|
@@ -112,20 +119,20 @@ export default function Editor() {
|
|
|
112
119
|
dispatch(updateAction);
|
|
113
120
|
}
|
|
114
121
|
}, [dispatch, generateSlug]);
|
|
115
|
-
return (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
return (_jsxs("div", { className: "w-full bg-gray-50 min-h-screen", children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsxs("div", { className: "p-6 max-w-4xl mx-auto", children: [_jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Builder Profile" }), _jsx("p", { className: "text-gray-600", children: "Create and manage your builder profile information" })] }), state && (state.name || state.icon || state.description) && (_jsxs("div", { className: "bg-white rounded-lg p-6 shadow-sm mb-6", children: [_jsx("h3", { className: "text-lg font-medium text-gray-900 mb-4", children: "Profile Preview" }), _jsx("div", { className: "border border-gray-200 rounded-lg p-4", children: _jsxs("div", { className: "flex items-start space-x-4", children: [_jsx("div", { className: "flex-shrink-0", children: state.icon ? (_jsx("img", { src: state.icon, alt: "Profile icon", className: "w-16 h-16 rounded-full object-cover border-2 border-gray-200" })) : (_jsx("div", { className: "w-16 h-16 rounded-full bg-gray-200 flex items-center justify-center", children: _jsx(Icon, { name: "Image", size: 24, className: "text-gray-400" }) })) }), _jsxs("div", { className: "flex-1", children: [_jsx("h4", { className: "text-lg font-semibold text-gray-900", children: state.name || "Unnamed Builder" }), state.slug && (_jsxs("p", { className: "text-sm text-gray-500 mb-2", children: ["@", state.slug] })), state.description && (_jsx("p", { className: "text-gray-700", children: state.description }))] })] }) })] })), _jsx("div", { className: "bg-white rounded-lg p-6 shadow-sm", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Builder ID:" }), _jsxs("div", { className: "text-sm text-gray-500 flex items-center", children: [_jsx("span", { className: "mr-2", children: doc?.header.id }), _jsx("button", { type: "button", className: "ml-1 p-1 rounded transition active:bg-gray-400 hover:bg-gray-200", title: "Copy Builder ID", onClick: () => {
|
|
123
|
+
navigator.clipboard.writeText(doc?.header.id || "");
|
|
124
|
+
toast("Copied Builder ID!", {
|
|
125
|
+
type: "success",
|
|
126
|
+
});
|
|
127
|
+
}, children: _jsx(Icon, { name: "Copy", size: 16, className: "text-gray-400" }) })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Builder Name:" }), _jsx(TextInput, { className: "w-full", defaultValue: state?.name || "", onBlur: (e) => {
|
|
128
|
+
if (e.target.value !== state?.name) {
|
|
129
|
+
handleFieldChange("name", e.target.value);
|
|
130
|
+
}
|
|
131
|
+
}, placeholder: "Enter your name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Profile Slug:" }), _jsx(TextInput, { className: "w-full", value: state?.slug || "", onChange: (e) => {
|
|
132
|
+
handleFieldChange("slug", e.target.value);
|
|
133
|
+
}, placeholder: "your-profile-slug" }), _jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Used for your profile URL (lowercase, no spaces)" })] }), _jsx(ImageUrlInput, { label: "Profile Icon:", value: state?.icon || "", onChange: (value) => handleFieldChange("icon", value), placeholder: "BuilderIcon.jpg", fileSize: "200KB" }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Description:" }), _jsx(Textarea, { className: "w-full", defaultValue: state?.description || "", onBlur: (e) => {
|
|
134
|
+
if (e.target.value !== state?.description) {
|
|
135
|
+
handleFieldChange("description", e.target.value);
|
|
136
|
+
}
|
|
137
|
+
}, placeholder: "Tell us about yourself as a builder...", rows: 4, autoExpand: true })] })] }) }), _jsx(ToastContainer, { position: "bottom-right" })] })] }));
|
|
131
138
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/builder-profile/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,6DAA6D;AAC7D,eAAO,MAAM,cAAc,EAAE,YAO5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { lazy } from "react";
|
|
2
|
+
/** Document editor module for the Todo List document type */
|
|
3
|
+
export const BuilderProfile = {
|
|
4
|
+
Component: lazy(() => import("./editor.js")),
|
|
5
|
+
documentTypes: ["powerhouse/builder-profile"],
|
|
6
|
+
config: {
|
|
7
|
+
id: "builder-profile-editor",
|
|
8
|
+
name: "builder-profile",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../editors/editors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,OAAO,EAAE,YAAY,EAAqB,CAAC"}
|
package/dist/editors/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization.
|
|
3
|
+
* Delete the file and run the code generator again to have it reset
|
|
4
|
+
*/
|
|
5
|
+
export { BuilderProfile } from "./builder-profile/module.js";
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/editors/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Manifest } from "document-model";
|
|
1
|
+
import type { Manifest } from "document-model";
|
|
2
2
|
export declare const manifest: Manifest;
|
|
3
|
-
export declare const documentModels: import("document-model").DocumentModelModule<import("./document-models/builder-profile/
|
|
3
|
+
export declare const documentModels: import("document-model").DocumentModelModule<import("./document-models/builder-profile/index.js").BuilderProfilePHState>[];
|
|
4
4
|
export declare const editors: import("document-model").EditorModule[];
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,QAAQ,EAAE,QAAuB,CAAC;AAC/C,eAAO,MAAM,cAAc,4HAAuC,CAAC;AACnE,eAAO,MAAM,OAAO,yCAAgC,CAAC"}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"description": "
|
|
4
|
-
"category": "
|
|
2
|
+
"name": "",
|
|
3
|
+
"description": "",
|
|
4
|
+
"category": "",
|
|
5
5
|
"publisher": {
|
|
6
|
-
"name": "
|
|
7
|
-
"url": "
|
|
6
|
+
"name": "",
|
|
7
|
+
"url": ""
|
|
8
8
|
},
|
|
9
|
-
"documentModels": [
|
|
10
|
-
|
|
11
|
-
"id": "powerhouse/builder-profile",
|
|
12
|
-
"name": "Builder Profile"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"editors": [
|
|
16
|
-
{
|
|
17
|
-
"id": "builder-profile-editor",
|
|
18
|
-
"name": "Builder Profile Editor",
|
|
19
|
-
"documentTypes": [
|
|
20
|
-
"powerhouse/builder-profile"
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
],
|
|
9
|
+
"documentModels": [],
|
|
10
|
+
"editors": [],
|
|
24
11
|
"apps": [],
|
|
25
12
|
"subgraphs": [],
|
|
26
13
|
"importScripts": []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":""}
|