@powerhousedao/renown-package 0.0.0 → 0.0.2

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 (61) hide show
  1. package/dist/document-models/index.d.ts +1 -0
  2. package/dist/document-models/index.js +1 -0
  3. package/dist/document-models/renown-credential/gen/actions.d.ts +3 -0
  4. package/dist/document-models/renown-credential/gen/actions.js +1 -0
  5. package/dist/document-models/renown-credential/gen/creators.d.ts +1 -0
  6. package/dist/document-models/renown-credential/gen/creators.js +1 -0
  7. package/dist/document-models/renown-credential/gen/document-model.d.ts +2 -0
  8. package/dist/document-models/renown-credential/gen/document-model.js +59 -0
  9. package/dist/document-models/renown-credential/gen/index.d.ts +7 -0
  10. package/dist/document-models/renown-credential/gen/index.js +6 -0
  11. package/dist/document-models/renown-credential/gen/manager/actions.d.ts +11 -0
  12. package/dist/document-models/renown-credential/gen/manager/actions.js +1 -0
  13. package/dist/document-models/renown-credential/gen/manager/creators.d.ts +4 -0
  14. package/dist/document-models/renown-credential/gen/manager/creators.js +4 -0
  15. package/dist/document-models/renown-credential/gen/manager/error.d.ts +1 -0
  16. package/dist/document-models/renown-credential/gen/manager/error.js +1 -0
  17. package/dist/document-models/renown-credential/gen/manager/object.d.ts +7 -0
  18. package/dist/document-models/renown-credential/gen/manager/object.js +10 -0
  19. package/dist/document-models/renown-credential/gen/manager/operations.d.ts +7 -0
  20. package/dist/document-models/renown-credential/gen/manager/operations.js +1 -0
  21. package/dist/document-models/renown-credential/gen/object.d.ts +14 -0
  22. package/dist/document-models/renown-credential/gen/object.js +25 -0
  23. package/dist/document-models/renown-credential/gen/ph-factories.d.ts +26 -0
  24. package/dist/document-models/renown-credential/gen/ph-factories.js +55 -0
  25. package/dist/document-models/renown-credential/gen/reducer.d.ts +4 -0
  26. package/dist/document-models/renown-credential/gen/reducer.js +24 -0
  27. package/dist/document-models/renown-credential/gen/schema/index.d.ts +2 -0
  28. package/dist/document-models/renown-credential/gen/schema/index.js +2 -0
  29. package/dist/document-models/renown-credential/gen/schema/types.d.ts +156 -0
  30. package/dist/document-models/renown-credential/gen/schema/types.js +1 -0
  31. package/dist/document-models/renown-credential/gen/schema/zod.d.ts +12 -0
  32. package/dist/document-models/renown-credential/gen/schema/zod.js +30 -0
  33. package/dist/document-models/renown-credential/gen/types.d.ts +9 -0
  34. package/dist/document-models/renown-credential/gen/types.js +1 -0
  35. package/dist/document-models/renown-credential/gen/utils.d.ts +21 -0
  36. package/dist/document-models/renown-credential/gen/utils.js +47 -0
  37. package/dist/document-models/renown-credential/index.d.ts +25 -0
  38. package/dist/document-models/renown-credential/index.js +21 -0
  39. package/dist/document-models/renown-credential/src/reducers/manager.d.ts +2 -0
  40. package/dist/document-models/renown-credential/src/reducers/manager.js +23 -0
  41. package/dist/document-models/renown-credential/src/tests/document-model.test.d.ts +5 -0
  42. package/dist/document-models/renown-credential/src/tests/document-model.test.js +18 -0
  43. package/dist/document-models/renown-credential/src/tests/manager.test.d.ts +5 -0
  44. package/dist/document-models/renown-credential/src/tests/manager.test.js +32 -0
  45. package/dist/document-models/renown-credential/src/utils.d.ts +1 -0
  46. package/dist/document-models/renown-credential/src/utils.js +1 -0
  47. package/dist/editors/renown-user-editor/editor.js +5 -5
  48. package/dist/index.d.ts +1 -1
  49. package/dist/powerhouse.manifest.json +4 -0
  50. package/dist/style.css +133 -139
  51. package/dist/subgraphs/index.d.ts +1 -0
  52. package/dist/subgraphs/index.js +1 -0
  53. package/dist/subgraphs/renown-credential/index.d.ts +10 -0
  54. package/dist/subgraphs/renown-credential/index.js +11 -0
  55. package/dist/subgraphs/renown-credential/resolvers.d.ts +2 -0
  56. package/dist/subgraphs/renown-credential/resolvers.js +96 -0
  57. package/dist/subgraphs/renown-credential/schema.d.ts +2 -0
  58. package/dist/subgraphs/renown-credential/schema.js +60 -0
  59. package/dist/subgraphs/renown-read-model/resolvers.js +3 -99
  60. package/dist/subgraphs/renown-read-model/schema.js +2 -28
  61. package/package.json +1 -1
@@ -0,0 +1,21 @@
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
+ import { actions as BaseActions, } from "document-model";
6
+ import { actions as RenownCredentialActions } from "./gen/index.js";
7
+ import { reducer } from "./gen/reducer.js";
8
+ import { documentModel } from "./gen/document-model.js";
9
+ import genUtils from "./gen/utils.js";
10
+ import * as customUtils from "./src/utils.js";
11
+ const utils = { ...genUtils, ...customUtils };
12
+ const actions = { ...BaseActions, ...RenownCredentialActions };
13
+ export const module = {
14
+ reducer,
15
+ actions,
16
+ utils,
17
+ documentModel,
18
+ };
19
+ export { reducer, actions, utils, documentModel };
20
+ export * from "./gen/types.js";
21
+ export * from "./src/utils.js";
@@ -0,0 +1,2 @@
1
+ import type { RenownCredentialManagerOperations } from "../../gen/manager/operations.js";
2
+ export declare const reducer: RenownCredentialManagerOperations;
@@ -0,0 +1,23 @@
1
+ export const reducer = {
2
+ initOperation(state, action, dispatch) {
3
+ const { issuer, subject, jwt, audience, payload } = action.input;
4
+ const credential = {
5
+ issuer: issuer || null,
6
+ subject: subject || null,
7
+ jwt,
8
+ revoked: false,
9
+ audience: audience || null,
10
+ payload: payload || null,
11
+ };
12
+ state = {
13
+ ...state,
14
+ ...credential,
15
+ };
16
+ },
17
+ revokeOperation(state, action, dispatch) {
18
+ const { jwt } = action.input;
19
+ state.revoked = true;
20
+ state.jwt = jwt || null;
21
+ return state;
22
+ },
23
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This is a scaffold file meant for customization:
3
+ * - change it by adding new tests or modifying the existing ones
4
+ */
5
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This is a scaffold file meant for customization:
3
+ * - change it by adding new tests or modifying the existing ones
4
+ */
5
+ import { describe, it, expect } from "vitest";
6
+ import utils, { initialGlobalState, initialLocalState, } from "../../gen/utils.js";
7
+ describe("Renown Credential Document Model", () => {
8
+ it("should create a new Renown Credential document", () => {
9
+ const document = utils.createDocument();
10
+ expect(document).toBeDefined();
11
+ expect(document.header.documentType).toBe("renown/credential");
12
+ });
13
+ it("should create a new Renown Credential document with a valid initial state", () => {
14
+ const document = utils.createDocument();
15
+ expect(document.state.global).toStrictEqual(initialGlobalState);
16
+ expect(document.state.local).toStrictEqual(initialLocalState);
17
+ });
18
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This is a scaffold file meant for customization:
3
+ * - change it by adding new tests or modifying the existing ones
4
+ */
5
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This is a scaffold file meant for customization:
3
+ * - change it by adding new tests or modifying the existing ones
4
+ */
5
+ import { describe, it, expect, beforeEach } from "vitest";
6
+ import { generateMock } from "@powerhousedao/codegen";
7
+ import utils from "../../gen/utils.js";
8
+ import { z } from "../../gen/schema/index.js";
9
+ import { reducer } from "../../gen/reducer.js";
10
+ import * as creators from "../../gen/manager/creators.js";
11
+ describe("Manager Operations", () => {
12
+ let document;
13
+ beforeEach(() => {
14
+ document = utils.createDocument();
15
+ });
16
+ it("should handle init operation", () => {
17
+ const input = generateMock(z.InitInputSchema());
18
+ const updatedDocument = reducer(document, creators.init(input));
19
+ expect(updatedDocument.operations.global).toHaveLength(1);
20
+ expect(updatedDocument.operations.global[0].action.type).toBe("INIT");
21
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
22
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
23
+ });
24
+ it("should handle revoke operation", () => {
25
+ const input = generateMock(z.RevokeInputSchema());
26
+ const updatedDocument = reducer(document, creators.revoke(input));
27
+ expect(updatedDocument.operations.global).toHaveLength(1);
28
+ expect(updatedDocument.operations.global[0].action.type).toBe("REVOKE");
29
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
30
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
31
+ });
32
+ });
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useSelectedDocument } from "@powerhousedao/reactor-browser";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useSelectedDocument, } from "@powerhousedao/reactor-browser";
3
3
  import { useCallback, useState } from "react";
4
4
  import { actions, } from "../../document-models/renown-user/index.js";
5
- import { Form, StringField, UrlField, Button } from "@powerhousedao/document-engineering";
5
+ import { Form, StringField, UrlField, Button, } from "@powerhousedao/document-engineering";
6
6
  export function Editor(props) {
7
7
  const [document, dispatch] = useSelectedDocument();
8
8
  if (!document) {
@@ -11,7 +11,7 @@ export function Editor(props) {
11
11
  const typedDocument = document;
12
12
  // Local form state
13
13
  const [isEditingUser, setIsEditingUser] = useState(false);
14
- const { state: { global } } = typedDocument;
14
+ const { state: { global }, } = typedDocument;
15
15
  const { username, ethAddress, userImage } = global;
16
16
  // User handlers
17
17
  const handleSetUsername = useCallback((newUsername) => {
@@ -29,5 +29,5 @@ export function Editor(props) {
29
29
  dispatch(actions.setUserImage({ userImage: imageUrl.trim() }));
30
30
  }
31
31
  }, [userImage, dispatch]);
32
- return (_jsxs("div", { className: "html-defaults-container min-h-screen bg-gray-50", children: [_jsx("div", { className: "bg-white shadow-sm border-b", children: _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8", children: _jsx("div", { className: "py-6", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center space-x-4", children: [_jsx("div", { className: "flex-shrink-0", children: userImage ? (_jsx("img", { className: "w-16 h-16 rounded-full object-cover border-2 border-blue-500", src: userImage, alt: username || "User" })) : (_jsx("div", { className: "w-16 h-16 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center", children: _jsx("svg", { className: "w-8 h-8 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }) })) }), _jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900", children: username || "Renown User" }), _jsx("p", { className: "text-sm text-gray-500 font-mono", children: ethAddress || "No Ethereum address set" })] })] }), _jsx("div", { className: "flex items-center space-x-3", children: _jsx(Button, { color: "light", onClick: () => setIsEditingUser(!isEditingUser), children: isEditingUser ? "Cancel" : "Edit User" }) })] }) }) }) }), _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8", children: _jsxs("div", { className: "grid grid-cols-1 gap-8", children: [_jsxs("div", { className: "bg-white rounded-lg shadow-sm border", children: [_jsxs("div", { className: "px-6 py-4 border-b border-gray-200", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900", children: "User Information" }), _jsx("p", { className: "text-sm text-gray-500", children: "Manage your renown User details" })] }), _jsx("div", { className: "p-6", children: isEditingUser ? (_jsx(Form, { onSubmit: (e) => e.preventDefault(), children: _jsxs("div", { className: "space-y-6", children: [_jsx(StringField, { name: "username", label: "Username", value: username || "", onChange: (e) => handleSetUsername(e.target.value), placeholder: "Enter your username", description: "Your display name on the platform" }), _jsx(StringField, { name: "ethAddress", label: "Ethereum Address", value: ethAddress || "", onChange: (e) => handleSetEthAddress(e.target.value), placeholder: "0x...", description: "Your Ethereum wallet address" }), _jsx(UrlField, { name: "userImage", label: "User Image URL", value: userImage || "", onChange: (e) => handleSetUserImage(e.target.value), placeholder: "https://example.com/avatar.png", description: "URL to your User image" }), _jsxs("div", { className: "flex justify-end space-x-3 pt-4 border-t", children: [_jsx(Button, { color: "light", onClick: () => setIsEditingUser(false), children: "Cancel" }), _jsx(Button, { onClick: () => setIsEditingUser(false), children: "Save Changes" })] })] }) })) : (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Username" }), _jsx("div", { className: "flex items-center", children: _jsx("p", { className: "text-base text-gray-900", children: username || _jsx("span", { className: "text-gray-400 italic", children: "Not set" }) }) })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ethereum Address" }), _jsx("div", { className: "flex items-center", children: _jsx("p", { className: "text-sm font-mono text-gray-900 break-all", children: ethAddress || _jsx("span", { className: "text-gray-400 italic", children: "Not set" }) }) })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "User Image" }), userImage ? (_jsxs("div", { className: "flex items-center space-x-4", children: [_jsx("img", { src: userImage, alt: "User", className: "w-20 h-20 rounded-lg object-cover border border-gray-200" }), _jsx("div", { className: "flex-1", children: _jsx("a", { href: userImage, target: "_blank", rel: "noopener noreferrer", className: "text-sm text-blue-600 hover:text-blue-800 hover:underline break-all", children: userImage }) })] })) : (_jsx("p", { className: "text-gray-400 italic", children: "No image set" }))] }), _jsx("div", { className: "pt-4 border-t", children: _jsx(Button, { onClick: () => setIsEditingUser(true), children: "Edit User" }) })] })) })] }), _jsxs("div", { className: "bg-gradient-to-br from-blue-50 to-purple-50 rounded-lg shadow-sm border border-blue-100", children: [_jsx("div", { className: "px-6 py-4 border-b border-blue-100", children: _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "User Summary" }) }), _jsx("div", { className: "p-6", children: _jsxs("div", { className: "flex items-center space-x-6", children: [_jsx("div", { className: "flex-shrink-0", children: userImage ? (_jsx("img", { src: userImage, alt: username || "User", className: "w-24 h-24 rounded-full object-cover border-4 border-white shadow-lg" })) : (_jsx("div", { className: "w-24 h-24 bg-gradient-to-br from-blue-400 to-purple-500 rounded-full flex items-center justify-center shadow-lg", children: _jsx("span", { className: "text-3xl text-white font-bold", children: username ? username.charAt(0).toUpperCase() : "?" }) })) }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-2", children: username || "Anonymous User" }), ethAddress && (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("svg", { className: "w-5 h-5 text-gray-500", fill: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { d: "M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z" }) }), _jsx("span", { className: "text-sm font-mono text-gray-600", children: ethAddress })] })), !username && !ethAddress && (_jsx("p", { className: "text-gray-500 italic", children: "No User information available. Click \"Edit User\" to get started." }))] })] }) })] })] }) })] }));
32
+ return (_jsxs("div", { className: "html-defaults-container min-h-screen bg-gray-50", children: [_jsx("div", { children: _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8", children: _jsx("div", { className: "py-8", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center space-x-5", children: [_jsx("div", { className: "flex-shrink-0", children: userImage ? (_jsx("img", { className: "w-20 h-20 rounded-xl object-cover ring-2 ring-gray-200 shadow-sm", src: userImage, alt: username || "User" })) : (_jsx("div", { className: "w-20 h-20 bg-gray-100 rounded-xl flex items-center justify-center ring-2 ring-gray-200 shadow-sm", children: _jsx("svg", { className: "w-10 h-10 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }) })) }), _jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900", children: username || "Renown User" }), _jsx("p", { className: "text-gray-600 mt-1 text-sm font-mono", children: ethAddress || "No Ethereum address set" })] })] }), _jsx("div", { className: "flex items-center space-x-3", children: _jsx(Button, { color: "light", onClick: () => setIsEditingUser(!isEditingUser), children: _jsx("span", { className: "inline-flex items-center gap-2", children: isEditingUser ? (_jsxs(_Fragment, { children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), "Cancel"] })) : (_jsxs(_Fragment, { children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }), "Edit User"] })) }) }) })] }) }) }) }), _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8", children: _jsxs("div", { className: "grid grid-cols-1 gap-8", children: [_jsxs("div", { className: "bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden", children: [_jsx("div", { className: "px-6 py-5 bg-gray-50", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("svg", { className: "w-6 h-6 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "User Information" }), _jsx("p", { className: "text-sm text-gray-600 mt-1", children: "Manage your Renown user profile details" })] })] }) }), _jsx("div", { className: "p-6", children: isEditingUser ? (_jsx(Form, { onSubmit: (e) => e.preventDefault(), children: _jsxs("div", { className: "space-y-6", children: [_jsx(StringField, { name: "username", label: "Username", value: username || "", onChange: (e) => handleSetUsername(e.target.value), placeholder: "Enter your username", description: "Your display name on the platform" }), _jsx(StringField, { name: "ethAddress", label: "Ethereum Address", value: ethAddress || "", onChange: (e) => handleSetEthAddress(e.target.value), placeholder: "0x...", description: "Your Ethereum wallet address" }), _jsx(UrlField, { name: "userImage", label: "User Image URL", value: userImage || "", onChange: (e) => handleSetUserImage(e.target.value), placeholder: "https://example.com/avatar.png", description: "URL to your User image" }), _jsxs("div", { className: "flex justify-end space-x-3 pt-4", children: [_jsx(Button, { color: "light", onClick: () => setIsEditingUser(false), children: _jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), "Cancel"] }) }), _jsx(Button, { onClick: () => setIsEditingUser(false), children: _jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }), "Save Changes"] }) })] })] }) })) : (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "bg-gray-50 p-4 rounded-lg border border-gray-200", children: [_jsx("label", { className: "block text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2", children: "Username" }), _jsx("p", { className: "text-base font-medium text-gray-900", children: username || (_jsx("span", { className: "text-gray-400 italic", children: "Not set" })) })] }), _jsxs("div", { className: "bg-gray-50 p-4 rounded-lg border border-gray-200", children: [_jsx("label", { className: "block text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2", children: "Ethereum Address" }), _jsx("p", { className: "text-sm font-mono text-gray-900 break-all", children: ethAddress || (_jsx("span", { className: "text-gray-400 italic", children: "Not set" })) })] })] }), _jsxs("div", { className: "bg-gray-50 p-4 rounded-lg border border-gray-200", children: [_jsx("label", { className: "block text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3", children: "User Image" }), userImage ? (_jsxs("div", { className: "flex items-center space-x-4", children: [_jsx("img", { src: userImage, alt: "User", className: "w-20 h-20 rounded-lg object-cover border border-gray-200" }), _jsx("div", { className: "flex-1", children: _jsx("a", { href: userImage, target: "_blank", rel: "noopener noreferrer", className: "text-sm text-gray-600 hover:text-gray-900 hover:underline break-all", children: userImage }) })] })) : (_jsx("p", { className: "text-gray-500 italic", children: "No image set" }))] })] })) })] }), _jsxs("div", { className: "bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden", children: [_jsx("div", { className: "px-6 py-5 bg-gray-50", children: _jsx("h3", { className: "text-xl font-bold text-gray-900", children: "User Summary" }) }), _jsx("div", { className: "p-6", children: _jsxs("div", { className: "flex items-center space-x-6", children: [_jsx("div", { className: "flex-shrink-0", children: userImage ? (_jsx("img", { src: userImage, alt: username || "User", className: "w-24 h-24 rounded-full object-cover ring-4 ring-gray-200 shadow-sm" })) : (_jsx("div", { className: "w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center ring-4 ring-gray-200 shadow-sm", children: _jsx("span", { className: "text-3xl text-gray-600 font-bold", children: username ? username.charAt(0).toUpperCase() : "?" }) })) }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-2", children: username || "Anonymous User" }), ethAddress && (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("svg", { className: "w-5 h-5 text-gray-500", fill: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { d: "M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z" }) }), _jsx("span", { className: "text-sm font-mono text-gray-600", children: ethAddress })] })), !username && !ethAddress && (_jsx("p", { className: "text-gray-500 italic", children: "No user information available. Click \"Edit User\" to get started." }))] })] }) })] })] }) })] }));
33
33
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
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/renown-user/gen").RenownUserPHState>[];
3
+ export declare const documentModels: (import("document-model").DocumentModelModule<import("./document-models/renown-user/gen").RenownUserPHState> | import("document-model").DocumentModelModule<import("./document-models/renown-credential/gen").RenownCredentialPHState>)[];
4
4
  export declare const editors: import("document-model").EditorModule[];
@@ -10,6 +10,10 @@
10
10
  {
11
11
  "id": "powerhouse/renown-user",
12
12
  "name": "RenownUser"
13
+ },
14
+ {
15
+ "id": "renown/credential",
16
+ "name": "RenownCredential"
13
17
  }
14
18
  ],
15
19
  "editors": [
package/dist/style.css CHANGED
@@ -59,9 +59,6 @@
59
59
  --color-blue-900: oklch(37.9% 0.146 265.522);
60
60
  --color-indigo-50: oklch(96.2% 0.018 272.314);
61
61
  --color-indigo-800: oklch(39.8% 0.195 277.366);
62
- --color-purple-50: oklch(97.7% 0.014 308.299);
63
- --color-purple-500: oklch(62.7% 0.265 303.9);
64
- --color-purple-600: oklch(55.8% 0.288 302.321);
65
62
  --color-purple-800: oklch(43.8% 0.218 303.724);
66
63
  --color-purple-900: oklch(38.1% 0.176 304.987);
67
64
  --color-pink-400: oklch(71.8% 0.202 349.761);
@@ -304,9 +301,15 @@
304
301
  .mx-auto {
305
302
  margin-inline: auto;
306
303
  }
304
+ .mt-1 {
305
+ margin-top: calc(var(--spacing) * 1);
306
+ }
307
307
  .mb-2 {
308
308
  margin-bottom: calc(var(--spacing) * 2);
309
309
  }
310
+ .mb-3 {
311
+ margin-bottom: calc(var(--spacing) * 3);
312
+ }
310
313
  .block {
311
314
  display: block;
312
315
  }
@@ -319,17 +322,23 @@
319
322
  .grid {
320
323
  display: grid;
321
324
  }
325
+ .inline-flex {
326
+ display: inline-flex;
327
+ }
322
328
  .table {
323
329
  display: table;
324
330
  }
331
+ .h-4 {
332
+ height: calc(var(--spacing) * 4);
333
+ }
325
334
  .h-5 {
326
335
  height: calc(var(--spacing) * 5);
327
336
  }
328
- .h-8 {
329
- height: calc(var(--spacing) * 8);
337
+ .h-6 {
338
+ height: calc(var(--spacing) * 6);
330
339
  }
331
- .h-16 {
332
- height: calc(var(--spacing) * 16);
340
+ .h-10 {
341
+ height: calc(var(--spacing) * 10);
333
342
  }
334
343
  .h-20 {
335
344
  height: calc(var(--spacing) * 20);
@@ -340,14 +349,17 @@
340
349
  .min-h-screen {
341
350
  min-height: 100vh;
342
351
  }
352
+ .w-4 {
353
+ width: calc(var(--spacing) * 4);
354
+ }
343
355
  .w-5 {
344
356
  width: calc(var(--spacing) * 5);
345
357
  }
346
- .w-8 {
347
- width: calc(var(--spacing) * 8);
358
+ .w-6 {
359
+ width: calc(var(--spacing) * 6);
348
360
  }
349
- .w-16 {
350
- width: calc(var(--spacing) * 16);
361
+ .w-10 {
362
+ width: calc(var(--spacing) * 10);
351
363
  }
352
364
  .w-20 {
353
365
  width: calc(var(--spacing) * 20);
@@ -379,6 +391,12 @@
379
391
  .justify-end {
380
392
  justify-content: flex-end;
381
393
  }
394
+ .gap-1\.5 {
395
+ gap: calc(var(--spacing) * 1.5);
396
+ }
397
+ .gap-2 {
398
+ gap: calc(var(--spacing) * 2);
399
+ }
382
400
  .gap-6 {
383
401
  gap: calc(var(--spacing) * 6);
384
402
  }
@@ -413,6 +431,13 @@
413
431
  margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
414
432
  }
415
433
  }
434
+ .space-x-5 {
435
+ :where(& > :not(:last-child)) {
436
+ --tw-space-x-reverse: 0;
437
+ margin-inline-start: calc(calc(var(--spacing) * 5) * var(--tw-space-x-reverse));
438
+ margin-inline-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-x-reverse)));
439
+ }
440
+ }
416
441
  .space-x-6 {
417
442
  :where(& > :not(:last-child)) {
418
443
  --tw-space-x-reverse: 0;
@@ -420,81 +445,40 @@
420
445
  margin-inline-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-x-reverse)));
421
446
  }
422
447
  }
448
+ .overflow-hidden {
449
+ overflow: hidden;
450
+ }
423
451
  .rounded-full {
424
452
  border-radius: calc(infinity * 1px);
425
453
  }
426
454
  .rounded-lg {
427
455
  border-radius: var(--radius-lg);
428
456
  }
457
+ .rounded-xl {
458
+ border-radius: var(--radius-xl);
459
+ }
429
460
  .border {
430
461
  border-style: var(--tw-border-style);
431
462
  border-width: 1px;
432
463
  }
433
- .border-2 {
434
- border-style: var(--tw-border-style);
435
- border-width: 2px;
436
- }
437
- .border-4 {
438
- border-style: var(--tw-border-style);
439
- border-width: 4px;
440
- }
441
- .border-t {
442
- border-top-style: var(--tw-border-style);
443
- border-top-width: 1px;
444
- }
445
- .border-b {
446
- border-bottom-style: var(--tw-border-style);
447
- border-bottom-width: 1px;
448
- }
449
- .border-blue-100 {
450
- border-color: var(--color-blue-100);
451
- }
452
- .border-blue-500 {
453
- border-color: var(--color-blue-500);
454
- }
455
464
  .border-gray-200 {
456
465
  border-color: var(--color-gray-200);
457
466
  }
458
- .border-white {
459
- border-color: var(--color-white);
460
- }
461
467
  .bg-gray-50 {
462
468
  background-color: var(--color-gray-50);
463
469
  }
470
+ .bg-gray-100 {
471
+ background-color: var(--color-gray-100);
472
+ }
464
473
  .bg-white {
465
474
  background-color: var(--color-white);
466
475
  }
467
- .bg-gradient-to-br {
468
- --tw-gradient-position: to bottom right in oklab;
469
- background-image: linear-gradient(var(--tw-gradient-stops));
470
- }
471
- .from-blue-50 {
472
- --tw-gradient-from: var(--color-blue-50);
473
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
474
- }
475
- .from-blue-400 {
476
- --tw-gradient-from: var(--color-blue-400);
477
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
478
- }
479
- .from-blue-500 {
480
- --tw-gradient-from: var(--color-blue-500);
481
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
482
- }
483
- .to-purple-50 {
484
- --tw-gradient-to: var(--color-purple-50);
485
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
486
- }
487
- .to-purple-500 {
488
- --tw-gradient-to: var(--color-purple-500);
489
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
490
- }
491
- .to-purple-600 {
492
- --tw-gradient-to: var(--color-purple-600);
493
- --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
494
- }
495
476
  .object-cover {
496
477
  object-fit: cover;
497
478
  }
479
+ .p-4 {
480
+ padding: calc(var(--spacing) * 4);
481
+ }
498
482
  .p-6 {
499
483
  padding: calc(var(--spacing) * 6);
500
484
  }
@@ -504,11 +488,8 @@
504
488
  .px-6 {
505
489
  padding-inline: calc(var(--spacing) * 6);
506
490
  }
507
- .py-4 {
508
- padding-block: calc(var(--spacing) * 4);
509
- }
510
- .py-6 {
511
- padding-block: calc(var(--spacing) * 6);
491
+ .py-5 {
492
+ padding-block: calc(var(--spacing) * 5);
512
493
  }
513
494
  .py-8 {
514
495
  padding-block: calc(var(--spacing) * 8);
@@ -531,14 +512,18 @@
531
512
  font-size: var(--text-base);
532
513
  line-height: var(--tw-leading, var(--text-base--line-height));
533
514
  }
534
- .text-lg {
535
- font-size: var(--text-lg);
536
- line-height: var(--tw-leading, var(--text-lg--line-height));
537
- }
538
515
  .text-sm {
539
516
  font-size: var(--text-sm);
540
517
  line-height: var(--tw-leading, var(--text-sm--line-height));
541
518
  }
519
+ .text-xl {
520
+ font-size: var(--text-xl);
521
+ line-height: var(--tw-leading, var(--text-xl--line-height));
522
+ }
523
+ .text-xs {
524
+ font-size: var(--text-xs);
525
+ line-height: var(--tw-leading, var(--text-xs--line-height));
526
+ }
542
527
  .font-bold {
543
528
  --tw-font-weight: var(--font-weight-bold);
544
529
  font-weight: var(--font-weight-bold);
@@ -551,12 +536,13 @@
551
536
  --tw-font-weight: var(--font-weight-semibold);
552
537
  font-weight: var(--font-weight-semibold);
553
538
  }
539
+ .tracking-wider {
540
+ --tw-tracking: var(--tracking-wider);
541
+ letter-spacing: var(--tracking-wider);
542
+ }
554
543
  .break-all {
555
544
  word-break: break-all;
556
545
  }
557
- .text-blue-600 {
558
- color: var(--color-blue-600);
559
- }
560
546
  .text-gray-400 {
561
547
  color: var(--color-gray-400);
562
548
  }
@@ -566,33 +552,41 @@
566
552
  .text-gray-600 {
567
553
  color: var(--color-gray-600);
568
554
  }
569
- .text-gray-700 {
570
- color: var(--color-gray-700);
571
- }
572
555
  .text-gray-900 {
573
556
  color: var(--color-gray-900);
574
557
  }
575
- .text-white {
576
- color: var(--color-white);
558
+ .uppercase {
559
+ text-transform: uppercase;
577
560
  }
578
561
  .italic {
579
562
  font-style: italic;
580
563
  }
581
- .shadow-lg {
582
- --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
564
+ .shadow-md {
565
+ --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
583
566
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
584
567
  }
585
568
  .shadow-sm {
586
569
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
587
570
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
588
571
  }
572
+ .ring-2 {
573
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
574
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
575
+ }
576
+ .ring-4 {
577
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
578
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
579
+ }
580
+ .ring-gray-200 {
581
+ --tw-ring-color: var(--color-gray-200);
582
+ }
589
583
  .filter {
590
584
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
591
585
  }
592
- .hover\:text-blue-800 {
586
+ .hover\:text-gray-900 {
593
587
  &:hover {
594
588
  @media (hover: hover) {
595
- color: var(--color-blue-800);
589
+ color: var(--color-gray-900);
596
590
  }
597
591
  }
598
592
  }
@@ -5118,10 +5112,6 @@ input[type="number"] {
5118
5112
  syntax: "*";
5119
5113
  inherits: false;
5120
5114
  }
5121
- @property --tw-tracking {
5122
- syntax: "*";
5123
- inherits: false;
5124
- }
5125
5115
  @property --tw-outline-style {
5126
5116
  syntax: "*";
5127
5117
  inherits: false;
@@ -11762,6 +11752,48 @@ input[type="number"] {
11762
11752
  scrollbar-width: initial;
11763
11753
  }
11764
11754
  }
11755
+ @property --tw-gradient-position {
11756
+ syntax: "*";
11757
+ inherits: false;
11758
+ }
11759
+ @property --tw-gradient-from {
11760
+ syntax: "<color>";
11761
+ inherits: false;
11762
+ initial-value: #0000;
11763
+ }
11764
+ @property --tw-gradient-via {
11765
+ syntax: "<color>";
11766
+ inherits: false;
11767
+ initial-value: #0000;
11768
+ }
11769
+ @property --tw-gradient-to {
11770
+ syntax: "<color>";
11771
+ inherits: false;
11772
+ initial-value: #0000;
11773
+ }
11774
+ @property --tw-gradient-stops {
11775
+ syntax: "*";
11776
+ inherits: false;
11777
+ }
11778
+ @property --tw-gradient-via-stops {
11779
+ syntax: "*";
11780
+ inherits: false;
11781
+ }
11782
+ @property --tw-gradient-from-position {
11783
+ syntax: "<length-percentage>";
11784
+ inherits: false;
11785
+ initial-value: 0%;
11786
+ }
11787
+ @property --tw-gradient-via-position {
11788
+ syntax: "<length-percentage>";
11789
+ inherits: false;
11790
+ initial-value: 50%;
11791
+ }
11792
+ @property --tw-gradient-to-position {
11793
+ syntax: "<length-percentage>";
11794
+ inherits: false;
11795
+ initial-value: 100%;
11796
+ }
11765
11797
  @keyframes spin {
11766
11798
  to {
11767
11799
  transform: rotate(360deg);
@@ -17427,49 +17459,11 @@ input[type="number"] {
17427
17459
  inherits: false;
17428
17460
  initial-value: solid;
17429
17461
  }
17430
- @property --tw-gradient-position {
17431
- syntax: "*";
17432
- inherits: false;
17433
- }
17434
- @property --tw-gradient-from {
17435
- syntax: "<color>";
17436
- inherits: false;
17437
- initial-value: #0000;
17438
- }
17439
- @property --tw-gradient-via {
17440
- syntax: "<color>";
17441
- inherits: false;
17442
- initial-value: #0000;
17443
- }
17444
- @property --tw-gradient-to {
17445
- syntax: "<color>";
17446
- inherits: false;
17447
- initial-value: #0000;
17448
- }
17449
- @property --tw-gradient-stops {
17450
- syntax: "*";
17451
- inherits: false;
17452
- }
17453
- @property --tw-gradient-via-stops {
17462
+ @property --tw-font-weight {
17454
17463
  syntax: "*";
17455
17464
  inherits: false;
17456
17465
  }
17457
- @property --tw-gradient-from-position {
17458
- syntax: "<length-percentage>";
17459
- inherits: false;
17460
- initial-value: 0%;
17461
- }
17462
- @property --tw-gradient-via-position {
17463
- syntax: "<length-percentage>";
17464
- inherits: false;
17465
- initial-value: 50%;
17466
- }
17467
- @property --tw-gradient-to-position {
17468
- syntax: "<length-percentage>";
17469
- inherits: false;
17470
- initial-value: 100%;
17471
- }
17472
- @property --tw-font-weight {
17466
+ @property --tw-tracking {
17473
17467
  syntax: "*";
17474
17468
  inherits: false;
17475
17469
  }
@@ -17607,16 +17601,8 @@ input[type="number"] {
17607
17601
  --tw-space-y-reverse: 0;
17608
17602
  --tw-space-x-reverse: 0;
17609
17603
  --tw-border-style: solid;
17610
- --tw-gradient-position: initial;
17611
- --tw-gradient-from: #0000;
17612
- --tw-gradient-via: #0000;
17613
- --tw-gradient-to: #0000;
17614
- --tw-gradient-stops: initial;
17615
- --tw-gradient-via-stops: initial;
17616
- --tw-gradient-from-position: 0%;
17617
- --tw-gradient-via-position: 50%;
17618
- --tw-gradient-to-position: 100%;
17619
17604
  --tw-font-weight: initial;
17605
+ --tw-tracking: initial;
17620
17606
  --tw-shadow: 0 0 #0000;
17621
17607
  --tw-shadow-color: initial;
17622
17608
  --tw-shadow-alpha: 100%;
@@ -17657,11 +17643,19 @@ input[type="number"] {
17657
17643
  --tw-skew-y: initial;
17658
17644
  --tw-divide-y-reverse: 0;
17659
17645
  --tw-leading: initial;
17660
- --tw-tracking: initial;
17661
17646
  --tw-outline-style: solid;
17662
17647
  --tw-duration: initial;
17663
17648
  --tw-ease: initial;
17664
17649
  --tw-content: "";
17650
+ --tw-gradient-position: initial;
17651
+ --tw-gradient-from: #0000;
17652
+ --tw-gradient-via: #0000;
17653
+ --tw-gradient-to: #0000;
17654
+ --tw-gradient-stops: initial;
17655
+ --tw-gradient-via-stops: initial;
17656
+ --tw-gradient-from-position: 0%;
17657
+ --tw-gradient-via-position: 50%;
17658
+ --tw-gradient-to-position: 100%;
17665
17659
  }
17666
17660
  }
17667
17661
  }
@@ -1,3 +1,4 @@
1
1
  export {};
2
2
  export * as RenownUserSubgraph from "./renown-user/index.js";
3
3
  export * as RenownReadModelSubgraph from "./renown-read-model/index.js";
4
+ export * as RenownCredentialSubgraph from "./renown-credential/index.js";
@@ -1,2 +1,3 @@
1
1
  export * as RenownUserSubgraph from "./renown-user/index.js";
2
2
  export * as RenownReadModelSubgraph from "./renown-read-model/index.js";
3
+ export * as RenownCredentialSubgraph from "./renown-credential/index.js";