@tangle-network/blueprint-ui 0.1.1 → 0.1.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.
- package/README.md +38 -4
- package/dist/BlueprintHostPanel-6iVEh-f1.d.ts +39 -0
- package/dist/chunk-37ADATBT.js +55 -0
- package/dist/chunk-37ADATBT.js.map +1 -0
- package/dist/chunk-A6PJT5YQ.js +1180 -0
- package/dist/chunk-A6PJT5YQ.js.map +1 -0
- package/dist/chunk-GD3AZEJL.js +327 -0
- package/dist/chunk-GD3AZEJL.js.map +1 -0
- package/dist/components.d.ts +179 -0
- package/dist/components.js +1127 -0
- package/dist/components.js.map +1 -0
- package/dist/host.d.ts +96 -0
- package/dist/host.js +39 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +8470 -0
- package/dist/index.js +841 -0
- package/dist/index.js.map +1 -0
- package/dist/preset.d.ts +60 -0
- package/dist/preset.js +7 -0
- package/dist/preset.js.map +1 -0
- package/dist/registry-JhwB9BPD.d.ts +87 -0
- package/dist/styles.css +559 -0
- package/package.json +42 -13
- package/src/components.ts +3 -0
- package/src/contracts/abi.ts +9 -0
- package/src/contracts/chains.ts +4 -3
- package/src/contracts/publicClient.ts +2 -1
- package/src/hooks/useProvisionProgress.ts +2 -1
- package/src/hooks/useQuotes.ts +69 -14
- package/src/hooks/useSessionAuth.ts +2 -1
- package/src/host/components/BlueprintHostHero.tsx +91 -0
- package/src/host/components/BlueprintHostPanel.tsx +24 -0
- package/src/host/index.ts +42 -0
- package/src/host/resolver.ts +204 -0
- package/src/host/types.ts +111 -0
- package/src/index.ts +41 -1
- package/src/stores/infra.ts +3 -2
- package/src/styles.css +128 -0
- package/src/utils/env.ts +22 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BlueprintAppEntry,
|
|
3
|
+
BlueprintAppResolvedView,
|
|
4
|
+
BlueprintExperienceTier,
|
|
5
|
+
BlueprintExternalAppTrust,
|
|
6
|
+
BlueprintPublisher,
|
|
7
|
+
BlueprintPublisherVerification,
|
|
8
|
+
BlueprintSlugPolicy,
|
|
9
|
+
BlueprintUiSurface,
|
|
10
|
+
} from './types';
|
|
11
|
+
|
|
12
|
+
const EXPERIENCE_TIER_LABELS: Record<BlueprintExperienceTier, string> = {
|
|
13
|
+
generic: 'Protocol fallback',
|
|
14
|
+
declarative: 'Declarative blueprint UI',
|
|
15
|
+
'curated-module': 'Curated app module',
|
|
16
|
+
'external-app': 'External app handoff',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const SLUG_POLICY_LABELS: Record<BlueprintSlugPolicy, string> = {
|
|
20
|
+
reserved: 'Reserved slug',
|
|
21
|
+
'publisher-scoped': 'Publisher-scoped slug',
|
|
22
|
+
'public-requested': 'Public requested slug',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const SURFACE_LABELS: Record<BlueprintUiSurface, string> = {
|
|
26
|
+
'generic-overview': 'Generic overview',
|
|
27
|
+
'service-explorer': 'Service explorer',
|
|
28
|
+
'service-console': 'Service console',
|
|
29
|
+
'actions-panel': 'Actions panel',
|
|
30
|
+
resources: 'Resources',
|
|
31
|
+
chat: 'Chat',
|
|
32
|
+
vaults: 'Vaults',
|
|
33
|
+
metrics: 'Metrics',
|
|
34
|
+
permissions: 'Permissions',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const PUBLISHER_VERIFICATION_LABELS: Record<
|
|
38
|
+
BlueprintPublisherVerification,
|
|
39
|
+
string
|
|
40
|
+
> = {
|
|
41
|
+
'first-party': 'First-party publisher',
|
|
42
|
+
verified: 'Verified publisher',
|
|
43
|
+
unverified: 'Unverified publisher',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const EXTERNAL_APP_TRUST_LABELS: Record<BlueprintExternalAppTrust, string> = {
|
|
47
|
+
trusted: 'Trusted external app',
|
|
48
|
+
restricted: 'Restricted external app',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export function buildCanonicalBlueprintSlug(entry: BlueprintAppEntry): string {
|
|
52
|
+
if (entry.canonicalSlug) {
|
|
53
|
+
return entry.canonicalSlug;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (entry.slugPolicy === 'reserved' || !entry.publisher.namespace) {
|
|
57
|
+
return entry.slug;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return `@${entry.publisher.namespace}/${entry.slug}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function resolveBlueprintAppView(
|
|
64
|
+
entry: BlueprintAppEntry,
|
|
65
|
+
): BlueprintAppResolvedView {
|
|
66
|
+
return {
|
|
67
|
+
slug: entry.slug,
|
|
68
|
+
canonicalSlug: buildCanonicalBlueprintSlug(entry),
|
|
69
|
+
blueprintId: entry.blueprintId,
|
|
70
|
+
publisher: entry.publisher,
|
|
71
|
+
tier: entry.tier,
|
|
72
|
+
slugPolicy: entry.slugPolicy,
|
|
73
|
+
manifest: entry.manifest,
|
|
74
|
+
module: entry.module,
|
|
75
|
+
fallbackEnabled: true,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function toBlueprintAppEntry(
|
|
80
|
+
view: BlueprintAppResolvedView,
|
|
81
|
+
): BlueprintAppEntry {
|
|
82
|
+
return {
|
|
83
|
+
slug: view.slug,
|
|
84
|
+
canonicalSlug: view.canonicalSlug,
|
|
85
|
+
blueprintId: view.blueprintId,
|
|
86
|
+
publisher: view.publisher,
|
|
87
|
+
tier: view.tier,
|
|
88
|
+
slugPolicy: view.slugPolicy,
|
|
89
|
+
manifest: view.manifest,
|
|
90
|
+
module: view.module,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function getBlueprintExperienceTierLabel(
|
|
95
|
+
tier: BlueprintExperienceTier,
|
|
96
|
+
): string {
|
|
97
|
+
return EXPERIENCE_TIER_LABELS[tier];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function getBlueprintSlugPolicyLabel(policy: BlueprintSlugPolicy): string {
|
|
101
|
+
return SLUG_POLICY_LABELS[policy];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function getBlueprintSurfaceLabel(surface: BlueprintUiSurface): string {
|
|
105
|
+
return SURFACE_LABELS[surface];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function getBlueprintPublisherVerificationLabel(
|
|
109
|
+
verification: BlueprintPublisherVerification,
|
|
110
|
+
): string {
|
|
111
|
+
return PUBLISHER_VERIFICATION_LABELS[verification];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function getExternalAppTrustLabel(
|
|
115
|
+
trust: BlueprintExternalAppTrust,
|
|
116
|
+
): string {
|
|
117
|
+
return EXTERNAL_APP_TRUST_LABELS[trust];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function isVerifiedBlueprintPublisher(
|
|
121
|
+
publisher: BlueprintPublisher,
|
|
122
|
+
): boolean {
|
|
123
|
+
return (
|
|
124
|
+
publisher.verification === 'first-party' ||
|
|
125
|
+
publisher.verification === 'verified'
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function canPublisherClaimSlug(
|
|
130
|
+
slug: string,
|
|
131
|
+
publisher?: Pick<BlueprintPublisher, 'namespace' | 'verification'>,
|
|
132
|
+
reservedSlugs: Set<string> = new Set(),
|
|
133
|
+
): boolean {
|
|
134
|
+
if (reservedSlugs.has(slug)) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
publisher?.namespace !== undefined &&
|
|
140
|
+
publisher.namespace.trim().length > 0 &&
|
|
141
|
+
(publisher.verification === 'verified' ||
|
|
142
|
+
publisher.verification === 'first-party')
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function isTrustedExternalAppHost(
|
|
147
|
+
host: string,
|
|
148
|
+
trustedHosts: readonly string[] = [],
|
|
149
|
+
): boolean {
|
|
150
|
+
const normalizedHost = host.trim().toLowerCase();
|
|
151
|
+
|
|
152
|
+
return trustedHosts.some(
|
|
153
|
+
(trustedHost) =>
|
|
154
|
+
normalizedHost === trustedHost || normalizedHost.endsWith(`.${trustedHost}`),
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function getBlueprintPath(view: BlueprintAppResolvedView): string {
|
|
159
|
+
if (view.tier === 'curated-module' || view.tier === 'external-app') {
|
|
160
|
+
return `/blueprints/${view.canonicalSlug}`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (view.blueprintId !== undefined) {
|
|
164
|
+
return `/blueprints/${view.blueprintId.toString()}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return `/blueprints/${view.slug}`;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function getBlueprintServicePath(
|
|
171
|
+
view: BlueprintAppResolvedView,
|
|
172
|
+
serviceId: string,
|
|
173
|
+
): string {
|
|
174
|
+
if (view.tier === 'curated-module' || view.tier === 'external-app') {
|
|
175
|
+
return `${getBlueprintPath(view)}/${serviceId}`;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return `${getBlueprintPath(view)}/services/${serviceId}`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function sanitizeBlueprintSlugPart(value: string): string {
|
|
182
|
+
return value
|
|
183
|
+
.trim()
|
|
184
|
+
.toLowerCase()
|
|
185
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
186
|
+
.replace(/^-+|-+$/g, '')
|
|
187
|
+
.replace(/-{2,}/g, '-');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function deriveBlueprintRequestedSlug(
|
|
191
|
+
blueprint: Pick<{ name: string; author: string; id: bigint }, 'name' | 'author' | 'id'>,
|
|
192
|
+
): string {
|
|
193
|
+
const fromName = sanitizeBlueprintSlugPart(blueprint.name);
|
|
194
|
+
if (fromName.length > 0) {
|
|
195
|
+
return fromName;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const fromAuthor = sanitizeBlueprintSlugPart(blueprint.author);
|
|
199
|
+
if (fromAuthor.length > 0) {
|
|
200
|
+
return `${fromAuthor}-${blueprint.id.toString()}`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return `blueprint-${blueprint.id.toString()}`;
|
|
204
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export type BlueprintAppVisibility = 'first-party' | 'third-party';
|
|
2
|
+
|
|
3
|
+
export type BlueprintPublisherVerification =
|
|
4
|
+
| 'first-party'
|
|
5
|
+
| 'verified'
|
|
6
|
+
| 'unverified';
|
|
7
|
+
|
|
8
|
+
export type BlueprintExperienceTier =
|
|
9
|
+
| 'generic'
|
|
10
|
+
| 'declarative'
|
|
11
|
+
| 'curated-module'
|
|
12
|
+
| 'external-app';
|
|
13
|
+
|
|
14
|
+
export type BlueprintSlugPolicy =
|
|
15
|
+
| 'reserved'
|
|
16
|
+
| 'publisher-scoped'
|
|
17
|
+
| 'public-requested';
|
|
18
|
+
|
|
19
|
+
export type BlueprintUiSurface =
|
|
20
|
+
| 'generic-overview'
|
|
21
|
+
| 'service-explorer'
|
|
22
|
+
| 'service-console'
|
|
23
|
+
| 'actions-panel'
|
|
24
|
+
| 'resources'
|
|
25
|
+
| 'chat'
|
|
26
|
+
| 'vaults'
|
|
27
|
+
| 'metrics'
|
|
28
|
+
| 'permissions';
|
|
29
|
+
|
|
30
|
+
export type BlueprintResourceRoute =
|
|
31
|
+
| 'bots'
|
|
32
|
+
| 'agents'
|
|
33
|
+
| 'runs'
|
|
34
|
+
| 'vault'
|
|
35
|
+
| 'chat'
|
|
36
|
+
| 'custom';
|
|
37
|
+
|
|
38
|
+
export type BlueprintPermissionScope =
|
|
39
|
+
| 'blueprint'
|
|
40
|
+
| 'service'
|
|
41
|
+
| 'resource';
|
|
42
|
+
|
|
43
|
+
export type BlueprintExternalAppMode = 'link' | 'iframe';
|
|
44
|
+
export type BlueprintExternalAppTrust = 'trusted' | 'restricted';
|
|
45
|
+
|
|
46
|
+
export type BlueprintPublisher = {
|
|
47
|
+
label: string;
|
|
48
|
+
namespace?: string;
|
|
49
|
+
visibility: BlueprintAppVisibility;
|
|
50
|
+
verification: BlueprintPublisherVerification;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type BlueprintResourceModel = {
|
|
54
|
+
serviceNoun: string;
|
|
55
|
+
resourceNoun: string;
|
|
56
|
+
resourceRoute?: BlueprintResourceRoute;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type BlueprintPermissionDescriptor = {
|
|
60
|
+
key: string;
|
|
61
|
+
label: string;
|
|
62
|
+
scope: BlueprintPermissionScope;
|
|
63
|
+
description?: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type BlueprintExternalAppConfig = {
|
|
67
|
+
url: string;
|
|
68
|
+
mode: BlueprintExternalAppMode;
|
|
69
|
+
label?: string;
|
|
70
|
+
host: string;
|
|
71
|
+
trust: BlueprintExternalAppTrust;
|
|
72
|
+
reason?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type BlueprintUiManifest = {
|
|
76
|
+
displayName: string;
|
|
77
|
+
tagline: string;
|
|
78
|
+
description: string;
|
|
79
|
+
surfaces: BlueprintUiSurface[];
|
|
80
|
+
resources: BlueprintResourceModel;
|
|
81
|
+
permissions?: BlueprintPermissionDescriptor[];
|
|
82
|
+
externalApp?: BlueprintExternalAppConfig;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type BlueprintAppModuleBinding = {
|
|
86
|
+
moduleId: string;
|
|
87
|
+
status: 'active' | 'planned';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type BlueprintAppEntry = {
|
|
91
|
+
slug: string;
|
|
92
|
+
canonicalSlug?: string;
|
|
93
|
+
blueprintId?: bigint;
|
|
94
|
+
publisher: BlueprintPublisher;
|
|
95
|
+
tier: BlueprintExperienceTier;
|
|
96
|
+
slugPolicy: BlueprintSlugPolicy;
|
|
97
|
+
manifest: BlueprintUiManifest;
|
|
98
|
+
module?: BlueprintAppModuleBinding;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type BlueprintAppResolvedView = {
|
|
102
|
+
slug: string;
|
|
103
|
+
canonicalSlug: string;
|
|
104
|
+
blueprintId?: bigint;
|
|
105
|
+
publisher: BlueprintPublisher;
|
|
106
|
+
tier: BlueprintExperienceTier;
|
|
107
|
+
slugPolicy: BlueprintSlugPolicy;
|
|
108
|
+
manifest: BlueprintUiManifest;
|
|
109
|
+
module?: BlueprintAppModuleBinding;
|
|
110
|
+
fallbackEnabled: boolean;
|
|
111
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -61,9 +61,49 @@ export {
|
|
|
61
61
|
getJobById,
|
|
62
62
|
} from './blueprints/registry';
|
|
63
63
|
|
|
64
|
+
// ── Blueprint Host ──
|
|
65
|
+
export type {
|
|
66
|
+
BlueprintAppVisibility,
|
|
67
|
+
BlueprintPublisherVerification,
|
|
68
|
+
BlueprintExperienceTier,
|
|
69
|
+
BlueprintSlugPolicy,
|
|
70
|
+
BlueprintUiSurface,
|
|
71
|
+
BlueprintResourceRoute,
|
|
72
|
+
BlueprintPermissionScope,
|
|
73
|
+
BlueprintExternalAppMode,
|
|
74
|
+
BlueprintExternalAppTrust,
|
|
75
|
+
BlueprintPublisher,
|
|
76
|
+
BlueprintResourceModel,
|
|
77
|
+
BlueprintPermissionDescriptor,
|
|
78
|
+
BlueprintExternalAppConfig,
|
|
79
|
+
BlueprintUiManifest,
|
|
80
|
+
BlueprintAppModuleBinding,
|
|
81
|
+
BlueprintAppEntry,
|
|
82
|
+
BlueprintAppResolvedView,
|
|
83
|
+
} from './host';
|
|
84
|
+
export {
|
|
85
|
+
buildCanonicalBlueprintSlug,
|
|
86
|
+
resolveBlueprintAppView,
|
|
87
|
+
toBlueprintAppEntry,
|
|
88
|
+
getBlueprintExperienceTierLabel,
|
|
89
|
+
getBlueprintSlugPolicyLabel,
|
|
90
|
+
getBlueprintSurfaceLabel,
|
|
91
|
+
getBlueprintPublisherVerificationLabel,
|
|
92
|
+
getExternalAppTrustLabel,
|
|
93
|
+
isVerifiedBlueprintPublisher,
|
|
94
|
+
canPublisherClaimSlug,
|
|
95
|
+
isTrustedExternalAppHost,
|
|
96
|
+
getBlueprintPath,
|
|
97
|
+
getBlueprintServicePath,
|
|
98
|
+
sanitizeBlueprintSlugPart,
|
|
99
|
+
deriveBlueprintRequestedSlug,
|
|
100
|
+
} from './host';
|
|
101
|
+
export type { BlueprintHostHeroProps, BlueprintHostPanelProps } from './host';
|
|
102
|
+
export { BlueprintHostHero, BlueprintHostPanel } from './host';
|
|
103
|
+
|
|
64
104
|
// ── Hooks ──
|
|
65
105
|
export type { DiscoveredOperator } from './hooks/useOperators';
|
|
66
|
-
export { useOperators } from './hooks/useOperators';
|
|
106
|
+
export { discoverOperatorsWithClient, useOperators } from './hooks/useOperators';
|
|
67
107
|
export type { JobFormState } from './hooks/useJobForm';
|
|
68
108
|
export { useJobForm } from './hooks/useJobForm';
|
|
69
109
|
export type { JobQuote, UseJobPriceResult, JobPriceEntry, UseJobPricesResult } from './hooks/useJobPrice';
|
package/src/stores/infra.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { persistedAtom } from './persistedAtom';
|
|
2
|
+
import { getEnvVar } from '../utils/env';
|
|
2
3
|
|
|
3
|
-
const defaultBlueprintId =
|
|
4
|
-
const defaultServiceId =
|
|
4
|
+
const defaultBlueprintId = getEnvVar('VITE_BLUEPRINT_ID') ?? '0';
|
|
5
|
+
const defaultServiceId = getEnvVar('VITE_SERVICE_ID') ?? getEnvVar('VITE_SERVICE_IDS')?.split(',')[0] ?? '0';
|
|
5
6
|
|
|
6
7
|
export interface OperatorInfo {
|
|
7
8
|
address: string;
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
.bp-tone-cloud {
|
|
3
|
+
--bp-font-display: var(--font-display, 'Outfit', system-ui, sans-serif);
|
|
4
|
+
--bp-font-data: var(--font-data, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace);
|
|
5
|
+
|
|
6
|
+
--bp-glass-bg: var(--glass-bg, transparent);
|
|
7
|
+
--bp-glass-bg-strong: var(--glass-bg-strong, var(--bp-glass-bg, transparent));
|
|
8
|
+
--bp-glass-border: var(--glass-border, transparent);
|
|
9
|
+
--bp-glass-border-hover: var(--glass-border-hover, var(--bp-glass-border, transparent));
|
|
10
|
+
--bp-glass-blur: var(--glass-blur, 0px);
|
|
11
|
+
--bp-glass-blur-strong: 24px;
|
|
12
|
+
|
|
13
|
+
--bp-elements-borderColor: var(--cloud-elements-borderColor, rgba(240, 240, 245, 0.06));
|
|
14
|
+
--bp-elements-borderColorActive: var(--cloud-elements-borderColorActive, #8B5CF6);
|
|
15
|
+
|
|
16
|
+
--bp-elements-bg-depth-1: var(--cloud-elements-bg-depth-1, #0A0A0F);
|
|
17
|
+
--bp-elements-bg-depth-2: var(--cloud-elements-bg-depth-2, #12121A);
|
|
18
|
+
--bp-elements-bg-depth-3: var(--cloud-elements-bg-depth-3, #1A1A25);
|
|
19
|
+
--bp-elements-bg-depth-4: var(--cloud-elements-bg-depth-4, #22222E);
|
|
20
|
+
|
|
21
|
+
--bp-elements-textPrimary: var(--cloud-elements-textPrimary, #F0F0F5);
|
|
22
|
+
--bp-elements-textSecondary: var(--cloud-elements-textSecondary, #8A8A9E);
|
|
23
|
+
--bp-elements-textTertiary: var(--cloud-elements-textTertiary, #5A5A6E);
|
|
24
|
+
|
|
25
|
+
--bp-elements-button-primary-background: var(--cloud-elements-button-primary-background, rgba(142, 89, 255, 0.14));
|
|
26
|
+
--bp-elements-button-primary-backgroundHover: var(--cloud-elements-button-primary-backgroundHover, rgba(142, 89, 255, 0.24));
|
|
27
|
+
--bp-elements-button-primary-text: var(--cloud-elements-button-primary-text, #A87BFF);
|
|
28
|
+
|
|
29
|
+
--bp-elements-button-secondary-background: var(--cloud-elements-button-secondary-background, rgba(240, 240, 245, 0.06));
|
|
30
|
+
--bp-elements-button-secondary-backgroundHover: var(--cloud-elements-button-secondary-backgroundHover, rgba(240, 240, 245, 0.10));
|
|
31
|
+
--bp-elements-button-secondary-text: var(--cloud-elements-button-secondary-text, #F0F0F5);
|
|
32
|
+
|
|
33
|
+
--bp-elements-button-danger-background: var(--cloud-elements-button-danger-background, rgba(255, 59, 92, 0.12));
|
|
34
|
+
--bp-elements-button-danger-backgroundHover: var(--cloud-elements-button-danger-backgroundHover, rgba(255, 59, 92, 0.20));
|
|
35
|
+
--bp-elements-button-danger-text: var(--cloud-elements-button-danger-text, #FF3B5C);
|
|
36
|
+
|
|
37
|
+
--bp-elements-icon-success: var(--cloud-elements-icon-success, #38B2AC);
|
|
38
|
+
--bp-elements-icon-error: var(--cloud-elements-icon-error, #FF4D6A);
|
|
39
|
+
--bp-elements-icon-warning: var(--cloud-elements-icon-warning, #FFB800);
|
|
40
|
+
--bp-elements-icon-primary: var(--cloud-elements-icon-primary, #F0F0F5);
|
|
41
|
+
--bp-elements-icon-secondary: var(--cloud-elements-icon-secondary, #5A5A6E);
|
|
42
|
+
|
|
43
|
+
--bp-elements-dividerColor: var(--cloud-elements-dividerColor, rgba(240, 240, 245, 0.06));
|
|
44
|
+
--bp-elements-item-backgroundHover: var(--cloud-elements-item-backgroundHover, rgba(240, 240, 245, 0.03));
|
|
45
|
+
--bp-elements-item-backgroundActive: var(--cloud-elements-item-backgroundActive, rgba(240, 240, 245, 0.06));
|
|
46
|
+
--bp-elements-focus: var(--cloud-elements-focus, #8B5CF6);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bp-tone-arena {
|
|
50
|
+
--bp-elements-borderColor: var(--arena-elements-borderColor, var(--bp-elements-borderColor));
|
|
51
|
+
--bp-elements-borderColorActive: var(--arena-elements-borderColorActive, var(--bp-elements-borderColorActive));
|
|
52
|
+
|
|
53
|
+
--bp-elements-bg-depth-1: var(--arena-elements-bg-depth-1, var(--bp-elements-bg-depth-1));
|
|
54
|
+
--bp-elements-bg-depth-2: var(--arena-elements-bg-depth-2, var(--bp-elements-bg-depth-2));
|
|
55
|
+
--bp-elements-bg-depth-3: var(--arena-elements-bg-depth-3, var(--bp-elements-bg-depth-3));
|
|
56
|
+
--bp-elements-bg-depth-4: var(--arena-elements-bg-depth-4, var(--bp-elements-bg-depth-4));
|
|
57
|
+
|
|
58
|
+
--bp-elements-textPrimary: var(--arena-elements-textPrimary, var(--bp-elements-textPrimary));
|
|
59
|
+
--bp-elements-textSecondary: var(--arena-elements-textSecondary, var(--bp-elements-textSecondary));
|
|
60
|
+
--bp-elements-textTertiary: var(--arena-elements-textTertiary, var(--bp-elements-textTertiary));
|
|
61
|
+
|
|
62
|
+
--bp-elements-button-primary-background: var(--arena-elements-button-primary-background, var(--bp-elements-button-primary-background));
|
|
63
|
+
--bp-elements-button-primary-backgroundHover: var(--arena-elements-button-primary-backgroundHover, var(--bp-elements-button-primary-backgroundHover));
|
|
64
|
+
--bp-elements-button-primary-text: var(--arena-elements-button-primary-text, var(--bp-elements-button-primary-text));
|
|
65
|
+
|
|
66
|
+
--bp-elements-button-secondary-background: var(--arena-elements-button-secondary-background, var(--bp-elements-button-secondary-background));
|
|
67
|
+
--bp-elements-button-secondary-backgroundHover: var(--arena-elements-button-secondary-backgroundHover, var(--bp-elements-button-secondary-backgroundHover));
|
|
68
|
+
--bp-elements-button-secondary-text: var(--arena-elements-button-secondary-text, var(--bp-elements-button-secondary-text));
|
|
69
|
+
|
|
70
|
+
--bp-elements-button-danger-background: var(--arena-elements-button-danger-background, var(--bp-elements-button-danger-background));
|
|
71
|
+
--bp-elements-button-danger-backgroundHover: var(--arena-elements-button-danger-backgroundHover, var(--bp-elements-button-danger-backgroundHover));
|
|
72
|
+
--bp-elements-button-danger-text: var(--arena-elements-button-danger-text, var(--bp-elements-button-danger-text));
|
|
73
|
+
|
|
74
|
+
--bp-elements-icon-success: var(--arena-elements-icon-success, var(--bp-elements-icon-success));
|
|
75
|
+
--bp-elements-icon-error: var(--arena-elements-icon-error, var(--bp-elements-icon-error));
|
|
76
|
+
--bp-elements-icon-warning: var(--arena-elements-icon-warning, var(--bp-elements-icon-warning));
|
|
77
|
+
--bp-elements-icon-primary: var(--arena-elements-icon-primary, var(--bp-elements-icon-primary));
|
|
78
|
+
--bp-elements-icon-secondary: var(--arena-elements-icon-secondary, var(--bp-elements-icon-secondary));
|
|
79
|
+
|
|
80
|
+
--bp-elements-dividerColor: var(--arena-elements-dividerColor, var(--bp-elements-dividerColor));
|
|
81
|
+
--bp-elements-item-backgroundHover: var(--arena-elements-item-backgroundHover, var(--bp-elements-item-backgroundHover));
|
|
82
|
+
--bp-elements-item-backgroundActive: var(--arena-elements-item-backgroundActive, var(--bp-elements-item-backgroundActive));
|
|
83
|
+
--bp-elements-focus: var(--arena-elements-focus, var(--bp-elements-focus));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.font-display {
|
|
87
|
+
font-family: var(--bp-font-display);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.font-data {
|
|
91
|
+
font-family: var(--bp-font-data);
|
|
92
|
+
font-feature-settings: 'tnum' 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.glass {
|
|
96
|
+
background: var(--bp-glass-bg);
|
|
97
|
+
backdrop-filter: blur(var(--bp-glass-blur));
|
|
98
|
+
-webkit-backdrop-filter: blur(var(--bp-glass-blur));
|
|
99
|
+
border: 1px solid var(--bp-glass-border);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.glass-hover {
|
|
103
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.glass-hover:hover {
|
|
107
|
+
background: var(--bp-glass-bg-strong);
|
|
108
|
+
border-color: var(--bp-glass-border-hover);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.glass-card {
|
|
112
|
+
background: var(--bp-glass-bg);
|
|
113
|
+
backdrop-filter: blur(var(--bp-glass-blur));
|
|
114
|
+
-webkit-backdrop-filter: blur(var(--bp-glass-blur));
|
|
115
|
+
border: 1px solid var(--bp-glass-border);
|
|
116
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.glass-card:hover {
|
|
120
|
+
border-color: var(--bp-glass-border-hover);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.glass-card-strong {
|
|
124
|
+
background: var(--bp-glass-bg-strong);
|
|
125
|
+
backdrop-filter: blur(var(--bp-glass-blur-strong));
|
|
126
|
+
-webkit-backdrop-filter: blur(var(--bp-glass-blur-strong));
|
|
127
|
+
border: 1px solid var(--bp-glass-border);
|
|
128
|
+
}
|
package/src/utils/env.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type ImportMetaEnvLike = {
|
|
2
|
+
DEV?: boolean;
|
|
3
|
+
VITE_RPC_URL?: string;
|
|
4
|
+
VITE_CHAIN_ID?: string;
|
|
5
|
+
VITE_BLUEPRINT_ID?: string;
|
|
6
|
+
VITE_SERVICE_ID?: string;
|
|
7
|
+
VITE_SERVICE_IDS?: string;
|
|
8
|
+
VITE_OPERATOR_API_URL?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function readImportMetaEnv(): ImportMetaEnvLike {
|
|
12
|
+
return ((import.meta as ImportMeta & { env?: ImportMetaEnvLike }).env ?? {});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getEnvVar(key: keyof ImportMetaEnvLike): string | undefined {
|
|
16
|
+
const value = readImportMetaEnv()[key];
|
|
17
|
+
return typeof value === 'string' ? value : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function isDevEnv(): boolean {
|
|
21
|
+
return Boolean(readImportMetaEnv().DEV);
|
|
22
|
+
}
|