@happyvertical/smrt-svelte 0.37.9 → 0.37.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/AGENTS.md +21 -85
  2. package/README.md +14 -10
  3. package/dist/components/workspace/MIGRATION.md +55 -0
  4. package/dist/components/workspace/README.md +22 -25
  5. package/dist/components/workspace/__tests__/AdminShell.test.js +55 -0
  6. package/dist/components/workspace/__tests__/admin-shell-hotkeys.test.js +34 -0
  7. package/dist/components/workspace/__tests__/admin-shell-settings.test.js +25 -0
  8. package/dist/components/workspace/__tests__/admin-shell-state.test.js +110 -0
  9. package/dist/components/workspace/__tests__/index.test.js +15 -24
  10. package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts +2 -1
  11. package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts.map +1 -1
  12. package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.js +1 -1
  13. package/dist/components/workspace/admin-shell/ActivityBadge.svelte +25 -0
  14. package/dist/components/workspace/admin-shell/ActivityBadge.svelte.d.ts +9 -0
  15. package/dist/components/workspace/admin-shell/ActivityBadge.svelte.d.ts.map +1 -0
  16. package/dist/components/workspace/admin-shell/ActivityItem.svelte +85 -0
  17. package/dist/components/workspace/admin-shell/ActivityItem.svelte.d.ts +8 -0
  18. package/dist/components/workspace/admin-shell/ActivityItem.svelte.d.ts.map +1 -0
  19. package/dist/components/workspace/admin-shell/ActivityList.svelte +41 -0
  20. package/dist/components/workspace/admin-shell/ActivityList.svelte.d.ts +10 -0
  21. package/dist/components/workspace/admin-shell/ActivityList.svelte.d.ts.map +1 -0
  22. package/dist/components/workspace/admin-shell/ActivityToasts.svelte +140 -0
  23. package/dist/components/workspace/admin-shell/ActivityToasts.svelte.d.ts +16 -0
  24. package/dist/components/workspace/admin-shell/ActivityToasts.svelte.d.ts.map +1 -0
  25. package/dist/components/workspace/admin-shell/AdminShell.svelte +691 -0
  26. package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts +24 -0
  27. package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts.map +1 -0
  28. package/dist/components/workspace/admin-shell/AppScopePanel.svelte +94 -0
  29. package/dist/components/workspace/admin-shell/AppScopePanel.svelte.d.ts +14 -0
  30. package/dist/components/workspace/admin-shell/AppScopePanel.svelte.d.ts.map +1 -0
  31. package/dist/components/workspace/admin-shell/HotkeyInput.svelte +74 -0
  32. package/dist/components/workspace/admin-shell/HotkeyInput.svelte.d.ts +11 -0
  33. package/dist/components/workspace/admin-shell/HotkeyInput.svelte.d.ts.map +1 -0
  34. package/dist/components/workspace/admin-shell/ShellCorner.svelte +25 -0
  35. package/dist/components/workspace/admin-shell/ShellCorner.svelte.d.ts +9 -0
  36. package/dist/components/workspace/admin-shell/ShellCorner.svelte.d.ts.map +1 -0
  37. package/dist/components/workspace/admin-shell/ShellDockTool.svelte +19 -0
  38. package/dist/components/workspace/admin-shell/ShellDockTool.svelte.d.ts +7 -0
  39. package/dist/components/workspace/admin-shell/ShellDockTool.svelte.d.ts.map +1 -0
  40. package/dist/components/workspace/admin-shell/ShellSettingsPanel.svelte +146 -0
  41. package/dist/components/workspace/admin-shell/ShellSettingsPanel.svelte.d.ts +4 -0
  42. package/dist/components/workspace/admin-shell/ShellSettingsPanel.svelte.d.ts.map +1 -0
  43. package/dist/components/workspace/admin-shell/ShortcutsOverlay.svelte +81 -0
  44. package/dist/components/workspace/admin-shell/ShortcutsOverlay.svelte.d.ts +7 -0
  45. package/dist/components/workspace/admin-shell/ShortcutsOverlay.svelte.d.ts.map +1 -0
  46. package/dist/components/workspace/admin-shell/SystemScopePanel.svelte +118 -0
  47. package/dist/components/workspace/admin-shell/SystemScopePanel.svelte.d.ts +9 -0
  48. package/dist/components/workspace/admin-shell/SystemScopePanel.svelte.d.ts.map +1 -0
  49. package/dist/components/workspace/admin-shell/SystemStatusChips.svelte +71 -0
  50. package/dist/components/workspace/admin-shell/SystemStatusChips.svelte.d.ts +8 -0
  51. package/dist/components/workspace/admin-shell/SystemStatusChips.svelte.d.ts.map +1 -0
  52. package/dist/components/workspace/admin-shell/TenantNav.svelte +101 -0
  53. package/dist/components/workspace/admin-shell/TenantNav.svelte.d.ts +10 -0
  54. package/dist/components/workspace/admin-shell/TenantNav.svelte.d.ts.map +1 -0
  55. package/dist/components/workspace/admin-shell/context.d.ts +6 -0
  56. package/dist/components/workspace/admin-shell/context.d.ts.map +1 -0
  57. package/dist/components/workspace/admin-shell/context.js +16 -0
  58. package/dist/components/workspace/admin-shell/hotkeys.d.ts +14 -0
  59. package/dist/components/workspace/admin-shell/hotkeys.d.ts.map +1 -0
  60. package/dist/components/workspace/admin-shell/hotkeys.js +62 -0
  61. package/dist/components/workspace/admin-shell/settings.d.ts +14 -0
  62. package/dist/components/workspace/admin-shell/settings.d.ts.map +1 -0
  63. package/dist/components/workspace/admin-shell/settings.js +139 -0
  64. package/dist/components/workspace/admin-shell/state.svelte.d.ts +47 -0
  65. package/dist/components/workspace/admin-shell/state.svelte.d.ts.map +1 -0
  66. package/dist/components/workspace/admin-shell/state.svelte.js +252 -0
  67. package/dist/components/workspace/admin-shell/types.d.ts +137 -0
  68. package/dist/components/workspace/admin-shell/types.d.ts.map +1 -0
  69. package/dist/components/workspace/admin-shell/types.js +13 -0
  70. package/dist/components/workspace/index.d.ts +25 -11
  71. package/dist/components/workspace/index.d.ts.map +1 -1
  72. package/dist/components/workspace/index.js +24 -10
  73. package/dist/i18n/strings.workspace.d.ts +30 -0
  74. package/dist/i18n/strings.workspace.d.ts.map +1 -1
  75. package/dist/i18n/strings.workspace.js +31 -0
  76. package/dist/web/__tests__/harness.svelte +25 -0
  77. package/dist/web/__tests__/harness.svelte.d.ts +15 -0
  78. package/dist/web/__tests__/harness.svelte.d.ts.map +1 -0
  79. package/dist/web/__tests__/live-collection.svelte.test.js +184 -0
  80. package/dist/web/index.d.ts +13 -0
  81. package/dist/web/index.d.ts.map +1 -0
  82. package/dist/web/index.js +12 -0
  83. package/dist/web/live-collection.svelte.d.ts +172 -0
  84. package/dist/web/live-collection.svelte.d.ts.map +1 -0
  85. package/dist/web/live-collection.svelte.js +213 -0
  86. package/package.json +13 -4
@@ -0,0 +1,94 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { Badge } from '@happyvertical/smrt-ui/ui';
4
+ import type { Snippet } from 'svelte';
5
+ import { M } from '../../../i18n/strings.workspace.js';
6
+ import ShellSettingsPanel from './ShellSettingsPanel.svelte';
7
+
8
+ interface Props {
9
+ appName: string;
10
+ tenantName?: string;
11
+ environment?: string;
12
+ search?: Snippet;
13
+ docs?: Snippet;
14
+ switcher?: Snippet;
15
+ showSettings?: boolean;
16
+ }
17
+
18
+ let {
19
+ appName,
20
+ tenantName = '',
21
+ environment = '',
22
+ search,
23
+ docs,
24
+ switcher,
25
+ showSettings = true,
26
+ }: Props = $props();
27
+ const { t } = useI18n();
28
+ </script>
29
+
30
+ <section
31
+ class="smrt-app-scope-panel"
32
+ aria-label={t(M['ui.app_scope_panel.app_scope'])}
33
+ >
34
+ <header>
35
+ <div>
36
+ <h2>{appName}</h2>
37
+ {#if tenantName}
38
+ <p>{tenantName}</p>
39
+ {/if}
40
+ </div>
41
+ {#if environment}
42
+ <Badge variant="info" size="sm">{environment}</Badge>
43
+ {/if}
44
+ </header>
45
+
46
+ {#if switcher}
47
+ <div class="smrt-app-scope-panel__section">
48
+ {@render switcher()}
49
+ </div>
50
+ {/if}
51
+
52
+ {#if search}
53
+ <div class="smrt-app-scope-panel__section">
54
+ {@render search()}
55
+ </div>
56
+ {/if}
57
+
58
+ {#if docs}
59
+ <div class="smrt-app-scope-panel__section">
60
+ {@render docs()}
61
+ </div>
62
+ {/if}
63
+
64
+ {#if showSettings}
65
+ <ShellSettingsPanel />
66
+ {/if}
67
+ </section>
68
+
69
+ <style>
70
+ .smrt-app-scope-panel {
71
+ display: grid;
72
+ gap: var(--smrt-spacing-5);
73
+ }
74
+
75
+ .smrt-app-scope-panel header {
76
+ display: flex;
77
+ align-items: flex-start;
78
+ justify-content: space-between;
79
+ gap: var(--smrt-spacing-4);
80
+ }
81
+
82
+ .smrt-app-scope-panel h2,
83
+ .smrt-app-scope-panel p {
84
+ margin: 0;
85
+ }
86
+
87
+ .smrt-app-scope-panel p {
88
+ color: var(--smrt-color-on-surface-variant);
89
+ }
90
+
91
+ .smrt-app-scope-panel__section {
92
+ min-width: 0;
93
+ }
94
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ appName: string;
4
+ tenantName?: string;
5
+ environment?: string;
6
+ search?: Snippet;
7
+ docs?: Snippet;
8
+ switcher?: Snippet;
9
+ showSettings?: boolean;
10
+ }
11
+ declare const AppScopePanel: import("svelte").Component<Props, {}, "">;
12
+ type AppScopePanel = ReturnType<typeof AppScopePanel>;
13
+ export default AppScopePanel;
14
+ //# sourceMappingURL=AppScopePanel.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppScopePanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/AppScopePanel.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA6DD,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { Button } from '@happyvertical/smrt-ui/ui';
4
+ import { M } from '../../../i18n/strings.workspace.js';
5
+ import { formatHotkeyBinding } from './hotkeys.js';
6
+ import type { ShellHotkeyBinding } from './types.js';
7
+
8
+ interface Props {
9
+ value?: ShellHotkeyBinding | null;
10
+ disabled?: boolean;
11
+ conflictsWith?: string | null;
12
+ oncapture?: (binding: ShellHotkeyBinding | null) => void;
13
+ }
14
+
15
+ let {
16
+ value = null,
17
+ disabled = false,
18
+ conflictsWith = null,
19
+ oncapture,
20
+ }: Props = $props();
21
+ const { t } = useI18n();
22
+
23
+ function handleKeydown(event: KeyboardEvent): void {
24
+ if (disabled) return;
25
+ // Let Tab move focus out of the capture control — swallowing it would trap
26
+ // keyboard users on the button. (Tab therefore can't be bound as a hotkey.)
27
+ if (event.key === 'Tab') return;
28
+ event.preventDefault();
29
+ if (event.key === 'Backspace' || event.key === 'Delete') {
30
+ oncapture?.(null);
31
+ return;
32
+ }
33
+ if (!event.code) return;
34
+ oncapture?.({
35
+ code: event.code,
36
+ altKey: event.altKey || undefined,
37
+ ctrlKey: event.ctrlKey || undefined,
38
+ metaKey: event.metaKey || undefined,
39
+ shiftKey: event.shiftKey || undefined,
40
+ });
41
+ }
42
+ </script>
43
+
44
+ <div class="smrt-hotkey-input">
45
+ <Button
46
+ variant="secondary"
47
+ size="sm"
48
+ {disabled}
49
+ onkeydown={handleKeydown}
50
+ title={t(M['ui.hotkey_input.capture_title'])}
51
+ >
52
+ {formatHotkeyBinding(value)}
53
+ </Button>
54
+ {#if conflictsWith}
55
+ <span class="smrt-hotkey-input__conflict">
56
+ {t(M['ui.hotkey_input.conflicts_with'])} {conflictsWith}
57
+ </span>
58
+ {/if}
59
+ </div>
60
+
61
+ <style>
62
+ .smrt-hotkey-input {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: var(--smrt-spacing-2);
66
+ min-width: 0;
67
+ }
68
+
69
+ .smrt-hotkey-input__conflict {
70
+ color: var(--smrt-color-error);
71
+ font-size: var(--smrt-typography-body-small-size);
72
+ overflow-wrap: anywhere;
73
+ }
74
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { ShellHotkeyBinding } from './types.js';
2
+ interface Props {
3
+ value?: ShellHotkeyBinding | null;
4
+ disabled?: boolean;
5
+ conflictsWith?: string | null;
6
+ oncapture?: (binding: ShellHotkeyBinding | null) => void;
7
+ }
8
+ declare const HotkeyInput: import("svelte").Component<Props, {}, "">;
9
+ type HotkeyInput = ReturnType<typeof HotkeyInput>;
10
+ export default HotkeyInput;
11
+ //# sourceMappingURL=HotkeyInput.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotkeyInput.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/HotkeyInput.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;CAC1D;AAqDD,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ side: 'left' | 'right';
6
+ children: Snippet;
7
+ }
8
+
9
+ let { side, children }: Props = $props();
10
+ </script>
11
+
12
+ <div class="smrt-shell-corner" data-side={side}>
13
+ {@render children()}
14
+ </div>
15
+
16
+ <style>
17
+ .smrt-shell-corner {
18
+ inline-size: var(--smrt-admin-shell-left-track);
19
+ min-inline-size: 0;
20
+ }
21
+
22
+ .smrt-shell-corner[data-side='right'] {
23
+ inline-size: var(--smrt-admin-shell-right-track);
24
+ }
25
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ side: 'left' | 'right';
4
+ children: Snippet;
5
+ }
6
+ declare const ShellCorner: import("svelte").Component<Props, {}, "">;
7
+ type ShellCorner = ReturnType<typeof ShellCorner>;
8
+ export default ShellCorner;
9
+ //# sourceMappingURL=ShellCorner.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShellCorner.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/ShellCorner.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAgBD,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { onDestroy, onMount } from 'svelte';
3
+ import { useAdminShell } from './context.js';
4
+ import type { ShellFocusTool } from './types.js';
5
+
6
+ interface Props extends ShellFocusTool {}
7
+
8
+ const shell = useAdminShell();
9
+ const props: Props = $props();
10
+ let unregister: (() => void) | null = null;
11
+
12
+ onMount(() => {
13
+ unregister = shell.registerFocusTool(props);
14
+ });
15
+
16
+ onDestroy(() => {
17
+ unregister?.();
18
+ });
19
+ </script>
@@ -0,0 +1,7 @@
1
+ import type { ShellFocusTool } from './types.js';
2
+ interface Props extends ShellFocusTool {
3
+ }
4
+ declare const ShellDockTool: import("svelte").Component<Props, {}, "">;
5
+ type ShellDockTool = ReturnType<typeof ShellDockTool>;
6
+ export default ShellDockTool;
7
+ //# sourceMappingURL=ShellDockTool.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShellDockTool.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/ShellDockTool.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,UAAU,KAAM,SAAQ,cAAc;CAAG;AAsBzC,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,146 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { Button } from '@happyvertical/smrt-ui/ui';
4
+ import { M } from '../../../i18n/strings.workspace.js';
5
+ import { useAdminShell } from './context.js';
6
+ import HotkeyInput from './HotkeyInput.svelte';
7
+ import { resolveHotkey } from './settings.js';
8
+ import type { PanelEdge, ShellHotkeyBinding } from './types.js';
9
+
10
+ const { t } = useI18n();
11
+ const shell = useAdminShell();
12
+ const edges: PanelEdge[] = ['top', 'left', 'bottom', 'right'];
13
+ const hotkeysEnabled = $derived(shell.settings.hotkeysEnabled !== false);
14
+
15
+ function bindingFor(edge: PanelEdge): ShellHotkeyBinding | null {
16
+ return resolveHotkey(edge, shell.config.panels[edge], shell.settings);
17
+ }
18
+
19
+ function conflictFor(edge: PanelEdge): string | null {
20
+ const binding = bindingFor(edge);
21
+ if (!binding) return null;
22
+ const conflict = edges.find(
23
+ (candidate) =>
24
+ candidate !== edge &&
25
+ bindingFor(candidate)?.code === binding.code &&
26
+ bindingFor(candidate)?.altKey === binding.altKey &&
27
+ bindingFor(candidate)?.ctrlKey === binding.ctrlKey &&
28
+ bindingFor(candidate)?.metaKey === binding.metaKey &&
29
+ bindingFor(candidate)?.shiftKey === binding.shiftKey,
30
+ );
31
+ return conflict ? shell.config.panels[conflict].label : null;
32
+ }
33
+ </script>
34
+
35
+ <section
36
+ class="smrt-shell-settings-panel"
37
+ aria-label={t(M['ui.shell_settings_panel.shell_settings'])}
38
+ >
39
+ <header>
40
+ <div>
41
+ <h2>{t(M['ui.shell_settings_panel.shell_settings'])}</h2>
42
+ <p>{t(M['ui.shell_settings_panel.description'])}</p>
43
+ </div>
44
+ <Button
45
+ variant={hotkeysEnabled ? 'secondary' : 'primary'}
46
+ size="sm"
47
+ onclick={() => shell.setHotkeysEnabled(!hotkeysEnabled)}
48
+ >
49
+ {hotkeysEnabled
50
+ ? t(M['ui.shell_settings_panel.disable_hotkeys'])
51
+ : t(M['ui.shell_settings_panel.enable_hotkeys'])}
52
+ </Button>
53
+ </header>
54
+
55
+ <div class="smrt-shell-settings-panel__grid">
56
+ {#each edges as edge}
57
+ {@const panel = shell.config.panels[edge]}
58
+ {#if shell.panels[edge] !== 'hidden'}
59
+ <div class="smrt-shell-settings-panel__row">
60
+ <div>
61
+ <strong>{panel.label}</strong>
62
+ <span>{shell.panels[edge]}</span>
63
+ </div>
64
+ <div class="smrt-shell-settings-panel__actions">
65
+ <Button
66
+ variant="ghost"
67
+ size="sm"
68
+ onclick={() =>
69
+ shell.setPanel(
70
+ edge,
71
+ shell.panels[edge] === 'expanded'
72
+ ? 'collapsed'
73
+ : 'expanded',
74
+ )}
75
+ >
76
+ {shell.panels[edge] === 'expanded'
77
+ ? t(M['ui.shell_settings_panel.collapse'])
78
+ : t(M['ui.shell_settings_panel.expand'])}
79
+ </Button>
80
+ <HotkeyInput
81
+ value={bindingFor(edge)}
82
+ disabled={!hotkeysEnabled}
83
+ conflictsWith={conflictFor(edge)}
84
+ oncapture={(binding) =>
85
+ shell.setHotkey(edge, binding?.code ?? null)}
86
+ />
87
+ </div>
88
+ </div>
89
+ {/if}
90
+ {/each}
91
+ </div>
92
+ </section>
93
+
94
+ <style>
95
+ .smrt-shell-settings-panel {
96
+ display: grid;
97
+ gap: var(--smrt-spacing-4);
98
+ }
99
+
100
+ .smrt-shell-settings-panel header,
101
+ .smrt-shell-settings-panel__row,
102
+ .smrt-shell-settings-panel__actions {
103
+ display: flex;
104
+ align-items: center;
105
+ gap: var(--smrt-spacing-3);
106
+ }
107
+
108
+ .smrt-shell-settings-panel header,
109
+ .smrt-shell-settings-panel__row {
110
+ justify-content: space-between;
111
+ }
112
+
113
+ .smrt-shell-settings-panel h2,
114
+ .smrt-shell-settings-panel p {
115
+ margin: 0;
116
+ }
117
+
118
+ .smrt-shell-settings-panel p,
119
+ .smrt-shell-settings-panel span {
120
+ color: var(--smrt-color-on-surface-variant);
121
+ }
122
+
123
+ .smrt-shell-settings-panel__grid {
124
+ display: grid;
125
+ gap: var(--smrt-spacing-3);
126
+ }
127
+
128
+ .smrt-shell-settings-panel__row {
129
+ padding-block: var(--smrt-spacing-3);
130
+ border-block-start: 1px solid var(--smrt-color-outline-variant);
131
+ }
132
+
133
+ .smrt-shell-settings-panel__row > div:first-child {
134
+ display: grid;
135
+ gap: var(--smrt-spacing-1);
136
+ }
137
+
138
+ @media (max-width: 42rem) {
139
+ .smrt-shell-settings-panel header,
140
+ .smrt-shell-settings-panel__row,
141
+ .smrt-shell-settings-panel__actions {
142
+ align-items: stretch;
143
+ flex-direction: column;
144
+ }
145
+ }
146
+ </style>
@@ -0,0 +1,4 @@
1
+ declare const ShellSettingsPanel: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type ShellSettingsPanel = ReturnType<typeof ShellSettingsPanel>;
3
+ export default ShellSettingsPanel;
4
+ //# sourceMappingURL=ShellSettingsPanel.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShellSettingsPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/ShellSettingsPanel.svelte.ts"],"names":[],"mappings":"AA4FA,QAAA,MAAM,kBAAkB,2DAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,81 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { Button } from '@happyvertical/smrt-ui/ui';
4
+ import { M } from '../../../i18n/strings.workspace.js';
5
+ import { useAdminShell } from './context.js';
6
+ import { formatHotkeyBinding } from './hotkeys.js';
7
+ import { resolveHotkey } from './settings.js';
8
+ import type { PanelEdge } from './types.js';
9
+
10
+ interface Props {
11
+ onclose?: () => void;
12
+ }
13
+
14
+ let { onclose }: Props = $props();
15
+ const { t } = useI18n();
16
+ const shell = useAdminShell();
17
+ const edges: PanelEdge[] = ['top', 'left', 'bottom', 'right'];
18
+ </script>
19
+
20
+ <section
21
+ class="smrt-shortcuts-overlay"
22
+ aria-label={t(M['ui.admin_shell.shell_shortcuts'])}
23
+ >
24
+ <header>
25
+ <h2>{t(M['ui.admin_shell.shell_shortcuts'])}</h2>
26
+ <Button
27
+ variant="ghost"
28
+ size="sm"
29
+ aria-label={t(M['ui.admin_shell.close_shortcuts'])}
30
+ onclick={() => onclose?.()}
31
+ >
32
+ {t(M['ui.shortcuts_overlay.close'])}
33
+ </Button>
34
+ </header>
35
+ <dl>
36
+ {#each edges as edge}
37
+ <div>
38
+ <dt>{shell.config.panels[edge].label}</dt>
39
+ <dd>
40
+ {formatHotkeyBinding(
41
+ resolveHotkey(edge, shell.config.panels[edge], shell.settings),
42
+ )}
43
+ </dd>
44
+ </div>
45
+ {/each}
46
+ <div>
47
+ <dt>{t(M['ui.shortcuts_overlay.open_shortcuts'])}</dt>
48
+ <dd>?</dd>
49
+ </div>
50
+ <div>
51
+ <dt>{t(M['ui.shortcuts_overlay.close_drawer'])}</dt>
52
+ <dd>{t(M['ui.shortcuts_overlay.escape'])}</dd>
53
+ </div>
54
+ </dl>
55
+ </section>
56
+
57
+ <style>
58
+ .smrt-shortcuts-overlay {
59
+ display: grid;
60
+ gap: var(--smrt-spacing-4);
61
+ }
62
+
63
+ .smrt-shortcuts-overlay header,
64
+ .smrt-shortcuts-overlay div {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: space-between;
68
+ gap: var(--smrt-spacing-4);
69
+ }
70
+
71
+ .smrt-shortcuts-overlay h2,
72
+ .smrt-shortcuts-overlay dl,
73
+ .smrt-shortcuts-overlay dd {
74
+ margin: 0;
75
+ }
76
+
77
+ .smrt-shortcuts-overlay dl {
78
+ display: grid;
79
+ gap: var(--smrt-spacing-3);
80
+ }
81
+ </style>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ onclose?: () => void;
3
+ }
4
+ declare const ShortcutsOverlay: import("svelte").Component<Props, {}, "">;
5
+ type ShortcutsOverlay = ReturnType<typeof ShortcutsOverlay>;
6
+ export default ShortcutsOverlay;
7
+ //# sourceMappingURL=ShortcutsOverlay.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutsOverlay.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/ShortcutsOverlay.svelte.ts"],"names":[],"mappings":"AAYA,UAAU,KAAK;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAkDD,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,118 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { M } from '../../../i18n/strings.workspace.js';
4
+ import ActivityList from './ActivityList.svelte';
5
+ import type { ShellSystemPanel } from './types.js';
6
+
7
+ interface Props {
8
+ panels: ShellSystemPanel[];
9
+ showActivities?: boolean;
10
+ }
11
+
12
+ let { panels, showActivities = true }: Props = $props();
13
+ const { t } = useI18n();
14
+ </script>
15
+
16
+ <section
17
+ class="smrt-system-scope-panel"
18
+ aria-label={t(M['ui.system_scope_panel.system_scope'])}
19
+ >
20
+ {#each panels as panel (panel.id)}
21
+ <section class="smrt-system-scope-panel__group" aria-label={panel.label}>
22
+ <header>
23
+ <h2>{panel.label}</h2>
24
+ <span>{panel.items.length}</span>
25
+ </header>
26
+ {#if panel.items.length > 0}
27
+ <div class="smrt-system-scope-panel__items">
28
+ {#each panel.items as item (item.id)}
29
+ <svelte:element
30
+ this={item.href ? 'a' : 'span'}
31
+ href={item.href ?? undefined}
32
+ class="smrt-system-scope-panel__item"
33
+ aria-disabled={item.href ? undefined : 'true'}
34
+ >
35
+ <strong>{item.label}</strong>
36
+ <span>{item.status}</span>
37
+ {#if item.detail}
38
+ <small>{item.detail}</small>
39
+ {/if}
40
+ </svelte:element>
41
+ {/each}
42
+ </div>
43
+ {:else}
44
+ <p>No {panel.label.toLowerCase()}</p>
45
+ {/if}
46
+ </section>
47
+ {/each}
48
+
49
+ {#if showActivities}
50
+ <section
51
+ class="smrt-system-scope-panel__group"
52
+ aria-label={t(M['ui.system_scope_panel.activities'])}
53
+ >
54
+ <header>
55
+ <h2>{t(M['ui.system_scope_panel.activities'])}</h2>
56
+ </header>
57
+ <ActivityList
58
+ filter={{ edge: 'bottom' }}
59
+ emptyLabel={t(M['ui.system_scope_panel.no_running_work'])}
60
+ />
61
+ </section>
62
+ {/if}
63
+ </section>
64
+
65
+ <style>
66
+ .smrt-system-scope-panel {
67
+ display: grid;
68
+ gap: var(--smrt-spacing-5);
69
+ }
70
+
71
+ .smrt-system-scope-panel__group,
72
+ .smrt-system-scope-panel__items {
73
+ display: grid;
74
+ gap: var(--smrt-spacing-2);
75
+ }
76
+
77
+ .smrt-system-scope-panel__group header {
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: space-between;
81
+ gap: var(--smrt-spacing-3);
82
+ }
83
+
84
+ .smrt-system-scope-panel h2,
85
+ .smrt-system-scope-panel p {
86
+ margin: 0;
87
+ }
88
+
89
+ .smrt-system-scope-panel p,
90
+ .smrt-system-scope-panel small,
91
+ .smrt-system-scope-panel__group header span {
92
+ color: var(--smrt-color-on-surface-variant);
93
+ }
94
+
95
+ .smrt-system-scope-panel__item {
96
+ display: grid;
97
+ grid-template-columns: minmax(0, 1fr) auto;
98
+ gap: var(--smrt-spacing-1) var(--smrt-spacing-3);
99
+ padding: var(--smrt-spacing-3) 0;
100
+ border-block-start: 1px solid var(--smrt-color-outline-variant);
101
+ color: var(--smrt-color-on-surface);
102
+ text-decoration: none;
103
+ }
104
+
105
+ .smrt-system-scope-panel__item[aria-disabled='true'] {
106
+ color: var(--smrt-color-on-surface-variant);
107
+ cursor: default;
108
+ }
109
+
110
+ .smrt-system-scope-panel__items strong,
111
+ .smrt-system-scope-panel__items small {
112
+ overflow-wrap: anywhere;
113
+ }
114
+
115
+ .smrt-system-scope-panel__items small {
116
+ grid-column: 1 / -1;
117
+ }
118
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { ShellSystemPanel } from './types.js';
2
+ interface Props {
3
+ panels: ShellSystemPanel[];
4
+ showActivities?: boolean;
5
+ }
6
+ declare const SystemScopePanel: import("svelte").Component<Props, {}, "">;
7
+ type SystemScopePanel = ReturnType<typeof SystemScopePanel>;
8
+ export default SystemScopePanel;
9
+ //# sourceMappingURL=SystemScopePanel.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemScopePanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/SystemScopePanel.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,UAAU,KAAK;IACb,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAmDD,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}