@crvouga/mockingbird-notifications 0.1.0 → 0.2.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/README.md +96 -17
- package/dist/{chunk-QE3TRUI6.js → chunk-3HF2NSFV.js} +280 -10
- package/dist/chunk-3HF2NSFV.js.map +7 -0
- package/dist/chunk-4QVURMVP.js +400 -0
- package/dist/chunk-4QVURMVP.js.map +7 -0
- package/dist/{chunk-LM7R7AR7.js → chunk-FBJ2DRHH.js} +58 -6
- package/dist/chunk-FBJ2DRHH.js.map +7 -0
- package/dist/chunk-GHIEYY5B.js +1177 -0
- package/dist/chunk-GHIEYY5B.js.map +7 -0
- package/dist/cli.js +12 -4
- package/dist/cli.js.map +2 -2
- package/dist/index.d.ts +130 -11
- package/dist/index.js +9 -6
- package/dist/index.js.map +2 -2
- package/dist/server.d.ts +91 -6
- package/dist/server.js +7 -3
- package/dist/ui.d.ts +383 -229
- package/dist/ui.js +808 -133
- package/dist/ui.js.map +4 -4
- package/package.json +14 -10
- package/dist/chunk-GRGR3QZM.js +0 -1066
- package/dist/chunk-GRGR3QZM.js.map +0 -7
- package/dist/chunk-JQ6KPT2C.js +0 -202
- package/dist/chunk-JQ6KPT2C.js.map +0 -7
- package/dist/chunk-LM7R7AR7.js.map +0 -7
- package/dist/chunk-QE3TRUI6.js.map +0 -7
package/README.md
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
> Local emulators. Real API contracts. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
|
|
4
4
|
|
|
5
5
|
A notification test harness for a Mockingbird fleet. It reads the same emulators your application
|
|
6
|
-
sends through and shows every SMS, email and
|
|
7
|
-
Messages app, a phone lock screen (iOS) or notification shade
|
|
6
|
+
sends through and shows every SMS, WhatsApp message, email, push and chat message the way the
|
|
7
|
+
recipient would see it: a phone's Messages app, a phone lock screen (iOS) or notification shade
|
|
8
|
+
(Android), a webmail inbox, and a team chat window.
|
|
8
9
|
Automated tests get the same data from a JSON API and a small client.
|
|
9
10
|
|
|
10
11
|
| Channel | Emulators read | Shown as |
|
|
11
12
|
| --- | --- | --- |
|
|
12
13
|
| SMS | Twilio (Messages and Verify codes), Amazon SNS (direct `PhoneNumber` and `sms` topic subscribers), Customer.io, Mailosaur | Messages app: threads per sender, bubbles, one-time code suggestion |
|
|
14
|
+
| WhatsApp | Twilio (Messages to a `whatsapp:` address, and Verify with `Channel=whatsapp`) | The same phone, as a WhatsApp chat. The channel is `sms` with `sms.via: "whatsapp"`; `to` is the bare number |
|
|
13
15
|
| Email | Resend, Amazon SES (`SendEmail` and MIME `SendRawEmail`), Amazon SNS (`email` / `email-json` subscribers), Customer.io, Mailosaur, Twilio Verify email | Webmail: inbox per recipient (to, cc, bcc), rendered HTML, attachments, headers |
|
|
14
16
|
| Push | Firebase Cloud Messaging | iOS lock screen or Android shade, chosen from the device token's platform; title, body, image, data, badge, sound |
|
|
17
|
+
| Chat | Slack (`chat.postMessage`, `chat.postEphemeral` and incoming webhooks) | Team chat window: a channel list, bot messages with mrkdwn, Block Kit blocks, attachments and reactions |
|
|
15
18
|
|
|
16
19
|
The [Notifications guide](https://mockingbird.chrisvouga.dev/docs/notifications) on the docs site
|
|
17
20
|
splits this README into pages, and the
|
|
@@ -32,11 +35,19 @@ application uses.
|
|
|
32
35
|
|
|
33
36
|
## Run it against your fleet
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
The recommended way: one flag on the fleet starts the harness with it, on a page that also has
|
|
39
|
+
every emulator's admin UI (`@crvouga/mockingbird-fleet` brings this package with it, so a project
|
|
40
|
+
that runs a fleet installs nothing more):
|
|
36
41
|
|
|
37
42
|
```sh
|
|
38
|
-
mockingbird-fleet serve --config mockingbird.json --
|
|
39
|
-
|
|
43
|
+
mockingbird-fleet serve --config mockingbird.json --dashboard # dashboard: http://127.0.0.1:8790
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or run it on its own: start the fleet as usual, then point the harness at the fleet controller or its ready file:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
mockingbird-fleet serve --config mockingbird.json --ready-file ready.json
|
|
50
|
+
mockingbird-notifications serve --manifest ready.json # http://127.0.0.1:8790
|
|
40
51
|
# or, with the controller URL from the ready file:
|
|
41
52
|
mockingbird-notifications serve --fleet http://127.0.0.1:9000/__admin/fleet
|
|
42
53
|
```
|
|
@@ -60,21 +71,39 @@ mockingbird-notifications serve --service twilio=http://127.0.0.1:8798 --service
|
|
|
60
71
|
| `--namespace <name>` | Watch this namespace in the background (repeatable). Default `default`, or every fleet namespace with `--fleet`. Any namespace the UI or an API call asks for is watched from then on. |
|
|
61
72
|
| `--poll <ms>` | Background poll interval, default 750. `0` reads only when asked. |
|
|
62
73
|
| `--admin-key-env <VAR>` | Environment variable with the admin key (default `MOCKINGBIRD_ADMIN_KEY`), sent as `x-mockingbird-admin-key`. |
|
|
74
|
+
| `--tab <name>` | The tab the page opens on: `notifications` (default) or `emulators`. |
|
|
75
|
+
| `--no-emulators` | Serve the notifications UI alone, without the Emulators tab. |
|
|
63
76
|
| `--ready-json` | Print `{"url": …}` once listening. |
|
|
64
77
|
|
|
78
|
+
### The dashboard
|
|
79
|
+
|
|
80
|
+
The page has two tabs. **Emulators** is the admin UI of every HTTP emulator the harness knows,
|
|
81
|
+
messaging or not (Stripe, Cognito, …). **Notifications** is the devices, and its tab counts what
|
|
82
|
+
arrives while you are on the other one. `?tab=emulators` and `?tab=notifications` open a tab; every
|
|
83
|
+
notifications link (`?view=sms&to=…`) still opens the devices.
|
|
84
|
+
|
|
85
|
+
The harness fronts each emulator's admin API on its own port under `/admin/apis/<name>/`, so the
|
|
86
|
+
browser reaches only the harness, and it adds its admin key (`adminKey`, or `adminKeys` by emulator
|
|
87
|
+
name) to requests that carry none. Anyone who can open the page can therefore change emulator
|
|
88
|
+
state: it listens on `127.0.0.1` unless you pass `--host`. `GET /api/admin` lists what the page
|
|
89
|
+
mounts. From code, `createServer` turns this on (`admin: false` turns it off, `defaultTab` picks
|
|
90
|
+
the tab); a harness you serve yourself takes `admin: adminGateway()` from `./server`.
|
|
91
|
+
|
|
65
92
|
## The UI
|
|
66
93
|
|
|
67
|
-
`/` shows
|
|
68
|
-
mailbox) that follows the newest arrival unless **Follow new** is off. The **Timeline** tab lists
|
|
94
|
+
`/` shows four devices side by side. Each has a recipient picker (phone number, push token,
|
|
95
|
+
mailbox, chat channel) that follows the newest arrival unless **Follow new** is off. The **Timeline** tab lists
|
|
69
96
|
everything in one table; double-click any message, or click a timeline row, to inspect the
|
|
70
97
|
normalized record and the emulator's raw one. Read state is kept per browser.
|
|
71
98
|
|
|
99
|
+
The **channel tabs** under the top bar (`All | Text | Push | Email | Chat`) pick one device or all of them. A tab whose device is not on screen counts what arrived there. When the harness has less than 800px to itself (a phone, a side panel, a narrow embed) there is no room for two devices, so it shows one at a time and the tabs switch between them; this follows the width of the element the UI is mounted on, not the window. Every device has the same header above it, so the frames always line up along the top.
|
|
100
|
+
|
|
72
101
|
Links open one device for a screenshot, for example in a Playwright test:
|
|
73
102
|
|
|
74
103
|
| Query | Effect |
|
|
75
104
|
| --- | --- |
|
|
76
105
|
| `?namespace=worker-3` | Show that namespace. |
|
|
77
|
-
| `?view=sms\|push\|email&to=<recipient>` | Show only that device, opened on that recipient (an SMS link opens the newest thread). |
|
|
106
|
+
| `?view=sms\|push\|email\|chat&to=<recipient>` | Show only that device, opened on that recipient (an SMS link opens the newest thread; a chat recipient is a channel such as `#alerts`). Without `to`, it selects that channel's tab. |
|
|
78
107
|
| `?id=<notification id>` | Open that notification on its device. |
|
|
79
108
|
| `?view=timeline` | Open the timeline. |
|
|
80
109
|
| `?follow=0` | Do not jump to new arrivals. |
|
|
@@ -88,6 +117,10 @@ The devices behave like the real apps, in a generic style with no vendor marks:
|
|
|
88
117
|
Options and Clear, and long-press it for a preview.
|
|
89
118
|
- **Notification shade (Android):** tap a card to expand it, swipe it either way to dismiss it,
|
|
90
119
|
long-press it for its settings, and use Clear all.
|
|
120
|
+
- **WhatsApp:** a message sent to a `whatsapp:` address is its own thread, labelled WhatsApp, and
|
|
121
|
+
opens as a WhatsApp chat on the same phone.
|
|
122
|
+
- **Chat:** channels on the left, and each message with its bot name, time, mrkdwn text, Block Kit
|
|
123
|
+
blocks, attachments and reactions.
|
|
91
124
|
- **Mail:** hover a row for Archive, Delete and Mark as read, then Undo from the toast. Star rows,
|
|
92
125
|
and open a message to read its HTML.
|
|
93
126
|
|
|
@@ -147,17 +180,21 @@ test("the sign-in code is offered above the keyboard", async ({ page }) => {
|
|
|
147
180
|
```
|
|
148
181
|
|
|
149
182
|
`selectors` builds the common CSS selectors: `ready()`, `testId(id)`, `notification(id)`,
|
|
150
|
-
`smsBubble({from, id})`, `smsThread(from)`, `pushNotification(id)`, `emailRow(id)
|
|
151
|
-
`timelineRow(id)`.
|
|
183
|
+
`smsBubble({from, id})`, `smsThread(from)`, `pushNotification(id)`, `emailRow(id)`,
|
|
184
|
+
`chatMessage(id)`, `chatChannel(to)`, `channelTab(value)` and `timelineRow(id)`.
|
|
152
185
|
|
|
153
186
|
| Device | Main test ids | State attributes |
|
|
154
187
|
| --- | --- | --- |
|
|
155
188
|
| Top bar | `namespace`, `search`, `view-devices`, `view-timeline`, `follow`, `sound-toggle`, `connection`, `source`, `notice`, `toast`, `toast-undo` | `source`: `data-name`, `data-service`, `data-ok`, `data-count`. `connection`: `data-state`. |
|
|
189
|
+
| Channel tabs | `channel-tabs`, `channel-tab`, `channel-tab-unread` | Root: `data-layout` (`grid` or `tabs`), `data-tab` (`all`, `sms`, `push`, `email`, `chat`). `channel-tab`: `data-value`, `aria-selected`, `data-unread`. |
|
|
156
190
|
| Messages | `sms-device`, `sms-recipient`, `sms-thread` (`-name`, `-preview`, `-time`, `-unread`), `sms-conversation`, `sms-back`, `sms-bubble`, `sms-code`, `sms-menu`, `sms-menu-tapback`, `sms-tapback`, `sms-empty` | `sms-device`: `data-screen` (`threads` or `conversation`), `data-recipient`, `data-thread`. `sms-thread`: `data-pinned`, `data-muted`. |
|
|
157
191
|
| Push | `push-device`, `push-recipient`, `push-skin`, `push-group`, `push-group-more`, `push-notification` (`-title`, `-body`, `-app`, `-time`, `-image`, `-data`, `-meta`), `push-clear`, `push-options`, `push-preview`, `push-settings`, `push-clear-all`, `push-empty` | `push-device`: `data-skin` (`ios` or `android`), `data-platform`. `push-notification`: `data-expanded`, `data-app`, `data-stacked`. |
|
|
158
192
|
| Mail | `email-device`, `email-recipient`, `email-row` (`-from`, `-subject`, `-snippet`, `-date`, `-star`, `-archive`, `-delete`), `email-open`, `email-subject`, `email-from-name`, `email-from-address`, `email-to`, `email-details`, `email-detail`, `email-body`, `email-text`, `email-attachment`, `email-empty` | `email-device`: `data-screen` (`inbox` or `message`). `email-detail`: `data-field`. `email-attachment`: `data-filename`, `data-content-type`, `data-size`. |
|
|
193
|
+
| Chat | `chat-device`, `chat-recipient`, `chat-workspace`, `chat-channel`, `chat-title`, `chat-message` (`-author`, `-time`, `-text`, `-blocks`, `-attachments`, `-reaction`), `chat-unread-count`, `chat-empty` | `chat-device`: `data-recipient`, `data-workspace`. `chat-channel`: `data-to`, `data-unread`, `aria-current`. `chat-message`: `data-method`, `data-ephemeral`, `data-thread`. |
|
|
159
194
|
| Timeline | `timeline`, `timeline-row`, `inspector`, `inspector-json`, `inspector-field`, `inspector-close`, `inspector-show-on-device` | `inspector-json` holds the whole record, `raw` included, as JSON. |
|
|
160
195
|
|
|
196
|
+
A WhatsApp message carries `data-via="whatsapp"` on its thread, bubble and timeline row; `sms-thread-via` is the label in the thread list, and `sms-device` and `sms-conversation` report `data-via` while a WhatsApp chat is open.
|
|
197
|
+
|
|
161
198
|
Controls are real buttons, selects and inputs with accessible names, so `getByRole` works as well.
|
|
162
199
|
New arrivals are drawn live, so a test can keep a page open while the app sends. When several tests
|
|
163
200
|
share a harness, give each one its own namespace (`?namespace=`) or open a deep link to one
|
|
@@ -165,7 +202,7 @@ recipient: a link with `to=` stays on that recipient instead of following new ar
|
|
|
165
202
|
`?follow=0` on any other link that should stay put.
|
|
166
203
|
|
|
167
204
|
[`e2e/ui.e2e.ts`](https://github.com/crvouga/mockingbird/blob/main/packages/notifications/e2e/ui.e2e.ts)
|
|
168
|
-
in this repository is a complete, passing example with real Twilio, Resend and
|
|
205
|
+
in this repository is a complete, passing example with real Twilio, Resend, FCM and Slack emulators.
|
|
169
206
|
|
|
170
207
|
## Embed the UI
|
|
171
208
|
|
|
@@ -189,11 +226,41 @@ ui.destroy()
|
|
|
189
226
|
|
|
190
227
|
Its styles are scoped to the UI's root (`.mb-notifications`) and added once to the document, or to
|
|
191
228
|
the shadow root that holds `panel`. Options: `harness`, or `fetch` and `baseUrl` for a harness on
|
|
192
|
-
another origin; `channels` (which devices to show); `
|
|
229
|
+
another origin; `channels` (which devices to show); `layout` (`auto`, `tabs` or `grid`) and `tabs` (show the
|
|
230
|
+
channel tabs); `chrome` (show the top bar); `scale` (draw the devices smaller, `0.5` to `1`); `sound`; `motion`
|
|
193
231
|
(`auto`, `full` or `reduce`); `onArrive`; and `syncUrl`, which reads and writes `?view=`-style
|
|
194
232
|
links on the page. The [lab ordering example](https://github.com/crvouga/mockingbird/tree/main/packages/examples/medical-testing)
|
|
195
233
|
mounts it as its Notifications tab.
|
|
196
234
|
|
|
235
|
+
`mountDashboard` puts a tab bar over that UI and an emulators panel you draw:
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
import { createNotificationHarness } from "@crvouga/mockingbird-notifications"
|
|
239
|
+
import { mountDashboard } from "@crvouga/mockingbird-notifications/ui"
|
|
240
|
+
import { createRuntime as twilio } from "@crvouga/mockingbird-service-twilio"
|
|
241
|
+
|
|
242
|
+
const harness = createNotificationHarness({ services: { twilio: twilio() } })
|
|
243
|
+
const dashboard = mountDashboard(document.getElementById("lab") as HTMLElement, {
|
|
244
|
+
title: "Acme lab",
|
|
245
|
+
emulators: {
|
|
246
|
+
// may be async; may return a dispose function
|
|
247
|
+
mount: (panel) => {
|
|
248
|
+
panel.textContent = "Your emulators' admin UI goes here"
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
notifications: { harness }, // what mountNotifications takes
|
|
252
|
+
syncUrl: true, // read and write ?tab=
|
|
253
|
+
})
|
|
254
|
+
dashboard.show("notifications")
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Tabs are your own `tabs` (`{ id, label, mount }`), then Emulators, then Notifications. A tab is
|
|
258
|
+
drawn the first time it is shown and stays mounted; the Notifications tab counts what arrives while
|
|
259
|
+
another is open. Other options: `initialTab`, `onTabChange`, `theme` (`dark`, `light`, `auto`) and
|
|
260
|
+
`injectStyles`. The handle has `show(id)`, `active()`, `tabs()`, `aside`, `notifications` and
|
|
261
|
+
`destroy()`. Give the element a height. The shell is plain DOM with no inline script, so it runs
|
|
262
|
+
under a strict Content-Security-Policy.
|
|
263
|
+
|
|
197
264
|
## Usage
|
|
198
265
|
|
|
199
266
|
`NotificationClient` talks to a running harness:
|
|
@@ -235,7 +302,7 @@ sync the emulators first instead of waiting for the next poll.
|
|
|
235
302
|
|
|
236
303
|
## HTTP API
|
|
237
304
|
|
|
238
|
-
All routes are `GET
|
|
305
|
+
All routes are `GET`, except the emulators' own admin APIs under `/admin/apis/`. Filters: `channel` (`sms`, `email`, `push`, `chat`), `service`, `source` (the fleet
|
|
239
306
|
entry name), `namespace` (default `default`), `to`, `contains` (case-insensitive text), `since`
|
|
240
307
|
(ISO-8601 or epoch ms).
|
|
241
308
|
|
|
@@ -248,6 +315,9 @@ entry name), `namespace` (default `default`), `to`, `contains` (case-insensitive
|
|
|
248
315
|
| `/api/events?namespace=` | Server-sent events: `hello`, `change` (`{added, version}`) and `sources` every 2 s. |
|
|
249
316
|
| `/api/sources` | Each emulator: name, service, admin URL, `ok`, last error and count. |
|
|
250
317
|
| `/api/namespaces` | Namespaces watched. |
|
|
318
|
+
| `/api/admin` | What the dashboard mounts: `{admin, emulators, fleet}`. |
|
|
319
|
+
| `/admin/apis/{name}/…` | That emulator's admin API, any method, forwarded unchanged. |
|
|
320
|
+
| `/admin/ui.js`, `/admin/ui` | The emulators' admin UI: the script the page loads, and the UI as a page of its own. |
|
|
251
321
|
|
|
252
322
|
A notification:
|
|
253
323
|
|
|
@@ -255,16 +325,17 @@ A notification:
|
|
|
255
325
|
{
|
|
256
326
|
"id": "twilio:default:SMb6c1…", // <fleet entry>:<namespace>:<provider id>[#mailbox]
|
|
257
327
|
"providerId": "SMb6c1…",
|
|
258
|
-
"channel": "sms", // sms | email | push
|
|
328
|
+
"channel": "sms", // sms | email | push | chat
|
|
259
329
|
"source": "twilio", "service": "twilio", "namespace": "default",
|
|
260
|
-
"to": "+12025550123", // phone, mailbox (lower case), or
|
|
330
|
+
"to": "+12025550123", // phone, mailbox (lower case), push token, or chat channel
|
|
261
331
|
"from": { "name": null, "address": "+15005550006" },
|
|
262
332
|
"createdAt": "2026-11-10T06:39:06.886Z", // on the emulator's clock
|
|
263
333
|
"preview": "Your code is 123456",
|
|
264
334
|
"status": "queued",
|
|
265
|
-
"sms": { "body": "Your code is 123456", "code": null, "media": [] },
|
|
335
|
+
"sms": { "body": "Your code is 123456", "code": null, "media": [] }, // + "via": "whatsapp" for WhatsApp
|
|
266
336
|
"email": null, // {subject, html, text, cc, bcc, replyTo, attachments, headers}
|
|
267
337
|
"push": null, // {title, body, imageUrl, app, platform, data, badge, sound}
|
|
338
|
+
"chat": null, // {text, workspace, method, blocks, attachments, threadTs, ephemeral, edited, reactions, names}
|
|
268
339
|
"raw": { /* the emulator's own record */ }
|
|
269
340
|
}
|
|
270
341
|
```
|
|
@@ -276,15 +347,18 @@ forwards to Mailosaur (`--forward-to-inbox`), the Mailosaur copy is hidden so th
|
|
|
276
347
|
|
|
277
348
|
| Export | Kind | Description |
|
|
278
349
|
| --- | --- | --- |
|
|
279
|
-
| `createNotificationHarness` | function | The harness as a Fetch handler: `fetch`, `sync(namespace?)`, `list(filter)`, `waitFor(filter, {timeoutMs, count})`, `sources()`, `close()`. Options: `fleet`, `manifest`, `services`, `namespaces`, `pollIntervalMs`, `adminKey`, `fetch`, `title`. |
|
|
350
|
+
| `createNotificationHarness` | function | The harness as a Fetch handler: `fetch`, `sync(namespace?)`, `list(filter)`, `waitFor(filter, {timeoutMs, count})`, `sources()`, `close()`. Options: `fleet`, `manifest`, `services`, `namespaces`, `pollIntervalMs`, `adminKey`, `adminKeys`, `admin`, `defaultTab`, `fetch`, `title`. |
|
|
280
351
|
| `NotificationClient` | class | HTTP client for a running harness: `list`, `latest`, `waitFor`, `waitForCode`, `sources`, `link`. Options: `namespace`, `fetch`. |
|
|
281
352
|
| `matches` | function | `(notification, filter)` → whether it matches, as the API filters. |
|
|
282
353
|
| `parseMime` | function | The MIME reader used for SES raw email: headers, subject, addresses, text, HTML, attachments. |
|
|
283
354
|
| `SERVICE_KINDS`, `SERVICE_LABELS` | values | The emulators the harness reads, and their display names. |
|
|
355
|
+
| `CHANNELS` | value | Every channel, in device order: `sms`, `push`, `email`, `chat`. |
|
|
284
356
|
| `TEST_IDS`, `selectors` | values | Every `data-testid` the UI renders, and CSS selector builders for browser tests. Also exported from `./ui`. |
|
|
285
357
|
| `mountNotifications` (`./ui`) | function | `(element, {harness, …})` → `{ready, show, setNamespace, setSound, render, destroy}`. Mounts the UI on an element. |
|
|
358
|
+
| `mountDashboard` (`./ui`) | function | `(element, {emulators, notifications, tabs, …})` → `{show, active, tabs, aside, notifications, destroy}`. A tab bar over an emulators panel and the notifications UI. Also `DASHBOARD_STYLES` and `DASHBOARD_ROOT_CLASS`. |
|
|
286
359
|
| `createApp`, `STYLES`, `ROOT_CLASS` (`./ui`) | browser | The UI without the style injection and embedded defaults, its scoped stylesheet, and its root class. |
|
|
287
360
|
| `createServer`, `manifestFile`, `DEFAULT_PORT` (`./server`) | Node | Serve the harness over `node:http`; `manifestFile(path)` re-reads a fleet ready file. Port 8790. |
|
|
361
|
+
| `adminGateway` (`./server`) | Node | The harness's `admin` option: fronts every emulator's admin API and admin UI under `/admin/`. `createServer` passes it by default. |
|
|
288
362
|
|
|
289
363
|
## Not covered
|
|
290
364
|
|
|
@@ -293,6 +367,11 @@ forwards to Mailosaur (`--forward-to-inbox`), the Mailosaur copy is hidden so th
|
|
|
293
367
|
- SNS mobile push (platform endpoints) is not emulated, and SNS topic subscribers are matched by
|
|
294
368
|
topic only.
|
|
295
369
|
- Twilio MMS media is not in the emulator's outbox, so bubbles show text only.
|
|
370
|
+
- Chat reads Slack only. Discord, Microsoft Teams and Telegram have no emulator, and neither do
|
|
371
|
+
other push providers (APNs direct, Expo, OneSignal, Web Push) or email providers (SendGrid,
|
|
372
|
+
Postmark, Mailgun).
|
|
373
|
+
- WhatsApp templates, media and read receipts: a WhatsApp message is its text, as Twilio's
|
|
374
|
+
Messages API accepted it.
|
|
296
375
|
- Replying from a device. The harness shows what was sent; inbound traffic goes through each
|
|
297
376
|
emulator's own admin routes.
|
|
298
377
|
|
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
// src/model.ts
|
|
2
|
+
var CHANNELS = ["sms", "push", "email", "chat"];
|
|
3
|
+
var SERVICE_KINDS = [
|
|
4
|
+
"twilio",
|
|
5
|
+
"resend",
|
|
6
|
+
"fcm",
|
|
7
|
+
"ses",
|
|
8
|
+
"sns",
|
|
9
|
+
"customerio",
|
|
10
|
+
"mailosaur",
|
|
11
|
+
"slack"
|
|
12
|
+
];
|
|
13
|
+
var SERVICE_LABELS = {
|
|
14
|
+
twilio: "Twilio",
|
|
15
|
+
resend: "Resend",
|
|
16
|
+
fcm: "Firebase Cloud Messaging",
|
|
17
|
+
ses: "Amazon SES",
|
|
18
|
+
sns: "Amazon SNS",
|
|
19
|
+
customerio: "Customer.io",
|
|
20
|
+
mailosaur: "Mailosaur",
|
|
21
|
+
slack: "Slack"
|
|
22
|
+
};
|
|
23
|
+
var toMs = (value) => typeof value === "number" ? value : /^\d+$/.test(value) ? Number(value) : Date.parse(value);
|
|
24
|
+
var searchable = (n) => [
|
|
25
|
+
n.to,
|
|
26
|
+
n.from.address,
|
|
27
|
+
n.from.name ?? "",
|
|
28
|
+
n.preview,
|
|
29
|
+
n.sms?.body ?? "",
|
|
30
|
+
n.email?.subject ?? "",
|
|
31
|
+
n.email?.text ?? "",
|
|
32
|
+
n.push?.title ?? "",
|
|
33
|
+
n.push?.body ?? "",
|
|
34
|
+
n.chat?.text ?? ""
|
|
35
|
+
].join("\n").toLowerCase();
|
|
36
|
+
var matches = (n, filter) => {
|
|
37
|
+
if (filter.channel && n.channel !== filter.channel) return false;
|
|
38
|
+
if (filter.service && n.service !== filter.service) return false;
|
|
39
|
+
if (filter.source && n.source !== filter.source) return false;
|
|
40
|
+
if (filter.namespace && n.namespace !== filter.namespace) return false;
|
|
41
|
+
if (filter.to && n.to.toLowerCase() !== filter.to.toLowerCase()) return false;
|
|
42
|
+
if (filter.contains && !searchable(n).includes(filter.contains.toLowerCase())) return false;
|
|
43
|
+
if (filter.since !== void 0 && Date.parse(n.createdAt) < toMs(filter.since)) return false;
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
46
|
+
var filterFromSearch = (params) => {
|
|
47
|
+
const filter = {};
|
|
48
|
+
const channel = params.get("channel");
|
|
49
|
+
if (channel) {
|
|
50
|
+
if (!CHANNELS.includes(channel))
|
|
51
|
+
throw new Error(`channel: expected sms, email, push or chat, got ${JSON.stringify(channel)}`);
|
|
52
|
+
filter.channel = channel;
|
|
53
|
+
}
|
|
54
|
+
const service = params.get("service");
|
|
55
|
+
if (service) {
|
|
56
|
+
if (!SERVICE_KINDS.includes(service))
|
|
57
|
+
throw new Error(`service: expected one of ${SERVICE_KINDS.join(", ")}`);
|
|
58
|
+
filter.service = service;
|
|
59
|
+
}
|
|
60
|
+
for (const key of ["source", "namespace", "to", "contains"]) {
|
|
61
|
+
const value = params.get(key);
|
|
62
|
+
if (value) filter[key] = value;
|
|
63
|
+
}
|
|
64
|
+
const since = params.get("since");
|
|
65
|
+
if (since) {
|
|
66
|
+
if (Number.isNaN(toMs(since))) throw new Error("since: expected ISO-8601 or epoch milliseconds");
|
|
67
|
+
filter.since = since;
|
|
68
|
+
}
|
|
69
|
+
return filter;
|
|
70
|
+
};
|
|
71
|
+
var filterToSearch = (filter) => {
|
|
72
|
+
const params = new URLSearchParams();
|
|
73
|
+
for (const [key, value] of Object.entries(filter))
|
|
74
|
+
if (value !== void 0 && value !== "") params.set(key, String(value));
|
|
75
|
+
return params;
|
|
76
|
+
};
|
|
77
|
+
|
|
1
78
|
// src/ui/scope-css.ts
|
|
2
79
|
var scopeCss = (css, scope) => {
|
|
3
80
|
const source = css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
@@ -51,9 +128,71 @@ var splitTopLevel = (value) => {
|
|
|
51
128
|
return parts;
|
|
52
129
|
};
|
|
53
130
|
|
|
131
|
+
// src/ui/dashboard-styles.ts
|
|
132
|
+
var DASHBOARD_ROOT_CLASS = "mb-dashboard";
|
|
133
|
+
var RAW = `
|
|
134
|
+
:root {
|
|
135
|
+
--mbd-bar: #12151b; --mbd-line: #2a2f3a; --mbd-text: #e8eaf0; --mbd-muted: #9aa1b1;
|
|
136
|
+
--mbd-accent: #0a84ff; --mbd-hover: rgba(255,255,255,.07); --mbd-panel: #0e1015; --mbd-ok: #30d158;
|
|
137
|
+
}
|
|
138
|
+
&[data-theme="light"] {
|
|
139
|
+
--mbd-bar: #ffffff; --mbd-line: #e4e8ee; --mbd-text: #172033; --mbd-muted: #667085;
|
|
140
|
+
--mbd-accent: #2563d8; --mbd-hover: rgba(16,24,40,.06); --mbd-panel: #f5f7fa; --mbd-ok: #1f9d55;
|
|
141
|
+
}
|
|
142
|
+
@media (prefers-color-scheme: light) {
|
|
143
|
+
&[data-theme="auto"] {
|
|
144
|
+
--mbd-bar: #ffffff; --mbd-line: #e4e8ee; --mbd-text: #172033; --mbd-muted: #667085;
|
|
145
|
+
--mbd-accent: #2563d8; --mbd-hover: rgba(16,24,40,.06); --mbd-panel: #f5f7fa; --mbd-ok: #1f9d55;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
:root { display: flex; flex-direction: column; box-sizing: border-box; height: 100%; min-height: 0; overflow: hidden;
|
|
149
|
+
background: var(--mbd-panel); color: var(--mbd-text);
|
|
150
|
+
font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
|
|
151
|
+
.mbd-bar, .mbd-bar *, .mbd-panels, .mbd-panel { box-sizing: border-box; }
|
|
152
|
+
.mbd-bar { flex: none; display: flex; align-items: stretch; gap: 18px; height: 46px; padding: 0 16px;
|
|
153
|
+
background: var(--mbd-bar); border-bottom: 1px solid var(--mbd-line); }
|
|
154
|
+
.mbd-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
|
|
155
|
+
.mbd-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg,#0a84ff,#5e5ce6); flex: none;
|
|
156
|
+
display: grid; place-items: center; color: #fff; font-size: 13px; line-height: 1; }
|
|
157
|
+
.mbd-tabs { display: flex; align-items: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
|
|
158
|
+
.mbd-tabs::-webkit-scrollbar { display: none; }
|
|
159
|
+
.mbd-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; margin: 0; border: 0;
|
|
160
|
+
background: none; color: var(--mbd-muted); font: inherit; font-weight: 560; white-space: nowrap; cursor: pointer; border-radius: 0; }
|
|
161
|
+
.mbd-tab::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
|
|
162
|
+
.mbd-tab:hover { color: var(--mbd-text); background: var(--mbd-hover); }
|
|
163
|
+
.mbd-tab[aria-selected="true"] { color: var(--mbd-text); }
|
|
164
|
+
.mbd-tab[aria-selected="true"]::after { background: var(--mbd-accent); }
|
|
165
|
+
.mbd-tab:focus-visible { outline: 2px solid var(--mbd-accent); outline-offset: -3px; border-radius: 7px; }
|
|
166
|
+
.mbd-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--mbd-accent); color: #fff;
|
|
167
|
+
font-size: 11px; font-weight: 650; line-height: 18px; text-align: center; }
|
|
168
|
+
.mbd-badge[hidden] { display: none; }
|
|
169
|
+
.mbd-aside { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; color: var(--mbd-muted); font-size: 12.5px; white-space: nowrap; }
|
|
170
|
+
.mbd-aside:empty { display: none; }
|
|
171
|
+
.mbd-aside a { color: var(--mbd-accent); text-decoration: none; font-weight: 560; }
|
|
172
|
+
.mbd-aside a:hover { text-decoration: underline; }
|
|
173
|
+
.mbd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--mbd-line); border-radius: 999px; }
|
|
174
|
+
.mbd-pill b { color: var(--mbd-text); font-weight: 600; }
|
|
175
|
+
.mbd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mbd-ok); }
|
|
176
|
+
.mbd-panels { flex: 1; min-height: 0; position: relative; }
|
|
177
|
+
.mbd-panel { height: 100%; overflow: auto; }
|
|
178
|
+
.mbd-panel[hidden] { display: none; }
|
|
179
|
+
.mbd-fill { height: 100%; }
|
|
180
|
+
.mbd-status { padding: 48px; color: var(--mbd-muted); }
|
|
181
|
+
.mbd-status[data-kind="error"] { color: #ff6b61; }
|
|
182
|
+
@media (max-width: 640px) {
|
|
183
|
+
.mbd-bar { gap: 8px; height: 42px; padding: 0 8px; }
|
|
184
|
+
.mbd-brand span { display: none; }
|
|
185
|
+
.mbd-tabs { flex: 1; }
|
|
186
|
+
.mbd-tab { flex: 1 0 auto; justify-content: center; padding: 0 10px; font-size: 13px; }
|
|
187
|
+
.mbd-aside .mbd-pill { display: none; }
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
var DASHBOARD_STYLES = scopeCss(RAW, `.${DASHBOARD_ROOT_CLASS}`);
|
|
191
|
+
var DASHBOARD_PAGE_STYLES = "html.mbd-page, html.mbd-page body, html.mbd-page #app { height: 100%; min-height: 0; overflow: hidden; }";
|
|
192
|
+
|
|
54
193
|
// src/ui/styles.ts
|
|
55
194
|
var ROOT_CLASS = "mb-notifications";
|
|
56
|
-
var
|
|
195
|
+
var RAW2 = `
|
|
57
196
|
:root {
|
|
58
197
|
--bg: #0e1015; --panel: #161920; --panel-2: #1d212a; --line: #2a2f3a; --text: #e8eaf0;
|
|
59
198
|
--muted: #9aa1b1; --accent: #0a84ff; --ok: #30d158; --bad: #ff453a; --warn: #ffd60a;
|
|
@@ -101,16 +240,34 @@ button { cursor: pointer; }
|
|
|
101
240
|
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
|
|
102
241
|
.notice { margin: 14px 18px 0; padding: 10px 14px; border: 1px solid #5a2b2b; background: #2a1517; color: #ffb4ab; border-radius: 10px; font-size: 13px; }
|
|
103
242
|
|
|
104
|
-
.devices { display: flex; flex-wrap: wrap; gap: 28px; padding: 22px 18px 40px; align-items: flex-start; justify-content: center; }
|
|
243
|
+
.devices { display: flex; flex-wrap: wrap; gap: 28px; padding: 22px 18px 40px; align-items: flex-start; justify-content: center; zoom: var(--mbn-scale, 1); }
|
|
105
244
|
.devices.solo .device-col.wide { max-width: 1280px; }
|
|
106
245
|
.device-col { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 362px; flex: none; }
|
|
107
|
-
.device-col.wide { flex:
|
|
108
|
-
.device-
|
|
109
|
-
.device-
|
|
246
|
+
.device-col.wide { flex: 3 1 480px; width: auto; min-width: 0; max-width: 1180px; align-items: stretch; }
|
|
247
|
+
.device-col.wide.chat-col { flex: 2 1 340px; max-width: 760px; }
|
|
248
|
+
.devices.solo .device-col.wide.chat-col { max-width: 980px; }
|
|
249
|
+
/* Two fixed rows on every device, so the frames underneath all start at the same height. */
|
|
250
|
+
.device-head { display: grid; grid-template-rows: 28px 30px; row-gap: 6px; height: 64px; flex: none; width: 100%; justify-items: start; }
|
|
251
|
+
.device-head .head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; height: 28px; overflow: hidden; }
|
|
252
|
+
.device-head h2 { white-space: nowrap; }
|
|
110
253
|
.device-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 8px; }
|
|
111
254
|
.device-head h2 .count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; letter-spacing: 0; line-height: 18px; }
|
|
112
|
-
.device-head .field { height: 30px; max-width:
|
|
255
|
+
.device-head .field { height: 30px; max-width: 100%; min-width: 0; }
|
|
113
256
|
.device-head .field select { max-width: 190px; text-overflow: ellipsis; }
|
|
257
|
+
.channel-tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; flex: none; scrollbar-width: none; }
|
|
258
|
+
.channel-tabs [role="tab"] { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; background: none; border: 0; padding: 10px 14px 9px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
|
|
259
|
+
.channel-tabs [role="tab"]:hover { color: var(--text); }
|
|
260
|
+
.channel-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
|
|
261
|
+
.channel-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 6px; }
|
|
262
|
+
.channel-tabs .tab-unread { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; min-width: 18px; font-size: 11px; line-height: 18px; text-align: center; }
|
|
263
|
+
.channel-tabs[data-layout="tabs"] { padding: 0 6px; }
|
|
264
|
+
.channel-tabs[data-layout="tabs"] [role="tab"] { flex: 1 1 0; justify-content: center; padding-left: 8px; padding-right: 8px; }
|
|
265
|
+
/* One device at a time: the host is too narrow for two. Phones shrink to fit rather than clip. */
|
|
266
|
+
&[data-layout="tabs"] .devices { padding: 14px 8px 32px; gap: 0; }
|
|
267
|
+
&[data-layout="tabs"] .device-col.wide { flex-basis: 100%; }
|
|
268
|
+
&[data-layout="tabs"] .iphone, &[data-layout="tabs"] .pixel { zoom: var(--mbn-fit, 1); }
|
|
269
|
+
&[data-layout="tabs"] .device-col:not(.wide) { width: auto; max-width: 100%; }
|
|
270
|
+
&[data-layout="tabs"] .device-col:not(.wide) .device-head { width: calc(362px * var(--mbn-fit, 1)); }
|
|
114
271
|
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
|
|
115
272
|
.seg button { border: 0; background: none; color: var(--muted); padding: 2px 9px; border-radius: 5px; font-size: 12px; }
|
|
116
273
|
.seg button[aria-pressed="true"] { background: #2c3240; color: var(--text); }
|
|
@@ -121,7 +278,8 @@ button { cursor: pointer; }
|
|
|
121
278
|
.iphone::before, .iphone::after { content: ""; position: absolute; left: -9px; width: 4px; border-radius: 2px; background: #2c2c2e; }
|
|
122
279
|
.iphone::before { top: 150px; height: 60px; }
|
|
123
280
|
.iphone::after { top: 225px; height: 60px; }
|
|
124
|
-
|
|
281
|
+
/* clip-path as well as overflow: under zoom, Chromium lets a blurred bar (backdrop-filter) square off the rounded corners. */
|
|
282
|
+
.iphone .screen { position: relative; width: 100%; height: 100%; border-radius: 47px; overflow: hidden; clip-path: inset(0 round 47px); background: #fff; font-family: var(--ios); color: #000; -webkit-font-smoothing: antialiased; }
|
|
125
283
|
.island { position: absolute; z-index: 30; top: 11px; left: 50%; transform: translateX(-50%); width: 112px; height: 33px; border-radius: 20px; background: #000; }
|
|
126
284
|
.statusbar { position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 6px 32px 0 40px; font: 600 16px/1 var(--ios); letter-spacing: -.01em; }
|
|
127
285
|
.statusbar .icons { display: flex; gap: 6px; align-items: center; }
|
|
@@ -132,7 +290,7 @@ button { cursor: pointer; }
|
|
|
132
290
|
.pixel { position: relative; width: 352px; height: 760px; border-radius: 44px; padding: 10px; background: #111;
|
|
133
291
|
box-shadow: 0 0 0 2px #2b2b2f, 0 0 0 5px #3c3c41, 0 40px 80px rgba(0,0,0,.55); }
|
|
134
292
|
.pixel::after { content: ""; position: absolute; right: -7px; top: 170px; width: 4px; height: 90px; border-radius: 2px; background: #2c2c2e; }
|
|
135
|
-
.pixel .screen { position: relative; width: 100%; height: 100%; border-radius: 35px; overflow: hidden; font-family: var(--android); }
|
|
293
|
+
.pixel .screen { position: relative; width: 100%; height: 100%; border-radius: 35px; overflow: hidden; clip-path: inset(0 round 35px); font-family: var(--android); }
|
|
136
294
|
.punch { position: absolute; z-index: 30; top: 12px; left: 50%; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%; background: #050505; box-shadow: inset 0 0 0 2px #1a1a1a; }
|
|
137
295
|
|
|
138
296
|
/* \u2500\u2500 Messages (iOS) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
@@ -326,6 +484,8 @@ button { cursor: pointer; }
|
|
|
326
484
|
.chan.sms { background: rgba(48,209,88,.14); color: #6ee38a; }
|
|
327
485
|
.chan.email { background: rgba(10,132,255,.16); color: #69b0ff; }
|
|
328
486
|
.chan.push { background: rgba(255,159,10,.15); color: #ffc15e; }
|
|
487
|
+
.chan.chat { background: rgba(191,90,242,.16); color: #d79bff; }
|
|
488
|
+
.chan.sms.wa { background: rgba(37,211,102,.2); color: #4be08a; }
|
|
329
489
|
.svc-tag { font-size: 12px; color: var(--muted); }
|
|
330
490
|
.empty-tl { padding: 60px; text-align: center; color: var(--muted); }
|
|
331
491
|
.inspector { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -20px 0 50px rgba(0,0,0,.4); display: flex; flex-direction: column; }
|
|
@@ -431,14 +591,124 @@ button { cursor: pointer; }
|
|
|
431
591
|
@keyframes mbn-rowflash { from { background: #fef7e0; } to { background: #fff; } }
|
|
432
592
|
@container (max-width: 980px) { .mail-nav { width: 72px; } .mail-nav .lbl, .mail-nav .n, .compose .lbl { display: none; } .mail-logo { width: auto; } .compose { padding: 0 16px; } .mrow .svc { display: none; } }
|
|
433
593
|
@container (max-width: 640px) { .mail-nav, .mail-search, .cat-tabs, .mail-logo .lbl, .mail-toolbar .range { display: none; } .mail-main { margin-left: 8px; } .mrow .from { width: 110px; } .reader .subject-row, .sender-row { padding-left: 16px; } .mail-frame, .mail-text, .attachments, .reply-row, .details { margin-left: 16px; } .mail-frame { width: calc(100% - 32px); } .sender-row { flex-wrap: wrap; } .sender-row .who { flex-basis: calc(100% - 54px); } .sender-row .meta { flex-basis: 100%; padding-left: 54px; white-space: normal; } .reader h1 { font-size: 19px; line-height: 24px; } }
|
|
594
|
+
|
|
595
|
+
/* \u2500\u2500 WhatsApp: the same phone, a different app \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
596
|
+
.avatar.wa { background: linear-gradient(180deg,#5fe08b,#1daa61); }
|
|
597
|
+
.thread .via-wa { flex: none; font: 600 10px/16px var(--ios); letter-spacing: .02em; color: #0a7a43; background: #d9fdd3; border-radius: 4px; padding: 0 5px; }
|
|
598
|
+
.convo.wa { background: #efeae2; }
|
|
599
|
+
.convo.wa .convo-nav { background: rgba(246,246,246,.96); }
|
|
600
|
+
.convo.wa .convo-nav .back { color: #1daa61; }
|
|
601
|
+
.convo.wa .convo-nav .back svg [stroke] { stroke: #1daa61; }
|
|
602
|
+
.convo.wa .convo-nav .back svg [fill]:not([fill="none"]) { fill: #1daa61; }
|
|
603
|
+
.convo.wa .convo-nav .avatar { background: linear-gradient(180deg,#5fe08b,#1daa61); }
|
|
604
|
+
.convo.wa .convo-nav .back .badge { background: #1daa61; }
|
|
605
|
+
.convo.wa .convo-nav .who { flex-direction: column; gap: 0; }
|
|
606
|
+
.convo.wa .wa-sub { font: 400 11px/14px var(--ios); color: #1daa61; }
|
|
607
|
+
.convo.wa .convo-body { background: #efeae2; }
|
|
608
|
+
.convo.wa .stamp { width: max-content; max-width: 90%; margin: 12px auto 8px; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,.92); color: #54656f; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
|
|
609
|
+
.convo.wa .bubble { background: #fff; border-radius: 8px; border-top-left-radius: 8px; font-size: 16px; line-height: 21px; padding: 6px 9px 7px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
|
|
610
|
+
.convo.wa .bubble.tail { border-bottom-left-radius: 0; }
|
|
611
|
+
.convo.wa .bubble.tail::before { left: -7px; width: 8px; height: 12px; background: #fff; border-radius: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
|
|
612
|
+
.convo.wa .bubble.tail::after { display: none; }
|
|
613
|
+
.convo.wa .wa-time { float: right; margin: 9px 0 -3px 10px; font: 400 11px/14px var(--ios); letter-spacing: 0; color: #667781; }
|
|
614
|
+
.convo.wa .convo-input { background: #f6f6f6; }
|
|
615
|
+
.convo.wa .convo-input .plus { background: none; }
|
|
616
|
+
.convo.wa .convo-input .field-ios { background: #fff; border-color: #e2e2e2; }
|
|
617
|
+
.convo.wa .otp-bar small { color: #1daa61; }
|
|
618
|
+
|
|
619
|
+
/* \u2500\u2500 Chat: a team chat window \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
620
|
+
.window.chat { background: #fff; color: #1d1c1d; font-family: "Lato", "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; }
|
|
621
|
+
.window.chat .chrome { flex: none; }
|
|
622
|
+
.chat-body { flex: 1; min-height: 0; display: flex; }
|
|
623
|
+
.chat-side { flex: none; width: 200px; background: #2f1d3a; color: #cfc3d4; padding: 0 8px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
|
|
624
|
+
.chat-team { display: flex; align-items: center; gap: 4px; padding: 14px 8px 12px; margin: 0 -8px 8px; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
625
|
+
.chat-side-label { padding: 6px 8px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
|
|
626
|
+
.chat-chan { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; color: inherit; text-align: left; padding: 4px 8px; border-radius: 6px; font-size: 14px; min-width: 0; }
|
|
627
|
+
.chat-chan:hover { background: rgba(255,255,255,.08); }
|
|
628
|
+
.chat-chan .hash { opacity: .7; width: 12px; text-align: center; flex: none; }
|
|
629
|
+
.chat-chan .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
630
|
+
.chat-chan .n { flex: none; background: #e01e5a; color: #fff; border-radius: 999px; font-size: 11px; line-height: 16px; padding: 0 6px; font-weight: 700; }
|
|
631
|
+
.chat-chan.unread { color: #fff; font-weight: 700; }
|
|
632
|
+
.chat-chan.on { background: #5b3a70; color: #fff; }
|
|
633
|
+
.chat-chan:focus-visible { outline: 2px solid #9ec5ff; outline-offset: -2px; }
|
|
634
|
+
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
|
|
635
|
+
.chat-head { flex: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #e3e3e3; }
|
|
636
|
+
.chat-head b { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
637
|
+
.chat-head span { color: #616061; font-size: 12px; white-space: nowrap; }
|
|
638
|
+
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; }
|
|
639
|
+
.chat-list > :first-child { margin-top: auto; }
|
|
640
|
+
.chat-day { display: flex; align-items: center; gap: 10px; padding: 8px 18px; color: #616061; font-size: 12px; font-weight: 700; }
|
|
641
|
+
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: #e3e3e3; }
|
|
642
|
+
.chat-day span { border: 1px solid #e3e3e3; border-radius: 999px; padding: 2px 12px; }
|
|
643
|
+
.chat-msg { display: flex; gap: 10px; padding: 7px 18px; outline: 0; }
|
|
644
|
+
.chat-msg:hover, .chat-msg:focus-visible { background: #f8f8f8; }
|
|
645
|
+
.chat-msg[data-unread="true"] { background: #fffbea; }
|
|
646
|
+
.chat-msg[data-ephemeral="true"] { background: #f6f6f6; }
|
|
647
|
+
.chat-msg.arrive { animation: mbn-chat-in .3s ease-out; }
|
|
648
|
+
@keyframes mbn-chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
|
|
649
|
+
.chat-avatar { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
|
|
650
|
+
.chat-msg-main { flex: 1; min-width: 0; font-size: 15px; line-height: 22px; }
|
|
651
|
+
.chat-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
|
|
652
|
+
.chat-meta b { font-weight: 800; }
|
|
653
|
+
.chat-app { background: #e8e8e8; color: #555; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; line-height: 14px; align-self: center; }
|
|
654
|
+
.chat-time, .chat-edited { color: #616061; font-size: 12px; }
|
|
655
|
+
.chat-note { color: #616061; font-size: 12px; line-height: 16px; }
|
|
656
|
+
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
657
|
+
.chat-text a, .chat-att-title a { color: #1264a3; text-decoration: none; }
|
|
658
|
+
.chat-text a:hover { text-decoration: underline; }
|
|
659
|
+
.chat-code { font: 12px/18px var(--mono); background: #f4f4f4; border: 1px solid #dcdcdc; border-radius: 3px; padding: 1px 3px; color: #c0143c; }
|
|
660
|
+
.chat-pre { font: 12px/18px var(--mono); background: #f7f7f7; border: 1px solid #dcdcdc; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
661
|
+
.chat-mention { background: #e8f1fa; color: #1264a3; border-radius: 3px; padding: 0 2px; }
|
|
662
|
+
.chat-quote { display: block; border-left: 4px solid #ddd; padding-left: 10px; margin: 2px 0; }
|
|
663
|
+
.chat-blocks, .chat-attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
|
|
664
|
+
.chat-block-header { font-size: 18px; font-weight: 800; line-height: 24px; }
|
|
665
|
+
.chat-block-divider hr { border: 0; border-top: 1px solid #e3e3e3; margin: 4px 0; }
|
|
666
|
+
.chat-block-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #616061; font-size: 13px; }
|
|
667
|
+
.chat-block-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
668
|
+
.chat-block.with-accessory { display: flex; gap: 12px; align-items: flex-start; }
|
|
669
|
+
.chat-section-body { flex: 1; min-width: 0; }
|
|
670
|
+
.chat-accessory { flex: none; }
|
|
671
|
+
.chat-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 4px; }
|
|
672
|
+
.chat-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid #bbb; border-radius: 4px; background: #fff; font-size: 13px; font-weight: 700; color: #1d1c1d; }
|
|
673
|
+
.chat-btn.primary { background: #007a5a; border-color: #007a5a; color: #fff; }
|
|
674
|
+
.chat-btn.danger { color: #e01e5a; }
|
|
675
|
+
.chat-thumb { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; display: block; }
|
|
676
|
+
.chat-block-context .chat-thumb { width: 20px; height: 20px; border-radius: 3px; }
|
|
677
|
+
.chat-image { max-width: min(360px, 100%); max-height: 260px; border-radius: 6px; display: block; }
|
|
678
|
+
.chat-caption { color: #616061; font-size: 13px; }
|
|
679
|
+
.chat-list-block { margin: 2px 0; padding-left: 22px; }
|
|
680
|
+
.chat-unknown { color: #616061; font: 12px var(--mono); border: 1px dashed #ccc; border-radius: 4px; padding: 2px 6px; }
|
|
681
|
+
.chat-attachment { border-left: 4px solid #ddd; padding-left: 12px; display: flex; flex-direction: column; gap: 2px; }
|
|
682
|
+
.chat-att-author { font-size: 13px; font-weight: 700; }
|
|
683
|
+
.chat-att-title { font-weight: 700; }
|
|
684
|
+
.chat-field { margin-top: 4px; }
|
|
685
|
+
.chat-field:not(.short) { grid-column: 1 / -1; }
|
|
686
|
+
.chat-att-footer { color: #616061; font-size: 12px; }
|
|
687
|
+
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
|
|
688
|
+
.chat-reaction { background: #f0f0f0; border: 1px solid #e0e0e0; border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 22px; }
|
|
689
|
+
.chat-compose { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0 18px 16px; padding: 0 12px; height: 42px; border: 1px solid #bbb; border-radius: 8px; color: #8a8a8a; font-size: 14px; }
|
|
690
|
+
.chat-compose span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
691
|
+
.chat-compose .send { display: grid; place-items: center; opacity: .5; }
|
|
692
|
+
.chat-empty { margin: auto; padding: 40px 28px; text-align: center; color: #616061; display: flex; flex-direction: column; gap: 6px; max-width: 380px; }
|
|
693
|
+
.chat-empty b { color: #1d1c1d; font-size: 16px; }
|
|
694
|
+
@container (max-width: 560px) { .chat-side { display: none; } .chat-msg, .chat-head, .chat-day { padding-left: 12px; padding-right: 12px; } .chat-compose { margin: 0 12px 12px; } .chat-fields { grid-template-columns: 1fr; } }
|
|
434
695
|
@media (max-width: 760px) { .devices { padding: 16px 8px; } .device-col.wide { flex-basis: 100%; } }
|
|
435
696
|
`;
|
|
436
|
-
var STYLES = scopeCss(
|
|
697
|
+
var STYLES = scopeCss(RAW2, `.${ROOT_CLASS}`);
|
|
437
698
|
var PAGE_STYLES = "html, body { margin: 0; min-height: 100%; background: #0e1015; color-scheme: dark; } #app { min-height: 100vh; } .boot { padding: 48px; color: #9aa1b1; font: 14px/1.4 system-ui, sans-serif; }";
|
|
438
699
|
|
|
439
700
|
export {
|
|
701
|
+
CHANNELS,
|
|
702
|
+
SERVICE_KINDS,
|
|
703
|
+
SERVICE_LABELS,
|
|
704
|
+
matches,
|
|
705
|
+
filterFromSearch,
|
|
706
|
+
filterToSearch,
|
|
707
|
+
DASHBOARD_ROOT_CLASS,
|
|
708
|
+
DASHBOARD_STYLES,
|
|
709
|
+
DASHBOARD_PAGE_STYLES,
|
|
440
710
|
ROOT_CLASS,
|
|
441
711
|
STYLES,
|
|
442
712
|
PAGE_STYLES
|
|
443
713
|
};
|
|
444
|
-
//# sourceMappingURL=chunk-
|
|
714
|
+
//# sourceMappingURL=chunk-3HF2NSFV.js.map
|