anentrypoint-design 0.0.232 → 0.0.234
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/app-shell.css +14 -1
- package/chat.css +25 -0
- package/dist/247420.css +39 -1
- package/dist/247420.js +10 -10
- package/package.json +1 -1
- package/src/community-app.js +17 -8
- package/src/components/files.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.234",
|
|
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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// channelContext(id, x, y), serverContext(id, x, y), switchServer(id),
|
|
22
22
|
// goHome(), openServers(), memberMenu(id, name, x, y),
|
|
23
23
|
// replaySegment(id), skipSegment(), pauseQueue(), resumeQueue(),
|
|
24
|
-
// setInput(v), cancelReply()
|
|
24
|
+
// setInput(v), startReply(msg), cancelReply(), deleteMessage(id)
|
|
25
25
|
// }
|
|
26
26
|
// adapter.helpers = { avatarColor(id), initial(name), formatTime(ts) }
|
|
27
27
|
//
|
|
@@ -112,8 +112,8 @@ export function mountCommunityApp(root, adapter = {}) {
|
|
|
112
112
|
const partsFromMessage = (m) => {
|
|
113
113
|
const parts = [];
|
|
114
114
|
if (m.replyTo) {
|
|
115
|
-
const who = m.replyTo.username || 'User';
|
|
116
|
-
const quoted = (m.replyTo.content || '').replace(/\n/g, ' ').slice(0, 120);
|
|
115
|
+
const who = m.replyTo.username || (m.replyTo.userId && A.resolveProfile && A.resolveProfile(m.replyTo.userId)) || 'User';
|
|
116
|
+
const quoted = m.replyTo.content ? (m.replyTo.content || '').replace(/\n/g, ' ').slice(0, 120) : '(message unavailable)';
|
|
117
117
|
parts.push({ kind: 'md', text: '> **@' + who + ':** ' + quoted });
|
|
118
118
|
}
|
|
119
119
|
const content = m.content || '';
|
|
@@ -138,21 +138,30 @@ export function mountCommunityApp(root, adapter = {}) {
|
|
|
138
138
|
const username = (A.resolveProfile && A.resolveProfile(m.userId)) || m.username || 'User';
|
|
139
139
|
const isYou = selfId && String(m.userId) === String(selfId);
|
|
140
140
|
const reactions = Array.isArray(m.reactions) ? m.reactions.map(r => ({ emoji: r.emoji, count: r.count != null ? r.count : (r.users ? r.users.length : 1), you: !!(r.you || (r.users && selfId && r.users.includes(selfId))) })) : null;
|
|
141
|
-
|
|
141
|
+
const msgActions = [
|
|
142
|
+
{ label: 'reply', title: 'reply to ' + username, icon: 'corner-up-left', onClick: () => A.startReply && A.startReply({ id: m.id, userId: m.userId, username, content: m.content }) },
|
|
143
|
+
isYou ? { label: 'delete', title: 'delete message', icon: 'trash', onClick: () => A.deleteMessage && A.deleteMessage(m.id) } : null,
|
|
144
|
+
].filter(Boolean);
|
|
145
|
+
return { key: m.id || ('m' + i), who: isYou ? 'you' : 'them', name: isYou ? null : username, avatar: initial(username), time: formatTime(m.timestamp), parts: partsFromMessage(m), reactions, actions: msgActions, receipt: isYou && m.read ? 'read' : (isYou && m.delivered ? 'delivered' : null) };
|
|
142
146
|
});
|
|
143
147
|
};
|
|
144
148
|
|
|
145
149
|
const chatView = (s) => {
|
|
146
150
|
const ch = s.currentChannel || {};
|
|
147
151
|
const sub = ch.type === 'voice' ? 'voice' : ch.type === 'forum' ? 'forum' : ch.type === 'page' ? 'page' : ch.type === 'announcement' ? 'announcement' : 'public';
|
|
152
|
+
const rt = s.replyTarget;
|
|
153
|
+
const replyPreview = rt ? h('div', { class: 'cm-reply-preview', role: 'status' },
|
|
154
|
+
h('span', { class: 'cm-reply-preview-label' }, 'Replying to ' + (rt.username || 'User')),
|
|
155
|
+
h('button', { type: 'button', class: 'cm-reply-preview-close', 'aria-label': 'cancel reply', title: 'cancel reply', onclick: (e) => { e.preventDefault(); A.cancelReply && A.cancelReply(); } }, Icon('x', { size: 14 }))
|
|
156
|
+
) : null;
|
|
148
157
|
return Chat({
|
|
149
158
|
title: ch.name || 'general', sub, messages: mapMessages(s), header: null,
|
|
150
|
-
composer: ChatComposer({
|
|
159
|
+
composer: h('div', { class: 'cm-composer-wrap' }, replyPreview, ChatComposer({
|
|
151
160
|
value: s.chatInputValue || '',
|
|
152
|
-
placeholder: 'message #' + (ch.name || 'general') + '…',
|
|
161
|
+
placeholder: rt ? 'reply to ' + (rt.username || 'User') + '…' : 'message #' + (ch.name || 'general') + '…',
|
|
153
162
|
onInput: (v) => A.setInput && A.setInput(v),
|
|
154
|
-
onSend: (v) => { const t = (v || '').trim(); if (t) A.send && A.send(t); },
|
|
155
|
-
}),
|
|
163
|
+
onSend: (v) => { const t = (v || '').trim(); if (t) A.send && A.send(t, rt ? { replyTo: rt } : undefined); },
|
|
164
|
+
})),
|
|
156
165
|
});
|
|
157
166
|
};
|
|
158
167
|
|
package/src/components/files.js
CHANGED
|
@@ -44,7 +44,7 @@ export function FileIcon({ type = 'other' } = {}) {
|
|
|
44
44
|
|
|
45
45
|
// Default action set for FileRow. A host without mutation endpoints passes a
|
|
46
46
|
// narrower `actions` list (e.g. ['download']) so the row renders no dead controls.
|
|
47
|
-
const FILE_ROW_ACTIONS = ['download', 'rename', 'delete'];
|
|
47
|
+
const FILE_ROW_ACTIONS = ['download', 'rename', 'move', 'delete'];
|
|
48
48
|
|
|
49
49
|
export function FileRow({ name, type = 'other', size, modified, code, onOpen, onAction, active, key, permissions, locked,
|
|
50
50
|
actions = FILE_ROW_ACTIONS, busy = false, selectable = false, marked = false, onMark } = {}) {
|
|
@@ -81,6 +81,11 @@ export function FileRow({ name, type = 'other', size, modified, code, onOpen, on
|
|
|
81
81
|
? actBtn('download', 'download', `download ${name}`, 'arrow-down', false) : null,
|
|
82
82
|
actions.indexOf('rename') !== -1
|
|
83
83
|
? actBtn('rename', 'rename', `rename ${name}`, 'pencil', false) : null,
|
|
84
|
+
// Single-file move used to require checkbox-select + BulkBar - a
|
|
85
|
+
// per-row affordance matches fsbrowse and the kit rename/delete rows
|
|
86
|
+
// already on this row (no reason move alone needed a select detour).
|
|
87
|
+
actions.indexOf('move') !== -1
|
|
88
|
+
? actBtn('move', 'move', `move ${name}`, 'arrow-right', false) : null,
|
|
84
89
|
actions.indexOf('delete') !== -1
|
|
85
90
|
? actBtn('delete', 'delete', `delete ${name}`, 'x', true) : null,
|
|
86
91
|
].filter(Boolean) : [];
|