@celljs/ta-web 4.9.1 → 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 +20 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-util.js +5 -3
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +10 -1
- package/esm/browser/assistant/assistant.js +44 -5
- 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/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +7 -3
- package/esm/browser/components/app-view.js +75 -21
- 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 +5 -4
- 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/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 +26 -8
- 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/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/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-parts.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +24 -1
- 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/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/web-extension-api.d.ts +97 -1
- 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 +122 -23
- 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/i18n/locales.d.ts +24 -2
- package/esm/browser/i18n/messages.d.ts +23 -1
- package/esm/browser/i18n/messages.js +48 -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 +27 -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 +46 -3
- 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 +7 -0
- package/esm/browser/workbench-util.js +9 -2
- package/esm/browser/workbench.d.ts +14 -5
- package/esm/browser/workbench.js +51 -31
- 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 +20 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-util.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-util.js +5 -3
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +10 -1
- package/lib/browser/assistant/assistant.js +44 -5
- 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/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +7 -3
- package/lib/browser/components/app-view.js +74 -20
- 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 +5 -4
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- 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 +26 -8
- 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/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/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-parts.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +24 -1
- 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/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/web-extension-api.d.ts +97 -1
- 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 +120 -21
- 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/i18n/locales.d.ts +24 -2
- package/lib/browser/i18n/messages.d.ts +23 -1
- package/lib/browser/i18n/messages.js +48 -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 +27 -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 +46 -3
- 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 +7 -0
- package/lib/browser/workbench-util.js +10 -3
- package/lib/browser/workbench.d.ts +14 -5
- package/lib/browser/workbench.js +51 -31
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -10,11 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { Autowired, Component, Optional, PostConstruct } from '@celljs/core';
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import { CodeEditor } from '../components/code-editor.js';
|
|
13
|
-
import { useContextMenu } from '../components/context-menu.js';
|
|
13
|
+
import { ContextMenuUtil, useContextMenu } from '../components/context-menu.js';
|
|
14
|
+
import { useConversationScroll } from '../components/conversation-scroll.js';
|
|
14
15
|
import { DiffEditor } from '../components/diff-editor.js';
|
|
15
16
|
import { EmptyState } from '../components/empty-state.js';
|
|
16
17
|
import { FolderPicker } from '../components/folder-picker.js';
|
|
17
18
|
import { HostTag } from '../components/host-tag.js';
|
|
19
|
+
import { ImageViewer } from '../components/image-viewer.js';
|
|
18
20
|
import { ListSkeleton } from '../components/list-skeleton.js';
|
|
19
21
|
import { Markdown } from '../components/markdown.js';
|
|
20
22
|
import { SettingsModelPicker } from '../components/model-picker.js';
|
|
@@ -28,6 +30,7 @@ import { WebComposer } from '../components/web-composer.js';
|
|
|
28
30
|
import { WebDialog } from '../components/web-dialog.js';
|
|
29
31
|
import { Device, useDevice } from '../device/device.js';
|
|
30
32
|
import { Scanner } from '../device/scanner.js';
|
|
33
|
+
import { TaFiles } from '../files/files-protocol.js';
|
|
31
34
|
import { message as messageOf } from '../i18n/messages.js';
|
|
32
35
|
import { translator } from '../i18n/use-t.js';
|
|
33
36
|
import { TaLinks } from '../links/links-protocol.js';
|
|
@@ -40,7 +43,7 @@ import { FileDragUtil } from '../util/file-drag.js';
|
|
|
40
43
|
import { TaWorkbench } from '../workbench-protocol.js';
|
|
41
44
|
import { WEB_ICONS } from './icons.js';
|
|
42
45
|
import { WebExtensionCode } from './web-extension-code.js';
|
|
43
|
-
import { BuiltinWebExtension, TaWebExtensions, WebLabelUtil, } from './web-extension-protocol.js';
|
|
46
|
+
import { BuiltinWebExtension, TaWebExtensions, WebCwdUtil, WebLabelUtil, } from './web-extension-protocol.js';
|
|
44
47
|
import { WebOnDemand } from './web-on-demand.js';
|
|
45
48
|
import { WebPagesUtil } from './web-pages.js';
|
|
46
49
|
import { WebSharing } from './web-sharing.js';
|
|
@@ -59,6 +62,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
59
62
|
views: [],
|
|
60
63
|
widgets: [],
|
|
61
64
|
composerAddons: [],
|
|
65
|
+
settingsSections: [],
|
|
62
66
|
renderers: {},
|
|
63
67
|
avatars: {},
|
|
64
68
|
tools: [],
|
|
@@ -67,6 +71,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
67
71
|
focus: 0,
|
|
68
72
|
page: '',
|
|
69
73
|
pageShown: 0,
|
|
74
|
+
conversationShown: true,
|
|
70
75
|
onOpen: [],
|
|
71
76
|
kept: [],
|
|
72
77
|
usage: {},
|
|
@@ -77,6 +82,8 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
77
82
|
this.refreshing = Promise.resolve(false);
|
|
78
83
|
/** The tabs of before are open again: from now on, what is open is kept. */
|
|
79
84
|
this.restored = false;
|
|
85
|
+
/** The extensions of the list of the last time have started (startKept), once. */
|
|
86
|
+
this.keptStarted = false;
|
|
80
87
|
this.sharing = new WebSharing({
|
|
81
88
|
language: () => this.settings.state.language,
|
|
82
89
|
notices: () => this.notices,
|
|
@@ -349,6 +356,11 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
349
356
|
this.update({ cwd: conversation === null || conversation === void 0 ? void 0 : conversation.cwd, sessionId: conversation === null || conversation === void 0 ? void 0 : conversation.sessionId });
|
|
350
357
|
}
|
|
351
358
|
}
|
|
359
|
+
setConversationShown(shown) {
|
|
360
|
+
if (this.current.conversationShown !== shown) {
|
|
361
|
+
this.update({ conversationShown: shown });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
352
364
|
setSessionSwitcher(switcher) {
|
|
353
365
|
this.switcher = switcher;
|
|
354
366
|
}
|
|
@@ -377,34 +389,81 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
377
389
|
if (changed) {
|
|
378
390
|
this.publish();
|
|
379
391
|
}
|
|
392
|
+
const host = this.workbench.state.host;
|
|
393
|
+
const listing = this.workbench.packages.listWebExtensions();
|
|
394
|
+
// Answered below; until then those of the last time start.
|
|
395
|
+
listing.catch(() => undefined);
|
|
396
|
+
changed = (await this.startKept(host)) || changed;
|
|
397
|
+
const listed = await listing;
|
|
398
|
+
if (host) {
|
|
399
|
+
this.code.keepList(host, listed);
|
|
400
|
+
}
|
|
380
401
|
// A built-in package turned off stays in the list, for its switch in the settings.
|
|
381
|
-
const infos =
|
|
382
|
-
const
|
|
383
|
-
this.code.keepOnly(
|
|
384
|
-
const stopped = this.stopUnless(run => {
|
|
385
|
-
const keep = !run.loaded.info || (hashes.has(run.loaded.id) && hashes.get(run.loaded.id) === run.hash);
|
|
386
|
-
if (!keep) {
|
|
387
|
-
this.onDemand.stopped(run.loaded.id);
|
|
388
|
-
}
|
|
389
|
-
return keep;
|
|
390
|
-
});
|
|
402
|
+
const infos = listed.filter(info => info.enabled !== false);
|
|
403
|
+
const fresh = new Map(infos.map(info => [info.id, info]));
|
|
404
|
+
this.code.keepOnly(infos.map(info => info.hash));
|
|
391
405
|
// Those started on open wait to be opened (ta-launcher.md).
|
|
392
406
|
this.onDemand.set(infos.filter(info => info.activation === 'open'));
|
|
393
407
|
// Fetched together, started in the order of the list: the order of their views stays the same.
|
|
394
|
-
const
|
|
395
|
-
const loads = await Promise.all(
|
|
396
|
-
|
|
408
|
+
const starting = infos.filter(info => { var _a; return ((_a = this.running.get(info.id)) === null || _a === void 0 ? void 0 : _a.hash) !== info.hash && info.activation !== 'open'; });
|
|
409
|
+
const loads = await Promise.all(starting.map(info => this.loadPackage(info)));
|
|
410
|
+
// Stopped only now, just before the new code starts: the views of the old one stay drawn until the next
|
|
411
|
+
// publish, and stopped while the new code is read (after an update, over the relay) they would show
|
|
412
|
+
// without the styles it took away.
|
|
413
|
+
const stopped = this.stopUnless(run => {
|
|
414
|
+
if (!run.loaded.info) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
const info = fresh.get(run.loaded.id);
|
|
418
|
+
if (info && info.hash === run.hash) {
|
|
419
|
+
// Started from the list of the last time: what else it says is of now.
|
|
420
|
+
run.loaded = { ...run.loaded, info };
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
this.onDemand.stopped(run.loaded.id);
|
|
424
|
+
return false;
|
|
425
|
+
});
|
|
426
|
+
for (const [index, info] of starting.entries()) {
|
|
397
427
|
this.startPackage(info, loads[index]);
|
|
398
428
|
}
|
|
399
429
|
this.placeholders = undefined;
|
|
400
430
|
// The list of those started on open may have changed too.
|
|
401
431
|
this.publish();
|
|
402
|
-
changed = changed || stopped ||
|
|
432
|
+
changed = changed || stopped || starting.length > 0;
|
|
403
433
|
if (!this.restored) {
|
|
404
434
|
await this.restoreTabs();
|
|
405
435
|
}
|
|
406
436
|
return changed;
|
|
407
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* The first time, before the computer has answered: the extensions of its list of the last time whose code
|
|
440
|
+
* this browser keeps. What they read goes with the first calls of the page, not a round trip after the list
|
|
441
|
+
* (a phone over the relay waited for it before its double's list could show). The list then keeps those
|
|
442
|
+
* still the same and stops the others.
|
|
443
|
+
*/
|
|
444
|
+
async startKept(host) {
|
|
445
|
+
if (this.keptStarted || !host) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
this.keptStarted = true;
|
|
449
|
+
const infos = this.code.list(host).filter(info => info.enabled !== false && info.activation !== 'open' && !this.running.has(info.id));
|
|
450
|
+
const loads = await Promise.all(infos.map(info => {
|
|
451
|
+
const code = this.code.get(info.hash);
|
|
452
|
+
return code === undefined ? undefined : WebExtensionUtil.load(code).catch(() => undefined);
|
|
453
|
+
}));
|
|
454
|
+
let started = false;
|
|
455
|
+
for (const [index, info] of infos.entries()) {
|
|
456
|
+
const factory = loads[index];
|
|
457
|
+
if (factory && !this.running.has(info.id)) {
|
|
458
|
+
this.start({ id: info.id, name: info.name, info }, factory, info.hash);
|
|
459
|
+
started = true;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (started) {
|
|
463
|
+
this.publish();
|
|
464
|
+
}
|
|
465
|
+
return started;
|
|
466
|
+
}
|
|
408
467
|
/** The tools open before, behind what is shown; the tab shown before, once it is open again. */
|
|
409
468
|
async restoreTabs() {
|
|
410
469
|
const kept = await this.persisted.load(WebViewUtil.TABS);
|
|
@@ -557,12 +616,13 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
557
616
|
taskSources: [],
|
|
558
617
|
searches: [],
|
|
559
618
|
composerAddons: [],
|
|
619
|
+
settingsSections: [],
|
|
560
620
|
handlers: [],
|
|
561
621
|
unsubscribes: [],
|
|
562
622
|
};
|
|
563
623
|
}
|
|
564
624
|
api(run) {
|
|
565
|
-
const { workbench, settings } = this;
|
|
625
|
+
const { workbench, settings, taFiles } = this;
|
|
566
626
|
const subscribe = (listener) => this.subscribe(listener);
|
|
567
627
|
const register = (change) => {
|
|
568
628
|
if (!run.stopped) {
|
|
@@ -586,6 +646,9 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
586
646
|
get packages() {
|
|
587
647
|
return workbench.packages;
|
|
588
648
|
},
|
|
649
|
+
get files() {
|
|
650
|
+
return taFiles;
|
|
651
|
+
},
|
|
589
652
|
get remote() {
|
|
590
653
|
return workbench.remote;
|
|
591
654
|
},
|
|
@@ -626,11 +689,18 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
626
689
|
},
|
|
627
690
|
useCwd: () => {
|
|
628
691
|
var _a;
|
|
629
|
-
|
|
630
|
-
const
|
|
692
|
+
// The conversation's while it is in front; with a page, the settings or nothing in front, the default directory.
|
|
693
|
+
const shown = () => WebCwdUtil.shown(this.current);
|
|
694
|
+
const cwd = React.useSyncExternalStore(subscribe, shown, shown);
|
|
695
|
+
const server = () => { var _a; return (_a = workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd; };
|
|
696
|
+
const fallback = React.useSyncExternalStore(listener => workbench.subscribe(listener), server, server);
|
|
631
697
|
return (_a = cwd !== null && cwd !== void 0 ? cwd : fallback) !== null && _a !== void 0 ? _a : '.';
|
|
632
698
|
},
|
|
633
699
|
useSessionId: () => React.useSyncExternalStore(subscribe, () => this.current.sessionId),
|
|
700
|
+
useSessions: () => {
|
|
701
|
+
const sessions = () => workbench.state.sessions;
|
|
702
|
+
return React.useSyncExternalStore(listener => workbench.subscribe(listener), sessions, sessions);
|
|
703
|
+
},
|
|
634
704
|
useDevice,
|
|
635
705
|
showView: id => (run.stopped ? Promise.resolve(false) : this.showView(id)),
|
|
636
706
|
usePages: () => {
|
|
@@ -645,6 +715,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
645
715
|
.flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])), [open]);
|
|
646
716
|
return [menu, openSections];
|
|
647
717
|
},
|
|
718
|
+
attachMenu: ContextMenuUtil.attach,
|
|
648
719
|
scanCode: Scanner.available() ? instructions => Scanner.scan(instructions, messageOf(settings.state.language, 'ta.cancel')) : undefined,
|
|
649
720
|
stopExtension: name => !run.stopped && this.stopExtension(name),
|
|
650
721
|
shareExtension: target => !run.stopped && this.share(target),
|
|
@@ -659,7 +730,24 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
659
730
|
const shown = React.useSyncExternalStore(subscribe, isShown, isShown);
|
|
660
731
|
// The title is read again in another language: a string, so that the same words stay the same value.
|
|
661
732
|
const title = view ? WebLabelUtil.text(view.title) : undefined;
|
|
662
|
-
|
|
733
|
+
// The preview as one string, so that the same line stays the same value.
|
|
734
|
+
const watch = React.useCallback((listener) => { var _a; var _b; return (_b = (_a = view === null || view === void 0 ? void 0 : view.subscribePreview) === null || _a === void 0 ? void 0 : _a.call(view, listener)) !== null && _b !== void 0 ? _b : (() => undefined); }, [view]);
|
|
735
|
+
const read = () => {
|
|
736
|
+
var _a;
|
|
737
|
+
const preview = (_a = view === null || view === void 0 ? void 0 : view.preview) === null || _a === void 0 ? void 0 : _a.call(view);
|
|
738
|
+
return preview ? `${preview.at}\n${preview.text}` : '';
|
|
739
|
+
};
|
|
740
|
+
const line = React.useSyncExternalStore(watch, read, read);
|
|
741
|
+
const isBusy = () => { var _a; return !!((_a = view === null || view === void 0 ? void 0 : view.busy) === null || _a === void 0 ? void 0 : _a.call(view)); };
|
|
742
|
+
const busy = React.useSyncExternalStore(watch, isBusy, isBusy);
|
|
743
|
+
return React.useMemo(() => {
|
|
744
|
+
if (!view || title === undefined) {
|
|
745
|
+
return undefined;
|
|
746
|
+
}
|
|
747
|
+
const cut = line.indexOf('\n');
|
|
748
|
+
const preview = line ? { at: Number(line.slice(0, cut)), text: line.slice(cut + 1) } : undefined;
|
|
749
|
+
return { title, location: view.location, shown, menu: view.menu, preview, busy };
|
|
750
|
+
}, [view, title, shown, line, busy]);
|
|
663
751
|
},
|
|
664
752
|
Avatar: TaAvatar,
|
|
665
753
|
icons: WEB_ICONS,
|
|
@@ -673,6 +761,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
673
761
|
},
|
|
674
762
|
Composer: this.composer,
|
|
675
763
|
Markdown,
|
|
764
|
+
useChatScroll: (sent, key) => useConversationScroll(sent, { sentTo: 'bottom', key }),
|
|
676
765
|
Empty: EmptyState,
|
|
677
766
|
Skeleton: ListSkeleton,
|
|
678
767
|
HostTag,
|
|
@@ -681,6 +770,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
681
770
|
SelectBar,
|
|
682
771
|
Picture,
|
|
683
772
|
PictureCards,
|
|
773
|
+
ImageViewer,
|
|
684
774
|
QrCode: QrView,
|
|
685
775
|
Dialog: WebDialog,
|
|
686
776
|
FolderPicker: this.folderPicker,
|
|
@@ -707,6 +797,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
707
797
|
registerTasks: source => register(() => run.taskSources.push(source)),
|
|
708
798
|
registerSearch: source => register(() => run.searches.push(source)),
|
|
709
799
|
registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
|
|
800
|
+
registerSettings: section => register(() => run.settingsSections.push(section)),
|
|
710
801
|
registerOpener: opener => register(() => run.openers.push(async (link) => {
|
|
711
802
|
// An opener that fails, or of an extension that stopped, leaves the link to the next one.
|
|
712
803
|
try {
|
|
@@ -791,18 +882,21 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
791
882
|
}
|
|
792
883
|
}
|
|
793
884
|
this.tasks.setSources(runs.flatMap(run => run.taskSources.map(source => ({ extension: run.loaded.name, source }))));
|
|
794
|
-
const views = runs.flatMap(run => [...run.views].map(([name, view]) => { var _a; var
|
|
885
|
+
const views = runs.flatMap(run => [...run.views].map(([name, view]) => { var _a, _b, _c, _d; var _e, _f; return ({
|
|
795
886
|
id: `${run.loaded.name}/${name}`,
|
|
796
887
|
extension: run.loaded.id,
|
|
797
888
|
title: view.title,
|
|
798
889
|
component: view.render,
|
|
799
890
|
icon: view.icon,
|
|
800
|
-
location: (
|
|
801
|
-
order: (
|
|
891
|
+
location: (_e = view.location) !== null && _e !== void 0 ? _e : 'page',
|
|
892
|
+
order: (_f = view.order) !== null && _f !== void 0 ? _f : DEFAULT_ORDER,
|
|
802
893
|
head: view.head,
|
|
803
894
|
pages: view.pages,
|
|
804
895
|
discover: view.discover,
|
|
805
896
|
menu: (_a = view.menu) === null || _a === void 0 ? void 0 : _a.bind(view),
|
|
897
|
+
preview: (_b = view.preview) === null || _b === void 0 ? void 0 : _b.bind(view),
|
|
898
|
+
busy: (_c = view.busy) === null || _c === void 0 ? void 0 : _c.bind(view),
|
|
899
|
+
subscribePreview: (_d = view.subscribe) === null || _d === void 0 ? void 0 : _d.bind(view),
|
|
806
900
|
...(this.onDemand.has(run.loaded.id) ? { onOpen: true } : {}),
|
|
807
901
|
}); }));
|
|
808
902
|
if (this.placeholders) {
|
|
@@ -823,6 +917,7 @@ let TaWebExtensionsImpl = class TaWebExtensionsImpl {
|
|
|
823
917
|
component,
|
|
824
918
|
}); })),
|
|
825
919
|
composerAddons: runs.flatMap(run => run.composerAddons.map((addon, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, addon }))),
|
|
920
|
+
settingsSections: runs.flatMap(run => run.settingsSections.map((section, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, section }))),
|
|
826
921
|
renderers,
|
|
827
922
|
avatars,
|
|
828
923
|
tools,
|
|
@@ -847,6 +942,10 @@ __decorate([
|
|
|
847
942
|
Autowired(TaSettings),
|
|
848
943
|
__metadata("design:type", Object)
|
|
849
944
|
], TaWebExtensionsImpl.prototype, "settings", void 0);
|
|
945
|
+
__decorate([
|
|
946
|
+
Autowired(TaFiles),
|
|
947
|
+
__metadata("design:type", Object)
|
|
948
|
+
], TaWebExtensionsImpl.prototype, "taFiles", void 0);
|
|
850
949
|
__decorate([
|
|
851
950
|
Autowired({ id: TaLinks, detached: true }),
|
|
852
951
|
__metadata("design:type", Object)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const TaFiles: unique symbol;
|
|
2
|
+
/** The bytes of a file, as the page shows them: its type as ta serve answers it, and the bytes themselves. */
|
|
3
|
+
export interface TaFileBytes {
|
|
4
|
+
type: string;
|
|
5
|
+
size: number;
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The bytes of the files of the workspace, for a page that cannot load them by their URL
|
|
10
|
+
* (`TaWorkspaceServer.fileUrl`): behind a relay, and in the app on a phone, only the calls on the WebSocket
|
|
11
|
+
* reach ta serve, so `/api/files` is not there to load. Through a relay they come sealed, end to end, on a
|
|
12
|
+
* channel of their own (RelayFiles of @celljs/ta-relay): the relay reads neither the request nor the bytes.
|
|
13
|
+
*/
|
|
14
|
+
export interface TaFiles {
|
|
15
|
+
/** Whether the page itself can load what `fileUrl` gives: false through a relay, and in the app on a phone. */
|
|
16
|
+
readonly byUrl: boolean;
|
|
17
|
+
/** The bytes of a file of `url` — what `workspace.fileUrl` gave, or a path beside it. */
|
|
18
|
+
read(url: string): Promise<TaFileBytes>;
|
|
19
|
+
/**
|
|
20
|
+
* A URL the page can load for a file of `url`: that one where ta serve serves the page, and a `blob:`
|
|
21
|
+
* made from its bytes where it does not. Made once for each file, and let go of when it is no longer
|
|
22
|
+
* among those shown (the page draws one again by asking).
|
|
23
|
+
*/
|
|
24
|
+
loadable(url: string): Promise<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RelayFiles, type RelayPairing } from '@celljs/ta-relay';
|
|
2
|
+
import type { Credential } from '../workbench-protocol.js';
|
|
3
|
+
import { TaWorkbench } from '../workbench-protocol.js';
|
|
4
|
+
import { type TaFileBytes, TaFiles } from './files-protocol.js';
|
|
5
|
+
/**
|
|
6
|
+
* The files of the workspace: loaded by their URL from ta serve when the page is served by it, and read
|
|
7
|
+
* through the relay — sealed end to end, on a channel of their own — when it is not (a phone, the app).
|
|
8
|
+
*/
|
|
9
|
+
export declare class TaFilesImpl implements TaFiles {
|
|
10
|
+
protected readonly workbench: TaWorkbench;
|
|
11
|
+
/** The channel of the computer in use, kept open for the page; another computer has another. */
|
|
12
|
+
protected relay?: {
|
|
13
|
+
key: string;
|
|
14
|
+
files: RelayFiles;
|
|
15
|
+
};
|
|
16
|
+
/** The URLs made from the bytes of files, by the URL of the file: a picture shown again is not read again. */
|
|
17
|
+
protected readonly made: Map<string, {
|
|
18
|
+
made: Promise<string>;
|
|
19
|
+
size: number;
|
|
20
|
+
}>;
|
|
21
|
+
protected held: number;
|
|
22
|
+
/** The computer the URLs made are of: those of another say nothing of its files. */
|
|
23
|
+
protected of?: string;
|
|
24
|
+
get byUrl(): boolean;
|
|
25
|
+
read(url: string): Promise<TaFileBytes>;
|
|
26
|
+
loadable(url: string): Promise<string>;
|
|
27
|
+
protected credential(): Credential | undefined;
|
|
28
|
+
protected pairing(): RelayPairing;
|
|
29
|
+
protected relayed(pairing: RelayPairing): RelayFiles;
|
|
30
|
+
/** Another computer: what was made of the files of the one before says nothing of its own. */
|
|
31
|
+
protected keep(): void;
|
|
32
|
+
protected forget(): void;
|
|
33
|
+
/** The URLs made stay within {@link MADE_MAX_BYTES}: the ones made first go, and are made again when shown. */
|
|
34
|
+
protected trim(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Autowired, Component } from '@celljs/core';
|
|
11
|
+
import { RelayFiles } from '@celljs/ta-relay';
|
|
12
|
+
import { TaWorkbench } from '../workbench-protocol.js';
|
|
13
|
+
import { TaFiles } from './files-protocol.js';
|
|
14
|
+
/** What the URLs made from bytes take at most: a conversation of pictures is looked at for a while, then read again. */
|
|
15
|
+
const MADE_MAX_BYTES = 48 * 1024 * 1024;
|
|
16
|
+
/**
|
|
17
|
+
* The files of the workspace: loaded by their URL from ta serve when the page is served by it, and read
|
|
18
|
+
* through the relay — sealed end to end, on a channel of their own — when it is not (a phone, the app).
|
|
19
|
+
*/
|
|
20
|
+
let TaFilesImpl = class TaFilesImpl {
|
|
21
|
+
constructor() {
|
|
22
|
+
/** The URLs made from the bytes of files, by the URL of the file: a picture shown again is not read again. */
|
|
23
|
+
this.made = new Map();
|
|
24
|
+
this.held = 0;
|
|
25
|
+
}
|
|
26
|
+
get byUrl() {
|
|
27
|
+
const credential = this.credential();
|
|
28
|
+
return !credential || !('pairing' in credential);
|
|
29
|
+
}
|
|
30
|
+
async read(url) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (this.byUrl) {
|
|
33
|
+
const response = await fetch(url, { cache: 'no-cache' });
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
throw new Error(`The file is not there (${response.status}).`);
|
|
36
|
+
}
|
|
37
|
+
const data = new Uint8Array(await response.arrayBuffer());
|
|
38
|
+
return { type: (_a = response.headers.get('content-type')) !== null && _a !== void 0 ? _a : 'application/octet-stream', size: data.length, data };
|
|
39
|
+
}
|
|
40
|
+
return this.relayed(this.pairing()).get(url);
|
|
41
|
+
}
|
|
42
|
+
async loadable(url) {
|
|
43
|
+
if (this.byUrl) {
|
|
44
|
+
return url;
|
|
45
|
+
}
|
|
46
|
+
this.keep();
|
|
47
|
+
const known = this.made.get(url);
|
|
48
|
+
if (known) {
|
|
49
|
+
return known.made;
|
|
50
|
+
}
|
|
51
|
+
const file = await this.read(url);
|
|
52
|
+
// Two frames asked for the same picture: the one that comes first is kept.
|
|
53
|
+
const again = this.made.get(url);
|
|
54
|
+
if (again) {
|
|
55
|
+
return again.made;
|
|
56
|
+
}
|
|
57
|
+
const created = URL.createObjectURL(new Blob([file.data], { type: file.type }));
|
|
58
|
+
this.made.set(url, { made: Promise.resolve(created), size: file.data.length });
|
|
59
|
+
this.held += file.data.length;
|
|
60
|
+
this.trim();
|
|
61
|
+
return created;
|
|
62
|
+
}
|
|
63
|
+
credential() {
|
|
64
|
+
var _a;
|
|
65
|
+
const state = this.workbench.state;
|
|
66
|
+
return (_a = state.hosts.find(host => host.id === state.host)) === null || _a === void 0 ? void 0 : _a.credential;
|
|
67
|
+
}
|
|
68
|
+
pairing() {
|
|
69
|
+
const credential = this.credential();
|
|
70
|
+
const pairing = credential && 'pairing' in credential ? credential.pairing : undefined;
|
|
71
|
+
if (!pairing) {
|
|
72
|
+
throw new Error('This page is not signed in to a computer through a relay.');
|
|
73
|
+
}
|
|
74
|
+
return pairing;
|
|
75
|
+
}
|
|
76
|
+
relayed(pairing) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const key = `${pairing.relay} ${pairing.host} ${pairing.device} ${pairing.key}`;
|
|
79
|
+
if (((_a = this.relay) === null || _a === void 0 ? void 0 : _a.key) !== key) {
|
|
80
|
+
(_b = this.relay) === null || _b === void 0 ? void 0 : _b.files.close();
|
|
81
|
+
this.relay = { key, files: new RelayFiles(pairing) };
|
|
82
|
+
}
|
|
83
|
+
return this.relay.files;
|
|
84
|
+
}
|
|
85
|
+
/** Another computer: what was made of the files of the one before says nothing of its own. */
|
|
86
|
+
keep() {
|
|
87
|
+
const host = this.workbench.state.host;
|
|
88
|
+
if (host === this.of) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.forget();
|
|
92
|
+
this.of = host;
|
|
93
|
+
}
|
|
94
|
+
forget() {
|
|
95
|
+
for (const entry of this.made.values()) {
|
|
96
|
+
entry.made.then(url => URL.revokeObjectURL(url), () => undefined);
|
|
97
|
+
}
|
|
98
|
+
this.made.clear();
|
|
99
|
+
this.held = 0;
|
|
100
|
+
}
|
|
101
|
+
/** The URLs made stay within {@link MADE_MAX_BYTES}: the ones made first go, and are made again when shown. */
|
|
102
|
+
trim() {
|
|
103
|
+
while (this.held > MADE_MAX_BYTES && this.made.size > 1) {
|
|
104
|
+
const [key, entry] = this.made.entries().next().value;
|
|
105
|
+
this.made.delete(key);
|
|
106
|
+
this.held -= entry.size;
|
|
107
|
+
entry.made.then(url => URL.revokeObjectURL(url), () => undefined);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
__decorate([
|
|
112
|
+
Autowired(TaWorkbench),
|
|
113
|
+
__metadata("design:type", Object)
|
|
114
|
+
], TaFilesImpl.prototype, "workbench", void 0);
|
|
115
|
+
TaFilesImpl = __decorate([
|
|
116
|
+
Component(TaFiles)
|
|
117
|
+
], TaFilesImpl);
|
|
118
|
+
export { TaFilesImpl };
|
|
119
|
+
//# sourceMappingURL=files.js.map
|