@celljs/ta-web 4.42.0 → 4.43.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/apps/web-apps.d.ts +4 -0
- package/esm/browser/apps/web-apps.js +14 -3
- package/esm/browser/assistant/ta-hearing.d.ts +85 -0
- package/esm/browser/assistant/ta-hearing.js +272 -0
- package/esm/browser/components/auth-view.js +1 -1
- package/esm/browser/components/board.js +9 -1
- package/esm/browser/components/clipboard-link-host.d.ts +2 -0
- package/esm/browser/components/clipboard-link-host.js +27 -0
- package/esm/browser/components/cloud-network.js +1 -1
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/custom-provider-advanced.js +8 -8
- package/esm/browser/components/custom-provider-view.js +12 -12
- package/esm/browser/components/empty-state.d.ts +2 -1
- package/esm/browser/components/empty-state.js +6 -2
- package/esm/browser/components/folder-picker.js +2 -2
- package/esm/browser/components/gallery.js +8 -9
- package/esm/browser/components/hearing-host.d.ts +5 -0
- package/esm/browser/components/hearing-host.js +58 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/link-dialog.js +4 -0
- package/esm/browser/components/loading.d.ts +3 -2
- package/esm/browser/components/loading.js +7 -3
- package/esm/browser/components/markdown.d.ts +3 -1
- package/esm/browser/components/markdown.js +10 -5
- package/esm/browser/components/media.d.ts +10 -4
- package/esm/browser/components/media.js +60 -14
- package/esm/browser/components/people-picker.d.ts +17 -0
- package/esm/browser/components/people-picker.js +129 -0
- package/esm/browser/components/relay-view.js +1 -1
- package/esm/browser/components/settings-parts.js +2 -0
- package/esm/browser/components/share-dialog.d.ts +2 -2
- package/esm/browser/components/share-dialog.js +7 -4
- package/esm/browser/components/share-friends.js +3 -10
- package/esm/browser/components/share-item-sheet.d.ts +12 -0
- package/esm/browser/components/share-item-sheet.js +39 -0
- package/esm/browser/components/share-sheet.d.ts +9 -2
- package/esm/browser/components/share-sheet.js +5 -4
- package/esm/browser/components/sign-in-setup.js +4 -4
- package/esm/browser/components/trusted-domains.js +1 -1
- package/esm/browser/components/view-room.d.ts +25 -0
- package/esm/browser/components/view-room.js +136 -0
- package/esm/browser/components/voice-services.js +6 -6
- package/esm/browser/device/device-protocol.d.ts +9 -6
- package/esm/browser/device/device-protocol.js +7 -4
- package/esm/browser/device/launch-screen.d.ts +11 -1
- package/esm/browser/device/launch-screen.js +22 -4
- package/esm/browser/extension/share-sheet-compat.d.ts +2 -0
- package/esm/browser/extension/share-sheet-compat.js +12 -2
- package/esm/browser/extension/web-api-code.d.ts +11 -0
- package/esm/browser/extension/web-api-components.d.ts +8 -1
- package/esm/browser/extension/web-api-contributions.d.ts +30 -1
- package/esm/browser/extension/web-api-desktop.d.ts +2 -1
- package/esm/browser/extension/web-api-file-views.d.ts +38 -0
- package/esm/browser/extension/web-api-file-views.js +2 -0
- package/esm/browser/extension/web-api-host.d.ts +47 -0
- package/esm/browser/extension/web-api-host.js +3 -0
- package/esm/browser/extension/web-api-menus.d.ts +46 -0
- package/esm/browser/extension/web-api-partners.d.ts +58 -1
- package/esm/browser/extension/web-api-spec.js +7 -0
- package/esm/browser/extension/web-extension-api.d.ts +10 -10
- package/esm/browser/extension/web-extension-context.d.ts +2 -8
- package/esm/browser/extension/web-extension-context.js +14 -39
- package/esm/browser/extension/web-extension-marks.d.ts +10 -0
- package/esm/browser/extension/web-extension-marks.js +29 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +11 -1
- package/esm/browser/extension/web-extension-protocol.js +3 -0
- package/esm/browser/extension/web-extension-run.d.ts +15 -2
- package/esm/browser/extension/web-extension-run.js +77 -0
- package/esm/browser/extension/web-extensions-running.d.ts +5 -1
- package/esm/browser/extension/web-extensions-running.js +16 -0
- package/esm/browser/extension/web-extensions.d.ts +2 -1
- package/esm/browser/extension/web-extensions.js +3 -0
- package/esm/browser/extension/web-home.js +3 -1
- package/esm/browser/extension/web-host-values.d.ts +66 -0
- package/esm/browser/extension/web-host-values.js +191 -0
- package/esm/browser/extension/web-hosts.d.ts +7 -2
- package/esm/browser/extension/web-hosts.js +16 -4
- package/esm/browser/extension/web-share-ui.d.ts +7 -0
- package/esm/browser/extension/web-share-ui.js +15 -0
- package/esm/browser/extension/web-share.d.ts +18 -0
- package/esm/browser/extension/web-share.js +42 -0
- package/esm/browser/i18n/en/chat.d.ts +10 -0
- package/esm/browser/i18n/en/chat.js +10 -0
- package/esm/browser/i18n/en/common.d.ts +18 -0
- package/esm/browser/i18n/en/common.js +18 -0
- package/esm/browser/i18n/en/discover.d.ts +7 -0
- package/esm/browser/i18n/en/discover.js +7 -0
- package/esm/browser/i18n/en/settings.d.ts +2 -0
- package/esm/browser/i18n/en/settings.js +2 -0
- package/esm/browser/i18n/ja/chat.js +10 -0
- package/esm/browser/i18n/ja/common.js +18 -0
- package/esm/browser/i18n/ja/discover.js +7 -0
- package/esm/browser/i18n/ja/settings.js +2 -0
- package/esm/browser/i18n/locales.d.ts +38 -1
- package/esm/browser/i18n/messages.d.ts +37 -0
- package/esm/browser/i18n/zh/chat.js +10 -0
- package/esm/browser/i18n/zh/common.js +18 -0
- package/esm/browser/i18n/zh/discover.js +7 -0
- package/esm/browser/i18n/zh/settings.js +2 -0
- package/esm/browser/i18n/zh-tw/chat.js +10 -0
- package/esm/browser/i18n/zh-tw/common.js +18 -0
- package/esm/browser/i18n/zh-tw/discover.js +7 -0
- package/esm/browser/i18n/zh-tw/settings.js +2 -0
- package/esm/browser/launch-art/art-palette.d.ts +41 -0
- package/esm/browser/launch-art/art-palette.js +72 -0
- package/esm/browser/launch-art/cyclic-automaton.d.ts +45 -0
- package/esm/browser/launch-art/cyclic-automaton.js +176 -0
- package/esm/browser/launch-art/fractal-tree.d.ts +43 -0
- package/esm/browser/launch-art/fractal-tree.js +48 -0
- package/esm/browser/launch-art/launch-art.d.ts +98 -0
- package/esm/browser/launch-art/launch-art.js +420 -0
- package/esm/browser/launch-art/launch-sky.d.ts +66 -0
- package/esm/browser/launch-art/launch-sky.js +153 -0
- package/esm/browser/links/clipboard-links.d.ts +89 -0
- package/esm/browser/links/clipboard-links.js +303 -0
- package/esm/browser/links/link-text.d.ts +29 -0
- package/esm/browser/links/link-text.js +97 -0
- package/esm/browser/links/links-protocol.d.ts +12 -1
- package/esm/browser/links/links.d.ts +8 -2
- package/esm/browser/links/links.js +33 -3
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/partners/group-picker.js +23 -29
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-senses.js +1 -1
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +10 -6
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +28 -15
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +2 -2
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +2 -5
- package/esm/browser/style/forms.d.ts +5 -0
- package/esm/browser/style/forms.js +65 -0
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +14 -24
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/shared.d.ts +1 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +1 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +0 -6
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style.js +2 -0
- package/esm/browser/util/voice.d.ts +18 -0
- package/esm/browser/util/voice.js +111 -3
- package/esm/browser/workbench-protocol.d.ts +2 -0
- package/esm/browser/workbench-services.d.ts +2 -0
- package/esm/browser/workbench-services.js +5 -0
- package/esm/browser/workbench.js +5 -0
- package/lib/browser/apps/web-apps.d.ts +4 -0
- package/lib/browser/apps/web-apps.js +14 -3
- package/lib/browser/assistant/ta-hearing.d.ts +86 -0
- package/lib/browser/assistant/ta-hearing.js +277 -0
- package/lib/browser/components/auth-view.js +1 -1
- package/lib/browser/components/board.js +9 -1
- package/lib/browser/components/clipboard-link-host.d.ts +3 -0
- package/lib/browser/components/clipboard-link-host.js +63 -0
- package/lib/browser/components/cloud-network.js +1 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/custom-provider-advanced.js +8 -8
- package/lib/browser/components/custom-provider-view.js +12 -12
- package/lib/browser/components/empty-state.d.ts +2 -1
- package/lib/browser/components/empty-state.js +6 -2
- package/lib/browser/components/folder-picker.js +2 -2
- package/lib/browser/components/gallery.js +7 -8
- package/lib/browser/components/hearing-host.d.ts +6 -0
- package/lib/browser/components/hearing-host.js +94 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/link-dialog.js +4 -0
- package/lib/browser/components/loading.d.ts +3 -2
- package/lib/browser/components/loading.js +7 -3
- package/lib/browser/components/markdown.d.ts +3 -1
- package/lib/browser/components/markdown.js +9 -4
- package/lib/browser/components/media.d.ts +10 -4
- package/lib/browser/components/media.js +61 -14
- package/lib/browser/components/people-picker.d.ts +18 -0
- package/lib/browser/components/people-picker.js +166 -0
- package/lib/browser/components/relay-view.js +1 -1
- package/lib/browser/components/settings-parts.js +2 -0
- package/lib/browser/components/share-dialog.d.ts +2 -2
- package/lib/browser/components/share-dialog.js +7 -4
- package/lib/browser/components/share-friends.js +3 -10
- package/lib/browser/components/share-item-sheet.d.ts +13 -0
- package/lib/browser/components/share-item-sheet.js +75 -0
- package/lib/browser/components/share-sheet.d.ts +9 -2
- package/lib/browser/components/share-sheet.js +5 -3
- package/lib/browser/components/sign-in-setup.js +4 -4
- package/lib/browser/components/trusted-domains.js +1 -1
- package/lib/browser/components/view-room.d.ts +26 -0
- package/lib/browser/components/view-room.js +173 -0
- package/lib/browser/components/voice-services.js +6 -6
- package/lib/browser/device/device-protocol.d.ts +9 -6
- package/lib/browser/device/device-protocol.js +7 -4
- package/lib/browser/device/launch-screen.d.ts +11 -1
- package/lib/browser/device/launch-screen.js +22 -4
- package/lib/browser/extension/share-sheet-compat.d.ts +2 -0
- package/lib/browser/extension/share-sheet-compat.js +13 -2
- package/lib/browser/extension/web-api-code.d.ts +11 -0
- package/lib/browser/extension/web-api-components.d.ts +8 -1
- package/lib/browser/extension/web-api-contributions.d.ts +30 -1
- package/lib/browser/extension/web-api-desktop.d.ts +2 -1
- package/lib/browser/extension/web-api-file-views.d.ts +39 -0
- package/lib/browser/extension/web-api-file-views.js +3 -0
- package/lib/browser/extension/web-api-host.d.ts +48 -0
- package/lib/browser/extension/web-api-host.js +4 -0
- package/lib/browser/extension/web-api-menus.d.ts +46 -0
- package/lib/browser/extension/web-api-partners.d.ts +58 -1
- package/lib/browser/extension/web-api-spec.js +7 -0
- package/lib/browser/extension/web-extension-api.d.ts +10 -10
- package/lib/browser/extension/web-extension-context.d.ts +2 -8
- package/lib/browser/extension/web-extension-context.js +14 -39
- package/lib/browser/extension/web-extension-marks.d.ts +11 -0
- package/lib/browser/extension/web-extension-marks.js +65 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +11 -1
- package/lib/browser/extension/web-extension-protocol.js +3 -0
- package/lib/browser/extension/web-extension-run.d.ts +15 -2
- package/lib/browser/extension/web-extension-run.js +77 -0
- package/lib/browser/extension/web-extensions-running.d.ts +5 -1
- package/lib/browser/extension/web-extensions-running.js +16 -0
- package/lib/browser/extension/web-extensions.d.ts +2 -1
- package/lib/browser/extension/web-extensions.js +3 -0
- package/lib/browser/extension/web-home.js +3 -1
- package/lib/browser/extension/web-host-values.d.ts +67 -0
- package/lib/browser/extension/web-host-values.js +229 -0
- package/lib/browser/extension/web-hosts.d.ts +7 -2
- package/lib/browser/extension/web-hosts.js +16 -4
- package/lib/browser/extension/web-share-ui.d.ts +8 -0
- package/lib/browser/extension/web-share-ui.js +51 -0
- package/lib/browser/extension/web-share.d.ts +19 -0
- package/lib/browser/extension/web-share.js +45 -0
- package/lib/browser/i18n/en/chat.d.ts +10 -0
- package/lib/browser/i18n/en/chat.js +10 -0
- package/lib/browser/i18n/en/common.d.ts +18 -0
- package/lib/browser/i18n/en/common.js +18 -0
- package/lib/browser/i18n/en/discover.d.ts +7 -0
- package/lib/browser/i18n/en/discover.js +7 -0
- package/lib/browser/i18n/en/settings.d.ts +2 -0
- package/lib/browser/i18n/en/settings.js +2 -0
- package/lib/browser/i18n/ja/chat.js +10 -0
- package/lib/browser/i18n/ja/common.js +18 -0
- package/lib/browser/i18n/ja/discover.js +7 -0
- package/lib/browser/i18n/ja/settings.js +2 -0
- package/lib/browser/i18n/locales.d.ts +38 -1
- package/lib/browser/i18n/messages.d.ts +37 -0
- package/lib/browser/i18n/zh/chat.js +10 -0
- package/lib/browser/i18n/zh/common.js +18 -0
- package/lib/browser/i18n/zh/discover.js +7 -0
- package/lib/browser/i18n/zh/settings.js +2 -0
- package/lib/browser/i18n/zh-tw/chat.js +10 -0
- package/lib/browser/i18n/zh-tw/common.js +18 -0
- package/lib/browser/i18n/zh-tw/discover.js +7 -0
- package/lib/browser/i18n/zh-tw/settings.js +2 -0
- package/lib/browser/launch-art/art-palette.d.ts +42 -0
- package/lib/browser/launch-art/art-palette.js +76 -0
- package/lib/browser/launch-art/cyclic-automaton.d.ts +46 -0
- package/lib/browser/launch-art/cyclic-automaton.js +180 -0
- package/lib/browser/launch-art/fractal-tree.d.ts +44 -0
- package/lib/browser/launch-art/fractal-tree.js +52 -0
- package/lib/browser/launch-art/launch-art.d.ts +99 -0
- package/lib/browser/launch-art/launch-art.js +424 -0
- package/lib/browser/launch-art/launch-sky.d.ts +67 -0
- package/lib/browser/launch-art/launch-sky.js +157 -0
- package/lib/browser/links/clipboard-links.d.ts +90 -0
- package/lib/browser/links/clipboard-links.js +308 -0
- package/lib/browser/links/link-text.d.ts +30 -0
- package/lib/browser/links/link-text.js +100 -0
- package/lib/browser/links/links-protocol.d.ts +12 -1
- package/lib/browser/links/links.d.ts +8 -2
- package/lib/browser/links/links.js +33 -3
- package/lib/browser/markdown/code-renderers.d.ts +4 -0
- package/lib/browser/markdown/code-renderers.js +5 -1
- package/lib/browser/partners/group-picker.js +23 -29
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-senses.js +1 -1
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +10 -6
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +28 -15
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +2 -2
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +2 -5
- package/lib/browser/style/forms.d.ts +6 -0
- package/lib/browser/style/forms.js +68 -0
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +14 -24
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/shared.d.ts +1 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +1 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +0 -6
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style.js +2 -0
- package/lib/browser/util/voice.d.ts +18 -0
- package/lib/browser/util/voice.js +111 -3
- package/lib/browser/workbench-protocol.d.ts +2 -0
- package/lib/browser/workbench-services.d.ts +2 -0
- package/lib/browser/workbench-services.js +5 -0
- package/lib/browser/workbench.js +5 -0
- package/package.json +8 -8
- package/public/launch.svg +3 -3
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ViewRoom = void 0;
|
|
37
|
+
exports.useViewRoom = useViewRoom;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
/**
|
|
40
|
+
* The room of a Loading or an EmptyState that is not `compact`: the rest of the view it is in, from its top to the
|
|
41
|
+
* bottom of what shows it, less what comes under it, so that it sits in the middle of what is left however the page
|
|
42
|
+
* around it is laid out. A column of flex that gives it room already (`flex: 1` in base.ts) is left to do so; where its
|
|
43
|
+
* parent is not one (a block an extension wraps it in, a body that is no column of flex) it takes the room itself,
|
|
44
|
+
* rather than each page having to make every box above it a column of flex. It keeps its own height in a reply, in a
|
|
45
|
+
* box drawn as one (a card: rounded, with a background, a border or a shadow) and beside something (a cell of a grid).
|
|
46
|
+
*/
|
|
47
|
+
var ViewRoom;
|
|
48
|
+
(function (ViewRoom) {
|
|
49
|
+
/** The min-height it takes, or undefined where it keeps the height it has. */
|
|
50
|
+
function height({ height, natural, room }) {
|
|
51
|
+
if (height > natural + 1) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return room > height + 1 ? Math.floor(room) : undefined;
|
|
55
|
+
}
|
|
56
|
+
ViewRoom.height = height;
|
|
57
|
+
/** Keeps the room of the element while the view and what is around it change; the function stops it. */
|
|
58
|
+
function keep(element) {
|
|
59
|
+
const view = viewOf(element);
|
|
60
|
+
if (element.closest('.ta-message') || boxed(element, view)) {
|
|
61
|
+
return () => undefined;
|
|
62
|
+
}
|
|
63
|
+
let frame = 0;
|
|
64
|
+
const measure = () => {
|
|
65
|
+
frame = 0;
|
|
66
|
+
const taken = room(element, view);
|
|
67
|
+
const next = taken === undefined ? '' : `${taken}px`;
|
|
68
|
+
if (element.style.minHeight !== next) {
|
|
69
|
+
element.style.minHeight = next;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const later = () => {
|
|
73
|
+
if (!frame) {
|
|
74
|
+
frame = requestAnimationFrame(measure);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
measure();
|
|
78
|
+
const observer = typeof ResizeObserver === 'function' ? new ResizeObserver(later) : undefined;
|
|
79
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(view !== null && view !== void 0 ? view : document.documentElement);
|
|
80
|
+
if (element.parentElement && element.parentElement !== view) {
|
|
81
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(element.parentElement);
|
|
82
|
+
}
|
|
83
|
+
window.addEventListener('resize', later);
|
|
84
|
+
return () => {
|
|
85
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
86
|
+
window.removeEventListener('resize', later);
|
|
87
|
+
cancelAnimationFrame(frame);
|
|
88
|
+
element.style.minHeight = '';
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
ViewRoom.keep = keep;
|
|
92
|
+
function room(element, view) {
|
|
93
|
+
element.style.minHeight = '';
|
|
94
|
+
const rect = element.getBoundingClientRect();
|
|
95
|
+
let after = 0;
|
|
96
|
+
for (let node = element; node.parentElement && node !== view; node = node.parentElement) {
|
|
97
|
+
const parent = node.parentElement;
|
|
98
|
+
if (parent === view) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
const box = node.getBoundingClientRect();
|
|
102
|
+
let bottom = box.bottom;
|
|
103
|
+
for (const sibling of Array.from(parent.children)) {
|
|
104
|
+
if (sibling === node || !inFlow(sibling)) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const other = sibling.getBoundingClientRect();
|
|
108
|
+
if (other.height === 0 && other.width === 0) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (other.top < box.bottom - 1 && other.bottom > box.top + 1) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
if (other.top >= box.bottom - 1) {
|
|
115
|
+
bottom = Math.max(bottom, other.bottom);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const style = getComputedStyle(parent);
|
|
119
|
+
after += bottom - box.bottom + px(style.paddingBottom) + px(style.borderBottomWidth);
|
|
120
|
+
}
|
|
121
|
+
const end = view ? viewBottom(view) : window.innerHeight;
|
|
122
|
+
return height({ height: rect.height, natural: natural(element, rect.height), room: Math.min(end, window.innerHeight) - rect.top - after });
|
|
123
|
+
}
|
|
124
|
+
function natural(element, laid) {
|
|
125
|
+
const style = getComputedStyle(element);
|
|
126
|
+
const children = Array.from(element.children).filter(inFlow);
|
|
127
|
+
if (!children.length) {
|
|
128
|
+
return Math.max(px(style.minHeight), laid);
|
|
129
|
+
}
|
|
130
|
+
const top = Math.min(...children.map(child => child.getBoundingClientRect().top));
|
|
131
|
+
const bottom = Math.max(...children.map(child => child.getBoundingClientRect().bottom));
|
|
132
|
+
const content = bottom - top + px(style.paddingTop) + px(style.paddingBottom) + px(style.borderTopWidth) + px(style.borderBottomWidth);
|
|
133
|
+
return Math.max(px(style.minHeight), content);
|
|
134
|
+
}
|
|
135
|
+
function viewOf(element) {
|
|
136
|
+
for (let node = element.parentElement; node && node !== document.body && node !== document.documentElement; node = node.parentElement) {
|
|
137
|
+
const overflow = getComputedStyle(node).overflowY;
|
|
138
|
+
if (overflow !== 'visible') {
|
|
139
|
+
return node;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
function viewBottom(view) {
|
|
145
|
+
const style = getComputedStyle(view);
|
|
146
|
+
return view.getBoundingClientRect().top + view.clientTop + view.clientHeight - px(style.paddingBottom);
|
|
147
|
+
}
|
|
148
|
+
function boxed(element, view) {
|
|
149
|
+
for (let node = element.parentElement; node && node !== view && node !== document.body; node = node.parentElement) {
|
|
150
|
+
const style = getComputedStyle(node);
|
|
151
|
+
if (px(style.borderTopLeftRadius) <= 0) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const filled = !/^(transparent|rgba\(0, 0, 0, 0\))$/.test(style.backgroundColor);
|
|
155
|
+
if (filled || px(style.borderTopWidth) > 0 || style.boxShadow !== 'none') {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
function inFlow(element) {
|
|
162
|
+
const style = getComputedStyle(element);
|
|
163
|
+
return style.display !== 'none' && style.position !== 'absolute' && style.position !== 'fixed';
|
|
164
|
+
}
|
|
165
|
+
function px(value) {
|
|
166
|
+
return Number.parseFloat(value) || 0;
|
|
167
|
+
}
|
|
168
|
+
})(ViewRoom || (exports.ViewRoom = ViewRoom = {}));
|
|
169
|
+
/** Gives the element its room in the view (ViewRoom) while `on`. */
|
|
170
|
+
function useViewRoom(ref, on) {
|
|
171
|
+
React.useLayoutEffect(() => (on && ref.current ? ViewRoom.keep(ref.current) : undefined), [on, ref]);
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=view-room.js.map
|
|
@@ -177,17 +177,17 @@ function VoiceForm({ type, title, service, close, added, }) {
|
|
|
177
177
|
event.preventDefault();
|
|
178
178
|
void submit();
|
|
179
179
|
} },
|
|
180
|
-
type.options.map(option => { var _a, _b; return (React.createElement("label", { key: option.key, className: "ta-
|
|
181
|
-
React.createElement("span", { className: "ta-
|
|
182
|
-
option.optional && React.createElement("span", { className: "ta-
|
|
180
|
+
type.options.map(option => { var _a, _b; return (React.createElement("label", { key: option.key, className: "ta-form-item" },
|
|
181
|
+
React.createElement("span", { className: "ta-form-label" }, (_a = ta_protocol_1.TaPackageTextUtil.pick(option.label, language)) !== null && _a !== void 0 ? _a : option.key,
|
|
182
|
+
option.optional && React.createElement("span", { className: "ta-form-optional" }, t('ta.voices.optional'))),
|
|
183
183
|
React.createElement("input", { className: "ta-input", type: option.secret ? 'password' : 'text', autoComplete: option.secret ? 'new-password' : 'off', spellCheck: false, placeholder: service && option.secret ? t('ta.voices.keepSecret') : option.placeholder, value: (_b = values[option.key]) !== null && _b !== void 0 ? _b : '', onChange: event => {
|
|
184
184
|
const value = event.target.value;
|
|
185
185
|
setValues(before => ({ ...before, [option.key]: value }));
|
|
186
186
|
} }))); }),
|
|
187
|
-
React.createElement("label", { className: "ta-
|
|
188
|
-
React.createElement("span", { className: "ta-
|
|
187
|
+
React.createElement("label", { className: "ta-form-item" },
|
|
188
|
+
React.createElement("span", { className: "ta-form-label" },
|
|
189
189
|
t('ta.voices.name'),
|
|
190
|
-
React.createElement("span", { className: "ta-
|
|
190
|
+
React.createElement("span", { className: "ta-form-optional" }, t('ta.voices.optional'))),
|
|
191
191
|
React.createElement("input", { className: "ta-input", value: name, placeholder: title, spellCheck: false, onChange: event => setName(event.target.value) })),
|
|
192
192
|
React.createElement("p", { className: "ta-store-form-note" },
|
|
193
193
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.ShieldCheck, size: 13 }),
|
|
@@ -21,14 +21,17 @@ export interface DeviceState {
|
|
|
21
21
|
* (`@media ${DeviceMedia.COMPACT}`) and for the code (DeviceState). Never write a width of the layout elsewhere.
|
|
22
22
|
*/
|
|
23
23
|
export declare namespace DeviceMedia {
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The main pointer is a finger. Or a pen: a screen that also takes a stylus is a fine pointer to Chrome on Android
|
|
26
|
+
* (phones with a pen, the emulator), but no pointer of it hovers, as none of a computer's fails to.
|
|
27
|
+
*/
|
|
28
|
+
const TOUCH = "(pointer: coarse), (hover: none)";
|
|
26
29
|
/** A phone held sideways: as wide as a small tablet, but low. */
|
|
27
|
-
const LOW = "(max-height: 500px) and (pointer: coarse)";
|
|
28
|
-
const COMPACT = "(max-width: 860px), (max-height: 500px) and (pointer: coarse)";
|
|
30
|
+
const LOW = "(max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none)";
|
|
31
|
+
const COMPACT = "(max-width: 860px), (max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none)";
|
|
29
32
|
/** The workbench beside the conversation too: a window of a computer, or a tablet wide enough (13" sideways) that the conversation keeps its room beside the sidebar. */
|
|
30
|
-
const EXPANDED = "(min-width: 1100px) and (pointer: fine), (min-width: 1300px)";
|
|
31
|
-
const HANDHELD = "(max-width: 599px), (max-height: 500px) and (pointer: coarse)";
|
|
33
|
+
const EXPANDED = "(min-width: 1100px) and (pointer: fine) and (hover: hover), (min-width: 1300px)";
|
|
34
|
+
const HANDHELD = "(max-width: 599px), (max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none)";
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
37
|
* How the page moves with the on-screen keyboard of the Ta app on iOS (DeviceObserver, style/shell.ts):
|
|
@@ -7,13 +7,16 @@ exports.DeviceMotion = exports.DeviceMedia = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
var DeviceMedia;
|
|
9
9
|
(function (DeviceMedia) {
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The main pointer is a finger. Or a pen: a screen that also takes a stylus is a fine pointer to Chrome on Android
|
|
12
|
+
* (phones with a pen, the emulator), but no pointer of it hovers, as none of a computer's fails to.
|
|
13
|
+
*/
|
|
14
|
+
DeviceMedia.TOUCH = '(pointer: coarse), (hover: none)';
|
|
12
15
|
/** A phone held sideways: as wide as a small tablet, but low. */
|
|
13
|
-
DeviceMedia.LOW = '(max-height: 500px) and (pointer: coarse)';
|
|
16
|
+
DeviceMedia.LOW = '(max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none)';
|
|
14
17
|
DeviceMedia.COMPACT = `(max-width: 860px), ${DeviceMedia.LOW}`;
|
|
15
18
|
/** The workbench beside the conversation too: a window of a computer, or a tablet wide enough (13" sideways) that the conversation keeps its room beside the sidebar. */
|
|
16
|
-
DeviceMedia.EXPANDED = '(min-width: 1100px) and (pointer: fine), (min-width: 1300px)';
|
|
19
|
+
DeviceMedia.EXPANDED = '(min-width: 1100px) and (pointer: fine) and (hover: hover), (min-width: 1300px)';
|
|
17
20
|
DeviceMedia.HANDHELD = `(max-width: 599px), ${DeviceMedia.LOW}`;
|
|
18
21
|
})(DeviceMedia || (exports.DeviceMedia = DeviceMedia = {}));
|
|
19
22
|
/**
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** What plays on the launch screen (LaunchArt): while a finger holds it, the launch screen stays. */
|
|
2
|
+
export interface LaunchStage {
|
|
3
|
+
readonly held: boolean;
|
|
4
|
+
/** `next` once, when the finger lets go. */
|
|
5
|
+
onRelease(next: () => void): void;
|
|
6
|
+
stop(): void;
|
|
7
|
+
}
|
|
1
8
|
/** What the launch screen reads of the page; tests give their own. */
|
|
2
9
|
export interface LaunchEnvironment {
|
|
3
10
|
/** `#ta-launch` of index.html: there in the app of a phone only. */
|
|
@@ -7,19 +14,22 @@ export interface LaunchEnvironment {
|
|
|
7
14
|
observe(changed: () => void): () => void;
|
|
8
15
|
frame(next: () => void): void;
|
|
9
16
|
later(next: () => void, ms: number): () => void;
|
|
17
|
+
stage?: LaunchStage;
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* The launch picture of the app of a phone, as WeChat's: apps/ta/serve/index.html draws it before any script
|
|
13
21
|
* runs (`#ta-launch`, the picture of `public/launch.svg`), over the native one it takes over from. It stays
|
|
14
22
|
* until what the page shows is whole, then fades: the app is there (`.ta-app`, or the page to sign in) and no
|
|
15
23
|
* list is still on its way (`.ta-loading`). A computer slow to answer gets the page after MAX at most, with
|
|
16
|
-
* its own word for that (ConnectionBar).
|
|
24
|
+
* its own word for that (ConnectionBar). Over it the picture comes alive (`stage`, LaunchArt); a finger on it keeps
|
|
25
|
+
* it until it lets go.
|
|
17
26
|
*/
|
|
18
27
|
export declare class LaunchScreen {
|
|
19
28
|
protected readonly env: LaunchEnvironment;
|
|
20
29
|
static readonly MAX = 2000;
|
|
21
30
|
static readonly FADE = 320;
|
|
22
31
|
protected done: boolean;
|
|
32
|
+
protected waiting: boolean;
|
|
23
33
|
protected stops: (() => void)[];
|
|
24
34
|
constructor(env: LaunchEnvironment);
|
|
25
35
|
/** The page shows something, and nothing in it waits for its rows. */
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LaunchScreenUtil = exports.LaunchScreen = void 0;
|
|
4
|
+
const launch_art_1 = require("../launch-art/launch-art");
|
|
4
5
|
/**
|
|
5
6
|
* The launch picture of the app of a phone, as WeChat's: apps/ta/serve/index.html draws it before any script
|
|
6
7
|
* runs (`#ta-launch`, the picture of `public/launch.svg`), over the native one it takes over from. It stays
|
|
7
8
|
* until what the page shows is whole, then fades: the app is there (`.ta-app`, or the page to sign in) and no
|
|
8
9
|
* list is still on its way (`.ta-loading`). A computer slow to answer gets the page after MAX at most, with
|
|
9
|
-
* its own word for that (ConnectionBar).
|
|
10
|
+
* its own word for that (ConnectionBar). Over it the picture comes alive (`stage`, LaunchArt); a finger on it keeps
|
|
11
|
+
* it until it lets go.
|
|
10
12
|
*/
|
|
11
13
|
class LaunchScreen {
|
|
12
14
|
constructor(env) {
|
|
13
15
|
this.env = env;
|
|
14
16
|
this.done = false;
|
|
17
|
+
this.waiting = false;
|
|
15
18
|
this.stops = [];
|
|
16
19
|
}
|
|
17
20
|
/** The page shows something, and nothing in it waits for its rows. */
|
|
@@ -34,8 +37,17 @@ class LaunchScreen {
|
|
|
34
37
|
this.env.frame(() => this.env.frame(() => LaunchScreen.whole(this.env.root) && this.hide()));
|
|
35
38
|
}
|
|
36
39
|
hide() {
|
|
40
|
+
var _a;
|
|
37
41
|
const { element } = this.env;
|
|
38
|
-
if (this.done || !element) {
|
|
42
|
+
if (this.done || !element || this.waiting) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if ((_a = this.env.stage) === null || _a === void 0 ? void 0 : _a.held) {
|
|
46
|
+
this.waiting = true;
|
|
47
|
+
this.env.stage.onRelease(() => {
|
|
48
|
+
this.waiting = false;
|
|
49
|
+
this.hide();
|
|
50
|
+
});
|
|
39
51
|
return;
|
|
40
52
|
}
|
|
41
53
|
this.done = true;
|
|
@@ -43,7 +55,11 @@ class LaunchScreen {
|
|
|
43
55
|
stop();
|
|
44
56
|
}
|
|
45
57
|
element.setAttribute('data-leaving', '');
|
|
46
|
-
this.env.later(() =>
|
|
58
|
+
this.env.later(() => {
|
|
59
|
+
var _a;
|
|
60
|
+
element.remove();
|
|
61
|
+
(_a = this.env.stage) === null || _a === void 0 ? void 0 : _a.stop();
|
|
62
|
+
}, LaunchScreen.FADE);
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
exports.LaunchScreen = LaunchScreen;
|
|
@@ -56,8 +72,10 @@ var LaunchScreenUtil;
|
|
|
56
72
|
if (typeof document === 'undefined') {
|
|
57
73
|
return;
|
|
58
74
|
}
|
|
75
|
+
const element = document.getElementById('ta-launch');
|
|
59
76
|
new LaunchScreen({
|
|
60
|
-
element
|
|
77
|
+
element,
|
|
78
|
+
stage: element ? launch_art_1.LaunchArtUtil.start(element) : undefined,
|
|
61
79
|
root: document.body,
|
|
62
80
|
observe: changed => {
|
|
63
81
|
const observer = new MutationObserver(changed);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type { WebShareSheetProps } from './web-api-components';
|
|
3
3
|
import type { WebExtensionAPI } from './web-extension-api';
|
|
4
|
+
/** What Copy puts in the clipboard: the words of the share, then the link on a line of its own. */
|
|
5
|
+
export declare function shareMessage(invite: string | undefined, link: string): string;
|
|
4
6
|
/**
|
|
5
7
|
* The share sheet a package shares through (`<ShareSheetCompat pi={pi} …/>`): the page's (`pi.ui.ShareSheet`), or,
|
|
6
8
|
* in a Ta app older than it (a phone's page is often older than the extensions of its computer), a dialog with the
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shareMessage = shareMessage;
|
|
3
4
|
exports.ShareSheetCompat = ShareSheetCompat;
|
|
5
|
+
/** What Copy puts in the clipboard: the words of the share, then the link on a line of its own. */
|
|
6
|
+
function shareMessage(invite, link) {
|
|
7
|
+
const words = invite === null || invite === void 0 ? void 0 : invite.trim();
|
|
8
|
+
return words ? `${words}\n${link}` : link;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* The share sheet a package shares through (`<ShareSheetCompat pi={pi} …/>`): the page's (`pi.ui.ShareSheet`), or,
|
|
6
12
|
* in a Ta app older than it (a phone's page is often older than the extensions of its computer), a dialog with the
|
|
@@ -11,7 +17,7 @@ function ShareSheetCompat({ pi, ...props }) {
|
|
|
11
17
|
if (pi.ui.ShareSheet) {
|
|
12
18
|
return h(pi.ui.ShareSheet, props);
|
|
13
19
|
}
|
|
14
|
-
const { title, link, error, name, gets, notes, password, own, onClose, children } = props;
|
|
20
|
+
const { title, link, error, name, gets, invite, notes, password, own, onClose, children } = props;
|
|
15
21
|
const quiet = { margin: 0, opacity: 0.7, textAlign: 'center' };
|
|
16
22
|
return h(pi.ui.Dialog, { title, onClose }, h('div', { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 12 } }, error !== undefined
|
|
17
23
|
? h('p', { role: 'alert' }, error)
|
|
@@ -21,7 +27,12 @@ function ShareSheetCompat({ pi, ...props }) {
|
|
|
21
27
|
h('code', { key: 'link', style: { maxWidth: '100%', overflowWrap: 'anywhere', userSelect: 'all' } }, link !== null && link !== void 0 ? link : '…'),
|
|
22
28
|
password ? h('code', { key: 'password', style: { userSelect: 'all' } }, password) : null,
|
|
23
29
|
link
|
|
24
|
-
? h('button', {
|
|
30
|
+
? h('button', {
|
|
31
|
+
key: 'copy',
|
|
32
|
+
type: 'button',
|
|
33
|
+
className: 'ta-button ta-primary',
|
|
34
|
+
onClick: () => { var _a; return void ((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(shareMessage(invite, link))); },
|
|
35
|
+
}, 'Copy')
|
|
25
36
|
: null,
|
|
26
37
|
children,
|
|
27
38
|
...(notes !== null && notes !== void 0 ? notes : []).filter(Boolean).map(line => h('p', { key: String(line), style: quiet }, line)),
|
|
@@ -31,6 +31,17 @@ export interface WebCodeRendererProps {
|
|
|
31
31
|
answer?: string;
|
|
32
32
|
conversation?: string;
|
|
33
33
|
embedded?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The title the frame around the block shows already (the head of a card of the board): a title of its own that says
|
|
36
|
+
* the same (TaWorkTitle.repeats) is left out, the rest of its head kept. None elsewhere, and for a block inside it.
|
|
37
|
+
*/
|
|
38
|
+
titled?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The block is what the page shows (a work's page, a file opened, a work shared by a link, a page printed): drawn
|
|
41
|
+
* whole. Otherwise it sits among others (a reply, a post, a message), and a long one shows its start with a way to
|
|
42
|
+
* see the rest (the first page of a document, the first rows of a sheet). Given by `ui.Markdown`'s `whole`.
|
|
43
|
+
*/
|
|
44
|
+
whole?: boolean;
|
|
34
45
|
point?: (point: TaWorkPoint) => void;
|
|
35
46
|
}
|
|
36
47
|
/** pi's custom message, as the conversation holds it. */
|
|
@@ -37,6 +37,13 @@ export interface WebShareSheetProps {
|
|
|
37
37
|
name?: string;
|
|
38
38
|
/** What the other gets, in a line: "They add it as an agent of their own". */
|
|
39
39
|
gets?: string;
|
|
40
|
+
/**
|
|
41
|
+
* What the other reads with the link, in their words, as the user would write it to them: "Join my group chat
|
|
42
|
+
* Weekend hike on Ta: open the link in Ta to ask to join". Copy and Other apps send it before the link (shareMessage),
|
|
43
|
+
* and Ta, where the other copies it, names the link by it (docs/design/ta-links.md 7): a link alone says nothing of
|
|
44
|
+
* what it is.
|
|
45
|
+
*/
|
|
46
|
+
invite: string;
|
|
40
47
|
/** Quieter lines under it: how long it works, what it holds or leaves out. Empty ones are left out. */
|
|
41
48
|
notes?: readonly (string | false | undefined)[];
|
|
42
49
|
/** A password the other needs, told apart from the link: with a Copy of its own. */
|
|
@@ -159,7 +166,7 @@ export interface WebSwitchProps {
|
|
|
159
166
|
}
|
|
160
167
|
/**
|
|
161
168
|
* What a page, a list, a card or a dialog shows while what it shows is on its way (`ui.Loading`): a turning mark and its
|
|
162
|
-
* `label`, centered in the space
|
|
169
|
+
* `label`, centered in the space left in the view however the page around it is laid out, `compact` a line of its own in a card or a
|
|
163
170
|
* dialog; after a moment, never for what comes at once. Never a spinner or a "loading" text of your own.
|
|
164
171
|
*/
|
|
165
172
|
export interface WebLoadingProps {
|
|
@@ -100,9 +100,27 @@ export interface WebRoomAddon {
|
|
|
100
100
|
}>;
|
|
101
101
|
/** Without a page: what a tap on its tile or line does. */
|
|
102
102
|
open?(room: TaRoomInfo): void;
|
|
103
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* What was said elsewhere, which the user may carry into the room as one card of chat history, as a messenger forwards
|
|
105
|
+
* one (docs/design/ta-link.md 7.6): a group chat of this computer it was before, say. The room offers it above the
|
|
106
|
+
* chat until the user carries it in or lets it go, and keeps it in its +. None: nothing to carry.
|
|
107
|
+
*/
|
|
108
|
+
history?(room: TaRoomInfo): WebRoomHistory | undefined;
|
|
109
|
+
/** What `tile`, `line` and `history` give changed (the data they read came): the page reads them again. */
|
|
104
110
|
subscribe?(listener: () => void): () => void;
|
|
105
111
|
}
|
|
112
|
+
/** What was said elsewhere, to carry into a room (WebRoomAddon.history). */
|
|
113
|
+
export interface WebRoomHistory {
|
|
114
|
+
/** Where it was said, as the offer names it: the name of the group chat of before. */
|
|
115
|
+
from: string;
|
|
116
|
+
/** What was said there, the earliest first, read when the user opens the offer: who, what (text only), when. */
|
|
117
|
+
lines(): Promise<WebRoomHistoryLine[]>;
|
|
118
|
+
}
|
|
119
|
+
export interface WebRoomHistoryLine {
|
|
120
|
+
name: string;
|
|
121
|
+
text: string;
|
|
122
|
+
at: number;
|
|
123
|
+
}
|
|
106
124
|
/** What an extension adds to the rooms, as `ui.useRoomAddons` lists it. */
|
|
107
125
|
export interface WebRoomAddonEntry {
|
|
108
126
|
/** `<extension id>/<index>`. */
|
|
@@ -559,5 +577,16 @@ export interface WebOpenerOptions {
|
|
|
559
577
|
* go out of Ta too (one scanned, opened with Cmd or Ctrl, pasted in Quick open), which the others are not.
|
|
560
578
|
*/
|
|
561
579
|
specific?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* What a link of its own is, in a few words of the user's ("Invite to a group chat"), told without opening it;
|
|
582
|
+
* undefined for one it does not open. Ta names by it the links of Ta in what the user copied or pasted, and offers
|
|
583
|
+
* to open them (docs/design/ta-links.md 7): it is asked often, so it only reads the link.
|
|
584
|
+
*/
|
|
585
|
+
describe?(link: {
|
|
586
|
+
type: 'url';
|
|
587
|
+
url: string;
|
|
588
|
+
}): string | undefined;
|
|
562
589
|
}
|
|
590
|
+
/** WebOpenerOptions.describe, of an extension that runs. */
|
|
591
|
+
export type WebLinkDescriber = (url: string) => string | undefined;
|
|
563
592
|
//# sourceMappingURL=web-api-contributions.d.ts.map
|
|
@@ -15,7 +15,8 @@ export interface WebDeviceUI {
|
|
|
15
15
|
readonly saveFile?: (file: Blob, name: string) => Promise<WebFileSaved>;
|
|
16
16
|
/**
|
|
17
17
|
* Pages installed as apps of the computer, each with a window, a name and an icon of its own (Launchpad, the Dock, the
|
|
18
|
-
* Start menu): in Ta Desktop only, `pi.ui.apps?.…`.
|
|
18
|
+
* Start menu): in Ta Desktop only, `pi.ui.apps?.…`. In a sandbox an extension installs, opens, removes and lists only
|
|
19
|
+
* pages of its own (SANDBOX_GUARDS); once it stopped, none.
|
|
19
20
|
*/
|
|
20
21
|
readonly apps?: WebApps;
|
|
21
22
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Part of the web extension API (web-extension-api.ts, which exports it all): how files of a kind look, drawn by an extension. */
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
/** A file the page holds, its bytes all here (one sent in a chat), as a view of its kind draws it (WebFileView). */
|
|
4
|
+
export interface WebFileViewProps {
|
|
5
|
+
name: string;
|
|
6
|
+
/** Its media type as it came; may be empty. */
|
|
7
|
+
type: string;
|
|
8
|
+
bytes: Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How files of a kind look in Ta (registerFileView): a Word, PowerPoint or Excel file drawn as it reads where the page
|
|
12
|
+
* holding it (a file of a chat) would only save it. The page draws it where it shows the file (a tab of the workbench, a
|
|
13
|
+
* page over the chat), with what is done with it (Save) around it.
|
|
14
|
+
*/
|
|
15
|
+
export interface WebFileView {
|
|
16
|
+
/** Whether it draws the file, by its name and type: read at once, as the file is opened. */
|
|
17
|
+
accepts(file: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}): boolean;
|
|
21
|
+
render: React.ComponentType<WebFileViewProps>;
|
|
22
|
+
}
|
|
23
|
+
/** What a web extension registers of files (WebExtensionAPI extends it). */
|
|
24
|
+
export interface WebFileViews {
|
|
25
|
+
/**
|
|
26
|
+
* How files of a kind look, where a page holds one it would otherwise only save: a file sent in a chat
|
|
27
|
+
* (`ui.fileView`). The first whose `accepts` takes a file draws it. Newer than some Ta apps: `pi.registerFileView?.(…)`.
|
|
28
|
+
*/
|
|
29
|
+
registerFileView(view: WebFileView): void;
|
|
30
|
+
}
|
|
31
|
+
/** What `ui` tells of them (WebExtensionUI extends it). */
|
|
32
|
+
export interface WebFileViewsUI {
|
|
33
|
+
/** How a file the page holds looks, as an extension draws its kind (registerFileView); undefined for none. Newer than some Ta apps. */
|
|
34
|
+
fileView?(file: {
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
}): React.ComponentType<WebFileViewProps> | undefined;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=web-api-file-views.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Part of the web extension API (web-extension-api.ts, which exports it all): what the server side of the package answers, as it changes. */
|
|
2
|
+
/** What a method of the package's host answers, as `ui.useHost` reads it: the same object until it changes. */
|
|
3
|
+
export interface WebHostValue<T> {
|
|
4
|
+
/** Its answer, the last one while it is read again; undefined until the first comes. */
|
|
5
|
+
readonly value?: T;
|
|
6
|
+
/** Why the last read failed; the value before stays. */
|
|
7
|
+
readonly error?: string;
|
|
8
|
+
/** Not answered yet. */
|
|
9
|
+
readonly loading: boolean;
|
|
10
|
+
/** Reads it again now (after the page changed something itself). */
|
|
11
|
+
read(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface WebHostOptions {
|
|
14
|
+
/**
|
|
15
|
+
* What the host says it changed (`TaExtensionHost.changed(topic)`) to read it again: the name of the method unless
|
|
16
|
+
* given.
|
|
17
|
+
*/
|
|
18
|
+
topics?: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Read again this often too (ms), while the page shows: only for what the host cannot tell (a service elsewhere),
|
|
21
|
+
* never to know what it can.
|
|
22
|
+
*/
|
|
23
|
+
every?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface WebHostUI {
|
|
26
|
+
/**
|
|
27
|
+
* A React hook: what a method of the package's host (`pi.host`, as `callHost`) answers, read as the component shows
|
|
28
|
+
* and again as soon as the host says it changed (`TaExtensionHost.changed`), as the connection comes back, and as
|
|
29
|
+
* the page shows again after it changed while hidden; never on a timer of the extension's own. Components that read
|
|
30
|
+
* the same method with the same params share one read, and an answer equal to the last renders nothing. Newer than
|
|
31
|
+
* some Ta apps: `pi.ui.useHost?.(…)`.
|
|
32
|
+
*/
|
|
33
|
+
useHost<T = unknown>(method: string, params?: readonly unknown[], options?: WebHostOptions): WebHostValue<T>;
|
|
34
|
+
}
|
|
35
|
+
export interface WebHostAPI {
|
|
36
|
+
/**
|
|
37
|
+
* Calls a method of the server side of the extension's package (`pi.host` of its package.json, which
|
|
38
|
+
* ta serve runs for the packages that come with Ta), with JSON values: what the page cannot do itself.
|
|
39
|
+
*/
|
|
40
|
+
callHost<T = unknown>(method: string, ...params: unknown[]): Promise<T>;
|
|
41
|
+
/**
|
|
42
|
+
* What the package's host says changed (`TaExtensionHost.changed`), once the page called one of its methods: for a
|
|
43
|
+
* store of the extension's own that `ui.useHost` does not fit. Stops when the extension unloads. Newer than some Ta
|
|
44
|
+
* apps: `pi.onHostChanged?.(…)`.
|
|
45
|
+
*/
|
|
46
|
+
onHostChanged(listener: (topics: string[]) => void): () => void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=web-api-host.d.ts.map
|