@celljs/ta-launcher 4.12.0 → 4.13.1
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 +2 -1
- package/README.md +2 -1
- package/package.json +3 -3
- package/web/index.js +58 -1
package/README.en.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
A pi package that comes with Ta (on by default; Settings → Extensions turns it off): Quick open, as WeChat pulls down the mini programs used lately and kept over its chats; design record in docs/design/ta-launcher.md. It has only a web extension (`pi.web`) and uses only the public `WebExtensionAPI`.
|
|
4
4
|
|
|
5
5
|
- **Where**: on a phone, pull down from the top of the list of the first tab; on a computer or a tablet, the grid at the bottom of the rail. The board has a Quick open card too.
|
|
6
|
+
- **Waiting for you**: the conversations that wait for you to decide come first (`ui.useAsks()`), a row each with its name and question; a tap opens it.
|
|
6
7
|
- **Recent**: the pages opened last first (`ui.usePages()`): extensions started on open, temporary ones opened without installing, and pages under Discover; those installed or made by an agent and never opened yet come after. What the navigation or the sidebar already shows is left out. A green dot marks an extension running in the background.
|
|
7
8
|
- **Mine**: the pages the user keeps, in the package's data (`mine` of `pi.storage`), the same on every device; a temporary extension kept there is never cleared for want of use (`updateTemporaryPackage(id, { kept: true })`).
|
|
8
9
|
- **Hold or right-click an icon**: keep in or take out of Mine, Close (stop it in the background), Install (a temporary one: its pi extensions and skills load too), Share (a link and its QR code: the source of a published one, else end to end through the relay, see docs/design/ta-launcher.md 2.4), Remove from Recent, Delete (a temporary one, asked first).
|
|
@@ -12,4 +13,4 @@ A pi package that comes with Ta (on by default; Settings → Extensions turns it
|
|
|
12
13
|
## Limits
|
|
13
14
|
|
|
14
15
|
- The link of an extension of this computer works while its Ta service runs, for 7 days, up to 8 MB.
|
|
15
|
-
- A temporary extension runs only its web part; install it to use its pi extensions and skills.
|
|
16
|
+
- A temporary extension runs only its web part; install it to use its pi extensions and skills.
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):快捷打开。参照微信首页下拉出的"最近使用"和"我的小程序",设计记录见 docs/design/ta-launcher.md。只有 Web 扩展(`pi.web`),只用公开的 `WebExtensionAPI`。
|
|
4
4
|
|
|
5
5
|
- **在哪里**:手机上在第一个标签的列表顶部往下拉;电脑和平板上点导轨底部的九宫格。小组件面板里也有一张"快捷打开"卡片。
|
|
6
|
+
- **待你决定**:有对话在等你决定时,最上面先列出它们(`ui.useAsks()`),每行是对话名和问题,点一下打开对话。
|
|
6
7
|
- **最近使用**:按最近一次打开排列的页面(`ui.usePages()`):打开时才启动的扩展、免安装打开的临时扩展,以及收在"发现"里的页面;刚装好或 Agent 刚做好、还没打开过的排在后面。导航栏和侧栏里已经有的不重复列出。在后台运行的扩展图标上有绿点。
|
|
7
8
|
- **我的**:用户收进来的页面,存在包数据里(`pi.storage` 的 `mine`),所有设备一致;收进"我的"的临时扩展不会因为长时间不用被清除(`updateTemporaryPackage(id, { kept: true })`)。
|
|
8
9
|
- **长按或右键图标**:收进/移出"我的"、关闭(结束后台运行)、安装(临时扩展:它的 pi 扩展、技能也加载)、分享(链接和二维码:已发布的给来源,本机的经中继端到端发送,见 docs/design/ta-launcher.md 2.4)、从最近使用中删除、删除(临时扩展,先确认)。
|
|
@@ -12,4 +13,4 @@ Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):快捷
|
|
|
12
13
|
## 限制
|
|
13
14
|
|
|
14
15
|
- 本机扩展的链接只在分享者的 Ta 服务运行时可用,7 天有效,最大 8 MB。
|
|
15
|
-
- 临时扩展只运行 Web 部分;要用它的 pi 扩展、技能,需要安装。
|
|
16
|
+
- 临时扩展只运行 Web 部分;要用它的 pi 扩展、技能,需要安装。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-launcher",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "A pi package for Ta: what a phone pulls down over its first tab (a button of the rail elsewhere), the pages used lately and those kept in Mine, opened without installing too",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@celljs/ta-protocol": "4.
|
|
29
|
-
"@celljs/ta-web": "4.
|
|
28
|
+
"@celljs/ta-protocol": "4.13.1",
|
|
29
|
+
"@celljs/ta-web": "4.13.1",
|
|
30
30
|
"@types/react": "^19.3.0"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// web-src/i18n.ts
|
|
2
2
|
var EN = {
|
|
3
3
|
recent: "Recent",
|
|
4
|
+
asks: "Waiting for you",
|
|
5
|
+
asksHint: "Waiting for you to decide",
|
|
4
6
|
mine: "Mine",
|
|
5
7
|
mineCard: "Quick open",
|
|
6
8
|
emptyTitle: "Nothing opened yet",
|
|
@@ -32,6 +34,8 @@ var EN = {
|
|
|
32
34
|
};
|
|
33
35
|
var ZH = {
|
|
34
36
|
recent: "最近使用",
|
|
37
|
+
asks: "待你决定",
|
|
38
|
+
asksHint: "等你决定",
|
|
35
39
|
mine: "我的",
|
|
36
40
|
mineCard: "快捷打开",
|
|
37
41
|
emptyTitle: "还没有打开过扩展",
|
|
@@ -386,6 +390,46 @@ function Dialogs({ context }) {
|
|
|
386
390
|
context
|
|
387
391
|
}) : null;
|
|
388
392
|
}
|
|
393
|
+
function Asks({ context }) {
|
|
394
|
+
const { pi, actions } = context;
|
|
395
|
+
const asks = pi.ui.useAsks?.() ?? [];
|
|
396
|
+
if (asks.length === 0) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
const open = (ask) => {
|
|
400
|
+
if (pi.openChat) {
|
|
401
|
+
pi.openChat(ask.sessionFile);
|
|
402
|
+
} else if (ask.sessionId) {
|
|
403
|
+
pi.switchSession(ask.sessionId);
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
return /* @__PURE__ */ React.createElement("section", {
|
|
407
|
+
className: "tla-asks"
|
|
408
|
+
}, /* @__PURE__ */ React.createElement("header", {
|
|
409
|
+
className: "tla-head"
|
|
410
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
411
|
+
className: "tla-label"
|
|
412
|
+
}, actions.words.asks), /* @__PURE__ */ React.createElement("span", {
|
|
413
|
+
className: "tla-asks-count"
|
|
414
|
+
}, asks.length)), /* @__PURE__ */ React.createElement("ul", {
|
|
415
|
+
className: "tla-asks-list"
|
|
416
|
+
}, asks.map((ask) => /* @__PURE__ */ React.createElement("li", {
|
|
417
|
+
key: ask.sessionFile
|
|
418
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
419
|
+
type: "button",
|
|
420
|
+
className: "tla-ask",
|
|
421
|
+
onClick: () => open(ask)
|
|
422
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
423
|
+
className: "tla-ask-mark",
|
|
424
|
+
"aria-hidden": "true"
|
|
425
|
+
}, "?"), /* @__PURE__ */ React.createElement("span", {
|
|
426
|
+
className: "tla-ask-text"
|
|
427
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
428
|
+
className: "tla-ask-title"
|
|
429
|
+
}, ask.title || actions.words.asksHint), /* @__PURE__ */ React.createElement("span", {
|
|
430
|
+
className: "tla-ask-question"
|
|
431
|
+
}, ask.question ?? actions.words.asksHint)))))));
|
|
432
|
+
}
|
|
389
433
|
function LauncherView({ context }) {
|
|
390
434
|
const { pi, mine: store, actions } = context;
|
|
391
435
|
const words = actions.words;
|
|
@@ -419,7 +463,9 @@ function LauncherView({ context }) {
|
|
|
419
463
|
})));
|
|
420
464
|
return /* @__PURE__ */ React.createElement("div", {
|
|
421
465
|
className: "tla"
|
|
422
|
-
}, /* @__PURE__ */ React.createElement(
|
|
466
|
+
}, /* @__PURE__ */ React.createElement(Asks, {
|
|
467
|
+
context
|
|
468
|
+
}), /* @__PURE__ */ React.createElement("header", {
|
|
423
469
|
className: "tla-head"
|
|
424
470
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
425
471
|
className: "tla-label"
|
|
@@ -488,6 +534,17 @@ var STYLE = `
|
|
|
488
534
|
.tla { display: flex; flex-direction: column; }
|
|
489
535
|
.tla-head { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 2px 10px; }
|
|
490
536
|
.tla-head-mine { margin-top: 18px; }
|
|
537
|
+
/* The conversations that wait for the user to decide: rows above the pages, with the blue ? of the list of chats. */
|
|
538
|
+
.tla-asks { margin-bottom: 14px; }
|
|
539
|
+
.tla-asks .tla-label { flex: none; color: color-mix(in srgb, var(--ta-blue) 80%, var(--ta-muted)); }
|
|
540
|
+
.tla-asks-count { min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: color-mix(in srgb, var(--ta-blue) 14%, transparent); color: color-mix(in srgb, var(--ta-blue) 80%, var(--ta-muted)); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
|
|
541
|
+
.tla-asks-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
|
|
542
|
+
.tla-ask { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--ta-blue) 30%, var(--ta-border)); border-radius: 10px; background: color-mix(in srgb, var(--ta-blue) 5%, transparent); color: var(--ta-text); text-align: left; cursor: pointer; }
|
|
543
|
+
.tla-ask-mark { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--ta-blue); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
|
|
544
|
+
.tla-ask-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
|
|
545
|
+
.tla-ask-title, .tla-ask-question { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
546
|
+
.tla-ask-title { font-size: calc(13.5px * var(--ta-font-scale)); line-height: calc(19px * var(--ta-font-scale)); font-weight: 500; }
|
|
547
|
+
.tla-ask-question { color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
491
548
|
.tla-label { flex: 1; min-width: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); font-weight: 500; }
|
|
492
549
|
.tla-tools { display: flex; gap: 2px; margin-right: -6px; }
|
|
493
550
|
.tla-tool { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ta-muted); cursor: pointer; transition: background 140ms, color 140ms; }
|