@celljs/ta-web 4.16.0 → 4.17.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 +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-ask-book.d.ts +35 -0
- package/esm/browser/assistant/assistant-ask-book.js +96 -0
- package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
- package/esm/browser/assistant/assistant-conversation.js +351 -0
- package/esm/browser/assistant/assistant-export.js +6 -7
- package/esm/browser/assistant/assistant-extension.d.ts +3 -2
- package/esm/browser/assistant/assistant-extension.js +57 -4
- package/esm/browser/assistant/assistant-protocol.d.ts +17 -2
- package/esm/browser/assistant/assistant-role.d.ts +22 -4
- package/esm/browser/assistant/assistant-role.js +29 -7
- package/esm/browser/assistant/assistant-state.d.ts +5 -1
- package/esm/browser/assistant/assistant-state.js +11 -0
- package/esm/browser/assistant/assistant-task-source.js +7 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +19 -7
- package/esm/browser/assistant/assistant-task-util.js +73 -20
- package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
- package/esm/browser/assistant/assistant-tasks.js +0 -2
- package/esm/browser/assistant/assistant-thread.d.ts +22 -0
- package/esm/browser/assistant/assistant-thread.js +108 -0
- package/esm/browser/assistant/assistant-view.js +77 -126
- package/esm/browser/assistant/assistant.d.ts +33 -105
- package/esm/browser/assistant/assistant.js +103 -356
- package/esm/browser/assistant/chat-task-source.d.ts +58 -0
- package/esm/browser/assistant/chat-task-source.js +107 -0
- package/esm/browser/assistant/read-aloud.d.ts +34 -0
- package/esm/browser/assistant/read-aloud.js +98 -0
- package/esm/browser/assistant/realtime-voice.d.ts +77 -0
- package/esm/browser/assistant/realtime-voice.js +320 -0
- package/esm/browser/assistant/task-views.d.ts +2 -3
- package/esm/browser/assistant/task-views.js +20 -16
- package/esm/browser/assistant/voice-call-bar.d.ts +60 -0
- package/esm/browser/assistant/voice-call-bar.js +260 -0
- package/esm/browser/assistant/voice-call.d.ts +175 -0
- package/esm/browser/assistant/voice-call.js +366 -0
- package/esm/browser/chat/chat-shown.d.ts +78 -0
- package/esm/browser/chat/chat-shown.js +262 -0
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/chat/chat.d.ts +4 -68
- package/esm/browser/chat/chat.js +5 -253
- package/esm/browser/chat/draft-model.d.ts +1 -1
- 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 +3 -1
- package/esm/browser/components/app-nav.js +7 -7
- package/esm/browser/components/app-shell-hooks.d.ts +11 -2
- package/esm/browser/components/app-shell-hooks.js +25 -4
- package/esm/browser/components/app-shell-state.d.ts +80 -0
- package/esm/browser/components/app-shell-state.js +466 -0
- package/esm/browser/components/app-view.js +121 -333
- package/esm/browser/components/asks-badge.d.ts +6 -2
- package/esm/browser/components/asks-badge.js +7 -3
- package/esm/browser/components/auth-pictures.d.ts +2 -2
- package/esm/browser/components/auth-pictures.js +13 -1
- package/esm/browser/components/auth-view.d.ts +4 -3
- package/esm/browser/components/auth-view.js +54 -5
- package/esm/browser/components/chat-asks.d.ts +2 -0
- package/esm/browser/components/chat-asks.js +8 -0
- package/esm/browser/components/chat-busy.d.ts +32 -0
- package/esm/browser/components/chat-busy.js +49 -0
- package/esm/browser/components/chat-icon.d.ts +6 -0
- package/esm/browser/components/chat-icon.js +17 -1
- package/esm/browser/components/chat-list-row.d.ts +84 -0
- package/esm/browser/components/chat-list-row.js +198 -0
- package/esm/browser/components/chat-list-util.d.ts +166 -0
- package/esm/browser/components/chat-list-util.js +335 -0
- package/esm/browser/components/chat-list.d.ts +9 -148
- package/esm/browser/components/chat-list.js +277 -513
- package/esm/browser/components/chat-seen.js +1 -0
- package/esm/browser/components/composer-addon-util.d.ts +1 -1
- package/esm/browser/components/composer-addons.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +11 -0
- package/esm/browser/components/composer-attachments.js +27 -0
- package/esm/browser/components/composer-box-hooks.d.ts +9 -0
- package/esm/browser/components/composer-box-hooks.js +138 -0
- package/esm/browser/components/composer-box-protocol.d.ts +108 -0
- package/esm/browser/components/composer-box-protocol.js +2 -0
- package/esm/browser/components/composer-box.d.ts +1 -95
- package/esm/browser/components/composer-box.js +49 -156
- package/esm/browser/components/composer-target.d.ts +21 -0
- package/esm/browser/components/composer-target.js +43 -0
- package/esm/browser/components/composer.d.ts +7 -1
- package/esm/browser/components/composer.js +13 -9
- package/esm/browser/components/context-menu.js +4 -0
- package/esm/browser/components/conversation-find.d.ts +27 -0
- package/esm/browser/components/conversation-find.js +151 -0
- package/esm/browser/components/conversation-scroll-hooks.js +2 -1
- package/esm/browser/components/conversation-scroll-util.d.ts +73 -0
- package/esm/browser/components/conversation-scroll-util.js +80 -0
- package/esm/browser/components/conversation-scroll.d.ts +1 -35
- package/esm/browser/components/conversation-scroll.js +2 -81
- package/esm/browser/components/conversation-view.d.ts +8 -0
- package/esm/browser/components/conversation-view.js +41 -0
- package/esm/browser/components/discover-view.d.ts +3 -2
- package/esm/browser/components/discover-view.js +31 -26
- package/esm/browser/components/dismiss.js +2 -0
- package/esm/browser/components/earlier-messages.d.ts +2 -0
- package/esm/browser/components/earlier-messages.js +2 -1
- package/esm/browser/components/folder-picker.d.ts +7 -0
- package/esm/browser/components/folder-picker.js +89 -19
- package/esm/browser/components/gallery.d.ts +1 -1
- package/esm/browser/components/gallery.js +57 -14
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +3 -1
- package/esm/browser/components/image-menu.d.ts +11 -0
- package/esm/browser/components/image-menu.js +29 -0
- package/esm/browser/components/image-viewer.d.ts +3 -2
- package/esm/browser/components/image-viewer.js +29 -4
- package/esm/browser/components/lightbox.js +2 -0
- package/esm/browser/components/link-dialog.js +2 -0
- package/esm/browser/components/list-rows.d.ts +3 -1
- package/esm/browser/components/list-rows.js +2 -1
- package/esm/browser/components/markdown.js +5 -0
- package/esm/browser/components/media.d.ts +2 -0
- package/esm/browser/components/media.js +16 -1
- package/esm/browser/components/message-actions.d.ts +1 -1
- package/esm/browser/components/message-actions.js +9 -0
- package/esm/browser/components/message-footer.d.ts +3 -1
- package/esm/browser/components/message-footer.js +3 -2
- package/esm/browser/components/message-images.d.ts +41 -0
- package/esm/browser/components/message-images.js +120 -0
- package/esm/browser/components/message-list.d.ts +4 -100
- package/esm/browser/components/message-list.js +10 -447
- package/esm/browser/components/message-menu.js +4 -0
- package/esm/browser/components/message-steps.d.ts +21 -0
- package/esm/browser/components/message-steps.js +182 -0
- package/esm/browser/components/message-user.d.ts +54 -0
- package/esm/browser/components/message-user.js +169 -0
- package/esm/browser/components/model-picker.d.ts +1 -1
- package/esm/browser/components/model-picker.js +2 -0
- package/esm/browser/components/moved-notice.d.ts +14 -0
- package/esm/browser/components/moved-notice.js +60 -0
- package/esm/browser/components/nav-places.d.ts +12 -1
- package/esm/browser/components/nav-places.js +10 -2
- package/esm/browser/components/notice-center.js +36 -1
- package/esm/browser/components/notice-face.js +2 -1
- package/esm/browser/components/phone-shell.d.ts +4 -3
- package/esm/browser/components/phone-shell.js +60 -68
- package/esm/browser/components/plus-menu.d.ts +1 -1
- package/esm/browser/components/relay-services.d.ts +6 -1
- package/esm/browser/components/relay-services.js +109 -2
- package/esm/browser/components/relay-view.js +2 -0
- package/esm/browser/components/remote-hosts.d.ts +10 -0
- package/esm/browser/components/remote-hosts.js +7 -6
- package/esm/browser/components/remote-prompts.js +2 -0
- package/esm/browser/components/scan-screen.js +7 -0
- package/esm/browser/components/screen-navigator-util.d.ts +28 -0
- package/esm/browser/components/screen-navigator-util.js +33 -0
- package/esm/browser/components/screen-navigator.d.ts +30 -0
- package/esm/browser/components/screen-navigator.js +47 -0
- package/esm/browser/components/session-settings.d.ts +1 -1
- package/esm/browser/components/session-view.js +157 -7
- package/esm/browser/components/settings-choices.d.ts +6 -0
- package/esm/browser/components/settings-choices.js +8 -0
- package/esm/browser/components/settings-more.d.ts +7 -0
- package/esm/browser/components/settings-more.js +263 -0
- package/esm/browser/components/settings-parts.d.ts +8 -3
- package/esm/browser/components/settings-parts.js +31 -249
- package/esm/browser/components/settings-view.js +43 -15
- package/esm/browser/components/stop-times.js +1 -0
- package/esm/browser/components/surface-flyout.js +2 -0
- package/esm/browser/components/unseen-drop.d.ts +10 -4
- package/esm/browser/components/unseen-drop.js +9 -8
- package/esm/browser/components/use-seen-chats.js +1 -1
- package/esm/browser/components/voice-services.d.ts +6 -0
- package/esm/browser/components/voice-services.js +137 -0
- package/esm/browser/components/voice-talk.d.ts +23 -6
- package/esm/browser/components/voice-talk.js +46 -11
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/components/web-dialog.js +2 -0
- package/esm/browser/device/back-stack.d.ts +89 -11
- package/esm/browser/device/back-stack.js +200 -29
- package/esm/browser/device/device-protocol.d.ts +1 -1
- package/esm/browser/device/device-protocol.js +1 -1
- package/esm/browser/device/own-gestures.d.ts +1 -1
- package/esm/browser/device/pull-down.js +3 -1
- package/esm/browser/device/row-swipe.js +3 -1
- package/esm/browser/device/sheet-swipe.d.ts +1 -179
- package/esm/browser/device/sheet-swipe.js +3 -433
- package/esm/browser/device/swipe-finger.d.ts +31 -0
- package/esm/browser/device/swipe-finger.js +83 -0
- package/esm/browser/device/swipe-settle.d.ts +52 -0
- package/esm/browser/device/swipe-settle.js +170 -0
- package/esm/browser/device/swipe-util.d.ts +97 -0
- package/esm/browser/device/swipe-util.js +183 -0
- package/esm/browser/drafts/drafts-protocol.d.ts +58 -0
- package/esm/browser/drafts/drafts-protocol.js +75 -0
- package/esm/browser/drafts/drafts.d.ts +21 -0
- package/esm/browser/drafts/drafts.js +91 -0
- package/esm/browser/drafts/use-composer-draft.d.ts +20 -0
- package/esm/browser/drafts/use-composer-draft.js +108 -0
- package/esm/browser/extension/icons.js +3 -1
- package/esm/browser/extension/web-api-components.d.ts +13 -0
- package/esm/browser/extension/web-api-contributions.d.ts +125 -0
- package/esm/browser/extension/web-extension-api.d.ts +88 -5
- package/esm/browser/extension/web-extension-context.d.ts +5 -0
- package/esm/browser/extension/web-extension-context.js +60 -7
- package/esm/browser/extension/web-extension-protocol.d.ts +19 -1
- package/esm/browser/extension/web-extension-protocol.js +3 -0
- package/esm/browser/extension/web-extension-run.d.ts +5 -2
- package/esm/browser/extension/web-extension-run.js +13 -1
- package/esm/browser/extension/web-extensions-running.d.ts +93 -0
- package/esm/browser/extension/web-extensions-running.js +339 -0
- package/esm/browser/extension/web-extensions.d.ts +6 -82
- package/esm/browser/extension/web-extensions.js +10 -319
- package/esm/browser/extension/web-pages.js +1 -0
- package/esm/browser/extension/web-session-notices.js +6 -1
- package/esm/browser/extension/web-tasks.d.ts +2 -0
- package/esm/browser/extension/web-tasks.js +6 -0
- package/esm/browser/extension/web-view-util.d.ts +2 -1
- package/esm/browser/extension/web-view-util.js +4 -1
- package/esm/browser/gateway/console-parts.d.ts +1 -11
- package/esm/browser/gateway/console-parts.js +38 -128
- package/esm/browser/gateway/console-tenant.js +2 -1
- package/esm/browser/gateway/console-trend.d.ts +11 -0
- package/esm/browser/gateway/console-trend.js +115 -0
- package/esm/browser/gateway/console-view.js +39 -1
- package/esm/browser/i18n/locales.d.ts +143 -6
- package/esm/browser/i18n/messages-ja.js +144 -7
- package/esm/browser/i18n/messages-zh-tw.js +144 -7
- package/esm/browser/i18n/messages.d.ts +140 -3
- package/esm/browser/i18n/messages.js +288 -14
- package/esm/browser/index.d.ts +17 -0
- package/esm/browser/index.js +17 -0
- package/esm/browser/notices/notices-protocol.d.ts +12 -0
- package/esm/browser/notices/notices.js +7 -4
- package/esm/browser/offline/device-values.d.ts +2 -0
- package/esm/browser/offline/device-values.js +6 -1
- package/esm/browser/screen/page-answers.d.ts +42 -0
- package/esm/browser/screen/page-answers.js +89 -0
- package/esm/browser/screen/screen-protocol.d.ts +112 -0
- package/esm/browser/screen/screen-protocol.js +45 -0
- package/esm/browser/screen/screen.d.ts +20 -0
- package/esm/browser/screen/screen.js +122 -0
- package/esm/browser/screen/use-screen-part.d.ts +6 -0
- package/esm/browser/screen/use-screen-part.js +14 -0
- package/esm/browser/settings/settings-protocol.d.ts +5 -1
- package/esm/browser/settings/settings-protocol.js +6 -2
- package/esm/browser/share/shared-extensions.d.ts +29 -0
- package/esm/browser/share/shared-extensions.js +145 -0
- package/esm/browser/share/shared-link.d.ts +11 -0
- package/esm/browser/share/shared-link.js +38 -0
- package/esm/browser/share/shared-page.d.ts +5 -0
- package/esm/browser/share/shared-page.js +137 -0
- package/esm/browser/state/state-protocol.d.ts +14 -0
- package/esm/browser/state/state-protocol.js +18 -0
- package/esm/browser/state/state.d.ts +10 -2
- package/esm/browser/state/state.js +19 -3
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +4 -0
- package/esm/browser/style/chat-list.d.ts +2 -0
- package/esm/browser/style/chat-list.js +153 -0
- package/esm/browser/style/conversation-column.d.ts +2 -0
- package/esm/browser/style/conversation-column.js +250 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +24 -8
- package/esm/browser/style/dialogs.d.ts +2 -0
- package/esm/browser/style/dialogs.js +163 -0
- package/esm/browser/style/layout.d.ts +2 -2
- package/esm/browser/style/layout.js +1 -525
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +9 -3
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +6 -2
- package/esm/browser/style/shared.d.ts +2 -0
- package/esm/browser/style/shared.js +23 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -0
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +13 -8
- package/esm/browser/style.js +8 -0
- package/esm/browser/util/gallery.d.ts +24 -2
- package/esm/browser/util/gallery.js +82 -2
- package/esm/browser/util/image-copy.d.ts +16 -0
- package/esm/browser/util/image-copy.js +57 -0
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +14 -0
- package/esm/browser/util/process.d.ts +6 -2
- package/esm/browser/util/process.js +6 -2
- package/esm/browser/util/spoken.d.ts +24 -0
- package/esm/browser/util/spoken.js +83 -0
- package/esm/browser/util/transcript.d.ts +22 -0
- package/esm/browser/util/transcript.js +46 -0
- package/esm/browser/util/voice.d.ts +5 -1
- package/esm/browser/util/voice.js +6 -1
- package/esm/browser/workbench-hosts.d.ts +36 -0
- package/esm/browser/workbench-hosts.js +120 -0
- package/esm/browser/workbench-lists.d.ts +33 -0
- package/esm/browser/workbench-lists.js +128 -0
- package/esm/browser/workbench-protocol.d.ts +14 -1
- package/esm/browser/workbench-services.d.ts +49 -0
- package/esm/browser/workbench-services.js +120 -0
- package/esm/browser/workbench-util.d.ts +1 -1
- package/esm/browser/workbench.d.ts +6 -89
- package/esm/browser/workbench.js +26 -336
- package/lib/browser/assistant/assistant-ask-book.d.ts +36 -0
- package/lib/browser/assistant/assistant-ask-book.js +100 -0
- package/lib/browser/assistant/assistant-conversation.d.ts +111 -0
- package/lib/browser/assistant/assistant-conversation.js +355 -0
- package/lib/browser/assistant/assistant-export.js +6 -7
- package/lib/browser/assistant/assistant-extension.d.ts +3 -2
- package/lib/browser/assistant/assistant-extension.js +55 -2
- package/lib/browser/assistant/assistant-protocol.d.ts +17 -2
- package/lib/browser/assistant/assistant-role.d.ts +22 -4
- package/lib/browser/assistant/assistant-role.js +30 -8
- package/lib/browser/assistant/assistant-state.d.ts +5 -1
- package/lib/browser/assistant/assistant-state.js +11 -0
- package/lib/browser/assistant/assistant-task-source.js +7 -1
- package/lib/browser/assistant/assistant-task-util.d.ts +19 -7
- package/lib/browser/assistant/assistant-task-util.js +73 -20
- package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
- package/lib/browser/assistant/assistant-tasks.js +1 -3
- package/lib/browser/assistant/assistant-thread.d.ts +23 -0
- package/lib/browser/assistant/assistant-thread.js +144 -0
- package/lib/browser/assistant/assistant-view.js +74 -123
- package/lib/browser/assistant/assistant.d.ts +33 -105
- package/lib/browser/assistant/assistant.js +100 -353
- package/lib/browser/assistant/chat-task-source.d.ts +59 -0
- package/lib/browser/assistant/chat-task-source.js +111 -0
- package/lib/browser/assistant/read-aloud.d.ts +35 -0
- package/lib/browser/assistant/read-aloud.js +102 -0
- package/lib/browser/assistant/realtime-voice.d.ts +78 -0
- package/lib/browser/assistant/realtime-voice.js +324 -0
- package/lib/browser/assistant/task-views.d.ts +2 -3
- package/lib/browser/assistant/task-views.js +19 -15
- package/lib/browser/assistant/voice-call-bar.d.ts +61 -0
- package/lib/browser/assistant/voice-call-bar.js +306 -0
- package/lib/browser/assistant/voice-call.d.ts +176 -0
- package/lib/browser/assistant/voice-call.js +370 -0
- package/lib/browser/chat/chat-shown.d.ts +79 -0
- package/lib/browser/chat/chat-shown.js +266 -0
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/chat/chat.d.ts +4 -68
- package/lib/browser/chat/chat.js +3 -251
- package/lib/browser/chat/draft-model.d.ts +1 -1
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +1 -1
- package/lib/browser/components/app-nav.d.ts +3 -1
- package/lib/browser/components/app-nav.js +7 -7
- package/lib/browser/components/app-shell-hooks.d.ts +11 -2
- package/lib/browser/components/app-shell-hooks.js +26 -5
- package/lib/browser/components/app-shell-state.d.ts +81 -0
- package/lib/browser/components/app-shell-state.js +502 -0
- package/lib/browser/components/app-view.js +114 -326
- package/lib/browser/components/asks-badge.d.ts +6 -2
- package/lib/browser/components/asks-badge.js +7 -3
- package/lib/browser/components/auth-pictures.d.ts +2 -2
- package/lib/browser/components/auth-pictures.js +13 -1
- package/lib/browser/components/auth-view.d.ts +4 -3
- package/lib/browser/components/auth-view.js +53 -4
- package/lib/browser/components/chat-asks.d.ts +2 -0
- package/lib/browser/components/chat-asks.js +8 -0
- package/lib/browser/components/chat-busy.d.ts +33 -0
- package/lib/browser/components/chat-busy.js +52 -0
- package/lib/browser/components/chat-icon.d.ts +6 -0
- package/lib/browser/components/chat-icon.js +17 -1
- package/lib/browser/components/chat-list-row.d.ts +85 -0
- package/lib/browser/components/chat-list-row.js +236 -0
- package/lib/browser/components/chat-list-util.d.ts +167 -0
- package/lib/browser/components/chat-list-util.js +338 -0
- package/lib/browser/components/chat-list.d.ts +9 -148
- package/lib/browser/components/chat-list.js +294 -532
- package/lib/browser/components/chat-seen.js +1 -0
- package/lib/browser/components/composer-addon-util.d.ts +1 -1
- package/lib/browser/components/composer-addons.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +12 -0
- package/lib/browser/components/composer-attachments.js +64 -0
- package/lib/browser/components/composer-box-hooks.d.ts +10 -0
- package/lib/browser/components/composer-box-hooks.js +178 -0
- package/lib/browser/components/composer-box-protocol.d.ts +109 -0
- package/lib/browser/components/composer-box-protocol.js +3 -0
- package/lib/browser/components/composer-box.d.ts +1 -95
- package/lib/browser/components/composer-box.js +51 -159
- package/lib/browser/components/composer-target.d.ts +22 -0
- package/lib/browser/components/composer-target.js +46 -0
- package/lib/browser/components/composer.d.ts +7 -1
- package/lib/browser/components/composer.js +15 -11
- package/lib/browser/components/context-menu.js +4 -0
- package/lib/browser/components/conversation-find.d.ts +28 -0
- package/lib/browser/components/conversation-find.js +188 -0
- package/lib/browser/components/conversation-scroll-hooks.js +3 -2
- package/lib/browser/components/conversation-scroll-util.d.ts +73 -0
- package/lib/browser/components/conversation-scroll-util.js +85 -1
- package/lib/browser/components/conversation-scroll.d.ts +1 -35
- package/lib/browser/components/conversation-scroll.js +20 -100
- package/lib/browser/components/conversation-view.d.ts +9 -0
- package/lib/browser/components/conversation-view.js +77 -0
- package/lib/browser/components/discover-view.d.ts +3 -2
- package/lib/browser/components/discover-view.js +30 -25
- package/lib/browser/components/dismiss.js +2 -0
- package/lib/browser/components/earlier-messages.d.ts +2 -0
- package/lib/browser/components/earlier-messages.js +2 -1
- package/lib/browser/components/folder-picker.d.ts +7 -0
- package/lib/browser/components/folder-picker.js +88 -18
- package/lib/browser/components/gallery.d.ts +1 -1
- package/lib/browser/components/gallery.js +56 -13
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +4 -2
- package/lib/browser/components/image-menu.d.ts +12 -0
- package/lib/browser/components/image-menu.js +65 -0
- package/lib/browser/components/image-viewer.d.ts +3 -2
- package/lib/browser/components/image-viewer.js +28 -3
- package/lib/browser/components/lightbox.js +2 -0
- package/lib/browser/components/link-dialog.js +2 -0
- package/lib/browser/components/list-rows.d.ts +3 -1
- package/lib/browser/components/list-rows.js +2 -1
- package/lib/browser/components/markdown.js +5 -0
- package/lib/browser/components/media.d.ts +2 -0
- package/lib/browser/components/media.js +17 -1
- package/lib/browser/components/message-actions.d.ts +1 -1
- package/lib/browser/components/message-actions.js +9 -0
- package/lib/browser/components/message-footer.d.ts +3 -1
- package/lib/browser/components/message-footer.js +2 -1
- package/lib/browser/components/message-images.d.ts +42 -0
- package/lib/browser/components/message-images.js +157 -0
- package/lib/browser/components/message-list.d.ts +4 -100
- package/lib/browser/components/message-list.js +11 -455
- package/lib/browser/components/message-menu.js +4 -0
- package/lib/browser/components/message-steps.d.ts +22 -0
- package/lib/browser/components/message-steps.js +218 -0
- package/lib/browser/components/message-user.d.ts +55 -0
- package/lib/browser/components/message-user.js +211 -0
- package/lib/browser/components/model-picker.d.ts +1 -1
- package/lib/browser/components/model-picker.js +2 -0
- package/lib/browser/components/moved-notice.d.ts +15 -0
- package/lib/browser/components/moved-notice.js +96 -0
- package/lib/browser/components/nav-places.d.ts +12 -1
- package/lib/browser/components/nav-places.js +12 -3
- package/lib/browser/components/notice-center.js +35 -0
- package/lib/browser/components/notice-face.js +7 -6
- package/lib/browser/components/phone-shell.d.ts +4 -3
- package/lib/browser/components/phone-shell.js +59 -67
- package/lib/browser/components/plus-menu.d.ts +1 -1
- package/lib/browser/components/relay-services.d.ts +6 -1
- package/lib/browser/components/relay-services.js +107 -0
- package/lib/browser/components/relay-view.js +2 -0
- package/lib/browser/components/remote-hosts.d.ts +10 -0
- package/lib/browser/components/remote-hosts.js +8 -6
- package/lib/browser/components/remote-prompts.js +2 -0
- package/lib/browser/components/scan-screen.js +7 -0
- package/lib/browser/components/screen-navigator-util.d.ts +29 -0
- package/lib/browser/components/screen-navigator-util.js +36 -0
- package/lib/browser/components/screen-navigator.d.ts +31 -0
- package/lib/browser/components/screen-navigator.js +83 -0
- package/lib/browser/components/session-settings.d.ts +1 -1
- package/lib/browser/components/session-view.js +157 -7
- package/lib/browser/components/settings-choices.d.ts +7 -1
- package/lib/browser/components/settings-choices.js +9 -1
- package/lib/browser/components/settings-more.d.ts +8 -0
- package/lib/browser/components/settings-more.js +299 -0
- package/lib/browser/components/settings-parts.d.ts +8 -3
- package/lib/browser/components/settings-parts.js +27 -245
- package/lib/browser/components/settings-view.js +43 -15
- package/lib/browser/components/stop-times.js +1 -0
- package/lib/browser/components/surface-flyout.js +2 -0
- package/lib/browser/components/unseen-drop.d.ts +10 -4
- package/lib/browser/components/unseen-drop.js +9 -8
- package/lib/browser/components/use-seen-chats.js +2 -2
- package/lib/browser/components/voice-services.d.ts +7 -0
- package/lib/browser/components/voice-services.js +173 -0
- package/lib/browser/components/voice-talk.d.ts +23 -6
- package/lib/browser/components/voice-talk.js +45 -10
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/components/web-dialog.js +2 -0
- package/lib/browser/device/back-stack.d.ts +89 -11
- package/lib/browser/device/back-stack.js +205 -31
- package/lib/browser/device/device-protocol.d.ts +1 -1
- package/lib/browser/device/device-protocol.js +1 -1
- package/lib/browser/device/own-gestures.d.ts +1 -1
- package/lib/browser/device/pull-down.js +8 -6
- package/lib/browser/device/row-swipe.js +11 -9
- package/lib/browser/device/sheet-swipe.d.ts +1 -179
- package/lib/browser/device/sheet-swipe.js +16 -452
- package/lib/browser/device/swipe-finger.d.ts +32 -0
- package/lib/browser/device/swipe-finger.js +87 -0
- package/lib/browser/device/swipe-settle.d.ts +53 -0
- package/lib/browser/device/swipe-settle.js +176 -0
- package/lib/browser/device/swipe-util.d.ts +98 -0
- package/lib/browser/device/swipe-util.js +187 -0
- package/lib/browser/drafts/drafts-protocol.d.ts +59 -0
- package/lib/browser/drafts/drafts-protocol.js +78 -0
- package/lib/browser/drafts/drafts.d.ts +22 -0
- package/lib/browser/drafts/drafts.js +94 -0
- package/lib/browser/drafts/use-composer-draft.d.ts +21 -0
- package/lib/browser/drafts/use-composer-draft.js +146 -0
- package/lib/browser/extension/icons.js +2 -0
- package/lib/browser/extension/web-api-components.d.ts +13 -0
- package/lib/browser/extension/web-api-contributions.d.ts +125 -0
- package/lib/browser/extension/web-extension-api.d.ts +88 -5
- package/lib/browser/extension/web-extension-context.d.ts +5 -0
- package/lib/browser/extension/web-extension-context.js +62 -9
- package/lib/browser/extension/web-extension-protocol.d.ts +19 -1
- package/lib/browser/extension/web-extension-protocol.js +3 -0
- package/lib/browser/extension/web-extension-run.d.ts +5 -2
- package/lib/browser/extension/web-extension-run.js +13 -1
- package/lib/browser/extension/web-extensions-running.d.ts +94 -0
- package/lib/browser/extension/web-extensions-running.js +343 -0
- package/lib/browser/extension/web-extensions.d.ts +6 -82
- package/lib/browser/extension/web-extensions.js +7 -316
- package/lib/browser/extension/web-pages.js +1 -0
- package/lib/browser/extension/web-session-notices.js +8 -3
- package/lib/browser/extension/web-tasks.d.ts +2 -0
- package/lib/browser/extension/web-tasks.js +6 -0
- package/lib/browser/extension/web-view-util.d.ts +2 -1
- package/lib/browser/extension/web-view-util.js +4 -1
- package/lib/browser/gateway/console-parts.d.ts +1 -11
- package/lib/browser/gateway/console-parts.js +38 -129
- package/lib/browser/gateway/console-tenant.js +2 -1
- package/lib/browser/gateway/console-trend.d.ts +12 -0
- package/lib/browser/gateway/console-trend.js +151 -0
- package/lib/browser/gateway/console-view.js +39 -1
- package/lib/browser/i18n/locales.d.ts +143 -6
- package/lib/browser/i18n/messages-ja.js +144 -7
- package/lib/browser/i18n/messages-zh-tw.js +144 -7
- package/lib/browser/i18n/messages.d.ts +140 -3
- package/lib/browser/i18n/messages.js +288 -14
- package/lib/browser/index.d.ts +17 -0
- package/lib/browser/index.js +17 -0
- package/lib/browser/notices/notices-protocol.d.ts +12 -0
- package/lib/browser/notices/notices.js +7 -4
- package/lib/browser/offline/device-values.d.ts +2 -0
- package/lib/browser/offline/device-values.js +6 -1
- package/lib/browser/screen/page-answers.d.ts +43 -0
- package/lib/browser/screen/page-answers.js +93 -0
- package/lib/browser/screen/screen-protocol.d.ts +113 -0
- package/lib/browser/screen/screen-protocol.js +48 -0
- package/lib/browser/screen/screen.d.ts +21 -0
- package/lib/browser/screen/screen.js +125 -0
- package/lib/browser/screen/use-screen-part.d.ts +7 -0
- package/lib/browser/screen/use-screen-part.js +50 -0
- package/lib/browser/settings/settings-protocol.d.ts +5 -1
- package/lib/browser/settings/settings-protocol.js +5 -1
- package/lib/browser/share/shared-extensions.d.ts +30 -0
- package/lib/browser/share/shared-extensions.js +181 -0
- package/lib/browser/share/shared-link.d.ts +12 -0
- package/lib/browser/share/shared-link.js +41 -0
- package/lib/browser/share/shared-page.d.ts +6 -0
- package/lib/browser/share/shared-page.js +173 -0
- package/lib/browser/state/state-protocol.d.ts +14 -0
- package/lib/browser/state/state-protocol.js +20 -1
- package/lib/browser/state/state.d.ts +10 -2
- package/lib/browser/state/state.js +18 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +4 -0
- package/lib/browser/style/chat-list.d.ts +3 -0
- package/lib/browser/style/chat-list.js +156 -0
- package/lib/browser/style/conversation-column.d.ts +3 -0
- package/lib/browser/style/conversation-column.js +253 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +24 -8
- package/lib/browser/style/dialogs.d.ts +3 -0
- package/lib/browser/style/dialogs.js +166 -0
- package/lib/browser/style/layout.d.ts +2 -2
- package/lib/browser/style/layout.js +1 -525
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +9 -3
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +7 -3
- package/lib/browser/style/shared.d.ts +3 -0
- package/lib/browser/style/shared.js +26 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -0
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +13 -8
- package/lib/browser/style.js +8 -0
- package/lib/browser/util/gallery.d.ts +24 -2
- package/lib/browser/util/gallery.js +82 -2
- package/lib/browser/util/image-copy.d.ts +17 -0
- package/lib/browser/util/image-copy.js +60 -0
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +14 -0
- package/lib/browser/util/process.d.ts +6 -2
- package/lib/browser/util/process.js +6 -2
- package/lib/browser/util/spoken.d.ts +25 -0
- package/lib/browser/util/spoken.js +86 -0
- package/lib/browser/util/transcript.d.ts +23 -0
- package/lib/browser/util/transcript.js +49 -0
- package/lib/browser/util/voice.d.ts +5 -1
- package/lib/browser/util/voice.js +6 -1
- package/lib/browser/workbench-hosts.d.ts +37 -0
- package/lib/browser/workbench-hosts.js +124 -0
- package/lib/browser/workbench-lists.d.ts +34 -0
- package/lib/browser/workbench-lists.js +132 -0
- package/lib/browser/workbench-protocol.d.ts +14 -1
- package/lib/browser/workbench-services.d.ts +50 -0
- package/lib/browser/workbench-services.js +124 -0
- package/lib/browser/workbench-util.d.ts +1 -1
- package/lib/browser/workbench.d.ts +6 -89
- package/lib/browser/workbench.js +23 -333
- package/package.json +7 -7
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { X } from 'lucide-react';
|
|
1
|
+
import { ArrowRight, Undo2, X } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useBackLayer } from '../device/back-stack.js';
|
|
4
5
|
import { useNotices } from '../hooks.js';
|
|
5
6
|
import { useT } from '../i18n/use-t.js';
|
|
6
7
|
import { NoticesUtil } from '../notices/notices.js';
|
|
7
8
|
import { LEVEL_ICONS } from './callout.js';
|
|
9
|
+
import { Face } from './face.js';
|
|
8
10
|
import { Icon, IconButton } from './icon.js';
|
|
9
11
|
import { NoticeFace } from './notice-face.js';
|
|
10
12
|
import { TerminalArt } from './terminal-art.js';
|
|
@@ -73,6 +75,34 @@ function SessionToast({ notice, leaving, leave, hold, }) {
|
|
|
73
75
|
} }, action.label))))),
|
|
74
76
|
React.createElement(IconButton, { icon: X, label: t('ta.dismiss'), className: "ta-toast-close", onClick: leave })));
|
|
75
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* What Ta did for the user: its face, what it did as the head, what changed under it a row each (before, an arrow, after),
|
|
80
|
+
* and Undo beside the head, where the eye already is.
|
|
81
|
+
*/
|
|
82
|
+
function TaToast({ notice, leaving, leave, hold }) {
|
|
83
|
+
var _a;
|
|
84
|
+
const t = useT();
|
|
85
|
+
const action = notice.action;
|
|
86
|
+
return (React.createElement("div", { className: `ta-toast ta-toast-ta${leaving ? ' ta-leaving' : ''}`, role: "status", ...hold },
|
|
87
|
+
React.createElement("span", { className: "ta-toast-face" },
|
|
88
|
+
React.createElement(Face, { double: true, size: 32 })),
|
|
89
|
+
React.createElement("div", { className: "ta-toast-text" },
|
|
90
|
+
React.createElement("div", { className: "ta-toast-title" }, notice.message),
|
|
91
|
+
(_a = notice.changes) === null || _a === void 0 ? void 0 :
|
|
92
|
+
_a.map((change, index) => (React.createElement("div", { key: index, className: "ta-toast-change" },
|
|
93
|
+
change.label && React.createElement("span", { className: "ta-toast-change-label" }, change.label),
|
|
94
|
+
change.before !== undefined && (React.createElement(React.Fragment, null,
|
|
95
|
+
React.createElement("span", { className: "ta-toast-change-before" }, change.before),
|
|
96
|
+
React.createElement(Icon, { icon: ArrowRight, size: 12, className: "ta-toast-change-arrow" }))),
|
|
97
|
+
React.createElement("span", { className: `ta-toast-change-after${change.label || change.before !== undefined ? '' : ' ta-toast-change-name'}` }, change.after))))),
|
|
98
|
+
action && (React.createElement("button", { type: "button", className: "ta-toast-undo", onClick: () => {
|
|
99
|
+
action.run();
|
|
100
|
+
leave();
|
|
101
|
+
} },
|
|
102
|
+
React.createElement(Icon, { icon: Undo2, size: 14 }),
|
|
103
|
+
action.label)),
|
|
104
|
+
React.createElement(IconButton, { icon: X, label: t('ta.dismiss'), className: "ta-toast-close", onClick: leave })));
|
|
105
|
+
}
|
|
76
106
|
function Toast({ notice, notices }) {
|
|
77
107
|
var _a;
|
|
78
108
|
const t = useT();
|
|
@@ -82,6 +112,9 @@ function Toast({ notice, notices }) {
|
|
|
82
112
|
setTimeout(() => notices.dismiss(notice.id), LEAVE_MS);
|
|
83
113
|
}, [notices, notice.id]);
|
|
84
114
|
const hold = useLifetime(notice, leave);
|
|
115
|
+
if (notice.ta) {
|
|
116
|
+
return React.createElement(TaToast, { notice: notice, leaving: leaving, leave: leave, hold: hold });
|
|
117
|
+
}
|
|
85
118
|
if (notice.from) {
|
|
86
119
|
return React.createElement(SessionToast, { notice: notice, leaving: leaving, leave: leave, hold: hold });
|
|
87
120
|
}
|
|
@@ -109,6 +142,7 @@ function ConfirmDialog({ request, notices }) {
|
|
|
109
142
|
var _a;
|
|
110
143
|
const t = useT();
|
|
111
144
|
const answer = (confirmed) => notices.answer(request.id, confirmed);
|
|
145
|
+
useBackLayer(true, () => answer(false));
|
|
112
146
|
React.useEffect(() => {
|
|
113
147
|
const onKey = (event) => event.key === 'Escape' && notices.answer(request.id, false);
|
|
114
148
|
document.addEventListener('keydown', onKey);
|
|
@@ -129,6 +163,7 @@ function InputDialog({ request, notices }) {
|
|
|
129
163
|
const t = useT();
|
|
130
164
|
const [value, setValue] = React.useState((_a = request.value) !== null && _a !== void 0 ? _a : '');
|
|
131
165
|
const cancel = () => notices.answerInput(request.id, undefined);
|
|
166
|
+
useBackLayer(true, cancel);
|
|
132
167
|
const submit = (event) => {
|
|
133
168
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
134
169
|
notices.answerInput(request.id, value);
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { useAssistant } from '../assistant/assistant-hooks.js';
|
|
3
3
|
import { SessionAvatars } from '../extension/extension-view.js';
|
|
4
4
|
import { useWorkbench } from '../hooks.js';
|
|
5
|
-
import { ChatAvatar
|
|
5
|
+
import { ChatAvatar } from './chat-list-row.js';
|
|
6
|
+
import { ChatListUtil } from './chat-list-util.js';
|
|
6
7
|
/**
|
|
7
8
|
* The face a conversation has in the lists, for a notice it gave (NoticeFrom): the double's, an agent's, else the
|
|
8
9
|
* letter of its directory in its color. Nothing while the lists do not have it.
|
|
@@ -47,7 +47,7 @@ export interface PhoneShellProps {
|
|
|
47
47
|
}
|
|
48
48
|
/** What comes out over the first tab: the launcher (pulled down), the board (from the right). */
|
|
49
49
|
export type PhoneSurface = 'launcher' | 'board';
|
|
50
|
-
/** A
|
|
50
|
+
/** A page pushed (PhoneStack), for what shows that one is: the head of an extension's page, the launcher. */
|
|
51
51
|
export interface StackLayer {
|
|
52
52
|
close(): void;
|
|
53
53
|
}
|
|
@@ -78,8 +78,9 @@ export interface PhoneStackProps {
|
|
|
78
78
|
/**
|
|
79
79
|
* A screen pushed over the screen of a phone, as iOS pushes a page of its settings over their list: it slides
|
|
80
80
|
* in from the right and goes back with its button, a swipe from the left edge or the back of the system, as
|
|
81
|
-
* the screen under it does (
|
|
82
|
-
* it only slides
|
|
81
|
+
* the screen under it does, in a tab too (each is a layer of BackLayers; only the top one has the swipe).
|
|
82
|
+
* Outside a PhoneShell it only slides, and the back of the system closes it on a touch screen. In the page of
|
|
83
|
+
* an extension (`ui.Stack`), the head of the page shows back while it is open.
|
|
83
84
|
*/
|
|
84
85
|
export declare function PhoneStack({ base, top, open, onClose }: PhoneStackProps): React.JSX.Element;
|
|
85
86
|
export declare namespace PhoneUtil {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BackLayerContext, useBackLayer, useNoBackLayer } from '../device/back-stack.js';
|
|
3
3
|
import { useDevice } from '../device/device.js';
|
|
4
4
|
import { DeviceMotion } from '../device/device-protocol.js';
|
|
5
5
|
import { useHeld } from '../device/hold.js';
|
|
@@ -22,7 +22,10 @@ function useWarm(wanted) {
|
|
|
22
22
|
}, [wanted, warm]);
|
|
23
23
|
return warm;
|
|
24
24
|
}
|
|
25
|
+
/** What the launcher pushed over itself: the shell moves the home out of its way. */
|
|
25
26
|
const PhoneStackContext = React.createContext(undefined);
|
|
27
|
+
/** Inside the shell of a phone, where a PhoneStack closes with a swipe from the left edge. */
|
|
28
|
+
const InPhoneContext = React.createContext(false);
|
|
26
29
|
/** The page of an extension a PhoneStack is in (PageView): its head shows back while one is pushed, on any device. */
|
|
27
30
|
export const PageStackContext = React.createContext(undefined);
|
|
28
31
|
const ArrivingContext = React.createContext(false);
|
|
@@ -61,16 +64,20 @@ export function PhoneShell(props) {
|
|
|
61
64
|
const t = useT();
|
|
62
65
|
const touch = useDevice(device => device.touch);
|
|
63
66
|
const { screenOpen, workbenchOpen, onBack, onWorkbench, surface, onSurface, launcher, board } = props;
|
|
64
|
-
const [stack, setStack] = React.useState();
|
|
65
|
-
const stacked = screenOpen && !!stack;
|
|
66
67
|
const home = !screenOpen && !workbenchOpen;
|
|
68
|
+
// The layers of the shell, in the one list of the page (BackLayers): the back of the system closes the top one, and
|
|
69
|
+
// only the top one has its swipe, so that none moves under a page pushed, a dialog or a menu.
|
|
70
|
+
const screenLayer = useBackLayer(screenOpen, onBack);
|
|
71
|
+
const surfaceLayer = useBackLayer(!!surface, () => onSurface(undefined));
|
|
72
|
+
const workbenchLayer = useBackLayer(workbenchOpen, () => onWorkbench(false));
|
|
73
|
+
const bare = useNoBackLayer();
|
|
67
74
|
// What the launcher pushed over itself (its search page): the home goes down out of the way, and it goes back as a screen's.
|
|
68
75
|
const [launcherStack, setLauncherStack] = React.useState();
|
|
69
76
|
const launcherStacked = home && surface === 'launcher' && !!launcherStack;
|
|
70
77
|
const warmLauncher = useWarm(!!launcher) || surface === 'launcher';
|
|
71
78
|
const warmBoard = useWarm(!!board) || surface === 'board';
|
|
72
79
|
usePullDown({
|
|
73
|
-
enabled: touch && !!launcher && home && surface
|
|
80
|
+
enabled: touch && !!launcher && home && (surface === 'launcher' ? surfaceLayer.top : !surface && bare),
|
|
74
81
|
open: surface === 'launcher',
|
|
75
82
|
setOpen: open => onSurface(open ? 'launcher' : undefined),
|
|
76
83
|
sheet: '.ta-phone-home',
|
|
@@ -80,7 +87,7 @@ export function PhoneShell(props) {
|
|
|
80
87
|
peek: '.ta-phone-peek',
|
|
81
88
|
});
|
|
82
89
|
useSheetSwipe({
|
|
83
|
-
enabled: touch && !!board && home && surface
|
|
90
|
+
enabled: touch && !!board && home && (surface === 'board' ? surfaceLayer.top : !surface && bare),
|
|
84
91
|
open: surface === 'board',
|
|
85
92
|
setOpen: open => onSurface(open ? 'board' : undefined),
|
|
86
93
|
// From the left, as a swipe to the right brings it: a row swipes to the left, so only an open one, which a
|
|
@@ -96,7 +103,7 @@ export function PhoneShell(props) {
|
|
|
96
103
|
});
|
|
97
104
|
const arriving = useArriving(screenOpen);
|
|
98
105
|
useSheetSwipe({
|
|
99
|
-
enabled: touch &&
|
|
106
|
+
enabled: touch && screenLayer.top,
|
|
100
107
|
open: screenOpen,
|
|
101
108
|
setOpen: open => !open && onBack(),
|
|
102
109
|
side: 'right',
|
|
@@ -106,31 +113,9 @@ export function PhoneShell(props) {
|
|
|
106
113
|
under: '.ta-phone-home',
|
|
107
114
|
scrim: '.ta-phone-dim[data-for="screen"]',
|
|
108
115
|
});
|
|
109
|
-
useSheetSwipe({
|
|
110
|
-
enabled: touch && stacked && !workbenchOpen,
|
|
111
|
-
open: stacked,
|
|
112
|
-
setOpen: open => !open && (stack === null || stack === void 0 ? void 0 : stack.close()),
|
|
113
|
-
side: 'right',
|
|
114
|
-
opensFrom: 'never',
|
|
115
|
-
closesFrom: 'edge',
|
|
116
|
-
sheet: '.ta-phone-screen .ta-phone-stack-top',
|
|
117
|
-
under: '.ta-phone-screen .ta-phone-stack-base',
|
|
118
|
-
scrim: '.ta-phone-screen .ta-phone-stack > .ta-phone-dim',
|
|
119
|
-
});
|
|
120
|
-
useSheetSwipe({
|
|
121
|
-
enabled: touch && launcherStacked,
|
|
122
|
-
open: launcherStacked,
|
|
123
|
-
setOpen: open => !open && (launcherStack === null || launcherStack === void 0 ? void 0 : launcherStack.close()),
|
|
124
|
-
side: 'right',
|
|
125
|
-
opensFrom: 'never',
|
|
126
|
-
closesFrom: 'edge',
|
|
127
|
-
sheet: '.ta-phone-launcher .ta-phone-stack-top',
|
|
128
|
-
under: '.ta-phone-launcher .ta-phone-stack-base',
|
|
129
|
-
scrim: '.ta-phone-launcher .ta-phone-stack > .ta-phone-dim',
|
|
130
|
-
});
|
|
131
116
|
useSheetSwipe({
|
|
132
117
|
// Put away over a page of a tab too (its head has the button); brought out by a swipe only over a conversation.
|
|
133
|
-
enabled: touch && !!props.workbench && (
|
|
118
|
+
enabled: touch && !!props.workbench && (workbenchOpen ? workbenchLayer.top : screenLayer.top),
|
|
134
119
|
open: workbenchOpen,
|
|
135
120
|
setOpen: onWorkbench,
|
|
136
121
|
side: 'right',
|
|
@@ -142,52 +127,58 @@ export function PhoneShell(props) {
|
|
|
142
127
|
// A row swipes to the left as the workbench comes: over one, the workbench comes only from the edge.
|
|
143
128
|
edgeOver: '.ta-swipe-row[data-swipeable]',
|
|
144
129
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
React.createElement(
|
|
166
|
-
|
|
167
|
-
launcher && (React.createElement("button", { type: "button", className: "ta-phone-peek", "aria-label": t('ta.launcher.back'), tabIndex: surface === 'launcher' ? 0 : -1, onClick: () => onSurface(undefined) })),
|
|
168
|
-
board && (React.createElement(React.Fragment, null,
|
|
169
|
-
React.createElement("div", { className: "ta-phone-dim", "data-for": "board" }),
|
|
170
|
-
React.createElement("div", { className: "ta-phone-board", inert: surface !== 'board' }, warmBoard && board))),
|
|
171
|
-
React.createElement("div", { className: "ta-phone-dim", "data-for": "screen" }),
|
|
172
|
-
React.createElement("div", { className: "ta-phone-screen", inert: !screenOpen || workbenchOpen },
|
|
173
|
-
React.createElement("main", { className: "ta-main" },
|
|
174
|
-
React.createElement(PhoneStackContext.Provider, { value: setStack },
|
|
175
|
-
React.createElement(ArrivingContext.Provider, { value: arriving }, props.screen)))),
|
|
176
|
-
props.workbench && React.createElement("div", { className: "ta-phone-dim", "data-for": "workbench" }),
|
|
177
|
-
props.workbench,
|
|
178
|
-
props.children));
|
|
130
|
+
return (React.createElement(InPhoneContext.Provider, { value: true },
|
|
131
|
+
React.createElement("div", { className: "ta-app ta-phone", "data-screen": screenOpen ? '' : undefined, "data-workbench": workbenchOpen ? '' : undefined, "data-surface": surface, "data-surface-stack": launcherStacked ? '' : undefined },
|
|
132
|
+
launcher && (React.createElement("div", { className: "ta-phone-launcher", inert: surface !== 'launcher' },
|
|
133
|
+
React.createElement("div", { className: "ta-phone-launcher-body" },
|
|
134
|
+
React.createElement(BackLayerContext.Provider, { value: surfaceLayer.layer },
|
|
135
|
+
React.createElement(PhoneStackContext.Provider, { value: setLauncherStack }, warmLauncher && launcher))))),
|
|
136
|
+
React.createElement("div", { className: "ta-phone-home", inert: screenOpen || workbenchOpen || !!surface },
|
|
137
|
+
React.createElement("div", { className: "ta-phone-page" }, props.home),
|
|
138
|
+
React.createElement(TabBar, { tabs: props.tabs, tab: props.tab, onTab: props.onTab })),
|
|
139
|
+
launcher && (React.createElement("button", { type: "button", className: "ta-phone-peek", "aria-label": t('ta.launcher.back'), tabIndex: surface === 'launcher' ? 0 : -1, onClick: () => onSurface(undefined) })),
|
|
140
|
+
board && (React.createElement(React.Fragment, null,
|
|
141
|
+
React.createElement("div", { className: "ta-phone-dim", "data-for": "board" }),
|
|
142
|
+
React.createElement("div", { className: "ta-phone-board", inert: surface !== 'board' },
|
|
143
|
+
React.createElement(BackLayerContext.Provider, { value: surfaceLayer.layer }, warmBoard && board)))),
|
|
144
|
+
React.createElement("div", { className: "ta-phone-dim", "data-for": "screen" }),
|
|
145
|
+
React.createElement("div", { className: "ta-phone-screen", inert: !screenOpen || workbenchOpen },
|
|
146
|
+
React.createElement("main", { className: "ta-main" },
|
|
147
|
+
React.createElement(BackLayerContext.Provider, { value: screenLayer.layer },
|
|
148
|
+
React.createElement(ArrivingContext.Provider, { value: arriving }, props.screen)))),
|
|
149
|
+
props.workbench && React.createElement("div", { className: "ta-phone-dim", "data-for": "workbench" }),
|
|
150
|
+
React.createElement(BackLayerContext.Provider, { value: workbenchLayer.layer }, props.workbench),
|
|
151
|
+
props.children)));
|
|
179
152
|
}
|
|
180
153
|
/**
|
|
181
154
|
* A screen pushed over the screen of a phone, as iOS pushes a page of its settings over their list: it slides
|
|
182
155
|
* in from the right and goes back with its button, a swipe from the left edge or the back of the system, as
|
|
183
|
-
* the screen under it does (
|
|
184
|
-
* it only slides
|
|
156
|
+
* the screen under it does, in a tab too (each is a layer of BackLayers; only the top one has the swipe).
|
|
157
|
+
* Outside a PhoneShell it only slides, and the back of the system closes it on a touch screen. In the page of
|
|
158
|
+
* an extension (`ui.Stack`), the head of the page shows back while it is open.
|
|
185
159
|
*/
|
|
186
160
|
export function PhoneStack({ base, top, open, onClose }) {
|
|
161
|
+
const inPhone = React.useContext(InPhoneContext);
|
|
187
162
|
const register = React.useContext(PhoneStackContext);
|
|
188
163
|
const page = React.useContext(PageStackContext);
|
|
164
|
+
const touch = useDevice(device => device.touch);
|
|
189
165
|
const close = React.useRef(onClose);
|
|
190
166
|
close.current = onClose;
|
|
167
|
+
// A layer of the page, wherever it is (a tab, the screen, the launcher, another PhoneStack): the back closes it.
|
|
168
|
+
const back = useBackLayer(open, onClose);
|
|
169
|
+
const id = React.useId();
|
|
170
|
+
const of = `.ta-phone-stack[data-stack="${id}"]`;
|
|
171
|
+
useSheetSwipe({
|
|
172
|
+
enabled: inPhone && touch && back.top,
|
|
173
|
+
open,
|
|
174
|
+
setOpen: shown => !shown && close.current(),
|
|
175
|
+
side: 'right',
|
|
176
|
+
opensFrom: 'never',
|
|
177
|
+
closesFrom: 'edge',
|
|
178
|
+
sheet: `${of} > .ta-phone-stack-top`,
|
|
179
|
+
under: `${of} > .ta-phone-stack-base`,
|
|
180
|
+
scrim: `${of} > .ta-phone-dim`,
|
|
181
|
+
});
|
|
191
182
|
React.useEffect(() => {
|
|
192
183
|
const registers = [register, page].filter((each) => !!each);
|
|
193
184
|
if (!open || registers.length === 0) {
|
|
@@ -203,10 +194,11 @@ export function PhoneStack({ base, top, open, onClose }) {
|
|
|
203
194
|
}
|
|
204
195
|
};
|
|
205
196
|
}, [open, register, page]);
|
|
206
|
-
return (React.createElement("div", { className: "ta-phone-stack", "data-open": open ? '' : undefined },
|
|
197
|
+
return (React.createElement("div", { className: "ta-phone-stack", "data-open": open ? '' : undefined, "data-stack": id },
|
|
207
198
|
React.createElement("div", { className: "ta-phone-stack-base", inert: open }, base),
|
|
208
199
|
React.createElement("div", { className: "ta-phone-dim" }),
|
|
209
|
-
React.createElement("div", { className: "ta-phone-stack-top", inert: !open },
|
|
200
|
+
React.createElement("div", { className: "ta-phone-stack-top", inert: !open },
|
|
201
|
+
React.createElement(BackLayerContext.Provider, { value: back.layer }, top))));
|
|
210
202
|
}
|
|
211
203
|
function TabBar({ tabs, tab, onTab }) {
|
|
212
204
|
const t = useT();
|
|
@@ -229,7 +221,7 @@ function TabBar({ tabs, tab, onTab }) {
|
|
|
229
221
|
return (React.createElement("button", { key: item.id, type: "button", className: `ta-tabbar-item${active ? ' ta-active' : ''}`, "aria-current": active ? 'page' : undefined, onClick: event => (active ? again(item.id, event.currentTarget.closest('.ta-phone-home')) : onTab(item.id)), onContextMenu: item.menu ? event => { var _a; return openMenu(event, (_a = item.menu) !== null && _a !== void 0 ? _a : []); } : undefined, ...held(item.hold) },
|
|
230
222
|
React.createElement("span", { className: "ta-tabbar-icon" },
|
|
231
223
|
item.double ? React.createElement(DinoFace, { size: 24, className: "ta-nav-face" }) : React.createElement(Glyph, { size: 22, strokeWidth: active ? 2 : 1.6 }),
|
|
232
|
-
item.asks ? React.createElement(AsksBadge, { count: item.asks }) : item.unseen && React.createElement(UnseenDrop, { label: t('ta.chat.unseen'), onDismiss: item.onSeeAll })),
|
|
224
|
+
item.asks ? (React.createElement(AsksBadge, { count: item.asks, onDismiss: item.onSeeAll })) : (item.unseen && React.createElement(UnseenDrop, { label: t('ta.chat.unseen'), onDismiss: item.onSeeAll }))),
|
|
233
225
|
React.createElement("span", null, item.label)));
|
|
234
226
|
}),
|
|
235
227
|
menu));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { ComposerAction } from './composer-box.js';
|
|
2
|
+
import type { ComposerAction } from './composer-box-protocol.js';
|
|
3
3
|
export declare namespace PlusMenuUtil {
|
|
4
4
|
/** Tiles on a page of the grid: four to a row, two rows, as WeChat's + panel; more go to the next page, which a swipe shows. */
|
|
5
5
|
const COLUMNS = 4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TaRelayFeature, type TaRelayProbe, type TaRelayService, type TaRelayTypeInfo } from '@celljs/ta-protocol';
|
|
1
|
+
import { type TaJoinedDeployment, type TaRelayFeature, type TaRelayProbe, type TaRelayService, type TaRelayTypeInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import { type LucideIcon } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useT } from '../i18n/use-t.js';
|
|
@@ -11,6 +11,11 @@ export declare namespace RelayServicesUtil {
|
|
|
11
11
|
function serves(service: TaRelayService, feature: TaRelayFeature): boolean;
|
|
12
12
|
/** The icon of a service: the official relay, a relay, a folder, a store by the icon its package gave its type. */
|
|
13
13
|
function icon(service: TaRelayService, types?: readonly TaRelayTypeInfo[]): LucideIcon;
|
|
14
|
+
/** What a deployment is called: its name, else the host of the address it was joined by. */
|
|
15
|
+
function deploymentName(deployment: TaJoinedDeployment): string;
|
|
16
|
+
function host(url: string): string;
|
|
17
|
+
/** A name for the cloud workspace of a deployment's gateway (ta://<name>): its first label, as TaLocation takes it. */
|
|
18
|
+
function cloudName(gateway: string): string;
|
|
14
19
|
function iconNamed(name: string | undefined): LucideIcon;
|
|
15
20
|
/** What a relay shows under its name: where it is, whether it answers, what it keeps. */
|
|
16
21
|
function line(service: TaRelayService, probe: TaRelayProbe | undefined, t: ReturnType<typeof useT>): string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { TaPackageTextUtil } from '@celljs/ta-protocol';
|
|
2
|
-
import { Cloud, Database, FileJson, Folder, GitBranch, HardDrive, Plus, Server, ShieldCheck, Trash2 } from 'lucide-react';
|
|
1
|
+
import { TaPackageTextUtil, } from '@celljs/ta-protocol';
|
|
2
|
+
import { Building2, Cloud, Database, ExternalLink, FileJson, Folder, GitBranch, HardDrive, Plus, Server, ShieldCheck, Trash2, } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
5
|
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
6
6
|
import { Icon, IconButton } from './icon.js';
|
|
7
|
+
import { AddCloudHost } from './remote-hosts.js';
|
|
7
8
|
import { Row } from './settings-controls.js';
|
|
8
9
|
/** The features that go through a relay, in the order the settings list them. */
|
|
9
10
|
const FEATURES = ['devices', 'share', 'rooms', 'sync'];
|
|
@@ -46,6 +47,31 @@ export var RelayServicesUtil;
|
|
|
46
47
|
return iconNamed((_a = types.find(each => each.type === service.type)) === null || _a === void 0 ? void 0 : _a.icon);
|
|
47
48
|
}
|
|
48
49
|
RelayServicesUtil.icon = icon;
|
|
50
|
+
/** What a deployment is called: its name, else the host of the address it was joined by. */
|
|
51
|
+
function deploymentName(deployment) {
|
|
52
|
+
var _a;
|
|
53
|
+
return (_a = deployment.name) !== null && _a !== void 0 ? _a : host(deployment.url);
|
|
54
|
+
}
|
|
55
|
+
RelayServicesUtil.deploymentName = deploymentName;
|
|
56
|
+
function host(url) {
|
|
57
|
+
try {
|
|
58
|
+
return new URL(url).host;
|
|
59
|
+
}
|
|
60
|
+
catch (_a) {
|
|
61
|
+
return url;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
RelayServicesUtil.host = host;
|
|
65
|
+
/** A name for the cloud workspace of a deployment's gateway (ta://<name>): its first label, as TaLocation takes it. */
|
|
66
|
+
function cloudName(gateway) {
|
|
67
|
+
var _a;
|
|
68
|
+
const first = ((_a = host(gateway).split(/[.:]/)[0]) !== null && _a !== void 0 ? _a : '')
|
|
69
|
+
.toLowerCase()
|
|
70
|
+
.replace(/[^a-z0-9-]+/g, '-')
|
|
71
|
+
.replace(/^-+|-+$/g, '');
|
|
72
|
+
return /^[a-z0-9]/.test(first) ? first.slice(0, 40) : 'cloud';
|
|
73
|
+
}
|
|
74
|
+
RelayServicesUtil.cloudName = cloudName;
|
|
49
75
|
function iconNamed(name) {
|
|
50
76
|
return name === 'Database' ? Database : name === 'GitBranch' ? GitBranch : name === 'HardDrive' ? HardDrive : name === 'Server' ? Server : Cloud;
|
|
51
77
|
}
|
|
@@ -162,6 +188,14 @@ export function RelayServices() {
|
|
|
162
188
|
const used = new Set(Object.values(relays.use));
|
|
163
189
|
const types = (_a = relays.types) !== null && _a !== void 0 ? _a : [];
|
|
164
190
|
return (React.createElement(React.Fragment, null,
|
|
191
|
+
React.createElement(Deployment, { relays: relays, changed: listed => {
|
|
192
|
+
var _a;
|
|
193
|
+
setRelays(listed);
|
|
194
|
+
const id = (_a = listed.deployment) === null || _a === void 0 ? void 0 : _a.relay;
|
|
195
|
+
if (id) {
|
|
196
|
+
void bench.relay.probeRelay(id).then(probe => setProbes(before => ({ ...before, [id]: probe })));
|
|
197
|
+
}
|
|
198
|
+
} }),
|
|
165
199
|
relays.error && React.createElement(Row, { label: t('ta.relays.broken'), description: relays.error }),
|
|
166
200
|
FEATURES.map(feature => { var _a; return (React.createElement(Row, { key: feature, label: t(`ta.relays.feature.${feature}`), description: t(`ta.relays.feature.${feature}Hint`) },
|
|
167
201
|
React.createElement("select", { className: "ta-input ta-select", "aria-label": t(`ta.relays.feature.${feature}`), disabled: busy !== undefined, value: (_a = relays.use[feature]) !== null && _a !== void 0 ? _a : '', onChange: event => void run(feature, async () => setRelays(await bench.relay.chooseRelay(feature, event.target.value || null))) }, relays.relays
|
|
@@ -195,6 +229,79 @@ export function RelayServices() {
|
|
|
195
229
|
t('ta.relays.addButton')))),
|
|
196
230
|
React.createElement(Row, { icon: FileJson, label: t('ta.relays.file'), description: React.createElement("span", { className: "ta-path" }, relays.file) })));
|
|
197
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* A deployment of Ta, inside a company or outside it (docs/design/ta-deploy.md 8): joined by the address of any of its
|
|
234
|
+
* services, its relay is the default of what is new, and its gateway gives a Ta in the cloud to open, or its sandbox as a
|
|
235
|
+
* cloud workspace here. Joined, it shows what it is and how to leave it.
|
|
236
|
+
*/
|
|
237
|
+
function Deployment({ relays, changed }) {
|
|
238
|
+
const t = useT();
|
|
239
|
+
const [, bench] = useWorkbench();
|
|
240
|
+
const [, notices] = useNotices();
|
|
241
|
+
const [url, setUrl] = React.useState('');
|
|
242
|
+
const [busy, setBusy] = React.useState(false);
|
|
243
|
+
const [clouds, setClouds] = React.useState();
|
|
244
|
+
const joined = relays.deployment;
|
|
245
|
+
const gateway = joined === null || joined === void 0 ? void 0 : joined.gateway;
|
|
246
|
+
const readClouds = React.useCallback(async () => {
|
|
247
|
+
const hosts = await bench.remote.listHosts();
|
|
248
|
+
setClouds(hosts.filter(host => host.source === 'cloud' && host.url).map(host => host.url));
|
|
249
|
+
}, [bench]);
|
|
250
|
+
React.useEffect(() => {
|
|
251
|
+
if (gateway) {
|
|
252
|
+
readClouds().catch(() => setClouds([]));
|
|
253
|
+
}
|
|
254
|
+
}, [gateway, readClouds]);
|
|
255
|
+
const act = async (action) => {
|
|
256
|
+
setBusy(true);
|
|
257
|
+
try {
|
|
258
|
+
const listed = await action();
|
|
259
|
+
changed(listed);
|
|
260
|
+
return listed;
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
notices.error(error);
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
setBusy(false);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
if (!joined) {
|
|
271
|
+
return (React.createElement(Row, { label: t('ta.deploy.join'), description: t('ta.deploy.joinHint'), stacked: true },
|
|
272
|
+
React.createElement("form", { className: "ta-trusted-add", onSubmit: event => {
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
void act(() => bench.relay.joinDeployment(url.trim())).then(listed => {
|
|
275
|
+
if (listed === null || listed === void 0 ? void 0 : listed.deployment) {
|
|
276
|
+
setUrl('');
|
|
277
|
+
notices.notify(t('ta.deploy.joined', { name: RelayServicesUtil.deploymentName(listed.deployment) }), { level: 'success' });
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
} },
|
|
281
|
+
React.createElement("input", { className: "ta-input", value: url, type: "url", inputMode: "url", placeholder: "https://ta.example.com", "aria-label": t('ta.deploy.join'), spellCheck: false, autoCapitalize: "off", onChange: event => setUrl(event.target.value) }),
|
|
282
|
+
React.createElement("button", { type: "submit", className: `ta-button${busy ? ' ta-busy' : ''}`, disabled: !url.trim() || busy },
|
|
283
|
+
busy && React.createElement("span", { className: "ta-spinner ta-busy-mark" }),
|
|
284
|
+
React.createElement("span", null, t('ta.deploy.joinButton'))))));
|
|
285
|
+
}
|
|
286
|
+
const relay = relays.relays.find(each => each.id === joined.relay);
|
|
287
|
+
const parts = [
|
|
288
|
+
(relay === null || relay === void 0 ? void 0 : relay.url) ? t('ta.deploy.relay', { host: RelayServicesUtil.host(relay.url) }) : undefined,
|
|
289
|
+
gateway ? t('ta.deploy.gateway', { host: RelayServicesUtil.host(gateway) }) : undefined,
|
|
290
|
+
].filter(Boolean);
|
|
291
|
+
const added = gateway && (clouds === null || clouds === void 0 ? void 0 : clouds.some(each => RelayServicesUtil.host(each) === RelayServicesUtil.host(gateway)));
|
|
292
|
+
return (React.createElement(React.Fragment, null,
|
|
293
|
+
React.createElement(Row, { icon: Building2, label: RelayServicesUtil.deploymentName(joined), description: [t('ta.deploy.joinedLine'), ...parts].join(' · ') },
|
|
294
|
+
React.createElement("button", { type: "button", className: `ta-button${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void act(() => bench.relay.leaveDeployment()) },
|
|
295
|
+
busy && React.createElement("span", { className: "ta-spinner ta-busy-mark" }),
|
|
296
|
+
React.createElement("span", null, t('ta.deploy.leave')))),
|
|
297
|
+
gateway && (React.createElement(Row, { label: t('ta.deploy.cloud'), description: added ? t('ta.deploy.cloudAdded') : t('ta.deploy.cloudHint'), stacked: true },
|
|
298
|
+
React.createElement("div", { className: "ta-deploy-cloud" },
|
|
299
|
+
React.createElement("a", { className: "ta-button", href: gateway, target: "_blank", rel: "noreferrer noopener" },
|
|
300
|
+
React.createElement(Icon, { icon: ExternalLink, size: 14 }),
|
|
301
|
+
" ",
|
|
302
|
+
t('ta.deploy.open')),
|
|
303
|
+
clouds && !added && React.createElement(AddCloudHost, { url: gateway, name: RelayServicesUtil.cloudName(gateway), onAdded: readClouds }))))));
|
|
304
|
+
}
|
|
198
305
|
/**
|
|
199
306
|
* The form of a type of service a package registered (WebDAV, S3, git): its fields as the package said, secrets as
|
|
200
307
|
* passwords, and a name. Ta tries the store before it adds it; then sync goes there.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Copy, Smartphone, Trash2, X } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useBackLayer } from '../device/back-stack.js';
|
|
4
5
|
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
6
|
import { useT } from '../i18n/use-t.js';
|
|
6
7
|
import { BusyMark } from './busy.js';
|
|
@@ -43,6 +44,7 @@ export function RelayDialog({ onClose }) {
|
|
|
43
44
|
const timer = setInterval(load, 3000);
|
|
44
45
|
return () => clearInterval(timer);
|
|
45
46
|
}, [load]);
|
|
47
|
+
useBackLayer(true, onClose);
|
|
46
48
|
React.useEffect(() => {
|
|
47
49
|
const onKey = (event) => event.key === 'Escape' && onClose();
|
|
48
50
|
document.addEventListener('keydown', onKey);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A cloud workspace to add: the address of a Ta gateway (or Ta service), a token of one's account there, and a name for
|
|
4
|
+
* its directories, `ta://<name>/…`. Checked by connecting before it is kept. A deployment joined (RelayServices) opens
|
|
5
|
+
* it with the address of its gateway and a name filled in.
|
|
6
|
+
*/
|
|
7
|
+
export declare function AddCloudHost({ onAdded, url: givenUrl, name: givenName }: {
|
|
8
|
+
onAdded(): Promise<unknown>;
|
|
9
|
+
url?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
}): React.JSX.Element;
|
|
2
12
|
/**
|
|
3
13
|
* The machines conversations can work on (`ssh://` directories): those of ~/.ssh/config and those added,
|
|
4
14
|
* whether Ta is connected to each, and the ports forwarded from them. Connecting checks a host the way a
|
|
@@ -28,15 +28,16 @@ function useRemote() {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* A cloud workspace to add: the address of a Ta gateway (or Ta service), a token of one's account there, and a name for
|
|
31
|
-
* its directories, `ta://<name>/…`. Checked by connecting before it is kept.
|
|
31
|
+
* its directories, `ta://<name>/…`. Checked by connecting before it is kept. A deployment joined (RelayServices) opens
|
|
32
|
+
* it with the address of its gateway and a name filled in.
|
|
32
33
|
*/
|
|
33
|
-
function AddCloudHost({ onAdded }) {
|
|
34
|
+
export function AddCloudHost({ onAdded, url: givenUrl = '', name: givenName = '' }) {
|
|
34
35
|
const t = useT();
|
|
35
36
|
const [, bench] = useWorkbench();
|
|
36
37
|
const [, notices] = useNotices();
|
|
37
38
|
const [open, setOpen] = React.useState(false);
|
|
38
|
-
const [name, setName] = React.useState(
|
|
39
|
-
const [url, setUrl] = React.useState(
|
|
39
|
+
const [name, setName] = React.useState(givenName);
|
|
40
|
+
const [url, setUrl] = React.useState(givenUrl);
|
|
40
41
|
const [token, setToken] = React.useState('');
|
|
41
42
|
const [busy, setBusy] = React.useState(false);
|
|
42
43
|
const nameOk = TaLocation.isCloudName(name.trim());
|
|
@@ -53,8 +54,8 @@ function AddCloudHost({ onAdded }) {
|
|
|
53
54
|
const added = await bench.remote.addCloudHost(name.trim(), url.trim(), token.trim());
|
|
54
55
|
notices.notify(t('ta.remote.cloudAdded', { name: TaLocation.hostLabel(added.host) }), { level: 'success' });
|
|
55
56
|
setOpen(false);
|
|
56
|
-
setName(
|
|
57
|
-
setUrl(
|
|
57
|
+
setName(givenName);
|
|
58
|
+
setUrl(givenUrl);
|
|
58
59
|
setToken('');
|
|
59
60
|
await onAdded();
|
|
60
61
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeyRound, Server, ShieldQuestion } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useBackLayer } from '../device/back-stack.js';
|
|
4
5
|
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
6
|
import { useT } from '../i18n/use-t.js';
|
|
6
7
|
import { Icon } from './icon.js';
|
|
@@ -9,6 +10,7 @@ function PromptDialog({ prompt, onAnswer }) {
|
|
|
9
10
|
const t = useT();
|
|
10
11
|
const [value, setValue] = React.useState('');
|
|
11
12
|
const confirm = prompt.kind === 'confirm';
|
|
13
|
+
useBackLayer(true, () => onAnswer(null));
|
|
12
14
|
return createPortal(React.createElement("div", { className: "ta-modal-scrim" },
|
|
13
15
|
React.createElement("button", { type: "button", className: "ta-overlay-close", "aria-label": t('ta.cancel'), tabIndex: -1, onClick: () => onAnswer(null) }),
|
|
14
16
|
React.createElement("form", { className: "ta-modal ta-confirm ta-remote-prompt", role: "alertdialog", "aria-modal": "true", "aria-label": t('ta.remote.prompt.title', { host: prompt.host }), onKeyDown: event => event.key === 'Escape' && onAnswer(null), onSubmit: event => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ArrowUp, ChevronLeft, Image as ImageIcon, QrCode, SwitchCamera } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useBackLayer } from '../device/back-stack.js';
|
|
4
5
|
import { ScanScreen } from '../device/code-scan.js';
|
|
5
6
|
import { CodeVision } from '../device/code-vision.js';
|
|
6
7
|
import { nativePlugin } from '../device/device.js';
|
|
@@ -136,6 +137,12 @@ function ScanView({ onCode, onAsk }) {
|
|
|
136
137
|
close();
|
|
137
138
|
}
|
|
138
139
|
}, [phase.kind, close]);
|
|
140
|
+
// The scanner, and the photo looked at in it: the back of the system goes back from the photo first.
|
|
141
|
+
useBackLayer(true, close);
|
|
142
|
+
useBackLayer(phase.kind === 'photo', () => {
|
|
143
|
+
setPhase({ kind: 'live' });
|
|
144
|
+
setText('');
|
|
145
|
+
});
|
|
139
146
|
React.useEffect(() => {
|
|
140
147
|
const onKey = (event) => event.key === 'Escape' && !myCode && back();
|
|
141
148
|
document.addEventListener('keydown', onKey);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type WebViewEntry } from '../extension/web-extension-protocol.js';
|
|
2
|
+
/** What is in front, for ScreenNavigatorUtil.where: at most one of them, but the list beside. */
|
|
3
|
+
export interface ShellFront {
|
|
4
|
+
/** The settings shown, at a section (`''`: the first). */
|
|
5
|
+
settings?: string;
|
|
6
|
+
page?: WebViewEntry;
|
|
7
|
+
discover?: boolean;
|
|
8
|
+
me?: boolean;
|
|
9
|
+
/** The list in the sidebar, or the tab of a phone. */
|
|
10
|
+
list?: string;
|
|
11
|
+
/** The name of the conversation shown. */
|
|
12
|
+
chat?: string;
|
|
13
|
+
words: {
|
|
14
|
+
settings: string;
|
|
15
|
+
discover: string;
|
|
16
|
+
me: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare namespace ScreenNavigatorUtil {
|
|
20
|
+
/** What is in front, a line: `Settings → voice`, `Page “Town”`, `Conversation “Fix the login” · list “Chats” beside`. */
|
|
21
|
+
function where(front: ShellFront): string;
|
|
22
|
+
/** A conversation by its session id, its file or its name: the name whole first, then a part of it. */
|
|
23
|
+
function chat<T extends {
|
|
24
|
+
name: string;
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
sessionFile?: string;
|
|
27
|
+
}>(chats: readonly T[], words: string): T | undefined;
|
|
28
|
+
}
|