@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
|
@@ -33,448 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SwipeFinger = exports.SwipeSettle = exports.SwipeVelocity = exports.SwipeSpring = exports.SwipeUtil = void 0;
|
|
37
|
-
exports.afterLetGo = afterLetGo;
|
|
38
|
-
exports.translated = translated;
|
|
39
36
|
exports.useSheetSwipe = useSheetSwipe;
|
|
40
37
|
const React = __importStar(require("react"));
|
|
41
|
-
const frame_1 = require("../util/frame");
|
|
42
|
-
const device_protocol_1 = require("./device-protocol");
|
|
43
38
|
const own_gestures_1 = require("./own-gestures");
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/** A swipe from an edge starts this close to it: the rest of the page scrolls and selects. */
|
|
48
|
-
SwipeUtil.EDGE_PX = 24;
|
|
49
|
-
/** How far the finger moves before the swipe is told from a scroll. */
|
|
50
|
-
SwipeUtil.SLOP_PX = 10;
|
|
51
|
-
/** A flick: faster than this, in pixels a millisecond, it goes the way it was flicked whatever the distance. */
|
|
52
|
-
SwipeUtil.FLICK = 0.4;
|
|
53
|
-
/** How it slides on, let go: the curve of the sheets of iOS, as the styles slide them (style/phone.ts). */
|
|
54
|
-
SwipeUtil.CURVE = device_protocol_1.DeviceMotion.SHEET_CURVE;
|
|
55
|
-
/** How much faster than on average CURVE starts: the slope of its first control point (0.72 / 0.32). */
|
|
56
|
-
const CURVE_START = 0.72 / 0.32;
|
|
57
|
-
/** The quickest it slides on, however fast it was flicked. */
|
|
58
|
-
SwipeUtil.SHORTEST_MS = 120;
|
|
59
|
-
/** The speed of the finger let go is that of its last moves, this long. */
|
|
60
|
-
SwipeUtil.VELOCITY_MS = 80;
|
|
61
|
-
/** 1 when the finger moves right to bring the sheet out, -1 when left. */
|
|
62
|
-
function outward(sheet) {
|
|
63
|
-
return sheet.side === 'left' ? 1 : -1;
|
|
64
|
-
}
|
|
65
|
-
SwipeUtil.outward = outward;
|
|
66
|
-
/** The way the finger moves now: out while it is away, back while it is out. */
|
|
67
|
-
function way(sheet, open) {
|
|
68
|
-
return open ? -outward(sheet) : outward(sheet);
|
|
69
|
-
}
|
|
70
|
-
/** Whether a touch at `start` may move the sheet, on a screen `width` wide. */
|
|
71
|
-
function starts(sheet, start, open, width) {
|
|
72
|
-
const from = open ? sheet.closesFrom : sheet.opensFrom;
|
|
73
|
-
if (from !== 'edge') {
|
|
74
|
-
return from === 'anywhere';
|
|
75
|
-
}
|
|
76
|
-
return way(sheet, open) > 0 ? start.x <= SwipeUtil.EDGE_PX : start.x >= width - SwipeUtil.EDGE_PX;
|
|
77
|
-
}
|
|
78
|
-
SwipeUtil.starts = starts;
|
|
79
|
-
/** Whether the move so far is the sheet's (more sideways than down, the right way); undefined until it is told. */
|
|
80
|
-
function claims(sheet, start, now, open) {
|
|
81
|
-
const dx = now.x - start.x;
|
|
82
|
-
const dy = now.y - start.y;
|
|
83
|
-
if (Math.hypot(dx, dy) < SwipeUtil.SLOP_PX) {
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
return Math.abs(dx) > Math.abs(dy) * 1.2 && dx * way(sheet, open) > 0;
|
|
87
|
-
}
|
|
88
|
-
SwipeUtil.claims = claims;
|
|
89
|
-
/**
|
|
90
|
-
* Whether the sheet takes the move so far: undefined while it is not told yet (a finger that sets off
|
|
91
|
-
* slowly moves a pixel or two a move, and is waited for), false when it is not the sheet's or what is under
|
|
92
|
-
* the finger scrolls sideways (`sideways`, asked only then: a tap or a scroll never reads the styles).
|
|
93
|
-
*/
|
|
94
|
-
function takes(sheet, start, now, open, sideways) {
|
|
95
|
-
const claimed = claims(sheet, start, now, open);
|
|
96
|
-
return claimed === undefined ? undefined : claimed && !sideways();
|
|
97
|
-
}
|
|
98
|
-
SwipeUtil.takes = takes;
|
|
99
|
-
/** Where the sheet rests away: `∓width`, on its side; out, it rests at 0. */
|
|
100
|
-
function away(sheet, width) {
|
|
101
|
-
return -outward(sheet) * width;
|
|
102
|
-
}
|
|
103
|
-
SwipeUtil.away = away;
|
|
104
|
-
/** Where the sheet is, between 0 (out) and away, when the finger moved `dx` from where it took it (`from`). */
|
|
105
|
-
function position(sheet, from, dx, width) {
|
|
106
|
-
const rest = away(sheet, width);
|
|
107
|
-
return Math.min(Math.max(rest, 0), Math.max(Math.min(rest, 0), from + dx));
|
|
108
|
-
}
|
|
109
|
-
SwipeUtil.position = position;
|
|
110
|
-
/** Whether it ends out, let go at `x` at `speed` (pixels a millisecond, SwipeVelocity): the way it was flicked, or the nearer side. */
|
|
111
|
-
function settle(sheet, x, width, speed) {
|
|
112
|
-
if (Math.abs(speed) > SwipeUtil.FLICK) {
|
|
113
|
-
return speed * outward(sheet) > 0;
|
|
114
|
-
}
|
|
115
|
-
return Math.abs(x) < width / 2;
|
|
116
|
-
}
|
|
117
|
-
SwipeUtil.settle = settle;
|
|
118
|
-
/**
|
|
119
|
-
* How long it slides on to where it rests, `distance` away (signed), let go at `speed`, where the curves of
|
|
120
|
-
* `linear()` are not (SwipeSpring): on CURVE, as fast at first as the finger was; `longest` (the style's)
|
|
121
|
-
* when the finger was slow, or going the other way.
|
|
122
|
-
*/
|
|
123
|
-
function duration(distance, speed, longest) {
|
|
124
|
-
const toward = Math.sign(distance) * speed;
|
|
125
|
-
if (toward <= 0 || distance === 0) {
|
|
126
|
-
return longest;
|
|
127
|
-
}
|
|
128
|
-
return Math.round(Math.min(longest, Math.max(SwipeUtil.SHORTEST_MS, (CURVE_START * Math.abs(distance)) / toward)));
|
|
129
|
-
}
|
|
130
|
-
SwipeUtil.duration = duration;
|
|
131
|
-
/** Whether the page draws the curves of `linear()` (iOS 17.2, Chrome 113 on): a spring then, else CURVE. */
|
|
132
|
-
SwipeUtil.springs = (() => {
|
|
133
|
-
try {
|
|
134
|
-
return typeof CSS !== 'undefined' && CSS.supports('transition-timing-function', 'linear(0, 1)');
|
|
135
|
-
}
|
|
136
|
-
catch (_a) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
})();
|
|
140
|
-
/**
|
|
141
|
-
* How what the finger let go at `from` at `speed` slides on to `to`, never past `bounds`: a spring that starts at
|
|
142
|
-
* the speed of the finger where the page draws it (SwipeSpring), else CURVE for `duration`. `longest` is how long
|
|
143
|
-
* its style slides it.
|
|
144
|
-
*/
|
|
145
|
-
function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
|
|
146
|
-
if (SwipeUtil.springs) {
|
|
147
|
-
return SwipeSpring.motion(from, to, speed, longest, bounds);
|
|
148
|
-
}
|
|
149
|
-
return { ms: Math.abs(to - from) < SwipeSpring.REST_PX ? 0 : duration(to - from, speed, longest), easing: SwipeUtil.CURVE };
|
|
150
|
-
}
|
|
151
|
-
SwipeUtil.motion = motion;
|
|
152
|
-
})(SwipeUtil || (exports.SwipeUtil = SwipeUtil = {}));
|
|
153
|
-
/**
|
|
154
|
-
* What a finger lets go slides on as on a spring, as the sheets of iOS: at the speed the finger had, slowing
|
|
155
|
-
* down to where it rests, never past it; going the other way, it goes on a little that way first, as far as it
|
|
156
|
-
* may. A sheet let go near where it rests settles there quickly, one let go far away takes its time. Drawn by
|
|
157
|
-
* the compositor as a CSS transition, its curve a `linear()` of the spring's points. Pure, for the tests.
|
|
158
|
-
*/
|
|
159
|
-
var SwipeSpring;
|
|
160
|
-
(function (SwipeSpring) {
|
|
161
|
-
/** How stiff, for what its style slides in `longest` ms: ω = STIFFNESS / longest, 95% of the way in about 0.6 × longest from rest. */
|
|
162
|
-
SwipeSpring.STIFFNESS = 8;
|
|
163
|
-
/** It rests once nearer than this, in pixels. */
|
|
164
|
-
SwipeSpring.REST_PX = 0.5;
|
|
165
|
-
/** A point of its curve this often, in milliseconds. */
|
|
166
|
-
const STEP_MS = 12;
|
|
167
|
-
/** 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. */
|
|
168
|
-
function left(t, omega, speed) {
|
|
169
|
-
return (1 + (omega - speed) * t) * Math.exp(-omega * t);
|
|
170
|
-
}
|
|
171
|
-
SwipeSpring.left = left;
|
|
172
|
-
function motion(from, to, speed, longest, bounds = [-Infinity, Infinity]) {
|
|
173
|
-
const distance = to - from;
|
|
174
|
-
const span = Math.abs(distance);
|
|
175
|
-
if (span < SwipeSpring.REST_PX) {
|
|
176
|
-
return { ms: 0, easing: 'linear' };
|
|
177
|
-
}
|
|
178
|
-
const toward = (Math.sign(distance) * speed) / span;
|
|
179
|
-
// Flicked faster than the spring goes, it is stiffer: it goes on at the finger's speed, and never past where it rests.
|
|
180
|
-
const omega = Math.max(SwipeSpring.STIFFNESS / longest, toward);
|
|
181
|
-
let ms = STEP_MS;
|
|
182
|
-
while (ms < longest * 2 && Math.abs(left(ms, omega, toward)) * span > SwipeSpring.REST_PX) {
|
|
183
|
-
ms += 4;
|
|
184
|
-
}
|
|
185
|
-
// The other way, it goes on only as far as it may.
|
|
186
|
-
const behind = distance > 0 ? from - bounds[0] : bounds[1] - from;
|
|
187
|
-
const lowest = -Math.max(0, behind) / span;
|
|
188
|
-
const count = Math.max(8, Math.ceil(ms / STEP_MS));
|
|
189
|
-
const points = [];
|
|
190
|
-
for (let i = 0; i <= count; i++) {
|
|
191
|
-
const progress = i === count ? 1 : Math.max(lowest, 1 - left((ms * i) / count, omega, toward));
|
|
192
|
-
points.push(String(Math.round(progress * 1000) / 1000));
|
|
193
|
-
}
|
|
194
|
-
return { ms, easing: `linear(${points.join(', ')})` };
|
|
195
|
-
}
|
|
196
|
-
SwipeSpring.motion = motion;
|
|
197
|
-
})(SwipeSpring || (exports.SwipeSpring = SwipeSpring = {}));
|
|
198
|
-
/**
|
|
199
|
-
* The speed of a finger along x, in pixels a millisecond, of its last moves (SwipeUtil.VELOCITY_MS): let go
|
|
200
|
-
* after a slow drag and a flick it is the flick's, held still a moment it is none.
|
|
201
|
-
*/
|
|
202
|
-
class SwipeVelocity {
|
|
203
|
-
/** Along `x` by default; `y` for what the finger pulls down. */
|
|
204
|
-
constructor(axis = 'x') {
|
|
205
|
-
this.axis = axis;
|
|
206
|
-
this.points = [];
|
|
207
|
-
}
|
|
208
|
-
start(point) {
|
|
209
|
-
this.points = [point];
|
|
210
|
-
}
|
|
211
|
-
add(point) {
|
|
212
|
-
this.points.push(point);
|
|
213
|
-
const since = point.t - SwipeUtil.VELOCITY_MS;
|
|
214
|
-
while (this.points.length > 2 && this.points[1].t <= since) {
|
|
215
|
-
this.points.shift();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
get speed() {
|
|
219
|
-
const first = this.points[0];
|
|
220
|
-
const last = this.points[this.points.length - 1];
|
|
221
|
-
const ms = last && first ? last.t - first.t : 0;
|
|
222
|
-
return ms > 0 ? (last[this.axis] - first[this.axis]) / ms : 0;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
exports.SwipeVelocity = SwipeVelocity;
|
|
226
|
-
/** The settle that holds an element now: one at a time, so that a finger that takes it stops whatever slid it. */
|
|
227
|
-
const holders = new WeakMap();
|
|
228
|
-
/**
|
|
229
|
-
* The elements a finger moves, then lets go (SwipeMotion): while it moves them their styles do not slide
|
|
230
|
-
* them; let go, they slide on to where they rest with transitions of their own, and only once they are there,
|
|
231
|
-
* and the state has them there too (`ready`), they are their styles' again. So the slide starts in the frame
|
|
232
|
-
* the finger lets go, before the page draws what the state changed (which may take a while: a long
|
|
233
|
-
* conversation), and never jumps if it takes longer than the slide. A finger that takes one of them again, or
|
|
234
|
-
* another swipe that moves it, stops it where it is now.
|
|
235
|
-
*/
|
|
236
|
-
class SwipeSettle {
|
|
237
|
-
constructor() {
|
|
238
|
-
this.elements = new Set();
|
|
239
|
-
}
|
|
240
|
-
/** Whether some of its elements are still its own: moved, or sliding on. */
|
|
241
|
-
get busy() {
|
|
242
|
-
return this.elements.size > 0;
|
|
243
|
-
}
|
|
244
|
-
/** A finger moves these: each stops where it is, whatever slid it, and its style no longer slides it. */
|
|
245
|
-
hold(elements) {
|
|
246
|
-
clearTimeout(this.timer);
|
|
247
|
-
this.done = undefined;
|
|
248
|
-
for (const element of elements) {
|
|
249
|
-
if (element) {
|
|
250
|
-
this.take(element);
|
|
251
|
-
element.style.transition = 'none';
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Let go, each slides on to its target as `motion` says; once there and `ready()`, they are their styles'
|
|
257
|
-
* again and `done` runs.
|
|
258
|
-
*/
|
|
259
|
-
run(motion, targets, ready, done) {
|
|
260
|
-
clearTimeout(this.timer);
|
|
261
|
-
const transition = motion.ms > 0 ? `transform ${motion.ms}ms ${motion.easing}, opacity ${motion.ms}ms ${motion.easing}` : 'none';
|
|
262
|
-
for (const { element, transform, opacity } of targets) {
|
|
263
|
-
if (!element) {
|
|
264
|
-
continue;
|
|
265
|
-
}
|
|
266
|
-
this.take(element);
|
|
267
|
-
element.style.transition = transition;
|
|
268
|
-
if (transform !== undefined) {
|
|
269
|
-
element.style.transform = transform;
|
|
270
|
-
}
|
|
271
|
-
if (opacity !== undefined) {
|
|
272
|
-
element.style.opacity = String(opacity);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
this.done = done;
|
|
276
|
-
const until = Date.now() + motion.ms + SwipeSettle.READY_MS;
|
|
277
|
-
const check = () => {
|
|
278
|
-
if (ready() || Date.now() > until) {
|
|
279
|
-
this.finish();
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
this.timer = setTimeout(check, 32);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
this.timer = setTimeout(check, motion.ms + 16);
|
|
286
|
-
}
|
|
287
|
-
/** They are their styles' again at once, where those say they rest, without sliding there. */
|
|
288
|
-
finish() {
|
|
289
|
-
this.giveBack(false);
|
|
290
|
-
}
|
|
291
|
-
/** They are their styles' again from where they are now: the styles slide them on to where they rest. */
|
|
292
|
-
release() {
|
|
293
|
-
this.giveBack(true);
|
|
294
|
-
}
|
|
295
|
-
giveBack(slide) {
|
|
296
|
-
clearTimeout(this.timer);
|
|
297
|
-
const elements = [...this.elements];
|
|
298
|
-
this.elements.clear();
|
|
299
|
-
const done = this.done;
|
|
300
|
-
this.done = undefined;
|
|
301
|
-
if (slide) {
|
|
302
|
-
for (const element of elements) {
|
|
303
|
-
this.freeze(element);
|
|
304
|
-
}
|
|
305
|
-
// Where they are now is where the styles slide them from.
|
|
306
|
-
if (elements.length) {
|
|
307
|
-
void getComputedStyle(elements[0]).transform;
|
|
308
|
-
}
|
|
309
|
-
done === null || done === void 0 ? void 0 : done();
|
|
310
|
-
for (const element of elements) {
|
|
311
|
-
SwipeSettle.clean(element, this);
|
|
312
|
-
element.style.removeProperty('transition');
|
|
313
|
-
}
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
for (const element of elements) {
|
|
317
|
-
element.style.transition = 'none';
|
|
318
|
-
SwipeSettle.clean(element, this);
|
|
319
|
-
}
|
|
320
|
-
done === null || done === void 0 ? void 0 : done();
|
|
321
|
-
// Where they rest is drawn with no transition, then theirs are the styles' again.
|
|
322
|
-
if (elements.length) {
|
|
323
|
-
void getComputedStyle(elements[0]).transform;
|
|
324
|
-
}
|
|
325
|
-
for (const element of elements) {
|
|
326
|
-
element.style.removeProperty('transition');
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
static clean(element, holder) {
|
|
330
|
-
if (holders.get(element) === holder) {
|
|
331
|
-
holders.delete(element);
|
|
332
|
-
}
|
|
333
|
-
element.style.removeProperty('transform');
|
|
334
|
-
element.style.removeProperty('opacity');
|
|
335
|
-
element.style.removeProperty('visibility');
|
|
336
|
-
}
|
|
337
|
-
/** Takes `element` from the settle that has it, stopped where it is. */
|
|
338
|
-
take(element) {
|
|
339
|
-
const holder = holders.get(element);
|
|
340
|
-
if (holder && holder !== this) {
|
|
341
|
-
holder.elements.delete(element);
|
|
342
|
-
}
|
|
343
|
-
if (holder) {
|
|
344
|
-
this.freeze(element);
|
|
345
|
-
}
|
|
346
|
-
holders.set(element, this);
|
|
347
|
-
this.elements.add(element);
|
|
348
|
-
}
|
|
349
|
-
/** What slides stops where it is now. */
|
|
350
|
-
freeze(element) {
|
|
351
|
-
const transition = element.style.transition;
|
|
352
|
-
if (!transition || transition === 'none') {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
const style = getComputedStyle(element);
|
|
356
|
-
if (element.style.transform) {
|
|
357
|
-
element.style.transform = style.transform;
|
|
358
|
-
}
|
|
359
|
-
if (element.style.opacity) {
|
|
360
|
-
element.style.opacity = style.opacity;
|
|
361
|
-
}
|
|
362
|
-
element.style.transition = 'none';
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
exports.SwipeSettle = SwipeSettle;
|
|
366
|
-
/** How long it waits for the state, past the slide, before giving the elements back anyway. */
|
|
367
|
-
SwipeSettle.READY_MS = 1000;
|
|
368
|
-
/**
|
|
369
|
-
* 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
|
|
370
|
-
* set off (FrameUtil.painted), or after a while where frames are not drawn (a page out of sight); only if it
|
|
371
|
-
* changes something: the workbench is put away by the same call that brings it out.
|
|
372
|
-
*/
|
|
373
|
-
function afterLetGo(open, current) {
|
|
374
|
-
let called = false;
|
|
375
|
-
const call = () => {
|
|
376
|
-
if (!called) {
|
|
377
|
-
called = true;
|
|
378
|
-
if (current().open !== open) {
|
|
379
|
-
current().setOpen(open);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
void frame_1.FrameUtil.painted().then(call);
|
|
384
|
-
setTimeout(call, 100);
|
|
385
|
-
}
|
|
386
|
-
/** Where `element` is moved along `axis` now, by its transform: wherever a style or a slide has it. */
|
|
387
|
-
function translated(element, axis = 'x') {
|
|
388
|
-
const transform = getComputedStyle(element).transform;
|
|
389
|
-
if (!transform || transform === 'none') {
|
|
390
|
-
return 0;
|
|
391
|
-
}
|
|
392
|
-
const matrix = new DOMMatrixReadOnly(transform);
|
|
393
|
-
return axis === 'x' ? matrix.m41 : matrix.m42;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
|
|
397
|
-
* it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
|
|
398
|
-
* the finger) while the document no longer does, and on the document too, each event once. Another finger put
|
|
399
|
-
* down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
|
|
400
|
-
*/
|
|
401
|
-
class SwipeFinger {
|
|
402
|
-
/** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
|
|
403
|
-
constructor(on, blocking = false) {
|
|
404
|
-
this.on = on;
|
|
405
|
-
this.blocking = blocking;
|
|
406
|
-
this.targets = [];
|
|
407
|
-
this.onMove = (event) => {
|
|
408
|
-
if (event === this.last) {
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
this.last = event;
|
|
412
|
-
const touch = this.find(event.touches);
|
|
413
|
-
if (touch) {
|
|
414
|
-
this.on.move(event, touch);
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
this.onEnd = (event) => {
|
|
418
|
-
if (event === this.last) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
this.last = event;
|
|
422
|
-
const touch = this.find(event.changedTouches);
|
|
423
|
-
if (touch) {
|
|
424
|
-
this.stop();
|
|
425
|
-
this.on.end(event, touch);
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
get down() {
|
|
430
|
-
return this.id !== undefined;
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
|
|
434
|
-
* another, which is still down, or when several are.
|
|
435
|
-
*/
|
|
436
|
-
follow(event, doc) {
|
|
437
|
-
if (this.down) {
|
|
438
|
-
if (this.find(event.touches)) {
|
|
439
|
-
return false;
|
|
440
|
-
}
|
|
441
|
-
const lost = event;
|
|
442
|
-
this.stop();
|
|
443
|
-
this.on.end(lost, undefined);
|
|
444
|
-
}
|
|
445
|
-
const touch = event.changedTouches[0];
|
|
446
|
-
if (event.touches.length !== 1 || !touch) {
|
|
447
|
-
return false;
|
|
448
|
-
}
|
|
449
|
-
this.id = touch.identifier;
|
|
450
|
-
const target = event.target;
|
|
451
|
-
this.targets = target && target !== doc ? [target, doc] : [doc];
|
|
452
|
-
for (const element of this.targets) {
|
|
453
|
-
element.addEventListener('touchmove', this.onMove, { passive: !this.blocking });
|
|
454
|
-
element.addEventListener('touchend', this.onEnd, { passive: true });
|
|
455
|
-
element.addEventListener('touchcancel', this.onEnd, { passive: true });
|
|
456
|
-
}
|
|
457
|
-
return true;
|
|
458
|
-
}
|
|
459
|
-
stop() {
|
|
460
|
-
for (const element of this.targets) {
|
|
461
|
-
element.removeEventListener('touchmove', this.onMove);
|
|
462
|
-
element.removeEventListener('touchend', this.onEnd);
|
|
463
|
-
element.removeEventListener('touchcancel', this.onEnd);
|
|
464
|
-
}
|
|
465
|
-
this.targets = [];
|
|
466
|
-
this.id = undefined;
|
|
467
|
-
}
|
|
468
|
-
find(touches) {
|
|
469
|
-
for (let i = 0; i < touches.length; i++) {
|
|
470
|
-
if (touches[i].identifier === this.id) {
|
|
471
|
-
return touches[i];
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
return undefined;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
exports.SwipeFinger = SwipeFinger;
|
|
39
|
+
const swipe_finger_1 = require("./swipe-finger");
|
|
40
|
+
const swipe_settle_1 = require("./swipe-settle");
|
|
41
|
+
const swipe_util_1 = require("./swipe-util");
|
|
478
42
|
/** How far what the sheet covers moves, of the width of the sheet (as the styles of the phone, style/phone.ts). */
|
|
479
43
|
const UNDER = 0.3;
|
|
480
44
|
/** How long the styles of the phone slide a sheet (style/phone.ts). */
|
|
@@ -569,8 +133,8 @@ function useSheetSwipe(options) {
|
|
|
569
133
|
let claimed;
|
|
570
134
|
let moved;
|
|
571
135
|
let source;
|
|
572
|
-
const velocity = new SwipeVelocity();
|
|
573
|
-
const settle = new SwipeSettle();
|
|
136
|
+
const velocity = new swipe_util_1.SwipeVelocity();
|
|
137
|
+
const settle = new swipe_settle_1.SwipeSettle();
|
|
574
138
|
const point = (event, touch) => {
|
|
575
139
|
var _a;
|
|
576
140
|
var _b, _c;
|
|
@@ -583,7 +147,7 @@ function useSheetSwipe(options) {
|
|
|
583
147
|
const out = 1 - Math.abs(x) / elements.width;
|
|
584
148
|
return [
|
|
585
149
|
{ element: elements.sheet, transform: `translate3d(${x}px, 0, 0)` },
|
|
586
|
-
{ element: elements.under, transform: `translate3d(${SwipeUtil.outward(latest.current) * UNDER * elements.width * out}px, 0, 0)` },
|
|
150
|
+
{ element: elements.under, transform: `translate3d(${swipe_util_1.SwipeUtil.outward(latest.current) * UNDER * elements.width * out}px, 0, 0)` },
|
|
587
151
|
{ element: elements.scrim, opacity: out },
|
|
588
152
|
];
|
|
589
153
|
};
|
|
@@ -603,7 +167,7 @@ function useSheetSwipe(options) {
|
|
|
603
167
|
}
|
|
604
168
|
const now = point(event, touch);
|
|
605
169
|
if (claimed === undefined) {
|
|
606
|
-
claimed = SwipeUtil.takes(current, start, now, current.open, () => scrollsSideways(event.target));
|
|
170
|
+
claimed = swipe_util_1.SwipeUtil.takes(current, start, now, current.open, () => scrollsSideways(event.target));
|
|
607
171
|
if (claimed === undefined) {
|
|
608
172
|
return;
|
|
609
173
|
}
|
|
@@ -615,7 +179,7 @@ function useSheetSwipe(options) {
|
|
|
615
179
|
const sheet = find(current.sheet);
|
|
616
180
|
const width = (sheet === null || sheet === void 0 ? void 0 : sheet.getBoundingClientRect().width) || window.innerWidth;
|
|
617
181
|
// From where it is: at rest, or still sliding.
|
|
618
|
-
const from = sheet ? translated(sheet) : current.open ? 0 : SwipeUtil.away(current, width);
|
|
182
|
+
const from = sheet ? (0, swipe_settle_1.translated)(sheet) : current.open ? 0 : swipe_util_1.SwipeUtil.away(current, width);
|
|
619
183
|
moved = { sheet, under: find(current.under), scrim: find(current.scrim), width, from };
|
|
620
184
|
settle.hold([moved.sheet, moved.under, moved.scrim]);
|
|
621
185
|
root.dataset.sheetDrag = (_b = current.name) !== null && _b !== void 0 ? _b : '';
|
|
@@ -630,7 +194,7 @@ function useSheetSwipe(options) {
|
|
|
630
194
|
event.preventDefault();
|
|
631
195
|
velocity.add(now);
|
|
632
196
|
last = now;
|
|
633
|
-
const x = SwipeUtil.position(current, moved.from, now.x - start.x, moved.width);
|
|
197
|
+
const x = swipe_util_1.SwipeUtil.position(current, moved.from, now.x - start.x, moved.width);
|
|
634
198
|
for (const { element, transform, opacity } of targets(moved, x)) {
|
|
635
199
|
if (element && transform) {
|
|
636
200
|
element.style.transform = transform;
|
|
@@ -649,19 +213,19 @@ function useSheetSwipe(options) {
|
|
|
649
213
|
velocity.add(end);
|
|
650
214
|
}
|
|
651
215
|
const speed = touch ? velocity.speed : 0;
|
|
652
|
-
const x = SwipeUtil.position(current, moved.from, end.x - start.x, moved.width);
|
|
653
|
-
const out = SwipeUtil.settle(current, x, moved.width, speed);
|
|
654
|
-
const away = SwipeUtil.away(current, moved.width);
|
|
216
|
+
const x = swipe_util_1.SwipeUtil.position(current, moved.from, end.x - start.x, moved.width);
|
|
217
|
+
const out = swipe_util_1.SwipeUtil.settle(current, x, moved.width, speed);
|
|
218
|
+
const away = swipe_util_1.SwipeUtil.away(current, moved.width);
|
|
655
219
|
const rest = out ? 0 : away;
|
|
656
|
-
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)]);
|
|
220
|
+
const motion = swipe_util_1.SwipeUtil.motion(x, rest, speed, (_a = current.settleMs) !== null && _a !== void 0 ? _a : SETTLE_MS, [Math.min(0, away), Math.max(0, away)]);
|
|
657
221
|
delete root.dataset.sheetDrag;
|
|
658
222
|
// It slides on now; the state follows once that is drawn, so that what it changes never holds it still.
|
|
659
223
|
settle.run(motion, targets(moved, rest), () => latest.current.open === out);
|
|
660
|
-
afterLetGo(out, () => latest.current);
|
|
224
|
+
(0, swipe_settle_1.afterLetGo)(out, () => latest.current);
|
|
661
225
|
}
|
|
662
226
|
reset();
|
|
663
227
|
};
|
|
664
|
-
const finger = new SwipeFinger({ move: onMove, end: onEnd }, true);
|
|
228
|
+
const finger = new swipe_finger_1.SwipeFinger({ move: onMove, end: onEnd }, true);
|
|
665
229
|
const onStart = (event, from) => {
|
|
666
230
|
var _a;
|
|
667
231
|
const current = latest.current;
|
|
@@ -693,7 +257,7 @@ function useSheetSwipe(options) {
|
|
|
693
257
|
return;
|
|
694
258
|
}
|
|
695
259
|
const at = point(event, touch);
|
|
696
|
-
if (SwipeUtil.starts(sheet, at, current.open, window.innerWidth) && finger.follow(event, from.doc)) {
|
|
260
|
+
if (swipe_util_1.SwipeUtil.starts(sheet, at, current.open, window.innerWidth) && finger.follow(event, from.doc)) {
|
|
697
261
|
start = at;
|
|
698
262
|
velocity.start(at);
|
|
699
263
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Where and when a finger is, of a touch. */
|
|
2
|
+
export interface SwipeFingerHandlers {
|
|
3
|
+
move(event: TouchEvent, touch: Touch): void;
|
|
4
|
+
/** Lifted, or taken by the system; `touch` is none when its end was never seen (a finger put down after it). */
|
|
5
|
+
end(event: TouchEvent, touch: Touch | undefined): void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
|
|
9
|
+
* it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
|
|
10
|
+
* the finger) while the document no longer does, and on the document too, each event once. Another finger put
|
|
11
|
+
* down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SwipeFinger {
|
|
14
|
+
protected readonly on: SwipeFingerHandlers;
|
|
15
|
+
protected readonly blocking: boolean;
|
|
16
|
+
protected id?: number;
|
|
17
|
+
protected targets: EventTarget[];
|
|
18
|
+
protected last?: Event;
|
|
19
|
+
/** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
|
|
20
|
+
constructor(on: SwipeFingerHandlers, blocking?: boolean);
|
|
21
|
+
get down(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
|
|
24
|
+
* another, which is still down, or when several are.
|
|
25
|
+
*/
|
|
26
|
+
follow(event: TouchEvent, doc: EventTarget): boolean;
|
|
27
|
+
stop(): void;
|
|
28
|
+
protected find(touches: TouchList): Touch | undefined;
|
|
29
|
+
protected readonly onMove: (event: TouchEvent) => void;
|
|
30
|
+
protected readonly onEnd: (event: TouchEvent) => void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=swipe-finger.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwipeFinger = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
|
|
6
|
+
* it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
|
|
7
|
+
* the finger) while the document no longer does, and on the document too, each event once. Another finger put
|
|
8
|
+
* down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
|
|
9
|
+
*/
|
|
10
|
+
class SwipeFinger {
|
|
11
|
+
/** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
|
|
12
|
+
constructor(on, blocking = false) {
|
|
13
|
+
this.on = on;
|
|
14
|
+
this.blocking = blocking;
|
|
15
|
+
this.targets = [];
|
|
16
|
+
this.onMove = (event) => {
|
|
17
|
+
if (event === this.last) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this.last = event;
|
|
21
|
+
const touch = this.find(event.touches);
|
|
22
|
+
if (touch) {
|
|
23
|
+
this.on.move(event, touch);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.onEnd = (event) => {
|
|
27
|
+
if (event === this.last) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.last = event;
|
|
31
|
+
const touch = this.find(event.changedTouches);
|
|
32
|
+
if (touch) {
|
|
33
|
+
this.stop();
|
|
34
|
+
this.on.end(event, touch);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
get down() {
|
|
39
|
+
return this.id !== undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
|
|
43
|
+
* another, which is still down, or when several are.
|
|
44
|
+
*/
|
|
45
|
+
follow(event, doc) {
|
|
46
|
+
if (this.down) {
|
|
47
|
+
if (this.find(event.touches)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const lost = event;
|
|
51
|
+
this.stop();
|
|
52
|
+
this.on.end(lost, undefined);
|
|
53
|
+
}
|
|
54
|
+
const touch = event.changedTouches[0];
|
|
55
|
+
if (event.touches.length !== 1 || !touch) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
this.id = touch.identifier;
|
|
59
|
+
const target = event.target;
|
|
60
|
+
this.targets = target && target !== doc ? [target, doc] : [doc];
|
|
61
|
+
for (const element of this.targets) {
|
|
62
|
+
element.addEventListener('touchmove', this.onMove, { passive: !this.blocking });
|
|
63
|
+
element.addEventListener('touchend', this.onEnd, { passive: true });
|
|
64
|
+
element.addEventListener('touchcancel', this.onEnd, { passive: true });
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
stop() {
|
|
69
|
+
for (const element of this.targets) {
|
|
70
|
+
element.removeEventListener('touchmove', this.onMove);
|
|
71
|
+
element.removeEventListener('touchend', this.onEnd);
|
|
72
|
+
element.removeEventListener('touchcancel', this.onEnd);
|
|
73
|
+
}
|
|
74
|
+
this.targets = [];
|
|
75
|
+
this.id = undefined;
|
|
76
|
+
}
|
|
77
|
+
find(touches) {
|
|
78
|
+
for (let i = 0; i < touches.length; i++) {
|
|
79
|
+
if (touches[i].identifier === this.id) {
|
|
80
|
+
return touches[i];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.SwipeFinger = SwipeFinger;
|
|
87
|
+
//# sourceMappingURL=swipe-finger.js.map
|