@niyamulahsan/create-deskapp 1.2.4 → 1.2.6

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 (104) hide show
  1. package/package.json +16 -16
  2. package/template/.env.example +20 -13
  3. package/template/AGENTS.md +699 -0
  4. package/template/package.json +3 -0
  5. package/template/src/config/app.ts +26 -24
  6. package/template/src/config/winsetup.ts +93 -91
  7. package/template/src/core/api/binding-error.ts +57 -0
  8. package/template/src/core/api/bindings.generated.ts +2 -0
  9. package/template/src/core/api/generate.manifest.ts +84 -80
  10. package/template/src/core/api/registry.ts +58 -48
  11. package/template/src/core/config.ts +101 -99
  12. package/template/src/core/database/aggregate.ts +89 -85
  13. package/template/src/core/database/config.ts +50 -48
  14. package/template/src/core/database/connection.ts +116 -114
  15. package/template/src/core/database/migrate-hooks.ts +86 -84
  16. package/template/src/core/database/paginate.ts +226 -224
  17. package/template/src/core/database/reset.ts +21 -19
  18. package/template/src/core/database/seed.ts +169 -167
  19. package/template/src/core/database/status.ts +37 -35
  20. package/template/src/core/env.ts +108 -106
  21. package/template/src/core/facade.ts +63 -61
  22. package/template/src/core/maker/db/fresh.ts +10 -8
  23. package/template/src/core/maker/db/generate.ts +13 -11
  24. package/template/src/core/maker/db/helpers.ts +92 -96
  25. package/template/src/core/maker/db/migrate.ts +37 -35
  26. package/template/src/core/maker/db/mod.ts +93 -91
  27. package/template/src/core/maker/db/module-migrate.ts +56 -54
  28. package/template/src/core/maker/db/push.ts +23 -21
  29. package/template/src/core/maker/db/reset.ts +8 -6
  30. package/template/src/core/maker/db/seed.ts +9 -7
  31. package/template/src/core/maker/db/status.ts +8 -6
  32. package/template/src/core/maker/help.ts +59 -57
  33. package/template/src/core/maker/make/controller.ts +25 -22
  34. package/template/src/core/maker/make/helpers.ts +97 -91
  35. package/template/src/core/maker/make/mod.ts +69 -67
  36. package/template/src/core/maker/make/model.ts +16 -14
  37. package/template/src/core/maker/make/module.ts +53 -39
  38. package/template/src/core/maker/make/seeder.ts +23 -21
  39. package/template/src/core/maker/make/test.ts +33 -30
  40. package/template/src/core/maker/mod.ts +85 -83
  41. package/template/src/core/maker/run/mod.ts +134 -132
  42. package/template/src/core/maker/stub.ts +26 -24
  43. package/template/src/core/maker/stubs/controller/controller.controller.stub +57 -55
  44. package/template/src/core/maker/stubs/controller/controller.schema.stub +18 -13
  45. package/template/src/core/maker/stubs/facade/facade.stub +21 -0
  46. package/template/src/core/maker/stubs/model/model.stub +10 -8
  47. package/template/src/core/maker/stubs/seeder/seeder.stub +18 -16
  48. package/template/src/core/maker/stubs/test/test.stub +9 -7
  49. package/template/src/core/maker/sync-config.ts +93 -94
  50. package/template/src/core/utils/password.ts +29 -27
  51. package/template/src/core/utils/playwright.ts +123 -121
  52. package/template/src/core/utils/queue.ts +68 -66
  53. package/template/src/core/utils/scheduler.ts +62 -60
  54. package/template/src/core/utils/storage.ts +3 -1
  55. package/template/src/core/utils/validation.ts +37 -35
  56. package/template/src/database/schema.ts +2 -0
  57. package/template/src/main.ts +120 -118
  58. package/template/src/modules/app/__tests__/demo.controller.test.ts +75 -0
  59. package/template/src/modules/app/__tests__/net.controller.test.ts +65 -0
  60. package/template/src/modules/app/__tests__/playwright.controller.test.ts +50 -0
  61. package/template/src/modules/app/__tests__/storage.controller.test.ts +114 -0
  62. package/template/src/modules/app/__tests__/window.controller.test.ts +98 -0
  63. package/template/src/modules/app/controllers/demo.controller.ts +120 -118
  64. package/template/src/modules/app/controllers/net.controller.ts +50 -48
  65. package/template/src/modules/app/controllers/playwright.controller.ts +142 -140
  66. package/template/src/modules/app/controllers/storage.controller.ts +231 -229
  67. package/template/src/modules/app/controllers/window.controller.ts +2 -0
  68. package/template/src/modules/app/facade.ts +21 -0
  69. package/template/src/preload.ts +25 -2
  70. package/template/src/ui/src/App.vue +4 -2
  71. package/template/src/ui/src/app.ts +38 -23
  72. package/template/src/ui/src/bindings.d.ts +18 -16
  73. package/template/src/ui/src/components/Button.vue +34 -32
  74. package/template/src/ui/src/components/Checkbox.vue +26 -29
  75. package/template/src/ui/src/components/Input.vue +221 -227
  76. package/template/src/ui/src/components/InputGroup.vue +141 -0
  77. package/template/src/ui/src/components/InputPasswordToggle.vue +204 -0
  78. package/template/src/ui/src/components/Modal.vue +65 -55
  79. package/template/src/ui/src/components/Spinner.vue +44 -42
  80. package/template/src/ui/src/components/Switch.vue +62 -65
  81. package/template/src/ui/src/components/TextArea.vue +108 -121
  82. package/template/src/ui/src/components/Toast.vue +55 -56
  83. package/template/src/ui/src/components/datatable/DataTableSkeleton.vue +100 -98
  84. package/template/src/ui/src/components/datatable/Pagination.vue +153 -125
  85. package/template/src/ui/src/components/datatable/SelectOpption.vue +36 -35
  86. package/template/src/ui/src/components/datatable/index.vue +336 -258
  87. package/template/src/ui/src/env.d.ts +16 -13
  88. package/template/src/ui/src/global.d.ts +21 -2
  89. package/template/src/ui/src/helpers/nformatter.ts +12 -10
  90. package/template/src/ui/src/pages/dashboard/index.vue +690 -687
  91. package/template/src/ui/src/plugins/browserDetect.ts +57 -0
  92. package/template/src/ui/src/plugins/gum.ts +576 -549
  93. package/template/src/ui/src/plugins/pulse.ts +181 -147
  94. package/template/src/ui/src/plugins/routeProgress.ts +89 -0
  95. package/template/src/ui/src/router/index.ts +44 -25
  96. package/template/src/ui/src/stores/example.ts +2 -0
  97. package/template/src/ui/vite.config.ts +40 -38
  98. package/template/src/window/app-menu.ts +89 -87
  99. package/template/src/window/config.ts +14 -12
  100. package/template/src/window/context-menu.ts +23 -21
  101. package/template/src/window/dialogs.ts +92 -90
  102. package/template/src/window/manager.ts +2 -0
  103. package/template/src/window/native.ts +47 -45
  104. package/template/src/window/tray.ts +132 -130
@@ -1,687 +1,690 @@
1
- <script setup lang="ts">
2
- import { ref } from "vue";
3
- import deskapp from "@/ui/assets/images/deskapp.png";
4
- import DataTable from "@/ui/components/datatable/index.vue";
5
- import { useGum } from "@/ui/plugins/gum";
6
-
7
- interface LogEntry {
8
- kind: "info" | "ok" | "warn" | "err";
9
- text: string;
10
- }
11
-
12
- const log = ref<LogEntry[]>([]);
13
- const downloadUrl = ref("https://jsonplaceholder.typicode.com/todos/1");
14
- const apiUrl = ref("https://jsonplaceholder.typicode.com/todos/1");
15
- const siteUrl = ref("https://vuejs.org");
16
- const windowTitle = ref("Deskapp · Recipe Demo");
17
-
18
- const gum = useGum();
19
- const table = ref<InstanceType<typeof DataTable> | null>(null);
20
-
21
- function push(kind: LogEntry["kind"], text: string) {
22
- log.value.unshift({ kind, text });
23
- if (log.value.length > 200) log.value.length = 200;
24
- }
25
-
26
- // Nested form (works for any module): md.<module>.<controller>.<handler>()
27
- // Flat form also works: bindings['app.window.focus']()
28
-
29
- /* app.window.* */
30
- async function openUrlWindow() {
31
- try {
32
- push("ok", `app.window.openUrl → ${JSON.stringify(await md.app.window.openUrl(siteUrl.value || "https://vite.dev"))}`);
33
- } catch (e) {
34
- push("err", `app.window.openUrl → ${String(e)}`);
35
- }
36
- }
37
- async function setWindowTitle() {
38
- try {
39
- push("ok", `app.window.setTitle → ${JSON.stringify(await md.app.window.setTitle(windowTitle.value))}`);
40
- } catch (e) {
41
- push("err", `app.window.setTitle → ${String(e)}`);
42
- }
43
- }
44
- async function focusWindow() {
45
- try {
46
- push("ok", `app.window.focus → ${JSON.stringify(await md.app.window.focus())}`);
47
- } catch (e) {
48
- push("err", `app.window.focus → ${String(e)}`);
49
- }
50
- }
51
- async function toggleAlwaysOnTop() {
52
- try {
53
- push("ok", `app.window.toggleAlwaysOnTop → ${JSON.stringify(await md.app.window.toggleAlwaysOnTop())}`);
54
- } catch (e) {
55
- push("err", `app.window.toggleAlwaysOnTop → ${String(e)}`);
56
- }
57
- }
58
- async function createTray() {
59
- try {
60
- push("ok", `app.window.createTray → ${JSON.stringify(await md.app.window.createTray())}`);
61
- } catch (e) {
62
- push("err", `app.window.createTray → ${String(e)}`);
63
- }
64
- }
65
- async function confirmSomething() {
66
- try {
67
- push("ok", `app.window.confirmSomething → ${JSON.stringify(await md.app.window.confirmSomething("Continue?"))}`);
68
- } catch (e) {
69
- push("err", `app.window.confirmSomething → ${String(e)}`);
70
- }
71
- }
72
- async function alertSomething() {
73
- try {
74
- push("ok", `app.window.alertSomething → ${JSON.stringify(await md.app.window.alertSomething("Hello from Deskapp"))}`);
75
- } catch (e) {
76
- push("err", `app.window.alertSomething → ${String(e)}`);
77
- }
78
- }
79
-
80
- /* app.storage.* */
81
- async function openFile() {
82
- try {
83
- push("ok", `app.storage.open → ${JSON.stringify(await md.app.storage.open())}`);
84
- } catch (e) {
85
- push("err", `app.storage.open → ${String(e)}`);
86
- }
87
- }
88
- async function saveFile() {
89
- try {
90
- push("ok", `app.storage.save → ${JSON.stringify(await md.app.storage.save())}`);
91
- } catch (e) {
92
- push("err", `app.storage.save → ${String(e)}`);
93
- }
94
- }
95
- async function uploadFile() {
96
- try {
97
- push("ok", `app.storage.upload → ${JSON.stringify(await md.app.storage.upload())}`);
98
- } catch (e) {
99
- push("err", `app.storage.upload → ${String(e)}`);
100
- }
101
- }
102
- async function removeFile() {
103
- try {
104
- push("ok", `app.storage.remove → ${JSON.stringify(await md.app.storage.remove())}`);
105
- } catch (e) {
106
- push("err", `app.storage.remove → ${String(e)}`);
107
- }
108
- }
109
- async function listDir() {
110
- try {
111
- push("ok", `app.storage.list → ${JSON.stringify(await md.app.storage.list())}`);
112
- } catch (e) {
113
- push("err", `app.storage.list → ${String(e)}`);
114
- }
115
- }
116
- async function downloadFile() {
117
- try {
118
- push("ok", `app.storage.download → ${JSON.stringify(await md.app.storage.download(downloadUrl.value))}`);
119
- } catch (e) {
120
- push("err", `app.storage.download → ${String(e)}`);
121
- }
122
- }
123
- async function appSave() {
124
- try {
125
- push("ok", `app.storage.appSave → ${JSON.stringify(await md.app.storage.appSave())}`);
126
- } catch (e) {
127
- push("err", `app.storage.appSave → ${String(e)}`);
128
- }
129
- }
130
- async function appLoad() {
131
- try {
132
- push("ok", `app.storage.appLoad → ${JSON.stringify(await md.app.storage.appLoad())}`);
133
- } catch (e) {
134
- push("err", `app.storage.appLoad → ${String(e)}`);
135
- }
136
- }
137
- async function appList() {
138
- try {
139
- push("ok", `app.storage.appList → ${JSON.stringify(await md.app.storage.appList())}`);
140
- } catch (e) {
141
- push("err", `app.storage.appList → ${String(e)}`);
142
- }
143
- }
144
- async function appExport() {
145
- try {
146
- push("ok", `app.storage.appExport → ${JSON.stringify(await md.app.storage.appExport())}`);
147
- } catch (e) {
148
- push("err", `app.storage.appExport → ${String(e)}`);
149
- }
150
- }
151
- async function appDelete() {
152
- try {
153
- push("ok", `app.storage.appDelete → ${JSON.stringify(await md.app.storage.appDelete())}`);
154
- } catch (e) {
155
- push("err", `app.storage.appDelete → ${String(e)}`);
156
- }
157
- }
158
-
159
- /* app.net.* */
160
- async function fetchPlaceholder() {
161
- try {
162
- push("ok", `app.net.placeholder → ${JSON.stringify(await md.app.net.placeholder())}`);
163
- } catch (e) {
164
- push("err", `app.net.placeholder → ${String(e)}`);
165
- }
166
- }
167
- async function fetchJson() {
168
- try {
169
- push("ok", `app.net.fetchJson → ${JSON.stringify(await md.app.net.fetchJson(apiUrl.value))}`);
170
- } catch (e) {
171
- push("err", `app.net.fetchJson → ${String(e)}`);
172
- }
173
- }
174
-
175
- /* app.playwright.* */
176
- async function play() {
177
- push("info", "Starting Playwright…");
178
- try {
179
- push("ok", `app.playwright.play → ${JSON.stringify(await md.app.playwright.play({ seconds: 3, headless: false }))}`);
180
- } catch (e) {
181
- push("err", `app.playwright.play → ${String(e)}`);
182
- }
183
- }
184
-
185
- /* app.demo.* */
186
- async function runQueue() {
187
- try {
188
- push(
189
- "ok",
190
- `app.demo.queue → ${JSON.stringify(await md.app.demo.queue({ items: ["alpha", "beta", "gamma"], concurrency: 2, delayMs: 150 }))}`
191
- );
192
- } catch (e) {
193
- push("err", `app.demo.queue → ${String(e)}`);
194
- }
195
- }
196
- async function runSchedule() {
197
- push("info", "Running cron demo (2s)…");
198
- try {
199
- push("ok", `app.demo.schedule → ${JSON.stringify(await md.app.demo.schedule({ seconds: 2 }))}`);
200
- } catch (e) {
201
- push("err", `app.demo.schedule → ${String(e)}`);
202
- }
203
- }
204
-
205
- /* Data table (gum / app.demo.table + destroy) */
206
- async function removeRows(ids: Array<string | number>) {
207
- try {
208
- const res = await gum.delete("app.demo.destroy", { query: { ids } });
209
- push("ok", `app.demo.destroy → ${JSON.stringify(res?.data ?? res)}`);
210
- } catch (e) {
211
- push("err", `app.demo.destroy → ${String(e)}`);
212
- }
213
- await table.value?.load(1);
214
- }
215
- </script>
216
-
217
- <template>
218
- <div class="app">
219
- <header class="top">
220
- <div class="brand">
221
- <img :src="deskapp" class="logo" alt="deskapp">
222
- <span class="brand-sub">recipes</span>
223
- </div>
224
- <div class="chip"><span class="dot"></span> Electron · Vue 3 · SQLite</div>
225
- </header>
226
-
227
- <section class="hero">
228
- <p class="eyebrow">Simple calls (module → controller → handler)</p>
229
- <h1>Call the backend with <span class="grad">bindings</span></h1>
230
- <p class="sub">
231
- Logical form: <code>await md.app.window.focus()</code> — <b>bindings</b> → <b>module</b> (<code>app</code>) →
232
- <b>controller</b> (<code>window</code>) → <b>handler</b> (<code>focus</code>). Works for any module you create.
233
- </p>
234
- <pre class="snippet">// controller: src/modules/app/controllers/hello.controller.ts
235
- export const greet = async (name: string) => ({ message: `Hello, ${name}!` });
236
- export const handlers = { greet };
237
-
238
- // UI
239
- const res = await md.app.hello.greet('World');</pre>
240
- </section>
241
-
242
- <section class="grid">
243
- <article class="card">
244
- <header>
245
- <i class="bi bi-window-stack"></i>
246
- <div>
247
- <h2>Windows</h2>
248
- <p><code>md.app.window.*</code></p>
249
- </div>
250
- </header>
251
- <div class="actions">
252
- <button class="act" @click="openUrlWindow">Open URL window</button>
253
- <button class="act" @click="focusWindow">Focus</button>
254
- <button class="act" @click="toggleAlwaysOnTop">Always on top</button>
255
- <button class="act" @click="setWindowTitle">Set title</button>
256
- </div>
257
- <div class="row"><input v-model="siteUrl" type="url" placeholder="https://vite.dev"></div>
258
- <div class="row"><input v-model="windowTitle" type="text" placeholder="Window title"></div>
259
- <div class="actions">
260
- <button class="act" @click="createTray">Create tray</button>
261
- <button class="act" @click="confirmSomething">Confirm</button>
262
- <button class="act" @click="alertSomething">Alert</button>
263
- </div>
264
- </article>
265
-
266
- <article class="card">
267
- <header>
268
- <i class="bi bi-folder2-open"></i>
269
- <div>
270
- <h2>Files &amp; storage</h2>
271
- <p><code>md.app.storage.*</code></p>
272
- </div>
273
- </header>
274
- <div class="actions">
275
- <button class="act" @click="openFile">Open</button>
276
- <button class="act" @click="saveFile">Save</button>
277
- <button class="act" @click="uploadFile">Upload</button>
278
- <button class="act" @click="removeFile">Remove</button>
279
- <button class="act" @click="listDir">List dir</button>
280
- </div>
281
- <div class="row">
282
- <input v-model="downloadUrl" type="url" placeholder="https://example.com/file.zip">
283
- <button class="act slim" title="Download" @click="downloadFile"><i class="bi bi-download"></i></button>
284
- </div>
285
- <div class="actions">
286
- <button class="act" @click="appSave">App save</button>
287
- <button class="act" @click="appLoad">App load</button>
288
- <button class="act" @click="appList">App list</button>
289
- <button class="act" @click="appExport">Export tmp</button>
290
- <button class="act danger" @click="appDelete">Delete state</button>
291
- </div>
292
- </article>
293
-
294
- <article class="card">
295
- <header>
296
- <i class="bi bi-globe2"></i>
297
- <div>
298
- <h2>Network (no CORS)</h2>
299
- <p><code>md.app.net.*</code></p>
300
- </div>
301
- </header>
302
- <div class="actions">
303
- <button class="act" @click="fetchPlaceholder">Placeholder</button>
304
- <button class="act accent" @click="fetchJson">Fetch JSON</button>
305
- </div>
306
- <div class="row"><input v-model="apiUrl" type="url" placeholder="https://api.github.com/zen"></div>
307
- </article>
308
-
309
- <article class="card">
310
- <header>
311
- <i class="bi bi-browser-chrome"></i>
312
- <div>
313
- <h2>Playwright</h2>
314
- <p><code>md.app.playwright.play</code></p>
315
- </div>
316
- </header>
317
- <div class="actions">
318
- <button class="act accent" @click="play"><i class="bi bi-play-circle"></i> Launch Chromium (3s)</button>
319
- </div>
320
- <p class="hint">
321
- Backend resolves Chromium via facade. <code>npm i playwright && npx playwright install chromium</code> if needed.
322
- </p>
323
- </article>
324
-
325
- <article class="card">
326
- <header>
327
- <i class="bi bi-lightning-charge"></i>
328
- <div>
329
- <h2>Queue &amp; cron</h2>
330
- <p><code>md.app.demo.*</code></p>
331
- </div>
332
- </header>
333
- <div class="actions">
334
- <button class="act" @click="runQueue">Run queue</button>
335
- <button class="act" @click="runSchedule">Cron · 2s</button>
336
- </div>
337
- </article>
338
-
339
- <article class="card wide">
340
- <header>
341
- <i class="bi bi-table"></i>
342
- <div>
343
- <h2>Data table (gum)</h2>
344
- <p><code>app.demo.table</code> + <code>app.demo.destroy</code></p>
345
- </div>
346
- </header>
347
- <DataTable ref="table" path="app.demo.table" :option="[10, 25, 50]" @remove="removeRows">
348
- <template #thead
349
- ><th>Name</th>
350
- <th>Email</th>
351
- <th>Role</th>
352
- <th>Created</th></template
353
- >
354
- <template #tbody="{ td }"
355
- ><td>{{ td.name }}</td>
356
- <td>{{ td.email }}</td>
357
- <td>{{ td.role }}</td>
358
- <td>{{ td.created }}</td></template
359
- >
360
- </DataTable>
361
- </article>
362
- </section>
363
-
364
- <section class="term">
365
- <header>
366
- <div class="term-title"><i class="bi bi-terminal"></i> Console <span class="cap">— responses</span></div>
367
- <button class="act slim" title="Clear" @click="log = []"><i class="bi bi-trash3"></i></button>
368
- </header>
369
- <pre
370
- v-if="log.length"
371
- class="lines"
372
- ><code v-for="(entry, i) in log" :key="i" :class="'k-' + entry.kind" v-text="entry.text"></code></pre>
373
- <p v-else class="empty">Click an action. (Works in the Electron app: <code>npm run dev</code>.)</p>
374
- </section>
375
-
376
- <footer class="foot">
377
- <span>deskapp starter</span><span class="rule"></span><span><code>md.&lt;module&gt;.&lt;controller&gt;.&lt;handler&gt;()</code></span>
378
- </footer>
379
- </div>
380
- </template>
381
-
382
- <style scoped>
383
- .app {
384
- min-height: 100vh;
385
- display: flex;
386
- flex-direction: column;
387
- padding: 0 clamp(16px, 4vw, 48px) 24px;
388
- background:
389
- radial-gradient(60rem 32rem at 12% -8%, rgba(78, 163, 255, 0.16), transparent 60%),
390
- radial-gradient(50rem 30rem at 88% 4%, rgba(34, 211, 238, 0.12), transparent 60%),
391
- linear-gradient(180deg, var(--dk-bg) 0%, var(--dk-bg-soft) 100%);
392
- }
393
- .top {
394
- display: flex;
395
- align-items: center;
396
- justify-content: space-between;
397
- padding: 18px 0;
398
- border-bottom: 1px solid var(--dk-border);
399
- }
400
- .brand {
401
- display: flex;
402
- align-items: center;
403
- gap: 10px;
404
- }
405
- .brand-sub {
406
- font-size: 12px;
407
- color: var(--dk-faint);
408
- font-weight: 500;
409
- }
410
- .logo {
411
- width: auto;
412
- height: 28px;
413
- }
414
- .chip {
415
- display: flex;
416
- align-items: center;
417
- gap: 8px;
418
- font-size: 12px;
419
- color: var(--dk-muted);
420
- border: 1px solid var(--dk-border);
421
- border-radius: 999px;
422
- padding: 6px 12px;
423
- }
424
- .chip .dot {
425
- width: 8px;
426
- height: 8px;
427
- border-radius: 50%;
428
- background: var(--dk-safe);
429
- animation: pulse 2s infinite;
430
- }
431
- @keyframes pulse {
432
- 0% {
433
- box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
434
- }
435
- 70% {
436
- box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
437
- }
438
- 100% {
439
- box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
440
- }
441
- }
442
- .hero {
443
- padding: clamp(22px, 4vh, 36px) 0 18px;
444
- }
445
- .eyebrow {
446
- margin: 0 0 10px;
447
- font-size: 11px;
448
- font-weight: 600;
449
- letter-spacing: 0.14em;
450
- text-transform: uppercase;
451
- color: var(--dk-faint);
452
- }
453
- .hero h1 {
454
- margin: 0 0 10px;
455
- font-size: clamp(24px, 4.2vw, 38px);
456
- font-weight: 750;
457
- letter-spacing: -0.03em;
458
- line-height: 1.08;
459
- }
460
- .hero .grad {
461
- background: linear-gradient(92deg, var(--dk-accent), var(--dk-accent-2));
462
- -webkit-background-clip: text;
463
- background-clip: text;
464
- color: transparent;
465
- }
466
- .hero .sub {
467
- margin: 0 0 12px;
468
- max-width: 780px;
469
- color: var(--dk-muted);
470
- font-size: 14px;
471
- line-height: 1.6;
472
- }
473
- .hero .sub code,
474
- .hint code,
475
- .snippet {
476
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
477
- }
478
- .hero .sub code,
479
- .hint code {
480
- font-size: 11.5px;
481
- color: var(--dk-accent-2);
482
- background: rgba(34, 211, 238, 0.08);
483
- border-radius: 5px;
484
- padding: 1px 5px;
485
- }
486
- .snippet {
487
- margin: 0;
488
- white-space: pre-wrap;
489
- font-size: 12px;
490
- line-height: 1.55;
491
- color: #c7d7e8;
492
- background: rgba(8, 12, 17, 0.85);
493
- border: 1px solid var(--dk-border);
494
- border-radius: 12px;
495
- padding: 12px 14px;
496
- overflow-x: auto;
497
- }
498
- .grid {
499
- display: grid;
500
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
501
- gap: 14px;
502
- margin-top: 14px;
503
- }
504
- .card {
505
- display: flex;
506
- flex-direction: column;
507
- gap: 12px;
508
- padding: 18px;
509
- border: 1px solid var(--dk-border);
510
- border-radius: 16px;
511
- background: linear-gradient(160deg, rgba(22, 32, 43, 0.85), rgba(14, 20, 27, 0.9));
512
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
513
- }
514
- .card.wide {
515
- grid-column: 1 / -1;
516
- }
517
- .card > header {
518
- display: flex;
519
- align-items: center;
520
- gap: 12px;
521
- }
522
- .card > header > i {
523
- font-size: 20px;
524
- color: var(--dk-accent);
525
- background: rgba(78, 163, 255, 0.12);
526
- border-radius: 10px;
527
- padding: 9px;
528
- }
529
- .card h2 {
530
- margin: 0;
531
- font-size: 15px;
532
- font-weight: 650;
533
- }
534
- .card header p {
535
- margin: 2px 0 0;
536
- font-size: 12px;
537
- color: var(--dk-faint);
538
- }
539
- .actions {
540
- display: flex;
541
- flex-wrap: wrap;
542
- gap: 7px;
543
- }
544
- .act {
545
- display: inline-flex;
546
- align-items: center;
547
- justify-content: center;
548
- gap: 6px;
549
- font-size: 12.5px;
550
- font-weight: 500;
551
- color: var(--dk-text);
552
- border: 1px solid var(--dk-border);
553
- border-radius: 9px;
554
- background: var(--dk-surface-2);
555
- padding: 8px 12px;
556
- cursor: pointer;
557
- }
558
- .act:hover {
559
- border-color: rgba(78, 163, 255, 0.55);
560
- color: var(--dk-accent);
561
- }
562
- .act.slim {
563
- padding: 8px 10px;
564
- }
565
- .act.accent {
566
- background: linear-gradient(92deg, #357dcc, #1f9ec1);
567
- border-color: transparent;
568
- color: #fff;
569
- }
570
- .act.danger:hover {
571
- border-color: rgba(251, 113, 133, 0.6);
572
- color: var(--dk-err);
573
- }
574
- .row {
575
- display: flex;
576
- gap: 7px;
577
- }
578
- .row input {
579
- flex: 1;
580
- min-width: 0;
581
- font-size: 12.5px;
582
- color: var(--dk-text);
583
- background: var(--dk-surface-2);
584
- border: 1px solid var(--dk-border);
585
- border-radius: 9px;
586
- padding: 8px 11px;
587
- }
588
- .row input:focus {
589
- outline: none;
590
- border-color: var(--dk-accent);
591
- }
592
- .hint {
593
- margin: 0;
594
- font-size: 12px;
595
- line-height: 1.55;
596
- color: var(--dk-faint);
597
- }
598
- .term {
599
- margin-top: 14px;
600
- border: 1px solid var(--dk-border);
601
- border-radius: 16px;
602
- overflow: hidden;
603
- background: rgba(8, 12, 17, 0.85);
604
- }
605
- .term > header {
606
- display: flex;
607
- align-items: center;
608
- justify-content: space-between;
609
- padding: 12px 16px;
610
- border-bottom: 1px solid var(--dk-border);
611
- }
612
- .term-title {
613
- display: flex;
614
- align-items: center;
615
- gap: 8px;
616
- font-size: 12.5px;
617
- font-weight: 600;
618
- }
619
- .term-title i {
620
- color: var(--dk-accent);
621
- }
622
- .term-title .cap {
623
- font-weight: 400;
624
- color: var(--dk-faint);
625
- }
626
- .lines {
627
- max-height: 320px;
628
- overflow: auto;
629
- padding: 14px 16px;
630
- display: flex;
631
- flex-direction: column-reverse;
632
- gap: 4px;
633
- font-size: 12px;
634
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
635
- line-height: 1.6;
636
- margin: 0;
637
- }
638
- .lines code {
639
- white-space: pre-wrap;
640
- word-break: break-word;
641
- }
642
- .k-ok {
643
- color: var(--dk-safe);
644
- }
645
- .k-err {
646
- color: var(--dk-err);
647
- }
648
- .k-warn {
649
- color: var(--dk-warn);
650
- }
651
- .k-info {
652
- color: var(--dk-accent-2);
653
- }
654
- .empty {
655
- margin: 0;
656
- padding: 14px 16px;
657
- font-size: 12.5px;
658
- color: var(--dk-faint);
659
- }
660
- .foot {
661
- display: flex;
662
- align-items: center;
663
- justify-content: center;
664
- gap: 12px;
665
- margin-top: 22px;
666
- font-size: 11.5px;
667
- color: var(--dk-faint);
668
- }
669
- .foot .rule {
670
- width: 1px;
671
- height: 12px;
672
- background: var(--dk-border);
673
- }
674
- .card :deep(.datatable thead th) {
675
- background: rgba(78, 163, 255, 0.07);
676
- border-color: var(--dk-border) !important;
677
- }
678
- .card :deep(.datatable td),
679
- .card :deep(.datatable th) {
680
- background-color: transparent;
681
- }
682
- @media (max-width: 720px) {
683
- .chip {
684
- display: none;
685
- }
686
- }
687
- </style>
1
+ <!-- ./src/ui/src/pages/dashboard/index.vue -->
2
+
3
+ <script setup lang="ts">
4
+ import { ref } from "vue";
5
+ import deskapp from "@/ui/assets/images/deskapp.png";
6
+ import DataTable from "@/ui/components/datatable/index.vue";
7
+ import { useGum } from "@/ui/plugins/gum";
8
+
9
+ interface LogEntry {
10
+ kind: "info" | "ok" | "warn" | "err";
11
+ text: string;
12
+ }
13
+
14
+ const log = ref<LogEntry[]>([]);
15
+ const downloadUrl = ref("https://jsonplaceholder.typicode.com/todos/1");
16
+ const apiUrl = ref("https://jsonplaceholder.typicode.com/todos/1");
17
+ const siteUrl = ref("https://vuejs.org");
18
+ const windowTitle = ref("Deskapp · Recipe Demo");
19
+
20
+ const gum = useGum();
21
+ const table = ref<InstanceType<typeof DataTable> | null>(null);
22
+
23
+ function push(kind: LogEntry["kind"], text: string) {
24
+ log.value.unshift({ kind, text });
25
+ if (log.value.length > 200) log.value.length = 200;
26
+ }
27
+
28
+ // Nested form (works for any module): md.<module>.<controller>.<handler>()
29
+ // Flat form also works: bindings['app.window.focus']()
30
+
31
+ /* app.window.* */
32
+ async function openUrlWindow() {
33
+ try {
34
+ push("ok", `app.window.openUrl → ${JSON.stringify(await md.app.window.openUrl(siteUrl.value || "https://vite.dev"))}`);
35
+ } catch (e) {
36
+ push("err", `app.window.openUrl → ${String(e)}`);
37
+ }
38
+ }
39
+ async function setWindowTitle() {
40
+ try {
41
+ push("ok", `app.window.setTitle → ${JSON.stringify(await md.app.window.setTitle(windowTitle.value))}`);
42
+ } catch (e) {
43
+ push("err", `app.window.setTitle → ${String(e)}`);
44
+ }
45
+ }
46
+ async function focusWindow() {
47
+ try {
48
+ push("ok", `app.window.focus → ${JSON.stringify(await md.app.window.focus())}`);
49
+ } catch (e) {
50
+ push("err", `app.window.focus → ${String(e)}`);
51
+ }
52
+ }
53
+ async function toggleAlwaysOnTop() {
54
+ try {
55
+ push("ok", `app.window.toggleAlwaysOnTop → ${JSON.stringify(await md.app.window.toggleAlwaysOnTop())}`);
56
+ } catch (e) {
57
+ push("err", `app.window.toggleAlwaysOnTop → ${String(e)}`);
58
+ }
59
+ }
60
+ async function createTray() {
61
+ try {
62
+ push("ok", `app.window.createTray → ${JSON.stringify(await md.app.window.createTray())}`);
63
+ } catch (e) {
64
+ push("err", `app.window.createTray → ${String(e)}`);
65
+ }
66
+ }
67
+ async function confirmSomething() {
68
+ try {
69
+ push("ok", `app.window.confirmSomething → ${JSON.stringify(await md.app.window.confirmSomething("Continue?"))}`);
70
+ } catch (e) {
71
+ push("err", `app.window.confirmSomething → ${String(e)}`);
72
+ }
73
+ }
74
+ async function alertSomething() {
75
+ try {
76
+ push("ok", `app.window.alertSomething → ${JSON.stringify(await md.app.window.alertSomething("Hello from Deskapp"))}`);
77
+ } catch (e) {
78
+ push("err", `app.window.alertSomething → ${String(e)}`);
79
+ }
80
+ }
81
+
82
+ /* app.storage.* */
83
+ async function openFile() {
84
+ try {
85
+ push("ok", `app.storage.open → ${JSON.stringify(await md.app.storage.open())}`);
86
+ } catch (e) {
87
+ push("err", `app.storage.open → ${String(e)}`);
88
+ }
89
+ }
90
+ async function saveFile() {
91
+ try {
92
+ push("ok", `app.storage.save → ${JSON.stringify(await md.app.storage.save())}`);
93
+ } catch (e) {
94
+ push("err", `app.storage.save → ${String(e)}`);
95
+ }
96
+ }
97
+ async function uploadFile() {
98
+ try {
99
+ push("ok", `app.storage.upload → ${JSON.stringify(await md.app.storage.upload())}`);
100
+ } catch (e) {
101
+ push("err", `app.storage.upload → ${String(e)}`);
102
+ }
103
+ }
104
+ async function removeFile() {
105
+ try {
106
+ push("ok", `app.storage.remove → ${JSON.stringify(await md.app.storage.remove())}`);
107
+ } catch (e) {
108
+ push("err", `app.storage.remove → ${String(e)}`);
109
+ }
110
+ }
111
+ async function listDir() {
112
+ try {
113
+ push("ok", `app.storage.list → ${JSON.stringify(await md.app.storage.list())}`);
114
+ } catch (e) {
115
+ push("err", `app.storage.list → ${String(e)}`);
116
+ }
117
+ }
118
+ async function downloadFile() {
119
+ try {
120
+ push("ok", `app.storage.download → ${JSON.stringify(await md.app.storage.download(downloadUrl.value))}`);
121
+ } catch (e) {
122
+ push("err", `app.storage.download → ${String(e)}`);
123
+ }
124
+ }
125
+ async function appSave() {
126
+ try {
127
+ push("ok", `app.storage.appSave → ${JSON.stringify(await md.app.storage.appSave())}`);
128
+ } catch (e) {
129
+ push("err", `app.storage.appSave → ${String(e)}`);
130
+ }
131
+ }
132
+ async function appLoad() {
133
+ try {
134
+ push("ok", `app.storage.appLoad → ${JSON.stringify(await md.app.storage.appLoad())}`);
135
+ } catch (e) {
136
+ push("err", `app.storage.appLoad → ${String(e)}`);
137
+ }
138
+ }
139
+ async function appList() {
140
+ try {
141
+ push("ok", `app.storage.appList → ${JSON.stringify(await md.app.storage.appList())}`);
142
+ } catch (e) {
143
+ push("err", `app.storage.appList → ${String(e)}`);
144
+ }
145
+ }
146
+ async function appExport() {
147
+ try {
148
+ push("ok", `app.storage.appExport → ${JSON.stringify(await md.app.storage.appExport())}`);
149
+ } catch (e) {
150
+ push("err", `app.storage.appExport → ${String(e)}`);
151
+ }
152
+ }
153
+ async function appDelete() {
154
+ try {
155
+ push("ok", `app.storage.appDelete → ${JSON.stringify(await md.app.storage.appDelete())}`);
156
+ } catch (e) {
157
+ push("err", `app.storage.appDelete → ${String(e)}`);
158
+ }
159
+ }
160
+
161
+ /* app.net.* */
162
+ async function fetchPlaceholder() {
163
+ try {
164
+ push("ok", `app.net.placeholder → ${JSON.stringify(await md.app.net.placeholder())}`);
165
+ } catch (e) {
166
+ push("err", `app.net.placeholder → ${String(e)}`);
167
+ }
168
+ }
169
+ async function fetchJson() {
170
+ try {
171
+ push("ok", `app.net.fetchJson → ${JSON.stringify(await md.app.net.fetchJson(apiUrl.value))}`);
172
+ } catch (e) {
173
+ push("err", `app.net.fetchJson → ${String(e)}`);
174
+ }
175
+ }
176
+
177
+ /* app.playwright.* */
178
+ async function play() {
179
+ push("info", "Starting Playwright…");
180
+ try {
181
+ push("ok", `app.playwright.play → ${JSON.stringify(await md.app.playwright.play({ seconds: 3, headless: false }))}`);
182
+ } catch (e) {
183
+ push("err", `app.playwright.play → ${String(e)}`);
184
+ }
185
+ }
186
+
187
+ /* app.demo.* */
188
+ async function runQueue() {
189
+ try {
190
+ push(
191
+ "ok",
192
+ `app.demo.queue → ${JSON.stringify(await md.app.demo.queue({ items: ["alpha", "beta", "gamma"], concurrency: 2, delayMs: 150 }))}`
193
+ );
194
+ } catch (e) {
195
+ push("err", `app.demo.queue → ${String(e)}`);
196
+ }
197
+ }
198
+ async function runSchedule() {
199
+ push("info", "Running cron demo (2s)…");
200
+ try {
201
+ push("ok", `app.demo.schedule → ${JSON.stringify(await md.app.demo.schedule({ seconds: 2 }))}`);
202
+ } catch (e) {
203
+ push("err", `app.demo.schedule → ${String(e)}`);
204
+ }
205
+ }
206
+
207
+ /* Data table (gum / app.demo.table + destroy) */
208
+ async function removeRows(ids: Array<string | number>) {
209
+ try {
210
+ const res = await gum.delete("app.demo.destroy", { query: { ids } });
211
+ push("ok", `app.demo.destroy → ${JSON.stringify(res?.data ?? res)}`);
212
+ } catch (e) {
213
+ push("err", `app.demo.destroy → ${String(e)}`);
214
+ }
215
+ await table.value?.load(1);
216
+ }
217
+ </script>
218
+
219
+ <template>
220
+ <div class="app">
221
+ <header class="top">
222
+ <div class="brand">
223
+ <img :src="deskapp" class="logo" alt="deskapp">
224
+ <span class="brand-sub">recipes</span>
225
+ </div>
226
+ <div class="chip"><span class="dot"></span> Electron · Vue 3 · SQLite</div>
227
+ </header>
228
+
229
+ <section class="hero">
230
+ <p class="eyebrow">Simple calls (module → controller → handler)</p>
231
+ <h1>Call the backend with <span class="grad">bindings</span></h1>
232
+ <p class="sub">
233
+ Logical form: <code>await md.app.window.focus()</code> — <b>bindings</b> → <b>module</b> (<code>app</code>) →
234
+ <b>controller</b>
235
+ (<code>window</code>) → <b>handler</b> (<code>focus</code>). Works for any module you create.
236
+ </p>
237
+ <pre class="snippet">// controller: src/modules/app/controllers/hello.controller.ts
238
+ export const greet = async (name: string) => ({ message: `Hello, ${name}!` });
239
+ export const handlers = { greet };
240
+
241
+ // UI
242
+ const res = await md.app.hello.greet('World');</pre>
243
+ </section>
244
+
245
+ <section class="grid">
246
+ <article class="card">
247
+ <header>
248
+ <i class="bi bi-window-stack"></i>
249
+ <div>
250
+ <h2>Windows</h2>
251
+ <p><code>md.app.window.*</code></p>
252
+ </div>
253
+ </header>
254
+ <div class="actions">
255
+ <button class="act" @click="openUrlWindow">Open URL window</button>
256
+ <button class="act" @click="focusWindow">Focus</button>
257
+ <button class="act" @click="toggleAlwaysOnTop">Always on top</button>
258
+ <button class="act" @click="setWindowTitle">Set title</button>
259
+ </div>
260
+ <div class="row"><input v-model="siteUrl" type="url" placeholder="https://vite.dev"></div>
261
+ <div class="row"><input v-model="windowTitle" type="text" placeholder="Window title"></div>
262
+ <div class="actions">
263
+ <button class="act" @click="createTray">Create tray</button>
264
+ <button class="act" @click="confirmSomething">Confirm</button>
265
+ <button class="act" @click="alertSomething">Alert</button>
266
+ </div>
267
+ </article>
268
+
269
+ <article class="card">
270
+ <header>
271
+ <i class="bi bi-folder2-open"></i>
272
+ <div>
273
+ <h2>Files &amp; storage</h2>
274
+ <p><code>md.app.storage.*</code></p>
275
+ </div>
276
+ </header>
277
+ <div class="actions">
278
+ <button class="act" @click="openFile">Open</button>
279
+ <button class="act" @click="saveFile">Save</button>
280
+ <button class="act" @click="uploadFile">Upload</button>
281
+ <button class="act" @click="removeFile">Remove</button>
282
+ <button class="act" @click="listDir">List dir</button>
283
+ </div>
284
+ <div class="row">
285
+ <input v-model="downloadUrl" type="url" placeholder="https://example.com/file.zip">
286
+ <button class="act slim" title="Download" @click="downloadFile"><i class="bi bi-download"></i></button>
287
+ </div>
288
+ <div class="actions">
289
+ <button class="act" @click="appSave">App save</button>
290
+ <button class="act" @click="appLoad">App load</button>
291
+ <button class="act" @click="appList">App list</button>
292
+ <button class="act" @click="appExport">Export tmp</button>
293
+ <button class="act danger" @click="appDelete">Delete state</button>
294
+ </div>
295
+ </article>
296
+
297
+ <article class="card">
298
+ <header>
299
+ <i class="bi bi-globe2"></i>
300
+ <div>
301
+ <h2>Network (no CORS)</h2>
302
+ <p><code>md.app.net.*</code></p>
303
+ </div>
304
+ </header>
305
+ <div class="actions">
306
+ <button class="act" @click="fetchPlaceholder">Placeholder</button>
307
+ <button class="act accent" @click="fetchJson">Fetch JSON</button>
308
+ </div>
309
+ <div class="row"><input v-model="apiUrl" type="url" placeholder="https://api.github.com/zen"></div>
310
+ </article>
311
+
312
+ <article class="card">
313
+ <header>
314
+ <i class="bi bi-browser-chrome"></i>
315
+ <div>
316
+ <h2>Playwright</h2>
317
+ <p><code>md.app.playwright.play</code></p>
318
+ </div>
319
+ </header>
320
+ <div class="actions">
321
+ <button class="act accent" @click="play"><i class="bi bi-play-circle"></i> Launch Chromium (3s)</button>
322
+ </div>
323
+ <p class="hint">
324
+ Backend resolves Chromium via facade. <code>npm i playwright && npx playwright install chromium</code> if needed.
325
+ </p>
326
+ </article>
327
+
328
+ <article class="card">
329
+ <header>
330
+ <i class="bi bi-lightning-charge"></i>
331
+ <div>
332
+ <h2>Queue &amp; cron</h2>
333
+ <p><code>md.app.demo.*</code></p>
334
+ </div>
335
+ </header>
336
+ <div class="actions">
337
+ <button class="act" @click="runQueue">Run queue</button>
338
+ <button class="act" @click="runSchedule">Cron · 2s</button>
339
+ </div>
340
+ </article>
341
+
342
+ <article class="card wide">
343
+ <header>
344
+ <i class="bi bi-table"></i>
345
+ <div>
346
+ <h2>Data table (gum)</h2>
347
+ <p><code>app.demo.table</code> + <code>app.demo.destroy</code></p>
348
+ </div>
349
+ </header>
350
+ <DataTable ref="table" path="app.demo.table" :option="[10, 25, 50]" @remove="removeRows">
351
+ <template #thead
352
+ ><th>Name</th>
353
+ <th>Email</th>
354
+ <th>Role</th>
355
+ <th>Created</th></template
356
+ >
357
+ <template #tbody="{ td }"
358
+ ><td>{{ td.name }}</td>
359
+ <td>{{ td.email }}</td>
360
+ <td>{{ td.role }}</td>
361
+ <td>{{ td.created }}</td></template
362
+ >
363
+ </DataTable>
364
+ </article>
365
+ </section>
366
+
367
+ <section class="term">
368
+ <header>
369
+ <div class="term-title"><i class="bi bi-terminal"></i> Console <span class="cap">— responses</span></div>
370
+ <button class="act slim" title="Clear" @click="log = []"><i class="bi bi-trash3"></i></button>
371
+ </header>
372
+ <pre
373
+ v-if="log.length"
374
+ class="lines"
375
+ ><code v-for="(entry, i) in log" :key="i" :class="'k-' + entry.kind" v-text="entry.text"></code></pre>
376
+ <p v-else class="empty">Click an action. (Works in the Electron app: <code>npm run dev</code>.)</p>
377
+ </section>
378
+
379
+ <footer class="foot">
380
+ <span>deskapp starter</span><span class="rule"></span><span><code>md.&lt;module&gt;.&lt;controller&gt;.&lt;handler&gt;()</code></span>
381
+ </footer>
382
+ </div>
383
+ </template>
384
+
385
+ <style lang="scss" scoped>
386
+ .app {
387
+ min-height: 100vh;
388
+ display: flex;
389
+ flex-direction: column;
390
+ padding: 0 clamp(16px, 4vw, 48px) 24px;
391
+ background:
392
+ radial-gradient(60rem 32rem at 12% -8%, rgba(78, 163, 255, 0.16), transparent 60%),
393
+ radial-gradient(50rem 30rem at 88% 4%, rgba(34, 211, 238, 0.12), transparent 60%),
394
+ linear-gradient(180deg, var(--dk-bg) 0%, var(--dk-bg-soft) 100%);
395
+ }
396
+ .top {
397
+ display: flex;
398
+ align-items: center;
399
+ justify-content: space-between;
400
+ padding: 18px 0;
401
+ border-bottom: 1px solid var(--dk-border);
402
+ }
403
+ .brand {
404
+ display: flex;
405
+ align-items: center;
406
+ gap: 10px;
407
+ }
408
+ .brand-sub {
409
+ font-size: 12px;
410
+ color: var(--dk-faint);
411
+ font-weight: 500;
412
+ }
413
+ .logo {
414
+ width: auto;
415
+ height: 28px;
416
+ }
417
+ .chip {
418
+ display: flex;
419
+ align-items: center;
420
+ gap: 8px;
421
+ font-size: 12px;
422
+ color: var(--dk-muted);
423
+ border: 1px solid var(--dk-border);
424
+ border-radius: 999px;
425
+ padding: 6px 12px;
426
+ }
427
+ .chip .dot {
428
+ width: 8px;
429
+ height: 8px;
430
+ border-radius: 50%;
431
+ background: var(--dk-safe);
432
+ animation: pulse 2s infinite;
433
+ }
434
+ @keyframes pulse {
435
+ 0% {
436
+ box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
437
+ }
438
+ 70% {
439
+ box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
440
+ }
441
+ 100% {
442
+ box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
443
+ }
444
+ }
445
+ .hero {
446
+ padding: clamp(22px, 4vh, 36px) 0 18px;
447
+ }
448
+ .eyebrow {
449
+ margin: 0 0 10px;
450
+ font-size: 11px;
451
+ font-weight: 600;
452
+ letter-spacing: 0.14em;
453
+ text-transform: uppercase;
454
+ color: var(--dk-faint);
455
+ }
456
+ .hero h1 {
457
+ margin: 0 0 10px;
458
+ font-size: clamp(24px, 4.2vw, 38px);
459
+ font-weight: 750;
460
+ letter-spacing: -0.03em;
461
+ line-height: 1.08;
462
+ }
463
+ .hero .grad {
464
+ background: linear-gradient(92deg, var(--dk-accent), var(--dk-accent-2));
465
+ -webkit-background-clip: text;
466
+ background-clip: text;
467
+ color: transparent;
468
+ }
469
+ .hero .sub {
470
+ margin: 0 0 12px;
471
+ max-width: 780px;
472
+ color: var(--dk-muted);
473
+ font-size: 14px;
474
+ line-height: 1.6;
475
+ }
476
+ .hero .sub code,
477
+ .hint code,
478
+ .snippet {
479
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
480
+ }
481
+ .hero .sub code,
482
+ .hint code {
483
+ font-size: 11.5px;
484
+ color: var(--dk-accent-2);
485
+ background: rgba(34, 211, 238, 0.08);
486
+ border-radius: 5px;
487
+ padding: 1px 5px;
488
+ }
489
+ .snippet {
490
+ margin: 0;
491
+ white-space: pre-wrap;
492
+ font-size: 12px;
493
+ line-height: 1.55;
494
+ color: #c7d7e8;
495
+ background: rgba(8, 12, 17, 0.85);
496
+ border: 1px solid var(--dk-border);
497
+ border-radius: 12px;
498
+ padding: 12px 14px;
499
+ overflow-x: auto;
500
+ }
501
+ .grid {
502
+ display: grid;
503
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
504
+ gap: 14px;
505
+ margin-top: 14px;
506
+ }
507
+ .card {
508
+ display: flex;
509
+ flex-direction: column;
510
+ gap: 12px;
511
+ padding: 18px;
512
+ border: 1px solid var(--dk-border);
513
+ border-radius: 16px;
514
+ background: linear-gradient(160deg, rgba(22, 32, 43, 0.85), rgba(14, 20, 27, 0.9));
515
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
516
+ }
517
+ .card.wide {
518
+ grid-column: 1 / -1;
519
+ }
520
+ .card > header {
521
+ display: flex;
522
+ align-items: center;
523
+ gap: 12px;
524
+ }
525
+ .card > header > i {
526
+ font-size: 20px;
527
+ color: var(--dk-accent);
528
+ background: rgba(78, 163, 255, 0.12);
529
+ border-radius: 10px;
530
+ padding: 9px;
531
+ }
532
+ .card h2 {
533
+ margin: 0;
534
+ font-size: 15px;
535
+ font-weight: 650;
536
+ }
537
+ .card header p {
538
+ margin: 2px 0 0;
539
+ font-size: 12px;
540
+ color: var(--dk-faint);
541
+ }
542
+ .actions {
543
+ display: flex;
544
+ flex-wrap: wrap;
545
+ gap: 7px;
546
+ }
547
+ .act {
548
+ display: inline-flex;
549
+ align-items: center;
550
+ justify-content: center;
551
+ gap: 6px;
552
+ font-size: 12.5px;
553
+ font-weight: 500;
554
+ color: var(--dk-text);
555
+ border: 1px solid var(--dk-border);
556
+ border-radius: 9px;
557
+ background: var(--dk-surface-2);
558
+ padding: 8px 12px;
559
+ cursor: pointer;
560
+ }
561
+ .act:hover {
562
+ border-color: rgba(78, 163, 255, 0.55);
563
+ color: var(--dk-accent);
564
+ }
565
+ .act.slim {
566
+ padding: 8px 10px;
567
+ }
568
+ .act.accent {
569
+ background: linear-gradient(92deg, #357dcc, #1f9ec1);
570
+ border-color: transparent;
571
+ color: #fff;
572
+ }
573
+ .act.danger:hover {
574
+ border-color: rgba(251, 113, 133, 0.6);
575
+ color: var(--dk-err);
576
+ }
577
+ .row {
578
+ display: flex;
579
+ gap: 7px;
580
+ }
581
+ .row input {
582
+ flex: 1;
583
+ min-width: 0;
584
+ font-size: 12.5px;
585
+ color: var(--dk-text);
586
+ background: var(--dk-surface-2);
587
+ border: 1px solid var(--dk-border);
588
+ border-radius: 9px;
589
+ padding: 8px 11px;
590
+ }
591
+ .row input:focus {
592
+ outline: none;
593
+ border-color: var(--dk-accent);
594
+ }
595
+ .hint {
596
+ margin: 0;
597
+ font-size: 12px;
598
+ line-height: 1.55;
599
+ color: var(--dk-faint);
600
+ }
601
+ .term {
602
+ margin-top: 14px;
603
+ border: 1px solid var(--dk-border);
604
+ border-radius: 16px;
605
+ overflow: hidden;
606
+ background: rgba(8, 12, 17, 0.85);
607
+ }
608
+ .term > header {
609
+ display: flex;
610
+ align-items: center;
611
+ justify-content: space-between;
612
+ padding: 12px 16px;
613
+ border-bottom: 1px solid var(--dk-border);
614
+ }
615
+ .term-title {
616
+ display: flex;
617
+ align-items: center;
618
+ gap: 8px;
619
+ font-size: 12.5px;
620
+ font-weight: 600;
621
+ }
622
+ .term-title i {
623
+ color: var(--dk-accent);
624
+ }
625
+ .term-title .cap {
626
+ font-weight: 400;
627
+ color: var(--dk-faint);
628
+ }
629
+ .lines {
630
+ max-height: 320px;
631
+ overflow: auto;
632
+ padding: 14px 16px;
633
+ display: flex;
634
+ flex-direction: column-reverse;
635
+ gap: 4px;
636
+ font-size: 12px;
637
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
638
+ line-height: 1.6;
639
+ margin: 0;
640
+ }
641
+ .lines code {
642
+ white-space: pre-wrap;
643
+ word-break: break-word;
644
+ }
645
+ .k-ok {
646
+ color: var(--dk-safe);
647
+ }
648
+ .k-err {
649
+ color: var(--dk-err);
650
+ }
651
+ .k-warn {
652
+ color: var(--dk-warn);
653
+ }
654
+ .k-info {
655
+ color: var(--dk-accent-2);
656
+ }
657
+ .empty {
658
+ margin: 0;
659
+ padding: 14px 16px;
660
+ font-size: 12.5px;
661
+ color: var(--dk-faint);
662
+ }
663
+ .foot {
664
+ display: flex;
665
+ align-items: center;
666
+ justify-content: center;
667
+ gap: 12px;
668
+ margin-top: 22px;
669
+ font-size: 11.5px;
670
+ color: var(--dk-faint);
671
+ }
672
+ .foot .rule {
673
+ width: 1px;
674
+ height: 12px;
675
+ background: var(--dk-border);
676
+ }
677
+ .card :deep(.datatable thead th) {
678
+ background: rgba(78, 163, 255, 0.07);
679
+ border-color: var(--dk-border) !important;
680
+ }
681
+ .card :deep(.datatable td),
682
+ .card :deep(.datatable th) {
683
+ background-color: transparent;
684
+ }
685
+ @media (max-width: 720px) {
686
+ .chip {
687
+ display: none;
688
+ }
689
+ }
690
+ </style>