@powerhousedao/service-offering 1.0.0-dev.18 → 1.0.0-dev.19

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.
@@ -1,41 +1,6 @@
1
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.
2
+ * Re-exports from the shared GraphQL client.
3
+ * @deprecated Import directly from "../../utils/graphql-client.js" instead.
4
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>>;
5
+ export { fetchAllRemoteBuilderProfiles, fetchBuilderProfileById, fetchRemoteBuilderProfilesByIds, type RemoteBuilderProfile, } from "../../utils/graphql-client.js";
41
6
  //# sourceMappingURL=graphql-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/resource-instance-editor/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"}
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/resource-instance-editor/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC"}
@@ -1,189 +1,5 @@
1
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.
2
+ * Re-exports from the shared GraphQL client.
3
+ * @deprecated Import directly from "../../utils/graphql-client.js" instead.
4
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
- }
5
+ export { fetchAllRemoteBuilderProfiles, fetchBuilderProfileById, fetchRemoteBuilderProfilesByIds, } from "../../utils/graphql-client.js";
@@ -1,81 +1,6 @@
1
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.
2
+ * Re-exports from the shared GraphQL client.
3
+ * @deprecated Import directly from "../../utils/graphql-client.js" instead.
4
4
  */
5
- export interface RemoteBuilderProfile {
6
- id: string;
7
- state: {
8
- name: string | null;
9
- slug: string | null;
10
- icon: string | null;
11
- description: string | null;
12
- };
13
- }
14
- /**
15
- * Fetches a single builder profile by document ID
16
- */
17
- export declare function fetchBuilderProfileById(docId: string): Promise<RemoteBuilderProfile | null>;
18
- /**
19
- * Fetches all builder profiles using BuilderProfile_findDocuments.
20
- */
21
- export declare function fetchAllRemoteBuilderProfiles(): Promise<RemoteBuilderProfile[]>;
22
- /**
23
- * Fetches multiple builder profiles by their IDs.
24
- */
25
- export declare function fetchRemoteBuilderProfilesByIds(phids: string[]): Promise<Map<string, RemoteBuilderProfile>>;
26
- export interface SetOpHubMemberInput {
27
- name: string | null;
28
- phid: string | null;
29
- }
30
- /**
31
- * Sets the operational hub member on a builder profile document.
32
- *
33
- * @param docId - The builder profile document ID (PHID)
34
- * @param input - The operational hub member data (name and phid of the op hub)
35
- * @returns true if successful, false otherwise
36
- */
37
- export declare function setOpHubMemberOnBuilderProfile(docId: string, input: SetOpHubMemberInput): Promise<boolean>;
38
- interface RemoteResourceTemplateService {
39
- id: string;
40
- title: string;
41
- isSetupFormation: boolean;
42
- description: string | null;
43
- displayOrder: number | null;
44
- optionGroupId: string | null;
45
- }
46
- export interface RemoteResourceTemplate {
47
- id: string;
48
- name: string | null;
49
- operatorName?: string | null;
50
- state: {
51
- id: string | null;
52
- operatorId: string | null;
53
- title: string | null;
54
- summary: string | null;
55
- description: string | null;
56
- thumbnailUrl: string | null;
57
- infoLink: string | null;
58
- status: string | null;
59
- lastModified: string | null;
60
- targetAudiences: Array<{
61
- id: string;
62
- label: string;
63
- color: string | null;
64
- }>;
65
- setupServices: string[];
66
- recurringServices: string[];
67
- facetTargets: Array<{
68
- id: string;
69
- categoryKey: string;
70
- categoryLabel: string;
71
- selectedOptions: string[];
72
- }>;
73
- services: RemoteResourceTemplateService[];
74
- };
75
- }
76
- /**
77
- * Fetches all resource template documents from the remote Switchboard.
78
- */
79
- export declare function fetchAllRemoteResourceTemplates(): Promise<RemoteResourceTemplate[]>;
80
- export {};
5
+ export { fetchAllRemoteBuilderProfiles, fetchBuilderProfileById, fetchRemoteBuilderProfilesByIds, setOpHubMemberOnBuilderProfile, fetchAllRemoteResourceTemplates, type RemoteBuilderProfile, type RemoteResourceTemplate, type SetOpHubMemberInput, } from "../../utils/graphql-client.js";
81
6
  //# sourceMappingURL=graphql-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/service-offering-editor/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwHH,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;QACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;CACH;AAyCD;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAOtC;AAED;;GAEG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAC5D,oBAAoB,EAAE,CACvB,CAUA;AAED;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CA+B5C;AASD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,OAAO,CAAC,CAWlB;AAkDD,UAAU,6BAA6B;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,eAAe,EAAE,KAAK,CAAC;YACrB,EAAE,EAAE,MAAM,CAAC;YACX,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;SACtB,CAAC,CAAC;QACH,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC;YAClB,EAAE,EAAE,MAAM,CAAC;YACX,WAAW,EAAE,MAAM,CAAC;YACpB,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,EAAE,CAAC;SAC3B,CAAC,CAAC;QACH,QAAQ,EAAE,6BAA6B,EAAE,CAAC;KAC3C,CAAC;CACH;AAmED;;GAEG;AACH,wBAAsB,+BAA+B,IAAI,OAAO,CAC9D,sBAAsB,EAAE,CACzB,CAYA"}
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/service-offering-editor/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,+BAA+B,CAAC"}
@@ -1,266 +1,5 @@
1
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.
2
+ * Re-exports from the shared GraphQL client.
3
+ * @deprecated Import directly from "../../utils/graphql-client.js" instead.
4
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 find all builder profile documents
58
- const FIND_BUILDER_PROFILES_QUERY = `
59
- query FindBuilderProfiles {
60
- BuilderProfile_findDocuments(search: {}) {
61
- items {
62
- id
63
- name
64
- state {
65
- global {
66
- id
67
- name
68
- slug
69
- icon
70
- description
71
- }
72
- }
73
- }
74
- totalCount
75
- }
76
- }
77
- `;
78
- // Query to get a single builder profile by identifier
79
- const GET_BUILDER_PROFILE_QUERY = `
80
- query GetBuilderProfile($identifier: String!) {
81
- BuilderProfile_document(identifier: $identifier) {
82
- document {
83
- id
84
- name
85
- state {
86
- global {
87
- id
88
- name
89
- slug
90
- icon
91
- description
92
- }
93
- }
94
- }
95
- }
96
- }
97
- `;
98
- function toRemoteProfile(item) {
99
- return {
100
- id: item.id,
101
- state: {
102
- name: item.state.global.name,
103
- slug: item.state.global.slug,
104
- icon: item.state.global.icon,
105
- description: item.state.global.description,
106
- },
107
- };
108
- }
109
- /**
110
- * Fetches a single builder profile by document ID
111
- */
112
- export async function fetchBuilderProfileById(docId) {
113
- const data = await graphqlRequest(GET_BUILDER_PROFILE_QUERY, { identifier: docId });
114
- const item = data?.BuilderProfile_document?.document;
115
- return item ? toRemoteProfile(item) : null;
116
- }
117
- /**
118
- * Fetches all builder profiles using BuilderProfile_findDocuments.
119
- */
120
- export async function fetchAllRemoteBuilderProfiles() {
121
- try {
122
- const data = await graphqlRequest(FIND_BUILDER_PROFILES_QUERY);
123
- const items = data?.BuilderProfile_findDocuments?.items ?? [];
124
- return items.map(toRemoteProfile);
125
- }
126
- catch {
127
- return [];
128
- }
129
- }
130
- /**
131
- * Fetches multiple builder profiles by their IDs.
132
- */
133
- export async function fetchRemoteBuilderProfilesByIds(phids) {
134
- if (!phids.length) {
135
- return new Map();
136
- }
137
- try {
138
- const allProfiles = await fetchAllRemoteBuilderProfiles();
139
- const result = new Map();
140
- for (const profile of allProfiles) {
141
- if (phids.includes(profile.id)) {
142
- result.set(profile.id, profile);
143
- }
144
- }
145
- // For any missing profiles, try direct fetch
146
- const missingPhids = phids.filter((phid) => !result.has(phid));
147
- if (missingPhids.length > 0) {
148
- const directFetches = missingPhids.map(async (phid) => {
149
- const profile = await fetchBuilderProfileById(phid);
150
- if (profile) {
151
- result.set(phid, profile);
152
- }
153
- });
154
- await Promise.all(directFetches);
155
- }
156
- return result;
157
- }
158
- catch {
159
- return new Map();
160
- }
161
- }
162
- // Mutation to set operational hub member on a builder profile
163
- const SET_OP_HUB_MEMBER_MUTATION = `
164
- mutation BuilderProfile_setOpHubMember($docId: PHID!, $input: BuilderProfile_SetOpHubMemberInput!) {
165
- BuilderProfile_setOpHubMember(docId: $docId, input: $input)
166
- }
167
- `;
168
- /**
169
- * Sets the operational hub member on a builder profile document.
170
- *
171
- * @param docId - The builder profile document ID (PHID)
172
- * @param input - The operational hub member data (name and phid of the op hub)
173
- * @returns true if successful, false otherwise
174
- */
175
- export async function setOpHubMemberOnBuilderProfile(docId, input) {
176
- try {
177
- const data = await graphqlRequest(SET_OP_HUB_MEMBER_MUTATION, { docId, input });
178
- return data?.BuilderProfile_setOpHubMember ?? false;
179
- }
180
- catch (error) {
181
- console.warn("[graphql-client] Failed to set op hub member:", error);
182
- return false;
183
- }
184
- }
185
- // ── Resource Template queries ──
186
- const FIND_RESOURCE_TEMPLATES_QUERY = `
187
- query FindResourceTemplates {
188
- ResourceTemplate_findDocuments(search: {}) {
189
- items {
190
- id
191
- name
192
- state {
193
- global {
194
- id
195
- operatorId
196
- title
197
- summary
198
- description
199
- thumbnailUrl
200
- infoLink
201
- status
202
- lastModified
203
- targetAudiences {
204
- id
205
- label
206
- color
207
- }
208
- setupServices
209
- recurringServices
210
- facetTargets {
211
- id
212
- categoryKey
213
- categoryLabel
214
- selectedOptions
215
- }
216
- services {
217
- id
218
- title
219
- isSetupFormation
220
- description
221
- displayOrder
222
- optionGroupId
223
- }
224
- }
225
- }
226
- }
227
- totalCount
228
- }
229
- }
230
- `;
231
- function toRemoteResourceTemplate(item) {
232
- const g = item.state.global;
233
- return {
234
- id: item.id,
235
- name: item.name,
236
- state: {
237
- id: g.id,
238
- operatorId: g.operatorId,
239
- title: g.title,
240
- summary: g.summary,
241
- description: g.description,
242
- thumbnailUrl: g.thumbnailUrl,
243
- infoLink: g.infoLink,
244
- status: g.status,
245
- lastModified: g.lastModified,
246
- targetAudiences: g.targetAudiences ?? [],
247
- setupServices: g.setupServices ?? [],
248
- recurringServices: g.recurringServices ?? [],
249
- facetTargets: g.facetTargets ?? [],
250
- services: g.services ?? [],
251
- },
252
- };
253
- }
254
- /**
255
- * Fetches all resource template documents from the remote Switchboard.
256
- */
257
- export async function fetchAllRemoteResourceTemplates() {
258
- try {
259
- const data = await graphqlRequest(FIND_RESOURCE_TEMPLATES_QUERY, undefined, { silent: true });
260
- const items = data?.ResourceTemplate_findDocuments?.items ?? [];
261
- return items.map(toRemoteResourceTemplate);
262
- }
263
- catch {
264
- return [];
265
- }
266
- }
5
+ export { fetchAllRemoteBuilderProfiles, fetchBuilderProfileById, fetchRemoteBuilderProfilesByIds, setOpHubMemberOnBuilderProfile, fetchAllRemoteResourceTemplates, } from "../../utils/graphql-client.js";
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Shared GraphQL client for fetching data from the Reactor API.
3
+ * All editors should import from this module instead of maintaining their own copies.
4
+ */
5
+ export declare function graphqlRequest<T>(query: string, variables?: Record<string, unknown>, options?: {
6
+ silent?: boolean;
7
+ }): Promise<T | null>;
8
+ export interface FindDocumentsItem {
9
+ id: string;
10
+ name: string;
11
+ state: Record<string, unknown>;
12
+ }
13
+ export declare function getGlobalState(state: Record<string, unknown>): Record<string, unknown>;
14
+ export declare function findDocuments(type: string, options?: {
15
+ silent?: boolean;
16
+ }): Promise<FindDocumentsItem[]>;
17
+ export declare function getDocument(identifier: string): Promise<FindDocumentsItem | null>;
18
+ export declare function mutateDocument(documentIdentifier: string, actions: Array<{
19
+ type: string;
20
+ input: unknown;
21
+ scope: string;
22
+ }>): Promise<{
23
+ id: string;
24
+ name: string;
25
+ } | null>;
26
+ export interface RemoteBuilderProfile {
27
+ id: string;
28
+ state: {
29
+ name: string | null;
30
+ slug: string | null;
31
+ icon: string | null;
32
+ description?: string | null;
33
+ };
34
+ }
35
+ export declare function fetchBuilderProfileById(docId: string): Promise<RemoteBuilderProfile | null>;
36
+ export declare function fetchAllRemoteBuilderProfiles(): Promise<RemoteBuilderProfile[]>;
37
+ export declare function fetchRemoteBuilderProfilesByIds(phids: string[]): Promise<Map<string, RemoteBuilderProfile>>;
38
+ interface RemoteResourceTemplateService {
39
+ id: string;
40
+ title: string;
41
+ isSetupFormation: boolean;
42
+ description: string | null;
43
+ displayOrder: number | null;
44
+ optionGroupId: string | null;
45
+ }
46
+ export interface RemoteResourceTemplate {
47
+ id: string;
48
+ name: string | null;
49
+ operatorName?: string | null;
50
+ state: {
51
+ id: string | null;
52
+ operatorId: string | null;
53
+ title: string | null;
54
+ summary: string | null;
55
+ description: string | null;
56
+ thumbnailUrl: string | null;
57
+ infoLink: string | null;
58
+ status: string | null;
59
+ lastModified: string | null;
60
+ targetAudiences: Array<{
61
+ id: string;
62
+ label: string;
63
+ color: string | null;
64
+ }>;
65
+ setupServices: string[];
66
+ recurringServices: string[];
67
+ facetTargets: Array<{
68
+ id: string;
69
+ categoryKey: string;
70
+ categoryLabel: string;
71
+ selectedOptions: string[];
72
+ }>;
73
+ services: RemoteResourceTemplateService[];
74
+ };
75
+ }
76
+ export declare function fetchAllRemoteResourceTemplates(): Promise<RemoteResourceTemplate[]>;
77
+ export interface SetOpHubMemberInput {
78
+ name: string | null;
79
+ phid: string | null;
80
+ }
81
+ export declare function setOpHubMemberOnBuilderProfile(docId: string, input: SetOpHubMemberInput): Promise<boolean>;
82
+ export {};
83
+ //# sourceMappingURL=graphql-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../editors/utils/graphql-client.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Shared GraphQL client for fetching data from the Reactor API.
3
+ * All editors should import from this module instead of maintaining their own copies.
4
+ */
5
+ // ── URL resolution ──
6
+ function getGraphQLUrl() {
7
+ if (typeof window === "undefined") {
8
+ return "http://localhost:4001/graphql";
9
+ }
10
+ const baseURI = window.document.baseURI;
11
+ if (baseURI.includes("localhost")) {
12
+ return "http://localhost:4001/graphql";
13
+ }
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
+ return "https://switchboard.powerhouse.xyz/graphql";
21
+ }
22
+ export async function graphqlRequest(query, variables, options) {
23
+ try {
24
+ const response = await fetch(getGraphQLUrl(), {
25
+ method: "POST",
26
+ headers: { "Content-Type": "application/json" },
27
+ body: JSON.stringify({ query, variables }),
28
+ });
29
+ if (!response.ok) {
30
+ if (!options?.silent) {
31
+ console.warn("[graphql-client] Request failed:", response.status, response.statusText);
32
+ }
33
+ return null;
34
+ }
35
+ const result = (await response.json());
36
+ if (result.errors?.length && !result.data) {
37
+ if (!options?.silent) {
38
+ console.warn("[graphql-client] GraphQL errors:", result.errors);
39
+ }
40
+ return null;
41
+ }
42
+ return result.data ?? null;
43
+ }
44
+ catch (error) {
45
+ if (!options?.silent) {
46
+ console.warn("[graphql-client] Request error:", error);
47
+ }
48
+ return null;
49
+ }
50
+ }
51
+ // ── Helpers ──
52
+ export function getGlobalState(state) {
53
+ if (state && typeof state === "object" && "global" in state) {
54
+ return state.global;
55
+ }
56
+ return state;
57
+ }
58
+ // ── Generic queries ──
59
+ const FIND_DOCUMENTS_QUERY = `
60
+ query FindDocuments($type: String!) {
61
+ findDocuments(search: { type: $type }) {
62
+ items { id name state }
63
+ totalCount
64
+ }
65
+ }
66
+ `;
67
+ const GET_DOCUMENT_QUERY = `
68
+ query GetDocument($identifier: String!) {
69
+ document(identifier: $identifier) {
70
+ document { id name state }
71
+ }
72
+ }
73
+ `;
74
+ const MUTATE_DOCUMENT_MUTATION = `
75
+ mutation MutateDocument($documentIdentifier: String!, $actions: [JSONObject!]!) {
76
+ mutateDocument(documentIdentifier: $documentIdentifier, actions: $actions) {
77
+ id
78
+ name
79
+ }
80
+ }
81
+ `;
82
+ export async function findDocuments(type, options) {
83
+ const data = await graphqlRequest(FIND_DOCUMENTS_QUERY, { type }, options);
84
+ return data?.findDocuments?.items ?? [];
85
+ }
86
+ export async function getDocument(identifier) {
87
+ const data = await graphqlRequest(GET_DOCUMENT_QUERY, { identifier });
88
+ return data?.document?.document ?? null;
89
+ }
90
+ export async function mutateDocument(documentIdentifier, actions) {
91
+ const data = await graphqlRequest(MUTATE_DOCUMENT_MUTATION, { documentIdentifier, actions });
92
+ return data?.mutateDocument ?? null;
93
+ }
94
+ function toRemoteProfile(item, includeDescription = false) {
95
+ const global = getGlobalState(item.state);
96
+ const profile = {
97
+ id: item.id,
98
+ state: {
99
+ name: global.name ?? null,
100
+ slug: global.slug ?? null,
101
+ icon: global.icon ?? null,
102
+ },
103
+ };
104
+ if (includeDescription) {
105
+ profile.state.description = global.description ?? null;
106
+ }
107
+ return profile;
108
+ }
109
+ export async function fetchBuilderProfileById(docId) {
110
+ const item = await getDocument(docId);
111
+ return item ? toRemoteProfile(item, true) : null;
112
+ }
113
+ export async function fetchAllRemoteBuilderProfiles() {
114
+ try {
115
+ const items = await findDocuments("powerhouse/builder-profile");
116
+ return items.map((item) => toRemoteProfile(item, true));
117
+ }
118
+ catch {
119
+ return [];
120
+ }
121
+ }
122
+ export async function fetchRemoteBuilderProfilesByIds(phids) {
123
+ if (!phids.length) {
124
+ return new Map();
125
+ }
126
+ try {
127
+ const allProfiles = await fetchAllRemoteBuilderProfiles();
128
+ const result = new Map();
129
+ for (const profile of allProfiles) {
130
+ if (phids.includes(profile.id)) {
131
+ result.set(profile.id, profile);
132
+ }
133
+ }
134
+ const missingPhids = phids.filter((phid) => !result.has(phid));
135
+ if (missingPhids.length > 0) {
136
+ const directFetches = missingPhids.map(async (phid) => {
137
+ const profile = await fetchBuilderProfileById(phid);
138
+ if (profile) {
139
+ result.set(phid, profile);
140
+ }
141
+ });
142
+ await Promise.all(directFetches);
143
+ }
144
+ return result;
145
+ }
146
+ catch {
147
+ return new Map();
148
+ }
149
+ }
150
+ function toRemoteResourceTemplate(item) {
151
+ const g = getGlobalState(item.state);
152
+ return {
153
+ id: item.id,
154
+ name: item.name,
155
+ state: {
156
+ id: g.id ?? null,
157
+ operatorId: g.operatorId ?? null,
158
+ title: g.title ?? null,
159
+ summary: g.summary ?? null,
160
+ description: g.description ?? null,
161
+ thumbnailUrl: g.thumbnailUrl ?? null,
162
+ infoLink: g.infoLink ?? null,
163
+ status: g.status ?? null,
164
+ lastModified: g.lastModified ?? null,
165
+ targetAudiences: g.targetAudiences ??
166
+ [],
167
+ setupServices: g.setupServices ?? [],
168
+ recurringServices: g.recurringServices ?? [],
169
+ facetTargets: g.facetTargets ??
170
+ [],
171
+ services: g.services ?? [],
172
+ },
173
+ };
174
+ }
175
+ export async function fetchAllRemoteResourceTemplates() {
176
+ try {
177
+ const items = await findDocuments("powerhouse/resource-template", {
178
+ silent: true,
179
+ });
180
+ return items.map(toRemoteResourceTemplate);
181
+ }
182
+ catch {
183
+ return [];
184
+ }
185
+ }
186
+ export async function setOpHubMemberOnBuilderProfile(docId, input) {
187
+ try {
188
+ const result = await mutateDocument(docId, [
189
+ { type: "SET_OP_HUB_MEMBER", input, scope: "global" },
190
+ ]);
191
+ return result !== null;
192
+ }
193
+ catch (error) {
194
+ console.warn("[graphql-client] Failed to set op hub member:", error);
195
+ return false;
196
+ }
197
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/service-offering",
3
3
  "description": "service offering document models",
4
- "version": "1.0.0-dev.18",
4
+ "version": "1.0.0-dev.19",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -55,8 +55,7 @@
55
55
  "./style.css": "./dist/style.css"
56
56
  },
57
57
  "scripts": {
58
- "build": "npm run tsc && npm run tailwind && npm run copy-css",
59
- "copy-css": "cp editors/service-offering-editor/editor.css dist/editors/service-offering-editor/editor.css",
58
+ "build": "npm run tsc && npm run tailwind",
60
59
  "test": "vitest run",
61
60
  "test:watch": "vitest",
62
61
  "lint": "eslint --config eslint.config.js --cache --cache-strategy content",
@@ -76,59 +75,47 @@
76
75
  },
77
76
  "dependencies": {
78
77
  "@electric-sql/pglite": "0.3.15",
79
- "@powerhousedao/builder-tools": "6.0.0-staging.0",
80
- "@powerhousedao/common": "6.0.0-staging.0",
81
- "@powerhousedao/design-system": "6.0.0-staging.0",
78
+ "@powerhousedao/builder-tools": "6.0.0-dev.104",
79
+ "@powerhousedao/common": "6.0.0-dev.104",
80
+ "@powerhousedao/design-system": "6.0.0-dev.104",
82
81
  "@powerhousedao/document-engineering": "1.40.1",
83
- "@powerhousedao/vetra": "6.0.0-staging.0",
84
- "@tailwindcss/vite": "^4.2.1",
82
+ "@powerhousedao/vetra": "6.0.0-dev.104",
85
83
  "@uiw/react-md-editor": "^4.0.11",
86
- "cmd-ts": "^0.15.0",
87
- "document-model": "6.0.0-staging.0",
84
+ "document-model": "6.0.0-dev.104",
88
85
  "graphql": "16.12.0",
89
86
  "graphql-tag": "^2.12.6",
90
87
  "lucide-react": "^0.577.0",
91
88
  "rehype-slug": "^6.0.0",
92
- "vite-plugin-html": "^3.2.2",
93
- "vite-plugin-svgr": "^4.5.0",
94
89
  "zod": "^4.3.5"
95
90
  },
96
91
  "devDependencies": {
97
92
  "@eslint/js": "^9.38.0",
98
- "@openfeature/web-sdk": "^1.7.3",
99
- "@powerhousedao/analytics-engine-core": "6.0.0-staging.0",
100
- "@powerhousedao/config": "6.0.0-staging.0",
101
- "@powerhousedao/connect": "6.0.0-staging.0",
102
- "@powerhousedao/ph-cli": "6.0.0-staging.0",
103
- "@powerhousedao/reactor-api": "6.0.0-staging.0",
104
- "@powerhousedao/reactor-browser": "6.0.0-staging.0",
105
- "@powerhousedao/reactor-local": "6.0.0-staging.0",
106
- "@powerhousedao/switchboard": "6.0.0-staging.0",
107
93
  "@semantic-release/changelog": "^6.0.3",
108
94
  "@semantic-release/git": "^10.0.1",
109
- "@sentry/react": "^10.6.0",
95
+ "@powerhousedao/analytics-engine-core": "6.0.0-dev.104",
96
+ "@powerhousedao/config": "6.0.0-dev.104",
97
+ "@powerhousedao/connect": "6.0.0-dev.104",
98
+ "@powerhousedao/ph-cli": "6.0.0-dev.104",
99
+ "@powerhousedao/reactor-api": "6.0.0-dev.104",
100
+ "@powerhousedao/reactor-browser": "6.0.0-dev.104",
101
+ "@powerhousedao/reactor-local": "6.0.0-dev.104",
102
+ "@powerhousedao/switchboard": "6.0.0-dev.104",
110
103
  "@tailwindcss/cli": "^4.1.4",
111
104
  "@testing-library/react": "^16.3.0",
112
105
  "@types/node": "^24.9.2",
113
106
  "@types/react": "^19.2.3",
114
107
  "@vitejs/plugin-react": "^5.1.0",
115
- "document-drive": "6.0.0-staging.0",
108
+ "document-drive": "6.0.0-dev.104",
116
109
  "eslint": "^9.38.0",
117
110
  "eslint-config-prettier": "^10.1.8",
118
111
  "eslint-plugin-prettier": "^5.5.4",
119
112
  "eslint-plugin-react": "^7.37.5",
120
113
  "eslint-plugin-react-hooks": "^7.0.1",
121
114
  "globals": "^16.4.0",
122
- "i18next": "^25.5.2",
123
115
  "package-manager-detector": "^0.2.8",
124
116
  "pm2": "^5.4.3",
125
- "react": "^19.2.4",
117
+ "react": "^19.2.3",
126
118
  "react-dom": "^19.2.3",
127
- "react-error-boundary": "^6.0.0",
128
- "react-hotkeys-hook": "^5.1.0",
129
- "react-i18next": "^16.0.0",
130
- "react-router-dom": "^7.9.3",
131
- "semantic-release": "^25.0.3",
132
119
  "tailwindcss": "^4.1.16",
133
120
  "typescript": "^5.9.3",
134
121
  "typescript-eslint": "^8.46.2",
@@ -137,7 +124,7 @@
137
124
  "vitest": "^3.0.9"
138
125
  },
139
126
  "overrides": {
140
- "graphql": "16.12.0"
127
+ "graphql": "$graphql"
141
128
  },
142
129
  "peerDependencies": {
143
130
  "react": ">=19.0.0",
@@ -1,119 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');
2
-
3
- /* ── Keyframes (cannot be expressed as Tailwind utilities) ── */
4
-
5
- @keyframes so-fade-in {
6
- from { opacity: 0; transform: translateY(8px); }
7
- to { opacity: 1; transform: translateY(0); }
8
- }
9
-
10
- @keyframes so-scale-in {
11
- from { opacity: 0; transform: scale(0.96); }
12
- to { opacity: 1; transform: scale(1); }
13
- }
14
-
15
- @keyframes so-float {
16
- 0%, 100% { transform: translateY(0); }
17
- 50% { transform: translateY(-8px); }
18
- }
19
-
20
- @keyframes so-fab-in {
21
- from { opacity: 0; transform: translateY(8px); }
22
- to { opacity: 1; transform: translateY(0); }
23
- }
24
-
25
- @keyframes so-confirm-fade-in {
26
- from { opacity: 0; }
27
- to { opacity: 1; }
28
- }
29
-
30
- @keyframes so-confirm-scale-in {
31
- from { opacity: 0; transform: scale(0.95); }
32
- to { opacity: 1; transform: scale(1); }
33
- }
34
-
35
- @keyframes progress-pulse {
36
- 0%, 100% { opacity: 1; }
37
- 50% { opacity: 0.4; }
38
- }
39
-
40
- @keyframes progress-dropdown-in {
41
- from { opacity: 0; transform: translateY(-4px); }
42
- to { opacity: 1; transform: translateY(0); }
43
- }
44
-
45
- @keyframes progress-overlay-in {
46
- from { opacity: 0; }
47
- to { opacity: 1; }
48
- }
49
-
50
- @keyframes progress-modal-in {
51
- from { opacity: 0; transform: scale(0.95) translateY(8px); }
52
- to { opacity: 1; transform: scale(1) translateY(0); }
53
- }
54
-
55
- @keyframes tier-slide-up {
56
- from { opacity: 0; transform: translateY(12px); }
57
- to { opacity: 1; transform: translateY(0); }
58
- }
59
-
60
- @keyframes catalog__fade-in {
61
- from { opacity: 0; transform: translateY(4px); }
62
- to { opacity: 1; transform: translateY(0); }
63
- }
64
-
65
- @keyframes rts-spin {
66
- to { transform: rotate(360deg); }
67
- }
68
-
69
- @keyframes matrix-warning-pulse {
70
- 0%, 100% { opacity: 1; }
71
- 50% { opacity: 0.5; }
72
- }
73
-
74
- @keyframes panel-overlay-fade {
75
- from { opacity: 0; }
76
- to { opacity: 1; }
77
- }
78
-
79
- @keyframes panel-slide-in {
80
- from { opacity: 0; transform: translateX(20px); }
81
- to { opacity: 1; transform: translateX(0); }
82
- }
83
-
84
- @keyframes modal-backdrop {
85
- from { opacity: 0; }
86
- to { opacity: 1; }
87
- }
88
-
89
- @keyframes modal-pop {
90
- from { opacity: 0; transform: scale(0.95) translateY(8px); }
91
- to { opacity: 1; transform: scale(1) translateY(0); }
92
- }
93
-
94
- /* ── Tooltip overrides — Radix portals outside .so-editor scope ── */
95
-
96
- [data-radix-popper-content-wrapper] {
97
- z-index: 9999 !important;
98
- min-width: 0 !important;
99
- max-width: 280px !important;
100
- }
101
-
102
- [data-radix-popper-content-wrapper] [data-side] {
103
- max-width: 280px !important;
104
- white-space: normal !important;
105
- line-height: 1.45 !important;
106
- word-wrap: break-word !important;
107
- }
108
-
109
- /* ── Scrollbar styles (not possible with Tailwind) ── */
110
-
111
- .so-scrollbar-h::-webkit-scrollbar { height: 8px; }
112
- .so-scrollbar-h::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
113
- .so-scrollbar-h::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
114
- .so-scrollbar-h::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
115
-
116
- .so-scrollbar-v::-webkit-scrollbar { width: 6px; }
117
- .so-scrollbar-v::-webkit-scrollbar-track { background: #f8fafc; border-radius: 3px; }
118
- .so-scrollbar-v::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
119
- .so-scrollbar-v::-webkit-scrollbar-thumb:hover { background: #94a3b8; }