anentrypoint-design 0.0.376 → 0.0.377
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/dist/247420.css +23 -0
- package/dist/247420.js +26 -26
- package/package.json +1 -1
- package/src/community-app.js +16 -4
- package/src/components/shell.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.377",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
package/src/community-app.js
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
// voiceParticipants, micMuted, voiceDeafened,
|
|
14
14
|
// audioQueueItems, audioQueueCurrentId, audioQueuePaused,
|
|
15
15
|
// showAuthModal, settingsOpen, voiceSettingsOpen, replyTarget,
|
|
16
|
-
// mobileMenuOpen
|
|
16
|
+
// mobileMenuOpen, // drives the .ca-rail off-canvas drawer on narrow shells
|
|
17
|
+
// canManage // gates the rail's "+ create channel" affordance
|
|
17
18
|
// }
|
|
18
19
|
// adapter.subscribe(cb) -> unsubscribe // cb fires when any snapshot field changes
|
|
19
20
|
// adapter.actions = {
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
// channelContext(id, x, y), serverContext(id, x, y), switchServer(id),
|
|
23
24
|
// goHome(), openServers(), memberMenu(id, name, x, y),
|
|
24
25
|
// replaySegment(id), skipSegment(), pauseQueue(), resumeQueue(),
|
|
25
|
-
// setInput(v), startReply(msg), cancelReply(), deleteMessage(id)
|
|
26
|
+
// setInput(v), startReply(msg), cancelReply(), deleteMessage(id),
|
|
27
|
+
// createChannel() // optional; when present + canManage, rail shows a "+" next to "rooms"
|
|
26
28
|
// }
|
|
27
29
|
// adapter.helpers = { avatarColor(id), initial(name), formatTime(ts) }
|
|
28
30
|
//
|
|
@@ -65,11 +67,12 @@ export function mountCommunityApp(root, adapter = {}) {
|
|
|
65
67
|
const voice = channels.filter(c => c.type === 'voice' || c.type === 'threaded');
|
|
66
68
|
const cur = s.currentChannel || {};
|
|
67
69
|
const servers = s.servers || [];
|
|
70
|
+
if (text.length || !servers.length) {
|
|
71
|
+
out.push(groupHeader('rooms', s));
|
|
72
|
+
}
|
|
68
73
|
if (text.length) {
|
|
69
|
-
out.push(h('div', { class: 'group' }, 'rooms'));
|
|
70
74
|
for (const c of text) out.push(railPill(c, cur, false, s));
|
|
71
75
|
} else if (!servers.length) {
|
|
72
|
-
out.push(h('div', { class: 'group' }, 'rooms'));
|
|
73
76
|
out.push(h('div', { class: 'rail-empty', role: 'status' }, 'no rooms yet'));
|
|
74
77
|
}
|
|
75
78
|
if (voice.length) {
|
|
@@ -84,6 +87,15 @@ export function mountCommunityApp(root, adapter = {}) {
|
|
|
84
87
|
return h('div', {}, ...out);
|
|
85
88
|
};
|
|
86
89
|
|
|
90
|
+
const groupHeader = (label, s) => h('div', { class: 'group group-header' },
|
|
91
|
+
h('span', {}, label),
|
|
92
|
+
(s.canManage && A.createChannel)
|
|
93
|
+
? h('button', {
|
|
94
|
+
type: 'button', class: 'group-add-btn', 'aria-label': 'create channel', title: 'Create channel',
|
|
95
|
+
onclick: (e) => { e.preventDefault(); e.stopPropagation(); A.createChannel(); },
|
|
96
|
+
}, Icon('plus', { size: 13 }))
|
|
97
|
+
: null);
|
|
98
|
+
|
|
87
99
|
const railPill = (c, cur, isVoice, s) => {
|
|
88
100
|
const active = cur.id === c.id;
|
|
89
101
|
const inVoice = isVoice && s.voiceConnected && s.voiceChannelName === c.name;
|
package/src/components/shell.js
CHANGED
|
@@ -176,6 +176,7 @@ export const ICON_PATHS = {
|
|
|
176
176
|
'arrow-down': '<path d="M12 5v14M5 12l7 7 7-7"/>',
|
|
177
177
|
'arrow-right': '<path d="M5 12h14M12 5l7 7-7 7"/>',
|
|
178
178
|
x: '<path d="M18 6 6 18M6 6l12 12"/>',
|
|
179
|
+
plus: '<path d="M12 5v14M5 12h14"/>',
|
|
179
180
|
play: '<path d="M6 4v16l14-8z"/>',
|
|
180
181
|
pause: '<path d="M8 5v14M16 5v14"/>',
|
|
181
182
|
refresh: '<path d="M21 12a9 9 0 1 1-3-6.7L21 8"/><path d="M21 3v5h-5"/>',
|