@desktalk/core 0.1.0-alpha.1
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/LICENSE +21 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +82 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/frontend/assets/frontend-B3QNYf3p.js +413 -0
- package/dist/frontend/assets/frontend-B3QNYf3p.js.map +1 -0
- package/dist/frontend/assets/frontend-B4aeXn9d.js +416 -0
- package/dist/frontend/assets/frontend-B4aeXn9d.js.map +1 -0
- package/dist/frontend/assets/frontend-BwyRSlHp.js +6513 -0
- package/dist/frontend/assets/frontend-BwyRSlHp.js.map +1 -0
- package/dist/frontend/assets/frontend-Dix2OWTT.js +229 -0
- package/dist/frontend/assets/frontend-Dix2OWTT.js.map +1 -0
- package/dist/frontend/assets/frontend-Dx41dEM9.js +407 -0
- package/dist/frontend/assets/frontend-Dx41dEM9.js.map +1 -0
- package/dist/frontend/assets/frontend-WpQng8Mt.js +1991 -0
- package/dist/frontend/assets/frontend-WpQng8Mt.js.map +1 -0
- package/dist/frontend/assets/frontend-rTwBdJbn.js +2123 -0
- package/dist/frontend/assets/frontend-rTwBdJbn.js.map +1 -0
- package/dist/frontend/assets/highlighted-body-TPN3WLV5-DD4wpkf4.js +2 -0
- package/dist/frontend/assets/highlighted-body-TPN3WLV5-DD4wpkf4.js.map +1 -0
- package/dist/frontend/assets/index-C5-XUOS7.js +1863 -0
- package/dist/frontend/assets/index-C5-XUOS7.js.map +1 -0
- package/dist/frontend/assets/index-C_e3_6yE.css +1 -0
- package/dist/frontend/index.html +22 -0
- package/dist/frontend/pcm-capture-processor.js +65 -0
- package/dist/i18n/manifest.json +34 -0
- package/dist/i18n/zh-CN.json +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/server/admin-routes.d.ts +14 -0
- package/dist/server/admin-routes.d.ts.map +1 -0
- package/dist/server/admin-routes.js +118 -0
- package/dist/server/admin-routes.js.map +1 -0
- package/dist/server/api-routes.d.ts +8 -0
- package/dist/server/api-routes.d.ts.map +1 -0
- package/dist/server/api-routes.js +203 -0
- package/dist/server/api-routes.js.map +1 -0
- package/dist/server/auth-routes.d.ts +19 -0
- package/dist/server/auth-routes.d.ts.map +1 -0
- package/dist/server/auth-routes.js +155 -0
- package/dist/server/auth-routes.js.map +1 -0
- package/dist/server/dtfs-routes.d.ts +3 -0
- package/dist/server/dtfs-routes.d.ts.map +1 -0
- package/dist/server/dtfs-routes.js +183 -0
- package/dist/server/dtfs-routes.js.map +1 -0
- package/dist/server/index.d.ts +15 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +158 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/monaco-routes.d.ts +3 -0
- package/dist/server/monaco-routes.d.ts.map +1 -0
- package/dist/server/monaco-routes.js +45 -0
- package/dist/server/monaco-routes.js.map +1 -0
- package/dist/server/voice-routes.d.ts +7 -0
- package/dist/server/voice-routes.d.ts.map +1 -0
- package/dist/server/voice-routes.js +142 -0
- package/dist/server/voice-routes.js.map +1 -0
- package/dist/server/ws-routes.d.ts +29 -0
- package/dist/server/ws-routes.d.ts.map +1 -0
- package/dist/server/ws-routes.js +334 -0
- package/dist/server/ws-routes.js.map +1 -0
- package/dist/services/ai/action-tool.d.ts +9 -0
- package/dist/services/ai/action-tool.d.ts.map +1 -0
- package/dist/services/ai/action-tool.js +51 -0
- package/dist/services/ai/action-tool.js.map +1 -0
- package/dist/services/ai/app-tools.d.ts +15 -0
- package/dist/services/ai/app-tools.d.ts.map +1 -0
- package/dist/services/ai/app-tools.js +119 -0
- package/dist/services/ai/app-tools.js.map +1 -0
- package/dist/services/ai/chat-service.d.ts +27 -0
- package/dist/services/ai/chat-service.d.ts.map +1 -0
- package/dist/services/ai/chat-service.js +213 -0
- package/dist/services/ai/chat-service.js.map +1 -0
- package/dist/services/ai/create-liveapp-tool.d.ts +15 -0
- package/dist/services/ai/create-liveapp-tool.d.ts.map +1 -0
- package/dist/services/ai/create-liveapp-tool.js +142 -0
- package/dist/services/ai/create-liveapp-tool.js.map +1 -0
- package/dist/services/ai/desktop-tool.d.ts +27 -0
- package/dist/services/ai/desktop-tool.d.ts.map +1 -0
- package/dist/services/ai/desktop-tool.js +106 -0
- package/dist/services/ai/desktop-tool.js.map +1 -0
- package/dist/services/ai/edit-history.d.ts +16 -0
- package/dist/services/ai/edit-history.d.ts.map +1 -0
- package/dist/services/ai/edit-history.js +137 -0
- package/dist/services/ai/edit-history.js.map +1 -0
- package/dist/services/ai/edit-tool.d.ts +9 -0
- package/dist/services/ai/edit-tool.d.ts.map +1 -0
- package/dist/services/ai/edit-tool.js +113 -0
- package/dist/services/ai/edit-tool.js.map +1 -0
- package/dist/services/ai/generate-html-tool.d.ts +15 -0
- package/dist/services/ai/generate-html-tool.d.ts.map +1 -0
- package/dist/services/ai/generate-html-tool.js +140 -0
- package/dist/services/ai/generate-html-tool.js.map +1 -0
- package/dist/services/ai/generate-icon-tool.d.ts +10 -0
- package/dist/services/ai/generate-icon-tool.d.ts.map +1 -0
- package/dist/services/ai/generate-icon-tool.js +58 -0
- package/dist/services/ai/generate-icon-tool.js.map +1 -0
- package/dist/services/ai/html-bridge-script.d.ts +2 -0
- package/dist/services/ai/html-bridge-script.d.ts.map +1 -0
- package/dist/services/ai/html-bridge-script.js +2 -0
- package/dist/services/ai/html-bridge-script.js.map +1 -0
- package/dist/services/ai/html-guidelines-tool.d.ts +3 -0
- package/dist/services/ai/html-guidelines-tool.d.ts.map +1 -0
- package/dist/services/ai/html-guidelines-tool.js +157 -0
- package/dist/services/ai/html-guidelines-tool.js.map +1 -0
- package/dist/services/ai/html-stream-coordinator.d.ts +92 -0
- package/dist/services/ai/html-stream-coordinator.d.ts.map +1 -0
- package/dist/services/ai/html-stream-coordinator.js +314 -0
- package/dist/services/ai/html-stream-coordinator.js.map +1 -0
- package/dist/services/ai/html-theme-link.d.ts +9 -0
- package/dist/services/ai/html-theme-link.d.ts.map +1 -0
- package/dist/services/ai/html-theme-link.js +12 -0
- package/dist/services/ai/html-theme-link.js.map +1 -0
- package/dist/services/ai/html-ui-script.d.ts +9 -0
- package/dist/services/ai/html-ui-script.d.ts.map +1 -0
- package/dist/services/ai/html-ui-script.js +9 -0
- package/dist/services/ai/html-ui-script.js.map +1 -0
- package/dist/services/ai/image-generation-service.d.ts +26 -0
- package/dist/services/ai/image-generation-service.d.ts.map +1 -0
- package/dist/services/ai/image-generation-service.js +205 -0
- package/dist/services/ai/image-generation-service.js.map +1 -0
- package/dist/services/ai/manual-pages/desktop-actions.md +36 -0
- package/dist/services/ai/manual-pages/desktop-windows.md +24 -0
- package/dist/services/ai/manual-pages/dt-badge.md +36 -0
- package/dist/services/ai/manual-pages/dt-button.md +38 -0
- package/dist/services/ai/manual-pages/dt-card.md +22 -0
- package/dist/services/ai/manual-pages/dt-chart.md +261 -0
- package/dist/services/ai/manual-pages/dt-divider.md +25 -0
- package/dist/services/ai/manual-pages/dt-grid.md +29 -0
- package/dist/services/ai/manual-pages/dt-list-view.md +96 -0
- package/dist/services/ai/manual-pages/dt-markdown-editor.md +90 -0
- package/dist/services/ai/manual-pages/dt-markdown.md +86 -0
- package/dist/services/ai/manual-pages/dt-select.md +21 -0
- package/dist/services/ai/manual-pages/dt-stack.md +31 -0
- package/dist/services/ai/manual-pages/dt-stat.md +43 -0
- package/dist/services/ai/manual-pages/dt-table-view.md +120 -0
- package/dist/services/ai/manual-pages/dt-tooltip.md +18 -0
- package/dist/services/ai/manual-pages/editing-preview.md +25 -0
- package/dist/services/ai/manual-pages/html-actions.md +74 -0
- package/dist/services/ai/manual-pages/html-bridge.md +187 -0
- package/dist/services/ai/manual-pages/html-components.md +66 -0
- package/dist/services/ai/manual-pages/html-examples.md +185 -0
- package/dist/services/ai/manual-pages/html-layouts.md +128 -0
- package/dist/services/ai/manual-pages/html-storage.md +153 -0
- package/dist/services/ai/manual-pages/html-tokens.md +26 -0
- package/dist/services/ai/manual-pages/index.d.ts +10 -0
- package/dist/services/ai/manual-pages/index.d.ts.map +1 -0
- package/dist/services/ai/manual-pages/index.js +186 -0
- package/dist/services/ai/manual-pages/index.js.map +1 -0
- package/dist/services/ai/manual-tool.d.ts +3 -0
- package/dist/services/ai/manual-tool.d.ts.map +1 -0
- package/dist/services/ai/manual-tool.js +104 -0
- package/dist/services/ai/manual-tool.js.map +1 -0
- package/dist/services/ai/pi-session-service.d.ts +101 -0
- package/dist/services/ai/pi-session-service.d.ts.map +1 -0
- package/dist/services/ai/pi-session-service.js +697 -0
- package/dist/services/ai/pi-session-service.js.map +1 -0
- package/dist/services/ai/providers.d.ts +21 -0
- package/dist/services/ai/providers.d.ts.map +1 -0
- package/dist/services/ai/providers.js +93 -0
- package/dist/services/ai/providers.js.map +1 -0
- package/dist/services/ai/redo-edit-tool.d.ts +9 -0
- package/dist/services/ai/redo-edit-tool.d.ts.map +1 -0
- package/dist/services/ai/redo-edit-tool.js +44 -0
- package/dist/services/ai/redo-edit-tool.js.map +1 -0
- package/dist/services/ai/system-prompt.d.ts +7 -0
- package/dist/services/ai/system-prompt.d.ts.map +1 -0
- package/dist/services/ai/system-prompt.js +72 -0
- package/dist/services/ai/system-prompt.js.map +1 -0
- package/dist/services/ai/undo-edit-tool.d.ts +9 -0
- package/dist/services/ai/undo-edit-tool.d.ts.map +1 -0
- package/dist/services/ai/undo-edit-tool.js +44 -0
- package/dist/services/ai/undo-edit-tool.js.map +1 -0
- package/dist/services/ai/window-tools.d.ts +27 -0
- package/dist/services/ai/window-tools.d.ts.map +1 -0
- package/dist/services/ai/window-tools.js +155 -0
- package/dist/services/ai/window-tools.js.map +1 -0
- package/dist/services/backend-host.d.ts +10 -0
- package/dist/services/backend-host.d.ts.map +1 -0
- package/dist/services/backend-host.js +117 -0
- package/dist/services/backend-host.js.map +1 -0
- package/dist/services/backend-ipc.d.ts +60 -0
- package/dist/services/backend-ipc.d.ts.map +1 -0
- package/dist/services/backend-ipc.js +2 -0
- package/dist/services/backend-ipc.js.map +1 -0
- package/dist/services/backend-process-manager.d.ts +60 -0
- package/dist/services/backend-process-manager.d.ts.map +1 -0
- package/dist/services/backend-process-manager.js +203 -0
- package/dist/services/backend-process-manager.js.map +1 -0
- package/dist/services/filesystem.d.ts +8 -0
- package/dist/services/filesystem.d.ts.map +1 -0
- package/dist/services/filesystem.js +94 -0
- package/dist/services/filesystem.js.map +1 -0
- package/dist/services/i18n.d.ts +28 -0
- package/dist/services/i18n.d.ts.map +1 -0
- package/dist/services/i18n.js +76 -0
- package/dist/services/i18n.js.map +1 -0
- package/dist/services/liveapp-icon.d.ts +9 -0
- package/dist/services/liveapp-icon.d.ts.map +1 -0
- package/dist/services/liveapp-icon.js +28 -0
- package/dist/services/liveapp-icon.js.map +1 -0
- package/dist/services/liveapps.d.ts +12 -0
- package/dist/services/liveapps.d.ts.map +1 -0
- package/dist/services/liveapps.js +84 -0
- package/dist/services/liveapps.js.map +1 -0
- package/dist/services/logger.d.ts +34 -0
- package/dist/services/logger.d.ts.map +1 -0
- package/dist/services/logger.js +74 -0
- package/dist/services/logger.js.map +1 -0
- package/dist/services/messaging.d.ts +14 -0
- package/dist/services/messaging.d.ts.map +1 -0
- package/dist/services/messaging.js +41 -0
- package/dist/services/messaging.js.map +1 -0
- package/dist/services/miniapp-icon.d.ts +9 -0
- package/dist/services/miniapp-icon.d.ts.map +1 -0
- package/dist/services/miniapp-icon.js +25 -0
- package/dist/services/miniapp-icon.js.map +1 -0
- package/dist/services/miniapp-registry.d.ts +73 -0
- package/dist/services/miniapp-registry.d.ts.map +1 -0
- package/dist/services/miniapp-registry.js +144 -0
- package/dist/services/miniapp-registry.js.map +1 -0
- package/dist/services/onboarding-config.d.ts +37 -0
- package/dist/services/onboarding-config.d.ts.map +1 -0
- package/dist/services/onboarding-config.js +76 -0
- package/dist/services/onboarding-config.js.map +1 -0
- package/dist/services/preferences.d.ts +10 -0
- package/dist/services/preferences.d.ts.map +1 -0
- package/dist/services/preferences.js +48 -0
- package/dist/services/preferences.js.map +1 -0
- package/dist/services/proxy-dispatcher.d.ts +18 -0
- package/dist/services/proxy-dispatcher.d.ts.map +1 -0
- package/dist/services/proxy-dispatcher.js +33 -0
- package/dist/services/proxy-dispatcher.js.map +1 -0
- package/dist/services/storage.d.ts +7 -0
- package/dist/services/storage.d.ts.map +1 -0
- package/dist/services/storage.js +55 -0
- package/dist/services/storage.js.map +1 -0
- package/dist/services/theme-css.d.ts +21 -0
- package/dist/services/theme-css.d.ts.map +1 -0
- package/dist/services/theme-css.js +213 -0
- package/dist/services/theme-css.js.map +1 -0
- package/dist/services/user-db.d.ts +69 -0
- package/dist/services/user-db.d.ts.map +1 -0
- package/dist/services/user-db.js +175 -0
- package/dist/services/user-db.js.map +1 -0
- package/dist/services/voice/audio-format.d.ts +5 -0
- package/dist/services/voice/audio-format.d.ts.map +1 -0
- package/dist/services/voice/audio-format.js +27 -0
- package/dist/services/voice/audio-format.js.map +1 -0
- package/dist/services/voice/azure-openai-whisper-adapter.d.ts +23 -0
- package/dist/services/voice/azure-openai-whisper-adapter.d.ts.map +1 -0
- package/dist/services/voice/azure-openai-whisper-adapter.js +60 -0
- package/dist/services/voice/azure-openai-whisper-adapter.js.map +1 -0
- package/dist/services/voice/openai-whisper-adapter.d.ts +22 -0
- package/dist/services/voice/openai-whisper-adapter.d.ts.map +1 -0
- package/dist/services/voice/openai-whisper-adapter.js +61 -0
- package/dist/services/voice/openai-whisper-adapter.js.map +1 -0
- package/dist/services/voice/stt-adapter.d.ts +31 -0
- package/dist/services/voice/stt-adapter.d.ts.map +1 -0
- package/dist/services/voice/stt-adapter.js +8 -0
- package/dist/services/voice/stt-adapter.js.map +1 -0
- package/dist/services/voice/vad-segmenter.d.ts +68 -0
- package/dist/services/voice/vad-segmenter.d.ts.map +1 -0
- package/dist/services/voice/vad-segmenter.js +159 -0
- package/dist/services/voice/vad-segmenter.js.map +1 -0
- package/dist/services/voice/voice-session.d.ts +54 -0
- package/dist/services/voice/voice-session.d.ts.map +1 -0
- package/dist/services/voice/voice-session.js +137 -0
- package/dist/services/voice/voice-session.js.map +1 -0
- package/dist/services/window-manager.d.ts +94 -0
- package/dist/services/window-manager.d.ts.map +1 -0
- package/dist/services/window-manager.js +282 -0
- package/dist/services/window-manager.js.map +1 -0
- package/dist/services/workspace.d.ts +51 -0
- package/dist/services/workspace.d.ts.map +1 -0
- package/dist/services/workspace.js +144 -0
- package/dist/services/workspace.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,1991 @@
|
|
|
1
|
+
import{W as vt,a as ft,u as z,A as _t,b as I}from"./index-C5-XUOS7.js";(()=>{if(typeof document>"u")return;const t="desktalk-style-desktalk-miniapp-note-emi3yz";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent=`/* src/styles/NoteApp.module.css */
|
|
2
|
+
.NoteApp_root {
|
|
3
|
+
display: flex;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
background: var(--dt-window-body);
|
|
7
|
+
color: var(--dt-text);
|
|
8
|
+
font-family: var(--font-sans);
|
|
9
|
+
}
|
|
10
|
+
.NoteApp_rootCompact {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
.NoteApp_rootCompact .NoteApp_listPanel {
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
max-height: 180px;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
border-right: none;
|
|
19
|
+
border-bottom: 1px solid var(--dt-border);
|
|
20
|
+
}
|
|
21
|
+
.NoteApp_rootCompact .NoteApp_listHeader {
|
|
22
|
+
width: 140px;
|
|
23
|
+
min-width: 140px;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
padding: 10px;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
border-bottom: none;
|
|
28
|
+
border-right: 1px solid var(--dt-border-subtle);
|
|
29
|
+
}
|
|
30
|
+
.NoteApp_rootCompact .NoteApp_searchInput {
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
.NoteApp_rootCompact .NoteApp_newNoteBtn {
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
.NoteApp_rootCompact .NoteApp_noteList {
|
|
37
|
+
flex: 1;
|
|
38
|
+
overflow-x: auto;
|
|
39
|
+
overflow-y: hidden;
|
|
40
|
+
display: flex;
|
|
41
|
+
padding: 8px;
|
|
42
|
+
gap: 8px;
|
|
43
|
+
}
|
|
44
|
+
.NoteApp_rootCompact .NoteApp_noteItem,
|
|
45
|
+
.NoteApp_rootCompact .NoteApp_noteItemActive {
|
|
46
|
+
min-width: 160px;
|
|
47
|
+
max-width: 200px;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
border-bottom: none;
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
background: var(--dt-surface);
|
|
52
|
+
}
|
|
53
|
+
.NoteApp_rootCompact .NoteApp_noteItemActive {
|
|
54
|
+
border-left: none;
|
|
55
|
+
padding-left: 10px;
|
|
56
|
+
border: 1px solid var(--dt-accent);
|
|
57
|
+
background: color-mix(in oklab, var(--dt-accent) 8%, var(--dt-surface));
|
|
58
|
+
}
|
|
59
|
+
.NoteApp_rootCompact .NoteApp_emptyState {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
.NoteApp_listPanel {
|
|
66
|
+
display: flex;
|
|
67
|
+
width: 260px;
|
|
68
|
+
min-width: 200px;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
border-right: 1px solid var(--dt-border);
|
|
72
|
+
}
|
|
73
|
+
.NoteApp_listHeader {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 8px;
|
|
77
|
+
padding: 10px 14px;
|
|
78
|
+
border-bottom: 1px solid var(--dt-border);
|
|
79
|
+
}
|
|
80
|
+
.NoteApp_searchInput {
|
|
81
|
+
flex: 1;
|
|
82
|
+
padding: 6px 10px;
|
|
83
|
+
border: 1px solid var(--dt-border);
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
background: var(--dt-surface);
|
|
86
|
+
color: var(--dt-text);
|
|
87
|
+
font-family: inherit;
|
|
88
|
+
font-size: 13px;
|
|
89
|
+
outline: none;
|
|
90
|
+
transition: border-color 0.15s;
|
|
91
|
+
}
|
|
92
|
+
.NoteApp_searchInput::placeholder {
|
|
93
|
+
color: var(--dt-text-muted);
|
|
94
|
+
}
|
|
95
|
+
.NoteApp_searchInput:focus {
|
|
96
|
+
border-color: var(--dt-accent);
|
|
97
|
+
}
|
|
98
|
+
.NoteApp_newNoteBtn {
|
|
99
|
+
display: flex;
|
|
100
|
+
width: 30px;
|
|
101
|
+
height: 30px;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
border: 1px solid var(--dt-border);
|
|
106
|
+
border-radius: 6px;
|
|
107
|
+
background: var(--dt-surface);
|
|
108
|
+
color: var(--dt-text);
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
font-size: 18px;
|
|
111
|
+
line-height: 1;
|
|
112
|
+
transition:
|
|
113
|
+
background 0.15s,
|
|
114
|
+
border-color 0.15s,
|
|
115
|
+
color 0.15s;
|
|
116
|
+
}
|
|
117
|
+
.NoteApp_newNoteBtn:hover {
|
|
118
|
+
border-color: var(--dt-accent);
|
|
119
|
+
background: var(--dt-surface-hover);
|
|
120
|
+
color: var(--dt-accent);
|
|
121
|
+
}
|
|
122
|
+
.NoteApp_noteList {
|
|
123
|
+
flex: 1;
|
|
124
|
+
overflow-y: auto;
|
|
125
|
+
}
|
|
126
|
+
.NoteApp_noteItem {
|
|
127
|
+
padding: 10px 14px;
|
|
128
|
+
border-bottom: 1px solid var(--dt-border);
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
transition: background 0.1s;
|
|
131
|
+
}
|
|
132
|
+
.NoteApp_noteItem:hover {
|
|
133
|
+
background: var(--dt-surface-hover);
|
|
134
|
+
}
|
|
135
|
+
.NoteApp_noteItemActive {
|
|
136
|
+
padding-left: 11px;
|
|
137
|
+
border-left: 3px solid var(--dt-accent);
|
|
138
|
+
background: var(--dt-surface);
|
|
139
|
+
}
|
|
140
|
+
.NoteApp_noteTitle {
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
margin-bottom: 4px;
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
font-weight: 500;
|
|
145
|
+
text-overflow: ellipsis;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
}
|
|
148
|
+
.NoteApp_notePreview {
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
margin-bottom: 4px;
|
|
151
|
+
color: var(--dt-text-muted);
|
|
152
|
+
font-size: 12px;
|
|
153
|
+
text-overflow: ellipsis;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
}
|
|
156
|
+
.NoteApp_noteDate {
|
|
157
|
+
color: var(--dt-text-muted);
|
|
158
|
+
opacity: 0.7;
|
|
159
|
+
font-size: 11px;
|
|
160
|
+
}
|
|
161
|
+
.NoteApp_emptyState {
|
|
162
|
+
padding: 24px 14px;
|
|
163
|
+
color: var(--dt-text-muted);
|
|
164
|
+
font-size: 13px;
|
|
165
|
+
text-align: center;
|
|
166
|
+
}
|
|
167
|
+
.NoteApp_editorPanel {
|
|
168
|
+
display: flex;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
flex: 1;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
}
|
|
174
|
+
.NoteApp_editorHeader {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-shrink: 0;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: space-between;
|
|
179
|
+
padding: 10px 16px;
|
|
180
|
+
border-bottom: 1px solid var(--dt-border);
|
|
181
|
+
}
|
|
182
|
+
.NoteApp_editorTitle {
|
|
183
|
+
font-size: 16px;
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
}
|
|
186
|
+
.NoteApp_editorTags {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-wrap: wrap;
|
|
189
|
+
gap: 6px;
|
|
190
|
+
}
|
|
191
|
+
.NoteApp_editorTag {
|
|
192
|
+
padding: 2px 8px;
|
|
193
|
+
border: 1px solid var(--dt-border);
|
|
194
|
+
border-radius: 4px;
|
|
195
|
+
background: var(--dt-surface);
|
|
196
|
+
color: var(--dt-accent);
|
|
197
|
+
font-size: 11px;
|
|
198
|
+
}
|
|
199
|
+
.NoteApp_editorBody {
|
|
200
|
+
position: relative;
|
|
201
|
+
flex: 1;
|
|
202
|
+
overflow-y: auto;
|
|
203
|
+
}
|
|
204
|
+
.NoteApp_editorPlaceholder {
|
|
205
|
+
display: flex;
|
|
206
|
+
height: 100%;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
color: var(--dt-text-muted);
|
|
210
|
+
font-size: 14px;
|
|
211
|
+
}
|
|
212
|
+
.NoteApp_editorBody .milkdown {
|
|
213
|
+
height: 100%;
|
|
214
|
+
background: transparent;
|
|
215
|
+
color: var(--dt-text);
|
|
216
|
+
}
|
|
217
|
+
.NoteApp_editorBody .milkdown .editor {
|
|
218
|
+
min-height: 100%;
|
|
219
|
+
padding: 16px 20px;
|
|
220
|
+
outline: none;
|
|
221
|
+
font-family: var(--font-sans);
|
|
222
|
+
font-size: 14px;
|
|
223
|
+
line-height: 1.65;
|
|
224
|
+
}
|
|
225
|
+
.NoteApp_editorBody .milkdown .editor h1 {
|
|
226
|
+
margin: 0.8em 0 0.4em;
|
|
227
|
+
font-size: 1.6em;
|
|
228
|
+
}
|
|
229
|
+
.NoteApp_editorBody .milkdown .editor h2 {
|
|
230
|
+
margin: 0.7em 0 0.35em;
|
|
231
|
+
font-size: 1.35em;
|
|
232
|
+
}
|
|
233
|
+
.NoteApp_editorBody .milkdown .editor h3 {
|
|
234
|
+
margin: 0.6em 0 0.3em;
|
|
235
|
+
font-size: 1.15em;
|
|
236
|
+
}
|
|
237
|
+
.NoteApp_editorBody .milkdown .editor p {
|
|
238
|
+
margin: 0.5em 0;
|
|
239
|
+
}
|
|
240
|
+
.NoteApp_editorBody .milkdown .editor code {
|
|
241
|
+
padding: 2px 5px;
|
|
242
|
+
border-radius: 3px;
|
|
243
|
+
background: var(--dt-surface);
|
|
244
|
+
font-family: var(--font-mono);
|
|
245
|
+
font-size: 0.9em;
|
|
246
|
+
}
|
|
247
|
+
.NoteApp_editorBody .milkdown .editor pre {
|
|
248
|
+
overflow-x: auto;
|
|
249
|
+
margin: 0.8em 0;
|
|
250
|
+
padding: 12px 16px;
|
|
251
|
+
border: 1px solid var(--dt-border);
|
|
252
|
+
border-radius: 6px;
|
|
253
|
+
background: var(--dt-surface);
|
|
254
|
+
}
|
|
255
|
+
.NoteApp_editorBody .milkdown .editor pre code {
|
|
256
|
+
padding: 0;
|
|
257
|
+
border-radius: 0;
|
|
258
|
+
background: transparent;
|
|
259
|
+
}
|
|
260
|
+
.NoteApp_editorBody .milkdown .editor blockquote {
|
|
261
|
+
margin: 0.8em 0;
|
|
262
|
+
padding-left: 14px;
|
|
263
|
+
border-left: 3px solid var(--dt-accent);
|
|
264
|
+
color: var(--dt-text-muted);
|
|
265
|
+
}
|
|
266
|
+
.NoteApp_editorBody .milkdown .editor a {
|
|
267
|
+
color: var(--dt-accent);
|
|
268
|
+
text-decoration: none;
|
|
269
|
+
}
|
|
270
|
+
.NoteApp_editorBody .milkdown .editor a:hover {
|
|
271
|
+
text-decoration: underline;
|
|
272
|
+
}
|
|
273
|
+
.NoteApp_editorBody .milkdown .editor hr {
|
|
274
|
+
margin: 1.5em 0;
|
|
275
|
+
border: none;
|
|
276
|
+
border-top: 1px solid var(--dt-border);
|
|
277
|
+
}
|
|
278
|
+
.NoteApp_editorBody .milkdown .editor ul,
|
|
279
|
+
.NoteApp_editorBody .milkdown .editor ol {
|
|
280
|
+
margin: 0.5em 0;
|
|
281
|
+
padding-left: 24px;
|
|
282
|
+
}
|
|
283
|
+
.NoteApp_editorBody .milkdown .editor li {
|
|
284
|
+
margin: 0.2em 0;
|
|
285
|
+
}
|
|
286
|
+
.NoteApp_editorBody .milkdown .editor img {
|
|
287
|
+
max-width: 100%;
|
|
288
|
+
border-radius: 6px;
|
|
289
|
+
}
|
|
290
|
+
.NoteApp_editorBody dt-markdown-editor {
|
|
291
|
+
display: block;
|
|
292
|
+
height: 100%;
|
|
293
|
+
}
|
|
294
|
+
.NoteApp_saveStatus {
|
|
295
|
+
color: var(--dt-text-muted);
|
|
296
|
+
opacity: 0.7;
|
|
297
|
+
font-size: 11px;
|
|
298
|
+
}
|
|
299
|
+
.NoteApp_saveStatusSaving {
|
|
300
|
+
color: var(--dt-warning);
|
|
301
|
+
}
|
|
302
|
+
/*# sourceMappingURL=frontend.css.map */
|
|
303
|
+
`,document.head.appendChild(e)})();var h=window.React;h.Children;h.Component;h.Fragment;h.Profiler;h.PureComponent;h.StrictMode;h.Suspense;h.cloneElement;h.createContext;h.createElement;h.createRef;var xt=h.forwardRef;h.isValidElement;h.lazy;h.memo;h.startTransition;var x=h.useCallback;h.useContext;h.useDebugValue;h.useDeferredValue;var j=h.useEffect;h.useId;var wt=h.useImperativeHandle;h.useInsertionEffect;h.useLayoutEffect;h.useMemo;h.useReducer;var F=h.useRef,R=h.useState;h.useSyncExternalStore;h.useTransition;h.version;var ct=window.ReactDOM,yt=ct.createRoot;ct.hydrateRoot;var v={root:"NoteApp_root",rootCompact:"NoteApp_rootCompact",listPanel:"NoteApp_listPanel",listHeader:"NoteApp_listHeader",searchInput:"NoteApp_searchInput",newNoteBtn:"NoteApp_newNoteBtn",noteList:"NoteApp_noteList",noteItem:"NoteApp_noteItem",noteItemActive:"NoteApp_noteItem NoteApp_noteItemActive",emptyState:"NoteApp_emptyState",noteTitle:"NoteApp_noteTitle",notePreview:"NoteApp_notePreview",noteDate:"NoteApp_noteDate",editorPanel:"NoteApp_editorPanel",editorHeader:"NoteApp_editorHeader",editorTitle:"NoteApp_editorTitle",editorTags:"NoteApp_editorTags",editorTag:"NoteApp_editorTag",editorBody:"NoteApp_editorBody",editorPlaceholder:"NoteApp_editorPlaceholder",saveStatus:"NoteApp_saveStatus",saveStatusSaving:"NoteApp_saveStatus NoteApp_saveStatusSaving"},K=window.__desktalk_jsx_runtime,u=K.jsx,H=K.jsxs;K.jsxDEV;K.Fragment;function kt(t){try{const e=new Date(t),n=new Date().getTime()-e.getTime(),i=Math.floor(n/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);return a<7?`${a}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function Ct({notes:t,selectedId:e,onSelect:r,onCreate:n,searchQuery:i,onSearchChange:o}){const a=F(null);return H("div",{className:v.listPanel,children:[H("div",{className:v.listHeader,children:[u("input",{ref:a,type:"text",className:v.searchInput,placeholder:"Search notes...",value:i,onChange:s=>o(s.target.value)}),u("button",{className:v.newNoteBtn,onClick:n,title:"New note",children:"+"})]}),u("div",{className:v.noteList,children:t.length===0?u("div",{className:v.emptyState,children:i?"No notes match your search":"No notes yet"}):t.map(s=>H("div",{className:s.id===e?v.noteItemActive:v.noteItem,onClick:()=>r(s.id),children:[u("div",{className:v.noteTitle,children:s.title}),u("div",{className:v.notePreview,children:s.preview}),u("div",{className:v.noteDate,children:kt(s.updatedAt)})]},s.id))})]})}var At=`.dt-tooltip-popup {
|
|
304
|
+
position: fixed;
|
|
305
|
+
z-index: 2147483647;
|
|
306
|
+
padding: 6px 10px;
|
|
307
|
+
border: 1px solid var(--dt-accent);
|
|
308
|
+
border-radius: 2px;
|
|
309
|
+
background: var(--dt-surface);
|
|
310
|
+
color: var(--dt-text-secondary);
|
|
311
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
312
|
+
font-size: 12px;
|
|
313
|
+
font-weight: 500;
|
|
314
|
+
line-height: 1.4;
|
|
315
|
+
white-space: nowrap;
|
|
316
|
+
pointer-events: none;
|
|
317
|
+
user-select: none;
|
|
318
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Tech corner accents */
|
|
322
|
+
.dt-tooltip-popup::before {
|
|
323
|
+
content: '';
|
|
324
|
+
position: absolute;
|
|
325
|
+
top: -1px;
|
|
326
|
+
left: -1px;
|
|
327
|
+
width: 4px;
|
|
328
|
+
height: 4px;
|
|
329
|
+
border-top: 1px solid var(--dt-accent);
|
|
330
|
+
border-left: 1px solid var(--dt-accent);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.dt-tooltip-popup::after {
|
|
334
|
+
content: '';
|
|
335
|
+
position: absolute;
|
|
336
|
+
bottom: -1px;
|
|
337
|
+
right: -1px;
|
|
338
|
+
width: 4px;
|
|
339
|
+
height: 4px;
|
|
340
|
+
border-bottom: 1px solid var(--dt-accent);
|
|
341
|
+
border-right: 1px solid var(--dt-accent);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* Arrow styling - tech/minimal */
|
|
345
|
+
.dt-tooltip-popup[data-actual-placement='top'] {
|
|
346
|
+
transform: translateX(-50%);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.dt-tooltip-popup[data-actual-placement='top']::before {
|
|
350
|
+
top: auto;
|
|
351
|
+
bottom: -4px;
|
|
352
|
+
left: 50%;
|
|
353
|
+
transform: translateX(-50%);
|
|
354
|
+
width: 0;
|
|
355
|
+
height: 0;
|
|
356
|
+
border: 4px solid transparent;
|
|
357
|
+
border-top-color: var(--dt-accent);
|
|
358
|
+
border-left: none;
|
|
359
|
+
border-right: none;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.dt-tooltip-popup[data-actual-placement='bottom'] {
|
|
363
|
+
transform: translateX(-50%);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.dt-tooltip-popup[data-actual-placement='bottom']::before {
|
|
367
|
+
bottom: auto;
|
|
368
|
+
top: -4px;
|
|
369
|
+
left: 50%;
|
|
370
|
+
transform: translateX(-50%);
|
|
371
|
+
width: 0;
|
|
372
|
+
height: 0;
|
|
373
|
+
border: 4px solid transparent;
|
|
374
|
+
border-bottom-color: var(--dt-accent);
|
|
375
|
+
border-left: none;
|
|
376
|
+
border-right: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.dt-tooltip-popup[data-actual-placement='left'] {
|
|
380
|
+
transform: translateY(-50%);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.dt-tooltip-popup[data-actual-placement='left']::before {
|
|
384
|
+
left: auto;
|
|
385
|
+
top: 50%;
|
|
386
|
+
right: -4px;
|
|
387
|
+
transform: translateY(-50%);
|
|
388
|
+
width: 0;
|
|
389
|
+
height: 0;
|
|
390
|
+
border: 4px solid transparent;
|
|
391
|
+
border-left-color: var(--dt-accent);
|
|
392
|
+
border-top: none;
|
|
393
|
+
border-bottom: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.dt-tooltip-popup[data-actual-placement='right'] {
|
|
397
|
+
transform: translateY(-50%);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.dt-tooltip-popup[data-actual-placement='right']::before {
|
|
401
|
+
right: auto;
|
|
402
|
+
top: 50%;
|
|
403
|
+
left: -4px;
|
|
404
|
+
transform: translateY(-50%);
|
|
405
|
+
width: 0;
|
|
406
|
+
height: 0;
|
|
407
|
+
border: 4px solid transparent;
|
|
408
|
+
border-right-color: var(--dt-accent);
|
|
409
|
+
border-top: none;
|
|
410
|
+
border-bottom: none;
|
|
411
|
+
}
|
|
412
|
+
`,Et="dt-tooltip-popup",L=8,ot=!1;function St(){if(ot)return;let t=document.createElement("style");t.setAttribute("data-dt-tooltip",""),t.textContent=At,document.head.appendChild(t),ot=!0}var Nt=class extends HTMLElement{_popup=null;_showTimeout=null;_tooltipId="";_visible=!1;static get observedAttributes(){return["content","placement","delay","disabled"]}get content(){return this.getAttribute("content")??""}set content(t){this.setAttribute("content",t)}get placement(){let t=this.getAttribute("placement");return t==="bottom"||t==="left"||t==="right"?t:"top"}set placement(t){this.setAttribute("placement",t)}get delay(){let t=Number(this.getAttribute("delay"));return Number.isFinite(t)&&t>0?t:0}set delay(t){this.setAttribute("delay",String(t))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}constructor(){super();let t=this.attachShadow({mode:"open"});t.innerHTML="<slot></slot>",this._tooltipId=`dt-tip-${Math.random().toString(36).slice(2,9)}`}connectedCallback(){St(),this.addEventListener("mouseenter",this._onEnter),this.addEventListener("mouseleave",this._onLeave),this.addEventListener("focusin",this._onEnter),this.addEventListener("focusout",this._onLeave)}disconnectedCallback(){this.removeEventListener("mouseenter",this._onEnter),this.removeEventListener("mouseleave",this._onLeave),this.removeEventListener("focusin",this._onEnter),this.removeEventListener("focusout",this._onLeave),this._hide()}attributeChangedCallback(t,e,r){t==="disabled"&&this.disabled&&this._hide(),t==="content"&&this._popup&&(this._popup.textContent=this.content)}_onEnter=()=>{if(this.disabled||!this.content)return;this._showTimeout!==null&&clearTimeout(this._showTimeout);let t=()=>{this._createPopup(),this._position(),this._visible=!0};this.delay>0?this._showTimeout=setTimeout(t,this.delay):t()};_onLeave=()=>{this._hide()};_createPopup(){if(this._popup)return;let t=document.createElement("div");t.className=Et,t.id=this._tooltipId,t.setAttribute("role","tooltip"),t.textContent=this.content,document.body.appendChild(t),this._popup=t;let e=this._getTrigger();e&&e.setAttribute("aria-describedby",this._tooltipId)}_hide(){if(this._showTimeout!==null&&(clearTimeout(this._showTimeout),this._showTimeout=null),this._popup){let t=this._getTrigger();t&&t.removeAttribute("aria-describedby"),this._popup.remove(),this._popup=null,this._visible=!1}}_getTrigger(){let t=this.shadowRoot?.querySelector("slot")?.assignedElements();return t&&t.length>0?t[0]:null}_position(){let t=this._popup;if(!t)return;let e=this.getBoundingClientRect(),r=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight,o=this.placement;o==="top"&&e.top-r.height-L<0?o="bottom":o==="bottom"&&e.bottom+r.height+L>i?o="top":o==="left"&&e.left-r.width-L<0?o="right":o==="right"&&e.right+r.width+L>n&&(o="left"),t.setAttribute("data-actual-placement",o);let a,s;switch(o){case"top":s=e.left+e.width/2,a=e.top-r.height-L;break;case"bottom":s=e.left+e.width/2,a=e.bottom+L;break;case"left":s=e.left-r.width-L,a=e.top+e.height/2;break;case"right":s=e.right+L,a=e.top+e.height/2;break}t.style.left=`${s}px`,t.style.top=`${a}px`}},zt=`:host {
|
|
413
|
+
display: block;
|
|
414
|
+
margin-bottom: 12px;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.dt-card-inner {
|
|
418
|
+
background: var(--dt-surface);
|
|
419
|
+
border: 1px solid var(--dt-accent);
|
|
420
|
+
border-radius: 2px;
|
|
421
|
+
padding: 12px;
|
|
422
|
+
color: var(--dt-text);
|
|
423
|
+
font-family: var(--font-ui, 'Work Sans', system-ui, sans-serif);
|
|
424
|
+
position: relative;
|
|
425
|
+
height: 100%;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Corner accents for sci-fi feel */
|
|
429
|
+
.dt-card-inner::before {
|
|
430
|
+
content: '';
|
|
431
|
+
position: absolute;
|
|
432
|
+
top: -1px;
|
|
433
|
+
left: -1px;
|
|
434
|
+
width: 8px;
|
|
435
|
+
height: 8px;
|
|
436
|
+
border-top: 2px solid var(--dt-accent);
|
|
437
|
+
border-left: 2px solid var(--dt-accent);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.dt-card-inner::after {
|
|
441
|
+
content: '';
|
|
442
|
+
position: absolute;
|
|
443
|
+
bottom: -1px;
|
|
444
|
+
right: -1px;
|
|
445
|
+
width: 8px;
|
|
446
|
+
height: 8px;
|
|
447
|
+
border-bottom: 2px solid var(--dt-accent);
|
|
448
|
+
border-right: 2px solid var(--dt-accent);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
:host([variant='outlined']) .dt-card-inner {
|
|
452
|
+
background: transparent;
|
|
453
|
+
border-style: dashed;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
:host([variant='filled']) .dt-card-inner {
|
|
457
|
+
background: var(--dt-accent-subtle);
|
|
458
|
+
border-style: solid;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
::slotted(h1),
|
|
462
|
+
::slotted(h2),
|
|
463
|
+
::slotted(h3),
|
|
464
|
+
::slotted(h4),
|
|
465
|
+
::slotted(h5),
|
|
466
|
+
::slotted(h6) {
|
|
467
|
+
color: var(--dt-accent);
|
|
468
|
+
margin: 0 0 6px;
|
|
469
|
+
line-height: 1.2;
|
|
470
|
+
font-family: var(--font-display, 'Sora', system-ui, sans-serif);
|
|
471
|
+
font-weight: 600;
|
|
472
|
+
text-transform: uppercase;
|
|
473
|
+
letter-spacing: 0.1em;
|
|
474
|
+
font-size: 0.85rem;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
::slotted(p) {
|
|
478
|
+
color: var(--dt-text-secondary);
|
|
479
|
+
margin: 0 0 6px;
|
|
480
|
+
line-height: 1.4;
|
|
481
|
+
font-family: var(--font-ui, 'Work Sans', system-ui, sans-serif);
|
|
482
|
+
font-size: 0.8125rem;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
::slotted(p:last-child) {
|
|
486
|
+
margin-bottom: 0;
|
|
487
|
+
}
|
|
488
|
+
`,Mt="dt-card-inner",Tt=class extends HTMLElement{static get observedAttributes(){return["variant"]}get variant(){let t=this.getAttribute("variant");return t==="outlined"||t==="filled"?t:"default"}set variant(t){this.setAttribute("variant",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=zt,t.appendChild(e);let r=document.createElement("div");r.className=Mt,r.innerHTML="<slot></slot>",t.appendChild(r)}},Lt=`.dt-select-menu {
|
|
489
|
+
position: fixed;
|
|
490
|
+
z-index: 2147483646;
|
|
491
|
+
display: flex;
|
|
492
|
+
min-width: 200px;
|
|
493
|
+
max-width: min(300px, 72vw);
|
|
494
|
+
max-height: 240px;
|
|
495
|
+
flex-direction: column;
|
|
496
|
+
overflow-y: auto;
|
|
497
|
+
border: 1px solid var(--dt-accent);
|
|
498
|
+
border-radius: 2px;
|
|
499
|
+
background: var(--dt-surface);
|
|
500
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
|
|
501
|
+
opacity: 0;
|
|
502
|
+
pointer-events: none;
|
|
503
|
+
transition: opacity 100ms ease;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.dt-select-menu[data-open] {
|
|
507
|
+
opacity: 1;
|
|
508
|
+
pointer-events: auto;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.dt-select-option {
|
|
512
|
+
display: flex;
|
|
513
|
+
width: 100%;
|
|
514
|
+
align-items: center;
|
|
515
|
+
justify-content: space-between;
|
|
516
|
+
padding: 8px 10px;
|
|
517
|
+
border: 0;
|
|
518
|
+
border-bottom: 1px solid var(--dt-border-subtle);
|
|
519
|
+
background: transparent;
|
|
520
|
+
color: var(--dt-text);
|
|
521
|
+
font-family: var(
|
|
522
|
+
--font-mono,
|
|
523
|
+
'SF Mono',
|
|
524
|
+
Monaco,
|
|
525
|
+
'Cascadia Code',
|
|
526
|
+
'Roboto Mono',
|
|
527
|
+
Consolas,
|
|
528
|
+
monospace
|
|
529
|
+
);
|
|
530
|
+
font-size: 0.8125rem;
|
|
531
|
+
font-weight: 600;
|
|
532
|
+
letter-spacing: 0.04em;
|
|
533
|
+
text-align: left;
|
|
534
|
+
cursor: pointer;
|
|
535
|
+
transition: all 0.1s ease;
|
|
536
|
+
user-select: none;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.dt-select-option:last-child {
|
|
540
|
+
border-bottom: none;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.dt-select-option:hover {
|
|
544
|
+
background: var(--dt-accent);
|
|
545
|
+
color: var(--dt-text-on-accent);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.dt-select-option.dt-select-option--active {
|
|
549
|
+
background: var(--dt-accent-subtle);
|
|
550
|
+
color: var(--dt-accent);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.dt-select-option span {
|
|
554
|
+
overflow: hidden;
|
|
555
|
+
text-overflow: ellipsis;
|
|
556
|
+
white-space: nowrap;
|
|
557
|
+
}
|
|
558
|
+
`,Ht=`:host {
|
|
559
|
+
display: block;
|
|
560
|
+
width: 100%;
|
|
561
|
+
min-width: 0;
|
|
562
|
+
position: relative;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
:host([disabled]) .dt-select-trigger {
|
|
566
|
+
cursor: not-allowed;
|
|
567
|
+
opacity: 0.4;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.dt-select-trigger {
|
|
571
|
+
display: flex;
|
|
572
|
+
width: 100%;
|
|
573
|
+
min-width: 0;
|
|
574
|
+
max-width: 100%;
|
|
575
|
+
box-sizing: border-box;
|
|
576
|
+
align-items: center;
|
|
577
|
+
gap: 6px;
|
|
578
|
+
padding: 6px 10px;
|
|
579
|
+
border: 1px solid var(--dt-accent);
|
|
580
|
+
border-radius: 2px;
|
|
581
|
+
background: var(--dt-surface);
|
|
582
|
+
color: var(--dt-text);
|
|
583
|
+
font-family: var(
|
|
584
|
+
--font-mono,
|
|
585
|
+
'SF Mono',
|
|
586
|
+
Monaco,
|
|
587
|
+
'Cascadia Code',
|
|
588
|
+
'Roboto Mono',
|
|
589
|
+
Consolas,
|
|
590
|
+
monospace
|
|
591
|
+
);
|
|
592
|
+
font-size: 0.8125rem;
|
|
593
|
+
font-weight: 600;
|
|
594
|
+
letter-spacing: 0.04em;
|
|
595
|
+
line-height: 1;
|
|
596
|
+
cursor: pointer;
|
|
597
|
+
transition: all 0.1s ease;
|
|
598
|
+
user-select: none;
|
|
599
|
+
position: relative;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Corner accents */
|
|
603
|
+
.dt-select-trigger::before {
|
|
604
|
+
content: '';
|
|
605
|
+
position: absolute;
|
|
606
|
+
top: 0;
|
|
607
|
+
left: 0;
|
|
608
|
+
width: 4px;
|
|
609
|
+
height: 4px;
|
|
610
|
+
border-top: 1px solid var(--dt-accent);
|
|
611
|
+
border-left: 1px solid var(--dt-accent);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.dt-select-trigger::after {
|
|
615
|
+
content: '';
|
|
616
|
+
position: absolute;
|
|
617
|
+
bottom: 0;
|
|
618
|
+
right: 0;
|
|
619
|
+
width: 4px;
|
|
620
|
+
height: 4px;
|
|
621
|
+
border-bottom: 1px solid var(--dt-accent);
|
|
622
|
+
border-right: 1px solid var(--dt-accent);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.dt-select-trigger:hover:not([disabled]) {
|
|
626
|
+
background: var(--dt-accent);
|
|
627
|
+
color: var(--dt-text-on-accent);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.dt-select-trigger:hover:not([disabled])::before,
|
|
631
|
+
.dt-select-trigger:hover:not([disabled])::after {
|
|
632
|
+
border-color: var(--dt-text-on-accent);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.dt-select-trigger[aria-expanded='true'] {
|
|
636
|
+
background: var(--dt-accent);
|
|
637
|
+
color: var(--dt-text-on-accent);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.dt-select-trigger[aria-expanded='true']::before,
|
|
641
|
+
.dt-select-trigger[aria-expanded='true']::after {
|
|
642
|
+
border-color: var(--dt-text-on-accent);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.dt-select-label {
|
|
646
|
+
overflow: hidden;
|
|
647
|
+
text-overflow: ellipsis;
|
|
648
|
+
white-space: nowrap;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.dt-select-chevron {
|
|
652
|
+
color: currentColor;
|
|
653
|
+
font-size: 10px;
|
|
654
|
+
transition: transform 140ms ease;
|
|
655
|
+
opacity: 0.7;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.dt-select-trigger[aria-expanded='true'] .dt-select-chevron {
|
|
659
|
+
transform: rotate(180deg);
|
|
660
|
+
}
|
|
661
|
+
`,It="dt-select-trigger",at="dt-select-label",Rt="dt-select-chevron",Ft="dt-select-menu",$t="dt-select-option",Pt="dt-select-option--active",st=!1;function Dt(){if(st)return;let t=document.createElement("style");t.setAttribute("data-dt-select",""),t.textContent=Lt,document.head.appendChild(t),st=!0}var Bt=class extends HTMLElement{_menu=null;_trigger=null;_options=[];_open=!1;_menuId="";static get observedAttributes(){return["value","placeholder","disabled","align"]}get value(){return this.getAttribute("value")??""}set value(t){this.setAttribute("value",t)}get placeholder(){return this.getAttribute("placeholder")??"Select…"}set placeholder(t){this.setAttribute("placeholder",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get align(){return this.getAttribute("align")==="right"?"right":"left"}set align(t){this.setAttribute("align",t)}get options(){return this._options}set options(t){this._options=t,this._updateLabel(),this._open&&this._renderMenuItems()}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Ht,t.appendChild(e);let r=document.createElement("button");r.type="button",r.className=It,r.setAttribute("aria-haspopup","listbox"),r.setAttribute("aria-expanded","false");let n=document.createElement("span");n.className=at,r.appendChild(n);let i=document.createElement("span");i.className=Rt,i.setAttribute("aria-hidden","true"),i.textContent="▾",r.appendChild(i),t.appendChild(r),this._trigger=r,this._menuId=`dt-sel-${Math.random().toString(36).slice(2,9)}`}connectedCallback(){Dt(),this._trigger.addEventListener("click",this._onTriggerClick),this._updateLabel()}disconnectedCallback(){this._trigger.removeEventListener("click",this._onTriggerClick),this._close()}attributeChangedCallback(t){t==="value"&&(this._updateLabel(),this._open&&this._renderMenuItems()),t==="placeholder"&&!this.value&&this._updateLabel(),t==="disabled"&&this.disabled&&this._close()}_updateLabel(){let t=this._trigger.querySelector(`.${at}`),e=this._options.find(r=>r.value===this.value);t.textContent=e?.label??this.placeholder}_onTriggerClick=()=>{this.disabled||(this._open?this._close():this._openMenu())};_openMenu(){if(this._open)return;let t=document.createElement("div");t.className=Ft,t.id=this._menuId,t.setAttribute("role","listbox"),document.body.appendChild(t),this._menu=t,this._renderMenuItems(),this._position(),requestAnimationFrame(()=>{t.setAttribute("data-open","")}),this._open=!0,this._trigger.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{document.addEventListener("mousedown",this._onOutsideClick),document.addEventListener("keydown",this._onKeyDown)})}_close(){if(this._open){if(document.removeEventListener("mousedown",this._onOutsideClick),document.removeEventListener("keydown",this._onKeyDown),this._menu){this._menu.removeAttribute("data-open");let t=this._menu;setTimeout(()=>t.remove(),140),this._menu=null}this._open=!1,this._trigger.setAttribute("aria-expanded","false")}}_onOutsideClick=t=>{let e=t.target;this._menu?.contains(e)||this.contains(e)||this._close()};_onKeyDown=t=>{t.key==="Escape"&&(this._close(),this._trigger.focus())};_renderMenuItems(){let t=this._menu;if(t){t.innerHTML="";for(let e of this._options){let r=document.createElement("button");r.type="button",r.className=$t,r.setAttribute("role","option"),r.setAttribute("aria-selected",String(e.value===this.value)),e.value===this.value&&r.classList.add(Pt);let n=document.createElement("span");n.textContent=e.label,r.appendChild(n),r.addEventListener("click",()=>{this._selectValue(e.value)}),t.appendChild(r)}}}_selectValue(t){let e=this.value;this.value=t,this._updateLabel(),this._close(),t!==e&&this.dispatchEvent(new CustomEvent("dt-change",{detail:{value:t},bubbles:!0,composed:!0}))}_position(){let t=this._menu;if(!t)return;let e=this.getBoundingClientRect(),r=10,n=Math.max(e.width,240),i=e.bottom+r,o=t.scrollHeight||260,a=window.innerHeight;if(i+o>a&&e.top-o-r>0&&(i=e.top-o-r),t.style.minWidth=`${n}px`,this.align==="right"){let s=window.innerWidth;t.style.right=`${s-e.right}px`,t.style.left="auto"}else t.style.left=`${e.left}px`,t.style.right="auto";t.style.top=`${i}px`}},Ot=`:host {
|
|
662
|
+
display: block;
|
|
663
|
+
margin-bottom: 12px;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.dt-grid-inner {
|
|
667
|
+
display: grid;
|
|
668
|
+
gap: var(--grid-gap, 12px);
|
|
669
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--min-width, 220px), 1fr));
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
:host([cols='1']) .dt-grid-inner {
|
|
673
|
+
grid-template-columns: repeat(1, 1fr);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
:host([cols='2']) .dt-grid-inner {
|
|
677
|
+
grid-template-columns: repeat(2, 1fr);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
:host([cols='3']) .dt-grid-inner {
|
|
681
|
+
grid-template-columns: repeat(3, 1fr);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
:host([cols='4']) .dt-grid-inner {
|
|
685
|
+
grid-template-columns: repeat(4, 1fr);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
:host([cols='5']) .dt-grid-inner {
|
|
689
|
+
grid-template-columns: repeat(5, 1fr);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
:host([cols='6']) .dt-grid-inner {
|
|
693
|
+
grid-template-columns: repeat(6, 1fr);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
@media (max-width: 480px) {
|
|
697
|
+
:host([cols='2']) .dt-grid-inner,
|
|
698
|
+
:host([cols='3']) .dt-grid-inner,
|
|
699
|
+
:host([cols='4']) .dt-grid-inner,
|
|
700
|
+
:host([cols='5']) .dt-grid-inner,
|
|
701
|
+
:host([cols='6']) .dt-grid-inner {
|
|
702
|
+
grid-template-columns: 1fr;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
:host([gap='0']) .dt-grid-inner {
|
|
707
|
+
--grid-gap: 0;
|
|
708
|
+
}
|
|
709
|
+
:host([gap='4']) .dt-grid-inner {
|
|
710
|
+
--grid-gap: 4px;
|
|
711
|
+
}
|
|
712
|
+
:host([gap='8']) .dt-grid-inner {
|
|
713
|
+
--grid-gap: 8px;
|
|
714
|
+
}
|
|
715
|
+
:host([gap='12']) .dt-grid-inner {
|
|
716
|
+
--grid-gap: 12px;
|
|
717
|
+
}
|
|
718
|
+
:host([gap='16']) .dt-grid-inner {
|
|
719
|
+
--grid-gap: 16px;
|
|
720
|
+
}
|
|
721
|
+
:host([gap='20']) .dt-grid-inner {
|
|
722
|
+
--grid-gap: 20px;
|
|
723
|
+
}
|
|
724
|
+
:host([gap='24']) .dt-grid-inner {
|
|
725
|
+
--grid-gap: 24px;
|
|
726
|
+
}
|
|
727
|
+
:host([gap='32']) .dt-grid-inner {
|
|
728
|
+
--grid-gap: 32px;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
:host([min-width='150']) .dt-grid-inner {
|
|
732
|
+
--min-width: 150px;
|
|
733
|
+
}
|
|
734
|
+
:host([min-width='180']) .dt-grid-inner {
|
|
735
|
+
--min-width: 180px;
|
|
736
|
+
}
|
|
737
|
+
:host([min-width='200']) .dt-grid-inner {
|
|
738
|
+
--min-width: 200px;
|
|
739
|
+
}
|
|
740
|
+
:host([min-width='220']) .dt-grid-inner {
|
|
741
|
+
--min-width: 220px;
|
|
742
|
+
}
|
|
743
|
+
:host([min-width='260']) .dt-grid-inner {
|
|
744
|
+
--min-width: 260px;
|
|
745
|
+
}
|
|
746
|
+
:host([min-width='300']) .dt-grid-inner {
|
|
747
|
+
--min-width: 300px;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
::slotted(*) {
|
|
751
|
+
min-width: 0;
|
|
752
|
+
}
|
|
753
|
+
`,Vt="dt-grid-inner",Wt=class extends HTMLElement{static get observedAttributes(){return["cols","gap","min-width"]}get cols(){let t=this.getAttribute("cols");return t==="1"||t==="2"||t==="3"||t==="4"||t==="5"||t==="6"?t:null}set cols(t){t===null?this.removeAttribute("cols"):this.setAttribute("cols",t)}get gap(){let t=this.getAttribute("gap");return t==="0"||t==="4"||t==="8"||t==="12"||t==="20"||t==="24"||t==="32"?t:"16"}set gap(t){this.setAttribute("gap",t)}get minWidth(){let t=this.getAttribute("min-width");return t==="150"||t==="180"||t==="200"||t==="260"||t==="300"?t:"220"}set minWidth(t){this.setAttribute("min-width",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Ot,t.appendChild(e);let r=document.createElement("div");r.className=Vt,r.innerHTML="<slot></slot>",t.appendChild(r)}},jt=`:host {
|
|
754
|
+
display: block;
|
|
755
|
+
margin-bottom: 12px;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.dt-stack-inner {
|
|
759
|
+
display: flex;
|
|
760
|
+
flex-direction: var(--flex-direction, column);
|
|
761
|
+
gap: var(--stack-gap, 12px);
|
|
762
|
+
align-items: var(--align-items, stretch);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
:host([direction='column']) .dt-stack-inner {
|
|
766
|
+
--flex-direction: column;
|
|
767
|
+
}
|
|
768
|
+
:host([direction='row']) .dt-stack-inner {
|
|
769
|
+
--flex-direction: row;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
:host([gap='0']) .dt-stack-inner {
|
|
773
|
+
--stack-gap: 0;
|
|
774
|
+
}
|
|
775
|
+
:host([gap='4']) .dt-stack-inner {
|
|
776
|
+
--stack-gap: 4px;
|
|
777
|
+
}
|
|
778
|
+
:host([gap='8']) .dt-stack-inner {
|
|
779
|
+
--stack-gap: 8px;
|
|
780
|
+
}
|
|
781
|
+
:host([gap='12']) .dt-stack-inner {
|
|
782
|
+
--stack-gap: 12px;
|
|
783
|
+
}
|
|
784
|
+
:host([gap='16']) .dt-stack-inner {
|
|
785
|
+
--stack-gap: 16px;
|
|
786
|
+
}
|
|
787
|
+
:host([gap='20']) .dt-stack-inner {
|
|
788
|
+
--stack-gap: 20px;
|
|
789
|
+
}
|
|
790
|
+
:host([gap='24']) .dt-stack-inner {
|
|
791
|
+
--stack-gap: 24px;
|
|
792
|
+
}
|
|
793
|
+
:host([gap='32']) .dt-stack-inner {
|
|
794
|
+
--stack-gap: 32px;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
:host([align='start']) .dt-stack-inner {
|
|
798
|
+
--align-items: flex-start;
|
|
799
|
+
}
|
|
800
|
+
:host([align='center']) .dt-stack-inner {
|
|
801
|
+
--align-items: center;
|
|
802
|
+
}
|
|
803
|
+
:host([align='end']) .dt-stack-inner {
|
|
804
|
+
--align-items: flex-end;
|
|
805
|
+
}
|
|
806
|
+
:host([align='stretch']) .dt-stack-inner {
|
|
807
|
+
--align-items: stretch;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
@media (max-width: 480px) {
|
|
811
|
+
:host([direction='row']) .dt-stack-inner {
|
|
812
|
+
--flex-direction: column;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
::slotted(*) {
|
|
817
|
+
min-width: 0;
|
|
818
|
+
}
|
|
819
|
+
`,qt="dt-stack-inner";function J(t){return t==="row"||t==="horizontal"?"row":"column"}var Ut=class extends HTMLElement{static get observedAttributes(){return["direction","gap","align"]}get direction(){return J(this.getAttribute("direction"))}set direction(t){this.setAttribute("direction",J(t))}get gap(){let t=this.getAttribute("gap");return t==="0"||t==="4"||t==="8"||t==="12"||t==="20"||t==="24"||t==="32"?t:"16"}set gap(t){this.setAttribute("gap",t)}get align(){let t=this.getAttribute("align");return t==="start"||t==="center"||t==="end"?t:"stretch"}set align(t){this.setAttribute("align",t)}connectedCallback(){this.#t()}attributeChangedCallback(t){t==="direction"&&this.#t()}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=jt,t.appendChild(e);let r=document.createElement("div");r.className=qt,r.innerHTML="<slot></slot>",t.appendChild(r)}#t(){let t=this.getAttribute("direction"),e=J(t);t!==null&&t!==e&&this.setAttribute("direction",e)}},Yt=`:host {
|
|
820
|
+
display: block;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.dt-stat-inner {
|
|
824
|
+
background: var(--dt-surface);
|
|
825
|
+
border: 1px solid var(--dt-accent);
|
|
826
|
+
border-radius: 2px;
|
|
827
|
+
padding: 12px;
|
|
828
|
+
font-family: var(--font-ui, 'Work Sans', system-ui, sans-serif);
|
|
829
|
+
display: flex;
|
|
830
|
+
flex-direction: column;
|
|
831
|
+
gap: 4px;
|
|
832
|
+
position: relative;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/* Corner accents */
|
|
836
|
+
.dt-stat-inner::before {
|
|
837
|
+
content: '';
|
|
838
|
+
position: absolute;
|
|
839
|
+
top: 0;
|
|
840
|
+
left: 0;
|
|
841
|
+
width: 6px;
|
|
842
|
+
height: 6px;
|
|
843
|
+
border-top: 1px solid var(--dt-accent);
|
|
844
|
+
border-left: 1px solid var(--dt-accent);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.dt-stat-inner .label {
|
|
848
|
+
font-size: 0.625rem;
|
|
849
|
+
font-weight: 600;
|
|
850
|
+
color: var(--dt-text-muted);
|
|
851
|
+
text-transform: uppercase;
|
|
852
|
+
letter-spacing: 0.12em;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.dt-stat-inner .value {
|
|
856
|
+
font-size: 1.5rem;
|
|
857
|
+
font-weight: 600;
|
|
858
|
+
color: var(--dt-accent);
|
|
859
|
+
line-height: 1.1;
|
|
860
|
+
white-space: nowrap;
|
|
861
|
+
overflow: hidden;
|
|
862
|
+
text-overflow: ellipsis;
|
|
863
|
+
font-family: var(--font-display, 'Sora', system-ui, sans-serif);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.dt-stat-inner .description {
|
|
867
|
+
font-size: 0.75rem;
|
|
868
|
+
color: var(--dt-text-secondary);
|
|
869
|
+
line-height: 1.3;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/* Size variants */
|
|
873
|
+
:host([size='sm']) .dt-stat-inner .value {
|
|
874
|
+
font-size: 1.125rem;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
:host([size='sm']) .dt-stat-inner {
|
|
878
|
+
padding: 8px;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
:host([size='lg']) .dt-stat-inner .value {
|
|
882
|
+
font-size: 2rem;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
:host([size='lg']) .dt-stat-inner {
|
|
886
|
+
padding: 16px;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/* Variant: outlined */
|
|
890
|
+
:host([variant='outlined']) .dt-stat-inner {
|
|
891
|
+
background: transparent;
|
|
892
|
+
border-style: dashed;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/* Variant: filled */
|
|
896
|
+
:host([variant='filled']) .dt-stat-inner {
|
|
897
|
+
background: var(--dt-accent-subtle);
|
|
898
|
+
border-style: solid;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/* Trend indicators */
|
|
902
|
+
.dt-stat-inner .trend {
|
|
903
|
+
display: inline-flex;
|
|
904
|
+
align-items: center;
|
|
905
|
+
gap: 3px;
|
|
906
|
+
font-size: 0.6875rem;
|
|
907
|
+
font-weight: 600;
|
|
908
|
+
margin-top: 2px;
|
|
909
|
+
text-transform: uppercase;
|
|
910
|
+
letter-spacing: 0.05em;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.dt-stat-inner .trend.positive {
|
|
914
|
+
color: var(--dt-success);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.dt-stat-inner .trend.negative {
|
|
918
|
+
color: var(--dt-danger);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.dt-stat-inner .trend.neutral {
|
|
922
|
+
color: var(--dt-text-muted);
|
|
923
|
+
}
|
|
924
|
+
`,Xt="dt-stat-inner",Gt=class extends HTMLElement{static get observedAttributes(){return["label","value","description","size","variant","trend","trend-value"]}_container;_labelEl;_valueEl;_descEl;_trendEl;get label(){return this.getAttribute("label")}set label(t){t===null?this.removeAttribute("label"):this.setAttribute("label",t)}get value(){return this.getAttribute("value")}set value(t){t===null?this.removeAttribute("value"):this.setAttribute("value",t)}get description(){return this.getAttribute("description")}set description(t){t===null?this.removeAttribute("description"):this.setAttribute("description",t)}get size(){let t=this.getAttribute("size");return t==="sm"||t==="lg"?t:"md"}set size(t){this.setAttribute("size",t)}get variant(){let t=this.getAttribute("variant");return t==="outlined"||t==="filled"?t:"default"}set variant(t){this.setAttribute("variant",t)}get trend(){let t=this.getAttribute("trend");return t==="up"||t==="down"||t==="neutral"?t:null}set trend(t){t===null?this.removeAttribute("trend"):this.setAttribute("trend",t)}get trendValue(){return this.getAttribute("trend-value")}set trendValue(t){t===null?this.removeAttribute("trend-value"):this.setAttribute("trend-value",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Yt,t.appendChild(e),this._container=document.createElement("div"),this._container.className=Xt,this._labelEl=document.createElement("div"),this._labelEl.className="label",this._container.appendChild(this._labelEl),this._valueEl=document.createElement("div"),this._valueEl.className="value",this._container.appendChild(this._valueEl),this._descEl=document.createElement("div"),this._descEl.className="description",this._container.appendChild(this._descEl),this._trendEl=document.createElement("div"),this._trendEl.className="trend",this._container.appendChild(this._trendEl),t.appendChild(this._container),this._render()}attributeChangedCallback(t,e,r){(t==="label"||t==="value"||t==="description"||t==="size"||t==="variant"||t==="trend"||t==="trend-value")&&this._render()}_render(){this._labelEl.textContent=this.label??"",this._labelEl.style.display=this.label?"block":"none",this._valueEl.textContent=this.value??"",this._valueEl.style.display=this.value?"block":"none",this._descEl.textContent=this.description??"",this._descEl.style.display=this.description?"block":"none";let t=this.trend,e=this.trendValue;if(t&&e){this._trendEl.style.display="inline-flex",this._trendEl.className=`trend ${t==="up"?"positive":t==="down"?"negative":"neutral"}`;let r="";t==="up"?r="↑":t==="down"?r="↓":r="→",this._trendEl.textContent=`${r} ${e}`}else this._trendEl.style.display="none"}},Kt=`:host {
|
|
925
|
+
display: inline-flex;
|
|
926
|
+
vertical-align: middle;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.dt-badge-inner {
|
|
930
|
+
display: inline-flex;
|
|
931
|
+
align-items: center;
|
|
932
|
+
padding: 2px 6px;
|
|
933
|
+
border: 1px solid;
|
|
934
|
+
border-radius: 2px;
|
|
935
|
+
font-size: 0.6875rem;
|
|
936
|
+
font-weight: 600;
|
|
937
|
+
font-family: var(
|
|
938
|
+
--font-mono,
|
|
939
|
+
'SF Mono',
|
|
940
|
+
Monaco,
|
|
941
|
+
'Cascadia Code',
|
|
942
|
+
'Roboto Mono',
|
|
943
|
+
Consolas,
|
|
944
|
+
monospace
|
|
945
|
+
);
|
|
946
|
+
line-height: 1.2;
|
|
947
|
+
white-space: nowrap;
|
|
948
|
+
text-transform: uppercase;
|
|
949
|
+
letter-spacing: 0.1em;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
/* Variant: accent (default) */
|
|
953
|
+
:host([variant='accent']) .dt-badge-inner,
|
|
954
|
+
.dt-badge-inner {
|
|
955
|
+
background: var(--dt-accent-subtle);
|
|
956
|
+
border-color: var(--dt-accent);
|
|
957
|
+
color: var(--dt-accent);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/* Variant: success */
|
|
961
|
+
:host([variant='success']) .dt-badge-inner {
|
|
962
|
+
background: var(--dt-success-subtle);
|
|
963
|
+
border-color: var(--dt-success);
|
|
964
|
+
color: var(--dt-success);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/* Variant: danger */
|
|
968
|
+
:host([variant='danger']) .dt-badge-inner {
|
|
969
|
+
background: var(--dt-danger-subtle);
|
|
970
|
+
border-color: var(--dt-danger);
|
|
971
|
+
color: var(--dt-danger);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/* Variant: warning */
|
|
975
|
+
:host([variant='warning']) .dt-badge-inner {
|
|
976
|
+
background: var(--dt-warning-subtle);
|
|
977
|
+
border-color: var(--dt-warning);
|
|
978
|
+
color: var(--dt-warning);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/* Variant: info */
|
|
982
|
+
:host([variant='info']) .dt-badge-inner {
|
|
983
|
+
background: var(--dt-info-subtle);
|
|
984
|
+
border-color: var(--dt-info);
|
|
985
|
+
color: var(--dt-info);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/* Variant: default/neutral */
|
|
989
|
+
:host([variant='default']) .dt-badge-inner,
|
|
990
|
+
:host([variant='neutral']) .dt-badge-inner {
|
|
991
|
+
background: transparent;
|
|
992
|
+
border-color: var(--dt-border);
|
|
993
|
+
color: var(--dt-text-secondary);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/* Size variants */
|
|
997
|
+
:host([size='sm']) .dt-badge-inner {
|
|
998
|
+
padding: 1px 4px;
|
|
999
|
+
font-size: 0.625rem;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
:host([size='lg']) .dt-badge-inner {
|
|
1003
|
+
padding: 3px 8px;
|
|
1004
|
+
font-size: 0.75rem;
|
|
1005
|
+
}
|
|
1006
|
+
`,Jt="dt-badge-inner",Qt=class extends HTMLElement{static get observedAttributes(){return["variant","size","text"]}_container;_slot;get variant(){let t=this.getAttribute("variant");return t==="success"||t==="danger"||t==="warning"||t==="info"||t==="default"||t==="neutral"?t:"accent"}set variant(t){this.setAttribute("variant",t)}get size(){let t=this.getAttribute("size");return t==="sm"||t==="lg"?t:"md"}set size(t){this.setAttribute("size",t)}get text(){return this.getAttribute("text")}set text(t){t===null?this.removeAttribute("text"):this.setAttribute("text",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Kt,t.appendChild(e),this._container=document.createElement("span"),this._container.className=Jt;let r=this.text;r!==null?this._container.textContent=r:(this._slot=document.createElement("slot"),this._container.appendChild(this._slot)),t.appendChild(this._container)}attributeChangedCallback(t,e,r){t==="text"&&this._render()}_render(){let t=this.text;t!==null&&(this._container.textContent=t)}},Zt=`:host {
|
|
1007
|
+
display: inline-flex;
|
|
1008
|
+
vertical-align: middle;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.dt-button-inner {
|
|
1012
|
+
display: inline-flex;
|
|
1013
|
+
align-items: center;
|
|
1014
|
+
justify-content: center;
|
|
1015
|
+
gap: 4px;
|
|
1016
|
+
padding: 6px 12px;
|
|
1017
|
+
border: 1px solid var(--dt-accent);
|
|
1018
|
+
border-radius: 2px;
|
|
1019
|
+
font-size: 0.8125rem;
|
|
1020
|
+
font-weight: 600;
|
|
1021
|
+
font-family: var(--font-ui, 'Work Sans', system-ui, sans-serif);
|
|
1022
|
+
line-height: 1.2;
|
|
1023
|
+
cursor: pointer;
|
|
1024
|
+
transition: all 0.1s ease;
|
|
1025
|
+
background: var(--dt-surface);
|
|
1026
|
+
color: var(--dt-accent);
|
|
1027
|
+
text-transform: uppercase;
|
|
1028
|
+
letter-spacing: 0.08em;
|
|
1029
|
+
position: relative;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/* Corner accents */
|
|
1033
|
+
.dt-button-inner::before {
|
|
1034
|
+
content: '';
|
|
1035
|
+
position: absolute;
|
|
1036
|
+
top: 0;
|
|
1037
|
+
left: 0;
|
|
1038
|
+
width: 4px;
|
|
1039
|
+
height: 4px;
|
|
1040
|
+
border-top: 1px solid var(--dt-accent);
|
|
1041
|
+
border-left: 1px solid var(--dt-accent);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
.dt-button-inner::after {
|
|
1045
|
+
content: '';
|
|
1046
|
+
position: absolute;
|
|
1047
|
+
bottom: 0;
|
|
1048
|
+
right: 0;
|
|
1049
|
+
width: 4px;
|
|
1050
|
+
height: 4px;
|
|
1051
|
+
border-bottom: 1px solid var(--dt-accent);
|
|
1052
|
+
border-right: 1px solid var(--dt-accent);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.dt-button-inner:hover:not(:disabled) {
|
|
1056
|
+
background: var(--dt-accent);
|
|
1057
|
+
color: var(--dt-text-on-accent);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.dt-button-inner:hover:not(:disabled)::before,
|
|
1061
|
+
.dt-button-inner:hover:not(:disabled)::after {
|
|
1062
|
+
border-color: var(--dt-text-on-accent);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.dt-button-inner:active:not(:disabled) {
|
|
1066
|
+
background: var(--dt-accent-active);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.dt-button-inner:disabled {
|
|
1070
|
+
opacity: 0.4;
|
|
1071
|
+
cursor: not-allowed;
|
|
1072
|
+
border-color: var(--dt-border);
|
|
1073
|
+
color: var(--dt-text-muted);
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.dt-button-inner:disabled::before,
|
|
1077
|
+
.dt-button-inner:disabled::after {
|
|
1078
|
+
border-color: var(--dt-border);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/* Variant: primary - filled accent */
|
|
1082
|
+
:host([variant='primary']) .dt-button-inner {
|
|
1083
|
+
background: var(--dt-accent);
|
|
1084
|
+
color: var(--dt-text-on-accent);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
:host([variant='primary']) .dt-button-inner:hover:not(:disabled) {
|
|
1088
|
+
background: var(--dt-accent-hover);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/* Variant: secondary - outlined */
|
|
1092
|
+
:host([variant='secondary']) .dt-button-inner {
|
|
1093
|
+
background: transparent;
|
|
1094
|
+
border-color: var(--dt-border);
|
|
1095
|
+
color: var(--dt-text);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
:host([variant='secondary']) .dt-button-inner:hover:not(:disabled) {
|
|
1099
|
+
background: var(--dt-surface-hover);
|
|
1100
|
+
border-color: var(--dt-accent);
|
|
1101
|
+
color: var(--dt-accent);
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/* Variant: ghost - minimal */
|
|
1105
|
+
:host([variant='ghost']) .dt-button-inner {
|
|
1106
|
+
background: transparent;
|
|
1107
|
+
border-color: transparent;
|
|
1108
|
+
color: var(--dt-text-secondary);
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
:host([variant='ghost']) .dt-button-inner:hover:not(:disabled) {
|
|
1112
|
+
background: var(--dt-surface);
|
|
1113
|
+
border-color: var(--dt-border);
|
|
1114
|
+
color: var(--dt-text);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
:host([variant='ghost']) .dt-button-inner::before,
|
|
1118
|
+
:host([variant='ghost']) .dt-button-inner::after {
|
|
1119
|
+
display: none;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/* Variant: danger */
|
|
1123
|
+
:host([variant='danger']) .dt-button-inner {
|
|
1124
|
+
background: transparent;
|
|
1125
|
+
border-color: var(--dt-danger);
|
|
1126
|
+
color: var(--dt-danger);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
:host([variant='danger']) .dt-button-inner:hover:not(:disabled) {
|
|
1130
|
+
background: var(--dt-danger);
|
|
1131
|
+
color: var(--dt-text-on-accent);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
:host([variant='danger']) .dt-button-inner::before,
|
|
1135
|
+
:host([variant='danger']) .dt-button-inner::after {
|
|
1136
|
+
border-color: var(--dt-danger);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
:host([variant='danger']) .dt-button-inner:hover:not(:disabled)::before,
|
|
1140
|
+
:host([variant='danger']) .dt-button-inner:hover:not(:disabled)::after {
|
|
1141
|
+
border-color: var(--dt-text-on-accent);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
/* Size: sm */
|
|
1145
|
+
:host([size='sm']) .dt-button-inner {
|
|
1146
|
+
padding: 4px 8px;
|
|
1147
|
+
font-size: 0.75rem;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/* Size: lg */
|
|
1151
|
+
:host([size='lg']) .dt-button-inner {
|
|
1152
|
+
padding: 8px 16px;
|
|
1153
|
+
font-size: 0.875rem;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
:host([fullwidth]) .dt-button-inner {
|
|
1157
|
+
width: 100%;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
::slotted([slot='icon']) {
|
|
1161
|
+
display: inline-flex;
|
|
1162
|
+
width: 1em;
|
|
1163
|
+
height: 1em;
|
|
1164
|
+
}
|
|
1165
|
+
`,te="dt-button-inner",ee=class extends HTMLElement{static get observedAttributes(){return["variant","size","disabled","fullwidth","type"]}_button;_slot;get variant(){let t=this.getAttribute("variant");return t==="secondary"||t==="ghost"||t==="danger"?t:"primary"}set variant(t){this.setAttribute("variant",t)}get size(){let t=this.getAttribute("size");return t==="sm"||t==="lg"?t:"md"}set size(t){this.setAttribute("size",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get fullwidth(){return this.hasAttribute("fullwidth")}set fullwidth(t){t?this.setAttribute("fullwidth",""):this.removeAttribute("fullwidth")}get type(){let t=this.getAttribute("type");return t==="submit"||t==="reset"?t:"button"}set type(t){this.setAttribute("type",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Zt,t.appendChild(e),this._button=document.createElement("button"),this._button.className=te,this._button.type=this.type,this._button.disabled=this.disabled,this._slot=document.createElement("slot"),this._button.appendChild(this._slot),t.appendChild(this._button)}attributeChangedCallback(t,e,r){switch(t){case"disabled":this._button.disabled=this.disabled;break;case"type":this._button.type=this.type;break}}},re=`:host {
|
|
1166
|
+
display: block;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
.dt-divider-inner {
|
|
1170
|
+
border: none;
|
|
1171
|
+
margin: 0;
|
|
1172
|
+
flex-shrink: 0;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/* Horizontal (default) */
|
|
1176
|
+
:host([direction='horizontal']) .dt-divider-inner,
|
|
1177
|
+
.dt-divider-inner {
|
|
1178
|
+
width: 100%;
|
|
1179
|
+
height: 1px;
|
|
1180
|
+
background: var(--dt-accent);
|
|
1181
|
+
opacity: 0.5;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/* Vertical */
|
|
1185
|
+
:host([direction='vertical']) .dt-divider-inner {
|
|
1186
|
+
width: 1px;
|
|
1187
|
+
height: 100%;
|
|
1188
|
+
min-height: 1em;
|
|
1189
|
+
background: var(--dt-accent);
|
|
1190
|
+
opacity: 0.5;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/* Style variants */
|
|
1194
|
+
:host([style-variant='subtle']) .dt-divider-inner {
|
|
1195
|
+
background: var(--dt-border);
|
|
1196
|
+
opacity: 1;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
:host([style-variant='strong']) .dt-divider-inner {
|
|
1200
|
+
background: var(--dt-accent);
|
|
1201
|
+
opacity: 1;
|
|
1202
|
+
height: 2px;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
:host([direction='vertical'][style-variant='strong']) .dt-divider-inner {
|
|
1206
|
+
width: 2px;
|
|
1207
|
+
height: 100%;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/* Spacing */
|
|
1211
|
+
:host([spacing='sm']) .dt-divider-inner {
|
|
1212
|
+
margin: 6px 0;
|
|
1213
|
+
}
|
|
1214
|
+
:host([spacing='md']) .dt-divider-inner {
|
|
1215
|
+
margin: 12px 0;
|
|
1216
|
+
}
|
|
1217
|
+
:host([spacing='lg']) .dt-divider-inner {
|
|
1218
|
+
margin: 18px 0;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
:host([direction='vertical'][spacing='sm']) .dt-divider-inner {
|
|
1222
|
+
margin: 0 6px;
|
|
1223
|
+
}
|
|
1224
|
+
:host([direction='vertical'][spacing='md']) .dt-divider-inner {
|
|
1225
|
+
margin: 0 12px;
|
|
1226
|
+
}
|
|
1227
|
+
:host([direction='vertical'][spacing='lg']) .dt-divider-inner {
|
|
1228
|
+
margin: 0 18px;
|
|
1229
|
+
}
|
|
1230
|
+
`,ne="dt-divider-inner",ie=class extends HTMLElement{static get observedAttributes(){return["direction","style-variant","spacing"]}get direction(){return this.getAttribute("direction")==="vertical"?"vertical":"horizontal"}set direction(t){this.setAttribute("direction",t)}get styleVariant(){let t=this.getAttribute("style-variant");return t==="subtle"||t==="strong"?t:"default"}set styleVariant(t){this.setAttribute("style-variant",t)}get spacing(){let t=this.getAttribute("spacing");return t==="sm"||t==="md"||t==="lg"?t:null}set spacing(t){t===null?this.removeAttribute("spacing"):this.setAttribute("spacing",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=re,t.appendChild(e);let r=document.createElement("hr");r.className=ne,t.appendChild(r)}},oe=`:host {
|
|
1231
|
+
display: block;
|
|
1232
|
+
min-height: 180px;
|
|
1233
|
+
color: var(--dt-text);
|
|
1234
|
+
font-family: var(
|
|
1235
|
+
--font-mono,
|
|
1236
|
+
'SF Mono',
|
|
1237
|
+
Monaco,
|
|
1238
|
+
'Cascadia Code',
|
|
1239
|
+
'Roboto Mono',
|
|
1240
|
+
Consolas,
|
|
1241
|
+
monospace
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.dt-table-view {
|
|
1246
|
+
display: flex;
|
|
1247
|
+
flex-direction: column;
|
|
1248
|
+
min-height: inherit;
|
|
1249
|
+
height: 100%;
|
|
1250
|
+
overflow: hidden;
|
|
1251
|
+
background: var(--dt-surface);
|
|
1252
|
+
border: 1px solid var(--dt-border);
|
|
1253
|
+
border-radius: 2px;
|
|
1254
|
+
position: relative;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
.dt-table-view::before,
|
|
1258
|
+
.dt-table-view::after {
|
|
1259
|
+
content: '';
|
|
1260
|
+
position: absolute;
|
|
1261
|
+
width: 8px;
|
|
1262
|
+
height: 8px;
|
|
1263
|
+
pointer-events: none;
|
|
1264
|
+
z-index: 3;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
.dt-table-view::before {
|
|
1268
|
+
top: -1px;
|
|
1269
|
+
left: -1px;
|
|
1270
|
+
border-top: 2px solid var(--dt-accent);
|
|
1271
|
+
border-left: 2px solid var(--dt-accent);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
.dt-table-view::after {
|
|
1275
|
+
right: -1px;
|
|
1276
|
+
bottom: -1px;
|
|
1277
|
+
border-right: 2px solid var(--dt-accent);
|
|
1278
|
+
border-bottom: 2px solid var(--dt-accent);
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
.dt-table-scroll {
|
|
1282
|
+
min-height: inherit;
|
|
1283
|
+
height: 100%;
|
|
1284
|
+
overflow: auto;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.dt-table-header,
|
|
1288
|
+
.dt-table-row {
|
|
1289
|
+
display: grid;
|
|
1290
|
+
grid-template-columns: var(--dt-table-columns, minmax(0, 1fr));
|
|
1291
|
+
min-width: fit-content;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.dt-table-header {
|
|
1295
|
+
position: sticky;
|
|
1296
|
+
top: 0;
|
|
1297
|
+
z-index: 2;
|
|
1298
|
+
background: color-mix(in srgb, var(--dt-surface) 88%, var(--dt-accent) 12%);
|
|
1299
|
+
border-bottom: 1px solid var(--dt-border);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.dt-table-header-cell,
|
|
1303
|
+
.dt-table-cell {
|
|
1304
|
+
min-width: 0;
|
|
1305
|
+
padding: 10px 12px;
|
|
1306
|
+
overflow: hidden;
|
|
1307
|
+
text-overflow: ellipsis;
|
|
1308
|
+
white-space: nowrap;
|
|
1309
|
+
font-size: 0.8125rem;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
.dt-table-header-cell {
|
|
1313
|
+
color: var(--dt-accent);
|
|
1314
|
+
font-size: 0.75rem;
|
|
1315
|
+
font-weight: 600;
|
|
1316
|
+
letter-spacing: 0.1em;
|
|
1317
|
+
text-transform: uppercase;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.dt-table-header-cell--sortable {
|
|
1321
|
+
cursor: pointer;
|
|
1322
|
+
user-select: none;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
.dt-table-header-cell--sortable:hover {
|
|
1326
|
+
background: var(--dt-surface-hover);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.dt-table-header-label {
|
|
1330
|
+
display: inline-flex;
|
|
1331
|
+
align-items: center;
|
|
1332
|
+
gap: 6px;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
.dt-table-sort-indicator {
|
|
1336
|
+
color: var(--dt-text-secondary);
|
|
1337
|
+
font-size: 0.7rem;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.dt-table-body {
|
|
1341
|
+
position: relative;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
.dt-table-canvas {
|
|
1345
|
+
position: relative;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
.dt-table-row {
|
|
1349
|
+
position: absolute;
|
|
1350
|
+
left: 0;
|
|
1351
|
+
right: 0;
|
|
1352
|
+
border-bottom: 1px solid var(--dt-border-subtle);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.dt-table-row--clickable {
|
|
1356
|
+
cursor: pointer;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
.dt-table-row--clickable:hover {
|
|
1360
|
+
background: var(--dt-surface-hover);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
:host([striped]) .dt-table-row:nth-child(even) {
|
|
1364
|
+
background: color-mix(in srgb, var(--dt-surface) 92%, var(--dt-accent) 8%);
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
:host([bordered]) .dt-table-header-cell,
|
|
1368
|
+
:host([bordered]) .dt-table-cell {
|
|
1369
|
+
border-right: 1px solid var(--dt-border-subtle);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
:host([bordered]) .dt-table-header-cell:last-child,
|
|
1373
|
+
:host([bordered]) .dt-table-cell:last-child {
|
|
1374
|
+
border-right: 0;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
.dt-table-cell[data-align='center'],
|
|
1378
|
+
.dt-table-header-cell[data-align='center'] {
|
|
1379
|
+
text-align: center;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
.dt-table-cell[data-align='right'],
|
|
1383
|
+
.dt-table-header-cell[data-align='right'] {
|
|
1384
|
+
text-align: right;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
.dt-table-empty {
|
|
1388
|
+
display: flex;
|
|
1389
|
+
align-items: center;
|
|
1390
|
+
justify-content: center;
|
|
1391
|
+
min-height: 140px;
|
|
1392
|
+
padding: 20px;
|
|
1393
|
+
color: var(--dt-text-muted);
|
|
1394
|
+
text-transform: uppercase;
|
|
1395
|
+
letter-spacing: 0.08em;
|
|
1396
|
+
font-size: 0.75rem;
|
|
1397
|
+
}
|
|
1398
|
+
`;function ae(t){return t==null||t===!1?null:t===!0?"":String(t)}function se(t,e){let r=t.querySelectorAll("*");for(let n of r){let i=n.getAttribute("data-field");if(i){let o=e[i];n.textContent=o==null?"":String(o)}for(let o of n.getAttributeNames()){if(o==="data-field"||!o.startsWith("data-field-"))continue;let a=o.slice(11);if(!a)continue;let s=n.getAttribute(o);if(!s)continue;let d=ae(e[s]);d===null?n.removeAttribute(a):n.setAttribute(a,d)}}}function ht(t,e){let r=t.content.cloneNode(!0);return se(r,e),r}var ut=class{_count=0;_estimateSize=56;_overscan=5;_fixedSize=null;_viewportHeight=0;_scrollTop=0;_sizes=new Map;constructor(t={}){this._count=t.count??0,this._estimateSize=t.estimateSize??56,this._overscan=t.overscan??5,this._fixedSize=t.fixedSize??null}setCount(t){this._count=Math.max(0,t);for(let e of this._sizes.keys())e>=this._count&&this._sizes.delete(e)}setViewportHeight(t){this._viewportHeight=Math.max(0,t)}setScrollTop(t){this._scrollTop=Math.max(0,t)}setEstimateSize(t){this._estimateSize=Math.max(1,t)}setFixedSize(t){this._fixedSize=t&&t>0?t:null}resetMeasurements(){this._sizes.clear()}measure(t,e){if(this._fixedSize!==null||t<0||t>=this._count)return 0;let r=Math.max(1,Math.round(e)),n=this._sizes.get(t);return n===r?0:(this._sizes.set(t,r),this.getOffset(t+1)<=this._scrollTop?r-(n??this._estimateSize):0)}getOffset(t){if(t<=0)return 0;let e=Math.min(t,this._count);if(this._fixedSize!==null)return e*this._fixedSize;let r=0;for(let n=0;n<e;n+=1)r+=this._sizes.get(n)??this._estimateSize;return r}getTotalHeight(){return this.getOffset(this._count)}getRange(){if(this._count===0)return{start:0,end:0,paddingTop:0,paddingBottom:0,totalHeight:0};if(this._fixedSize!==null){let s=Math.max(1,Math.ceil(this._viewportHeight/this._fixedSize)),d=Math.max(0,Math.floor(this._scrollTop/this._fixedSize)-this._overscan),l=Math.min(this._count,d+s+this._overscan*2),g=d*this._fixedSize,_=this._count*this._fixedSize,b=Math.max(0,_-g-(l-d)*this._fixedSize);return{start:d,end:l,paddingTop:g,paddingBottom:b,totalHeight:_}}let t=0,e=0;for(;t<this._count;){let s=this._sizes.get(t)??this._estimateSize;if(e+s>this._scrollTop)break;e+=s,t+=1}t=Math.max(0,t-this._overscan);let r=this.getOffset(t),n=t,i=0;for(;n<this._count&&i<this._viewportHeight;)i+=this._sizes.get(n)??this._estimateSize,n+=1;n=Math.min(this._count,n+this._overscan);let o=this.getTotalHeight(),a=Math.max(0,o-this.getOffset(n));return{start:t,end:n,paddingTop:r,paddingBottom:a,totalHeight:o}}};function de(t){return t&&typeof t=="object"?t:{value:t}}function le(t){return t==="center"||t==="right"?t:"left"}var pt=class extends HTMLElement{static get observedAttributes(){return["field","header","width","min-width","align"]}get field(){return this.getAttribute("field")??""}get header(){return this.getAttribute("header")??this.field}get width(){return this.getAttribute("width")??"auto"}get minWidth(){return this.getAttribute("min-width")??"0"}get align(){return le(this.getAttribute("align"))}connectedCallback(){this.hidden=!0}attributeChangedCallback(){this.dispatchEvent(new CustomEvent("dt-column-change",{bubbles:!0,composed:!0}))}},ce=class extends HTMLElement{_rows=[];_columns=[];_virtualizer=new ut({estimateSize:40,overscan:5,fixedSize:40});_root;_scroll;_header;_body;_canvas;_emptyState;_resizeObserver=null;_mutationObserver=null;_sortField=null;_sortDirection="asc";static get observedAttributes(){return["row-height","sortable","striped","bordered","empty-text"]}get rows(){return this._rows}set rows(t){this._rows=Array.isArray(t)?t:[],this._virtualizer.setCount(this._rows.length),this._render()}get rowHeight(){let t=Number(this.getAttribute("row-height")??"40");return Number.isFinite(t)&&t>0?t:40}set rowHeight(t){this.setAttribute("row-height",String(t))}get sortable(){return this.hasAttribute("sortable")}get emptyText(){return this.getAttribute("empty-text")??"No data"}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=oe,t.appendChild(e),this._root=document.createElement("div"),this._root.className="dt-table-view",this._scroll=document.createElement("div"),this._scroll.className="dt-table-scroll",this._scroll.addEventListener("scroll",this._onScroll,{passive:!0}),this._header=document.createElement("div"),this._header.className="dt-table-header",this._body=document.createElement("div"),this._body.className="dt-table-body",this._canvas=document.createElement("div"),this._canvas.className="dt-table-canvas",this._emptyState=document.createElement("div"),this._emptyState.className="dt-table-empty",this._body.append(this._canvas,this._emptyState),this._scroll.append(this._header,this._body),this._root.appendChild(this._scroll),t.appendChild(this._root)}connectedCallback(){this._virtualizer.setFixedSize(this.rowHeight),this._virtualizer.setEstimateSize(this.rowHeight),this._syncColumns(),this._resizeObserver=new ResizeObserver(t=>{for(let e of t)if(e.target===this._scroll){let r=this._header.offsetHeight;this._virtualizer.setViewportHeight(Math.max(0,e.contentRect.height-r)),this._render()}}),this._resizeObserver.observe(this._scroll),this._mutationObserver=new MutationObserver(()=>{this._syncColumns(),this._render()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["field","header","width","min-width","align"]}),this._virtualizer.setCount(this._rows.length),this._virtualizer.setViewportHeight(Math.max(0,this._scroll.clientHeight-this._header.offsetHeight)),this._render()}disconnectedCallback(){this._scroll.removeEventListener("scroll",this._onScroll),this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),this._resizeObserver=null,this._mutationObserver=null}attributeChangedCallback(t){t==="row-height"&&(this._virtualizer.setFixedSize(this.rowHeight),this._virtualizer.setEstimateSize(this.rowHeight)),this._render()}_onScroll=()=>{this._virtualizer.setScrollTop(Math.max(0,this._scroll.scrollTop-this._header.offsetHeight)),this._renderBody()};_syncColumns(){this._columns=Array.from(this.children).filter(t=>t instanceof pt).map(t=>({field:t.field,header:t.header,width:t.width,minWidth:t.minWidth,align:t.align,template:Array.from(t.children).find(e=>e instanceof HTMLTemplateElement)??null})).filter(t=>t.field)}_render(){if(!this.isConnected)return;this._emptyState.textContent=this.emptyText;let t=this._columns.length>0?this._columns.map(e=>this._toGridColumn(e)).join(" "):"minmax(0, 1fr)";this._header.style.setProperty("--dt-table-columns",t),this._canvas.style.setProperty("--dt-table-columns",t),this._renderHeader(),this._renderBody()}_renderHeader(){let t=document.createDocumentFragment();for(let e of this._columns){let r=document.createElement("div");r.className="dt-table-header-cell",r.dataset.align=e.align,this.sortable&&(r.classList.add("dt-table-header-cell--sortable"),r.tabIndex=0,r.setAttribute("role","button"),r.setAttribute("aria-label",`Sort by ${e.header}`),r.addEventListener("click",()=>this._requestSort(e.field)),r.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this._requestSort(e.field))}));let n=document.createElement("span");if(n.className="dt-table-header-label",n.textContent=e.header,this.sortable){let i=document.createElement("span");i.className="dt-table-sort-indicator",this._sortField===e.field?i.textContent=this._sortDirection==="asc"?"▲":"▼":i.textContent="↕",n.appendChild(i)}r.appendChild(n),t.appendChild(r)}this._header.replaceChildren(t)}_renderBody(){if(this._rows.length===0||this._columns.length===0){this._emptyState.hidden=!1,this._canvas.replaceChildren(),this._body.style.height="140px",this._canvas.style.height="0px";return}this._emptyState.hidden=!0,this._virtualizer.setCount(this._rows.length),this._virtualizer.setScrollTop(Math.max(0,this._scroll.scrollTop-this._header.offsetHeight)),this._virtualizer.setViewportHeight(Math.max(0,this._scroll.clientHeight-this._header.offsetHeight));let t=this._virtualizer.getRange();this._body.style.height=`${Math.max(t.totalHeight,this._scroll.clientHeight-this._header.offsetHeight)}px`,this._canvas.style.height=`${t.totalHeight}px`;let e=document.createDocumentFragment();for(let r=t.start;r<t.end;r+=1)e.appendChild(this._renderRow(r));this._canvas.replaceChildren(e)}_renderRow(t){let e=this._rows[t],r=document.createElement("div");r.className="dt-table-row dt-table-row--clickable",r.style.top=`${this._virtualizer.getOffset(t)}px`,r.style.height=`${this.rowHeight}px`,r.style.setProperty("--dt-table-columns",this._header.style.getPropertyValue("--dt-table-columns")),r.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("dt-row-click",{detail:{row:e,index:t},bubbles:!0,composed:!0}))});let n=de(e);for(let i of this._columns){let o=document.createElement("div");if(o.className="dt-table-cell",o.dataset.align=i.align,i.template)o.appendChild(ht(i.template,n));else{let a=n[i.field];o.textContent=a==null?"":String(a)}r.appendChild(o)}return r}_requestSort(t){this._sortField===t?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortField=t,this._sortDirection="asc"),this._renderHeader(),this.dispatchEvent(new CustomEvent("dt-sort",{detail:{field:t,direction:this._sortDirection},bubbles:!0,composed:!0}))}_toGridColumn(t){let e=/^\d+$/.test(t.minWidth)?`${t.minWidth}px`:t.minWidth;if(t.width==="auto")return`minmax(${e}, 1fr)`;let r=/^\d+$/.test(t.width)?`${t.width}px`:t.width;return`minmax(${e}, ${r})`}},he=`:host {
|
|
1399
|
+
display: block;
|
|
1400
|
+
min-height: 120px;
|
|
1401
|
+
color: var(--dt-text);
|
|
1402
|
+
font-family: var(
|
|
1403
|
+
--font-mono,
|
|
1404
|
+
'SF Mono',
|
|
1405
|
+
Monaco,
|
|
1406
|
+
'Cascadia Code',
|
|
1407
|
+
'Roboto Mono',
|
|
1408
|
+
Consolas,
|
|
1409
|
+
monospace
|
|
1410
|
+
);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
.dt-list-view {
|
|
1414
|
+
position: relative;
|
|
1415
|
+
display: block;
|
|
1416
|
+
min-height: inherit;
|
|
1417
|
+
height: 100%;
|
|
1418
|
+
overflow: auto;
|
|
1419
|
+
background: var(--dt-surface);
|
|
1420
|
+
border: 1px solid var(--dt-border);
|
|
1421
|
+
border-radius: 2px;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.dt-list-view::before,
|
|
1425
|
+
.dt-list-view::after {
|
|
1426
|
+
content: '';
|
|
1427
|
+
position: sticky;
|
|
1428
|
+
z-index: 2;
|
|
1429
|
+
width: 8px;
|
|
1430
|
+
height: 8px;
|
|
1431
|
+
pointer-events: none;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
.dt-list-view::before {
|
|
1435
|
+
top: 0;
|
|
1436
|
+
left: 0;
|
|
1437
|
+
display: block;
|
|
1438
|
+
border-top: 2px solid var(--dt-accent);
|
|
1439
|
+
border-left: 2px solid var(--dt-accent);
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
.dt-list-view::after {
|
|
1443
|
+
right: 0;
|
|
1444
|
+
bottom: 0;
|
|
1445
|
+
float: right;
|
|
1446
|
+
border-right: 2px solid var(--dt-accent);
|
|
1447
|
+
border-bottom: 2px solid var(--dt-accent);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.dt-list-spacer {
|
|
1451
|
+
position: relative;
|
|
1452
|
+
min-height: 100%;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.dt-list-items {
|
|
1456
|
+
position: relative;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
.dt-list-item {
|
|
1460
|
+
box-sizing: border-box;
|
|
1461
|
+
width: 100%;
|
|
1462
|
+
padding: 12px;
|
|
1463
|
+
color: inherit;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
.dt-list-item--interactive {
|
|
1467
|
+
cursor: pointer;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.dt-list-item--interactive:hover {
|
|
1471
|
+
background: var(--dt-surface-hover);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.dt-list-item--selected {
|
|
1475
|
+
background: var(--dt-accent-subtle);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
:host([dividers]) .dt-list-item {
|
|
1479
|
+
border-bottom: 1px solid var(--dt-border-subtle);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
:host([dividers]) .dt-list-item:last-child {
|
|
1483
|
+
border-bottom: 0;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.dt-list-empty {
|
|
1487
|
+
display: flex;
|
|
1488
|
+
align-items: center;
|
|
1489
|
+
justify-content: center;
|
|
1490
|
+
min-height: 120px;
|
|
1491
|
+
padding: 20px;
|
|
1492
|
+
color: var(--dt-text-muted);
|
|
1493
|
+
text-transform: uppercase;
|
|
1494
|
+
letter-spacing: 0.08em;
|
|
1495
|
+
font-size: 0.75rem;
|
|
1496
|
+
}
|
|
1497
|
+
`,dt=56;function ue(t){return t&&typeof t=="object"?t:{value:t}}var pe=class extends HTMLElement{_items=[];_selectedIndices=new Set;_renderItem=null;_virtualizer=new ut({estimateSize:dt,overscan:5});_viewport;_spacer;_itemsLayer;_emptyState;_resizeObserver=null;_itemResizeObserver=null;static get observedAttributes(){return["item-height","dividers","selectable","empty-text"]}get items(){return this._items}set items(t){this._items=Array.isArray(t)?t:[],this._selectedIndices=new Set([...this._selectedIndices].filter(e=>e<this._items.length)),this._virtualizer.setCount(this._items.length),this._syncSizingMode(!0),this._render()}get selectedItems(){return[...this._selectedIndices].sort((t,e)=>t-e).map(t=>this._items[t])}get renderItem(){return this._renderItem}set renderItem(t){this._renderItem=typeof t=="function"?t:null,this._render()}get itemHeight(){let t=this.getAttribute("item-height");if(!t)return null;let e=Number(t);return Number.isFinite(e)&&e>0?e:null}set itemHeight(t){if(t===null||t<=0){this.removeAttribute("item-height");return}this.setAttribute("item-height",String(t))}get selectable(){let t=this.getAttribute("selectable");return t==="single"||t==="multi"?t:"none"}set selectable(t){this.setAttribute("selectable",t)}get emptyText(){return this.getAttribute("empty-text")??"No items"}set emptyText(t){this.setAttribute("empty-text",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=he,t.appendChild(e),this._viewport=document.createElement("div"),this._viewport.className="dt-list-view",this._viewport.addEventListener("scroll",this._onScroll,{passive:!0}),this._spacer=document.createElement("div"),this._spacer.className="dt-list-spacer",this._itemsLayer=document.createElement("div"),this._itemsLayer.className="dt-list-items",this._emptyState=document.createElement("div"),this._emptyState.className="dt-list-empty",this._spacer.append(this._itemsLayer,this._emptyState),this._viewport.appendChild(this._spacer),t.appendChild(this._viewport)}connectedCallback(){this._resizeObserver=new ResizeObserver(t=>{for(let e of t)e.target===this._viewport&&(this._virtualizer.setViewportHeight(e.contentRect.height),this._render())}),this._resizeObserver.observe(this._viewport),this._itemResizeObserver=new ResizeObserver(t=>{let e=0;for(let r of t){let n=r.target,i=Number(n.dataset.index);Number.isFinite(i)&&(e+=this._virtualizer.measure(i,r.contentRect.height))}e!==0&&(this._viewport.scrollTop+=e),t.length>0&&this._render()}),this._virtualizer.setCount(this._items.length),this._virtualizer.setViewportHeight(this._viewport.clientHeight),this._syncSizingMode(!1),this._render()}disconnectedCallback(){this._viewport.removeEventListener("scroll",this._onScroll),this._resizeObserver?.disconnect(),this._itemResizeObserver?.disconnect(),this._resizeObserver=null,this._itemResizeObserver=null}attributeChangedCallback(t){t==="item-height"&&this._syncSizingMode(!0),t==="selectable"&&this.selectable==="none"&&this._selectedIndices.size>0&&(this._selectedIndices.clear(),this._emitSelectionChange()),this._render()}_onScroll=()=>{this._virtualizer.setScrollTop(this._viewport.scrollTop),this._render()};_syncSizingMode(t){let e=this.itemHeight;this._virtualizer.setFixedSize(e),this._virtualizer.setEstimateSize(e??dt),t&&this._virtualizer.resetMeasurements()}_render(){if(!this.isConnected)return;if(this._emptyState.textContent=this.emptyText,this._emptyState.hidden=this._items.length>0,this._items.length===0){this._itemsLayer.replaceChildren(),this._spacer.style.height="100%";return}this._virtualizer.setScrollTop(this._viewport.scrollTop),this._virtualizer.setViewportHeight(this._viewport.clientHeight),this._virtualizer.setCount(this._items.length);let t=this._virtualizer.getRange();this._spacer.style.height=`${Math.max(t.totalHeight,this._viewport.clientHeight)}px`,this._itemsLayer.style.transform=`translateY(${t.paddingTop}px)`;let e=document.createDocumentFragment();for(let r=t.start;r<t.end;r+=1)e.appendChild(this._renderVisibleItem(r));this._itemsLayer.replaceChildren(e)}_renderVisibleItem(t){let e=this._items[t],r=document.createElement("div");if(r.className="dt-list-item",r.dataset.index=String(t),this.selectable!=="none"&&(r.classList.add("dt-list-item--interactive"),r.setAttribute("role","option"),r.setAttribute("aria-selected",String(this._selectedIndices.has(t))),r.tabIndex=0),this._selectedIndices.has(t)&&r.classList.add("dt-list-item--selected"),this.itemHeight!==null&&(r.style.minHeight=`${this.itemHeight}px`),this._renderItem)this._renderItem(e,r,t);else{let n=this._getTemplate();n?r.appendChild(ht(n,ue(e))):r.textContent=String(e??"")}return r.addEventListener("click",()=>this._handleItemClick(t)),r.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this._handleItemClick(t))}),this.itemHeight===null&&this._itemResizeObserver?.observe(r),r}_handleItemClick(t){let e=this._items[t],r=this.selectable;r==="single"?(this._selectedIndices=new Set([t]),this._emitSelectionChange(),this._render()):r==="multi"&&(this._selectedIndices.has(t)?this._selectedIndices.delete(t):this._selectedIndices.add(t),this._emitSelectionChange(),this._render()),this.dispatchEvent(new CustomEvent("dt-item-click",{detail:{item:e,index:t},bubbles:!0,composed:!0}))}_emitSelectionChange(){this.dispatchEvent(new CustomEvent("dt-selection-change",{detail:{selected:this.selectedItems},bubbles:!0,composed:!0}))}_getTemplate(){for(let t of Array.from(this.children))if(t instanceof HTMLTemplateElement)return t;return null}},me=`:host {
|
|
1498
|
+
display: block;
|
|
1499
|
+
min-height: 220px;
|
|
1500
|
+
color: var(--dt-text);
|
|
1501
|
+
font-family: var(
|
|
1502
|
+
--font-mono,
|
|
1503
|
+
'SF Mono',
|
|
1504
|
+
Monaco,
|
|
1505
|
+
'Cascadia Code',
|
|
1506
|
+
'Roboto Mono',
|
|
1507
|
+
Consolas,
|
|
1508
|
+
monospace
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.dt-chart {
|
|
1513
|
+
position: relative;
|
|
1514
|
+
display: block;
|
|
1515
|
+
min-height: inherit;
|
|
1516
|
+
height: 100%;
|
|
1517
|
+
overflow: hidden;
|
|
1518
|
+
border: 1px solid var(--dt-border);
|
|
1519
|
+
border-radius: 2px;
|
|
1520
|
+
background:
|
|
1521
|
+
radial-gradient(
|
|
1522
|
+
circle at top left,
|
|
1523
|
+
color-mix(in srgb, var(--dt-accent) 16%, transparent),
|
|
1524
|
+
transparent 42%
|
|
1525
|
+
),
|
|
1526
|
+
linear-gradient(
|
|
1527
|
+
180deg,
|
|
1528
|
+
color-mix(in srgb, var(--dt-surface) 90%, var(--dt-accent) 10%),
|
|
1529
|
+
var(--dt-surface)
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
.dt-chart::before,
|
|
1534
|
+
.dt-chart::after {
|
|
1535
|
+
content: '';
|
|
1536
|
+
position: absolute;
|
|
1537
|
+
z-index: 3;
|
|
1538
|
+
width: 8px;
|
|
1539
|
+
height: 8px;
|
|
1540
|
+
pointer-events: none;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.dt-chart::before {
|
|
1544
|
+
top: -1px;
|
|
1545
|
+
left: -1px;
|
|
1546
|
+
border-top: 2px solid var(--dt-accent);
|
|
1547
|
+
border-left: 2px solid var(--dt-accent);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
.dt-chart::after {
|
|
1551
|
+
right: -1px;
|
|
1552
|
+
bottom: -1px;
|
|
1553
|
+
border-right: 2px solid var(--dt-accent);
|
|
1554
|
+
border-bottom: 2px solid var(--dt-accent);
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
.dt-chart__canvas {
|
|
1558
|
+
position: relative;
|
|
1559
|
+
z-index: 1;
|
|
1560
|
+
display: block;
|
|
1561
|
+
width: 100%;
|
|
1562
|
+
height: 100%;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.dt-chart__status {
|
|
1566
|
+
position: absolute;
|
|
1567
|
+
inset: 0;
|
|
1568
|
+
z-index: 2;
|
|
1569
|
+
display: flex;
|
|
1570
|
+
align-items: center;
|
|
1571
|
+
justify-content: center;
|
|
1572
|
+
padding: 20px;
|
|
1573
|
+
color: var(--dt-text-muted);
|
|
1574
|
+
font-size: 0.75rem;
|
|
1575
|
+
letter-spacing: 0.08em;
|
|
1576
|
+
text-align: center;
|
|
1577
|
+
text-transform: uppercase;
|
|
1578
|
+
background: color-mix(in srgb, var(--dt-surface) 72%, transparent);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
.dt-chart__status[hidden] {
|
|
1582
|
+
display: none;
|
|
1583
|
+
}
|
|
1584
|
+
`,Q=null;function ge(){return window.__DtChart?Promise.resolve(window.__DtChart):Q||(Q=new Promise((t,e)=>{let r=document.createElement("script");r.src="/api/ui/chart.umd.js",r.async=!0,r.dataset.dtChart="true",r.onload=()=>{if(window.__DtChart){t(window.__DtChart);return}e(new Error("Chart runtime loaded without a __DtChart export."))},r.onerror=()=>e(new Error("Failed to load the Chart.js runtime bundle.")),document.head.appendChild(r)}),Q)}function q(t,e,r){return Math.min(r,Math.max(e,t))}function be(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function et(t){let e=t.trim().match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(e){let i=e[1],o=i.length===3?i.split("").map(l=>`${l}${l}`).join(""):i,a=parseInt(o.slice(0,2),16)/255,s=parseInt(o.slice(2,4),16)/255,d=parseInt(o.slice(4,6),16)/255;return lt(a,s,d)}let r=t.trim().match(/^rgba?\((\d+(?:\.\d+)?)[,\s]+(\d+(?:\.\d+)?)[,\s]+(\d+(?:\.\d+)?)(?:[,/\s]+[\d.]+)?\)$/i);if(r)return lt(Number(r[1])/255,Number(r[2])/255,Number(r[3])/255);let n=t.trim().match(/^hsla?\(([-\d.]+)(?:deg)?[,\s]+([\d.]+)%[,\s]+([\d.]+)%(?:[,/\s]+[\d.]+)?\)$/i);return n?{h:(Number(n[1])%360+360)%360,s:q(Number(n[2]),0,100),l:q(Number(n[3]),0,100)}:null}function lt(t,e,r){let n=Math.max(t,e,r),i=Math.min(t,e,r),o=n-i,a=0,s=(n+i)/2,d=o===0?0:o/(1-Math.abs(2*s-1));if(o!==0)switch(n){case t:a=60*((e-r)/o%6);break;case e:a=60*((r-t)/o+2);break;default:a=60*((t-e)/o+4);break}return{h:(a+360)%360,s:Math.round(d*100),l:Math.round(s*100)}}function B(t,e=1){return`hsla(${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}% / ${e})`}function ve(t){let e=et(t)??{h:185,s:88,l:56};return[0,32,68,118,164,212,258,304].map((r,n)=>({h:(e.h+r)%360,s:q(e.s-n*2,55,90),l:q(e.l+(n%2===0?0:6)-n,38,66)}))}function G(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function mt(t,e){if(!G(t)||!G(e))return e??t;let r={...t};for(let[n,i]of Object.entries(e)){let o=r[n];r[n]=G(o)&&G(i)?mt(o,i):i}return r}function fe(t){return t==="top"||t==="bottom"||t==="left"||t==="right"?t:"none"}function _e(t){return t==="bar"||t==="line"||t==="area"||t==="pie"||t==="doughnut"||t==="radar"||t==="scatter"||t==="bubble"?t:"bar"}function xe(t){return t==="bar"||t==="line"||t==="area"||t==="scatter"||t==="bubble"}function we(t){return t.map(e=>e.trim()).filter(Boolean)}var ye=class extends HTMLElement{_canvas;_status;_runtime=null;_loadPromise=null;_chart=null;_renderedType=null;_dataInput=null;_optionsOverride=null;_syncFrame=0;static get observedAttributes(){return["type","legend","stacked","labels"]}get type(){return _e(this.getAttribute("type"))}set type(t){this.setAttribute("type",t)}get legend(){return fe(this.getAttribute("legend"))}set legend(t){this.setAttribute("legend",t)}get stacked(){return this.hasAttribute("stacked")}set stacked(t){this.toggleAttribute("stacked",t)}get labels(){return we(be(this.getAttribute("labels")))}set labels(t){this.setAttribute("labels",t.join(","))}get data(){return this._dataInput}set data(t){this._dataInput=t?structuredClone(t):null,this._scheduleSync()}get options(){return this._optionsOverride}set options(t){this._optionsOverride=t?structuredClone(t):null,this._renderChart()}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=me,t.appendChild(e);let r=document.createElement("div");r.className="dt-chart",this._canvas=document.createElement("canvas"),this._canvas.className="dt-chart__canvas",this._status=document.createElement("div"),this._status.className="dt-chart__status",this._status.textContent="Loading chart",r.append(this._canvas,this._status),t.appendChild(r)}connectedCallback(){this._canvas.addEventListener("click",this._handleCanvasClick),this._ensureRuntime().then(()=>this._renderChart()),this._scheduleSync()}disconnectedCallback(){this._canvas.removeEventListener("click",this._handleCanvasClick),this._syncFrame!==0&&(cancelAnimationFrame(this._syncFrame),this._syncFrame=0),this._chart?.destroy(),this._chart=null,this._renderedType=null}attributeChangedCallback(){this._scheduleSync()}_handleCanvasClick=t=>{if(!this._chart)return;let e=this._chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!0)[0];if(!e)return;let r=Array.isArray(this._chart.data.labels)?this._chart.data.labels[e.index]??null:null,n=this._chart.data.datasets[e.datasetIndex],i=Array.isArray(n?.data)?n.data[e.index]:void 0;this.dispatchEvent(new CustomEvent("dt-chart-click",{bubbles:!0,composed:!0,detail:{label:r,datasetIndex:e.datasetIndex,index:e.index,value:i}}))};_scheduleSync(){this._syncFrame===0&&(this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncFromCurrentSource()}))}_syncFromCurrentSource(){this._renderChart()}async _ensureRuntime(){return this._runtime?this._runtime:(this._loadPromise||(this._loadPromise=ge().then(t=>(this._runtime=t,t))),this._loadPromise)}async _renderChart(){let t=this._dataInput;if(!t){this._setStatus("Waiting for data");return}let e=await this._ensureRuntime(),r=this._buildConfig(e,t),n=r.type;!this._chart||this._renderedType!==n?(this._chart?.destroy(),this._chart=new e.Chart(this._canvas,r),this._renderedType=n):(this._chart.data=r.data,this._chart.options=r.options,this._chart.update()),this._setStatus(t.datasets.length>0?null:"Waiting for data")}_buildConfig(t,e){let r=getComputedStyle(this),n=r.getPropertyValue("--dt-accent").trim()||"#42d4ff",i=r.getPropertyValue("--dt-text").trim()||"#d6ebff",o=r.getPropertyValue("--dt-text-muted").trim()||"#7b93a6",a=r.getPropertyValue("--dt-border").trim()||"rgba(123, 147, 166, 0.3)",s=r.getPropertyValue("--font-mono").trim()||"'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace",d=ve(n),l=this.type==="area"?"line":this.type,g={labels:e.labels??this.labels,datasets:e.datasets.map((b,w)=>{let C=d[w%d.length],m=b.color??B(C,1),M={label:b.label??"",data:b.data,backgroundColor:l==="line"||l==="radar"||l==="scatter"?B(C,l==="scatter"?.95:.24):m,borderColor:m,pointBackgroundColor:m,pointBorderColor:m,pointHoverBackgroundColor:m,pointRadius:this.type==="line"||this.type==="area"?3:4,pointHoverRadius:this.type==="line"||this.type==="area"?5:6,borderWidth:2,tension:l==="line"||this.type==="area"?.32:void 0,fill:this.type==="area"};return l==="pie"||l==="doughnut"?{...M,backgroundColor:Array.isArray(b.data)?b.data.map(($,A)=>B(d[A%d.length],.86)):m,borderColor:Array.isArray(b.data)?b.data.map(($,A)=>B(d[A%d.length],1)):m,borderWidth:1}:l==="scatter"||l==="bubble"?{...M,showLine:!1,backgroundColor:B(C,.78)}:M})},_={responsive:!0,maintainAspectRatio:!1,animation:{duration:320},interaction:{mode:"nearest",intersect:!0},plugins:{legend:{display:this.legend!=="none",position:this.legend==="none"?"top":this.legend,labels:{color:i,boxWidth:12,boxHeight:12,padding:14,font:{family:s,size:11}}},tooltip:{backgroundColor:"rgba(10, 18, 24, 0.92)",borderColor:ke(a,n,.35),borderWidth:1,titleColor:i,bodyColor:i,footerColor:o,titleFont:{family:s,size:11},bodyFont:{family:s,size:11},padding:10}},scales:xe(this.type)?{x:{stacked:this.stacked,grid:{display:!1,color:a},border:{color:a},ticks:{color:o,font:{family:s,size:11}}},y:{stacked:this.stacked,beginAtZero:!0,grid:{display:!1,color:a},border:{color:a},ticks:{color:o,font:{family:s,size:11}}}}:l==="radar"?{r:{angleLines:{color:a},grid:{color:a},pointLabels:{color:o,font:{family:s,size:11}},ticks:{color:o,backdropColor:"transparent",font:{family:s,size:10}}}}:void 0};return{type:l,data:g,options:mt(_,this._optionsOverride??{})}}_setStatus(t){if(!t){this._status.hidden=!0;return}this._status.hidden=!1,this._status.textContent=t}};function ke(t,e,r){let n=et(t),i=et(e);if(!n||!i)return t;let o=q(r,0,1),a=((i.h-n.h)%360+540)%360-180;return B({h:(n.h+a*o+360)%360,s:n.s+(i.s-n.s)*o,l:n.l+(i.l-n.l)*o})}var Ce=`:host {
|
|
1585
|
+
display: block;
|
|
1586
|
+
color: var(--dt-text);
|
|
1587
|
+
font-family: var(--font-sans, 'Inter', sans-serif);
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.dt-markdown {
|
|
1591
|
+
color: inherit;
|
|
1592
|
+
line-height: 1.7;
|
|
1593
|
+
word-break: break-word;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
.dt-markdown > :first-child {
|
|
1597
|
+
margin-top: 0;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
.dt-markdown > :last-child {
|
|
1601
|
+
margin-bottom: 0;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.dt-markdown :is(h1, h2, h3, h4, h5, h6) {
|
|
1605
|
+
margin: 1.2em 0 0.55em;
|
|
1606
|
+
color: var(--dt-text);
|
|
1607
|
+
font-family: var(--font-sans, 'Inter', sans-serif);
|
|
1608
|
+
line-height: 1.2;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
.dt-markdown h1 {
|
|
1612
|
+
color: var(--dt-accent);
|
|
1613
|
+
font-size: 1.6rem;
|
|
1614
|
+
letter-spacing: 0.08em;
|
|
1615
|
+
text-transform: uppercase;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.dt-markdown h2 {
|
|
1619
|
+
font-size: 1.3rem;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.dt-markdown h3 {
|
|
1623
|
+
font-size: 1.1rem;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.dt-markdown p,
|
|
1627
|
+
.dt-markdown ul,
|
|
1628
|
+
.dt-markdown ol,
|
|
1629
|
+
.dt-markdown blockquote,
|
|
1630
|
+
.dt-markdown pre,
|
|
1631
|
+
.dt-markdown table {
|
|
1632
|
+
margin: 0.8em 0;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
.dt-markdown ul,
|
|
1636
|
+
.dt-markdown ol {
|
|
1637
|
+
padding-left: 1.4rem;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
.dt-markdown li + li {
|
|
1641
|
+
margin-top: 0.28em;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.dt-markdown strong {
|
|
1645
|
+
color: var(--dt-text);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.dt-markdown a,
|
|
1649
|
+
.dt-markdown .dt-md-link {
|
|
1650
|
+
color: var(--dt-accent);
|
|
1651
|
+
text-decoration: none;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.dt-markdown a:hover,
|
|
1655
|
+
.dt-markdown .dt-md-link:hover {
|
|
1656
|
+
text-decoration: underline;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
.dt-markdown code {
|
|
1660
|
+
padding: 0.12rem 0.35rem;
|
|
1661
|
+
border-radius: 2px;
|
|
1662
|
+
background: color-mix(in srgb, var(--dt-surface) 88%, var(--dt-accent) 12%);
|
|
1663
|
+
color: var(--dt-accent);
|
|
1664
|
+
font-family: var(
|
|
1665
|
+
--font-mono,
|
|
1666
|
+
'SF Mono',
|
|
1667
|
+
Monaco,
|
|
1668
|
+
'Cascadia Code',
|
|
1669
|
+
'Roboto Mono',
|
|
1670
|
+
Consolas,
|
|
1671
|
+
monospace
|
|
1672
|
+
);
|
|
1673
|
+
font-size: 0.92em;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
.dt-md-pre {
|
|
1677
|
+
overflow-x: auto;
|
|
1678
|
+
padding: 14px 16px;
|
|
1679
|
+
border: 1px solid var(--dt-border);
|
|
1680
|
+
border-radius: 2px;
|
|
1681
|
+
background: var(--dt-surface);
|
|
1682
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dt-surface) 85%, var(--dt-accent) 15%);
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.dt-md-pre code {
|
|
1686
|
+
display: block;
|
|
1687
|
+
padding: 0;
|
|
1688
|
+
background: transparent;
|
|
1689
|
+
color: var(--dt-text);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
.dt-md-blockquote {
|
|
1693
|
+
margin: 0.9em 0;
|
|
1694
|
+
padding: 0.15rem 0 0.15rem 1rem;
|
|
1695
|
+
border-left: 3px solid var(--dt-accent);
|
|
1696
|
+
color: var(--dt-text-muted);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.dt-md-table {
|
|
1700
|
+
width: 100%;
|
|
1701
|
+
border-collapse: collapse;
|
|
1702
|
+
border: 1px solid var(--dt-border);
|
|
1703
|
+
background: var(--dt-surface);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
.dt-md-table th,
|
|
1707
|
+
.dt-md-table td {
|
|
1708
|
+
padding: 0.6rem 0.8rem;
|
|
1709
|
+
border: 1px solid var(--dt-border-subtle, var(--dt-border));
|
|
1710
|
+
text-align: left;
|
|
1711
|
+
vertical-align: top;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
.dt-md-table th {
|
|
1715
|
+
color: var(--dt-accent);
|
|
1716
|
+
background: color-mix(in srgb, var(--dt-surface) 88%, var(--dt-accent) 12%);
|
|
1717
|
+
font-size: 0.75rem;
|
|
1718
|
+
letter-spacing: 0.08em;
|
|
1719
|
+
text-transform: uppercase;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.dt-markdown hr {
|
|
1723
|
+
border: 0;
|
|
1724
|
+
border-top: 1px solid var(--dt-border);
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
.dt-md-image {
|
|
1728
|
+
display: block;
|
|
1729
|
+
max-width: 100%;
|
|
1730
|
+
border: 1px solid var(--dt-border);
|
|
1731
|
+
border-radius: 2px;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
.dt-markdown__caret {
|
|
1735
|
+
display: inline-block;
|
|
1736
|
+
margin-left: 0.15rem;
|
|
1737
|
+
color: var(--dt-accent);
|
|
1738
|
+
animation: dt-markdown-caret 0.9s steps(1) infinite;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
.dt-markdown__caret[hidden] {
|
|
1742
|
+
display: none;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
@keyframes dt-markdown-caret {
|
|
1746
|
+
0%,
|
|
1747
|
+
49% {
|
|
1748
|
+
opacity: 1;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
50%,
|
|
1752
|
+
100% {
|
|
1753
|
+
opacity: 0;
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
`,Z=null;function Ae(){return window.__DtMarked?Promise.resolve(window.__DtMarked):Z||(Z=new Promise((t,e)=>{let r=document.createElement("script");r.src="/api/ui/marked.js",r.async=!0,r.dataset.dtMarked="true",r.onload=()=>{if(window.__DtMarked){t(window.__DtMarked);return}e(new Error("Marked runtime loaded without a __DtMarked export."))},r.onerror=()=>e(new Error("Failed to load the marked runtime bundle.")),document.head.appendChild(r)}),Z)}function gt(t){return t.replaceAll(`\r
|
|
1757
|
+
`,`
|
|
1758
|
+
`)}function Ee(t){let e=gt(t).split(`
|
|
1759
|
+
`);for(;e.length>0&&e[0].trim()==="";)e.shift();for(;e.length>0&&e[e.length-1].trim()==="";)e.pop();let r=e.filter(i=>i.trim()!=="").map(i=>i.match(/^\s*/)?.[0].length??0),n=r.length>0?Math.min(...r):0;return n===0?e.join(`
|
|
1760
|
+
`):e.map(i=>i.slice(n)).join(`
|
|
1761
|
+
`)}function Se(t){let e=gt(t);if((e.match(/(^|\n)(```|~~~)/g)??[]).length%2===0)return e;let r=e.includes("~~~")&&!e.includes("```")?"~~~":"```";return`${e}
|
|
1762
|
+
${r}`}var Ne=class extends HTMLElement{_body;_caret;_contentOverride=null;_runtime=null;_loadPromise=null;_observer=null;_renderFrame=0;static get observedAttributes(){return["streaming","unsafe-html"]}get content(){return this._contentOverride??this._readInlineMarkdown()}set content(t){this._contentOverride=String(t??""),this._scheduleRender()}get streaming(){return this.hasAttribute("streaming")}set streaming(t){this.toggleAttribute("streaming",t)}get unsafeHtml(){return this.hasAttribute("unsafe-html")}set unsafeHtml(t){this.toggleAttribute("unsafe-html",t)}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=Ce,t.appendChild(e),this._body=document.createElement("div"),this._body.className="dt-markdown",this._body.addEventListener("click",this._onLinkClick),this._caret=document.createElement("span"),this._caret.className="dt-markdown__caret",this._caret.textContent="▌",this._caret.hidden=!0,t.append(this._body,this._caret)}connectedCallback(){this._observer||(this._observer=new MutationObserver(()=>{this._contentOverride===null&&this._scheduleRender()}),this._observer.observe(this,{childList:!0,characterData:!0,subtree:!0})),this._ensureRuntime(),this._scheduleRender()}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._renderFrame!==0&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=0)}attributeChangedCallback(){this._scheduleRender()}_onLinkClick=t=>{let e=t.composedPath().find(r=>r instanceof HTMLAnchorElement);e&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("dt-link-click",{bubbles:!0,composed:!0,detail:{href:e.getAttribute("href")??"#"}})))};_readInlineMarkdown(){return Ee(this.textContent??"")}_scheduleRender(){this._renderFrame===0&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=0,this._render()}))}async _ensureRuntime(){return this._runtime?this._runtime:(this._loadPromise||(this._loadPromise=Ae().then(t=>(this._runtime=t,t))),this._loadPromise)}async _render(){let t=await this._ensureRuntime(),e=this.content;this.streaming&&(e=Se(e)),this._body.innerHTML=t.render(e,{unsafeHtml:this.unsafeHtml}),this._caret.hidden=!this.streaming}},ze=`:host {
|
|
1763
|
+
display: block;
|
|
1764
|
+
min-height: 240px;
|
|
1765
|
+
color: var(--dt-text);
|
|
1766
|
+
font-family: var(--font-sans, 'Inter', sans-serif);
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
.dt-markdown-editor {
|
|
1770
|
+
position: relative;
|
|
1771
|
+
height: 100%;
|
|
1772
|
+
min-height: inherit;
|
|
1773
|
+
overflow: hidden;
|
|
1774
|
+
border: 1px solid var(--dt-border);
|
|
1775
|
+
border-radius: 2px;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
.dt-markdown-editor::before,
|
|
1779
|
+
.dt-markdown-editor::after {
|
|
1780
|
+
content: '';
|
|
1781
|
+
position: absolute;
|
|
1782
|
+
z-index: 3;
|
|
1783
|
+
width: 8px;
|
|
1784
|
+
height: 8px;
|
|
1785
|
+
pointer-events: none;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.dt-markdown-editor::before {
|
|
1789
|
+
top: -1px;
|
|
1790
|
+
left: -1px;
|
|
1791
|
+
border-top: 2px solid var(--dt-accent);
|
|
1792
|
+
border-left: 2px solid var(--dt-accent);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
.dt-markdown-editor::after {
|
|
1796
|
+
right: -1px;
|
|
1797
|
+
bottom: -1px;
|
|
1798
|
+
border-right: 2px solid var(--dt-accent);
|
|
1799
|
+
border-bottom: 2px solid var(--dt-accent);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
.dt-markdown-editor__surface {
|
|
1803
|
+
height: 100%;
|
|
1804
|
+
min-height: inherit;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.dt-markdown-editor__content {
|
|
1808
|
+
height: 100%;
|
|
1809
|
+
min-height: inherit;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.dt-markdown-editor__status {
|
|
1813
|
+
position: absolute;
|
|
1814
|
+
inset: 0;
|
|
1815
|
+
display: flex;
|
|
1816
|
+
align-items: center;
|
|
1817
|
+
justify-content: center;
|
|
1818
|
+
padding: 20px;
|
|
1819
|
+
background: color-mix(in srgb, var(--dt-surface) 84%, transparent);
|
|
1820
|
+
color: var(--dt-text-muted);
|
|
1821
|
+
font-size: 0.75rem;
|
|
1822
|
+
letter-spacing: 0.08em;
|
|
1823
|
+
text-transform: uppercase;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
.dt-markdown-editor__status[hidden] {
|
|
1827
|
+
display: none;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
.milkdown {
|
|
1831
|
+
--crepe-color-background: transparent;
|
|
1832
|
+
--crepe-color-on-background: var(--dt-text);
|
|
1833
|
+
--crepe-color-surface: var(--dt-surface);
|
|
1834
|
+
--crepe-color-surface-low: color-mix(in srgb, var(--dt-surface) 94%, var(--dt-accent) 6%);
|
|
1835
|
+
--crepe-color-on-surface: var(--dt-text);
|
|
1836
|
+
--crepe-color-on-surface-variant: var(--dt-text-muted);
|
|
1837
|
+
--crepe-color-outline: var(--dt-border);
|
|
1838
|
+
--crepe-color-primary: var(--dt-accent);
|
|
1839
|
+
--crepe-color-secondary: color-mix(in srgb, var(--dt-surface) 84%, var(--dt-accent) 16%);
|
|
1840
|
+
--crepe-color-on-secondary: var(--dt-text);
|
|
1841
|
+
--crepe-color-inverse: var(--dt-text);
|
|
1842
|
+
--crepe-color-on-inverse: var(--dt-surface);
|
|
1843
|
+
--crepe-color-inline-code: var(--dt-accent);
|
|
1844
|
+
--crepe-color-error: var(--dt-danger, #ff6a6a);
|
|
1845
|
+
--crepe-color-hover: var(--dt-surface-hover);
|
|
1846
|
+
--crepe-color-selected: color-mix(in srgb, var(--dt-surface) 82%, var(--dt-accent) 18%);
|
|
1847
|
+
--crepe-color-inline-area: color-mix(in srgb, var(--dt-surface) 90%, var(--dt-accent) 10%);
|
|
1848
|
+
--crepe-font-title: var(--font-sans, 'Inter', sans-serif);
|
|
1849
|
+
--crepe-font-default: var(--font-sans, 'Inter', sans-serif);
|
|
1850
|
+
--crepe-font-code: var(
|
|
1851
|
+
--font-mono,
|
|
1852
|
+
'SF Mono',
|
|
1853
|
+
Monaco,
|
|
1854
|
+
'Cascadia Code',
|
|
1855
|
+
'Roboto Mono',
|
|
1856
|
+
Consolas,
|
|
1857
|
+
monospace
|
|
1858
|
+
);
|
|
1859
|
+
--crepe-shadow-1: 0 0 0 1px color-mix(in srgb, var(--dt-surface) 82%, var(--dt-accent) 18%);
|
|
1860
|
+
--crepe-shadow-2:
|
|
1861
|
+
0 0 0 1px color-mix(in srgb, var(--dt-surface) 78%, var(--dt-accent) 22%),
|
|
1862
|
+
0 8px 24px color-mix(in srgb, var(--dt-accent) 12%, transparent);
|
|
1863
|
+
|
|
1864
|
+
height: 100%;
|
|
1865
|
+
background: transparent;
|
|
1866
|
+
color: var(--dt-text);
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
.milkdown .editor {
|
|
1870
|
+
min-height: 100%;
|
|
1871
|
+
padding: 16px 18px 20px;
|
|
1872
|
+
outline: none;
|
|
1873
|
+
color: var(--dt-text);
|
|
1874
|
+
font-family: var(--font-sans, 'Inter', sans-serif);
|
|
1875
|
+
font-size: 14px;
|
|
1876
|
+
line-height: 1.7;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
.milkdown .editor > :first-child {
|
|
1880
|
+
margin-top: 0;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
.milkdown .editor h1,
|
|
1884
|
+
.milkdown .editor h2,
|
|
1885
|
+
.milkdown .editor h3,
|
|
1886
|
+
.milkdown .editor h4,
|
|
1887
|
+
.milkdown .editor h5,
|
|
1888
|
+
.milkdown .editor h6 {
|
|
1889
|
+
margin: 0.95em 0 0.45em;
|
|
1890
|
+
line-height: 1.2;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
.milkdown .editor h1 {
|
|
1894
|
+
color: var(--dt-accent);
|
|
1895
|
+
font-size: 1.6rem;
|
|
1896
|
+
letter-spacing: 0.08em;
|
|
1897
|
+
text-transform: uppercase;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
.milkdown .editor h2 {
|
|
1901
|
+
font-size: 1.28rem;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
.milkdown .editor h3 {
|
|
1905
|
+
font-size: 1.08rem;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
.milkdown .editor p {
|
|
1909
|
+
margin: 0.65em 0;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
.milkdown .editor code {
|
|
1913
|
+
padding: 2px 5px;
|
|
1914
|
+
border-radius: 2px;
|
|
1915
|
+
background: color-mix(in srgb, var(--dt-surface) 88%, var(--dt-accent) 12%);
|
|
1916
|
+
font-family: var(
|
|
1917
|
+
--font-mono,
|
|
1918
|
+
'SF Mono',
|
|
1919
|
+
Monaco,
|
|
1920
|
+
'Cascadia Code',
|
|
1921
|
+
'Roboto Mono',
|
|
1922
|
+
Consolas,
|
|
1923
|
+
monospace
|
|
1924
|
+
);
|
|
1925
|
+
font-size: 0.9em;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
.milkdown .editor pre {
|
|
1929
|
+
overflow-x: auto;
|
|
1930
|
+
margin: 0.9em 0;
|
|
1931
|
+
padding: 12px 14px;
|
|
1932
|
+
border: 1px solid var(--dt-border);
|
|
1933
|
+
border-radius: 2px;
|
|
1934
|
+
background: var(--dt-surface);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
.milkdown .editor pre code {
|
|
1938
|
+
padding: 0;
|
|
1939
|
+
background: transparent;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
.milkdown .editor blockquote {
|
|
1943
|
+
margin: 0.9em 0;
|
|
1944
|
+
padding-left: 12px;
|
|
1945
|
+
border-left: 3px solid var(--dt-accent);
|
|
1946
|
+
color: var(--dt-text-muted);
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
.milkdown .editor a {
|
|
1950
|
+
color: var(--dt-accent);
|
|
1951
|
+
text-decoration: none;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
.milkdown .editor a:hover {
|
|
1955
|
+
text-decoration: underline;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.milkdown .editor hr {
|
|
1959
|
+
border: 0;
|
|
1960
|
+
border-top: 1px solid var(--dt-border);
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
.milkdown .editor ul,
|
|
1964
|
+
.milkdown .editor ol {
|
|
1965
|
+
padding-left: 1.5rem;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
.milkdown .editor img {
|
|
1969
|
+
max-width: 100%;
|
|
1970
|
+
border-radius: 2px;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
.milkdown .editor table {
|
|
1974
|
+
width: 100%;
|
|
1975
|
+
border-collapse: collapse;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
.milkdown .editor th,
|
|
1979
|
+
.milkdown .editor td {
|
|
1980
|
+
border: 1px solid var(--dt-border);
|
|
1981
|
+
}
|
|
1982
|
+
`,tt=null;function Me(){return window.__DtMilkdown?Promise.resolve(window.__DtMilkdown):tt||(tt=new Promise((t,e)=>{let r=document.createElement("script");r.src="/api/ui/milkdown.umd.js",r.async=!0,r.dataset.dtMilkdown="true",r.onload=()=>{if(window.__DtMilkdown){t(window.__DtMilkdown);return}e(new Error("Milkdown runtime loaded without a __DtMilkdown export."))},r.onerror=()=>e(new Error("Failed to load the Milkdown runtime bundle.")),document.head.appendChild(r)}),tt)}var Te=class extends HTMLElement{_runtimeStyle;_surface;_content;_status;_runtime=null;_loadPromise=null;_editor=null;_pendingValue="";_changeTimer=null;_setupToken=0;_suppressNextChange=!1;static get observedAttributes(){return["placeholder","readonly"]}get placeholder(){return this.getAttribute("placeholder")??""}set placeholder(t){this.setAttribute("placeholder",t)}get readonly(){return this.hasAttribute("readonly")}set readonly(t){this.toggleAttribute("readonly",t)}get value(){return this._editor&&(this._pendingValue=this._editor.getMarkdown()),this._pendingValue}set value(t){let e=String(t??"");this._pendingValue=e,this._editor&&this._runtime&&this._editor.getMarkdown()!==e&&(this._suppressNextChange=!0,this._editor.editor.action(this._runtime.replaceAll(e)))}constructor(){super();let t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=ze,t.appendChild(e),this._runtimeStyle=document.createElement("style"),t.appendChild(this._runtimeStyle),this._surface=document.createElement("div"),this._surface.className="dt-markdown-editor",this._content=document.createElement("div"),this._content.className="dt-markdown-editor__surface";let r=document.createElement("div");r.className="dt-markdown-editor__content",this._content.appendChild(r),this._status=document.createElement("div"),this._status.className="dt-markdown-editor__status",this._status.textContent="Loading editor",this._surface.append(this._content,this._status),t.appendChild(this._surface)}connectedCallback(){this._initializeEditor()}disconnectedCallback(){this._setupToken+=1,this._clearChangeTimer(),this._destroyEditor()}attributeChangedCallback(t){if(t==="readonly"){this._editor?.setReadonly(this.readonly);return}t==="placeholder"&&this.isConnected&&this._initializeEditor(!0)}async _ensureRuntime(){return this._runtime?this._runtime:(this._loadPromise||(this._loadPromise=Me().then(t=>(this._runtime=t,this._runtimeStyle.textContent=t.cssText,t))),this._loadPromise)}async _initializeEditor(t=!1){let e=++this._setupToken;if(this._setStatus("Loading editor"),t)await this._destroyEditor();else if(this._editor){this._setStatus(null);return}try{let r=await this._ensureRuntime();if(!this.isConnected||e!==this._setupToken)return;this._content.replaceChildren();let n=document.createElement("div");n.className="dt-markdown-editor__content",this._content.appendChild(n);let i=new r.Crepe({root:n,defaultValue:this._pendingValue,features:{[r.Crepe.Feature.CodeMirror]:!1,[r.Crepe.Feature.ImageBlock]:!1,[r.Crepe.Feature.Latex]:!1},featureConfigs:{[r.Crepe.Feature.Placeholder]:{text:this.placeholder,mode:"doc"}}});if(i.on(o=>{o.markdownUpdated((a,s)=>{if(this._pendingValue=s,this._suppressNextChange){this._suppressNextChange=!1;return}this._queueChange(s)}),o.focus(()=>{this.dispatchEvent(new CustomEvent("dt-focus",{bubbles:!0,composed:!0}))}),o.blur(()=>{this.dispatchEvent(new CustomEvent("dt-blur",{bubbles:!0,composed:!0}))})}),await i.create(),!this.isConnected||e!==this._setupToken){await i.destroy();return}this._editor=i,this._editor.setReadonly(this.readonly),this._pendingValue=this._editor.getMarkdown(),this._setStatus(null)}catch{e===this._setupToken&&this._setStatus("Failed to load editor")}}async _destroyEditor(){let t=this._editor;if(this._editor=null,!!t)try{await t.destroy()}catch{}}_queueChange(t){this._clearChangeTimer(),this._changeTimer=setTimeout(()=>{this._changeTimer=null,this.dispatchEvent(new CustomEvent("dt-change",{bubbles:!0,composed:!0,detail:{value:t}}))},300)}_clearChangeTimer(){this._changeTimer&&(clearTimeout(this._changeTimer),this._changeTimer=null)}_setStatus(t){if(t){this._status.hidden=!1,this._status.textContent=t;return}this._status.hidden=!0}};customElements.get("dt-tooltip")||customElements.define("dt-tooltip",Nt);customElements.get("dt-card")||customElements.define("dt-card",Tt);customElements.get("dt-select")||customElements.define("dt-select",Bt);customElements.get("dt-grid")||customElements.define("dt-grid",Wt);customElements.get("dt-stack")||customElements.define("dt-stack",Ut);customElements.get("dt-stat")||customElements.define("dt-stat",Gt);customElements.get("dt-badge")||customElements.define("dt-badge",Qt);customElements.get("dt-button")||customElements.define("dt-button",ee);customElements.get("dt-divider")||customElements.define("dt-divider",ie);customElements.get("dt-list-view")||customElements.define("dt-list-view",pe);customElements.get("dt-table-view")||customElements.define("dt-table-view",ce);customElements.get("dt-column")||customElements.define("dt-column",pt);customElements.get("dt-chart")||customElements.define("dt-chart",ye);customElements.get("dt-markdown")||customElements.define("dt-markdown",Ne);customElements.get("dt-markdown-editor")||customElements.define("dt-markdown-editor",Te);function Le(t){const e=t.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?([\s\S]*)$/);return e?e[1]:t}var He=xt(function({note:e,loading:r,onSave:n},i){const o=F(null),[a,s]=R("idle"),d=F(null),l=F(n);return l.current=n,j(()=>{if(o.current&&e){const g=Le(e.content);o.current.value=g}},[e?.id]),j(()=>{const g=o.current;if(!g)return;const _=b=>{const w=b.detail;w&&(d.current&&clearTimeout(d.current),s("saving"),d.current=setTimeout(()=>{l.current(w.value),s("saved")},500))};return g.addEventListener("dt-change",_),()=>g.removeEventListener("dt-change",_)},[]),j(()=>()=>{d.current&&clearTimeout(d.current)},[]),wt(i,()=>({getMarkdown(){return o.current?.value??null},setMarkdown(g){o.current&&(o.current.value=g)},getCursorLine(){return 1},getSelectedText(){return""}}),[]),e?H("div",{className:v.editorPanel,children:[H("div",{className:v.editorHeader,children:[H("div",{children:[u("div",{className:v.editorTitle,children:e.title}),e.tags.length>0&&u("div",{className:v.editorTags,children:e.tags.map(g=>u("span",{className:v.editorTag,children:g},g))})]}),u("span",{className:a==="saving"?v.saveStatusSaving:v.saveStatus,children:a==="saving"?"Saving...":a==="saved"?"Saved":""})]}),u("div",{className:v.editorBody,children:u("dt-markdown-editor",{ref:o,placeholder:"Start writing...",style:{height:"100%"}})})]}):u("div",{className:v.editorPanel,children:u("div",{className:v.editorPlaceholder,children:r?"Loading...":"Select a note or create a new one"})})}),Ie=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;function Re(t){const e=t.match(Ie);if(!e){const d=t.match(/^#\s+(.+)$/m);return{title:d?d[1].trim():"Untitled",tags:[],created:null,body:t}}const r=e[1],n=e[2];let i="Untitled",o=[],a=null,s=!1;for(const d of r.split(`
|
|
1983
|
+
`)){const l=d.trim();if(l.startsWith("title:"))i=l.slice(6).trim().replace(/^["']|["']$/g,""),s=!1;else if(l.startsWith("created:"))a=l.slice(8).trim(),s=!1;else if(l.startsWith("tags:")){s=!0;const g=l.slice(5).trim();g.startsWith("[")&&g.endsWith("]")&&(o=g.slice(1,-1).split(",").map(_=>_.trim().replace(/^["']|["']$/g,"")).filter(Boolean),s=!1)}else s&&l.startsWith("- ")?o.push(l.slice(2).trim().replace(/^["']|["']$/g,"")):s=!1}return{title:i,tags:o,created:a,body:n}}function Fe(t,e,r,n){const i=["---",`title: "${t.replace(/"/g,'\\"')}"`];if(e.length>0){i.push("tags:");for(const o of e)i.push(` - ${o}`)}return i.push(`created: ${r}`,"---","",n),i.join(`
|
|
1984
|
+
`)}function $e(t,e,r,n,i){const a=t.substring(0,i).split(`
|
|
1985
|
+
`).length,s=r.split(`
|
|
1986
|
+
`),d=n.split(`
|
|
1987
|
+
`),l=Math.max(0,a-4),g=t.split(`
|
|
1988
|
+
`),_=e.split(`
|
|
1989
|
+
`),b=[];b.push(`@@ -${a},${s.length} +${a},${d.length} @@`);for(let m=l;m<a-1;m++)b.push(` ${g[m]}`);for(const m of s)b.push(`-${m}`);for(const m of d)b.push(`+${m}`);const w=a-1+s.length,C=Math.min(_.length,w+3);for(let m=w;m<C;m++)_[m]!==void 0&&b.push(` ${_[m]}`);return{diff:b.join(`
|
|
1990
|
+
`),firstChangedLine:a}}function Pe({children:t,selectedNoteId:e,selectedNote:r,notes:n,editorRef:i,onNoteCreated:o,onNoteDeleted:a,onSearch:s,onNoteUpdated:d,onSelectNote:l,onRefresh:g}){const _=z("notes.create"),b=z("notes.delete"),w=z("notes.search"),C=z("notes.update"),m=x(async f=>{const p=await _({title:f?.title||void 0,content:f?.content||void 0,tags:f?.tags||void 0,path:f?.path||void 0});return o(p),p},[_,o]),M=x(async()=>{e&&(await b({id:e}),a(e))},[b,e,a]),$=x(async f=>{const p=f?.query||"";return s(p),await w({query:p})},[w,s]),A=x(()=>{if(!r)return null;const f=i.current;if(!f)return null;const p=f.getMarkdown();return p===null?null:Fe(r.title,r.tags,r.createdAt,p)},[r,i]),P=x(async()=>({notes:n.slice(0,20).map(p=>({id:p.id,title:p.title,updatedAt:p.updatedAt,selected:p.id===e}))}),[n,e]),E=x(async f=>{const p=f?.id;return p?n.find(T=>T.id===p)?(await l(p),{success:!0}):{success:!1,error:`Note not found: ${p}`}:{success:!1,error:"id parameter is required"}},[n,l]),U=x(async()=>{if(!e||!r)return{error:"No note is currently open"};const f=i.current;if(!f)return{error:"Editor is not ready"};const p=A();return p===null?{error:"Editor is not ready"}:{id:r.id,title:r.title,content:p,cursorLine:f.getCursorLine(),selectedText:f.getSelectedText()}},[e,r,i,A]),O=x(async f=>{if(!e||!r)return{success:!1,error:"No note is currently open"};const p=i.current;if(!p)return{success:!1,error:"Editor is not ready"};const y=f?.old_text,T=f?.new_text;if(y===void 0||T===void 0)return{success:!1,error:"Both old_text and new_text are required"};const S=A();if(S===null)return{success:!1,error:"Editor is not ready"};let D,V;if(y==="")D=T+S,V=0;else{const N=S.indexOf(y);if(N===-1)return{success:!1,error:"Text not found in note"};const X=S.indexOf(y,N+1);if(X!==-1){let rt=2,nt=X+1;for(;;){const it=S.indexOf(y,nt);if(it===-1)break;rt++,nt=it+1}return{success:!1,error:`Text appears ${rt} times; provide more surrounding context to make it unique`}}D=S.substring(0,N)+T+S.substring(N+y.length),V=N}const c=Re(D);p.setMarkdown(c.body);const k=c.tags.length!==r.tags.length||c.tags.some((N,X)=>N!==r.tags[X]),W=c.title!==r.title;if(k||W){const N=await C({id:e,tags:c.tags,content:c.body});d(N)}const{diff:Y,firstChangedLine:bt}=$e(S,D,y,T,V);return{success:!0,diff:Y,firstChangedLine:bt}},[e,r,i,A,C,d]);return H(_t,{children:[u(I,{name:"Create Note",description:"Create a new note with optional title, content, and path",params:{title:{type:"string",description:"Note title",required:!1},content:{type:"string",description:"Note content in Markdown",required:!1},tags:{type:"string",description:"Comma-separated tags",required:!1},path:{type:"string",description:'Relative path for the note (e.g. "work/meeting-notes"). Becomes the note ID. Auto-generated if omitted.',required:!1}},handler:m}),u(I,{name:"Delete Note",description:"Delete the currently selected note",handler:M}),u(I,{name:"Search Notes",description:"Search notes by keyword",params:{query:{type:"string",description:"Search query",required:!0}},handler:$}),u(I,{name:"List Notes",description:"Return the 20 most recent notes with selection status",handler:P}),u(I,{name:"Select Note",description:"Select a note by ID and open it in the editor",params:{id:{type:"string",description:"Note ID (relative path without .md)",required:!0}},handler:E}),u(I,{name:"Get Editing Context",description:"Return the current editor state for the selected note including content, cursor position, and selected text",handler:U}),u(I,{name:"Edit Note",description:"Apply a text replacement to the current note content including front matter. Use old_text to find exact text and new_text to replace it. To edit tags or title, modify the YAML front matter directly.",params:{old_text:{type:"string",description:"Exact text to find in the note content (must appear exactly once). Searches the full content including YAML front matter. Use empty string to insert at beginning.",required:!0},new_text:{type:"string",description:"Replacement text",required:!0}},handler:O}),t]})}var De=720;function Be(){const[t,e]=R([]),[r,n]=R(null),[i,o]=R(null),[a,s]=R(""),[d,l]=R(!1),[g,_]=R(!1),b=F(null),w=F(null),C=z("notes.list"),m=z("notes.get"),M=z("notes.update"),$=z("notes.search"),A=z("notes.create"),P=x(async()=>{try{let c;a?c=await $({query:a}):c=await C(),e(c)}catch(c){console.error("Failed to fetch notes:",c)}},[C,$,a]),E=x(()=>{P()},[P]);j(()=>{E()},[E]),j(()=>{if(!w.current)return;const c=W=>{_(W<=De)};c(w.current.clientWidth);const k=new ResizeObserver(W=>{const Y=W[0];Y&&c(Y.contentRect.width)});return k.observe(w.current),()=>k.disconnect()},[]);const U=x(async c=>{n(c),l(!0);try{const k=await m({id:c});o(k)}catch(k){console.error("Failed to load note:",k),o(null)}finally{l(!1)}},[m]),O=F(null),f=x(c=>{s(c),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{},300)},[]),p=x(async c=>{if(!(!r||!i))try{const k=await M({id:r,content:c});o(k),P()}catch(k){console.error("Failed to save note:",k)}},[r,i,M,P]),y=x(c=>{E(),n(c.id),o(c)},[E]),T=x(c=>{r===c&&(n(null),o(null)),E()},[r,E]),S=x(c=>{r===c.id&&o(c),E()},[r,E]),D=x(c=>{s(c)},[]),V=x(async()=>{try{const c=await A({});y(c)}catch(c){console.error("Failed to create note:",c)}},[A,y]);return u(Pe,{selectedNoteId:r,selectedNote:i,notes:t,editorRef:b,onNoteCreated:y,onNoteDeleted:T,onSearch:D,onNoteUpdated:S,onSelectNote:U,onRefresh:E,children:H("div",{ref:w,className:`${v.root}${g?` ${v.rootCompact}`:""}`,children:[u(Ct,{notes:t,selectedId:r,onSelect:U,onCreate:V,searchQuery:a,onSearchChange:f}),u(He,{ref:b,note:i,loading:d,onSave:p})]})})}function Ve(t){const e=yt(t.root);return e.render(u(vt,{windowId:t.windowId,children:u(ft,{miniAppId:t.miniAppId,children:u(Be,{})})})),{deactivate(){e.unmount()}}}export{Ve as activate};
|
|
1991
|
+
//# sourceMappingURL=frontend-WpQng8Mt.js.map
|