@meddleware/dashboard 0.1.3 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meddleware/dashboard",
3
- "version": "0.1.3",
3
+ "version": "0.1.7",
4
4
  "description": "Meddleware tools hub — Vue 3 SPA listing hosted services (Walrus, Access Gate) with white-label deploy options.",
5
5
  "author": "Meddleware <dev@meddleware.co.uk>",
6
6
  "license": "0BSD",
@@ -26,12 +26,19 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
+ "@meddleware/access-gate-ui": "^0.1.3",
29
30
  "@meddleware/design-tokens": "^0.1.2",
31
+ "@meddleware/seal-ui": "^0.0.3",
30
32
  "@meddleware/ui": "^0.1.6",
33
+ "@meddleware/wallet-adapter": "^0.0.2",
34
+ "@meddleware/walrus-ui": "^0.1.5",
31
35
  "pinia": "^4.0.2",
32
36
  "vue": "^3.5.40",
33
37
  "vue-router": "^5.2.0"
34
38
  },
39
+ "overrides": {
40
+ "@mysten/sui": "2.28.0"
41
+ },
35
42
  "devDependencies": {
36
43
  "@types/node": "~24.12.2",
37
44
  "@vitejs/plugin-vue": "^6.0.8",
package/src/App.vue CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  ColorModeControl, SidebarItem, StatusWidget,
7
7
  useColorMode,
8
8
  } from '@meddleware/ui'
9
+ import { useWallet } from '@meddleware/wallet-adapter'
9
10
 
10
11
  const { mode, set } = useColorMode('dark')
11
12
  const route = useRoute()
@@ -13,6 +14,22 @@ const route = useRoute()
13
14
  const isWalrus = computed(() => route.path === '/walrus')
14
15
  const isAccessGate = computed(() => route.path === '/access-gate')
15
16
  const isSealedStorage = computed(() => route.path === '/sealed-storage')
17
+
18
+ // The dashboard hosts the single shared wallet connection for every inline tool view. It
19
+ // requests the superset of features the tools need so the connect control only offers wallets
20
+ // capable of every operation; individual tools still feature-guard at call time.
21
+ const { wallets, account, connect, disconnect, connecting } = useWallet({
22
+ requiredFeatures: ['sui:signTransaction', 'sui:signPersonalMessage'],
23
+ })
24
+
25
+ async function onConnect(): Promise<void> {
26
+ const w = wallets.value[0]
27
+ if (w) await connect(w)
28
+ }
29
+
30
+ function shortAddr(addr: string): string {
31
+ return `${addr.slice(0, 8)}…${addr.slice(-4)}`
32
+ }
16
33
  </script>
17
34
 
18
35
  <template>
@@ -23,6 +40,21 @@ const isSealedStorage = computed(() => route.path === '/sealed-storage')
23
40
  <span>Meddleware</span>
24
41
  </template>
25
42
  <template #actions>
43
+ <span v-if="account" class="wallet-addr" :title="account.address">
44
+ {{ shortAddr(account.address) }}
45
+ </span>
46
+ <button v-if="account" type="button" class="wallet-btn" @click="disconnect">
47
+ Disconnect
48
+ </button>
49
+ <button
50
+ v-else
51
+ type="button"
52
+ class="wallet-btn"
53
+ :disabled="!wallets.length || connecting"
54
+ @click="onConnect"
55
+ >
56
+ {{ wallets.length ? (connecting ? 'Connecting…' : 'Connect wallet') : 'No wallet' }}
57
+ </button>
26
58
  <StatusWidget />
27
59
  <ColorModeControl :model-value="mode" @update:model-value="set" />
28
60
  </template>
@@ -67,11 +99,34 @@ const isSealedStorage = computed(() => route.path === '/sealed-storage')
67
99
  }
68
100
 
69
101
  .app-shell__main {
70
- overflow: hidden;
102
+ /* Inline tool views can exceed the viewport — scroll the main area internally
103
+ (the shell itself stays fixed at 100vh). */
104
+ overflow-y: auto;
71
105
  height: 100%;
72
106
  }
73
107
 
74
108
  .brand-mark {
75
109
  color: var(--gold);
76
110
  }
111
+
112
+ .wallet-addr {
113
+ font-family: monospace;
114
+ font-size: 0.85rem;
115
+ color: var(--muted);
116
+ }
117
+
118
+ .wallet-btn {
119
+ background: none;
120
+ border: 1px solid var(--border);
121
+ border-radius: 8px;
122
+ padding: 0.35rem 0.75rem;
123
+ cursor: pointer;
124
+ color: var(--text);
125
+ font-size: 0.85rem;
126
+ }
127
+
128
+ .wallet-btn:disabled {
129
+ opacity: 0.5;
130
+ cursor: not-allowed;
131
+ }
77
132
  </style>
@@ -1,14 +1,26 @@
1
1
  import { createRouter, createWebHistory } from 'vue-router'
2
2
  import Home from '../views/Home.vue'
3
- import ToolPage from '../views/ToolPage.vue'
4
3
 
4
+ // Every tool renders inline via the view component exported from its own package
5
+ // (@meddleware/walrus-ui, @meddleware/access-gate-ui, @meddleware/seal-ui) — no iframes. They
6
+ // share the dashboard's wallet connection through the @meddleware/wallet-adapter singleton, and
7
+ // each route is lazy so a tool's deps (incl. the Walrus wasm) load only on navigation.
5
8
  const router = createRouter({
6
9
  history: createWebHistory(import.meta.env.BASE_URL),
7
10
  routes: [
8
11
  { path: '/', component: Home },
9
- { path: '/walrus', component: ToolPage, props: { src: 'https://sui-walrus.meddleware.co.uk/?embedded=1', title: 'Walrus' } },
10
- { path: '/access-gate', component: ToolPage, props: { src: 'https://sui-access-gate.meddleware.co.uk/?embedded=1', title: 'Access Gate' } },
11
- { path: '/sealed-storage', component: ToolPage, props: { src: 'https://sui-seal.meddleware.co.uk/?embedded=1', title: 'Sealed Storage' } },
12
+ {
13
+ path: '/walrus',
14
+ component: () => import('@meddleware/walrus-ui').then((m) => m.WalrusView),
15
+ },
16
+ {
17
+ path: '/access-gate',
18
+ component: () => import('@meddleware/access-gate-ui').then((m) => m.AccessGateView),
19
+ },
20
+ {
21
+ path: '/sealed-storage',
22
+ component: () => import('@meddleware/seal-ui').then((m) => m.SealView),
23
+ },
12
24
  ],
13
25
  })
14
26
 
package/vite.config.ts CHANGED
@@ -4,4 +4,9 @@ import vue from '@vitejs/plugin-vue'
4
4
  // @meddleware/* resolve from node_modules (published packages — no monorepo aliases).
5
5
  export default defineConfig({
6
6
  plugins: [vue()],
7
+ optimizeDeps: {
8
+ // The Walrus wasm client is dynamically imported inside the inline WalrusView upload flow;
9
+ // keep it out of the eager dep-optimization graph so it stays a lazy chunk.
10
+ exclude: ['@mysten/walrus', '@mysten/walrus-wasm'],
11
+ },
7
12
  })
@@ -1,21 +0,0 @@
1
- <script setup lang="ts">
2
- defineProps<{ src: string; title: string }>()
3
- </script>
4
-
5
- <template>
6
- <iframe
7
- :src="src"
8
- :title="title"
9
- class="tool-frame"
10
- allow="camera; clipboard-read; clipboard-write"
11
- />
12
- </template>
13
-
14
- <style scoped>
15
- .tool-frame {
16
- display: block;
17
- width: 100%;
18
- height: 100%;
19
- border: none;
20
- }
21
- </style>
@@ -1,9 +0,0 @@
1
- <script setup lang="ts">
2
- import ToolFrame from '../components/ToolFrame.vue'
3
-
4
- defineProps<{ src: string; title: string }>()
5
- </script>
6
-
7
- <template>
8
- <ToolFrame :src="src" :title="title" />
9
- </template>