@celljs/ta-web 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -3
- package/README.md +4 -3
- package/esm/browser/assistant/assistant-chat-list.js +8 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +33 -5
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-source.js +2 -0
- package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
- package/esm/browser/assistant/assistant-task-util.js +13 -3
- package/esm/browser/assistant/assistant-tasks.js +3 -2
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +30 -1
- package/esm/browser/assistant/assistant.js +89 -6
- package/esm/browser/assistant/task-views.d.ts +40 -6
- package/esm/browser/assistant/task-views.js +73 -21
- package/esm/browser/avatar/dino-avatar.d.ts +3 -4
- package/esm/browser/avatar/dino-avatar.js +4 -178
- package/esm/browser/avatar/dino-face.d.ts +19 -0
- package/esm/browser/avatar/dino-face.js +142 -0
- package/esm/browser/avatar/dino-geometry.d.ts +11 -0
- package/esm/browser/avatar/dino-geometry.js +38 -0
- package/esm/browser/avatar/dino-kinds.d.ts +15 -0
- package/esm/browser/avatar/dino-kinds.js +544 -0
- package/esm/browser/avatar/dino-motion.js +1 -1
- package/esm/browser/avatar/dino-shape.d.ts +80 -0
- package/esm/browser/avatar/dino-shape.js +113 -0
- package/esm/browser/avatar/dino-species.d.ts +1 -61
- package/esm/browser/avatar/dino-species.js +2 -653
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +23 -1
- package/esm/browser/chat/chat-stores.d.ts +59 -0
- package/esm/browser/chat/chat-stores.js +121 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +33 -12
- package/esm/browser/chat/chat.d.ts +31 -39
- package/esm/browser/chat/chat.js +226 -175
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +47 -0
- package/esm/browser/components/app-shell-hooks.js +169 -0
- package/esm/browser/components/app-view.js +81 -172
- package/esm/browser/components/auth-view.js +1 -1
- package/esm/browser/components/chat-list.d.ts +20 -2
- package/esm/browser/components/chat-list.js +138 -22
- package/esm/browser/components/composer-box.d.ts +5 -5
- package/esm/browser/components/composer-box.js +111 -4
- package/esm/browser/components/composer.d.ts +7 -0
- package/esm/browser/components/composer.js +22 -14
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +129 -6
- package/esm/browser/components/conversation-scroll.js +429 -109
- package/esm/browser/components/dino.js +1 -1
- package/esm/browser/components/earlier-messages.d.ts +2 -1
- package/esm/browser/components/earlier-messages.js +2 -17
- package/esm/browser/components/editor-area.d.ts +3 -1
- package/esm/browser/components/editor-area.js +6 -5
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +30 -9
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +1 -1
- package/esm/browser/components/icon.d.ts +2 -2
- package/esm/browser/components/icon.js +5 -6
- package/esm/browser/components/image-viewer.d.ts +124 -0
- package/esm/browser/components/image-viewer.js +397 -0
- package/esm/browser/components/lightbox.d.ts +11 -0
- package/esm/browser/components/lightbox.js +24 -0
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +24 -10
- package/esm/browser/components/media.js +1 -10
- package/esm/browser/components/message-footer.d.ts +16 -2
- package/esm/browser/components/message-footer.js +29 -12
- package/esm/browser/components/message-list.d.ts +24 -3
- package/esm/browser/components/message-list.js +149 -20
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +18 -3
- package/esm/browser/components/nav-places.d.ts +16 -1
- package/esm/browser/components/nav-places.js +12 -3
- package/esm/browser/components/phone-shell.d.ts +4 -1
- package/esm/browser/components/phone-shell.js +3 -1
- package/esm/browser/components/run-status.js +3 -3
- package/esm/browser/components/select-bar.d.ts +9 -0
- package/esm/browser/components/select-bar.js +24 -0
- package/esm/browser/components/session-settings.d.ts +6 -0
- package/esm/browser/components/session-settings.js +14 -1
- package/esm/browser/components/session-view.js +8 -4
- package/esm/browser/components/settings-choices.d.ts +35 -0
- package/esm/browser/components/settings-choices.js +117 -0
- package/esm/browser/components/settings-parts.d.ts +21 -0
- package/esm/browser/components/settings-parts.js +323 -0
- package/esm/browser/components/settings-view.d.ts +0 -6
- package/esm/browser/components/settings-view.js +4 -406
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +14 -12
- package/esm/browser/components/voice-button.d.ts +1 -1
- package/esm/browser/components/voice-button.js +1 -1
- package/esm/browser/components/voice-talk.d.ts +43 -0
- package/esm/browser/components/voice-talk.js +222 -0
- package/esm/browser/components/workbench-view.js +1 -1
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +136 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +2 -0
- package/esm/browser/device/long-press.js +16 -1
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +64 -76
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +149 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +406 -107
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-extension-api.d.ts +135 -2
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
- package/esm/browser/extension/web-extension-protocol.js +8 -0
- package/esm/browser/extension/web-extensions.d.ts +14 -1
- package/esm/browser/extension/web-extensions.js +128 -24
- package/esm/browser/extension/web-tasks.d.ts +9 -1
- package/esm/browser/extension/web-tasks.js +24 -0
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/hooks.d.ts +3 -1
- package/esm/browser/hooks.js +8 -0
- package/esm/browser/i18n/locales.d.ts +29 -2
- package/esm/browser/i18n/messages.d.ts +28 -1
- package/esm/browser/i18n/messages.js +58 -4
- package/esm/browser/index.d.ts +6 -0
- package/esm/browser/index.js +6 -0
- package/esm/browser/notices/notices-protocol.d.ts +9 -1
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +20 -10
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +142 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +107 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +57 -17
- package/esm/browser/style/device.js +43 -4
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +67 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -3
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +2 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/markdown.d.ts +18 -1
- package/esm/browser/util/markdown.js +119 -5
- package/esm/browser/util/process.d.ts +21 -0
- package/esm/browser/util/process.js +45 -1
- package/esm/browser/util/voice.d.ts +5 -2
- package/esm/browser/util/voice.js +6 -3
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +59 -0
- package/esm/browser/workbench-calls.js +141 -0
- package/esm/browser/workbench-protocol.d.ts +5 -1
- package/esm/browser/workbench-util.d.ts +68 -0
- package/esm/browser/workbench-util.js +145 -0
- package/esm/browser/workbench.d.ts +15 -42
- package/esm/browser/workbench.js +53 -167
- package/lib/browser/assistant/assistant-chat-list.js +8 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +33 -5
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-source.js +2 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
- package/lib/browser/assistant/assistant-task-util.js +13 -3
- package/lib/browser/assistant/assistant-tasks.js +2 -1
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +30 -1
- package/lib/browser/assistant/assistant.js +89 -6
- package/lib/browser/assistant/task-views.d.ts +40 -6
- package/lib/browser/assistant/task-views.js +74 -21
- package/lib/browser/avatar/dino-avatar.d.ts +3 -4
- package/lib/browser/avatar/dino-avatar.js +27 -202
- package/lib/browser/avatar/dino-face.d.ts +20 -0
- package/lib/browser/avatar/dino-face.js +148 -0
- package/lib/browser/avatar/dino-geometry.d.ts +12 -0
- package/lib/browser/avatar/dino-geometry.js +47 -0
- package/lib/browser/avatar/dino-kinds.d.ts +16 -0
- package/lib/browser/avatar/dino-kinds.js +547 -0
- package/lib/browser/avatar/dino-motion.js +2 -2
- package/lib/browser/avatar/dino-shape.d.ts +81 -0
- package/lib/browser/avatar/dino-shape.js +126 -0
- package/lib/browser/avatar/dino-species.d.ts +1 -61
- package/lib/browser/avatar/dino-species.js +34 -687
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +23 -1
- package/lib/browser/chat/chat-stores.d.ts +60 -0
- package/lib/browser/chat/chat-stores.js +125 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +33 -12
- package/lib/browser/chat/chat.d.ts +31 -39
- package/lib/browser/chat/chat.js +227 -176
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +2 -2
- package/lib/browser/components/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +48 -0
- package/lib/browser/components/app-shell-hooks.js +211 -0
- package/lib/browser/components/app-view.js +89 -180
- package/lib/browser/components/auth-view.js +3 -3
- package/lib/browser/components/chat-list.d.ts +20 -2
- package/lib/browser/components/chat-list.js +137 -21
- package/lib/browser/components/composer-box.d.ts +5 -5
- package/lib/browser/components/composer-box.js +111 -4
- package/lib/browser/components/composer.d.ts +7 -0
- package/lib/browser/components/composer.js +22 -14
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- package/lib/browser/components/dino.js +3 -3
- package/lib/browser/components/earlier-messages.d.ts +2 -1
- package/lib/browser/components/earlier-messages.js +2 -17
- package/lib/browser/components/editor-area.d.ts +3 -1
- package/lib/browser/components/editor-area.js +5 -4
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +30 -9
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +5 -5
- package/lib/browser/components/icon.d.ts +2 -2
- package/lib/browser/components/icon.js +7 -6
- package/lib/browser/components/image-viewer.d.ts +125 -0
- package/lib/browser/components/image-viewer.js +435 -0
- package/lib/browser/components/lightbox.d.ts +12 -0
- package/lib/browser/components/lightbox.js +60 -0
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +24 -10
- package/lib/browser/components/media.js +2 -11
- package/lib/browser/components/message-footer.d.ts +16 -2
- package/lib/browser/components/message-footer.js +31 -12
- package/lib/browser/components/message-list.d.ts +24 -3
- package/lib/browser/components/message-list.js +146 -16
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +17 -2
- package/lib/browser/components/nav-places.d.ts +16 -1
- package/lib/browser/components/nav-places.js +13 -3
- package/lib/browser/components/phone-shell.d.ts +4 -1
- package/lib/browser/components/phone-shell.js +3 -1
- package/lib/browser/components/run-status.js +3 -3
- package/lib/browser/components/select-bar.d.ts +10 -0
- package/lib/browser/components/select-bar.js +61 -0
- package/lib/browser/components/session-settings.d.ts +6 -0
- package/lib/browser/components/session-settings.js +14 -1
- package/lib/browser/components/session-view.js +7 -3
- package/lib/browser/components/settings-choices.d.ts +36 -0
- package/lib/browser/components/settings-choices.js +156 -0
- package/lib/browser/components/settings-parts.d.ts +22 -0
- package/lib/browser/components/settings-parts.js +359 -0
- package/lib/browser/components/settings-view.d.ts +0 -6
- package/lib/browser/components/settings-view.js +2 -405
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +14 -12
- package/lib/browser/components/voice-button.d.ts +1 -1
- package/lib/browser/components/voice-button.js +1 -1
- package/lib/browser/components/voice-talk.d.ts +44 -0
- package/lib/browser/components/voice-talk.js +260 -0
- package/lib/browser/components/workbench-view.js +3 -3
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +173 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +2 -0
- package/lib/browser/device/long-press.js +16 -1
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +63 -75
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +148 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +410 -108
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +135 -2
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
- package/lib/browser/extension/web-extension-protocol.js +9 -1
- package/lib/browser/extension/web-extensions.d.ts +14 -1
- package/lib/browser/extension/web-extensions.js +125 -21
- package/lib/browser/extension/web-tasks.d.ts +9 -1
- package/lib/browser/extension/web-tasks.js +24 -0
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/hooks.d.ts +3 -1
- package/lib/browser/hooks.js +9 -0
- package/lib/browser/i18n/locales.d.ts +29 -2
- package/lib/browser/i18n/messages.d.ts +28 -1
- package/lib/browser/i18n/messages.js +58 -4
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.js +6 -0
- package/lib/browser/notices/notices-protocol.d.ts +9 -1
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +20 -10
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +148 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +111 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +57 -17
- package/lib/browser/style/device.js +43 -4
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +67 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -3
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +2 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/markdown.d.ts +18 -1
- package/lib/browser/util/markdown.js +119 -5
- package/lib/browser/util/process.d.ts +21 -0
- package/lib/browser/util/process.js +46 -2
- package/lib/browser/util/voice.d.ts +5 -2
- package/lib/browser/util/voice.js +6 -3
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +60 -0
- package/lib/browser/workbench-calls.js +145 -0
- package/lib/browser/workbench-protocol.d.ts +5 -1
- package/lib/browser/workbench-util.d.ts +69 -0
- package/lib/browser/workbench-util.js +151 -0
- package/lib/browser/workbench.d.ts +15 -42
- package/lib/browser/workbench.js +74 -189
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShakeUndoUtil = void 0;
|
|
4
|
+
exports.startShakeUndo = startShakeUndo;
|
|
5
|
+
/** Fields of text: not a checkbox, a slider or a button. */
|
|
6
|
+
const TEXT_FIELD = 'textarea, input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=button], [type=submit], [type=reset], [type=image], [type=hidden])';
|
|
7
|
+
var ShakeUndoUtil;
|
|
8
|
+
(function (ShakeUndoUtil) {
|
|
9
|
+
/** A field of text being edited that has text in it: what a shake may undo is there to see. */
|
|
10
|
+
function hasText(element) {
|
|
11
|
+
if (!element) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (element.matches(TEXT_FIELD)) {
|
|
15
|
+
return element.value !== '';
|
|
16
|
+
}
|
|
17
|
+
return element.isContentEditable === true && !!element.textContent;
|
|
18
|
+
}
|
|
19
|
+
ShakeUndoUtil.hasText = hasText;
|
|
20
|
+
})(ShakeUndoUtil || (exports.ShakeUndoUtil = ShakeUndoUtil = {}));
|
|
21
|
+
/** What the field may have been told by: at once. */
|
|
22
|
+
const NOW = ['focusin', 'focusout', 'input', 'selectionchange'];
|
|
23
|
+
/** What the page may empty a field after (a message sent with Return, the send button, a talk let go): once it has. */
|
|
24
|
+
const AFTER = ['keyup', 'click', 'touchend'];
|
|
25
|
+
/**
|
|
26
|
+
* Shake to Undo in the Ta app on iOS only while a field being edited has text in it. The web view keeps what
|
|
27
|
+
* was typed and sent, or typed and put away, to undo: the system would offer to undo it with the field empty,
|
|
28
|
+
* or on a page without a field. The page tells the app when that changes: focus, typing, the selection, and
|
|
29
|
+
* after a key, a tap or a finger let go, which may have the page empty a field itself (a message sent) with no
|
|
30
|
+
* event of the field. Returns how to stop.
|
|
31
|
+
*/
|
|
32
|
+
function startShakeUndo(doc, bridge) {
|
|
33
|
+
let told;
|
|
34
|
+
let timer;
|
|
35
|
+
const tell = () => {
|
|
36
|
+
const undo = ShakeUndoUtil.hasText(doc.activeElement);
|
|
37
|
+
if (undo !== told) {
|
|
38
|
+
told = undo;
|
|
39
|
+
bridge.postMessage(undo);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const later = () => {
|
|
43
|
+
clearTimeout(timer);
|
|
44
|
+
timer = setTimeout(tell, 0);
|
|
45
|
+
};
|
|
46
|
+
for (const type of NOW) {
|
|
47
|
+
doc.addEventListener(type, tell, true);
|
|
48
|
+
}
|
|
49
|
+
for (const type of AFTER) {
|
|
50
|
+
doc.addEventListener(type, later, { capture: true, passive: true });
|
|
51
|
+
}
|
|
52
|
+
tell();
|
|
53
|
+
return () => {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
for (const type of NOW) {
|
|
56
|
+
doc.removeEventListener(type, tell, true);
|
|
57
|
+
}
|
|
58
|
+
for (const type of AFTER) {
|
|
59
|
+
doc.removeEventListener(type, later, { capture: true });
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=shake-undo.js.map
|
|
@@ -41,18 +41,46 @@ export declare namespace SwipeUtil {
|
|
|
41
41
|
* the finger scrolls sideways (`sideways`, asked only then: a tap or a scroll never reads the styles).
|
|
42
42
|
*/
|
|
43
43
|
function takes(sheet: SheetSwipe, start: TouchPoint, now: TouchPoint, open: boolean, sideways: () => boolean): boolean | undefined;
|
|
44
|
-
/** Where the sheet
|
|
45
|
-
function
|
|
46
|
-
/**
|
|
47
|
-
function
|
|
44
|
+
/** Where the sheet rests away: `∓width`, on its side; out, it rests at 0. */
|
|
45
|
+
function away(sheet: SheetSwipe, width: number): number;
|
|
46
|
+
/** Where the sheet is, between 0 (out) and away, when the finger moved `dx` from where it took it (`from`). */
|
|
47
|
+
function position(sheet: SheetSwipe, from: number, dx: number, width: number): number;
|
|
48
|
+
/** Whether it ends out, let go at `x` at `speed` (pixels a millisecond, SwipeVelocity): the way it was flicked, or the nearer side. */
|
|
49
|
+
function settle(sheet: SheetSwipe, x: number, width: number, speed: number): boolean;
|
|
48
50
|
/**
|
|
49
|
-
* How long it slides on to where it rests, `distance` away (signed), let go at `speed
|
|
50
|
-
*
|
|
51
|
-
*
|
|
51
|
+
* How long it slides on to where it rests, `distance` away (signed), let go at `speed`, where the curves of
|
|
52
|
+
* `linear()` are not (SwipeSpring): on CURVE, as fast at first as the finger was; `longest` (the style's)
|
|
53
|
+
* when the finger was slow, or going the other way.
|
|
52
54
|
*/
|
|
53
55
|
function duration(distance: number, speed: number, longest: number): number;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
+
/** Whether the page draws the curves of `linear()` (iOS 17.2, Chrome 113 on): a spring then, else CURVE. */
|
|
57
|
+
const springs: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* How what the finger let go at `from` at `speed` slides on to `to`, never past `bounds`: a spring that starts at
|
|
60
|
+
* the speed of the finger where the page draws it (SwipeSpring), else CURVE for `duration`. `longest` is how long
|
|
61
|
+
* its style slides it.
|
|
62
|
+
*/
|
|
63
|
+
function motion(from: number, to: number, speed: number, longest: number, bounds?: [number, number]): SwipeMotion;
|
|
64
|
+
}
|
|
65
|
+
/** How something let go slides on: for `ms`, on `easing`. */
|
|
66
|
+
export interface SwipeMotion {
|
|
67
|
+
ms: number;
|
|
68
|
+
easing: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* What a finger lets go slides on as on a spring, as the sheets of iOS: at the speed the finger had, slowing
|
|
72
|
+
* down to where it rests, never past it; going the other way, it goes on a little that way first, as far as it
|
|
73
|
+
* may. A sheet let go near where it rests settles there quickly, one let go far away takes its time. Drawn by
|
|
74
|
+
* the compositor as a CSS transition, its curve a `linear()` of the spring's points. Pure, for the tests.
|
|
75
|
+
*/
|
|
76
|
+
export declare namespace SwipeSpring {
|
|
77
|
+
/** How stiff, for what its style slides in `longest` ms: ω = STIFFNESS / longest, 95% of the way in about 0.6 × longest from rest. */
|
|
78
|
+
const STIFFNESS = 8;
|
|
79
|
+
/** It rests once nearer than this, in pixels. */
|
|
80
|
+
const REST_PX = 0.5;
|
|
81
|
+
/** 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. */
|
|
82
|
+
function left(t: number, omega: number, speed: number): number;
|
|
83
|
+
function motion(from: number, to: number, speed: number, longest: number, bounds?: [number, number]): SwipeMotion;
|
|
56
84
|
}
|
|
57
85
|
/**
|
|
58
86
|
* The speed of a finger along x, in pixels a millisecond, of its last moves (SwipeUtil.VELOCITY_MS): let go
|
|
@@ -67,17 +95,87 @@ export declare class SwipeVelocity {
|
|
|
67
95
|
add(point: TouchPoint): void;
|
|
68
96
|
get speed(): number;
|
|
69
97
|
}
|
|
98
|
+
/** What an element let go goes to: a transform, an opacity. */
|
|
99
|
+
export interface SettleTarget {
|
|
100
|
+
element: HTMLElement | null | undefined;
|
|
101
|
+
transform?: string;
|
|
102
|
+
opacity?: number;
|
|
103
|
+
}
|
|
70
104
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
105
|
+
* The elements a finger moves, then lets go (SwipeMotion): while it moves them their styles do not slide
|
|
106
|
+
* them; let go, they slide on to where they rest with transitions of their own, and only once they are there,
|
|
107
|
+
* and the state has them there too (`ready`), they are their styles' again. So the slide starts in the frame
|
|
108
|
+
* the finger lets go, before the page draws what the state changed (which may take a while: a long
|
|
109
|
+
* conversation), and never jumps if it takes longer than the slide. A finger that takes one of them again, or
|
|
110
|
+
* another swipe that moves it, stops it where it is now.
|
|
73
111
|
*/
|
|
74
112
|
export declare class SwipeSettle {
|
|
113
|
+
/** How long it waits for the state, past the slide, before giving the elements back anyway. */
|
|
114
|
+
static readonly READY_MS = 1000;
|
|
115
|
+
protected readonly elements: Set<HTMLElement>;
|
|
75
116
|
protected timer?: ReturnType<typeof setTimeout>;
|
|
76
|
-
protected
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
|
|
117
|
+
protected done?: () => void;
|
|
118
|
+
/** Whether some of its elements are still its own: moved, or sliding on. */
|
|
119
|
+
get busy(): boolean;
|
|
120
|
+
/** A finger moves these: each stops where it is, whatever slid it, and its style no longer slides it. */
|
|
121
|
+
hold(elements: (HTMLElement | null | undefined)[]): void;
|
|
122
|
+
/**
|
|
123
|
+
* Let go, each slides on to its target as `motion` says; once there and `ready()`, they are their styles'
|
|
124
|
+
* again and `done` runs.
|
|
125
|
+
*/
|
|
126
|
+
run(motion: SwipeMotion, targets: SettleTarget[], ready: () => boolean, done?: () => void): void;
|
|
127
|
+
/** They are their styles' again at once, where those say they rest, without sliding there. */
|
|
128
|
+
finish(): void;
|
|
129
|
+
/** They are their styles' again from where they are now: the styles slide them on to where they rest. */
|
|
130
|
+
release(): void;
|
|
131
|
+
protected giveBack(slide: boolean): void;
|
|
132
|
+
protected static clean(element: HTMLElement, holder: SwipeSettle): void;
|
|
133
|
+
/** Takes `element` from the settle that has it, stopped where it is. */
|
|
134
|
+
protected take(element: HTMLElement): void;
|
|
135
|
+
/** What slides stops where it is now. */
|
|
136
|
+
protected freeze(element: HTMLElement): void;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 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
|
|
140
|
+
* set off (FrameUtil.painted), or after a while where frames are not drawn (a page out of sight); only if it
|
|
141
|
+
* changes something: the workbench is put away by the same call that brings it out.
|
|
142
|
+
*/
|
|
143
|
+
export declare function afterLetGo(open: boolean, current: () => {
|
|
144
|
+
open: boolean;
|
|
145
|
+
setOpen(open: boolean): void;
|
|
146
|
+
}): void;
|
|
147
|
+
/** Where `element` is moved along `axis` now, by its transform: wherever a style or a slide has it. */
|
|
148
|
+
export declare function translated(element: HTMLElement, axis?: 'x' | 'y'): number;
|
|
149
|
+
/** Where and when a finger is, of a touch. */
|
|
150
|
+
export interface SwipeFingerHandlers {
|
|
151
|
+
move(event: TouchEvent, touch: Touch): void;
|
|
152
|
+
/** Lifted, or taken by the system; `touch` is none when its end was never seen (a finger put down after it). */
|
|
153
|
+
end(event: TouchEvent, touch: Touch | undefined): void;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The one finger a swipe follows, from its touchstart. Its moves and its end are listened to on the element
|
|
157
|
+
* it was put down on, which keeps getting them when it leaves the page (a row or a message drawn again under
|
|
158
|
+
* the finger) while the document no longer does, and on the document too, each event once. Another finger put
|
|
159
|
+
* down or lifted beside it is not its own; its end never seen, the next finger put down ends it.
|
|
160
|
+
*/
|
|
161
|
+
export declare class SwipeFinger {
|
|
162
|
+
protected readonly on: SwipeFingerHandlers;
|
|
163
|
+
protected readonly blocking: boolean;
|
|
164
|
+
protected id?: number;
|
|
165
|
+
protected targets: EventTarget[];
|
|
166
|
+
protected last?: Event;
|
|
167
|
+
/** `blocking`: its moves may be held back (preventDefault), so their listener is not passive. */
|
|
168
|
+
constructor(on: SwipeFingerHandlers, blocking?: boolean);
|
|
169
|
+
get down(): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Follows the finger `event` (a touchstart in `doc`) put down, alone on the screen; false while it follows
|
|
172
|
+
* another, which is still down, or when several are.
|
|
173
|
+
*/
|
|
174
|
+
follow(event: TouchEvent, doc: EventTarget): boolean;
|
|
175
|
+
stop(): void;
|
|
176
|
+
protected find(touches: TouchList): Touch | undefined;
|
|
177
|
+
protected readonly onMove: (event: TouchEvent) => void;
|
|
178
|
+
protected readonly onEnd: (event: TouchEvent) => void;
|
|
81
179
|
}
|
|
82
180
|
export interface SheetSwipeOptions extends SheetSwipe {
|
|
83
181
|
enabled: boolean;
|
|
@@ -103,8 +201,10 @@ export interface SheetSwipeOptions extends SheetSwipe {
|
|
|
103
201
|
* Lets the finger move a sheet while `enabled`, then `setOpen` says where it ended; its style says where it
|
|
104
202
|
* rests. Smooth on a long conversation: each move only sets transforms and an opacity, which the compositor
|
|
105
203
|
* draws, never a style the page inherits; the page keeps scrolling on the compositor too, as the listener that
|
|
106
|
-
* may hold a move back is only there while a touch may be the sheet's.
|
|
107
|
-
*
|
|
204
|
+
* 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
|
|
205
|
+
* spring (SwipeSettle, SwipeSpring), and the state changes in the frames after, so that what the page draws
|
|
206
|
+
* for it never holds the sheet still half way. A sheet still sliding, the finger takes it where it is. A touch
|
|
207
|
+
* in a frame the page may read moves it as well (TouchSources).
|
|
108
208
|
*/
|
|
109
209
|
export declare function useSheetSwipe(options: SheetSwipeOptions): void;
|
|
110
210
|
//# sourceMappingURL=sheet-swipe.d.ts.map
|