@celljs/ta-web 4.9.0 → 4.10.0
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/README.en.md +4 -3
- package/README.md +4 -3
- package/esm/browser/assistant/assistant-chat-list.js +8 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +33 -5
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-source.js +2 -0
- package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
- package/esm/browser/assistant/assistant-task-util.js +13 -3
- package/esm/browser/assistant/assistant-tasks.js +3 -2
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +30 -1
- package/esm/browser/assistant/assistant.js +89 -6
- package/esm/browser/assistant/task-views.d.ts +40 -6
- package/esm/browser/assistant/task-views.js +73 -21
- package/esm/browser/avatar/dino-avatar.d.ts +3 -4
- package/esm/browser/avatar/dino-avatar.js +4 -178
- package/esm/browser/avatar/dino-face.d.ts +19 -0
- package/esm/browser/avatar/dino-face.js +142 -0
- package/esm/browser/avatar/dino-geometry.d.ts +11 -0
- package/esm/browser/avatar/dino-geometry.js +38 -0
- package/esm/browser/avatar/dino-kinds.d.ts +15 -0
- package/esm/browser/avatar/dino-kinds.js +544 -0
- package/esm/browser/avatar/dino-motion.js +1 -1
- package/esm/browser/avatar/dino-shape.d.ts +80 -0
- package/esm/browser/avatar/dino-shape.js +113 -0
- package/esm/browser/avatar/dino-species.d.ts +1 -61
- package/esm/browser/avatar/dino-species.js +2 -653
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +23 -1
- package/esm/browser/chat/chat-stores.d.ts +59 -0
- package/esm/browser/chat/chat-stores.js +121 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +33 -12
- package/esm/browser/chat/chat.d.ts +31 -39
- package/esm/browser/chat/chat.js +226 -175
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +47 -0
- package/esm/browser/components/app-shell-hooks.js +169 -0
- package/esm/browser/components/app-view.js +81 -172
- package/esm/browser/components/auth-view.js +1 -1
- package/esm/browser/components/chat-list.d.ts +20 -2
- package/esm/browser/components/chat-list.js +138 -22
- package/esm/browser/components/composer-box.d.ts +5 -5
- package/esm/browser/components/composer-box.js +111 -4
- package/esm/browser/components/composer.d.ts +7 -0
- package/esm/browser/components/composer.js +22 -14
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +129 -6
- package/esm/browser/components/conversation-scroll.js +429 -109
- package/esm/browser/components/dino.js +1 -1
- package/esm/browser/components/earlier-messages.d.ts +2 -1
- package/esm/browser/components/earlier-messages.js +2 -17
- package/esm/browser/components/editor-area.d.ts +3 -1
- package/esm/browser/components/editor-area.js +6 -5
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +30 -9
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +1 -1
- package/esm/browser/components/icon.d.ts +2 -2
- package/esm/browser/components/icon.js +5 -6
- package/esm/browser/components/image-viewer.d.ts +124 -0
- package/esm/browser/components/image-viewer.js +397 -0
- package/esm/browser/components/lightbox.d.ts +11 -0
- package/esm/browser/components/lightbox.js +24 -0
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +24 -10
- package/esm/browser/components/media.js +1 -10
- package/esm/browser/components/message-footer.d.ts +16 -2
- package/esm/browser/components/message-footer.js +29 -12
- package/esm/browser/components/message-list.d.ts +24 -3
- package/esm/browser/components/message-list.js +149 -20
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +18 -3
- package/esm/browser/components/nav-places.d.ts +16 -1
- package/esm/browser/components/nav-places.js +12 -3
- package/esm/browser/components/phone-shell.d.ts +4 -1
- package/esm/browser/components/phone-shell.js +3 -1
- package/esm/browser/components/run-status.js +3 -3
- package/esm/browser/components/select-bar.d.ts +9 -0
- package/esm/browser/components/select-bar.js +24 -0
- package/esm/browser/components/session-settings.d.ts +6 -0
- package/esm/browser/components/session-settings.js +14 -1
- package/esm/browser/components/session-view.js +8 -4
- package/esm/browser/components/settings-choices.d.ts +35 -0
- package/esm/browser/components/settings-choices.js +117 -0
- package/esm/browser/components/settings-parts.d.ts +21 -0
- package/esm/browser/components/settings-parts.js +323 -0
- package/esm/browser/components/settings-view.d.ts +0 -6
- package/esm/browser/components/settings-view.js +4 -406
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +14 -12
- package/esm/browser/components/voice-button.d.ts +1 -1
- package/esm/browser/components/voice-button.js +1 -1
- package/esm/browser/components/voice-talk.d.ts +43 -0
- package/esm/browser/components/voice-talk.js +222 -0
- package/esm/browser/components/workbench-view.js +1 -1
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +136 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +2 -0
- package/esm/browser/device/long-press.js +16 -1
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +64 -76
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +149 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +406 -107
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-extension-api.d.ts +135 -2
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
- package/esm/browser/extension/web-extension-protocol.js +8 -0
- package/esm/browser/extension/web-extensions.d.ts +14 -1
- package/esm/browser/extension/web-extensions.js +128 -24
- package/esm/browser/extension/web-tasks.d.ts +9 -1
- package/esm/browser/extension/web-tasks.js +24 -0
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/hooks.d.ts +3 -1
- package/esm/browser/hooks.js +8 -0
- package/esm/browser/i18n/locales.d.ts +29 -2
- package/esm/browser/i18n/messages.d.ts +28 -1
- package/esm/browser/i18n/messages.js +58 -4
- package/esm/browser/index.d.ts +6 -0
- package/esm/browser/index.js +6 -0
- package/esm/browser/notices/notices-protocol.d.ts +9 -1
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +20 -10
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +142 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +107 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +57 -17
- package/esm/browser/style/device.js +43 -4
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +67 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -3
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +2 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/markdown.d.ts +18 -1
- package/esm/browser/util/markdown.js +119 -5
- package/esm/browser/util/process.d.ts +21 -0
- package/esm/browser/util/process.js +45 -1
- package/esm/browser/util/voice.d.ts +5 -2
- package/esm/browser/util/voice.js +6 -3
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +59 -0
- package/esm/browser/workbench-calls.js +141 -0
- package/esm/browser/workbench-protocol.d.ts +5 -1
- package/esm/browser/workbench-util.d.ts +68 -0
- package/esm/browser/workbench-util.js +145 -0
- package/esm/browser/workbench.d.ts +15 -42
- package/esm/browser/workbench.js +53 -167
- package/lib/browser/assistant/assistant-chat-list.js +8 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +33 -5
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-source.js +2 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
- package/lib/browser/assistant/assistant-task-util.js +13 -3
- package/lib/browser/assistant/assistant-tasks.js +2 -1
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +30 -1
- package/lib/browser/assistant/assistant.js +89 -6
- package/lib/browser/assistant/task-views.d.ts +40 -6
- package/lib/browser/assistant/task-views.js +74 -21
- package/lib/browser/avatar/dino-avatar.d.ts +3 -4
- package/lib/browser/avatar/dino-avatar.js +27 -202
- package/lib/browser/avatar/dino-face.d.ts +20 -0
- package/lib/browser/avatar/dino-face.js +148 -0
- package/lib/browser/avatar/dino-geometry.d.ts +12 -0
- package/lib/browser/avatar/dino-geometry.js +47 -0
- package/lib/browser/avatar/dino-kinds.d.ts +16 -0
- package/lib/browser/avatar/dino-kinds.js +547 -0
- package/lib/browser/avatar/dino-motion.js +2 -2
- package/lib/browser/avatar/dino-shape.d.ts +81 -0
- package/lib/browser/avatar/dino-shape.js +126 -0
- package/lib/browser/avatar/dino-species.d.ts +1 -61
- package/lib/browser/avatar/dino-species.js +34 -687
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +23 -1
- package/lib/browser/chat/chat-stores.d.ts +60 -0
- package/lib/browser/chat/chat-stores.js +125 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +33 -12
- package/lib/browser/chat/chat.d.ts +31 -39
- package/lib/browser/chat/chat.js +227 -176
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +2 -2
- package/lib/browser/components/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +48 -0
- package/lib/browser/components/app-shell-hooks.js +211 -0
- package/lib/browser/components/app-view.js +89 -180
- package/lib/browser/components/auth-view.js +3 -3
- package/lib/browser/components/chat-list.d.ts +20 -2
- package/lib/browser/components/chat-list.js +137 -21
- package/lib/browser/components/composer-box.d.ts +5 -5
- package/lib/browser/components/composer-box.js +111 -4
- package/lib/browser/components/composer.d.ts +7 -0
- package/lib/browser/components/composer.js +22 -14
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- package/lib/browser/components/dino.js +3 -3
- package/lib/browser/components/earlier-messages.d.ts +2 -1
- package/lib/browser/components/earlier-messages.js +2 -17
- package/lib/browser/components/editor-area.d.ts +3 -1
- package/lib/browser/components/editor-area.js +5 -4
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +30 -9
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +5 -5
- package/lib/browser/components/icon.d.ts +2 -2
- package/lib/browser/components/icon.js +7 -6
- package/lib/browser/components/image-viewer.d.ts +125 -0
- package/lib/browser/components/image-viewer.js +435 -0
- package/lib/browser/components/lightbox.d.ts +12 -0
- package/lib/browser/components/lightbox.js +60 -0
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +24 -10
- package/lib/browser/components/media.js +2 -11
- package/lib/browser/components/message-footer.d.ts +16 -2
- package/lib/browser/components/message-footer.js +31 -12
- package/lib/browser/components/message-list.d.ts +24 -3
- package/lib/browser/components/message-list.js +146 -16
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +17 -2
- package/lib/browser/components/nav-places.d.ts +16 -1
- package/lib/browser/components/nav-places.js +13 -3
- package/lib/browser/components/phone-shell.d.ts +4 -1
- package/lib/browser/components/phone-shell.js +3 -1
- package/lib/browser/components/run-status.js +3 -3
- package/lib/browser/components/select-bar.d.ts +10 -0
- package/lib/browser/components/select-bar.js +61 -0
- package/lib/browser/components/session-settings.d.ts +6 -0
- package/lib/browser/components/session-settings.js +14 -1
- package/lib/browser/components/session-view.js +7 -3
- package/lib/browser/components/settings-choices.d.ts +36 -0
- package/lib/browser/components/settings-choices.js +156 -0
- package/lib/browser/components/settings-parts.d.ts +22 -0
- package/lib/browser/components/settings-parts.js +359 -0
- package/lib/browser/components/settings-view.d.ts +0 -6
- package/lib/browser/components/settings-view.js +2 -405
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +14 -12
- package/lib/browser/components/voice-button.d.ts +1 -1
- package/lib/browser/components/voice-button.js +1 -1
- package/lib/browser/components/voice-talk.d.ts +44 -0
- package/lib/browser/components/voice-talk.js +260 -0
- package/lib/browser/components/workbench-view.js +3 -3
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +173 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +2 -0
- package/lib/browser/device/long-press.js +16 -1
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +63 -75
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +148 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +410 -108
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +135 -2
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
- package/lib/browser/extension/web-extension-protocol.js +9 -1
- package/lib/browser/extension/web-extensions.d.ts +14 -1
- package/lib/browser/extension/web-extensions.js +125 -21
- package/lib/browser/extension/web-tasks.d.ts +9 -1
- package/lib/browser/extension/web-tasks.js +24 -0
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/hooks.d.ts +3 -1
- package/lib/browser/hooks.js +9 -0
- package/lib/browser/i18n/locales.d.ts +29 -2
- package/lib/browser/i18n/messages.d.ts +28 -1
- package/lib/browser/i18n/messages.js +58 -4
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.js +6 -0
- package/lib/browser/notices/notices-protocol.d.ts +9 -1
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +20 -10
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +148 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +111 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +57 -17
- package/lib/browser/style/device.js +43 -4
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +67 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -3
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +2 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/markdown.d.ts +18 -1
- package/lib/browser/util/markdown.js +119 -5
- package/lib/browser/util/process.d.ts +21 -0
- package/lib/browser/util/process.js +46 -2
- package/lib/browser/util/voice.d.ts +5 -2
- package/lib/browser/util/voice.js +6 -3
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +60 -0
- package/lib/browser/workbench-calls.js +145 -0
- package/lib/browser/workbench-protocol.d.ts +5 -1
- package/lib/browser/workbench-util.d.ts +69 -0
- package/lib/browser/workbench-util.js +151 -0
- package/lib/browser/workbench.d.ts +15 -42
- package/lib/browser/workbench.js +74 -189
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -45,7 +45,7 @@ const device_1 = require("../device/device");
|
|
|
45
45
|
const hooks_1 = require("../hooks");
|
|
46
46
|
const hosts_1 = require("../hosts");
|
|
47
47
|
const use_t_1 = require("../i18n/use-t");
|
|
48
|
-
const
|
|
48
|
+
const workbench_util_1 = require("../workbench-util");
|
|
49
49
|
const auth_view_1 = require("./auth-view");
|
|
50
50
|
const dino_look_picker_1 = require("./dino-look-picker");
|
|
51
51
|
const host_view_1 = require("./host-view");
|
|
@@ -121,7 +121,7 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
121
121
|
entry('hosts', t('ta.hosts.title'), lucide_react_1.Monitor, () => onDialog('hosts'), { detail: inUse && (hosts_1.HostUtil.label(inUse) || t('ta.hosts.thisServer')) }),
|
|
122
122
|
entry('accounts', t('ta.manage.accounts'), lucide_react_1.KeyRound, () => onDialog('accounts')),
|
|
123
123
|
entry('directory', t('ta.manage.workingDirectory'), lucide_react_1.FolderOpen, () => onDialog('directory')),
|
|
124
|
-
...(
|
|
124
|
+
...(workbench_util_1.WorkbenchUtil.isApp() || handheld ? [] : [entry('relay', t('ta.manage.relay'), lucide_react_1.Smartphone, () => onDialog('relay'))]),
|
|
125
125
|
],
|
|
126
126
|
[
|
|
127
127
|
entry('theme', t('ta.settings.theme'), lucide_react_1.Palette, () => onSettings('appearance'), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type WebViewEntry } from '../extension/web-extension-protocol';
|
|
3
|
-
import { type Navigation } from './nav-places';
|
|
3
|
+
import { type EntryHolds, type Navigation } from './nav-places';
|
|
4
4
|
import type { PhoneSurface } from './phone-shell';
|
|
5
5
|
import type { SettingsSection } from './settings-view';
|
|
6
6
|
import type { SideList } from './side-lists';
|
|
@@ -27,12 +27,15 @@ export interface RailProps {
|
|
|
27
27
|
/** The one open in its flyout. */
|
|
28
28
|
surface?: PhoneSurface;
|
|
29
29
|
onSurface(surface: PhoneSurface | undefined): void;
|
|
30
|
+
/** What a held entry does: the double listens, the chats open a new one (entryHold). */
|
|
31
|
+
holds: EntryHolds;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
|
|
33
|
-
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
35
|
+
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
36
|
+
* Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
|
|
34
37
|
*/
|
|
35
|
-
export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface }: RailProps): React.JSX.Element;
|
|
38
|
+
export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, }: RailProps): React.JSX.Element;
|
|
36
39
|
/** A sidebar view of a web extension, under its title or its own top bar. */
|
|
37
40
|
export declare function SidebarView({ view }: {
|
|
38
41
|
view: WebViewEntry;
|
|
@@ -40,15 +40,18 @@ exports.PageView = PageView;
|
|
|
40
40
|
const lucide_react_1 = require("lucide-react");
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
42
|
const device_1 = require("../device/device");
|
|
43
|
+
const hold_1 = require("../device/hold");
|
|
43
44
|
const extension_view_1 = require("../extension/extension-view");
|
|
44
45
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
45
46
|
const hooks_1 = require("../hooks");
|
|
46
47
|
const use_t_1 = require("../i18n/use-t");
|
|
48
|
+
const agent_settings_1 = require("../settings/agent-settings");
|
|
47
49
|
const navigation_1 = require("../settings/navigation");
|
|
48
50
|
const account_menu_1 = require("./account-menu");
|
|
49
51
|
const connection_bar_1 = require("./connection-bar");
|
|
50
52
|
const context_menu_1 = require("./context-menu");
|
|
51
53
|
const dino_1 = require("./dino");
|
|
54
|
+
const icon_1 = require("./icon");
|
|
52
55
|
const nav_places_1 = require("./nav-places");
|
|
53
56
|
const ta_avatar_1 = require("./ta-avatar");
|
|
54
57
|
const workbench_toggle_1 = require("./workbench-toggle");
|
|
@@ -67,36 +70,42 @@ function useNavigation(views) {
|
|
|
67
70
|
update,
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
|
-
function RailItem({ label, active, onClick, onContextMenu, children }) {
|
|
71
|
-
return (React.createElement("button", { type: "button", className: `ta-rail-item ${active ? 'ta-active' : ''}`, title: label, "aria-label": label, "aria-pressed": active, onClick: onClick, onContextMenu: onContextMenu }, children));
|
|
73
|
+
function RailItem({ label, active, onClick, onContextMenu, onPointerDown, 'data-held': held, children }) {
|
|
74
|
+
return (React.createElement("button", { type: "button", className: `ta-rail-item ${active ? 'ta-active' : ''}`, title: label, "aria-label": label, "aria-pressed": active, onClick: onClick, onContextMenu: onContextMenu, onPointerDown: onPointerDown, "data-held": held }, children));
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
77
|
* The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
|
|
75
|
-
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
78
|
+
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
79
|
+
* Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
|
|
76
80
|
*/
|
|
77
|
-
function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface }) {
|
|
81
|
+
function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, }) {
|
|
78
82
|
const t = (0, use_t_1.useT)();
|
|
79
83
|
const [{ server }] = (0, hooks_1.useWorkbench)();
|
|
80
84
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
85
|
+
const held = (0, hold_1.useHeld)();
|
|
81
86
|
const settingsItem = { label: t('ta.nav.settings'), run: () => onSettings('navigation') };
|
|
82
|
-
/** A page of the rail; the double's (`double`) is its face and stays out of Discover. */
|
|
87
|
+
/** A page of the rail; the double's (`double`) is its face and stays out of Discover, and talks while it is held. */
|
|
83
88
|
const item = (view, foldable = true, double = false) => {
|
|
84
89
|
var _a;
|
|
85
90
|
const Glyph = (_a = view.icon) !== null && _a !== void 0 ? _a : lucide_react_1.PanelTop;
|
|
86
|
-
return (React.createElement(RailItem, { key: view.id, label: web_extension_protocol_1.WebLabelUtil.text(view.title), active: !settingsShown && current === view.id, onClick: () => onPage(view.id), onContextMenu: foldable ? event => openMenu(event, [{ label: t('ta.nav.fold'), run: () => navigation.fold(view.id) }, '-', settingsItem]) : undefined }, double ? React.createElement(ta_avatar_1.DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
|
|
91
|
+
return (React.createElement(RailItem, { key: view.id, label: web_extension_protocol_1.WebLabelUtil.text(view.title), active: !settingsShown && current === view.id, onClick: () => onPage(view.id), onContextMenu: foldable ? event => openMenu(event, [{ label: t('ta.nav.fold'), run: () => navigation.fold(view.id) }, '-', settingsItem]) : undefined, ...held(double ? holds.double : undefined) }, double ? React.createElement(ta_avatar_1.DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
|
|
87
92
|
};
|
|
88
93
|
const discover = navigation.discover.length > 0 || current === nav_places_1.DISCOVER;
|
|
94
|
+
// The workbench from anywhere, a page or the settings too, as the launcher and the board.
|
|
95
|
+
const workbench = React.useContext(workbench_toggle_1.WorkbenchToggleContext);
|
|
89
96
|
return (React.createElement("nav", { className: "ta-rail", "aria-label": t('ta.menu') },
|
|
90
97
|
React.createElement("div", { className: "ta-rail-logo", title: server ? `Ta v${server.version}` : 'Ta' },
|
|
91
98
|
React.createElement(dino_1.Dino, { size: 26 })),
|
|
92
99
|
React.createElement("div", { className: "ta-rail-items" },
|
|
93
100
|
navigation.home && item(navigation.home, false, true),
|
|
94
|
-
lists.map(entry => (React.createElement(RailItem, { key: entry.id, label: entry.label, active: list === entry.id, onClick: () => onList(entry.id) }, entry.double ? React.createElement(ta_avatar_1.DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(entry.icon, { size: 20, strokeWidth: 1.6 })))),
|
|
101
|
+
lists.map(entry => (React.createElement(RailItem, { key: entry.id, label: entry.label, active: list === entry.id, onClick: () => onList(entry.id), ...held((0, nav_places_1.entryHold)(entry.id, entry.double, holds)) }, entry.double ? React.createElement(ta_avatar_1.DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(entry.icon, { size: 20, strokeWidth: 1.6 })))),
|
|
95
102
|
(navigation.nav.length > 0 || discover) && React.createElement("hr", { className: "ta-rail-divider" }),
|
|
96
103
|
navigation.nav.map(view => item(view)),
|
|
97
104
|
discover && (React.createElement(RailItem, { label: t('ta.discover'), active: !settingsShown && current === nav_places_1.DISCOVER, onClick: onDiscover, onContextMenu: event => openMenu(event, [settingsItem]) },
|
|
98
105
|
React.createElement(lucide_react_1.Compass, { size: 20, strokeWidth: 1.6 })))),
|
|
99
|
-
(surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
|
|
106
|
+
(workbench || surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
|
|
107
|
+
workbench && (React.createElement(RailItem, { label: `${t('ta.workbench')} (${agent_settings_1.ShortcutUtil.keys('Mod+J').join(agent_settings_1.ShortcutUtil.isMac() ? '' : '+')})`, active: workbench.open, onClick: workbench.toggle },
|
|
108
|
+
React.createElement(icon_1.SidebarRight, { size: 20, strokeWidth: 1.6 }))),
|
|
100
109
|
surfaces.launcher && (React.createElement(SurfaceButton, { label: t('ta.launcher'), active: surface === 'launcher', onClick: () => onSurface(surface === 'launcher' ? undefined : 'launcher') },
|
|
101
110
|
React.createElement(lucide_react_1.Grip, { size: 20, strokeWidth: 1.6 }))),
|
|
102
111
|
surfaces.board && (React.createElement(SurfaceButton, { label: t('ta.board'), active: surface === 'board', onClick: () => onSurface(surface === 'board' ? undefined : 'board') },
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { WebViewEntry } from '../extension/web-extension-protocol';
|
|
2
|
+
import type { Theme } from '../settings/settings-protocol';
|
|
3
|
+
import { type StateSpec } from '../state/state-protocol';
|
|
4
|
+
import type { PaneSpec } from '../util/layout';
|
|
5
|
+
/**
|
|
6
|
+
* What the sidebar shows in this tab: `` for the chats, else the id of a sidebar view. Until the user picks
|
|
7
|
+
* a tab, the first sidebar view of web extensions (the agents), or the chats if there is none.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FIRST_SIDE = "*";
|
|
10
|
+
/** A page of ta's own in place of the conversation: Discover (a tab of a phone, a page of the rail), Me (a tab of a phone). */
|
|
11
|
+
export type TabPage = 'discover' | 'me';
|
|
12
|
+
/** The user put off signing in to a model, in this tab: the page shows the app until the tab is reopened. */
|
|
13
|
+
export declare const LOGIN_LATER: StateSpec<boolean>;
|
|
14
|
+
export declare const SIDE: StateSpec<string>;
|
|
15
|
+
export declare const SIDEBAR: PaneSpec;
|
|
16
|
+
export declare const EDITOR: PaneSpec;
|
|
17
|
+
/** The width of the navigation rail, in style.ts. */
|
|
18
|
+
export declare const RAIL = 56;
|
|
19
|
+
/** The cards of web extensions, as a tool of the workbench and its tab. */
|
|
20
|
+
export declare const CARDS_ID = "ta/cards";
|
|
21
|
+
/**
|
|
22
|
+
* Whether the right of the page (editors and cards) shows; on narrow screens it starts hidden. The last of
|
|
23
|
+
* them hides it where it lies over the conversation, the user's choice kept.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useRight(): [boolean, () => void, () => void, () => void];
|
|
26
|
+
/** Cmd/Ctrl+B shows or hides the sidebar, Cmd/Ctrl+J the workbench, and Cmd/Ctrl+, opens the settings, as in an IDE. */
|
|
27
|
+
export declare function useKeys(toggle: () => void, openSettings: () => void, toggleWorkbench: () => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* The installed app with its title bar hidden draws the bar itself (see .ta-titlebar), but the browser
|
|
30
|
+
* paints the corners of the window's buttons with theme-color: the traffic lights at the left over the
|
|
31
|
+
* side columns, its own buttons at the right. So the bar is the colour of the side columns throughout, the
|
|
32
|
+
* conversation below it too. Otherwise the whole title bar has the conversation's colour, as the sign-in page.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useTitlebarColor(signedIn: boolean, theme: Theme): void;
|
|
35
|
+
/** Reads the open sessions and the web extensions again while the tab is visible: other clients change them too. */
|
|
36
|
+
export declare function useRefresh(online: boolean): void;
|
|
37
|
+
/** The drawer of a compact layout comes out from the left edge under the finger, and goes the same way. */
|
|
38
|
+
export declare function useDrawerSwipe(enabled: boolean, open: boolean, setOpen: (open: boolean) => void): void;
|
|
39
|
+
/**
|
|
40
|
+
* The cards of web extensions as a tool of the workbench and its tab: the tab opens when the first card
|
|
41
|
+
* comes while the workbench `shown` has nothing else open, and goes with the last card.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useWorkbenchCards(shown: boolean): {
|
|
44
|
+
hasCards: boolean;
|
|
45
|
+
openCards(): void;
|
|
46
|
+
cardsTool: WebViewEntry;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=app-shell-hooks.d.ts.map
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CARDS_ID = exports.RAIL = exports.EDITOR = exports.SIDEBAR = exports.SIDE = exports.LOGIN_LATER = exports.FIRST_SIDE = void 0;
|
|
37
|
+
exports.useRight = useRight;
|
|
38
|
+
exports.useKeys = useKeys;
|
|
39
|
+
exports.useTitlebarColor = useTitlebarColor;
|
|
40
|
+
exports.useRefresh = useRefresh;
|
|
41
|
+
exports.useDrawerSwipe = useDrawerSwipe;
|
|
42
|
+
exports.useWorkbenchCards = useWorkbenchCards;
|
|
43
|
+
const lucide_react_1 = require("lucide-react");
|
|
44
|
+
const React = __importStar(require("react"));
|
|
45
|
+
const device_1 = require("../device/device");
|
|
46
|
+
const sheet_swipe_1 = require("../device/sheet-swipe");
|
|
47
|
+
const hooks_1 = require("../hooks");
|
|
48
|
+
const messages_1 = require("../i18n/messages");
|
|
49
|
+
const settings_1 = require("../settings/settings");
|
|
50
|
+
const state_protocol_1 = require("../state/state-protocol");
|
|
51
|
+
const editor_area_1 = require("./editor-area");
|
|
52
|
+
/**
|
|
53
|
+
* What the sidebar shows in this tab: `` for the chats, else the id of a sidebar view. Until the user picks
|
|
54
|
+
* a tab, the first sidebar view of web extensions (the agents), or the chats if there is none.
|
|
55
|
+
*/
|
|
56
|
+
exports.FIRST_SIDE = '*';
|
|
57
|
+
/** The user put off signing in to a model, in this tab: the page shows the app until the tab is reopened. */
|
|
58
|
+
exports.LOGIN_LATER = { key: 'login.later', tier: 'tab', initial: false, parse: state_protocol_1.StateUtil.boolean };
|
|
59
|
+
exports.SIDE = { key: 'side', tier: 'tab', initial: exports.FIRST_SIDE, parse: state_protocol_1.StateUtil.string };
|
|
60
|
+
exports.SIDEBAR = { key: 'sidebar', initial: 300, min: 200, max: 520 };
|
|
61
|
+
exports.EDITOR = { key: 'editor', initial: 480, min: 320, max: 1200 };
|
|
62
|
+
/** The width of the navigation rail, in style.ts. */
|
|
63
|
+
exports.RAIL = 56;
|
|
64
|
+
/** Whether the workbench on the right shows, in this browser, whose screen decides. */
|
|
65
|
+
const RIGHT = { key: 'panel', tier: 'device', initial: true, parse: state_protocol_1.StateUtil.boolean };
|
|
66
|
+
/** Sessions change with other clients too; while the tab is visible they are read again now and then. */
|
|
67
|
+
const REFRESH_MS = 5000;
|
|
68
|
+
/** The cards of web extensions, as a tool of the workbench and its tab. */
|
|
69
|
+
exports.CARDS_ID = 'ta/cards';
|
|
70
|
+
const CARDS_TAB_ID = `view:${exports.CARDS_ID}`;
|
|
71
|
+
function cardsTab(title) {
|
|
72
|
+
return { id: CARDS_TAB_ID, extension: 'ta', title, icon: lucide_react_1.LayoutGrid, render: editor_area_1.WorkbenchCards };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Whether the right of the page (editors and cards) shows; on narrow screens it starts hidden. The last of
|
|
76
|
+
* them hides it where it lies over the conversation, the user's choice kept.
|
|
77
|
+
*/
|
|
78
|
+
function useRight() {
|
|
79
|
+
const [kept, keep] = (0, hooks_1.usePersisted)(RIGHT);
|
|
80
|
+
// Where it does not fit beside the conversation it opens over it: only when asked, in this page.
|
|
81
|
+
const inline = (0, device_1.useDevice)(device => device.layout) === 'expanded';
|
|
82
|
+
const [asked, setAsked] = React.useState(false);
|
|
83
|
+
const open = kept && (inline || asked);
|
|
84
|
+
const set = React.useCallback((next) => {
|
|
85
|
+
setAsked(next);
|
|
86
|
+
keep(next);
|
|
87
|
+
}, [keep]);
|
|
88
|
+
const toggle = React.useCallback(() => set(!open), [set, open]);
|
|
89
|
+
const reveal = React.useCallback(() => set(true), [set]);
|
|
90
|
+
const uncover = React.useCallback(() => setAsked(false), []);
|
|
91
|
+
// `set` is stable, so `reveal` is too: effects may depend on it.
|
|
92
|
+
return [open, toggle, reveal, uncover];
|
|
93
|
+
}
|
|
94
|
+
/** Cmd/Ctrl+B shows or hides the sidebar, Cmd/Ctrl+J the workbench, and Cmd/Ctrl+, opens the settings, as in an IDE. */
|
|
95
|
+
function useKeys(toggle, openSettings, toggleWorkbench) {
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
const onKey = (event) => {
|
|
98
|
+
if (!(event.metaKey || event.ctrlKey) || event.shiftKey || event.altKey) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const key = event.key.toLowerCase();
|
|
102
|
+
if (key === 'b') {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
toggle();
|
|
105
|
+
}
|
|
106
|
+
else if (key === ',') {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
openSettings();
|
|
109
|
+
}
|
|
110
|
+
else if (key === 'j') {
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
toggleWorkbench();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
window.addEventListener('keydown', onKey);
|
|
116
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
117
|
+
}, [toggle, openSettings, toggleWorkbench]);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The installed app with its title bar hidden draws the bar itself (see .ta-titlebar), but the browser
|
|
121
|
+
* paints the corners of the window's buttons with theme-color: the traffic lights at the left over the
|
|
122
|
+
* side columns, its own buttons at the right. So the bar is the colour of the side columns throughout, the
|
|
123
|
+
* conversation below it too. Otherwise the whole title bar has the conversation's colour, as the sign-in page.
|
|
124
|
+
*/
|
|
125
|
+
function useTitlebarColor(signedIn, theme) {
|
|
126
|
+
React.useEffect(() => {
|
|
127
|
+
const overlay = matchMedia('(display-mode: window-controls-overlay)');
|
|
128
|
+
const apply = () => {
|
|
129
|
+
const meta = document.querySelector('meta[name="theme-color"]');
|
|
130
|
+
if (meta) {
|
|
131
|
+
meta.content = settings_1.THEME_COLORS[theme][overlay.matches && signedIn ? 'side' : 'main'];
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
apply();
|
|
135
|
+
overlay.addEventListener('change', apply);
|
|
136
|
+
return () => overlay.removeEventListener('change', apply);
|
|
137
|
+
}, [signedIn, theme]);
|
|
138
|
+
}
|
|
139
|
+
/** Reads the open sessions and the web extensions again while the tab is visible: other clients change them too. */
|
|
140
|
+
function useRefresh(online) {
|
|
141
|
+
const [, workbench] = (0, hooks_1.useWorkbench)();
|
|
142
|
+
const [, extensions] = (0, hooks_1.useWebExtensions)();
|
|
143
|
+
React.useEffect(() => {
|
|
144
|
+
if (!online) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const sessions = () => document.visibilityState === 'visible' && workbench.refresh().catch(() => undefined);
|
|
148
|
+
const shown = () => {
|
|
149
|
+
sessions();
|
|
150
|
+
if (document.visibilityState === 'visible') {
|
|
151
|
+
extensions.refresh().catch(() => undefined);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const timer = setInterval(sessions, REFRESH_MS);
|
|
155
|
+
document.addEventListener('visibilitychange', shown);
|
|
156
|
+
return () => {
|
|
157
|
+
clearInterval(timer);
|
|
158
|
+
document.removeEventListener('visibilitychange', shown);
|
|
159
|
+
};
|
|
160
|
+
}, [online, workbench, extensions]);
|
|
161
|
+
}
|
|
162
|
+
/** The drawer of a compact layout comes out from the left edge under the finger, and goes the same way. */
|
|
163
|
+
function useDrawerSwipe(enabled, open, setOpen) {
|
|
164
|
+
(0, sheet_swipe_1.useSheetSwipe)({
|
|
165
|
+
enabled,
|
|
166
|
+
open,
|
|
167
|
+
setOpen,
|
|
168
|
+
side: 'left',
|
|
169
|
+
opensFrom: 'edge',
|
|
170
|
+
closesFrom: 'anywhere',
|
|
171
|
+
sheet: '.ta-nav',
|
|
172
|
+
scrim: '.ta-scrim',
|
|
173
|
+
settleMs: 240,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The cards of web extensions as a tool of the workbench and its tab: the tab opens when the first card
|
|
178
|
+
* comes while the workbench `shown` has nothing else open, and goes with the last card.
|
|
179
|
+
*/
|
|
180
|
+
function useWorkbenchCards(shown) {
|
|
181
|
+
const [extensions, host] = (0, hooks_1.useWebExtensions)();
|
|
182
|
+
const [, settingsStore] = (0, hooks_1.useSettings)();
|
|
183
|
+
// The cards of web extensions are a tab of the workbench: it opens when the first card comes, if nothing else is open there, and goes with the last.
|
|
184
|
+
const hasCards = extensions.widgets.some(widget => widget.placement === 'panel');
|
|
185
|
+
const cardsOpen = extensions.editors.some(candidate => candidate.id === CARDS_TAB_ID);
|
|
186
|
+
const openCards = React.useCallback(() => host.open(cardsTab(() => (0, messages_1.message)(settingsStore.state.language, 'ta.workbench.cards'))), [host, settingsStore]);
|
|
187
|
+
const quiet = extensions.editors.length === 0 && shown;
|
|
188
|
+
// Only when cards come: not when the user closes their tab.
|
|
189
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: follows whether there are cards
|
|
190
|
+
React.useEffect(() => {
|
|
191
|
+
if (hasCards && !cardsOpen && quiet) {
|
|
192
|
+
openCards();
|
|
193
|
+
}
|
|
194
|
+
}, [hasCards]);
|
|
195
|
+
React.useEffect(() => {
|
|
196
|
+
if (!hasCards && cardsOpen) {
|
|
197
|
+
void host.closeEditor(CARDS_TAB_ID);
|
|
198
|
+
}
|
|
199
|
+
}, [hasCards, cardsOpen, host]);
|
|
200
|
+
const cardsTool = {
|
|
201
|
+
id: exports.CARDS_ID,
|
|
202
|
+
extension: 'ta',
|
|
203
|
+
title: () => (0, messages_1.message)(settingsStore.state.language, 'ta.workbench.cards'),
|
|
204
|
+
component: editor_area_1.WorkbenchCards,
|
|
205
|
+
icon: lucide_react_1.LayoutGrid,
|
|
206
|
+
location: 'panel',
|
|
207
|
+
order: 0,
|
|
208
|
+
};
|
|
209
|
+
return { hasCards, openCards, cardsTool };
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=app-shell-hooks.js.map
|