peerpigeon 0.1.1 → 1.0.2
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.md +141 -1365
- package/cli.js +1382 -0
- package/dist/peerpigeon-browser.js +12450 -0
- package/dist/peerpigeon-browser.js.map +7 -0
- package/docs/API_DOCUMENTATION.md +1976 -0
- package/docs/BOOTSTRAP_HUBS.md +319 -0
- package/docs/CLI_README.md +371 -0
- package/docs/CUSTOM_HUB_NAMESPACES.md +182 -0
- package/docs/CUSTOM_NAMESPACE_IMPLEMENTATION.md +187 -0
- package/docs/DOCUMENTATION_REORGANIZATION.md +172 -0
- package/docs/HUB_QUICK_REF.md +108 -0
- package/docs/HUB_SCRIPTS.md +341 -0
- package/docs/HUB_SYSTEM.md +599 -0
- package/docs/MIGRATION_COMPLETE.md +93 -0
- package/docs/NETWORK_NAMESPACES.md +212 -0
- package/docs/PIGEONRTC_MIGRATION.md +280 -0
- package/docs/README.md +108 -0
- package/docs/SELECTIVE_STREAMING_GUIDE.md +427 -0
- package/docs/TEST_CLEANUP_COMPLETE.md +80 -0
- package/examples/bootstrap-hub-example.js +292 -0
- package/examples/browser/README.md +278 -0
- package/examples/browser/app.js +2426 -49
- package/examples/browser/index.html +481 -630
- package/examples/browser/minimal/README.md +55 -0
- package/examples/browser/minimal/index.html +75 -0
- package/examples/browser/minimal/minimal.js +234 -0
- package/examples/browser/styles.css +687 -1425
- package/examples/browser/test-bundle.html +35 -0
- package/examples/browser-2/index.html +30 -0
- package/examples/browser-2/package.json +21 -0
- package/examples/browser-2/src/App-simple.vue +21 -0
- package/examples/browser-2/src/App.vue +420 -0
- package/examples/browser-2/src/components/CryptoView.vue +1661 -0
- package/examples/browser-2/src/components/DHTView.vue +1281 -0
- package/examples/browser-2/src/components/DebugView.vue +1773 -0
- package/examples/browser-2/src/components/MediaView.vue +1048 -0
- package/examples/browser-2/src/components/MessagingView.vue +775 -0
- package/examples/browser-2/src/components/NetworkView.vue +930 -0
- package/examples/browser-2/src/components/StorageView.vue +1376 -0
- package/examples/browser-2/src/main.js +5 -0
- package/examples/browser-2/src/stores/peerpigeon.js +895 -0
- package/examples/browser-2/vite.config.js +6 -0
- package/examples/hub-example.js +189 -0
- package/examples/multi-hub-test.js +186 -0
- package/examples/node/README.md +2 -2
- package/examples/programmatic-namespace-example.js +108 -0
- package/examples/selective-streaming-demo.html +698 -0
- package/examples/standard-events-demo.js +126 -0
- package/index.js +7 -1
- package/package.json +34 -16
- package/server/index.js +1058 -98
- package/server/start.js +52 -0
- package/src/ConnectionManager.js +239 -225
- package/src/CryptoManager.js +147 -18
- package/src/DebugLogger.js +0 -7
- package/src/DistributedStorageManager.js +224 -205
- package/src/EnvironmentDetector.js +88 -4
- package/src/EventEmitter.js +79 -1
- package/src/EvictionManager.js +10 -9
- package/src/GossipManager.js +163 -11
- package/src/MediaManager.js +12 -2
- package/src/PeerConnection.js +343 -311
- package/src/PeerPigeonMesh.js +576 -135
- package/src/PigeonRTC-browser.js +247 -0
- package/src/SignalingClient.js +14 -243
- package/src/SignalingHandler.js +31 -10
- package/src/StorageManager.js +0 -39
- package/src/WebDHT-Simple.js +389 -0
- package/src/WebDHT.js +363 -1165
- package/src/browser-entry.js +58 -0
- package/examples/browser/assets/images/favicon.png +0 -0
- package/examples/browser/assets/images/pigeon.png +0 -0
- package/examples/browser/crypto-test.html +0 -427
- package/examples/browser/ui-old.js +0 -1926
- package/examples/browser/ui.js +0 -3391
- package/websocket-server/README.md +0 -247
- package/websocket-server/server.js +0 -391
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="messaging-view">
|
|
3
|
+
<div class="section-header">
|
|
4
|
+
<h2>💬 Messaging System</h2>
|
|
5
|
+
<p>Send broadcast messages via gossip protocol and direct peer-to-peer messages</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="messaging-layout">
|
|
9
|
+
<!-- Broadcast Messages Section -->
|
|
10
|
+
<div class="broadcast-section">
|
|
11
|
+
<h3>🌐 Broadcast Messages (Gossip Protocol)</h3>
|
|
12
|
+
<p class="section-description">
|
|
13
|
+
Messages sent via gossip protocol reach all peers in the network, not just direct connections.
|
|
14
|
+
They propagate with TTL (Time To Live) and path tracking to prevent loops.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<div class="message-composer">
|
|
18
|
+
<div class="composer-header">
|
|
19
|
+
<span class="composer-icon">📢</span>
|
|
20
|
+
<span>Broadcast to all peers</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="composer-controls">
|
|
23
|
+
<textarea
|
|
24
|
+
v-model="broadcastMessage"
|
|
25
|
+
placeholder="Type your message to broadcast to all peers..."
|
|
26
|
+
class="message-input"
|
|
27
|
+
rows="3"
|
|
28
|
+
@keydown.ctrl.enter="sendBroadcast"
|
|
29
|
+
></textarea>
|
|
30
|
+
<div class="composer-actions">
|
|
31
|
+
<button
|
|
32
|
+
@click="sendBroadcast"
|
|
33
|
+
:disabled="!broadcastMessage.trim() || !isConnected"
|
|
34
|
+
class="btn btn-primary"
|
|
35
|
+
>
|
|
36
|
+
<span class="btn-icon">📤</span>
|
|
37
|
+
Send Broadcast
|
|
38
|
+
</button>
|
|
39
|
+
<span class="shortcut-hint">Ctrl+Enter</span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="messages-container">
|
|
45
|
+
<div class="messages-header">
|
|
46
|
+
<h4>Recent Broadcasts ({{ messages.length }})</h4>
|
|
47
|
+
<button @click="clearBroadcastMessages" class="btn btn-secondary btn-sm">
|
|
48
|
+
Clear
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="messages-list">
|
|
53
|
+
<div v-if="messages.length === 0" class="empty-state">
|
|
54
|
+
<div class="empty-icon">📭</div>
|
|
55
|
+
<p>No broadcast messages yet</p>
|
|
56
|
+
<p class="empty-meta">Send a message or wait for messages from other peers</p>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div
|
|
60
|
+
v-for="message in reversedMessages"
|
|
61
|
+
:key="message.id"
|
|
62
|
+
:class="['message-item', { 'own-message': message.fromPeerId === 'You' }]"
|
|
63
|
+
>
|
|
64
|
+
<div class="message-header">
|
|
65
|
+
<span class="message-sender">{{ message.fromPeerId }}</span>
|
|
66
|
+
<span class="message-time">{{ formatTime(message.timestamp) }}</span>
|
|
67
|
+
<span class="message-type">{{ message.type }}</span>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="message-content">
|
|
70
|
+
<pre>{{ formatMessageContent(message.content) }}</pre>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<!-- Direct Messages Section -->
|
|
78
|
+
<div class="direct-section">
|
|
79
|
+
<h3>💌 Direct Messages</h3>
|
|
80
|
+
<p class="section-description">
|
|
81
|
+
Send messages directly to specific peers. Messages are routed through the mesh network.
|
|
82
|
+
</p>
|
|
83
|
+
|
|
84
|
+
<!-- Peer Selection -->
|
|
85
|
+
<div class="peer-selector">
|
|
86
|
+
<label>Select target peer:</label>
|
|
87
|
+
<select v-model="selectedPeer" class="peer-select">
|
|
88
|
+
<option value="">Choose a peer...</option>
|
|
89
|
+
<option
|
|
90
|
+
v-for="peer in connectedPeersList"
|
|
91
|
+
:key="peer.id"
|
|
92
|
+
:value="peer.id"
|
|
93
|
+
>
|
|
94
|
+
{{ peer.id.substring(0, 16) }}... ({{ peer.status }})
|
|
95
|
+
</option>
|
|
96
|
+
</select>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="message-composer" v-if="selectedPeer">
|
|
100
|
+
<div class="composer-header">
|
|
101
|
+
<span class="composer-icon">💌</span>
|
|
102
|
+
<span>Direct message to {{ selectedPeer.substring(0, 16) }}...</span>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="composer-controls">
|
|
105
|
+
<textarea
|
|
106
|
+
v-model="directMessage"
|
|
107
|
+
placeholder="Type your direct message..."
|
|
108
|
+
class="message-input"
|
|
109
|
+
rows="3"
|
|
110
|
+
@keydown.ctrl.enter="sendDirect"
|
|
111
|
+
></textarea>
|
|
112
|
+
<div class="composer-actions">
|
|
113
|
+
<button
|
|
114
|
+
@click="sendDirect"
|
|
115
|
+
:disabled="!directMessage.trim() || !selectedPeer || !isConnected"
|
|
116
|
+
class="btn btn-primary"
|
|
117
|
+
>
|
|
118
|
+
<span class="btn-icon">📤</span>
|
|
119
|
+
Send Direct
|
|
120
|
+
</button>
|
|
121
|
+
<span class="shortcut-hint">Ctrl+Enter</span>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<!-- Direct Message Conversations -->
|
|
127
|
+
<div class="conversations">
|
|
128
|
+
<div class="conversations-header">
|
|
129
|
+
<h4>Conversations</h4>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div v-if="directMessagesList.length === 0" class="empty-state">
|
|
133
|
+
<div class="empty-icon">💬</div>
|
|
134
|
+
<p>No direct messages yet</p>
|
|
135
|
+
<p class="empty-meta">Select a peer and send a direct message</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div
|
|
139
|
+
v-for="conversation in directMessagesList"
|
|
140
|
+
:key="conversation.peerId"
|
|
141
|
+
class="conversation"
|
|
142
|
+
>
|
|
143
|
+
<div class="conversation-header">
|
|
144
|
+
<h5>{{ conversation.peerId.substring(0, 16) }}...</h5>
|
|
145
|
+
<span class="message-count">({{ conversation.messages.length }})</span>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="conversation-messages">
|
|
149
|
+
<div
|
|
150
|
+
v-for="message in conversation.messages.slice(-5)"
|
|
151
|
+
:key="message.id"
|
|
152
|
+
:class="['message-item', 'direct', { 'own-message': message.fromPeerId === 'You' }]"
|
|
153
|
+
>
|
|
154
|
+
<div class="message-header">
|
|
155
|
+
<span class="message-sender">{{ message.fromPeerId }}</span>
|
|
156
|
+
<span class="message-time">{{ formatTime(message.timestamp) }}</span>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="message-content">
|
|
159
|
+
<pre>{{ formatMessageContent(message.content) }}</pre>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div v-if="conversation.messages.length > 5" class="more-messages">
|
|
164
|
+
+ {{ conversation.messages.length - 5 }} more messages
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<!-- Message Statistics -->
|
|
173
|
+
<div class="stats-section">
|
|
174
|
+
<h3>📊 Messaging Statistics</h3>
|
|
175
|
+
<div class="stats-grid">
|
|
176
|
+
<div class="stat-item">
|
|
177
|
+
<strong>Total Broadcasts:</strong>
|
|
178
|
+
<span>{{ broadcastCount }}</span>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="stat-item">
|
|
181
|
+
<strong>Total Direct Messages:</strong>
|
|
182
|
+
<span>{{ directMessageCount }}</span>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="stat-item">
|
|
185
|
+
<strong>Active Conversations:</strong>
|
|
186
|
+
<span>{{ directMessagesList.length }}</span>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="stat-item">
|
|
189
|
+
<strong>Messages Sent:</strong>
|
|
190
|
+
<span>{{ sentMessageCount }}</span>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<!-- Advanced Messaging Features -->
|
|
196
|
+
<div class="advanced-section">
|
|
197
|
+
<h3>🔧 Advanced Messaging</h3>
|
|
198
|
+
|
|
199
|
+
<div class="advanced-controls">
|
|
200
|
+
<button @click="sendPingAll" class="btn btn-secondary">
|
|
201
|
+
<span class="btn-icon">🏓</span>
|
|
202
|
+
Ping All Peers
|
|
203
|
+
</button>
|
|
204
|
+
|
|
205
|
+
<button @click="sendSystemInfo" class="btn btn-secondary">
|
|
206
|
+
<span class="btn-icon">ℹ️</span>
|
|
207
|
+
Broadcast System Info
|
|
208
|
+
</button>
|
|
209
|
+
|
|
210
|
+
<button @click="testMessageTypes" class="btn btn-secondary">
|
|
211
|
+
<span class="btn-icon">🧪</span>
|
|
212
|
+
Test Message Types
|
|
213
|
+
</button>
|
|
214
|
+
|
|
215
|
+
<button @click="enableMessageFiltering" class="btn btn-secondary">
|
|
216
|
+
<span class="btn-icon">🔍</span>
|
|
217
|
+
Toggle Message Filtering
|
|
218
|
+
</button>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
|
|
224
|
+
<script setup>
|
|
225
|
+
import { ref, computed, nextTick } from 'vue';
|
|
226
|
+
import { usePeerPigeonStore } from '../stores/peerpigeon.js';
|
|
227
|
+
|
|
228
|
+
const store = usePeerPigeonStore();
|
|
229
|
+
|
|
230
|
+
// Local reactive state
|
|
231
|
+
const broadcastMessage = ref('');
|
|
232
|
+
const directMessage = ref('');
|
|
233
|
+
const selectedPeer = ref('');
|
|
234
|
+
const messageFilter = ref('');
|
|
235
|
+
const filteringEnabled = ref(false);
|
|
236
|
+
|
|
237
|
+
// Computed properties
|
|
238
|
+
const messages = computed(() => store.messages);
|
|
239
|
+
const directMessages = computed(() => store.directMessages);
|
|
240
|
+
const connectedPeersList = computed(() => store.connectedPeersList);
|
|
241
|
+
const isConnected = computed(() => store.isConnected);
|
|
242
|
+
|
|
243
|
+
const reversedMessages = computed(() => {
|
|
244
|
+
return [...messages.value].reverse();
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const directMessagesList = computed(() => {
|
|
248
|
+
const conversations = [];
|
|
249
|
+
for (const [peerId, msgs] of directMessages.value) {
|
|
250
|
+
conversations.push({
|
|
251
|
+
peerId,
|
|
252
|
+
messages: msgs,
|
|
253
|
+
lastMessage: msgs[msgs.length - 1]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return conversations.sort((a, b) =>
|
|
257
|
+
new Date(b.lastMessage.timestamp) - new Date(a.lastMessage.timestamp)
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const broadcastCount = computed(() => {
|
|
262
|
+
return messages.value.filter(msg => msg.type === 'broadcast').length;
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const directMessageCount = computed(() => {
|
|
266
|
+
let count = 0;
|
|
267
|
+
for (const msgs of directMessages.value.values()) {
|
|
268
|
+
count += msgs.length;
|
|
269
|
+
}
|
|
270
|
+
return count;
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const sentMessageCount = computed(() => {
|
|
274
|
+
const broadcastSent = messages.value.filter(msg => msg.fromPeerId === 'You').length;
|
|
275
|
+
let directSent = 0;
|
|
276
|
+
for (const msgs of directMessages.value.values()) {
|
|
277
|
+
directSent += msgs.filter(msg => msg.fromPeerId === 'You').length;
|
|
278
|
+
}
|
|
279
|
+
return broadcastSent + directSent;
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// Methods
|
|
283
|
+
const sendBroadcast = () => {
|
|
284
|
+
if (!broadcastMessage.value.trim() || !isConnected.value) return;
|
|
285
|
+
|
|
286
|
+
try {
|
|
287
|
+
store.sendBroadcastMessage(broadcastMessage.value.trim());
|
|
288
|
+
broadcastMessage.value = '';
|
|
289
|
+
store.addDebugLog('Broadcast message sent successfully', 'success');
|
|
290
|
+
} catch (error) {
|
|
291
|
+
store.addDebugLog(`Failed to send broadcast: ${error.message}`, 'error');
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const sendDirect = () => {
|
|
296
|
+
if (!directMessage.value.trim() || !selectedPeer.value || !isConnected.value) return;
|
|
297
|
+
|
|
298
|
+
try {
|
|
299
|
+
store.sendDirectMessage(selectedPeer.value, directMessage.value.trim());
|
|
300
|
+
directMessage.value = '';
|
|
301
|
+
store.addDebugLog(`Direct message sent to ${selectedPeer.value.substring(0, 8)}...`, 'success');
|
|
302
|
+
} catch (error) {
|
|
303
|
+
store.addDebugLog(`Failed to send direct message: ${error.message}`, 'error');
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const clearBroadcastMessages = () => {
|
|
308
|
+
store.messages = [];
|
|
309
|
+
store.addDebugLog('Broadcast messages cleared', 'info');
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const formatTime = (timestamp) => {
|
|
313
|
+
return new Date(timestamp).toLocaleTimeString();
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const formatMessageContent = (content) => {
|
|
317
|
+
if (typeof content === 'string') {
|
|
318
|
+
return content;
|
|
319
|
+
}
|
|
320
|
+
return JSON.stringify(content, null, 2);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const sendPingAll = () => {
|
|
324
|
+
const pingMessage = {
|
|
325
|
+
type: 'ping',
|
|
326
|
+
timestamp: Date.now(),
|
|
327
|
+
source: 'vue-demo'
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
store.sendBroadcastMessage(pingMessage);
|
|
331
|
+
store.addDebugLog('Ping sent to all peers', 'info');
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const sendSystemInfo = () => {
|
|
335
|
+
const systemInfo = {
|
|
336
|
+
type: 'system_info',
|
|
337
|
+
timestamp: Date.now(),
|
|
338
|
+
userAgent: navigator.userAgent,
|
|
339
|
+
platform: navigator.platform,
|
|
340
|
+
language: navigator.language,
|
|
341
|
+
online: navigator.onLine,
|
|
342
|
+
connectionType: navigator.connection?.effectiveType || 'unknown',
|
|
343
|
+
peerId: store.peerId.substring(0, 8) + '...',
|
|
344
|
+
connectedPeers: store.networkStatus.connectedCount
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
store.sendBroadcastMessage(systemInfo);
|
|
348
|
+
store.addDebugLog('System info broadcast sent', 'info');
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
const testMessageTypes = () => {
|
|
352
|
+
const testMessages = [
|
|
353
|
+
{ type: 'text', content: 'Simple text message' },
|
|
354
|
+
{ type: 'json', data: { key: 'value', number: 42, array: [1, 2, 3] } },
|
|
355
|
+
{ type: 'binary_info', size: 1024, encoding: 'base64' },
|
|
356
|
+
{ type: 'event', event: 'user_action', action: 'click', target: 'button' }
|
|
357
|
+
];
|
|
358
|
+
|
|
359
|
+
testMessages.forEach((msg, index) => {
|
|
360
|
+
setTimeout(() => {
|
|
361
|
+
store.sendBroadcastMessage(msg);
|
|
362
|
+
}, index * 500);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
store.addDebugLog('Test messages sent', 'info');
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const enableMessageFiltering = () => {
|
|
369
|
+
filteringEnabled.value = !filteringEnabled.value;
|
|
370
|
+
store.addDebugLog(`Message filtering ${filteringEnabled.value ? 'enabled' : 'disabled'}`, 'info');
|
|
371
|
+
};
|
|
372
|
+
</script>
|
|
373
|
+
|
|
374
|
+
<style scoped>
|
|
375
|
+
.messaging-view {
|
|
376
|
+
max-width: 1200px;
|
|
377
|
+
margin: 0 auto;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.section-header {
|
|
381
|
+
text-align: center;
|
|
382
|
+
margin-bottom: 30px;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.section-header h2 {
|
|
386
|
+
font-size: 28px;
|
|
387
|
+
color: #333;
|
|
388
|
+
margin-bottom: 8px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.section-header p {
|
|
392
|
+
color: #666;
|
|
393
|
+
font-size: 16px;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.messaging-layout {
|
|
397
|
+
display: grid;
|
|
398
|
+
grid-template-columns: 1fr 1fr;
|
|
399
|
+
gap: 30px;
|
|
400
|
+
margin-bottom: 30px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.broadcast-section,
|
|
404
|
+
.direct-section {
|
|
405
|
+
background: white;
|
|
406
|
+
border-radius: 12px;
|
|
407
|
+
padding: 24px;
|
|
408
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.broadcast-section h3,
|
|
412
|
+
.direct-section h3 {
|
|
413
|
+
margin: 0 0 8px 0;
|
|
414
|
+
color: #333;
|
|
415
|
+
font-size: 20px;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.section-description {
|
|
419
|
+
color: #666;
|
|
420
|
+
font-size: 14px;
|
|
421
|
+
margin-bottom: 20px;
|
|
422
|
+
line-height: 1.5;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.message-composer {
|
|
426
|
+
background: #f8f9fa;
|
|
427
|
+
border-radius: 8px;
|
|
428
|
+
padding: 16px;
|
|
429
|
+
margin-bottom: 24px;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.composer-header {
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: center;
|
|
435
|
+
gap: 8px;
|
|
436
|
+
margin-bottom: 12px;
|
|
437
|
+
font-weight: 500;
|
|
438
|
+
color: #333;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.composer-icon {
|
|
442
|
+
font-size: 16px;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.composer-controls {
|
|
446
|
+
display: flex;
|
|
447
|
+
flex-direction: column;
|
|
448
|
+
gap: 12px;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.message-input {
|
|
452
|
+
width: 100%;
|
|
453
|
+
padding: 12px;
|
|
454
|
+
border: 1px solid #ddd;
|
|
455
|
+
border-radius: 6px;
|
|
456
|
+
font-family: inherit;
|
|
457
|
+
font-size: 14px;
|
|
458
|
+
resize: vertical;
|
|
459
|
+
min-height: 80px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.message-input:focus {
|
|
463
|
+
outline: none;
|
|
464
|
+
border-color: #3b82f6;
|
|
465
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.composer-actions {
|
|
469
|
+
display: flex;
|
|
470
|
+
justify-content: space-between;
|
|
471
|
+
align-items: center;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.btn {
|
|
475
|
+
padding: 8px 16px;
|
|
476
|
+
border: none;
|
|
477
|
+
border-radius: 6px;
|
|
478
|
+
font-size: 14px;
|
|
479
|
+
font-weight: 500;
|
|
480
|
+
cursor: pointer;
|
|
481
|
+
transition: all 0.2s;
|
|
482
|
+
display: flex;
|
|
483
|
+
align-items: center;
|
|
484
|
+
gap: 6px;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.btn:disabled {
|
|
488
|
+
opacity: 0.6;
|
|
489
|
+
cursor: not-allowed;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.btn-primary {
|
|
493
|
+
background: #3b82f6;
|
|
494
|
+
color: white;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.btn-primary:hover:not(:disabled) {
|
|
498
|
+
background: #2563eb;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.btn-secondary {
|
|
502
|
+
background: #6b7280;
|
|
503
|
+
color: white;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.btn-secondary:hover:not(:disabled) {
|
|
507
|
+
background: #4b5563;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.btn-sm {
|
|
511
|
+
padding: 4px 8px;
|
|
512
|
+
font-size: 12px;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.btn-icon {
|
|
516
|
+
font-size: 14px;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.shortcut-hint {
|
|
520
|
+
font-size: 12px;
|
|
521
|
+
color: #999;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.messages-container {
|
|
525
|
+
border: 1px solid #eee;
|
|
526
|
+
border-radius: 8px;
|
|
527
|
+
overflow: hidden;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.messages-header {
|
|
531
|
+
display: flex;
|
|
532
|
+
justify-content: space-between;
|
|
533
|
+
align-items: center;
|
|
534
|
+
padding: 12px 16px;
|
|
535
|
+
background: #f8f9fa;
|
|
536
|
+
border-bottom: 1px solid #eee;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.messages-header h4 {
|
|
540
|
+
margin: 0;
|
|
541
|
+
font-size: 14px;
|
|
542
|
+
color: #333;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.messages-list {
|
|
546
|
+
max-height: 400px;
|
|
547
|
+
overflow-y: auto;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.empty-state {
|
|
551
|
+
text-align: center;
|
|
552
|
+
padding: 40px 20px;
|
|
553
|
+
color: #666;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.empty-icon {
|
|
557
|
+
font-size: 32px;
|
|
558
|
+
margin-bottom: 12px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.empty-meta {
|
|
562
|
+
font-size: 12px;
|
|
563
|
+
color: #999;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.message-item {
|
|
567
|
+
padding: 12px 16px;
|
|
568
|
+
border-bottom: 1px solid #f0f0f0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.message-item:last-child {
|
|
572
|
+
border-bottom: none;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.message-item.own-message {
|
|
576
|
+
background: rgba(59, 130, 246, 0.05);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.message-item.direct {
|
|
580
|
+
background: rgba(16, 185, 129, 0.05);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.message-item.direct.own-message {
|
|
584
|
+
background: rgba(59, 130, 246, 0.1);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.message-header {
|
|
588
|
+
display: flex;
|
|
589
|
+
justify-content: space-between;
|
|
590
|
+
align-items: center;
|
|
591
|
+
margin-bottom: 6px;
|
|
592
|
+
font-size: 12px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.message-sender {
|
|
596
|
+
font-weight: 500;
|
|
597
|
+
color: #333;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.message-time {
|
|
601
|
+
color: #999;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.message-type {
|
|
605
|
+
background: #e5e7eb;
|
|
606
|
+
color: #374151;
|
|
607
|
+
padding: 2px 6px;
|
|
608
|
+
border-radius: 3px;
|
|
609
|
+
font-size: 10px;
|
|
610
|
+
text-transform: uppercase;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.message-content {
|
|
614
|
+
color: #333;
|
|
615
|
+
line-height: 1.4;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.message-content pre {
|
|
619
|
+
margin: 0;
|
|
620
|
+
white-space: pre-wrap;
|
|
621
|
+
word-break: break-word;
|
|
622
|
+
font-family: inherit;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.peer-selector {
|
|
626
|
+
margin-bottom: 20px;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.peer-selector label {
|
|
630
|
+
display: block;
|
|
631
|
+
margin-bottom: 6px;
|
|
632
|
+
font-weight: 500;
|
|
633
|
+
color: #333;
|
|
634
|
+
font-size: 14px;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.peer-select {
|
|
638
|
+
width: 100%;
|
|
639
|
+
padding: 8px 12px;
|
|
640
|
+
border: 1px solid #ddd;
|
|
641
|
+
border-radius: 6px;
|
|
642
|
+
font-size: 14px;
|
|
643
|
+
background: white;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.conversations {
|
|
647
|
+
border: 1px solid #eee;
|
|
648
|
+
border-radius: 8px;
|
|
649
|
+
overflow: hidden;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.conversations-header {
|
|
653
|
+
padding: 12px 16px;
|
|
654
|
+
background: #f8f9fa;
|
|
655
|
+
border-bottom: 1px solid #eee;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.conversations-header h4 {
|
|
659
|
+
margin: 0;
|
|
660
|
+
font-size: 14px;
|
|
661
|
+
color: #333;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.conversation {
|
|
665
|
+
border-bottom: 1px solid #eee;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.conversation:last-child {
|
|
669
|
+
border-bottom: none;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.conversation-header {
|
|
673
|
+
display: flex;
|
|
674
|
+
justify-content: space-between;
|
|
675
|
+
align-items: center;
|
|
676
|
+
padding: 12px 16px;
|
|
677
|
+
background: #fafafa;
|
|
678
|
+
border-bottom: 1px solid #f0f0f0;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.conversation-header h5 {
|
|
682
|
+
margin: 0;
|
|
683
|
+
font-size: 13px;
|
|
684
|
+
color: #333;
|
|
685
|
+
font-family: monospace;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.message-count {
|
|
689
|
+
font-size: 11px;
|
|
690
|
+
color: #999;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.conversation-messages {
|
|
694
|
+
background: white;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.more-messages {
|
|
698
|
+
padding: 8px 16px;
|
|
699
|
+
font-size: 11px;
|
|
700
|
+
color: #999;
|
|
701
|
+
text-align: center;
|
|
702
|
+
background: #f8f9fa;
|
|
703
|
+
border-top: 1px solid #f0f0f0;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.stats-section {
|
|
707
|
+
background: white;
|
|
708
|
+
border-radius: 12px;
|
|
709
|
+
padding: 24px;
|
|
710
|
+
margin-bottom: 30px;
|
|
711
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.stats-section h3 {
|
|
715
|
+
margin: 0 0 20px 0;
|
|
716
|
+
color: #333;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.stats-grid {
|
|
720
|
+
display: grid;
|
|
721
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
722
|
+
gap: 16px;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.stat-item {
|
|
726
|
+
display: flex;
|
|
727
|
+
justify-content: space-between;
|
|
728
|
+
align-items: center;
|
|
729
|
+
padding: 12px 0;
|
|
730
|
+
border-bottom: 1px solid #eee;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.stat-item:last-child {
|
|
734
|
+
border-bottom: none;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.advanced-section {
|
|
738
|
+
background: white;
|
|
739
|
+
border-radius: 12px;
|
|
740
|
+
padding: 24px;
|
|
741
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.advanced-section h3 {
|
|
745
|
+
margin: 0 0 20px 0;
|
|
746
|
+
color: #333;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.advanced-controls {
|
|
750
|
+
display: flex;
|
|
751
|
+
flex-wrap: wrap;
|
|
752
|
+
gap: 12px;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/* Responsive design */
|
|
756
|
+
@media (max-width: 768px) {
|
|
757
|
+
.messaging-layout {
|
|
758
|
+
grid-template-columns: 1fr;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.advanced-controls {
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.composer-actions {
|
|
766
|
+
flex-direction: column;
|
|
767
|
+
align-items: stretch;
|
|
768
|
+
gap: 8px;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.shortcut-hint {
|
|
772
|
+
text-align: center;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
</style>
|