@celljs/ta-web 4.9.1 → 4.11.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 +8 -7
- package/README.md +8 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +20 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +25 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +14 -2
- package/esm/browser/assistant/assistant-task-util.js +62 -13
- package/esm/browser/assistant/assistant-view.js +117 -71
- package/esm/browser/assistant/assistant.d.ts +28 -5
- package/esm/browser/assistant/assistant.js +96 -22
- package/esm/browser/avatar/dino-face.js +1 -2
- 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 +28 -1
- package/esm/browser/chat/chat-stores.d.ts +62 -0
- package/esm/browser/chat/chat-stores.js +129 -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 +45 -17
- package/esm/browser/chat/chat.d.ts +41 -41
- package/esm/browser/chat/chat.js +276 -190
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +11 -5
- package/esm/browser/components/app-nav.js +39 -17
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +12 -6
- package/esm/browser/components/app-view.js +150 -36
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +93 -8
- package/esm/browser/components/chat-list.js +411 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +18 -8
- package/esm/browser/components/composer-box.js +199 -52
- package/esm/browser/components/composer.d.ts +13 -6
- package/esm/browser/components/composer.js +8 -5
- 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 +136 -6
- package/esm/browser/components/conversation-scroll.js +467 -108
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -2
- package/esm/browser/components/earlier-messages.js +42 -23
- package/esm/browser/components/editor-area.d.ts +6 -20
- package/esm/browser/components/editor-area.js +10 -96
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +6 -3
- package/esm/browser/components/folder-picker.js +27 -9
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +5 -3
- package/esm/browser/components/icon.js +9 -9
- package/esm/browser/components/image-viewer.d.ts +132 -0
- package/esm/browser/components/image-viewer.js +434 -0
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +14 -0
- package/esm/browser/components/lightbox.js +25 -0
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +60 -14
- package/esm/browser/components/media.js +20 -12
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +22 -2
- package/esm/browser/components/message-footer.js +47 -13
- package/esm/browser/components/message-list.d.ts +78 -6
- package/esm/browser/components/message-list.js +281 -36
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +24 -4
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +37 -3
- package/esm/browser/components/nav-places.js +32 -7
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +27 -2
- package/esm/browser/components/phone-shell.js +98 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +8 -3
- package/esm/browser/components/session-settings.js +15 -1
- package/esm/browser/components/session-view.js +36 -22
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +69 -15
- 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 +21 -14
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +51 -0
- package/esm/browser/components/voice-talk.js +242 -0
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- 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 +134 -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 +12 -0
- package/esm/browser/device/long-press.js +44 -13
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +67 -78
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +154 -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 +414 -108
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +15 -2
- package/esm/browser/extension/web-api-components.d.ts +269 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +385 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +218 -521
- 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-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +346 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +66 -6
- package/esm/browser/extension/web-extension-protocol.js +41 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +41 -68
- package/esm/browser/extension/web-extensions.js +188 -487
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -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/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +105 -3
- package/esm/browser/i18n/messages.d.ts +104 -2
- package/esm/browser/i18n/messages.js +215 -11
- package/esm/browser/index.d.ts +15 -0
- package/esm/browser/index.js +15 -0
- package/esm/browser/links/links-protocol.d.ts +5 -0
- package/esm/browser/links/links.d.ts +19 -7
- package/esm/browser/links/links.js +57 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +26 -1
- package/esm/browser/notices/notices.d.ts +3 -1
- package/esm/browser/notices/notices.js +26 -12
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +151 -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 +109 -0
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +17 -0
- package/esm/browser/settings/settings-protocol.js +20 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +95 -17
- package/esm/browser/style/device.js +42 -5
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +252 -67
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +38 -2
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +76 -9
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +2 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +22 -2
- package/esm/browser/util/markdown.js +120 -6
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +35 -2
- package/esm/browser/util/process.js +79 -4
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +49 -6
- package/esm/browser/util/voice.js +271 -26
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +61 -0
- package/esm/browser/workbench-calls.js +146 -0
- package/esm/browser/workbench-protocol.d.ts +36 -3
- package/esm/browser/workbench-util.d.ts +22 -4
- package/esm/browser/workbench-util.js +37 -7
- package/esm/browser/workbench.d.ts +47 -6
- package/esm/browser/workbench.js +191 -43
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +21 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +25 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +14 -2
- package/lib/browser/assistant/assistant-task-util.js +62 -13
- package/lib/browser/assistant/assistant-view.js +113 -67
- package/lib/browser/assistant/assistant.d.ts +28 -5
- package/lib/browser/assistant/assistant.js +96 -22
- package/lib/browser/avatar/dino-face.js +1 -2
- 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 +28 -1
- package/lib/browser/chat/chat-stores.d.ts +63 -0
- package/lib/browser/chat/chat-stores.js +133 -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 +44 -16
- package/lib/browser/chat/chat.d.ts +41 -41
- package/lib/browser/chat/chat.js +277 -191
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +11 -5
- package/lib/browser/components/app-nav.js +35 -13
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +12 -6
- package/lib/browser/components/app-view.js +145 -31
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +93 -8
- package/lib/browser/components/chat-list.js +412 -60
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +18 -8
- package/lib/browser/components/composer-box.js +198 -51
- package/lib/browser/components/composer.d.ts +13 -6
- package/lib/browser/components/composer.js +7 -4
- 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 +136 -6
- package/lib/browser/components/conversation-scroll.js +469 -109
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -2
- package/lib/browser/components/earlier-messages.js +44 -24
- package/lib/browser/components/editor-area.d.ts +6 -20
- package/lib/browser/components/editor-area.js +11 -97
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +6 -3
- package/lib/browser/components/folder-picker.js +27 -9
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +5 -3
- package/lib/browser/components/icon.js +11 -9
- package/lib/browser/components/image-viewer.d.ts +133 -0
- package/lib/browser/components/image-viewer.js +472 -0
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +15 -0
- package/lib/browser/components/lightbox.js +61 -0
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +60 -14
- package/lib/browser/components/media.js +21 -13
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +22 -2
- package/lib/browser/components/message-footer.js +49 -12
- package/lib/browser/components/message-list.d.ts +78 -6
- package/lib/browser/components/message-list.js +281 -32
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +23 -3
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +37 -3
- package/lib/browser/components/nav-places.js +35 -7
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +27 -2
- package/lib/browser/components/phone-shell.js +99 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +8 -3
- package/lib/browser/components/session-settings.js +15 -1
- package/lib/browser/components/session-view.js +32 -18
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +67 -13
- 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 +21 -14
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +52 -0
- package/lib/browser/components/voice-talk.js +281 -0
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- 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 +171 -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 +12 -0
- package/lib/browser/device/long-press.js +44 -13
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +66 -77
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +153 -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 +418 -109
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +14 -1
- package/lib/browser/extension/web-api-components.d.ts +270 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +386 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +218 -521
- 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-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +383 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +66 -6
- package/lib/browser/extension/web-extension-protocol.js +42 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +41 -68
- package/lib/browser/extension/web-extensions.js +184 -516
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -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/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +105 -3
- package/lib/browser/i18n/messages.d.ts +104 -2
- package/lib/browser/i18n/messages.js +215 -11
- package/lib/browser/index.d.ts +15 -0
- package/lib/browser/index.js +15 -0
- package/lib/browser/links/links-protocol.d.ts +5 -0
- package/lib/browser/links/links.d.ts +19 -7
- package/lib/browser/links/links.js +57 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +26 -1
- package/lib/browser/notices/notices.d.ts +3 -1
- package/lib/browser/notices/notices.js +26 -12
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +157 -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 +113 -0
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +17 -0
- package/lib/browser/settings/settings-protocol.js +21 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +95 -17
- package/lib/browser/style/device.js +42 -5
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +252 -67
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +38 -2
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +76 -9
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +2 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +22 -2
- package/lib/browser/util/markdown.js +120 -6
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +35 -2
- package/lib/browser/util/process.js +80 -5
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +49 -6
- package/lib/browser/util/voice.js +271 -26
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +62 -0
- package/lib/browser/workbench-calls.js +150 -0
- package/lib/browser/workbench-protocol.d.ts +36 -3
- package/lib/browser/workbench-util.d.ts +22 -4
- package/lib/browser/workbench-util.js +38 -8
- package/lib/browser/workbench.d.ts +47 -6
- package/lib/browser/workbench.js +189 -41
- package/package.json +14 -11
- package/public/launch.svg +46 -42
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { FrameUtil } from '../util/frame.js';
|
|
2
3
|
import { DeviceMotion } from './device-protocol.js';
|
|
4
|
+
import { OwnGestures } from './own-gestures.js';
|
|
3
5
|
/** It follows the finger and, let go, ends where it was flicked to, or the nearer side. Pure, for the tests. */
|
|
4
6
|
export var SwipeUtil;
|
|
5
7
|
(function (SwipeUtil) {
|
|
@@ -55,24 +57,29 @@ export var SwipeUtil;
|
|
|
55
57
|
return claimed === undefined ? undefined : claimed && !sideways();
|
|
56
58
|
}
|
|
57
59
|
SwipeUtil.takes = takes;
|
|
58
|
-
/** Where the sheet
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
/** Where the sheet rests away: `∓width`, on its side; out, it rests at 0. */
|
|
61
|
+
function away(sheet, width) {
|
|
62
|
+
return -outward(sheet) * width;
|
|
63
|
+
}
|
|
64
|
+
SwipeUtil.away = away;
|
|
65
|
+
/** Where the sheet is, between 0 (out) and away, when the finger moved `dx` from where it took it (`from`). */
|
|
66
|
+
function position(sheet, from, dx, width) {
|
|
67
|
+
const rest = away(sheet, width);
|
|
68
|
+
return Math.min(Math.max(rest, 0), Math.max(Math.min(rest, 0), from + dx));
|
|
69
|
+
}
|
|
70
|
+
SwipeUtil.position = position;
|
|
71
|
+
/** Whether it ends out, let go at `x` at `speed` (pixels a millisecond, SwipeVelocity): the way it was flicked, or the nearer side. */
|
|
72
|
+
function settle(sheet, x, width, speed) {
|
|
66
73
|
if (Math.abs(speed) > SwipeUtil.FLICK) {
|
|
67
74
|
return speed * outward(sheet) > 0;
|
|
68
75
|
}
|
|
69
|
-
return Math.abs(
|
|
76
|
+
return Math.abs(x) < width / 2;
|
|
70
77
|
}
|
|
71
78
|
SwipeUtil.settle = settle;
|
|
72
79
|
/**
|
|
73
|
-
* How long it slides on to where it rests, `distance` away (signed), let go at `speed
|
|
74
|
-
*
|
|
75
|
-
*
|
|
80
|
+
* How long it slides on to where it rests, `distance` away (signed), let go at `speed`, where the curves of
|
|
81
|
+
* `linear()` are not (SwipeSpring): on CURVE, as fast at first as the finger was; `longest` (the style's)
|
|
82
|
+
* when the finger was slow, or going the other way.
|
|
76
83
|
*/
|
|
77
84
|
function duration(distance, speed, longest) {
|
|
78
85
|
const toward = Math.sign(distance) * speed;
|
|
@@ -82,12 +89,73 @@ export var SwipeUtil;
|
|
|
82
89
|
return Math.round(Math.min(longest, Math.max(SwipeUtil.SHORTEST_MS, (CURVE_START * Math.abs(distance)) / toward)));
|
|
83
90
|
}
|
|
84
91
|
SwipeUtil.duration = duration;
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
/** Whether the page draws the curves of `linear()` (iOS 17.2, Chrome 113 on): a spring then, else CURVE. */
|
|
93
|
+
SwipeUtil.springs = (() => {
|
|
94
|
+
try {
|
|
95
|
+
return typeof CSS !== 'undefined' && CSS.supports('transition-timing-function', 'linear(0, 1)');
|
|
96
|
+
}
|
|
97
|
+
catch (_a) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
})();
|
|
101
|
+
/**
|
|
102
|
+
* How what the finger let go at `from` at `speed` slides on to `to`, never past `bounds`: a spring that starts at
|
|
103
|
+
* the speed of the finger where the page draws it (SwipeSpring), else CURVE for `duration`. `longest` is how long
|
|
104
|
+
* its style slides it.
|
|
105
|
+
*/
|
|
106
|
+
function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
|
|
107
|
+
if (SwipeUtil.springs) {
|
|
108
|
+
return SwipeSpring.motion(from, to, speed, longest, bounds);
|
|
109
|
+
}
|
|
110
|
+
return { ms: Math.abs(to - from) < SwipeSpring.REST_PX ? 0 : duration(to - from, speed, longest), easing: SwipeUtil.CURVE };
|
|
88
111
|
}
|
|
89
|
-
SwipeUtil.
|
|
112
|
+
SwipeUtil.motion = motion;
|
|
90
113
|
})(SwipeUtil || (SwipeUtil = {}));
|
|
114
|
+
/**
|
|
115
|
+
* What a finger lets go slides on as on a spring, as the sheets of iOS: at the speed the finger had, slowing
|
|
116
|
+
* down to where it rests, never past it; going the other way, it goes on a little that way first, as far as it
|
|
117
|
+
* may. A sheet let go near where it rests settles there quickly, one let go far away takes its time. Drawn by
|
|
118
|
+
* the compositor as a CSS transition, its curve a `linear()` of the spring's points. Pure, for the tests.
|
|
119
|
+
*/
|
|
120
|
+
export var SwipeSpring;
|
|
121
|
+
(function (SwipeSpring) {
|
|
122
|
+
/** How stiff, for what its style slides in `longest` ms: ω = STIFFNESS / longest, 95% of the way in about 0.6 × longest from rest. */
|
|
123
|
+
SwipeSpring.STIFFNESS = 8;
|
|
124
|
+
/** It rests once nearer than this, in pixels. */
|
|
125
|
+
SwipeSpring.REST_PX = 0.5;
|
|
126
|
+
/** A point of its curve this often, in milliseconds. */
|
|
127
|
+
const STEP_MS = 12;
|
|
128
|
+
/** How far it still is from where it rests, of the way, after `t` ms: critically damped, at `speed` (of the way a millisecond) at first. */
|
|
129
|
+
function left(t, omega, speed) {
|
|
130
|
+
return (1 + (omega - speed) * t) * Math.exp(-omega * t);
|
|
131
|
+
}
|
|
132
|
+
SwipeSpring.left = left;
|
|
133
|
+
function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
|
|
134
|
+
const distance = to - from;
|
|
135
|
+
const span = Math.abs(distance);
|
|
136
|
+
if (span < SwipeSpring.REST_PX) {
|
|
137
|
+
return { ms: 0, easing: 'linear' };
|
|
138
|
+
}
|
|
139
|
+
const toward = (Math.sign(distance) * speed) / span;
|
|
140
|
+
// Flicked faster than the spring goes, it is stiffer: it goes on at the finger's speed, and never past where it rests.
|
|
141
|
+
const omega = Math.max(SwipeSpring.STIFFNESS / longest, toward);
|
|
142
|
+
let ms = STEP_MS;
|
|
143
|
+
while (ms < longest * 2 && Math.abs(left(ms, omega, toward)) * span > SwipeSpring.REST_PX) {
|
|
144
|
+
ms += 4;
|
|
145
|
+
}
|
|
146
|
+
// The other way, it goes on only as far as it may.
|
|
147
|
+
const behind = distance > 0 ? from - bounds[0] : bounds[1] - from;
|
|
148
|
+
const lowest = -Math.max(0, behind) / span;
|
|
149
|
+
const count = Math.max(8, Math.ceil(ms / STEP_MS));
|
|
150
|
+
const points = [];
|
|
151
|
+
for (let i = 0; i <= count; i++) {
|
|
152
|
+
const progress = i === count ? 1 : Math.max(lowest, 1 - left((ms * i) / count, omega, toward));
|
|
153
|
+
points.push(String(Math.round(progress * 1000) / 1000));
|
|
154
|
+
}
|
|
155
|
+
return { ms, easing: `linear(${points.join(', ')})` };
|
|
156
|
+
}
|
|
157
|
+
SwipeSpring.motion = motion;
|
|
158
|
+
})(SwipeSpring || (SwipeSpring = {}));
|
|
91
159
|
/**
|
|
92
160
|
* The speed of a finger along x, in pixels a millisecond, of its last moves (SwipeUtil.VELOCITY_MS): let go
|
|
93
161
|
* after a slow drag and a flick it is the flick's, held still a moment it is none.
|
|
@@ -115,43 +183,254 @@ export class SwipeVelocity {
|
|
|
115
183
|
return ms > 0 ? (last[this.axis] - first[this.axis]) / ms : 0;
|
|
116
184
|
}
|
|
117
185
|
}
|
|
186
|
+
/** The settle that holds an element now: one at a time, so that a finger that takes it stops whatever slid it. */
|
|
187
|
+
const holders = new WeakMap();
|
|
118
188
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
189
|
+
* The elements a finger moves, then lets go (SwipeMotion): while it moves them their styles do not slide
|
|
190
|
+
* them; let go, they slide on to where they rest with transitions of their own, and only once they are there,
|
|
191
|
+
* and the state has them there too (`ready`), they are their styles' again. So the slide starts in the frame
|
|
192
|
+
* the finger lets go, before the page draws what the state changed (which may take a while: a long
|
|
193
|
+
* conversation), and never jumps if it takes longer than the slide. A finger that takes one of them again, or
|
|
194
|
+
* another swipe that moves it, stops it where it is now.
|
|
121
195
|
*/
|
|
122
196
|
export class SwipeSettle {
|
|
123
197
|
constructor() {
|
|
124
|
-
this.elements =
|
|
198
|
+
this.elements = new Set();
|
|
125
199
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
200
|
+
/** Whether some of its elements are still its own: moved, or sliding on. */
|
|
201
|
+
get busy() {
|
|
202
|
+
return this.elements.size > 0;
|
|
203
|
+
}
|
|
204
|
+
/** A finger moves these: each stops where it is, whatever slid it, and its style no longer slides it. */
|
|
205
|
+
hold(elements) {
|
|
206
|
+
clearTimeout(this.timer);
|
|
207
|
+
this.done = undefined;
|
|
208
|
+
for (const element of elements) {
|
|
209
|
+
if (element) {
|
|
210
|
+
this.take(element);
|
|
211
|
+
element.style.transition = 'none';
|
|
212
|
+
}
|
|
130
213
|
}
|
|
131
|
-
|
|
132
|
-
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Let go, each slides on to its target as `motion` says; once there and `ready()`, they are their styles'
|
|
217
|
+
* again and `done` runs.
|
|
218
|
+
*/
|
|
219
|
+
run(motion, targets, ready, done) {
|
|
220
|
+
clearTimeout(this.timer);
|
|
221
|
+
const transition = motion.ms > 0 ? `transform ${motion.ms}ms ${motion.easing}, opacity ${motion.ms}ms ${motion.easing}` : 'none';
|
|
222
|
+
for (const { element, transform, opacity } of targets) {
|
|
223
|
+
if (!element) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
this.take(element);
|
|
227
|
+
element.style.transition = transition;
|
|
228
|
+
if (transform !== undefined) {
|
|
229
|
+
element.style.transform = transform;
|
|
230
|
+
}
|
|
231
|
+
if (opacity !== undefined) {
|
|
232
|
+
element.style.opacity = String(opacity);
|
|
233
|
+
}
|
|
133
234
|
}
|
|
134
|
-
this.
|
|
235
|
+
this.done = done;
|
|
236
|
+
const until = Date.now() + motion.ms + SwipeSettle.READY_MS;
|
|
237
|
+
const check = () => {
|
|
238
|
+
if (ready() || Date.now() > until) {
|
|
239
|
+
this.finish();
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
this.timer = setTimeout(check, 32);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
this.timer = setTimeout(check, motion.ms + 16);
|
|
135
246
|
}
|
|
136
|
-
|
|
247
|
+
/** They are their styles' again at once, where those say they rest, without sliding there. */
|
|
248
|
+
finish() {
|
|
249
|
+
this.giveBack(false);
|
|
250
|
+
}
|
|
251
|
+
/** They are their styles' again from where they are now: the styles slide them on to where they rest. */
|
|
252
|
+
release() {
|
|
253
|
+
this.giveBack(true);
|
|
254
|
+
}
|
|
255
|
+
giveBack(slide) {
|
|
137
256
|
clearTimeout(this.timer);
|
|
138
|
-
|
|
257
|
+
const elements = [...this.elements];
|
|
258
|
+
this.elements.clear();
|
|
259
|
+
const done = this.done;
|
|
260
|
+
this.done = undefined;
|
|
261
|
+
if (slide) {
|
|
262
|
+
for (const element of elements) {
|
|
263
|
+
this.freeze(element);
|
|
264
|
+
}
|
|
265
|
+
// Where they are now is where the styles slide them from.
|
|
266
|
+
if (elements.length) {
|
|
267
|
+
void getComputedStyle(elements[0]).transform;
|
|
268
|
+
}
|
|
269
|
+
done === null || done === void 0 ? void 0 : done();
|
|
270
|
+
for (const element of elements) {
|
|
271
|
+
SwipeSettle.clean(element, this);
|
|
272
|
+
element.style.removeProperty('transition');
|
|
273
|
+
}
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
for (const element of elements) {
|
|
277
|
+
element.style.transition = 'none';
|
|
278
|
+
SwipeSettle.clean(element, this);
|
|
279
|
+
}
|
|
280
|
+
done === null || done === void 0 ? void 0 : done();
|
|
281
|
+
// Where they rest is drawn with no transition, then theirs are the styles' again.
|
|
282
|
+
if (elements.length) {
|
|
283
|
+
void getComputedStyle(elements[0]).transform;
|
|
284
|
+
}
|
|
285
|
+
for (const element of elements) {
|
|
139
286
|
element.style.removeProperty('transition');
|
|
140
287
|
}
|
|
141
|
-
this.elements = [];
|
|
142
288
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
289
|
+
static clean(element, holder) {
|
|
290
|
+
if (holders.get(element) === holder) {
|
|
291
|
+
holders.delete(element);
|
|
292
|
+
}
|
|
293
|
+
element.style.removeProperty('transform');
|
|
294
|
+
element.style.removeProperty('opacity');
|
|
295
|
+
element.style.removeProperty('visibility');
|
|
296
|
+
}
|
|
297
|
+
/** Takes `element` from the settle that has it, stopped where it is. */
|
|
298
|
+
take(element) {
|
|
299
|
+
const holder = holders.get(element);
|
|
300
|
+
if (holder && holder !== this) {
|
|
301
|
+
holder.elements.delete(element);
|
|
302
|
+
}
|
|
303
|
+
if (holder) {
|
|
304
|
+
this.freeze(element);
|
|
305
|
+
}
|
|
306
|
+
holders.set(element, this);
|
|
307
|
+
this.elements.add(element);
|
|
308
|
+
}
|
|
309
|
+
/** What slides stops where it is now. */
|
|
310
|
+
freeze(element) {
|
|
311
|
+
const transition = element.style.transition;
|
|
312
|
+
if (!transition || transition === 'none') {
|
|
146
313
|
return;
|
|
147
314
|
}
|
|
148
|
-
|
|
149
|
-
|
|
315
|
+
const style = getComputedStyle(element);
|
|
316
|
+
if (element.style.transform) {
|
|
317
|
+
element.style.transform = style.transform;
|
|
150
318
|
}
|
|
151
|
-
|
|
152
|
-
element.style.
|
|
153
|
-
|
|
319
|
+
if (element.style.opacity) {
|
|
320
|
+
element.style.opacity = style.opacity;
|
|
321
|
+
}
|
|
322
|
+
element.style.transition = 'none';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/** How long it waits for the state, past the slide, before giving the elements back anyway. */
|
|
326
|
+
SwipeSettle.READY_MS = 1000;
|
|
327
|
+
/**
|
|
328
|
+
* What a swipe let go changes in the state of the page, once the frame it was let go in is drawn and its slide
|
|
329
|
+
* set off (FrameUtil.painted), or after a while where frames are not drawn (a page out of sight); only if it
|
|
330
|
+
* changes something: the workbench is put away by the same call that brings it out.
|
|
331
|
+
*/
|
|
332
|
+
export function afterLetGo(open, current) {
|
|
333
|
+
let called = false;
|
|
334
|
+
const call = () => {
|
|
335
|
+
if (!called) {
|
|
336
|
+
called = true;
|
|
337
|
+
if (current().open !== open) {
|
|
338
|
+
current().setOpen(open);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
void FrameUtil.painted().then(call);
|
|
343
|
+
setTimeout(call, 100);
|
|
344
|
+
}
|
|
345
|
+
/** Where `element` is moved along `axis` now, by its transform: wherever a style or a slide has it. */
|
|
346
|
+
export function translated(element, axis = 'x') {
|
|
347
|
+
const transform = getComputedStyle(element).transform;
|
|
348
|
+
if (!transform || transform === 'none') {
|
|
349
|
+
return 0;
|
|
350
|
+
}
|
|
351
|
+
const matrix = new DOMMatrixReadOnly(transform);
|
|
352
|
+
return axis === 'x' ? matrix.m41 : matrix.m42;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
|
|
356
|
+
* it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
|
|
357
|
+
* the finger) while the document no longer does, and on the document too, each event once. Another finger put
|
|
358
|
+
* down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
|
|
359
|
+
*/
|
|
360
|
+
export class SwipeFinger {
|
|
361
|
+
/** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
|
|
362
|
+
constructor(on, blocking = false) {
|
|
363
|
+
this.on = on;
|
|
364
|
+
this.blocking = blocking;
|
|
365
|
+
this.targets = [];
|
|
366
|
+
this.onMove = (event) => {
|
|
367
|
+
if (event === this.last) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
this.last = event;
|
|
371
|
+
const touch = this.find(event.touches);
|
|
372
|
+
if (touch) {
|
|
373
|
+
this.on.move(event, touch);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
this.onEnd = (event) => {
|
|
377
|
+
if (event === this.last) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
this.last = event;
|
|
381
|
+
const touch = this.find(event.changedTouches);
|
|
382
|
+
if (touch) {
|
|
383
|
+
this.stop();
|
|
384
|
+
this.on.end(event, touch);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
get down() {
|
|
389
|
+
return this.id !== undefined;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
|
|
393
|
+
* another, which is still down, or when several are.
|
|
394
|
+
*/
|
|
395
|
+
follow(event, doc) {
|
|
396
|
+
if (this.down) {
|
|
397
|
+
if (this.find(event.touches)) {
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
const lost = event;
|
|
401
|
+
this.stop();
|
|
402
|
+
this.on.end(lost, undefined);
|
|
403
|
+
}
|
|
404
|
+
const touch = event.changedTouches[0];
|
|
405
|
+
if (event.touches.length !== 1 || !touch) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
this.id = touch.identifier;
|
|
409
|
+
const target = event.target;
|
|
410
|
+
this.targets = target && target !== doc ? [target, doc] : [doc];
|
|
411
|
+
for (const element of this.targets) {
|
|
412
|
+
element.addEventListener('touchmove', this.onMove, { passive: !this.blocking });
|
|
413
|
+
element.addEventListener('touchend', this.onEnd, { passive: true });
|
|
414
|
+
element.addEventListener('touchcancel', this.onEnd, { passive: true });
|
|
415
|
+
}
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
stop() {
|
|
419
|
+
for (const element of this.targets) {
|
|
420
|
+
element.removeEventListener('touchmove', this.onMove);
|
|
421
|
+
element.removeEventListener('touchend', this.onEnd);
|
|
422
|
+
element.removeEventListener('touchcancel', this.onEnd);
|
|
154
423
|
}
|
|
424
|
+
this.targets = [];
|
|
425
|
+
this.id = undefined;
|
|
426
|
+
}
|
|
427
|
+
find(touches) {
|
|
428
|
+
for (let i = 0; i < touches.length; i++) {
|
|
429
|
+
if (touches[i].identifier === this.id) {
|
|
430
|
+
return touches[i];
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return undefined;
|
|
155
434
|
}
|
|
156
435
|
}
|
|
157
436
|
/** How far what the sheet covers moves, of the width of the sheet (as the styles of the phone, style/phone.ts). */
|
|
@@ -229,8 +508,10 @@ class TouchSources {
|
|
|
229
508
|
* Lets the finger move a sheet while `enabled`, then `setOpen` says where it ended; its style says where it
|
|
230
509
|
* rests. Smooth on a long conversation: each move only sets transforms and an opacity, which the compositor
|
|
231
510
|
* draws, never a style the page inherits; the page keeps scrolling on the compositor too, as the listener that
|
|
232
|
-
* may hold a move back is only there while a touch may be the sheet's.
|
|
233
|
-
*
|
|
511
|
+
* may hold a move back is only there while a touch may be the sheet's. Let go, it slides on at once, as on a
|
|
512
|
+
* spring (SwipeSettle, SwipeSpring), and the state changes in the frames after, so that what the page draws
|
|
513
|
+
* for it never holds the sheet still half way. A sheet still sliding, the finger takes it where it is. A touch
|
|
514
|
+
* in a frame the page may read moves it as well (TouchSources).
|
|
234
515
|
*/
|
|
235
516
|
export function useSheetSwipe(options) {
|
|
236
517
|
const latest = React.useRef(options);
|
|
@@ -242,53 +523,63 @@ export function useSheetSwipe(options) {
|
|
|
242
523
|
}
|
|
243
524
|
const root = document.documentElement;
|
|
244
525
|
let start;
|
|
526
|
+
let last;
|
|
245
527
|
let claimed;
|
|
246
528
|
let moved;
|
|
247
529
|
let source;
|
|
248
530
|
const velocity = new SwipeVelocity();
|
|
249
531
|
const settle = new SwipeSettle();
|
|
250
|
-
const point = (event, touch
|
|
532
|
+
const point = (event, touch) => {
|
|
251
533
|
var _a;
|
|
252
|
-
var _b, _c
|
|
534
|
+
var _b, _c;
|
|
253
535
|
const box = (_a = source === null || source === void 0 ? void 0 : source.frame) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
254
|
-
return { x:
|
|
536
|
+
return { x: touch.clientX + ((_b = box === null || box === void 0 ? void 0 : box.left) !== null && _b !== void 0 ? _b : 0), y: touch.clientY + ((_c = box === null || box === void 0 ? void 0 : box.top) !== null && _c !== void 0 ? _c : 0), t: event.timeStamp };
|
|
255
537
|
};
|
|
256
538
|
const find = (selector) => (selector ? document.querySelector(selector) : null);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
539
|
+
/** Where each is with the sheet at `x`. */
|
|
540
|
+
const targets = (elements, x) => {
|
|
541
|
+
const out = 1 - Math.abs(x) / elements.width;
|
|
542
|
+
return [
|
|
543
|
+
{ element: elements.sheet, transform: `translate3d(${x}px, 0, 0)` },
|
|
544
|
+
{ element: elements.under, transform: `translate3d(${SwipeUtil.outward(latest.current) * UNDER * elements.width * out}px, 0, 0)` },
|
|
545
|
+
{ element: elements.scrim, opacity: out },
|
|
546
|
+
];
|
|
264
547
|
};
|
|
265
|
-
const
|
|
266
|
-
source === null || source === void 0 ? void 0 : source.doc.removeEventListener('touchmove', onMove);
|
|
548
|
+
const reset = () => {
|
|
267
549
|
start = undefined;
|
|
550
|
+
last = undefined;
|
|
551
|
+
claimed = undefined;
|
|
552
|
+
moved = undefined;
|
|
268
553
|
source = undefined;
|
|
269
554
|
};
|
|
270
|
-
const onMove = (event) => {
|
|
555
|
+
const onMove = (event, touch) => {
|
|
271
556
|
var _a;
|
|
557
|
+
var _b;
|
|
272
558
|
const current = latest.current;
|
|
273
559
|
if (!start || claimed === false) {
|
|
274
560
|
return;
|
|
275
561
|
}
|
|
276
|
-
const now = point(event);
|
|
562
|
+
const now = point(event, touch);
|
|
277
563
|
if (claimed === undefined) {
|
|
278
564
|
claimed = SwipeUtil.takes(current, start, now, current.open, () => scrollsSideways(event.target));
|
|
279
565
|
if (claimed === undefined) {
|
|
280
566
|
return;
|
|
281
567
|
}
|
|
282
568
|
if (!claimed) {
|
|
283
|
-
stop();
|
|
569
|
+
finger.stop();
|
|
570
|
+
reset();
|
|
284
571
|
return;
|
|
285
572
|
}
|
|
286
|
-
settle.clear();
|
|
287
573
|
const sheet = find(current.sheet);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
574
|
+
const width = (sheet === null || sheet === void 0 ? void 0 : sheet.getBoundingClientRect().width) || window.innerWidth;
|
|
575
|
+
// From where it is: at rest, or still sliding.
|
|
576
|
+
const from = sheet ? translated(sheet) : current.open ? 0 : SwipeUtil.away(current, width);
|
|
577
|
+
moved = { sheet, under: find(current.under), scrim: find(current.scrim), width, from };
|
|
578
|
+
settle.hold([moved.sheet, moved.under, moved.scrim]);
|
|
579
|
+
root.dataset.sheetDrag = (_b = current.name) !== null && _b !== void 0 ? _b : '';
|
|
580
|
+
// Seen while it moves, and while it slides on, whatever the styles say of where they rest.
|
|
291
581
|
sheet === null || sheet === void 0 ? void 0 : sheet.style.setProperty('visibility', 'visible');
|
|
582
|
+
(_a = moved.under) === null || _a === void 0 ? void 0 : _a.style.setProperty('visibility', 'visible');
|
|
292
583
|
}
|
|
293
584
|
if (!moved) {
|
|
294
585
|
return;
|
|
@@ -296,71 +587,82 @@ export function useSheetSwipe(options) {
|
|
|
296
587
|
// The page does not scroll under a sheet being dragged.
|
|
297
588
|
event.preventDefault();
|
|
298
589
|
velocity.add(now);
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
590
|
+
last = now;
|
|
591
|
+
const x = SwipeUtil.position(current, moved.from, now.x - start.x, moved.width);
|
|
592
|
+
for (const { element, transform, opacity } of targets(moved, x)) {
|
|
593
|
+
if (element && transform) {
|
|
594
|
+
element.style.transform = transform;
|
|
595
|
+
}
|
|
596
|
+
if (element && opacity !== undefined) {
|
|
597
|
+
element.style.opacity = String(opacity);
|
|
598
|
+
}
|
|
306
599
|
}
|
|
307
|
-
|
|
308
|
-
|
|
600
|
+
};
|
|
601
|
+
const onEnd = (event, touch) => {
|
|
602
|
+
var _a;
|
|
603
|
+
if (start && claimed && moved) {
|
|
604
|
+
const current = latest.current;
|
|
605
|
+
const end = touch ? point(event, touch) : (last !== null && last !== void 0 ? last : start);
|
|
606
|
+
if (touch) {
|
|
607
|
+
velocity.add(end);
|
|
608
|
+
}
|
|
609
|
+
const speed = touch ? velocity.speed : 0;
|
|
610
|
+
const x = SwipeUtil.position(current, moved.from, end.x - start.x, moved.width);
|
|
611
|
+
const out = SwipeUtil.settle(current, x, moved.width, speed);
|
|
612
|
+
const away = SwipeUtil.away(current, moved.width);
|
|
613
|
+
const rest = out ? 0 : away;
|
|
614
|
+
const motion = SwipeUtil.motion(x, rest, speed, (_a = current.settleMs) !== null && _a !== void 0 ? _a : SETTLE_MS, [Math.min(0, away), Math.max(0, away)]);
|
|
615
|
+
delete root.dataset.sheetDrag;
|
|
616
|
+
// It slides on now; the state follows once that is drawn, so that what it changes never holds it still.
|
|
617
|
+
settle.run(motion, targets(moved, rest), () => latest.current.open === out);
|
|
618
|
+
afterLetGo(out, () => latest.current);
|
|
309
619
|
}
|
|
620
|
+
reset();
|
|
310
621
|
};
|
|
622
|
+
const finger = new SwipeFinger({ move: onMove, end: onEnd }, true);
|
|
311
623
|
const onStart = (event, from) => {
|
|
312
624
|
var _a;
|
|
313
625
|
const current = latest.current;
|
|
314
|
-
|
|
315
|
-
|
|
626
|
+
// Another finger beside the one that moves it changes nothing; the end of that one never seen, it ends now.
|
|
627
|
+
if (finger.down) {
|
|
628
|
+
if (!finger.follow(event, from.doc)) {
|
|
629
|
+
// A second finger before the swipe was told from a scroll pinches (a picture): it is not the sheet's.
|
|
630
|
+
if (claimed === undefined && event.touches.length > 1) {
|
|
631
|
+
finger.stop();
|
|
632
|
+
reset();
|
|
633
|
+
}
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
finger.stop();
|
|
637
|
+
}
|
|
638
|
+
reset();
|
|
316
639
|
source = from;
|
|
317
|
-
const
|
|
640
|
+
const touch = event.touches[0];
|
|
318
641
|
const target = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.ELEMENT_NODE ? event.target : null;
|
|
642
|
+
// Over all of the page (ui.FullScreen), even the edges are its own.
|
|
643
|
+
if (OwnGestures.whole(target)) {
|
|
644
|
+
source = undefined;
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
319
647
|
const fromEdge = !current.open && !!current.edgeOver && !!(target === null || target === void 0 ? void 0 : target.closest(current.edgeOver));
|
|
320
|
-
|
|
321
|
-
|
|
648
|
+
// In a game (an element that takes its touches), the shell keeps only the edges of the screen.
|
|
649
|
+
const sheet = OwnGestures.within(target) ? OwnGestures.edgesOnly(current) : fromEdge ? { ...current, opensFrom: 'edge' } : current;
|
|
650
|
+
if (event.touches.length !== 1 || !touch) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
const at = point(event, touch);
|
|
654
|
+
if (SwipeUtil.starts(sheet, at, current.open, window.innerWidth) && finger.follow(event, from.doc)) {
|
|
322
655
|
start = at;
|
|
323
656
|
velocity.start(at);
|
|
324
|
-
from.doc.addEventListener('touchmove', onMove, { passive: false });
|
|
325
657
|
}
|
|
326
658
|
else {
|
|
327
|
-
|
|
659
|
+
source = undefined;
|
|
328
660
|
}
|
|
329
661
|
};
|
|
330
|
-
const onEnd = (event) => {
|
|
331
|
-
var _a;
|
|
332
|
-
if (start && claimed && moved) {
|
|
333
|
-
const current = latest.current;
|
|
334
|
-
const end = point(event, event.changedTouches[0]);
|
|
335
|
-
const dx = end.x - start.x;
|
|
336
|
-
velocity.add(end);
|
|
337
|
-
const speed = velocity.speed;
|
|
338
|
-
const out = SwipeUtil.settle(current, dx, moved.width, current.open, speed);
|
|
339
|
-
const x = SwipeUtil.offset(current, dx, moved.width, current.open);
|
|
340
|
-
const rest = out ? 0 : -SwipeUtil.outward(current) * moved.width;
|
|
341
|
-
const ms = SwipeUtil.duration(rest - x, speed, (_a = current.settleMs) !== null && _a !== void 0 ? _a : SETTLE_MS);
|
|
342
|
-
current.setOpen(out);
|
|
343
|
-
// Released in the frame the sheet takes its place, so that it slides on from where the finger left it, at its speed.
|
|
344
|
-
const elements = moved;
|
|
345
|
-
requestAnimationFrame(() => {
|
|
346
|
-
settle.run(ms, [elements.sheet, elements.under], [elements.scrim]);
|
|
347
|
-
release(elements);
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
moved = undefined;
|
|
351
|
-
stop();
|
|
352
|
-
claimed = undefined;
|
|
353
|
-
};
|
|
354
662
|
const sources = new TouchSources(from => {
|
|
355
663
|
const begin = (event) => onStart(event, from);
|
|
356
664
|
from.doc.addEventListener('touchstart', begin, { passive: true });
|
|
357
|
-
from.doc.
|
|
358
|
-
from.doc.addEventListener('touchcancel', onEnd, { passive: true });
|
|
359
|
-
return () => {
|
|
360
|
-
from.doc.removeEventListener('touchstart', begin);
|
|
361
|
-
from.doc.removeEventListener('touchend', onEnd);
|
|
362
|
-
from.doc.removeEventListener('touchcancel', onEnd);
|
|
363
|
-
};
|
|
665
|
+
return () => from.doc.removeEventListener('touchstart', begin);
|
|
364
666
|
});
|
|
365
667
|
const edge = !!latest.current.edgeOver;
|
|
366
668
|
if (edge) {
|
|
@@ -371,9 +673,13 @@ export function useSheetSwipe(options) {
|
|
|
371
673
|
delete root.dataset.edgeSwipe;
|
|
372
674
|
}
|
|
373
675
|
sources.dispose();
|
|
374
|
-
stop();
|
|
375
|
-
|
|
376
|
-
|
|
676
|
+
finger.stop();
|
|
677
|
+
// A sheet still under the finger goes back to where it rests; one sliding on finishes its slide.
|
|
678
|
+
if (moved) {
|
|
679
|
+
delete root.dataset.sheetDrag;
|
|
680
|
+
settle.finish();
|
|
681
|
+
}
|
|
682
|
+
reset();
|
|
377
683
|
};
|
|
378
684
|
}, [enabled]);
|
|
379
685
|
}
|