@happyvertical/smrt-svelte 0.55.6 → 0.55.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +17 -2
- package/README.md +83 -4
- package/agents/workspace.md +202 -5
- package/dist/browser-ai/adapters/stt/dictation-source.d.ts.map +1 -1
- package/dist/browser-ai/adapters/stt/dictation-source.js +8 -2
- package/dist/browser-ai/adapters/stt/factory.d.ts +6 -3
- package/dist/browser-ai/adapters/stt/factory.d.ts.map +1 -1
- package/dist/browser-ai/adapters/stt/factory.js +19 -9
- package/dist/browser-ai/adapters/stt/index.d.ts +3 -1
- package/dist/browser-ai/adapters/stt/index.d.ts.map +1 -1
- package/dist/browser-ai/adapters/stt/index.js +3 -1
- package/dist/browser-ai/adapters/stt/local-speech-model.d.ts +111 -0
- package/dist/browser-ai/adapters/stt/local-speech-model.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/local-speech-model.js +377 -0
- package/dist/browser-ai/adapters/stt/local-speech.d.ts +82 -0
- package/dist/browser-ai/adapters/stt/local-speech.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/local-speech.js +317 -0
- package/dist/browser-ai/adapters/stt/local-speech.worker.d.ts +2 -0
- package/dist/browser-ai/adapters/stt/local-speech.worker.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/local-speech.worker.js +32 -0
- package/dist/browser-ai/adapters/stt/transformers-env.d.ts +8 -0
- package/dist/browser-ai/adapters/stt/transformers-env.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/transformers-env.js +17 -0
- package/dist/browser-ai/adapters/stt/types.d.ts +54 -9
- package/dist/browser-ai/adapters/stt/types.d.ts.map +1 -1
- package/dist/browser-ai/capabilities/speech-probe.d.ts +29 -0
- package/dist/browser-ai/capabilities/speech-probe.d.ts.map +1 -0
- package/dist/browser-ai/capabilities/speech-probe.js +19 -0
- package/dist/browser-ai/core/errors.d.ts +9 -0
- package/dist/browser-ai/core/errors.d.ts.map +1 -1
- package/dist/browser-ai/core/errors.js +12 -0
- package/dist/browser-ai/index.d.ts +1 -0
- package/dist/browser-ai/index.d.ts.map +1 -1
- package/dist/browser-ai/index.js +1 -0
- package/dist/components/app/AppShell.svelte +587 -33
- package/dist/components/app/AppShell.svelte.d.ts +75 -4
- package/dist/components/app/AppShell.svelte.d.ts.map +1 -1
- package/dist/components/app/DockToggles.svelte +0 -1
- package/dist/components/app/dock-toggle.d.ts +7 -1
- package/dist/components/app/dock-toggle.d.ts.map +1 -1
- package/dist/components/app/index.d.ts +2 -1
- package/dist/components/app/index.d.ts.map +1 -1
- package/dist/components/app/slot-item.d.ts +21 -0
- package/dist/components/app/slot-item.d.ts.map +1 -0
- package/dist/components/app/slot-item.js +1 -0
- package/dist/components/forms/AddressInput.svelte +2 -15
- package/dist/components/forms/AddressInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/DateRangeInput.svelte +2 -15
- package/dist/components/forms/DateRangeInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/DateTimeInput.svelte +8 -15
- package/dist/components/forms/DateTimeInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/MeasurementInput.svelte +2 -15
- package/dist/components/forms/MeasurementInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/MoneyInput.svelte +8 -25
- package/dist/components/forms/MoneyInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/NumberInput.svelte +7 -15
- package/dist/components/forms/NumberInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/PhoneInput.svelte +7 -15
- package/dist/components/forms/PhoneInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/SelectInput.svelte +34 -40
- package/dist/components/forms/SelectInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/TextInput.svelte +20 -37
- package/dist/components/forms/TextInput.svelte.d.ts.map +1 -1
- package/dist/components/forms/TextareaInput.svelte +19 -35
- package/dist/components/forms/TextareaInput.svelte.d.ts.map +1 -1
- package/dist/components/sortable/Sortable.svelte +6 -33
- package/dist/components/sortable/Sortable.svelte.d.ts.map +1 -1
- package/dist/components/sortable/announce.d.ts +5 -0
- package/dist/components/sortable/announce.d.ts.map +1 -0
- package/dist/components/sortable/announce.js +33 -0
- package/dist/components/workspace/admin-shell/AdminShell.svelte +424 -58
- package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts +27 -2
- package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/ShellBrand.svelte +86 -0
- package/dist/components/workspace/admin-shell/ShellBrand.svelte.d.ts +18 -0
- package/dist/components/workspace/admin-shell/ShellBrand.svelte.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/ShellIconButton.svelte +77 -0
- package/dist/components/workspace/admin-shell/ShellIconButton.svelte.d.ts +26 -0
- package/dist/components/workspace/admin-shell/ShellIconButton.svelte.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/ShellLayoutEditor.svelte +88 -16
- package/dist/components/workspace/admin-shell/ShellLayoutEditor.svelte.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/ShellNavEditor.svelte +531 -0
- package/dist/components/workspace/admin-shell/ShellNavEditor.svelte.d.ts +26 -0
- package/dist/components/workspace/admin-shell/ShellNavEditor.svelte.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/ShellSectionIcon.svelte +57 -0
- package/dist/components/workspace/admin-shell/ShellSectionIcon.svelte.d.ts +22 -0
- package/dist/components/workspace/admin-shell/ShellSectionIcon.svelte.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/ShellSectionMenu.svelte +290 -0
- package/dist/components/workspace/admin-shell/ShellSectionMenu.svelte.d.ts +32 -0
- package/dist/components/workspace/admin-shell/ShellSectionMenu.svelte.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/TenantNav.svelte +67 -2
- package/dist/components/workspace/admin-shell/TenantNav.svelte.d.ts +8 -0
- package/dist/components/workspace/admin-shell/TenantNav.svelte.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/layout-controller.svelte.d.ts +67 -0
- package/dist/components/workspace/admin-shell/layout-controller.svelte.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/layout-controller.svelte.js +129 -1
- package/dist/components/workspace/admin-shell/layout.d.ts +122 -0
- package/dist/components/workspace/admin-shell/layout.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/layout.js +410 -10
- package/dist/components/workspace/admin-shell/settings.js +4 -4
- package/dist/components/workspace/admin-shell/shell-icons.d.ts +45 -0
- package/dist/components/workspace/admin-shell/shell-icons.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/shell-icons.js +66 -0
- package/dist/components/workspace/admin-shell/slot-labels.d.ts +33 -0
- package/dist/components/workspace/admin-shell/slot-labels.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/slot-labels.js +33 -0
- package/dist/components/workspace/admin-shell/slots.d.ts +50 -0
- package/dist/components/workspace/admin-shell/slots.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/slots.js +77 -0
- package/dist/components/workspace/admin-shell/state.svelte.d.ts +35 -0
- package/dist/components/workspace/admin-shell/state.svelte.d.ts.map +1 -1
- package/dist/components/workspace/admin-shell/state.svelte.js +111 -0
- package/dist/components/workspace/admin-shell/types.d.ts +101 -1
- package/dist/components/workspace/admin-shell/types.d.ts.map +1 -1
- package/dist/components/workspace/index.d.ts +9 -2
- package/dist/components/workspace/index.d.ts.map +1 -1
- package/dist/components/workspace/index.js +6 -0
- package/dist/i18n/strings.workspace.d.ts +49 -0
- package/dist/i18n/strings.workspace.d.ts.map +1 -1
- package/dist/i18n/strings.workspace.js +49 -0
- package/package.json +30 -19
- package/dist/browser-ai/adapters/stt/whisper-wasm.d.ts +0 -51
- package/dist/browser-ai/adapters/stt/whisper-wasm.d.ts.map +0 -1
- package/dist/browser-ai/adapters/stt/whisper-wasm.js +0 -380
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filled 24x24 icon paths used by the layout-editing chrome (the same
|
|
3
|
+
* convention as `@happyvertical/smrt-ui`'s `Icon`, which fills one path).
|
|
4
|
+
*/
|
|
5
|
+
export const SHELL_ICON_PATHS = {
|
|
6
|
+
edit: 'M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z',
|
|
7
|
+
undo: 'M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z',
|
|
8
|
+
done: 'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z',
|
|
9
|
+
eye: 'M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z',
|
|
10
|
+
eyeOff: 'M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z',
|
|
11
|
+
heading: 'M5 4v3h5.5v12h3V7H19V4z',
|
|
12
|
+
headingOff: 'M5 4v3h5.5v12h3V7H19V4zM3.5 2.5L2.1 3.9l18 18 1.4-1.4z',
|
|
13
|
+
trash: 'M7 3h10v2h4v2H3V5h4V3zm-2 6h14v12H5V9zm4 2v8h2v-8H9zm4 0v8h2v-8h-2z',
|
|
14
|
+
add: 'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z',
|
|
15
|
+
more: 'M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z',
|
|
16
|
+
settings: 'M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z',
|
|
17
|
+
calendar: 'M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z',
|
|
18
|
+
users: 'M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z',
|
|
19
|
+
shoppingBag: 'M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-8 4c0 .55-.45 1-1 1s-1-.45-1-1V8h2v2zm2-6c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2zm4 6c0 .55-.45 1-1 1s-1-.45-1-1V8h2v2z',
|
|
20
|
+
receipt: 'M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z',
|
|
21
|
+
book: 'M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1zm0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5v11.5z',
|
|
22
|
+
briefcase: 'M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z',
|
|
23
|
+
truck: 'M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z',
|
|
24
|
+
package: 'M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2zm-5 12H9v-2h6v2zm5-7H4V4h16v3z',
|
|
25
|
+
wrench: 'M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z',
|
|
26
|
+
fileText: 'M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z',
|
|
27
|
+
layers: 'M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z',
|
|
28
|
+
folder: 'M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z',
|
|
29
|
+
bank: 'M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z',
|
|
30
|
+
creditCard: 'M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z',
|
|
31
|
+
school: 'M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z',
|
|
32
|
+
home: 'M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z',
|
|
33
|
+
repeat: 'M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z',
|
|
34
|
+
tag: 'M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z',
|
|
35
|
+
archive: 'M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z',
|
|
36
|
+
chevronRight: 'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z',
|
|
37
|
+
};
|
|
38
|
+
/** Section icon used when neither the host nor the user chose one. */
|
|
39
|
+
export const SHELL_DEFAULT_SECTION_ICON = 'folder';
|
|
40
|
+
/** Icons the section icon picker offers (a subset of the shell icon set). */
|
|
41
|
+
export const SHELL_SECTION_ICONS = [
|
|
42
|
+
'folder',
|
|
43
|
+
'home',
|
|
44
|
+
'calendar',
|
|
45
|
+
'users',
|
|
46
|
+
'school',
|
|
47
|
+
'shoppingBag',
|
|
48
|
+
'truck',
|
|
49
|
+
'package',
|
|
50
|
+
'receipt',
|
|
51
|
+
'creditCard',
|
|
52
|
+
'bank',
|
|
53
|
+
'book',
|
|
54
|
+
'fileText',
|
|
55
|
+
'briefcase',
|
|
56
|
+
'wrench',
|
|
57
|
+
'layers',
|
|
58
|
+
'repeat',
|
|
59
|
+
'tag',
|
|
60
|
+
'archive',
|
|
61
|
+
'settings',
|
|
62
|
+
];
|
|
63
|
+
/** True when `name` is one of the shell's built-in icon names. */
|
|
64
|
+
export function isShellIconName(name) {
|
|
65
|
+
return Object.hasOwn(SHELL_ICON_PATHS, name);
|
|
66
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Message for each slot's full user-facing name (e.g. "Header, left"). */
|
|
2
|
+
export declare const SHELL_SLOT_MESSAGES: {
|
|
3
|
+
readonly 'header.start': "ui.shell_slot.header_start";
|
|
4
|
+
readonly 'header.center': "ui.shell_slot.header_center";
|
|
5
|
+
readonly 'header.end': "ui.shell_slot.header_end";
|
|
6
|
+
readonly 'footer.start': "ui.shell_slot.footer_start";
|
|
7
|
+
readonly 'footer.center': "ui.shell_slot.footer_center";
|
|
8
|
+
readonly 'footer.end': "ui.shell_slot.footer_end";
|
|
9
|
+
readonly 'leftSidebar.header': "ui.shell_slot.left_sidebar_header";
|
|
10
|
+
readonly 'leftSidebar.footer': "ui.shell_slot.left_sidebar_footer";
|
|
11
|
+
readonly 'rightSidebar.header': "ui.shell_slot.right_sidebar_header";
|
|
12
|
+
readonly 'rightSidebar.footer': "ui.shell_slot.right_sidebar_footer";
|
|
13
|
+
};
|
|
14
|
+
/** Message for a slot's short name within its region (e.g. "Left"). */
|
|
15
|
+
export declare const SHELL_SLOT_SHORT_MESSAGES: {
|
|
16
|
+
readonly 'header.start': "ui.shell_slot.short_header_start";
|
|
17
|
+
readonly 'header.center': "ui.shell_slot.short_header_center";
|
|
18
|
+
readonly 'header.end': "ui.shell_slot.short_header_end";
|
|
19
|
+
readonly 'footer.start': "ui.shell_slot.short_footer_start";
|
|
20
|
+
readonly 'footer.center': "ui.shell_slot.short_footer_center";
|
|
21
|
+
readonly 'footer.end': "ui.shell_slot.short_footer_end";
|
|
22
|
+
readonly 'leftSidebar.header': "ui.shell_slot.short_sidebar_header";
|
|
23
|
+
readonly 'leftSidebar.footer': "ui.shell_slot.short_sidebar_footer";
|
|
24
|
+
readonly 'rightSidebar.header': "ui.shell_slot.short_sidebar_header";
|
|
25
|
+
readonly 'rightSidebar.footer': "ui.shell_slot.short_sidebar_footer";
|
|
26
|
+
};
|
|
27
|
+
export declare const SHELL_REGION_MESSAGES: {
|
|
28
|
+
readonly header: "ui.shell_region.header";
|
|
29
|
+
readonly leftSidebar: "ui.shell_region.left_sidebar";
|
|
30
|
+
readonly rightSidebar: "ui.shell_region.right_sidebar";
|
|
31
|
+
readonly footer: "ui.shell_region.footer";
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=slot-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-labels.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/slot-labels.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAWe,CAAC;AAEhD,uEAAuE;AACvE,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAWS,CAAC;AAEhD,eAAO,MAAM,qBAAqB;;;;;CAKe,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { M } from '../../../i18n/strings.workspace.js';
|
|
2
|
+
/** Message for each slot's full user-facing name (e.g. "Header, left"). */
|
|
3
|
+
export const SHELL_SLOT_MESSAGES = {
|
|
4
|
+
'header.start': M['ui.shell_slot.header_start'],
|
|
5
|
+
'header.center': M['ui.shell_slot.header_center'],
|
|
6
|
+
'header.end': M['ui.shell_slot.header_end'],
|
|
7
|
+
'footer.start': M['ui.shell_slot.footer_start'],
|
|
8
|
+
'footer.center': M['ui.shell_slot.footer_center'],
|
|
9
|
+
'footer.end': M['ui.shell_slot.footer_end'],
|
|
10
|
+
'leftSidebar.header': M['ui.shell_slot.left_sidebar_header'],
|
|
11
|
+
'leftSidebar.footer': M['ui.shell_slot.left_sidebar_footer'],
|
|
12
|
+
'rightSidebar.header': M['ui.shell_slot.right_sidebar_header'],
|
|
13
|
+
'rightSidebar.footer': M['ui.shell_slot.right_sidebar_footer'],
|
|
14
|
+
};
|
|
15
|
+
/** Message for a slot's short name within its region (e.g. "Left"). */
|
|
16
|
+
export const SHELL_SLOT_SHORT_MESSAGES = {
|
|
17
|
+
'header.start': M['ui.shell_slot.short_header_start'],
|
|
18
|
+
'header.center': M['ui.shell_slot.short_header_center'],
|
|
19
|
+
'header.end': M['ui.shell_slot.short_header_end'],
|
|
20
|
+
'footer.start': M['ui.shell_slot.short_footer_start'],
|
|
21
|
+
'footer.center': M['ui.shell_slot.short_footer_center'],
|
|
22
|
+
'footer.end': M['ui.shell_slot.short_footer_end'],
|
|
23
|
+
'leftSidebar.header': M['ui.shell_slot.short_sidebar_header'],
|
|
24
|
+
'leftSidebar.footer': M['ui.shell_slot.short_sidebar_footer'],
|
|
25
|
+
'rightSidebar.header': M['ui.shell_slot.short_sidebar_header'],
|
|
26
|
+
'rightSidebar.footer': M['ui.shell_slot.short_sidebar_footer'],
|
|
27
|
+
};
|
|
28
|
+
export const SHELL_REGION_MESSAGES = {
|
|
29
|
+
header: M['ui.shell_region.header'],
|
|
30
|
+
leftSidebar: M['ui.shell_region.left_sidebar'],
|
|
31
|
+
rightSidebar: M['ui.shell_region.right_sidebar'],
|
|
32
|
+
footer: M['ui.shell_region.footer'],
|
|
33
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell regions and slots.
|
|
3
|
+
*
|
|
4
|
+
* Regions are the four edges: header (top), left sidebar, right sidebar and
|
|
5
|
+
* footer (bottom). Header and footer have `start | center | end` slots;
|
|
6
|
+
* sidebars have `header | footer` slots around their main area.
|
|
7
|
+
*/
|
|
8
|
+
export type ShellSlot = 'header.start' | 'header.center' | 'header.end' | 'footer.start' | 'footer.center' | 'footer.end' | 'leftSidebar.header' | 'leftSidebar.footer' | 'rightSidebar.header' | 'rightSidebar.footer';
|
|
9
|
+
export declare const SHELL_SLOTS: readonly ShellSlot[];
|
|
10
|
+
/** The region a slot lives in. */
|
|
11
|
+
export type ShellRegion = 'header' | 'footer' | 'leftSidebar' | 'rightSidebar';
|
|
12
|
+
export declare function slotRegion(slot: ShellSlot): ShellRegion;
|
|
13
|
+
/**
|
|
14
|
+
* Fallback chain used when a slot's region is not visible (hidden, or a
|
|
15
|
+
* sidebar that is collapsed). The first visible slot wins; nothing is
|
|
16
|
+
* dropped and no extra row is ever created.
|
|
17
|
+
*
|
|
18
|
+
* - header.X -> leftSidebar.header, rightSidebar.header, footer.X
|
|
19
|
+
* - footer.X -> leftSidebar.footer, rightSidebar.footer, header.X
|
|
20
|
+
* - leftSidebar.header -> header.start, rightSidebar.header, footer.start
|
|
21
|
+
* - leftSidebar.footer -> footer.start, header.start, rightSidebar.footer
|
|
22
|
+
* - rightSidebar.header -> header.end, leftSidebar.header, footer.end
|
|
23
|
+
* - rightSidebar.footer -> footer.end, header.end, leftSidebar.footer
|
|
24
|
+
*/
|
|
25
|
+
export declare function slotFallbackChain(slot: ShellSlot): ShellSlot[];
|
|
26
|
+
/** First slot in `[slot, ...fallbacks]` whose region is visible. */
|
|
27
|
+
export declare function resolveSlot(slot: ShellSlot, visible: (region: ShellRegion) => boolean): ShellSlot | null;
|
|
28
|
+
/** Prefix of the stable id of a dock toggle item: `dock:<tool>`. */
|
|
29
|
+
export declare const SHELL_DOCK_ITEM_PREFIX = "dock:";
|
|
30
|
+
/** Prefix of the stable id of a host `slots` snippet item: `slot:<slot>`. */
|
|
31
|
+
export declare const SHELL_HOST_SLOT_ITEM_PREFIX = "slot:";
|
|
32
|
+
/** Stable item id of the dock toggle for `tool`. */
|
|
33
|
+
export declare function shellDockItemId(tool: string): string;
|
|
34
|
+
/** Stable item id of the host's `slots[slot]` snippet. */
|
|
35
|
+
export declare function shellHostSlotItemId(slot: ShellSlot): string;
|
|
36
|
+
/** Whether a value is a known {@link ShellSlot}. */
|
|
37
|
+
export declare function isShellSlot(value: unknown): value is ShellSlot;
|
|
38
|
+
/**
|
|
39
|
+
* An item that lives in a slot and can be moved to another one. `slot` is the
|
|
40
|
+
* default placement; a user's `ShellLayout.placements` overrides it.
|
|
41
|
+
*/
|
|
42
|
+
export interface ShellPlacementItem {
|
|
43
|
+
/** Stable id, e.g. `dock:assistant`, `slot:header.end`, or a host id. */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Accessible, user-facing name. */
|
|
46
|
+
label: string;
|
|
47
|
+
/** Where the item lives unless the layout moves it. */
|
|
48
|
+
slot: ShellSlot;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/slots.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,cAAc,GACd,eAAe,GACf,YAAY,GACZ,oB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leftSidebar.header',
|
|
9
|
+
'leftSidebar.footer',
|
|
10
|
+
'rightSidebar.header',
|
|
11
|
+
'rightSidebar.footer',
|
|
12
|
+
];
|
|
13
|
+
export function slotRegion(slot) {
|
|
14
|
+
return slot.split('.')[0];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fallback chain used when a slot's region is not visible (hidden, or a
|
|
18
|
+
* sidebar that is collapsed). The first visible slot wins; nothing is
|
|
19
|
+
* dropped and no extra row is ever created.
|
|
20
|
+
*
|
|
21
|
+
* - header.X -> leftSidebar.header, rightSidebar.header, footer.X
|
|
22
|
+
* - footer.X -> leftSidebar.footer, rightSidebar.footer, header.X
|
|
23
|
+
* - leftSidebar.header -> header.start, rightSidebar.header, footer.start
|
|
24
|
+
* - leftSidebar.footer -> footer.start, header.start, rightSidebar.footer
|
|
25
|
+
* - rightSidebar.header -> header.end, leftSidebar.header, footer.end
|
|
26
|
+
* - rightSidebar.footer -> footer.end, header.end, leftSidebar.footer
|
|
27
|
+
*/
|
|
28
|
+
export function slotFallbackChain(slot) {
|
|
29
|
+
const [region, part] = slot.split('.');
|
|
30
|
+
switch (region) {
|
|
31
|
+
case 'header':
|
|
32
|
+
return [
|
|
33
|
+
'leftSidebar.header',
|
|
34
|
+
'rightSidebar.header',
|
|
35
|
+
`footer.${part}`,
|
|
36
|
+
];
|
|
37
|
+
case 'footer':
|
|
38
|
+
return [
|
|
39
|
+
'leftSidebar.footer',
|
|
40
|
+
'rightSidebar.footer',
|
|
41
|
+
`header.${part}`,
|
|
42
|
+
];
|
|
43
|
+
case 'leftSidebar':
|
|
44
|
+
return part === 'header'
|
|
45
|
+
? ['header.start', 'rightSidebar.header', 'footer.start']
|
|
46
|
+
: ['footer.start', 'header.start', 'rightSidebar.footer'];
|
|
47
|
+
case 'rightSidebar':
|
|
48
|
+
return part === 'header'
|
|
49
|
+
? ['header.end', 'leftSidebar.header', 'footer.end']
|
|
50
|
+
: ['footer.end', 'header.end', 'leftSidebar.footer'];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** First slot in `[slot, ...fallbacks]` whose region is visible. */
|
|
54
|
+
export function resolveSlot(slot, visible) {
|
|
55
|
+
for (const candidate of [slot, ...slotFallbackChain(slot)]) {
|
|
56
|
+
if (visible(slotRegion(candidate)))
|
|
57
|
+
return candidate;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
/** Prefix of the stable id of a dock toggle item: `dock:<tool>`. */
|
|
62
|
+
export const SHELL_DOCK_ITEM_PREFIX = 'dock:';
|
|
63
|
+
/** Prefix of the stable id of a host `slots` snippet item: `slot:<slot>`. */
|
|
64
|
+
export const SHELL_HOST_SLOT_ITEM_PREFIX = 'slot:';
|
|
65
|
+
/** Stable item id of the dock toggle for `tool`. */
|
|
66
|
+
export function shellDockItemId(tool) {
|
|
67
|
+
return `${SHELL_DOCK_ITEM_PREFIX}${tool}`;
|
|
68
|
+
}
|
|
69
|
+
/** Stable item id of the host's `slots[slot]` snippet. */
|
|
70
|
+
export function shellHostSlotItemId(slot) {
|
|
71
|
+
return `${SHELL_HOST_SLOT_ITEM_PREFIX}${slot}`;
|
|
72
|
+
}
|
|
73
|
+
/** Whether a value is a known {@link ShellSlot}. */
|
|
74
|
+
export function isShellSlot(value) {
|
|
75
|
+
return (typeof value === 'string' &&
|
|
76
|
+
SHELL_SLOTS.includes(value));
|
|
77
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ShellLayout, type ShellLayoutPanel } from './layout.js';
|
|
2
|
+
import type { ShellRegion } from './slots.js';
|
|
2
3
|
import type { PanelEdge, PanelPresentation, PanelState, PhonePanelPresentation, ResolvedShellConfig, ShellActivity, ShellActivityBadge, ShellActivityEvent, ShellActivityFilter, ShellDockOpenOptions, ShellFocusTool, ShellPanelDefaults, ShellPanelResize, ShellScope, ShellSettingsAdapter, ShellSettingsDelta, ShellStateSnapshot, ShellViewport, VisiblePanelState } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Phones: up to 48rem (768px itself is a phone). The same boundary the
|
|
@@ -25,6 +26,8 @@ export declare class ShellState {
|
|
|
25
26
|
readonly config: ResolvedShellConfig;
|
|
26
27
|
readonly adapter: ShellSettingsAdapter | null;
|
|
27
28
|
settings: ShellSettingsDelta;
|
|
29
|
+
/** Edges opened for now only (never written to the settings). */
|
|
30
|
+
private revealed;
|
|
28
31
|
panels: Record<PanelEdge, PanelState>;
|
|
29
32
|
/** Width class the shell is laid out for; `AdminShell` keeps it current. */
|
|
30
33
|
viewport: ShellViewport;
|
|
@@ -49,6 +52,14 @@ export declare class ShellState {
|
|
|
49
52
|
* is the state it starts in. Set it through `setLayoutPanels`.
|
|
50
53
|
*/
|
|
51
54
|
layoutPanels: Partial<Record<PanelEdge, ShellLayoutPanel>>;
|
|
55
|
+
/**
|
|
56
|
+
* Edges laid out inline rather than as a toggled drop-down (`AdminShell`
|
|
57
|
+
* `edgeToggles` off for the edge). An inline left edge is always docked
|
|
58
|
+
* open off phones while visible (the right edge, the dock, never is); an inline top/bottom edge is its band
|
|
59
|
+
* only. Everything is a drop-down (`false` here) unless set through
|
|
60
|
+
* `setInlineEdges`, so a bare `ShellState` keeps its historic behaviour.
|
|
61
|
+
*/
|
|
62
|
+
inlineEdges: Partial<Record<PanelEdge, boolean>>;
|
|
52
63
|
private activityListeners;
|
|
53
64
|
constructor(options?: ShellStateOptions);
|
|
54
65
|
hydrate(): Promise<void>;
|
|
@@ -71,10 +82,24 @@ export declare class ShellState {
|
|
|
71
82
|
* never covers the page on load, while a docked edge still restores.
|
|
72
83
|
*/
|
|
73
84
|
closeOverlaidEdges(): void;
|
|
85
|
+
/** Whether an edge is laid out inline (no drop-down) at this viewport. */
|
|
86
|
+
isInline(edge: PanelEdge): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Choose which edges are laid out inline. A visible inline side edge is
|
|
89
|
+
* docked open (not persisted); top/bottom keep their band only.
|
|
90
|
+
*/
|
|
91
|
+
setInlineEdges(next: Partial<Record<PanelEdge, boolean>>): void;
|
|
92
|
+
private applyInline;
|
|
74
93
|
/** Record whether a side edge's `overlayMedia` matches. */
|
|
75
94
|
setOverlayMatch(edge: PanelEdge, matches: boolean): void;
|
|
76
95
|
/** Whether an edge is rendered at the current viewport. */
|
|
77
96
|
isEdgeShown(edge: PanelEdge): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether a region currently shows its slots: the header and footer unless
|
|
99
|
+
* hidden, a sidebar only while shown and expanded (a collapsed one falls
|
|
100
|
+
* back, see `slotFallbackChain`).
|
|
101
|
+
*/
|
|
102
|
+
isRegionVisible(region: ShellRegion): boolean;
|
|
78
103
|
/** Resize limits for an edge, or `null` when it is not resizable. */
|
|
79
104
|
resizeLimits(edge: PanelEdge): Required<ShellPanelResize> | null;
|
|
80
105
|
/** The user's resized width for an edge in px, or `null` (configured size). */
|
|
@@ -117,6 +142,16 @@ export declare class ShellState {
|
|
|
117
142
|
setPanel(edge: PanelEdge, state: VisiblePanelState): void;
|
|
118
143
|
/** Set and persist a runtime panel preference, including hidden. */
|
|
119
144
|
setPanelState(edge: PanelEdge, state: PanelState): void;
|
|
145
|
+
/**
|
|
146
|
+
* Open a collapsed, shown sidebar for now only: nothing is written to the
|
|
147
|
+
* settings or the adapter, so a reload (or a page that unloads meanwhile)
|
|
148
|
+
* finds the user's own state. Returns whether it opened. An explicit
|
|
149
|
+
* change of that edge (toggle, `setPanelState`, a new starting state)
|
|
150
|
+
* makes it the user's, and `endTemporaryReveal` then leaves it alone.
|
|
151
|
+
*/
|
|
152
|
+
revealPanelTemporarily(edge: PanelEdge): boolean;
|
|
153
|
+
/** Close an edge opened by `revealPanelTemporarily`, without saving. */
|
|
154
|
+
endTemporaryReveal(edge: PanelEdge): void;
|
|
120
155
|
togglePanel(edge: PanelEdge): void;
|
|
121
156
|
expandPanel(edge: PanelEdge): void;
|
|
122
157
|
collapsePanel(edge: PanelEdge): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/state.svelte.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAUrB,OAAO,KAAK,EAEV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D,2EAA2E;AAC3E,wBAAgB,mBAAmB,IAAI,aAAa,CAWnD;AAED,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAC5D,KAAK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,uEAAuE;IACvE,YAAY,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACtC;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAE9C,QAAQ,qBAAkC;IAC1C,MAAM,gCAKH;IACH,4EAA4E;IAC5E,QAAQ,gBAAoC;IAC5C,UAAU,mBAAgC;IAC1C,iBAAiB,gBAA+B;IAChD;;;OAGG;IACH,gBAAgB,SAAa;IAC7B,oEAAoE;IACpE,eAAe,EAAE,WAAW,GAAG,IAAI,CAAQ;IAC3C,UAAU,kBAA+B;IACzC;;;OAGG;IACH,cAAc,sCAAmD;IACjE;;;;OAIG;IACH,YAAY,+CAA4D;
|
|
1
|
+
{"version":3,"file":"state.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/state.svelte.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAUrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAEV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D,2EAA2E;AAC3E,wBAAgB,mBAAmB,IAAI,aAAa,CAWnD;AAED,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAC5D,KAAK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAA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,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,kBAAkB;IAsBlD,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS;IAW9C,OAAO,CAAC,mBAAmB;YAmBb,eAAe;IAO7B,OAAO,CAAC,YAAY;CAGrB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAE5E"}
|
|
@@ -25,6 +25,8 @@ export class ShellState {
|
|
|
25
25
|
config;
|
|
26
26
|
adapter;
|
|
27
27
|
settings = $state({});
|
|
28
|
+
/** Edges opened for now only (never written to the settings). */
|
|
29
|
+
revealed = new Set();
|
|
28
30
|
panels = $state({
|
|
29
31
|
top: 'collapsed',
|
|
30
32
|
left: 'collapsed',
|
|
@@ -54,6 +56,14 @@ export class ShellState {
|
|
|
54
56
|
* is the state it starts in. Set it through `setLayoutPanels`.
|
|
55
57
|
*/
|
|
56
58
|
layoutPanels = $state({});
|
|
59
|
+
/**
|
|
60
|
+
* Edges laid out inline rather than as a toggled drop-down (`AdminShell`
|
|
61
|
+
* `edgeToggles` off for the edge). An inline left edge is always docked
|
|
62
|
+
* open off phones while visible (the right edge, the dock, never is); an inline top/bottom edge is its band
|
|
63
|
+
* only. Everything is a drop-down (`false` here) unless set through
|
|
64
|
+
* `setInlineEdges`, so a bare `ShellState` keeps its historic behaviour.
|
|
65
|
+
*/
|
|
66
|
+
inlineEdges = $state({});
|
|
57
67
|
activityListeners = new Set();
|
|
58
68
|
constructor(options = {}) {
|
|
59
69
|
this.config = resolveShellConfig(options.config);
|
|
@@ -103,6 +113,13 @@ export class ShellState {
|
|
|
103
113
|
}
|
|
104
114
|
if (changed)
|
|
105
115
|
this.settings = { ...this.settings, panels };
|
|
116
|
+
// Docked inline side edges become closed drawers on a phone.
|
|
117
|
+
if (viewport === 'phone') {
|
|
118
|
+
if (this.inlineEdges.left && this.panels.left === 'expanded') {
|
|
119
|
+
this.panels.left = 'collapsed';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
this.applyInline();
|
|
106
123
|
});
|
|
107
124
|
}
|
|
108
125
|
/** How a side edge is presented on phones (`drawer` unless configured). */
|
|
@@ -115,6 +132,8 @@ export class ShellState {
|
|
|
115
132
|
*/
|
|
116
133
|
presentationFor(edge) {
|
|
117
134
|
const config = this.config.panels[edge];
|
|
135
|
+
if (this.isInline(edge))
|
|
136
|
+
return config.presentation;
|
|
118
137
|
if ((edge === 'left' || edge === 'right') &&
|
|
119
138
|
this.viewport !== 'phone' &&
|
|
120
139
|
config.overlayMedia &&
|
|
@@ -138,6 +157,38 @@ export class ShellState {
|
|
|
138
157
|
}
|
|
139
158
|
});
|
|
140
159
|
}
|
|
160
|
+
/** Whether an edge is laid out inline (no drop-down) at this viewport. */
|
|
161
|
+
isInline(edge) {
|
|
162
|
+
// The right edge is the dock: dock toggles and focus tools open it, so it
|
|
163
|
+
// never docks open by itself (it only loses its toggle button and hotkey).
|
|
164
|
+
if (edge === 'right' || !this.inlineEdges[edge])
|
|
165
|
+
return false;
|
|
166
|
+
return edge !== 'left' || this.viewport !== 'phone';
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Choose which edges are laid out inline. A visible inline side edge is
|
|
170
|
+
* docked open (not persisted); top/bottom keep their band only.
|
|
171
|
+
*/
|
|
172
|
+
setInlineEdges(next) {
|
|
173
|
+
untrack(() => {
|
|
174
|
+
const same = PANEL_EDGES.every((edge) => Boolean(this.inlineEdges[edge]) === Boolean(next[edge]));
|
|
175
|
+
if (same)
|
|
176
|
+
return;
|
|
177
|
+
this.inlineEdges = { ...next };
|
|
178
|
+
this.applyInline();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
applyInline() {
|
|
182
|
+
if (this.isInline('left') && this.panels.left === 'collapsed') {
|
|
183
|
+
this.panels.left = 'expanded';
|
|
184
|
+
}
|
|
185
|
+
// An inline top/bottom edge is its band only: it has no drop-down to open.
|
|
186
|
+
for (const edge of ['top', 'bottom']) {
|
|
187
|
+
if (this.isInline(edge) && this.panels[edge] === 'expanded') {
|
|
188
|
+
this.panels[edge] = 'collapsed';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
141
192
|
/** Record whether a side edge's `overlayMedia` matches. */
|
|
142
193
|
setOverlayMatch(edge, matches) {
|
|
143
194
|
untrack(() => {
|
|
@@ -152,6 +203,23 @@ export class ShellState {
|
|
|
152
203
|
return false;
|
|
153
204
|
return !(this.viewport === 'phone' && this.phonePresentation(edge) === 'hidden');
|
|
154
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Whether a region currently shows its slots: the header and footer unless
|
|
208
|
+
* hidden, a sidebar only while shown and expanded (a collapsed one falls
|
|
209
|
+
* back, see `slotFallbackChain`).
|
|
210
|
+
*/
|
|
211
|
+
isRegionVisible(region) {
|
|
212
|
+
switch (region) {
|
|
213
|
+
case 'header':
|
|
214
|
+
return this.panels.top !== 'hidden';
|
|
215
|
+
case 'footer':
|
|
216
|
+
return this.panels.bottom !== 'hidden';
|
|
217
|
+
case 'leftSidebar':
|
|
218
|
+
return this.isEdgeShown('left') && this.panels.left === 'expanded';
|
|
219
|
+
case 'rightSidebar':
|
|
220
|
+
return this.isEdgeShown('right') && this.panels.right === 'expanded';
|
|
221
|
+
}
|
|
222
|
+
}
|
|
155
223
|
/** Resize limits for an edge, or `null` when it is not resizable. */
|
|
156
224
|
resizeLimits(edge) {
|
|
157
225
|
return resolvePanelResize(edge, this.config.panels[edge]);
|
|
@@ -203,8 +271,10 @@ export class ShellState {
|
|
|
203
271
|
untrack(() => {
|
|
204
272
|
this.settings = mergeShellSettingsDelta(this.settings, nextDelta);
|
|
205
273
|
for (const edge of PANEL_EDGES) {
|
|
274
|
+
this.revealed.delete(edge);
|
|
206
275
|
this.panels[edge] = resolveInitialPanelState(edge, this.config.panels[edge], this.settings, this.viewport, this.layoutPanels[edge]);
|
|
207
276
|
}
|
|
277
|
+
this.applyInline();
|
|
208
278
|
this.activeFocusToolId =
|
|
209
279
|
this.settings.activeFocusToolId ?? this.activeFocusToolId;
|
|
210
280
|
if (persist !== false)
|
|
@@ -232,10 +302,12 @@ export class ShellState {
|
|
|
232
302
|
const config = this.config.panels[edge];
|
|
233
303
|
if (config.initial === 'hidden')
|
|
234
304
|
continue;
|
|
305
|
+
this.revealed.delete(edge);
|
|
235
306
|
this.panels[edge] = resolveInitialPanelState(edge, config, this.settings, this.viewport, after);
|
|
236
307
|
if (this.panels[edge] === 'expanded')
|
|
237
308
|
this.closeExclusivePeers(edge);
|
|
238
309
|
}
|
|
310
|
+
this.applyInline();
|
|
239
311
|
});
|
|
240
312
|
}
|
|
241
313
|
/**
|
|
@@ -257,7 +329,9 @@ export class ShellState {
|
|
|
257
329
|
}
|
|
258
330
|
if (state === 'expanded')
|
|
259
331
|
this.closeExclusivePeers(edge);
|
|
332
|
+
this.revealed.delete(edge);
|
|
260
333
|
this.panels[edge] = state;
|
|
334
|
+
this.applyInline();
|
|
261
335
|
void this.persistSettings();
|
|
262
336
|
});
|
|
263
337
|
}
|
|
@@ -300,8 +374,17 @@ export class ShellState {
|
|
|
300
374
|
this.panels[edge] = 'hidden';
|
|
301
375
|
return;
|
|
302
376
|
}
|
|
377
|
+
// An inline side edge is always docked open; closing it is a no-op.
|
|
378
|
+
if (this.isInline(edge)) {
|
|
379
|
+
const side = edge === 'left';
|
|
380
|
+
if (side && state === 'collapsed')
|
|
381
|
+
state = 'expanded';
|
|
382
|
+
if (!side && state === 'expanded')
|
|
383
|
+
state = 'collapsed';
|
|
384
|
+
}
|
|
303
385
|
if (state === 'expanded')
|
|
304
386
|
this.closeExclusivePeers(edge);
|
|
387
|
+
this.revealed.delete(edge);
|
|
305
388
|
this.panels[edge] = state;
|
|
306
389
|
this.settings = mergeShellSettingsDelta(this.settings, {
|
|
307
390
|
panels: { [edge]: state },
|
|
@@ -309,6 +392,32 @@ export class ShellState {
|
|
|
309
392
|
void this.persistSettings();
|
|
310
393
|
});
|
|
311
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* Open a collapsed, shown sidebar for now only: nothing is written to the
|
|
397
|
+
* settings or the adapter, so a reload (or a page that unloads meanwhile)
|
|
398
|
+
* finds the user's own state. Returns whether it opened. An explicit
|
|
399
|
+
* change of that edge (toggle, `setPanelState`, a new starting state)
|
|
400
|
+
* makes it the user's, and `endTemporaryReveal` then leaves it alone.
|
|
401
|
+
*/
|
|
402
|
+
revealPanelTemporarily(edge) {
|
|
403
|
+
return untrack(() => {
|
|
404
|
+
if (!this.isEdgeShown(edge) || this.panels[edge] !== 'collapsed') {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
this.panels[edge] = 'expanded';
|
|
408
|
+
this.revealed.add(edge);
|
|
409
|
+
return true;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
/** Close an edge opened by `revealPanelTemporarily`, without saving. */
|
|
413
|
+
endTemporaryReveal(edge) {
|
|
414
|
+
untrack(() => {
|
|
415
|
+
if (!this.revealed.delete(edge))
|
|
416
|
+
return;
|
|
417
|
+
if (this.panels[edge] === 'expanded')
|
|
418
|
+
this.panels[edge] = 'collapsed';
|
|
419
|
+
});
|
|
420
|
+
}
|
|
312
421
|
togglePanel(edge) {
|
|
313
422
|
untrack(() => {
|
|
314
423
|
if (this.panels[edge] === 'hidden')
|
|
@@ -325,6 +434,8 @@ export class ShellState {
|
|
|
325
434
|
closeTopmostExpanded() {
|
|
326
435
|
return untrack(() => {
|
|
327
436
|
for (const edge of [...PANEL_EDGES].reverse()) {
|
|
437
|
+
if (this.isInline(edge))
|
|
438
|
+
continue;
|
|
328
439
|
if (this.panels[edge] === 'expanded' && this.isEdgeShown(edge)) {
|
|
329
440
|
this.collapsePanel(edge);
|
|
330
441
|
return true;
|