@hanzo/rooms 0.1.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/LICENSE-APACHE +205 -0
- package/LICENSE-MIT +21 -0
- package/README.md +23 -0
- package/dist/Account.d.ts +8 -0
- package/dist/Account.js +58 -0
- package/dist/Beluga.d.ts +12 -0
- package/dist/Beluga.js +152 -0
- package/dist/Billing.d.ts +1 -0
- package/dist/Billing.js +31 -0
- package/dist/Board.d.ts +9 -0
- package/dist/Board.js +447 -0
- package/dist/Boxes.d.ts +1 -0
- package/dist/Boxes.js +173 -0
- package/dist/CalScheduler.d.ts +15 -0
- package/dist/CalScheduler.js +196 -0
- package/dist/Chat.d.ts +35 -0
- package/dist/Chat.js +1049 -0
- package/dist/Column.d.ts +15 -0
- package/dist/Column.js +88 -0
- package/dist/Contacts.d.ts +1 -0
- package/dist/Contacts.js +301 -0
- package/dist/Directory.d.ts +24 -0
- package/dist/Directory.js +356 -0
- package/dist/Drive.d.ts +2 -0
- package/dist/Drive.js +466 -0
- package/dist/Find.d.ts +7 -0
- package/dist/Find.js +82 -0
- package/dist/Guide.d.ts +6 -0
- package/dist/Guide.js +272 -0
- package/dist/Home.d.ts +39 -0
- package/dist/Home.js +306 -0
- package/dist/Inbox.d.ts +9 -0
- package/dist/Inbox.js +193 -0
- package/dist/Market.d.ts +3 -0
- package/dist/Market.js +149 -0
- package/dist/Me.d.ts +27 -0
- package/dist/Me.js +251 -0
- package/dist/Meet.d.ts +9 -0
- package/dist/Meet.js +370 -0
- package/dist/ModeMark.d.ts +8 -0
- package/dist/ModeMark.js +18 -0
- package/dist/OrgSwitcher.d.ts +31 -0
- package/dist/OrgSwitcher.js +120 -0
- package/dist/Orgs.d.ts +10 -0
- package/dist/Orgs.js +582 -0
- package/dist/Profile.d.ts +4 -0
- package/dist/Profile.js +67 -0
- package/dist/Prose.d.ts +5 -0
- package/dist/Prose.js +111 -0
- package/dist/ProviderMark.d.ts +17 -0
- package/dist/ProviderMark.js +277 -0
- package/dist/Recents.d.ts +10 -0
- package/dist/Recents.js +91 -0
- package/dist/RightPane.d.ts +13 -0
- package/dist/RightPane.js +426 -0
- package/dist/Room.d.ts +8 -0
- package/dist/Room.js +50 -0
- package/dist/Scene.d.ts +12 -0
- package/dist/Scene.js +105 -0
- package/dist/Settings.d.ts +46 -0
- package/dist/Settings.js +321 -0
- package/dist/Setup.d.ts +1 -0
- package/dist/Setup.js +36 -0
- package/dist/Share.d.ts +3 -0
- package/dist/Share.js +130 -0
- package/dist/Shared.d.ts +1 -0
- package/dist/Shared.js +113 -0
- package/dist/Shell.d.ts +63 -0
- package/dist/Shell.js +1225 -0
- package/dist/Start.d.ts +1 -0
- package/dist/Start.js +96 -0
- package/dist/Support.d.ts +14 -0
- package/dist/Support.js +122 -0
- package/dist/Talk.d.ts +4 -0
- package/dist/Talk.js +107 -0
- package/dist/Upgrade.d.ts +11 -0
- package/dist/Upgrade.js +75 -0
- package/dist/Usage.d.ts +1 -0
- package/dist/Usage.js +21 -0
- package/dist/Vibe.d.ts +2 -0
- package/dist/Vibe.js +188 -0
- package/dist/Work.d.ts +12 -0
- package/dist/Work.js +256 -0
- package/dist/bots/Bots.d.ts +2 -0
- package/dist/bots/Bots.js +456 -0
- package/dist/bots/Lights.d.ts +8 -0
- package/dist/bots/Lights.js +13 -0
- package/dist/bots/api.d.ts +120 -0
- package/dist/bots/api.js +75 -0
- package/dist/bots/face.d.ts +5 -0
- package/dist/bots/face.js +13 -0
- package/dist/bots/ink.d.ts +7 -0
- package/dist/bots/ink.js +29 -0
- package/dist/bots/kit.d.ts +113 -0
- package/dist/bots/kit.js +43 -0
- package/dist/bots/runtime.d.ts +4 -0
- package/dist/bots/runtime.js +326 -0
- package/dist/card.d.ts +52 -0
- package/dist/card.js +52 -0
- package/dist/cast.d.ts +143 -0
- package/dist/cast.js +251 -0
- package/dist/connect.d.ts +29 -0
- package/dist/connect.js +64 -0
- package/dist/contacts-store.d.ts +111 -0
- package/dist/contacts-store.js +276 -0
- package/dist/conversations.d.ts +54 -0
- package/dist/conversations.js +98 -0
- package/dist/copy.d.ts +23 -0
- package/dist/copy.js +39 -0
- package/dist/crew.d.ts +36 -0
- package/dist/crew.js +304 -0
- package/dist/dev.d.ts +3 -0
- package/dist/dev.js +102 -0
- package/dist/enso.d.ts +70 -0
- package/dist/enso.js +112 -0
- package/dist/failure.d.ts +57 -0
- package/dist/failure.js +143 -0
- package/dist/ground.d.ts +32 -0
- package/dist/ground.js +32 -0
- package/dist/host.d.ts +76 -0
- package/dist/host.js +76 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +12 -0
- package/dist/kept.d.ts +5 -0
- package/dist/kept.js +27 -0
- package/dist/lib/account.d.ts +49 -0
- package/dist/lib/account.js +229 -0
- package/dist/lib/ai.d.ts +46 -0
- package/dist/lib/ai.js +140 -0
- package/dist/lib/api.d.ts +43 -0
- package/dist/lib/api.js +62 -0
- package/dist/lib/bare.d.ts +9 -0
- package/dist/lib/bare.js +7 -0
- package/dist/lib/coding.d.ts +105 -0
- package/dist/lib/coding.js +87 -0
- package/dist/lib/destination.d.ts +102 -0
- package/dist/lib/destination.js +260 -0
- package/dist/lib/durable.d.ts +66 -0
- package/dist/lib/durable.js +107 -0
- package/dist/lib/first.d.ts +11 -0
- package/dist/lib/first.js +23 -0
- package/dist/lib/home.d.ts +61 -0
- package/dist/lib/home.js +54 -0
- package/dist/lib/host.d.ts +104 -0
- package/dist/lib/host.js +132 -0
- package/dist/lib/hostname.d.ts +1 -0
- package/dist/lib/hostname.js +14 -0
- package/dist/lib/hydrated.d.ts +1 -0
- package/dist/lib/hydrated.js +20 -0
- package/dist/lib/integrations.d.ts +21 -0
- package/dist/lib/integrations.js +1 -0
- package/dist/lib/intent.d.ts +6 -0
- package/dist/lib/intent.js +71 -0
- package/dist/lib/invite.d.ts +155 -0
- package/dist/lib/invite.js +245 -0
- package/dist/lib/limits.d.ts +55 -0
- package/dist/lib/limits.js +119 -0
- package/dist/lib/list.d.ts +9 -0
- package/dist/lib/list.js +11 -0
- package/dist/lib/mark.d.ts +13 -0
- package/dist/lib/mark.js +85 -0
- package/dist/lib/mix.d.ts +22 -0
- package/dist/lib/mix.js +22 -0
- package/dist/lib/models.d.ts +27 -0
- package/dist/lib/models.js +106 -0
- package/dist/lib/org.d.ts +109 -0
- package/dist/lib/org.js +140 -0
- package/dist/lib/path.d.ts +9 -0
- package/dist/lib/path.js +29 -0
- package/dist/lib/plans.d.ts +193 -0
- package/dist/lib/plans.js +310 -0
- package/dist/lib/prose.d.ts +13 -0
- package/dist/lib/prose.js +62 -0
- package/dist/lib/reach.d.ts +17 -0
- package/dist/lib/reach.js +70 -0
- package/dist/lib/rooms.json +23 -0
- package/dist/lib/served.d.ts +20 -0
- package/dist/lib/served.js +92 -0
- package/dist/lib/session.d.ts +211 -0
- package/dist/lib/session.js +493 -0
- package/dist/lib/share.d.ts +131 -0
- package/dist/lib/share.js +216 -0
- package/dist/lib/signout.d.ts +14 -0
- package/dist/lib/signout.js +40 -0
- package/dist/lib/tags.d.ts +27 -0
- package/dist/lib/tags.js +46 -0
- package/dist/lib/tap.d.ts +17 -0
- package/dist/lib/tap.js +9 -0
- package/dist/lib/tier.d.ts +115 -0
- package/dist/lib/tier.js +207 -0
- package/dist/lib/tiers.d.ts +9 -0
- package/dist/lib/tiers.js +141 -0
- package/dist/lib/todo.d.ts +125 -0
- package/dist/lib/todo.js +379 -0
- package/dist/look.d.ts +1 -0
- package/dist/look.js +21 -0
- package/dist/meters.d.ts +8 -0
- package/dist/meters.js +31 -0
- package/dist/model.d.ts +4 -0
- package/dist/model.js +44 -0
- package/dist/network.d.ts +64 -0
- package/dist/network.js +216 -0
- package/dist/open.d.ts +81 -0
- package/dist/open.js +149 -0
- package/dist/pane.d.ts +92 -0
- package/dist/pane.js +231 -0
- package/dist/progress.d.ts +46 -0
- package/dist/progress.js +51 -0
- package/dist/recent.d.ts +67 -0
- package/dist/recent.js +161 -0
- package/dist/rooms.d.ts +131 -0
- package/dist/rooms.js +195 -0
- package/dist/roster.d.ts +28 -0
- package/dist/roster.js +70 -0
- package/dist/span.d.ts +14 -0
- package/dist/span.js +50 -0
- package/dist/speech.d.ts +44 -0
- package/dist/speech.js +229 -0
- package/dist/stars.d.ts +16 -0
- package/dist/stars.js +75 -0
- package/dist/tabs.d.ts +26 -0
- package/dist/tabs.js +25 -0
- package/dist/team.d.ts +11 -0
- package/dist/team.gen.d.ts +10 -0
- package/dist/team.gen.js +11 -0
- package/dist/team.js +30 -0
- package/dist/tools.d.ts +35 -0
- package/dist/tools.js +143 -0
- package/dist/tours.d.ts +24 -0
- package/dist/tours.js +311 -0
- package/dist/waiting.d.ts +15 -0
- package/dist/waiting.js +17 -0
- package/dist/where.d.ts +54 -0
- package/dist/where.js +14 -0
- package/package.json +108 -0
package/dist/network.js
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
// Which channel a message arrived on, as a mark.
|
|
4
|
+
//
|
|
5
|
+
// A message carries `channel` — the platform measures it — so this is a fact
|
|
6
|
+
// about the message and not decoration. The mark is what makes an inbox of many
|
|
7
|
+
// transports readable: a name tells you after you read it, a mark tells you
|
|
8
|
+
// before. The Channels grid asks a different question of the same set — which
|
|
9
|
+
// of these have you connected — so it reads this table too. Two tables would
|
|
10
|
+
// drift, and a channel called one thing in the Inbox and another in the grid is
|
|
11
|
+
// two channels to whoever is reading.
|
|
12
|
+
//
|
|
13
|
+
// NOTHING BELOW IS DRAWN BY US, and that is the whole of the design. A mark
|
|
14
|
+
// approximated by hand is a forgery that happens to be bad at it: it is close
|
|
15
|
+
// enough to be taken for the real thing and wrong enough to misidentify the
|
|
16
|
+
// product, which is how a Facebook card came to wear Messenger's bolt. So every
|
|
17
|
+
// mark here arrives from somewhere a reader can check, and there are exactly
|
|
18
|
+
// three ways in:
|
|
19
|
+
//
|
|
20
|
+
// path simple-icons 16.28.0, CC0-1.0. Imported, never transcribed, so the
|
|
21
|
+
// silhouette is the project's own bytes and updates with the package.
|
|
22
|
+
// It is one colour by design and sits on the brand's own hex.
|
|
23
|
+
// art the vendor's own file, byte for byte, for the brands simple-icons
|
|
24
|
+
// delisted at their owners' request. Served as a data URI in an <img>
|
|
25
|
+
// rather than inlined: an <img> gives each file its own document, so
|
|
26
|
+
// the gradient ids inside four vendor SVGs cannot collide with each
|
|
27
|
+
// other or with the page, and the artwork never has to be edited to
|
|
28
|
+
// be safe. Editing it to fit would be redrawing it by another name.
|
|
29
|
+
// glyph a plain lucide glyph, for the rows that are CAPABILITIES rather than
|
|
30
|
+
// brands — a phone call, a video call, the web widget, an IMAP
|
|
31
|
+
// mailbox. None of those is a product with a logo, and dressing one in
|
|
32
|
+
// a brand-coloured tile invents a company that does not exist.
|
|
33
|
+
//
|
|
34
|
+
// A brand we cannot draw takes none of the three: it gets its INITIAL on the
|
|
35
|
+
// neutral ground. Not on its own colour — a brand colour is half the mark, and
|
|
36
|
+
// a white Y on Yahoo purple is close enough to be read as the logo it is
|
|
37
|
+
// standing in for. Grey claims nothing, the letter tells two of them apart, and
|
|
38
|
+
// the tile keeps its place so the column still scans. Yahoo and LinkedIn are
|
|
39
|
+
// there now: both delisted, and neither publishes a square mark you can fetch.
|
|
40
|
+
import { MessageCircle, Phone, Server, Video, } from 'lucide-react';
|
|
41
|
+
import { Text, View, YStack } from '@hanzo/ui';
|
|
42
|
+
import { siDiscord, siFacebook, siGmail, siIcloud, siInstagram, siMessenger, siReddit, siSignal, siTelegram, siTiktok, siWhatsapp, siX, siZoom, } from 'simple-icons';
|
|
43
|
+
/* The vendor files, pasted unchanged. Each carries the address it came from,
|
|
44
|
+
because provenance is the whole claim and it should travel with the bytes. */
|
|
45
|
+
/** Outlook — fetched https://res.cdn.office.net/files/fabric-cdn-prod_20230815.002/assets/brand-icons/product/svg/outlook_48x1.svg
|
|
46
|
+
* Verbatim; not one byte of it is ours. */
|
|
47
|
+
const OUTLOOK = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><defs><linearGradient id="a" x1="28.5" y1="25" x2="28.5" y2="44" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#35b8f1"/><stop offset="1" stop-color="#28a8ea"/></linearGradient><linearGradient id="b" x1="5.822" y1="11.568" x2="20.178" y2="36.432" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1784d9"/><stop offset=".5" stop-color="#107ad5"/><stop offset="1" stop-color="#0a63c9"/></linearGradient></defs><path d="M45 25a.96.96 0 0 0-.458-.825h-.005l-.018-.01-14.9-8.82a2.026 2.026 0 0 0-.2-.119 2 2 0 0 0-1.834 0 2.026 2.026 0 0 0-.2.119l-14.9 8.82-.018.01a.971.971 0 0 0 .023 1.663l14.9 8.82a2.241 2.241 0 0 0 .2.119 2 2 0 0 0 1.834 0 2.241 2.241 0 0 0 .2-.119l14.9-8.82A.959.959 0 0 0 45 25z" fill="#0a2767"/><path fill="#0364b8" d="M14.222 19.111H24v8.963h-9.778zM43 10V5.9A1.858 1.858 0 0 0 41.187 4H15.813A1.858 1.858 0 0 0 14 5.9V10l15 4z"/><path fill="#0078d4" d="M14 10h10v9H14z"/><path fill="#28a8ea" d="M34 10H24v9l10 9h9v-9l-9-9z"/><path fill="#0078d4" d="M24 19h10v9H24z"/><path fill="#0364b8" d="M24 28h10v9H24z"/><path fill="#14447d" d="M14.222 28.074H24v8.148h-9.778z"/><path fill="#0078d4" d="M34 28h9v9h-9z"/><path d="M44.542 25.783l-.019.01-14.9 8.38c-.065.04-.131.078-.2.112a2.077 2.077 0 0 1-.808.2l-.814-.476a2.033 2.033 0 0 1-.2-.115l-15.1-8.618h-.007L12 25v16.964A2.05 2.05 0 0 0 14.063 44h28.906c.017 0 .032-.008.05-.008a2.531 2.531 0 0 0 .7-.146A2.019 2.019 0 0 0 44 43.7c.067-.038.182-.121.182-.121A2.019 2.019 0 0 0 45 41.964V25a.9.9 0 0 1-.458.783z" fill="url(#a)"/><path d="M44.2 24.933v1.04L28.62 36.7 12.49 25.283a.01.01 0 0 0-.01-.01l-1.48-.89v-.75l.61-.01 1.29.74.03.01.11.07s15.16 8.65 15.2 8.67l.58.34c.05-.02.1-.04.16-.06.03-.02 15.05-8.47 15.05-8.47z" fill="#0a2767" opacity=".5"/><path fill="none" d="M0 0h48v48H0z"/><path d="M44.542 25.783l-.019.011-14.9 8.38c-.065.04-.131.078-.2.112a2.089 2.089 0 0 1-1.834 0 2.264 2.264 0 0 1-.2-.112l-14.9-8.38-.018-.011A.9.9 0 0 1 12 25v16.964A2.049 2.049 0 0 0 14.062 44h28.876A2.049 2.049 0 0 0 45 41.964V25a.9.9 0 0 1-.458.783z" fill="#1490df"/><path d="M29.84 34.05l-.223.125a2.183 2.183 0 0 1-.2.113 2.071 2.071 0 0 1-.786.208L34.3 41.2l9.889 2.383a2.038 2.038 0 0 0 .627-.783z" opacity=".1"/><path d="M30.85 33.482l-1.233.693a2.183 2.183 0 0 1-.2.113 2.071 2.071 0 0 1-.786.208l2.656 7.323 12.905 1.761A2.022 2.022 0 0 0 45 41.964v-.219z" opacity=".05"/><path d="M14.09 44h28.845a2.074 2.074 0 0 0 1.235-.4L27.8 34.011a2.033 2.033 0 0 1-.2-.115l-15.1-8.618h-.007L12 25v16.906A2.092 2.092 0 0 0 14.09 44z" fill="#28a8ea"/><path d="M26 13.833v21.33a1.838 1.838 0 0 1-1.15 1.7 1.723 1.723 0 0 1-.68.14H12V13h2v-1h10.17A1.837 1.837 0 0 1 26 13.833z" opacity=".1"/><path d="M25 14.833v21.33a1.629 1.629 0 0 1-.15.7A1.822 1.822 0 0 1 23.17 38H12V13h11.17a1.679 1.679 0 0 1 .83.21 1.818 1.818 0 0 1 1 1.623z" opacity=".2"/><path d="M25 14.833v19.33A1.846 1.846 0 0 1 23.17 36H12V13h11.17a1.679 1.679 0 0 1 .83.21 1.818 1.818 0 0 1 1 1.623z" opacity=".2"/><path d="M24 14.833v19.33A1.839 1.839 0 0 1 22.17 36H12V13h10.17A1.831 1.831 0 0 1 24 14.833z" opacity=".2"/><rect x="2" y="13" width="22" height="22" rx="1.833" fill="url(#b)"/><path d="M7.729 20.688a5.332 5.332 0 0 1 2.094-2.313 6.33 6.33 0 0 1 3.327-.834 5.892 5.892 0 0 1 3.079.791 5.284 5.284 0 0 1 2.037 2.21 7.133 7.133 0 0 1 .714 3.25 7.528 7.528 0 0 1-.735 3.4 5.41 5.41 0 0 1-2.1 2.287 6.126 6.126 0 0 1-3.194.812 6.02 6.02 0 0 1-3.147-.8 5.366 5.366 0 0 1-2.064-2.214 6.963 6.963 0 0 1-.722-3.211 7.733 7.733 0 0 1 .711-3.378zm2.232 5.43a3.461 3.461 0 0 0 1.178 1.522 3.077 3.077 0 0 0 1.84.554 3.223 3.223 0 0 0 1.964-.572 3.315 3.315 0 0 0 1.144-1.522 5.908 5.908 0 0 0 .365-2.123 6.463 6.463 0 0 0-.344-2.15A3.4 3.4 0 0 0 15 20.241a3.043 3.043 0 0 0-1.947-.6 3.175 3.175 0 0 0-1.883.559 3.49 3.49 0 0 0-1.2 1.535 6.1 6.1 0 0 0-.008 4.385z" fill="#fff"/><path fill="#50d9ff" d="M34 10h9v9h-9z"/></svg>`;
|
|
48
|
+
/** Microsoft 365 — fetched https://res.cdn.office.net/files/fabric-cdn-prod_20230815.002/assets/brand-icons/product/svg/m365_48x1.svg
|
|
49
|
+
* Verbatim; not one byte of it is ours. */
|
|
50
|
+
const MICROSOFT365 = `<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
51
|
+
<path d="M20.0842 3.02539L19.8595 3.1613C19.5021 3.3775 19.1654 3.61923 18.8512 3.88336L19.4993 3.42749H25L26 10.9995L21 15.9995L16 19.4749V23.4824C16 26.2814 17.4629 28.8769 19.8574 30.3263L25.1211 33.5124L14 39.9997H11.8551L7.85737 37.5799C5.46286 36.1305 4 33.535 4 30.736V17.2601C4 14.4602 5.46379 11.864 7.85952 10.4149L19.8595 3.15638C19.9339 3.11141 20.0088 3.06774 20.0842 3.02539Z" fill="url(#paint0_radial_48543_184825)"/>
|
|
52
|
+
<path d="M20.0842 3.02539L19.8595 3.1613C19.5021 3.3775 19.1654 3.61923 18.8512 3.88336L19.4993 3.42749H25L26 10.9995L21 15.9995L16 19.4749V23.4824C16 26.2814 17.4629 28.8769 19.8574 30.3263L25.1211 33.5124L14 39.9997H11.8551L7.85737 37.5799C5.46286 36.1305 4 33.535 4 30.736V17.2601C4 14.4602 5.46379 11.864 7.85952 10.4149L19.8595 3.15638C19.9339 3.11141 20.0088 3.06774 20.0842 3.02539Z" fill="url(#paint1_linear_48543_184825)"/>
|
|
53
|
+
<path d="M31.9973 19V23.4803C31.9973 26.2793 30.5344 28.8748 28.1399 30.3242L16.1399 37.5878C13.6852 39.0737 10.6308 39.1273 8.13281 37.7487L19.8546 44.844C22.4013 46.3855 25.5932 46.3855 28.1399 44.844L40.1399 37.5803C42.5344 36.1309 43.9972 33.5354 43.9972 30.7364V27.5L42.9973 26L31.9973 19Z" fill="url(#paint2_radial_48543_184825)"/>
|
|
54
|
+
<path d="M31.9973 19V23.4803C31.9973 26.2793 30.5344 28.8748 28.1399 30.3242L16.1399 37.5878C13.6852 39.0737 10.6308 39.1273 8.13281 37.7487L19.8546 44.844C22.4013 46.3855 25.5932 46.3855 28.1399 44.844L40.1399 37.5803C42.5344 36.1309 43.9972 33.5354 43.9972 30.7364V27.5L42.9973 26L31.9973 19Z" fill="url(#paint3_linear_48543_184825)"/>
|
|
55
|
+
<path d="M40.1405 10.4153L28.1405 3.15678C25.6738 1.66471 22.6021 1.61849 20.0979 3.01811L19.8595 3.16231C17.4638 4.61143 16 7.20757 16 10.0075V19.4914L19.8595 17.1568C22.4051 15.6171 25.5949 15.6171 28.1405 17.1568L40.1405 24.4153C42.4613 25.8192 43.9076 28.2994 43.9957 30.9985C43.9986 30.9113 44 30.824 44 30.7364V17.2605C44 14.4606 42.5362 11.8644 40.1405 10.4153Z" fill="url(#paint4_radial_48543_184825)"/>
|
|
56
|
+
<path d="M40.1405 10.4153L28.1405 3.15678C25.6738 1.66471 22.6021 1.61849 20.0979 3.01811L19.8595 3.16231C17.4638 4.61143 16 7.20757 16 10.0075V19.4914L19.8595 17.1568C22.4051 15.6171 25.5949 15.6171 28.1405 17.1568L40.1405 24.4153C42.4613 25.8192 43.9076 28.2994 43.9957 30.9985C43.9986 30.9113 44 30.824 44 30.7364V17.2605C44 14.4606 42.5362 11.8644 40.1405 10.4153Z" fill="url(#paint5_linear_48543_184825)"/>
|
|
57
|
+
<path d="M4.00428 30.9984C4.00428 30.9984 4.00428 30.9984 4.00428 30.9984Z" fill="url(#paint6_radial_48543_184825)"/>
|
|
58
|
+
<path d="M4.00428 30.9984C4.00428 30.9984 4.00428 30.9984 4.00428 30.9984Z" fill="url(#paint7_linear_48543_184825)"/>
|
|
59
|
+
<defs>
|
|
60
|
+
<radialGradient id="paint0_radial_48543_184825" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(17.4186 10.6379) rotate(110.528) scale(33.3657 58.1966)">
|
|
61
|
+
<stop offset="0.06441" stop-color="#AE7FE2"/>
|
|
62
|
+
<stop offset="1" stop-color="#0078D4"/>
|
|
63
|
+
</radialGradient>
|
|
64
|
+
<linearGradient id="paint1_linear_48543_184825" x1="17.5119" y1="37.868" x2="12.7513" y2="29.6342" gradientUnits="userSpaceOnUse">
|
|
65
|
+
<stop stop-color="#114A8B"/>
|
|
66
|
+
<stop offset="1" stop-color="#0078D4" stop-opacity="0"/>
|
|
67
|
+
</linearGradient>
|
|
68
|
+
<radialGradient id="paint2_radial_48543_184825" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.4272 36.3511) rotate(-8.36717) scale(31.0503 20.5108)">
|
|
69
|
+
<stop offset="0.133928" stop-color="#D59DFF"/>
|
|
70
|
+
<stop offset="1" stop-color="#5E438F"/>
|
|
71
|
+
</radialGradient>
|
|
72
|
+
<linearGradient id="paint3_linear_48543_184825" x1="40.3539" y1="25.3768" x2="35.2525" y2="32.6916" gradientUnits="userSpaceOnUse">
|
|
73
|
+
<stop stop-color="#493474"/>
|
|
74
|
+
<stop offset="1" stop-color="#8C66BA" stop-opacity="0"/>
|
|
75
|
+
</linearGradient>
|
|
76
|
+
<radialGradient id="paint4_radial_48543_184825" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(41.0552 26.504) rotate(-165.772) scale(24.9228 41.9552)">
|
|
77
|
+
<stop offset="0.0584996" stop-color="#50E6FF"/>
|
|
78
|
+
<stop offset="1" stop-color="#436DCD"/>
|
|
79
|
+
</radialGradient>
|
|
80
|
+
<linearGradient id="paint5_linear_48543_184825" x1="16.9758" y1="3.05655" x2="24.4868" y2="3.05655" gradientUnits="userSpaceOnUse">
|
|
81
|
+
<stop stop-color="#2D3F80"/>
|
|
82
|
+
<stop offset="1" stop-color="#436DCD" stop-opacity="0"/>
|
|
83
|
+
</linearGradient>
|
|
84
|
+
<radialGradient id="paint6_radial_48543_184825" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(41.0552 26.504) rotate(-165.772) scale(24.9228 41.9552)">
|
|
85
|
+
<stop offset="0.0584996" stop-color="#50E6FF"/>
|
|
86
|
+
<stop offset="1" stop-color="#436DCD"/>
|
|
87
|
+
</radialGradient>
|
|
88
|
+
<linearGradient id="paint7_linear_48543_184825" x1="16.9758" y1="3.05655" x2="24.4868" y2="3.05655" gradientUnits="userSpaceOnUse">
|
|
89
|
+
<stop stop-color="#2D3F80"/>
|
|
90
|
+
<stop offset="1" stop-color="#436DCD" stop-opacity="0"/>
|
|
91
|
+
</linearGradient>
|
|
92
|
+
</defs>
|
|
93
|
+
</svg>`;
|
|
94
|
+
/** Teams — fetched https://res.cdn.office.net/files/fabric-cdn-prod_20230815.002/assets/brand-icons/product/svg/teams_48x1.svg
|
|
95
|
+
* Verbatim; not one byte of it is ours. */
|
|
96
|
+
const TEAMS = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><defs><linearGradient id="a" x1="5.822" y1="11.568" x2="20.178" y2="36.432" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5a62c3"/><stop offset=".5" stop-color="#4d55bd"/><stop offset="1" stop-color="#3940ab"/></linearGradient></defs><path d="M31.993 19H43.1a1.9 1.9 0 0 1 1.9 1.9v10.117A6.983 6.983 0 0 1 38.017 38h-.033A6.983 6.983 0 0 1 31 31.017V19.993a.993.993 0 0 1 .993-.993z" fill="#5059c9"/><circle cx="39.5" cy="12.5" r="4.5" fill="#5059c9"/><circle cx="25.5" cy="10.5" r="6.5" fill="#7b83eb"/><path d="M34.167 19H15.833A1.88 1.88 0 0 0 14 20.923v11.539A11.279 11.279 0 0 0 25 44a11.279 11.279 0 0 0 11-11.538V20.923A1.88 1.88 0 0 0 34.167 19z" fill="#7b83eb"/><path fill="none" d="M0 0h48v48H0z"/><path d="M26 19v16.17a1.841 1.841 0 0 1-1.14 1.69 1.772 1.772 0 0 1-.69.14h-9.29c-.13-.33-.25-.66-.35-1a12.179 12.179 0 0 1-.53-3.54V20.92A1.877 1.877 0 0 1 15.83 19z" opacity=".1"/><path d="M25 19v17.17a1.772 1.772 0 0 1-.14.69A1.841 1.841 0 0 1 23.17 38h-7.82c-.17-.33-.33-.66-.47-1s-.25-.66-.35-1a12.179 12.179 0 0 1-.53-3.54V20.92A1.877 1.877 0 0 1 15.83 19z" opacity=".2"/><path d="M25 19v15.17A1.844 1.844 0 0 1 23.17 36h-8.64a12.179 12.179 0 0 1-.53-3.54V20.92A1.877 1.877 0 0 1 15.83 19z" opacity=".2"/><path d="M24 19v15.17A1.844 1.844 0 0 1 22.17 36h-7.64a12.179 12.179 0 0 1-.53-3.54V20.92A1.877 1.877 0 0 1 15.83 19z" opacity=".2"/><path d="M26 13.83v3.15c-.17.01-.33.02-.5.02s-.33-.01-.5-.02a5.489 5.489 0 0 1-1-.16A6.5 6.5 0 0 1 19.5 13a5.556 5.556 0 0 1-.32-1h4.99A1.837 1.837 0 0 1 26 13.83z" opacity=".1"/><path d="M25 14.83v2.15a5.489 5.489 0 0 1-1-.16A6.5 6.5 0 0 1 19.5 13h3.67A1.837 1.837 0 0 1 25 14.83z" opacity=".2"/><path d="M25 14.83v2.15a5.489 5.489 0 0 1-1-.16A6.5 6.5 0 0 1 19.5 13h3.67A1.837 1.837 0 0 1 25 14.83z" opacity=".2"/><path d="M24 14.83v1.99A6.5 6.5 0 0 1 19.5 13h2.67A1.837 1.837 0 0 1 24 14.83z" opacity=".2"/><rect x="2" y="13" width="22" height="22" rx="1.833" fill="url(#a)"/><path d="M17.824 19.978h-3.665v9.98h-2.335v-9.98H8.176v-1.936h9.648z" fill="#fff"/></svg>`;
|
|
97
|
+
/** Slack — fetched https://a.slack-edge.com/38f0e7c/marketing/img/nav/logo.svg
|
|
98
|
+
* Verbatim; not one byte of it is ours. */
|
|
99
|
+
const SLACK = `<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
100
|
+
<g clip-path="url(#clip0_4127_70105)">
|
|
101
|
+
<path d="M11.379 33.9993C11.379 37.1358 8.84512 39.6507 5.7276 39.6507C2.61008 39.6507 0.0572205 37.1168 0.0572205 33.9993C0.0572205 30.8817 2.5911 28.3479 5.70862 28.3479H11.36V33.9993H11.379Z" fill="#E01E5A"/>
|
|
102
|
+
<path d="M14.1962 33.9997C14.1962 30.8632 16.7301 28.3483 19.8476 28.3483C22.9651 28.3483 25.499 30.8822 25.499 33.9997V48.1353C25.499 51.2718 22.9651 53.7867 19.8476 53.7867C16.7301 53.7867 14.1962 51.2718 14.1962 48.1353V33.9997Z" fill="#E01E5A"/>
|
|
103
|
+
<path d="M19.8662 11.2673C16.7296 11.2673 14.2148 8.73347 14.2148 5.61594C14.2148 2.49842 16.7486 -0.0354538 19.8662 -0.0354538C22.9837 -0.0354538 25.5175 2.49842 25.5175 5.61594V11.2673H19.8662Z" fill="#36C5F0"/>
|
|
104
|
+
<path d="M19.8682 14.1334C23.0047 14.1334 25.5196 16.6673 25.5196 19.7848C25.5196 22.9023 22.9857 25.4362 19.8682 25.4362H5.67566C2.53916 25.4362 0.0242615 22.9023 0.0242615 19.7848C0.0242615 16.6673 2.55814 14.1334 5.67566 14.1334H19.8682Z" fill="#36C5F0"/>
|
|
105
|
+
<path d="M42.5323 19.7853C42.5323 16.6488 45.0662 14.1339 48.1837 14.1339C51.3012 14.1339 53.8351 16.6678 53.8351 19.7853C53.8351 22.9028 51.3012 25.4367 48.1837 25.4367H42.5323V19.7853Z" fill="#2EB67D"/>
|
|
106
|
+
<path d="M39.7126 19.7934C39.7126 22.9299 37.1787 25.4448 34.0612 25.4448C30.9436 25.4448 28.4098 22.911 28.4098 19.7934V5.61986C28.4098 2.48336 30.9436 -0.0315399 34.0612 -0.0315399C37.1787 -0.0315399 39.7126 2.48336 39.7126 5.61986V19.7934Z" fill="#2EB67D"/>
|
|
107
|
+
<path d="M34.0376 42.482C37.1741 42.482 39.689 45.0158 39.689 48.1334C39.689 51.2509 37.1552 53.7848 34.0376 53.7848C30.9201 53.7848 28.3862 51.2509 28.3862 48.1334V42.482H34.0376Z" fill="#ECB22E"/>
|
|
108
|
+
<path d="M34.0381 39.6507C30.9016 39.6507 28.3867 37.1168 28.3867 33.9993C28.3867 30.8818 30.9206 28.3479 34.0381 28.3479H48.2306C51.3671 28.3479 53.882 30.8818 53.882 33.9993C53.882 37.1168 51.3482 39.6507 48.2306 39.6507H34.0381Z" fill="#ECB22E"/>
|
|
109
|
+
</g>
|
|
110
|
+
<defs>
|
|
111
|
+
<clipPath id="clip0_4127_70105">
|
|
112
|
+
<rect width="54" height="54" fill="white"/>
|
|
113
|
+
</clipPath>
|
|
114
|
+
</defs>
|
|
115
|
+
</svg>`;
|
|
116
|
+
/** The ground for a channel nobody has told us the colour of. */
|
|
117
|
+
const NEUTRAL = 'var(--neutral-600)';
|
|
118
|
+
/**
|
|
119
|
+
* The channels, keyed by what the platform puts in `channel`.
|
|
120
|
+
*
|
|
121
|
+
* Lowercase because that is how it arrives. A key nobody has taught this table
|
|
122
|
+
* still renders — `of()` falls back to the channel's own name and a neutral
|
|
123
|
+
* ground — so a fifth transport appearing on the server needs no release here.
|
|
124
|
+
*/
|
|
125
|
+
const NETWORK = {
|
|
126
|
+
gmail: { name: 'Gmail', hex: `#${siGmail.hex}`, path: siGmail.path },
|
|
127
|
+
icloud: { name: 'iCloud', hex: `#${siIcloud.hex}`, path: siIcloud.path },
|
|
128
|
+
discord: { name: 'Discord', hex: `#${siDiscord.hex}`, path: siDiscord.path },
|
|
129
|
+
telegram: { name: 'Telegram', hex: `#${siTelegram.hex}`, path: siTelegram.path },
|
|
130
|
+
facebook: { name: 'Facebook', hex: `#${siFacebook.hex}`, path: siFacebook.path },
|
|
131
|
+
messenger: { name: 'Messenger', hex: `#${siMessenger.hex}`, path: siMessenger.path },
|
|
132
|
+
instagram: { name: 'Instagram', hex: `#${siInstagram.hex}`, path: siInstagram.path },
|
|
133
|
+
tiktok: { name: 'TikTok', hex: `#${siTiktok.hex}`, path: siTiktok.path },
|
|
134
|
+
whatsapp: { name: 'WhatsApp', hex: `#${siWhatsapp.hex}`, path: siWhatsapp.path },
|
|
135
|
+
signal: { name: 'Signal', hex: `#${siSignal.hex}`, path: siSignal.path },
|
|
136
|
+
reddit: { name: 'Reddit', hex: `#${siReddit.hex}`, path: siReddit.path },
|
|
137
|
+
zoom: { name: 'Zoom', hex: `#${siZoom.hex}`, path: siZoom.path },
|
|
138
|
+
x: { name: 'X', hex: `#${siX.hex}`, path: siX.path },
|
|
139
|
+
outlook: { name: 'Outlook', art: OUTLOOK },
|
|
140
|
+
// Microsoft retired the Hotmail mark when it moved the mail to Outlook, and a
|
|
141
|
+
// hotmail.com address signs in there. The Outlook mark is the true one to
|
|
142
|
+
// show, so this row and Outlook's wear the same artwork on purpose.
|
|
143
|
+
hotmail: { name: 'Hotmail', art: OUTLOOK },
|
|
144
|
+
microsoft365: { name: 'Microsoft 365', art: MICROSOFT365 },
|
|
145
|
+
teams: { name: 'Teams', art: TEAMS },
|
|
146
|
+
slack: { name: 'Slack', art: SLACK },
|
|
147
|
+
calls: { name: 'Calls', glyph: Phone },
|
|
148
|
+
video: { name: 'Video', glyph: Video },
|
|
149
|
+
webchat: { name: 'WebChat', glyph: MessageCircle },
|
|
150
|
+
imap: { name: 'IMAP', glyph: Server },
|
|
151
|
+
// No mark to be had: delisted from simple-icons, and nothing square published
|
|
152
|
+
// anywhere you can fetch. No hex either — see above; the colour is part of
|
|
153
|
+
// what we do not have.
|
|
154
|
+
yahoo: { name: 'Yahoo' },
|
|
155
|
+
linkedin: { name: 'LinkedIn' },
|
|
156
|
+
};
|
|
157
|
+
/** What we know about a channel key, including one nobody taught us — which is
|
|
158
|
+
* a name and nothing else, and lands on the same initial Yahoo does. */
|
|
159
|
+
export function of(channel) {
|
|
160
|
+
const key = (channel || '').trim().toLowerCase();
|
|
161
|
+
return NETWORK[key] ?? { name: channel || 'Network' };
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* WHAT TO CALL THE SPEAKER.
|
|
165
|
+
*
|
|
166
|
+
* NOTHING THAT ARRIVES HERE CARRIES A NAME. `sender` is the network's own id
|
|
167
|
+
* for the person — "U031THJJ7F1" on Slack, a snowflake on Discord, a GUID on
|
|
168
|
+
* Teams — because that is what every adapter puts there; the envelope declares
|
|
169
|
+
* a `Display` beside it (cloud apps/channels/envelope.go) and not one of the
|
|
170
|
+
* five adapters fills it, so no name is stored and none is served.
|
|
171
|
+
* `senderUser` is not the name either: it is the linked account's OIDC `sub`,
|
|
172
|
+
* which IAM mints from a UUID, so it identifies a Hanzo account without saying
|
|
173
|
+
* who holds it — printing it swaps one opaque string for another.
|
|
174
|
+
*
|
|
175
|
+
* An id printed where a name goes READS as a name, and a reader takes
|
|
176
|
+
* "U031THJJ7F1" for what somebody calls themselves. So the id is MARKED as an
|
|
177
|
+
* id — '@' is how every one of these networks writes a handle it has not
|
|
178
|
+
* resolved — and it is kept, because it is the only thing that tells two
|
|
179
|
+
* speakers apart. A room holds messages from many people (useInbox groups by
|
|
180
|
+
* channel and room, never by sender), so dropping it renders every line of a
|
|
181
|
+
* group identically and a reader cannot tell who said what. Only where no id
|
|
182
|
+
* arrived at all is the network the one thing left to say. The day the
|
|
183
|
+
* platform resolves a name, this is where it goes.
|
|
184
|
+
*/
|
|
185
|
+
export const speaker = (channel, sender) => sender ? `@${sender}` : `Someone on ${of(channel).name}`;
|
|
186
|
+
/** A room is named by its own address, not by whoever spoke in it last: the
|
|
187
|
+
* handle for a DM, the network's room id otherwise. */
|
|
188
|
+
export function roomName(room) {
|
|
189
|
+
if (room.roomKind === 'dm')
|
|
190
|
+
return speaker(room.channel, room.last.sender);
|
|
191
|
+
return room.roomId ? `#${room.roomId}` : `A room on ${of(room.channel).name}`;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* One channel's mark, at whatever size the caller has room for.
|
|
195
|
+
*
|
|
196
|
+
* A rounded square rather than a disc, because in the Inbox the face beside it
|
|
197
|
+
* IS a disc and two circles the same size read as two people rather than as a
|
|
198
|
+
* person and where they wrote from. The Channels grid draws the same mark at
|
|
199
|
+
* 46px, which is the size the vendor files were cut for and still the size the
|
|
200
|
+
* simple-icons silhouettes were meant to scale to.
|
|
201
|
+
*/
|
|
202
|
+
export function Network({ channel, size = 16 }) {
|
|
203
|
+
const net = of(channel);
|
|
204
|
+
// A capability wears no ground and no colour. It is not a product, and a tile
|
|
205
|
+
// in a brand colour is the one thing that would say it was.
|
|
206
|
+
if (net.glyph) {
|
|
207
|
+
const Glyph = net.glyph;
|
|
208
|
+
return (_jsx(YStack, { width: size, height: size, items: "center", justify: "center", shrink: 0, "aria-label": net.name, children: _jsx(Glyph, { size: Math.round(size * 0.72), color: "var(--soft, var(--muted-foreground))", strokeWidth: 1.75 }) }));
|
|
209
|
+
}
|
|
210
|
+
// The vendor's file carries its own colours, so it takes the whole footprint
|
|
211
|
+
// and wears no ground of ours. Its own document, so its ids stay its own.
|
|
212
|
+
if (net.art) {
|
|
213
|
+
return (_jsx(View, { render: _jsx("img", { src: `data:image/svg+xml;charset=utf-8,${encodeURIComponent(net.art)}`, alt: net.name, width: size, height: size }), width: size, height: size, display: "block" }));
|
|
214
|
+
}
|
|
215
|
+
return (_jsx(YStack, { width: size, height: size, rounded: Math.round(size / 3), items: "center", justify: "center", shrink: 0, bg: (net.hex ?? NEUTRAL), "aria-label": net.name, children: net.path ? (_jsx("svg", { role: "presentation", width: Math.round(size * 0.62), height: Math.round(size * 0.62), viewBox: "0 0 24 24", fill: "#fff", children: _jsx("path", { d: net.path }) })) : (_jsx(Text, { fontSize: Math.round(size * 0.5), fontWeight: "700", color: "var(--pure-white)", children: net.name.slice(0, 1).toUpperCase() })) }));
|
|
216
|
+
}
|
package/dist/open.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface Open {
|
|
2
|
+
/** The open thread's id, or null for a new one. */
|
|
3
|
+
thread: string | null;
|
|
4
|
+
open: (id: string | null) => void;
|
|
5
|
+
/**
|
|
6
|
+
* The open run's id, or null for none.
|
|
7
|
+
*
|
|
8
|
+
* A second field and not a reused one: a thread is not a session, and one
|
|
9
|
+
* `selected` holding either would be a string whose meaning depends on which
|
|
10
|
+
* route is mounted — the kind of value that reads fine and resolves wrong.
|
|
11
|
+
*/
|
|
12
|
+
session: string | null;
|
|
13
|
+
openSession: (id: string | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The open inbox room's key ("<channel> <roomId>"), or null for none.
|
|
16
|
+
*
|
|
17
|
+
* A third field for the same reason there is a second: a room arrives over
|
|
18
|
+
* Slack or iMessage and is keyed by its transport, so it is not a thread id
|
|
19
|
+
* and cannot share the field with one. `useInbox` derives rooms from the page
|
|
20
|
+
* it holds, so this key is only meaningful against that page.
|
|
21
|
+
*/
|
|
22
|
+
room: string | null;
|
|
23
|
+
openRoom: (key: string | null) => void;
|
|
24
|
+
/** The open drive bucket, or null for the list of them. */
|
|
25
|
+
bucket: string | null;
|
|
26
|
+
openBucket: (name: string | null) => void;
|
|
27
|
+
/** The Settings pane a surface has asked for, or null. */
|
|
28
|
+
settings: string | null;
|
|
29
|
+
showSettings: (pane: string | null) => void;
|
|
30
|
+
/** What is open beside the room, by name, or null for nothing. */
|
|
31
|
+
aside: string | null;
|
|
32
|
+
showAside: (pane: string | null) => void;
|
|
33
|
+
/** Who the chat is with, in the order they were pressed; empty for the plain model. */
|
|
34
|
+
agents: string[];
|
|
35
|
+
/** The first of them, for a surface that addresses one. */
|
|
36
|
+
agent: string | null;
|
|
37
|
+
/** Adds a character to the open conversation, or lets one out who is already in it; null empties it. */
|
|
38
|
+
openAgent: (name: string | null) => void;
|
|
39
|
+
/** The room a stored conversation names, set as it is read back; the conversation stays open. */
|
|
40
|
+
seat: (names: string[]) => void;
|
|
41
|
+
/** The room outright: a roster row opens a chat with that one character. */
|
|
42
|
+
withAgents: (names: string[]) => void;
|
|
43
|
+
/**
|
|
44
|
+
* How many times the room has been emptied.
|
|
45
|
+
*
|
|
46
|
+
* A COUNTER AND NOT A FLAG, because the fact is an EVENT and the state it
|
|
47
|
+
* asks for is one the room may already be in. "New chat" nulls the thread,
|
|
48
|
+
* and on a room whose thread is already null that is not a change — so the
|
|
49
|
+
* pane's effect never re-ran and the button did nothing at all. A number that
|
|
50
|
+
* only ever goes up is the smallest thing two components can agree happened.
|
|
51
|
+
*/
|
|
52
|
+
emptied: number;
|
|
53
|
+
empty: () => void;
|
|
54
|
+
}
|
|
55
|
+
/** Opens a thread, or empties the room with null. */
|
|
56
|
+
export declare function openThread(id: string | null): void;
|
|
57
|
+
/** Opens a run, or empties the pane with null. */
|
|
58
|
+
export declare function openSession(id: string | null): void;
|
|
59
|
+
/** Opens an inbox room, or empties the pane with null. */
|
|
60
|
+
export declare function openRoom(key: string | null): void;
|
|
61
|
+
/** Opens a bucket, or returns to the list of them with null. */
|
|
62
|
+
export declare function openBucket(name: string | null): void;
|
|
63
|
+
/**
|
|
64
|
+
* Adds a character to the open conversation, or lets one out who is already in
|
|
65
|
+
* it; null empties the room. The conversation stays open: the room's system
|
|
66
|
+
* turn changes for the turns that follow, and Chat records the new room with
|
|
67
|
+
* the thread (`roster` in cast.tsx).
|
|
68
|
+
*/
|
|
69
|
+
export declare function openAgent(name: string | null): void;
|
|
70
|
+
/** The room a stored conversation names, as it is read back. The thread stays open. */
|
|
71
|
+
export declare function seat(names: string[]): void;
|
|
72
|
+
/** The room outright — a roster row opens a chat with that one character. */
|
|
73
|
+
export declare function withAgents(names: string[]): void;
|
|
74
|
+
/** Opens one pane beside the room, or shuts the column with null. */
|
|
75
|
+
export declare function showAside(pane: string | null): void;
|
|
76
|
+
/** Asks the shell to open Settings on one pane, or closes it with null. */
|
|
77
|
+
export declare function showSettings(pane: string | null): void;
|
|
78
|
+
/** Empties the room: no thread, and a fresh count so the pane hears it even
|
|
79
|
+
* when there was no thread to leave. */
|
|
80
|
+
export declare function empty(): void;
|
|
81
|
+
export declare function useOpen(): Open;
|
package/dist/open.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// What the rail and the pane both need to know: which conversation is open, and
|
|
3
|
+
// which run.
|
|
4
|
+
//
|
|
5
|
+
// THIS LIVES OUTSIDE REACT, and that is the whole point. The selection used to
|
|
6
|
+
// be `useState` inside `Workspace`, which the router MOUNTS — so `router.push`
|
|
7
|
+
// between two rooms unmounted the component holding the selection and the
|
|
8
|
+
// reader arrived in an empty room. "One level up, where both can reach it" was
|
|
9
|
+
// right about the rail and the pane and one level too low for the router: a
|
|
10
|
+
// value that must outlive a route change cannot be stored inside a component
|
|
11
|
+
// the route change destroys.
|
|
12
|
+
//
|
|
13
|
+
// A module is above every component, so the router cannot reach it. It resets
|
|
14
|
+
// on a real page load, which is correct — a fresh document is a fresh room.
|
|
15
|
+
import { useSyncExternalStore } from 'react';
|
|
16
|
+
/** The prerender's selection, and the initial one. A stable reference: React
|
|
17
|
+
* compares snapshots by identity, so returning a fresh object every read is an
|
|
18
|
+
* infinite render rather than an empty room. */
|
|
19
|
+
const EMPTY = {
|
|
20
|
+
thread: null,
|
|
21
|
+
session: null,
|
|
22
|
+
room: null,
|
|
23
|
+
bucket: null,
|
|
24
|
+
emptied: 0,
|
|
25
|
+
settings: null,
|
|
26
|
+
agents: [],
|
|
27
|
+
aside: null,
|
|
28
|
+
};
|
|
29
|
+
let selection = EMPTY;
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
try {
|
|
32
|
+
const params = new URLSearchParams(window.location.search);
|
|
33
|
+
const t = params.get('thread');
|
|
34
|
+
const s = params.get('session');
|
|
35
|
+
const a = params.get('agent');
|
|
36
|
+
const asideParam = params.get('aside');
|
|
37
|
+
if (t || s || a || asideParam) {
|
|
38
|
+
selection = {
|
|
39
|
+
...EMPTY,
|
|
40
|
+
thread: t ?? EMPTY.thread,
|
|
41
|
+
session: s ?? EMPTY.session,
|
|
42
|
+
agents: a ? a.split(',').map((one) => one.trim()).filter(Boolean) : EMPTY.agents,
|
|
43
|
+
aside: asideParam ?? EMPTY.aside,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch { }
|
|
48
|
+
}
|
|
49
|
+
const listeners = new Set();
|
|
50
|
+
function subscribe(listener) {
|
|
51
|
+
listeners.add(listener);
|
|
52
|
+
return () => {
|
|
53
|
+
listeners.delete(listener);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const read = () => selection;
|
|
57
|
+
const readOnServer = () => EMPTY;
|
|
58
|
+
function set(next) {
|
|
59
|
+
if (next.thread === selection.thread &&
|
|
60
|
+
next.session === selection.session &&
|
|
61
|
+
next.room === selection.room &&
|
|
62
|
+
next.bucket === selection.bucket &&
|
|
63
|
+
next.emptied === selection.emptied &&
|
|
64
|
+
next.settings === selection.settings &&
|
|
65
|
+
next.agents.join('\n') === selection.agents.join('\n') &&
|
|
66
|
+
next.aside === selection.aside) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
selection = next;
|
|
70
|
+
for (const listener of listeners)
|
|
71
|
+
listener();
|
|
72
|
+
}
|
|
73
|
+
/** Opens a thread, or empties the room with null. */
|
|
74
|
+
export function openThread(id) {
|
|
75
|
+
set({ ...selection, thread: id });
|
|
76
|
+
}
|
|
77
|
+
/** Opens a run, or empties the pane with null. */
|
|
78
|
+
export function openSession(id) {
|
|
79
|
+
set({ ...selection, session: id });
|
|
80
|
+
}
|
|
81
|
+
/** Opens an inbox room, or empties the pane with null. */
|
|
82
|
+
export function openRoom(key) {
|
|
83
|
+
set({ ...selection, room: key });
|
|
84
|
+
}
|
|
85
|
+
/** Opens a bucket, or returns to the list of them with null. */
|
|
86
|
+
export function openBucket(name) {
|
|
87
|
+
set({ ...selection, bucket: name });
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Adds a character to the open conversation, or lets one out who is already in
|
|
91
|
+
* it; null empties the room. The conversation stays open: the room's system
|
|
92
|
+
* turn changes for the turns that follow, and Chat records the new room with
|
|
93
|
+
* the thread (`roster` in cast.tsx).
|
|
94
|
+
*/
|
|
95
|
+
export function openAgent(name) {
|
|
96
|
+
const agents = name === null
|
|
97
|
+
? []
|
|
98
|
+
: selection.agents.some((one) => same(one, name))
|
|
99
|
+
? selection.agents.filter((one) => !same(one, name))
|
|
100
|
+
: [...selection.agents, name];
|
|
101
|
+
set({ ...selection, agents });
|
|
102
|
+
}
|
|
103
|
+
/** The room a stored conversation names, as it is read back. The thread stays open. */
|
|
104
|
+
export function seat(names) {
|
|
105
|
+
set({ ...selection, agents: names.filter((one, i) => names.findIndex((other) => same(other, one)) === i) });
|
|
106
|
+
}
|
|
107
|
+
/** Two handles name one character when they differ only in case ("Des" and "des"). */
|
|
108
|
+
const same = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
109
|
+
/** The room outright — a roster row opens a chat with that one character. */
|
|
110
|
+
export function withAgents(names) {
|
|
111
|
+
set({ ...selection, agents: [...new Set(names)], thread: null, emptied: selection.emptied + 1 });
|
|
112
|
+
}
|
|
113
|
+
/** Opens one pane beside the room, or shuts the column with null. */
|
|
114
|
+
export function showAside(pane) {
|
|
115
|
+
set({ ...selection, aside: pane });
|
|
116
|
+
}
|
|
117
|
+
/** Asks the shell to open Settings on one pane, or closes it with null. */
|
|
118
|
+
export function showSettings(pane) {
|
|
119
|
+
set({ ...selection, settings: pane });
|
|
120
|
+
}
|
|
121
|
+
/** Empties the room: no thread, and a fresh count so the pane hears it even
|
|
122
|
+
* when there was no thread to leave. */
|
|
123
|
+
export function empty() {
|
|
124
|
+
set({ ...selection, thread: null, emptied: selection.emptied + 1 });
|
|
125
|
+
}
|
|
126
|
+
export function useOpen() {
|
|
127
|
+
const current = useSyncExternalStore(subscribe, read, readOnServer);
|
|
128
|
+
return {
|
|
129
|
+
thread: current.thread,
|
|
130
|
+
open: openThread,
|
|
131
|
+
session: current.session,
|
|
132
|
+
openSession,
|
|
133
|
+
room: current.room,
|
|
134
|
+
openRoom,
|
|
135
|
+
bucket: current.bucket,
|
|
136
|
+
openBucket,
|
|
137
|
+
settings: current.settings,
|
|
138
|
+
showSettings,
|
|
139
|
+
aside: current.aside,
|
|
140
|
+
showAside,
|
|
141
|
+
agents: current.agents,
|
|
142
|
+
agent: current.agents[0] ?? null,
|
|
143
|
+
openAgent,
|
|
144
|
+
seat,
|
|
145
|
+
withAgents,
|
|
146
|
+
emptied: current.emptied,
|
|
147
|
+
empty,
|
|
148
|
+
};
|
|
149
|
+
}
|
package/dist/pane.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** One open tab in the pane's browser. */
|
|
2
|
+
export interface Leaf {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
/** What the strip shows: host and path, which is all we can read across an
|
|
6
|
+
* origin we do not own. A frame's real title is not ours to ask for. */
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A file the reader put into this conversation from their own disk.
|
|
11
|
+
*
|
|
12
|
+
* `href` is an object URL and is the reason this is never written down — see
|
|
13
|
+
* the note at the top. Everything else is read off the `File` itself, so a name
|
|
14
|
+
* and a size here are the file system's, never a guess.
|
|
15
|
+
*/
|
|
16
|
+
export interface Held {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
size: number;
|
|
20
|
+
/** The browser's type for it, or '' where it could not tell from the name. */
|
|
21
|
+
type: string;
|
|
22
|
+
href: string;
|
|
23
|
+
}
|
|
24
|
+
/** Everything the column beside one conversation is holding. */
|
|
25
|
+
export interface Pane {
|
|
26
|
+
tabs: Leaf[];
|
|
27
|
+
/** The chosen tab, or null when this conversation has opened none. */
|
|
28
|
+
at: string | null;
|
|
29
|
+
/** Whether the summary column stands beside the browser. */
|
|
30
|
+
pinned: boolean;
|
|
31
|
+
held: Held[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The conversation a pane belongs to.
|
|
35
|
+
*
|
|
36
|
+
* THREE FIELDS AND NOT ONE, because `open.ts` already refuses to conflate them:
|
|
37
|
+
* an inbox room arrives over a transport and is keyed by it, a thread is a
|
|
38
|
+
* conversation the org has recorded, and an agent is who you are talking to
|
|
39
|
+
* before a thread exists. Prefixed so a room called `x` and a thread called `x`
|
|
40
|
+
* cannot land on one entry.
|
|
41
|
+
*
|
|
42
|
+
* `new` is a real answer and not a fallback: a room nobody has spoken in yet is
|
|
43
|
+
* somewhere a reader can open tabs, and they should still be there when the
|
|
44
|
+
* first turn mints a thread. It is the ONE key that several conversations pass
|
|
45
|
+
* through, which is the honest cost of not having an id to key on yet.
|
|
46
|
+
*/
|
|
47
|
+
export declare function channel(open: {
|
|
48
|
+
room: string | null;
|
|
49
|
+
thread: string | null;
|
|
50
|
+
agent: string | null;
|
|
51
|
+
}): string;
|
|
52
|
+
/** The host and path of an address, which is as much as a title can honestly be. */
|
|
53
|
+
export declare function name(url: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* An address as typed, made into one that can be opened.
|
|
56
|
+
*
|
|
57
|
+
* A bare host is `https`, because that is the web now; a loopback name is
|
|
58
|
+
* `http`, because nothing is listening on 443 of a laptop and offering a
|
|
59
|
+
* reader a URL that cannot connect is worse than guessing.
|
|
60
|
+
*/
|
|
61
|
+
export declare function address(typed: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Opens an address in this conversation, and chooses it.
|
|
64
|
+
*
|
|
65
|
+
* `called` is for the things that HAVE a name of their own — an answer's
|
|
66
|
+
* `index.html`, a file off the reader's disk — because their address is a blob
|
|
67
|
+
* and `name()` can read nothing useful out of one. Without it the host and path
|
|
68
|
+
* are the honest title.
|
|
69
|
+
*/
|
|
70
|
+
export declare function openTab(key: string, url: string, called?: string): void;
|
|
71
|
+
/** Points an already-open tab somewhere else. */
|
|
72
|
+
export declare function goTab(key: string, id: string, url: string): void;
|
|
73
|
+
/** Chooses an open tab. */
|
|
74
|
+
export declare function pickTab(key: string, id: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Shuts a tab.
|
|
77
|
+
*
|
|
78
|
+
* THE NEIGHBOUR IS THE ONE TO ITS RIGHT, falling back to its left — what every
|
|
79
|
+
* browser does, and the only choice that does not send the reader somewhere
|
|
80
|
+
* they were not looking. Closing the last tab leaves none chosen rather than
|
|
81
|
+
* refusing, because a pane with no tabs is a state this panel draws.
|
|
82
|
+
*/
|
|
83
|
+
export declare function shutTab(key: string, id: string): void;
|
|
84
|
+
/** Shows or hides the summary column beside this conversation's browser. */
|
|
85
|
+
export declare function pin(key: string, on: boolean): void;
|
|
86
|
+
/** Takes files from the reader's disk into this conversation. */
|
|
87
|
+
export declare function hold(key: string, files: File[]): void;
|
|
88
|
+
/** Lets go of a file, and of the handle the browser minted for it. */
|
|
89
|
+
export declare function drop(key: string, id: string): void;
|
|
90
|
+
/** This conversation's pane, and it alone — a change to another redraws nothing
|
|
91
|
+
* here, because the snapshot returned is that key's own object. */
|
|
92
|
+
export declare function usePane(key: string): Pane;
|