@celljs/ta-rooms 4.15.2 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extension/index.mjs +1 -0
- package/host/index.mjs +497 -492
- package/package.json +4 -4
- package/web/index.js +223 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-rooms",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "A pi package for Ta: rooms shared with other Ta through the relay, end to end: who asks to join and the owner's answer, your rooms and their members, your Ta friends, and links that invite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-protocol": "4.
|
|
31
|
-
"@celljs/ta-relay": "4.
|
|
32
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-protocol": "4.17.0",
|
|
31
|
+
"@celljs/ta-relay": "4.17.0",
|
|
32
|
+
"@celljs/ta-web": "4.17.0",
|
|
33
33
|
"@types/react": "^19.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -773,7 +773,7 @@ var EN = {
|
|
|
773
773
|
members: "Members",
|
|
774
774
|
memberCount: "{n} members",
|
|
775
775
|
onlineCount: "{n} online",
|
|
776
|
-
membersTitle: "
|
|
776
|
+
membersTitle: "About the room",
|
|
777
777
|
membersCount: "{n} members · {online} online",
|
|
778
778
|
noRoomOpen: "Open a room to see who is in it",
|
|
779
779
|
you: "You",
|
|
@@ -839,6 +839,7 @@ var EN = {
|
|
|
839
839
|
roomOfName: "{name}’s room",
|
|
840
840
|
back: "Back",
|
|
841
841
|
openPage: "Open {name}",
|
|
842
|
+
apps: "Apps of the room",
|
|
842
843
|
pageLine: "A room of {name}: play in it together",
|
|
843
844
|
chatEmpty: "Nothing said yet. Only those in the room read it: the relay keeps it sealed.",
|
|
844
845
|
chatPlaceholder: "Message",
|
|
@@ -892,7 +893,7 @@ var ZH = {
|
|
|
892
893
|
members: "成员",
|
|
893
894
|
memberCount: "{n} 位成员",
|
|
894
895
|
onlineCount: "{n} 人在线",
|
|
895
|
-
membersTitle: "
|
|
896
|
+
membersTitle: "房间信息",
|
|
896
897
|
membersCount: "{n} 位成员 · {online} 人在线",
|
|
897
898
|
noRoomOpen: "打开一个房间,这里显示它的成员",
|
|
898
899
|
you: "我",
|
|
@@ -958,6 +959,7 @@ var ZH = {
|
|
|
958
959
|
roomOfName: "{name}的房间",
|
|
959
960
|
back: "返回",
|
|
960
961
|
openPage: "打开{name}",
|
|
962
|
+
apps: "房间应用",
|
|
961
963
|
pageLine: "{name}的房间,大家可以一起玩",
|
|
962
964
|
chatEmpty: "还没有人说话。只有房间里的人能看到,中继保存的是密文。",
|
|
963
965
|
chatPlaceholder: "发消息",
|
|
@@ -1011,7 +1013,7 @@ var ZH_TW = {
|
|
|
1011
1013
|
members: "成員",
|
|
1012
1014
|
memberCount: "{n} 位成員",
|
|
1013
1015
|
onlineCount: "{n} 人線上",
|
|
1014
|
-
membersTitle: "
|
|
1016
|
+
membersTitle: "房間資訊",
|
|
1015
1017
|
membersCount: "{n} 位成員 · {online} 人線上",
|
|
1016
1018
|
noRoomOpen: "開啟一個房間,這裡顯示它的成員",
|
|
1017
1019
|
you: "我",
|
|
@@ -1077,6 +1079,7 @@ var ZH_TW = {
|
|
|
1077
1079
|
roomOfName: "{name}的房間",
|
|
1078
1080
|
back: "返回",
|
|
1079
1081
|
openPage: "開啟{name}",
|
|
1082
|
+
apps: "房間應用",
|
|
1080
1083
|
pageLine: "{name}的房間,大家可以一起玩",
|
|
1081
1084
|
chatEmpty: "還沒有人說話。只有房間裡的人能看到,中繼儲存的是密文。",
|
|
1082
1085
|
chatPlaceholder: "發訊息",
|
|
@@ -1130,7 +1133,7 @@ var JA = {
|
|
|
1130
1133
|
members: "メンバー",
|
|
1131
1134
|
memberCount: "{n} 人のメンバー",
|
|
1132
1135
|
onlineCount: "{n} 人がオンライン",
|
|
1133
|
-
membersTitle: "
|
|
1136
|
+
membersTitle: "ルーム情報",
|
|
1134
1137
|
membersCount: "{n} 人のメンバー · {online} 人がオンライン",
|
|
1135
1138
|
noRoomOpen: "ルームを開いて、メンバーを確認します",
|
|
1136
1139
|
you: "私",
|
|
@@ -1196,6 +1199,7 @@ var JA = {
|
|
|
1196
1199
|
roomOfName: "{name}のルーム",
|
|
1197
1200
|
back: "戻る",
|
|
1198
1201
|
openPage: "{name} を開く",
|
|
1202
|
+
apps: "ルームのアプリ",
|
|
1199
1203
|
pageLine: "{name} のルーム:一緒にプレイします",
|
|
1200
1204
|
chatEmpty: "まだ何も言われていません。ルーム内の人だけが見ることができます。リレーは暗号化されて保存します。",
|
|
1201
1205
|
chatPlaceholder: "メッセージ",
|
|
@@ -1541,6 +1545,69 @@ function usePageOf(room) {
|
|
|
1541
1545
|
}
|
|
1542
1546
|
return pages.find((page) => page.id === view) ?? pages.find((page) => page.onOpen && view.startsWith(`${page.id}/`));
|
|
1543
1547
|
}
|
|
1548
|
+
function useRoomApps(room) {
|
|
1549
|
+
const entries = pi.ui.useRoomAddons?.() ?? [];
|
|
1550
|
+
const page = usePageOf(room ?? { view: undefined });
|
|
1551
|
+
const [, redraw] = React.useReducer((n) => n + 1, 0);
|
|
1552
|
+
React.useEffect(() => {
|
|
1553
|
+
const stops = entries.map(({ addon }) => addon.subscribe?.(redraw));
|
|
1554
|
+
return () => {
|
|
1555
|
+
for (const stop of stops) {
|
|
1556
|
+
stop?.();
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
}, [entries]);
|
|
1560
|
+
if (room?.status !== "member") {
|
|
1561
|
+
return { apps: [], lines: [] };
|
|
1562
|
+
}
|
|
1563
|
+
const safe = (read) => {
|
|
1564
|
+
try {
|
|
1565
|
+
return read();
|
|
1566
|
+
} catch (error) {
|
|
1567
|
+
console.error("An app of the rooms failed:", error);
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
};
|
|
1571
|
+
const apps = [];
|
|
1572
|
+
const lines = [];
|
|
1573
|
+
if (page && room.view) {
|
|
1574
|
+
const view = room.view;
|
|
1575
|
+
const app = { id: view, label: page.title, icon: page.icon ?? icon("ExternalLink"), open: () => void pi.ui.showView(view) };
|
|
1576
|
+
apps.push(app);
|
|
1577
|
+
lines.push({ id: view, text: t("pageLine", { name: page.title }), icon: app.icon, app });
|
|
1578
|
+
}
|
|
1579
|
+
for (const { id, addon } of entries) {
|
|
1580
|
+
const tile = safe(() => addon.tile?.(room));
|
|
1581
|
+
const line = safe(() => addon.line?.(room));
|
|
1582
|
+
if (!tile && !line) {
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1585
|
+
const app = {
|
|
1586
|
+
id,
|
|
1587
|
+
label: tile?.label ?? "",
|
|
1588
|
+
icon: icon(tile?.icon ?? line?.icon ?? "Sparkles"),
|
|
1589
|
+
...tile?.status ? { status: tile.status } : {},
|
|
1590
|
+
...tile?.attention ? { attention: true } : {},
|
|
1591
|
+
...addon.page ? { page: addon.page } : {},
|
|
1592
|
+
...addon.open ? { open: () => addon.open?.(room) } : {}
|
|
1593
|
+
};
|
|
1594
|
+
if (tile) {
|
|
1595
|
+
apps.push(app);
|
|
1596
|
+
}
|
|
1597
|
+
if (line) {
|
|
1598
|
+
lines.push({ id, text: line.text, icon: icon(line.icon ?? tile?.icon ?? "Sparkles"), app });
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return { apps, lines };
|
|
1602
|
+
}
|
|
1603
|
+
function openApp(room, app) {
|
|
1604
|
+
if (app.page) {
|
|
1605
|
+
book.set({ sub: { room: room.id, app: app.id } });
|
|
1606
|
+
pi.ui.showView(MEMBERS_VIEW);
|
|
1607
|
+
} else {
|
|
1608
|
+
app.open?.();
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1544
1611
|
function statusLine(room) {
|
|
1545
1612
|
switch (room.status) {
|
|
1546
1613
|
case "waiting":
|
|
@@ -2928,29 +2995,43 @@ function RoomHead({ room }) {
|
|
|
2928
2995
|
onClick: () => void pi.ui.showView(MEMBERS_VIEW)
|
|
2929
2996
|
}));
|
|
2930
2997
|
}
|
|
2931
|
-
function
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2998
|
+
function AppStrip({ room }) {
|
|
2999
|
+
const { lines } = useRoomApps(room);
|
|
3000
|
+
const Chevron = icon("ChevronRight");
|
|
3001
|
+
if (!lines.length) {
|
|
2934
3002
|
return null;
|
|
2935
3003
|
}
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
3004
|
+
if (lines.length === 1) {
|
|
3005
|
+
const [line] = lines;
|
|
3006
|
+
return /* @__PURE__ */ React.createElement("button", {
|
|
3007
|
+
type: "button",
|
|
3008
|
+
className: "trm-page-line",
|
|
3009
|
+
onClick: () => openApp(room, line.app)
|
|
3010
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3011
|
+
className: "trm-page-line-icon"
|
|
3012
|
+
}, /* @__PURE__ */ React.createElement(line.icon, {
|
|
3013
|
+
size: 15
|
|
3014
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3015
|
+
className: "trm-page-line-text"
|
|
3016
|
+
}, line.text), /* @__PURE__ */ React.createElement("span", {
|
|
3017
|
+
className: "trm-page-line-chevron"
|
|
3018
|
+
}, /* @__PURE__ */ React.createElement(Chevron, {
|
|
3019
|
+
size: 15
|
|
3020
|
+
})));
|
|
3021
|
+
}
|
|
3022
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
3023
|
+
className: "trm-app-chips"
|
|
3024
|
+
}, lines.map((line) => /* @__PURE__ */ React.createElement("button", {
|
|
3025
|
+
key: line.id,
|
|
2940
3026
|
type: "button",
|
|
2941
|
-
className: "trm-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
2946
|
-
size: 15
|
|
2947
|
-
})), /* @__PURE__ */ React.createElement("span", {
|
|
2948
|
-
className: "trm-page-line-text"
|
|
2949
|
-
}, t("pageLine", { name: page.title })), /* @__PURE__ */ React.createElement("span", {
|
|
2950
|
-
className: "trm-page-line-open"
|
|
2951
|
-
}, t("openPage", { name: page.title }), /* @__PURE__ */ React.createElement(Chevron, {
|
|
3027
|
+
className: "trm-app-chip",
|
|
3028
|
+
title: line.text,
|
|
3029
|
+
onClick: () => openApp(room, line.app)
|
|
3030
|
+
}, /* @__PURE__ */ React.createElement(line.icon, {
|
|
2952
3031
|
size: 14
|
|
2953
|
-
})
|
|
3032
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
3033
|
+
className: "trm-ellipsis"
|
|
3034
|
+
}, line.app.label ? `${line.app.label}${line.app.status ? ` · ${line.app.status}` : ""}` : line.text))));
|
|
2954
3035
|
}
|
|
2955
3036
|
function RoomView({ room, head, onBack }) {
|
|
2956
3037
|
const Back = icon("ArrowLeft");
|
|
@@ -3006,7 +3087,7 @@ function RoomView({ room, head, onBack }) {
|
|
|
3006
3087
|
size: 18
|
|
3007
3088
|
})), /* @__PURE__ */ React.createElement(RoomHead, {
|
|
3008
3089
|
room
|
|
3009
|
-
})), /* @__PURE__ */ React.createElement(
|
|
3090
|
+
})), /* @__PURE__ */ React.createElement(AppStrip, {
|
|
3010
3091
|
room
|
|
3011
3092
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
3012
3093
|
className: "trm-chat ta-conversation",
|
|
@@ -3079,6 +3160,7 @@ function RoomView({ room, head, onBack }) {
|
|
|
3079
3160
|
className: "trm-chat-bottom"
|
|
3080
3161
|
}, /* @__PURE__ */ React.createElement(pi.ui.Composer, {
|
|
3081
3162
|
placeholder: t("chatPlaceholder"),
|
|
3163
|
+
draft: room.id,
|
|
3082
3164
|
onSend: say,
|
|
3083
3165
|
mentions,
|
|
3084
3166
|
mentionLabel: dt("mentionLabel")
|
|
@@ -3758,12 +3840,53 @@ function SettingRow({ label, value, onClick }) {
|
|
|
3758
3840
|
size: 15
|
|
3759
3841
|
}));
|
|
3760
3842
|
}
|
|
3843
|
+
function AppTiles({ room, apps }) {
|
|
3844
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
3845
|
+
className: "trm-apps"
|
|
3846
|
+
}, apps.map((app, index) => /* @__PURE__ */ React.createElement("button", {
|
|
3847
|
+
key: app.id,
|
|
3848
|
+
type: "button",
|
|
3849
|
+
className: "trm-app",
|
|
3850
|
+
onClick: () => openApp(room, app)
|
|
3851
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3852
|
+
className: `trm-app-icon trm-app-tint-${index % 3}`
|
|
3853
|
+
}, /* @__PURE__ */ React.createElement(app.icon, {
|
|
3854
|
+
size: 20
|
|
3855
|
+
}), app.attention && /* @__PURE__ */ React.createElement("span", {
|
|
3856
|
+
className: "trm-app-dot"
|
|
3857
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3858
|
+
className: "trm-app-label trm-ellipsis"
|
|
3859
|
+
}, app.label), /* @__PURE__ */ React.createElement("span", {
|
|
3860
|
+
className: `trm-app-status trm-ellipsis${app.attention ? " trm-app-status-on" : ""}`
|
|
3861
|
+
}, app.status ?? ""))));
|
|
3862
|
+
}
|
|
3863
|
+
function SubPage({ title, onBack, children }) {
|
|
3864
|
+
const Back = icon("ArrowLeft");
|
|
3865
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
3866
|
+
className: "trm-sub"
|
|
3867
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
3868
|
+
className: "trm-sub-head"
|
|
3869
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
3870
|
+
type: "button",
|
|
3871
|
+
className: "trm-icon",
|
|
3872
|
+
title: t("back"),
|
|
3873
|
+
"aria-label": t("back"),
|
|
3874
|
+
onClick: onBack
|
|
3875
|
+
}, /* @__PURE__ */ React.createElement(Back, {
|
|
3876
|
+
size: 18
|
|
3877
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3878
|
+
className: "trm-sub-title trm-ellipsis"
|
|
3879
|
+
}, title)), /* @__PURE__ */ React.createElement("div", {
|
|
3880
|
+
className: "trm-sub-body"
|
|
3881
|
+
}, children));
|
|
3882
|
+
}
|
|
3761
3883
|
function MembersView() {
|
|
3762
3884
|
const { identity } = useBook();
|
|
3763
3885
|
const room = useOpened();
|
|
3764
|
-
const page = usePageOf(room ?? { view: undefined });
|
|
3765
3886
|
const agents = useAgents(room ?? { status: "gone" });
|
|
3766
3887
|
const joining = useJoining(room ?? { id: "", status: "gone", members: [] });
|
|
3888
|
+
const { apps } = useRoomApps(room);
|
|
3889
|
+
const { sub } = useBook();
|
|
3767
3890
|
if (!room) {
|
|
3768
3891
|
return /* @__PURE__ */ React.createElement("div", {
|
|
3769
3892
|
className: "trm-panel"
|
|
@@ -3771,6 +3894,23 @@ function MembersView() {
|
|
|
3771
3894
|
title: t("noRoomOpen")
|
|
3772
3895
|
}));
|
|
3773
3896
|
}
|
|
3897
|
+
const pushed = sub?.room === room.id ? sub.app : undefined;
|
|
3898
|
+
const back = () => book.set({ sub: undefined });
|
|
3899
|
+
if (pushed === "doubles") {
|
|
3900
|
+
return /* @__PURE__ */ React.createElement(SubPage, {
|
|
3901
|
+
title: dt("log"),
|
|
3902
|
+
onBack: back
|
|
3903
|
+
}, /* @__PURE__ */ React.createElement(DoublesView, null));
|
|
3904
|
+
}
|
|
3905
|
+
const app = pushed ? apps.find((each) => each.id === pushed && each.page) : undefined;
|
|
3906
|
+
if (app?.page) {
|
|
3907
|
+
return /* @__PURE__ */ React.createElement(SubPage, {
|
|
3908
|
+
title: app.label,
|
|
3909
|
+
onBack: back
|
|
3910
|
+
}, /* @__PURE__ */ React.createElement(app.page, {
|
|
3911
|
+
room
|
|
3912
|
+
}));
|
|
3913
|
+
}
|
|
3774
3914
|
const Plus = icon("Plus");
|
|
3775
3915
|
const Bot = icon("Bot");
|
|
3776
3916
|
const online = room.members.filter((member) => member.online).length;
|
|
@@ -3790,7 +3930,12 @@ function MembersView() {
|
|
|
3790
3930
|
className: "trm-ellipsis"
|
|
3791
3931
|
}, room.title), /* @__PURE__ */ React.createElement("span", {
|
|
3792
3932
|
className: "trm-ellipsis"
|
|
3793
|
-
}, room.owner ? t("ownRoom") : t("roomOf", { name: room.ownerName })))), /* @__PURE__ */ React.createElement("div", {
|
|
3933
|
+
}, room.owner ? t("ownRoom") : t("roomOf", { name: room.ownerName })))), apps.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
3934
|
+
className: "trm-panel-label"
|
|
3935
|
+
}, t("apps")), /* @__PURE__ */ React.createElement(AppTiles, {
|
|
3936
|
+
room,
|
|
3937
|
+
apps
|
|
3938
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
3794
3939
|
className: "trm-panel-label"
|
|
3795
3940
|
}, t("membersCount", { n: room.members.length, online })), /* @__PURE__ */ React.createElement("ul", {
|
|
3796
3941
|
className: "trm-panel-members"
|
|
@@ -3843,12 +3988,9 @@ function MembersView() {
|
|
|
3843
3988
|
room
|
|
3844
3989
|
}), /* @__PURE__ */ React.createElement(SettingRow, {
|
|
3845
3990
|
label: dt("log"),
|
|
3846
|
-
onClick: () =>
|
|
3991
|
+
onClick: () => book.set({ sub: { room: room.id, app: "doubles" } })
|
|
3847
3992
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
3848
3993
|
className: "trm-panel-sep"
|
|
3849
|
-
}), page && room.view && /* @__PURE__ */ React.createElement(SettingRow, {
|
|
3850
|
-
label: t("openPage", { name: page.title }),
|
|
3851
|
-
onClick: () => void pi.ui.showView(room.view)
|
|
3852
3994
|
}), /* @__PURE__ */ React.createElement(SettingRow, {
|
|
3853
3995
|
label: t("me"),
|
|
3854
3996
|
value: identity?.name,
|
|
@@ -4249,6 +4391,7 @@ function roomsSettings() {
|
|
|
4249
4391
|
return {
|
|
4250
4392
|
title: () => t("roomsTitle"),
|
|
4251
4393
|
icon: icon("Users"),
|
|
4394
|
+
group: "general",
|
|
4252
4395
|
rows: [{ key: "home", label: () => t("showOnHome"), description: () => t("showOnHomeHint"), render: HomeSwitch }]
|
|
4253
4396
|
};
|
|
4254
4397
|
}
|
|
@@ -4269,7 +4412,7 @@ var STYLE = `
|
|
|
4269
4412
|
.trm-head-room { flex: 1; min-width: 0; display: flex; align-items: center; padding-left: 20px; }
|
|
4270
4413
|
/* The list, as the sidebar of the double: faces, a name and when, a line under it */
|
|
4271
4414
|
.trm-page { flex: 1; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: none; }
|
|
4272
|
-
.trm-page > .trm-list { max-width:
|
|
4415
|
+
.trm-page > .trm-list { max-width: var(--ta-page-width); margin: 0 auto; }
|
|
4273
4416
|
.trm-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; }
|
|
4274
4417
|
.trm-section h3 { display: flex; align-items: center; height: 30px; margin: 0; padding: 0 10px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; letter-spacing: 0.02em; color: var(--ta-muted); }
|
|
4275
4418
|
.trm-card { margin: 0; padding: 2px 6px; list-style: none; border-radius: 14px; background: var(--ta-raised); }
|
|
@@ -4334,6 +4477,32 @@ var STYLE = `
|
|
|
4334
4477
|
.trm-page-line-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--ta-tint-3); color: var(--ta-tint-ink-3); }
|
|
4335
4478
|
.trm-page-line-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-secondary); }
|
|
4336
4479
|
.trm-page-line-open { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--ta-link); font-weight: 500; }
|
|
4480
|
+
.trm-page-line-chevron { display: inline-flex; flex: none; color: var(--ta-muted); }
|
|
4481
|
+
/* Several apps tell something at once: a row of chips that scrolls sideways, never lines stacked over the chat */
|
|
4482
|
+
.trm-app-chips { flex: none; display: flex; gap: 6px; width: calc(100% - 48px); max-width: var(--ta-col); margin: 8px auto 0; overflow-x: auto; scrollbar-width: none; }
|
|
4483
|
+
.trm-app-chips::-webkit-scrollbar { display: none; }
|
|
4484
|
+
.trm-app-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 240px; min-height: 30px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 999px; background: var(--ta-side); color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
4485
|
+
.trm-app-chip:hover { background: var(--ta-hover); }
|
|
4486
|
+
.trm-app-chip > svg { flex: none; color: var(--ta-muted); }
|
|
4487
|
+
/* The apps of a room in its panel: tiles, as the apps of a group */
|
|
4488
|
+
.trm-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 2px; padding: 0 2px 4px; }
|
|
4489
|
+
.trm-app { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 4px 8px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; cursor: pointer; }
|
|
4490
|
+
.trm-app:hover { background: var(--ta-hover); }
|
|
4491
|
+
.trm-app-icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 2px; border-radius: 12px; }
|
|
4492
|
+
.trm-app-tint-0 { background: var(--ta-tint-3); color: var(--ta-tint-ink-3); }
|
|
4493
|
+
.trm-app-tint-1 { background: var(--ta-tint-5); color: var(--ta-tint-ink-5); }
|
|
4494
|
+
.trm-app-tint-2 { background: var(--ta-tint-0); color: var(--ta-tint-ink-0); }
|
|
4495
|
+
.trm-app-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ta-link); box-shadow: 0 0 0 2px var(--ta-main); }
|
|
4496
|
+
.trm-app-label { max-width: 100%; font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
4497
|
+
.trm-app-status { max-width: 100%; min-height: calc(15px * var(--ta-font-scale)); color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); line-height: calc(15px * var(--ta-font-scale)); }
|
|
4498
|
+
.trm-app-status-on { color: var(--ta-link); }
|
|
4499
|
+
/* A page pushed in the panel of the room */
|
|
4500
|
+
.trm-sub { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--ta-main); color: var(--ta-text); animation: trm-sub-in 180ms ease-out; }
|
|
4501
|
+
.trm-sub-head { display: flex; align-items: center; gap: 4px; flex: none; height: 44px; padding: 0 8px; border-bottom: 1px solid var(--ta-border-muted); }
|
|
4502
|
+
.trm-sub-title { font-weight: 600; font-size: calc(14px * var(--ta-font-scale)); }
|
|
4503
|
+
.trm-sub-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
4504
|
+
.trm-sub-body > * { flex: 1; min-height: 0; height: auto; }
|
|
4505
|
+
@keyframes trm-sub-in { from { transform: translateX(20px); opacity: 0; } }
|
|
4337
4506
|
.trm-chat { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; overscroll-behavior: none; }
|
|
4338
4507
|
.trm-chat-col { position: relative; display: flex; flex-direction: column; gap: 4px; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 20px 24px 12px; box-sizing: border-box; }
|
|
4339
4508
|
.trm-chat-time { align-self: center; margin: 14px 0 6px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
@@ -4375,8 +4544,8 @@ button.trm-member { cursor: pointer; }
|
|
|
4375
4544
|
.trm-setting { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; }
|
|
4376
4545
|
.trm-setting:hover { background: var(--ta-hover); }
|
|
4377
4546
|
.trm-setting > svg { flex: none; color: var(--ta-muted); }
|
|
4378
|
-
.trm-setting-label { flex:
|
|
4379
|
-
.trm-setting-value { flex:
|
|
4547
|
+
.trm-setting-label { flex: 1; min-width: 0; }
|
|
4548
|
+
.trm-setting-value { flex: none; max-width: 55%; text-align: right; color: var(--ta-muted); }
|
|
4380
4549
|
.trm-panel-foot { display: flex; justify-content: center; flex: none; padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ta-border-muted); }
|
|
4381
4550
|
.trm-panel-foot .trm-link { width: 100%; min-height: 36px; border-radius: 10px; font-weight: 500; }
|
|
4382
4551
|
/* Dialogs */
|
|
@@ -4394,7 +4563,7 @@ button.trm-member { cursor: pointer; }
|
|
|
4394
4563
|
.trm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
|
|
4395
4564
|
.trm-center { justify-content: center; }
|
|
4396
4565
|
.trm-join { display: flex; align-items: center; gap: 12px; }
|
|
4397
|
-
.trm-friends-page { max-width:
|
|
4566
|
+
.trm-friends-page { max-width: var(--ta-page-width); margin: 0 auto; width: 100%; overflow-y: auto; height: 100%; }
|
|
4398
4567
|
.trm-friends-other { gap: 18px; padding-top: 4px; }
|
|
4399
4568
|
.trm-friends-entry { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--ta-surface, transparent); color: inherit; font: inherit; cursor: pointer; text-align: left; }
|
|
4400
4569
|
@media (hover: hover) { .trm-friends-entry:hover { background: var(--ta-hover); } }
|
|
@@ -4467,9 +4636,9 @@ button.trm-member { cursor: pointer; }
|
|
|
4467
4636
|
[data-layout='compact'] .trm-faces.trm-on-icon, [data-layout='compact'] .trm-faces.trm-on-icon .trm-faces-one { background: none; }
|
|
4468
4637
|
[data-layout='compact'] .trm-chat-col, [data-layout='compact'] .trm-chat-bottom { padding-left: 12px; padding-right: 12px; }
|
|
4469
4638
|
[data-layout='compact'] .trm-msg-col { max-width: calc(100% - 40px); }
|
|
4470
|
-
[data-layout='compact'] .trm-page-line { width: calc(100% - 24px); }
|
|
4639
|
+
[data-layout='compact'] .trm-page-line, [data-layout='compact'] .trm-app-chips { width: calc(100% - 24px); }
|
|
4471
4640
|
@media (max-width: 480px) { .trm-answers .ta-button { padding-left: 10px; padding-right: 10px; } }
|
|
4472
|
-
@media (prefers-reduced-motion: reduce) { .trm-room, .trm-page-line { transition: none; } }
|
|
4641
|
+
@media (prefers-reduced-motion: reduce) { .trm-room, .trm-page-line { transition: none; } .trm-sub { animation: none; } }
|
|
4473
4642
|
`;
|
|
4474
4643
|
function injectStyle() {
|
|
4475
4644
|
const element = document.createElement("style");
|
|
@@ -4506,8 +4675,24 @@ function activate(pi2) {
|
|
|
4506
4675
|
bind(pi2.React);
|
|
4507
4676
|
bindPage(pi2);
|
|
4508
4677
|
const removeStyle = injectStyle();
|
|
4509
|
-
pi2.registerView("rooms", {
|
|
4510
|
-
|
|
4678
|
+
pi2.registerView("rooms", {
|
|
4679
|
+
title: () => t("roomsTitle"),
|
|
4680
|
+
icon: icon("Users"),
|
|
4681
|
+
render: RoomsPage,
|
|
4682
|
+
head: RoomsHead,
|
|
4683
|
+
discover: true,
|
|
4684
|
+
group: "people",
|
|
4685
|
+
order: 81
|
|
4686
|
+
});
|
|
4687
|
+
pi2.registerView("friends", {
|
|
4688
|
+
title: () => t("friends"),
|
|
4689
|
+
icon: icon("Contact"),
|
|
4690
|
+
render: FriendsPage,
|
|
4691
|
+
head: FriendsHead,
|
|
4692
|
+
discover: true,
|
|
4693
|
+
group: "people",
|
|
4694
|
+
order: 79
|
|
4695
|
+
});
|
|
4511
4696
|
pi2.registerView("members", { title: () => t("membersTitle"), icon: icon("Users"), render: MembersView, location: "panel", order: 90 });
|
|
4512
4697
|
pi2.registerView(DOUBLES_VIEW.slice(DOUBLES_VIEW.lastIndexOf("/") + 1), {
|
|
4513
4698
|
title: () => dt("logTitle"),
|