@copilotz/directory 1.0.0-rc.80 → 1.0.0-rc.81

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.
Files changed (68) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +9 -68
  3. package/contract.d.ts +1 -8
  4. package/contract.js +1 -8
  5. package/mod.d.ts +2 -67
  6. package/mod.js +2 -122
  7. package/package.json +9 -35
  8. package/web.d.ts +2 -36
  9. package/web.js +2 -57
  10. package/WORDS.md +0 -198
  11. package/actions/code.d.ts +0 -4
  12. package/actions/code.js +0 -135
  13. package/actions/host.d.ts +0 -2
  14. package/actions/host.js +0 -55
  15. package/actions/invite.d.ts +0 -5
  16. package/actions/invite.js +0 -129
  17. package/actions/org.d.ts +0 -10
  18. package/actions/org.js +0 -273
  19. package/collections/credit-code.d.ts +0 -107
  20. package/collections/credit-code.js +0 -28
  21. package/collections/invite.d.ts +0 -74
  22. package/collections/invite.js +0 -20
  23. package/collections/membership.d.ts +0 -65
  24. package/collections/membership.js +0 -22
  25. package/collections/org-host.d.ts +0 -55
  26. package/collections/org-host.js +0 -30
  27. package/collections/org.d.ts +0 -134
  28. package/collections/org.js +0 -58
  29. package/collections/staff.d.ts +0 -35
  30. package/collections/staff.js +0 -12
  31. package/routes/console.d.ts +0 -26
  32. package/routes/console.js +0 -129
  33. package/routes/enter.d.ts +0 -18
  34. package/routes/enter.js +0 -47
  35. package/routes/forward.d.ts +0 -35
  36. package/routes/forward.js +0 -119
  37. package/routes/orgs.d.ts +0 -25
  38. package/routes/orgs.js +0 -113
  39. package/routes/signout.d.ts +0 -11
  40. package/routes/signout.js +0 -36
  41. package/shared/enter.d.ts +0 -36
  42. package/shared/enter.js +0 -82
  43. package/shared/http.d.ts +0 -42
  44. package/shared/http.js +0 -77
  45. package/shared/member.d.ts +0 -21
  46. package/shared/member.js +0 -73
  47. package/shared/settings.d.ts +0 -53
  48. package/shared/settings.js +0 -16
  49. package/shared/state.d.ts +0 -74
  50. package/shared/state.js +0 -101
  51. package/views/web/codes.d.ts +0 -27
  52. package/views/web/codes.js +0 -50
  53. package/views/web/console-codes.d.ts +0 -37
  54. package/views/web/console-codes.js +0 -166
  55. package/views/web/console.d.ts +0 -37
  56. package/views/web/console.js +0 -224
  57. package/views/web/lists.d.ts +0 -48
  58. package/views/web/lists.js +0 -42
  59. package/views/web/org.d.ts +0 -12
  60. package/views/web/org.js +0 -62
  61. package/views/web/orgs.d.ts +0 -148
  62. package/views/web/orgs.js +0 -253
  63. package/views/web/style.d.ts +0 -6
  64. package/views/web/style.js +0 -197
  65. package/views/web/switcher.d.ts +0 -81
  66. package/views/web/switcher.js +0 -367
  67. package/views/web/words.d.ts +0 -10
  68. package/views/web/words.js +0 -206
package/views/web/orgs.js DELETED
@@ -1,253 +0,0 @@
1
- /**
2
- * The directory's browser half: what the directory's routes say of the orgs
3
- * the signed-in person belongs to, when the app serves many behind one
4
- * address, and going between them. A server that serves one org has none of
5
- * this, and `useOrgs()` says so (`none`): the switcher then shows nothing.
6
- * The directory's front end (web.tsx: the switcher, the org page, staff's
7
- * console) is built on it; other plugins' front ends import it through the
8
- * directory's contract.ts.
9
- *
10
- * - `useOrgs()`: who's signed in, the org they're in, their orgs (the last
11
- * entered first), the invitations waiting for them, and whether they're
12
- * platform staff; `refreshOrgs()` asks again, as does the page hearing that
13
- * an org changed (the web shell's `orgsChanged()`, after renaming one).
14
- * - `enterOrg`, `createOrg`, `answerOrgInvite`: each goes into an org (the
15
- * directory hands the person to it, which sets its session), and the page
16
- * starts over at that org's home, after a short transition
17
- * (`useSwitching()`, which the shell shows).
18
- * - Staff's console: `consoleOrgs()`, `updateOrg(id, { suspended?, name? })`,
19
- * `moveOrg(id, schema)`, `exportOrgUrl(id)` (its rows, as SQL, to save)
20
- * and `deleteOrg(id, name)` (its exact name confirms it). An app that
21
- * doesn't do one says so (`unsupported`). Gift codes: `giftCodes()`,
22
- * `createGiftCode(...)` (the code itself, this once) and `revokeGiftCode(id)`.
23
- *
24
- * It's the page's own HTTP, same origin, with the cookies the directory set
25
- * (see routes/orgs.ts and routes/console.ts).
26
- */
27
- import { useSyncExternalStore } from "react";
28
- import { onOrgsChanged } from "copilotz/plugins/interfaces/contract";
29
- import { sayOrg } from "./words.js";
30
- let state = { status: "loading" };
31
- let asked;
32
- const listeners = new Set();
33
- const set = (next) => {
34
- state = next;
35
- for (const listener of listeners)
36
- listener();
37
- };
38
- const store = {
39
- subscribe(listener) {
40
- listeners.add(listener);
41
- return () => listeners.delete(listener);
42
- },
43
- get: () => state,
44
- };
45
- /** Asks the server, once (again with `refreshOrgs`); a server that serves one org answers none. */
46
- export function loadOrgs() {
47
- return asked ??= fetch("/orgs", { headers: { accept: "application/json" } }).then(async (response) => {
48
- const json = response.headers.get("content-type")?.includes("application/json");
49
- // One org: the server answers its page (or nothing) where many would answer JSON.
50
- if (!response.ok || !json) {
51
- set({ status: "none" });
52
- return state;
53
- }
54
- const value = await response.json();
55
- // Staff in an org of someone else's: its name is the console's.
56
- const here = currentOrg(value) ??
57
- (value.staff && value.current
58
- ? (await consoleOrgs().catch(() => [])).find((o) => o.id === value.current)
59
- : undefined);
60
- const next = {
61
- status: "ready",
62
- value,
63
- ...(here
64
- ? {
65
- here: {
66
- id: here.id,
67
- name: here.name,
68
- kind: here.kind,
69
- ...(here.suspended ? { suspended: true } : {}),
70
- },
71
- }
72
- : {}),
73
- };
74
- set(next);
75
- return next;
76
- }, () => {
77
- asked = undefined;
78
- const next = { status: "none" };
79
- set(next);
80
- return next;
81
- });
82
- }
83
- /** Asks the server again: after renaming an org, or answering an invitation. */
84
- export function refreshOrgs() {
85
- asked = undefined;
86
- return loadOrgs();
87
- }
88
- // An org changed elsewhere in the page (its owners renamed it in spaces' About): ask again.
89
- onOrgsChanged(() => void refreshOrgs());
90
- /** The orgs, as they stand, kept current. */
91
- export function useOrgs() {
92
- const now = useSyncExternalStore(store.subscribe, store.get, store.get);
93
- if (now.status === "loading" && typeof fetch === "function")
94
- void loadOrgs();
95
- return now;
96
- }
97
- /** The org the session is in: one of theirs, or (for staff) one they've gone into. */
98
- export const currentOrg = (orgs) => orgs.orgs.find((o) => o.id === orgs.current);
99
- /** Whether they're in an org as platform staff, not as one of its people. */
100
- export const asStaff = (orgs) => orgs.asStaff === true;
101
- /** What an org is called where it shows: everyone's own is "Personal". */
102
- export const orgName = (org) => org.kind === "personal" ? sayOrg("personalOrg") : org.name;
103
- /** What a refusal's status means: not let (403), not done by this app (501), or not so (else). */
104
- const codeOf = (status) => status === 403 ? "forbidden" : status === 501 ? "unsupported" : "invalid";
105
- const post = async (path, body) => {
106
- const response = await fetch(path, {
107
- method: "POST",
108
- headers: { "content-type": "application/json" },
109
- body: JSON.stringify(body),
110
- });
111
- const answer = await response.json().catch(() => ({}));
112
- if (!response.ok) {
113
- throw Object.assign(new Error(answer.error ?? response.statusText), {
114
- code: codeOf(response.status),
115
- });
116
- }
117
- return answer;
118
- };
119
- let switching;
120
- const switchers = new Set();
121
- const switchingTo = (next) => {
122
- switching = next;
123
- for (const listener of switchers)
124
- listener();
125
- };
126
- /** The org the page is going into, while it does (the shell shows a short transition). */
127
- export function useSwitching() {
128
- return useSyncExternalStore((listener) => {
129
- switchers.add(listener);
130
- return () => switchers.delete(listener);
131
- }, () => switching, () => undefined);
132
- }
133
- /** Where the page says, once it has started over, which org it came into. */
134
- const ARRIVED = "copilotz-org-arrived";
135
- /** Shows the transition, does `move`, then starts over at the org's home; failing, it stays. */
136
- async function into(to, move) {
137
- switchingTo(to);
138
- const started = Date.now();
139
- try {
140
- const done = await move();
141
- // Long enough to read where you're going; never long enough to wait on.
142
- await new Promise((r) => setTimeout(r, Math.max(0, 420 - (Date.now() - started))));
143
- try {
144
- sessionStorage.setItem(ARRIVED, JSON.stringify(to));
145
- }
146
- catch { /* private mode: no welcome */ }
147
- location.assign("/");
148
- return done;
149
- }
150
- catch (error) {
151
- switchingTo(undefined);
152
- throw error;
153
- }
154
- }
155
- /** Goes into an org (one of theirs; any, for staff), and starts over at its home. */
156
- export function enterOrg(org, staff = false) {
157
- return into({ id: org.id, name: org.name, kind: org.kind, ...(staff ? { staff: true } : {}) }, () => post("/orgs/enter", { org: org.id, ...(staff ? { staff: true } : {}) })).then(() => { });
158
- }
159
- /** Makes a team org, its maker its owner, and goes into it. */
160
- export function createOrg(name) {
161
- return into({ name, kind: "team" }, () => post("/orgs", { name })).then(() => { });
162
- }
163
- /** Accepts an invitation (and goes into its org) or declines it. */
164
- export async function answerOrgInvite(invite, accept) {
165
- if (!accept) {
166
- await post("/orgs/invites/answer", { invite: invite.id, accept: false });
167
- await refreshOrgs();
168
- return;
169
- }
170
- await into({ id: invite.org, name: invite.name, kind: "team" }, () => post("/orgs/invites/answer", { invite: invite.id, accept: true }));
171
- }
172
- /**
173
- * Where many orgs are served, someone still signed in whose session in this
174
- * org ended (they were taken out of it, or it was suspended) goes into
175
- * another of theirs instead of signing in again: the one they were in
176
- * before, or their own. True when the page is starting over there; never
177
- * twice in a row, so a page that can't get in shows sign-in.
178
- */
179
- export async function reenter() {
180
- const KEY = "copilotz-org-reentered";
181
- try {
182
- if (Date.now() - Number(sessionStorage.getItem(KEY) ?? 0) < 15_000)
183
- return false;
184
- const found = await loadOrgs();
185
- if (found.status !== "ready")
186
- return false;
187
- const next = found.value.orgs.find((o) => o.id !== found.value.current && !o.suspended);
188
- if (!next)
189
- return false;
190
- sessionStorage.setItem(KEY, String(Date.now()));
191
- await post("/orgs/enter", { org: next.id });
192
- sessionStorage.setItem(ARRIVED, JSON.stringify({ id: next.id, name: next.name, kind: next.kind, moved: true }));
193
- location.assign("/");
194
- return true;
195
- }
196
- catch {
197
- return false;
198
- }
199
- }
200
- /** The org the page just came into, once (its welcome), then forgotten. */
201
- export function arrived() {
202
- try {
203
- const kept = sessionStorage.getItem(ARRIVED);
204
- sessionStorage.removeItem(ARRIVED);
205
- return kept ? JSON.parse(kept) : undefined;
206
- }
207
- catch {
208
- return undefined;
209
- }
210
- }
211
- /** Every org, for staff's console. */
212
- export async function consoleOrgs() {
213
- const response = await fetch("/console/orgs", { headers: { accept: "application/json" } });
214
- const answer = await response.json().catch(() => ({}));
215
- if (!response.ok) {
216
- throw Object.assign(new Error(answer.error ?? response.statusText), {
217
- code: codeOf(response.status),
218
- });
219
- }
220
- return answer.orgs;
221
- }
222
- /** Suspends an org or lifts it, or renames it: staff's. */
223
- export async function updateOrg(org, change) {
224
- await post(`/console/orgs/${encodeURIComponent(org)}`, change);
225
- }
226
- /** Moves an org's rows to another schema (for a big org: one of its own). */
227
- export async function moveOrg(org, schema) {
228
- const { placement } = await post(`/console/orgs/${encodeURIComponent(org)}/move`, { schema });
229
- return placement;
230
- }
231
- /** Where an org's rows download, as SQL. */
232
- export const exportOrgUrl = (org) => `/console/orgs/${encodeURIComponent(org)}/export`;
233
- /** Deletes an org for good: `name`, its exact name, confirms it. */
234
- export async function deleteOrg(org, name) {
235
- await post(`/console/orgs/${encodeURIComponent(org)}/delete`, { confirm: name });
236
- }
237
- /** Gift codes, newest first, for staff's console. */
238
- export async function giftCodes() {
239
- const response = await fetch("/console/codes", { headers: { accept: "application/json" } });
240
- const answer = await response.json().catch(() => ({}));
241
- if (!response.ok) {
242
- throw Object.assign(new Error(answer.error ?? response.statusText), {
243
- code: codeOf(response.status),
244
- });
245
- }
246
- return answer.codes;
247
- }
248
- /** Makes a gift code: the answer's `code` is the only time it's ever shown. */
249
- export const createGiftCode = (code) => post("/console/codes", code);
250
- /** Takes back a gift code nobody has claimed. */
251
- export async function revokeGiftCode(id) {
252
- await post("/console/codes/revoke", { id });
253
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * The directory's front end, its layout: the switcher and what it opens, making an org,
3
- * going between orgs, staff's line along the top, the org's page and staff's console. Only
4
- * layout, on the theme's variables.
5
- */
6
- export declare const STYLE = "\n/* The switcher, at the top of the sidebar beside the app's mark */\n.copilotz-org { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px;\n padding: 6px 8px 6px 7px; border: 1px solid transparent; border-radius: var(--radius-lg); background: transparent;\n color: var(--sidebar-foreground); text-align: left; cursor: pointer; transition: background-color .12s, border-color .12s; }\n.copilotz-org:hover, .copilotz-org[aria-expanded=true] { background: var(--sidebar-accent); }\n.copilotz-org[aria-expanded=true] { border-color: var(--sidebar-border); }\n.copilotz-org-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }\n.copilotz-org-name { overflow: hidden; font-family: var(--font-display); font-size: 14.5px; font-weight: 650;\n letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }\n.copilotz-org-sub { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden;\n color: var(--muted-foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }\n.copilotz-org[data-staff] .copilotz-org-sub { color: var(--warning-text); font-weight: 620; }\n.copilotz-org[data-staff] > .copilotz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }\n.copilotz-org-rail[data-staff] > .copilotz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }\n.copilotz-org-chevron { flex: none; color: var(--muted-foreground); }\n.copilotz-org-dot { flex: none; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px;\n border-radius: var(--radius-full); background: var(--primary); color: var(--primary-foreground); font-size: 11px;\n font-weight: 700; font-variant-numeric: tabular-nums; }\n\n/* What the switcher opens */\n.copilotz-orgs-box { display: grid; gap: 2px; }\n.copilotz-orgs-who { margin: 4px 8px 6px; overflow: hidden; color: var(--muted-foreground); font-size: 12.5px;\n text-overflow: ellipsis; white-space: nowrap; }\n.copilotz-orgs-who b { color: var(--foreground); font-weight: 600; }\n.copilotz-orgs-staff { display: flex; align-items: flex-start; gap: 8px; margin: 0 2px 6px; padding: 9px 10px;\n border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft);\n color: var(--warning-text); font-size: 12.5px; line-height: 1.45; }\n.copilotz-orgs-staff > .copilotz-icon { margin-top: 1px; }\n.copilotz-orgs-staff b { font-weight: 650; }\n.copilotz-orgs-staff-back { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: inherit;\n font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }\n.copilotz-orgs-list, .copilotz-orgs-invites ul { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; }\n.copilotz-orgs-row, .copilotz-orgs-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;\n padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit;\n font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; outline: none; }\n.copilotz-orgs-row:hover, .copilotz-orgs-row:focus-visible, .copilotz-orgs-action:hover,\n.copilotz-orgs-action:focus-visible { background: var(--accent); color: var(--accent-foreground); }\n.copilotz-orgs-row:focus-visible, .copilotz-orgs-action:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }\n.copilotz-orgs-row[aria-current] { background: color-mix(in oklab, var(--primary-soft) 60%, transparent); }\n.copilotz-orgs-row[aria-disabled] { opacity: .62; cursor: not-allowed; }\n.copilotz-orgs-row-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }\n.copilotz-orgs-row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.copilotz-orgs-row-sub { color: var(--muted-foreground); font-size: 12px; }\n.copilotz-orgs-row-error { color: var(--destructive-text); font-size: 12px; white-space: normal; }\n.copilotz-orgs-check { flex: none; color: var(--primary-text); }\n.copilotz-orgs-invites { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }\n.copilotz-orgs-invites h3 { display: flex; align-items: center; gap: 6px; margin: 0 8px 8px; color: var(--muted-foreground);\n font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }\n.copilotz-orgs-invites ul { gap: 6px; }\n.copilotz-orgs-invite { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0 2px; padding: 10px;\n border: 1px solid var(--primary-border); border-radius: var(--radius-lg);\n background: color-mix(in oklab, var(--primary-soft) 45%, var(--popover)); }\n.copilotz-orgs-invite-text { display: grid; gap: 1px; min-width: 0; }\n.copilotz-orgs-invite-name { margin: 0; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }\n.copilotz-orgs-invite-meta { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.copilotz-orgs-invite-meta .copilotz-time { font-size: 12.5px; }\n.copilotz-orgs-invite-answers { display: flex; gap: 6px; margin-top: 8px; }\n.copilotz-orgs-actions { display: grid; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }\n.copilotz-orgs-action { min-height: 38px; color: var(--secondary-foreground); }\n.copilotz-orgs-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted-foreground); }\n.copilotz-orgs-icon-new { border: 1px dashed var(--input); border-radius: var(--radius-sm); }\n\n/* Making one */\n.copilotz-new-org { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }\n.copilotz-new-org-preview { padding-top: 25px; }\n\n/* Going into another org: over everything, until it's there; and a word once it is */\n.copilotz-switching { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;\n border: 0; background: transparent; color: var(--foreground); outline: none; }\n.copilotz-switching::backdrop { background: color-mix(in oklab, var(--background) 84%, transparent);\n -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: copilotz-switching .22s ease-out; }\n.copilotz-switching[open] { display: grid; place-items: center; animation: copilotz-switching .22s ease-out; }\n.copilotz-switching-box { display: grid; justify-items: center; text-align: center;\n animation: copilotz-switching-in .36s cubic-bezier(.2, .8, .2, 1); }\n.copilotz-switching-box .copilotz-avatar { box-shadow: var(--shadow-md); }\n.copilotz-switching-personal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-full);\n background: var(--primary-soft); color: var(--primary-text); }\n.copilotz-switching-label { margin: 18px 0 2px; color: var(--muted-foreground); font-size: 13px; }\n.copilotz-switching-name { margin: 0 0 18px; max-width: min(520px, calc(100vw - 48px)); font-family: var(--font-display);\n font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }\n.copilotz-switching .copilotz-spinner { color: var(--muted-foreground); }\n@keyframes copilotz-switching { from { opacity: 0; } }\n@keyframes copilotz-switching-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }\n.copilotz-arrived { position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));\n display: flex; align-items: center; gap: 9px; width: max-content; max-width: min(560px, calc(100vw - 32px));\n padding: 10px 16px;\n border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--popover);\n color: var(--popover-foreground); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4;\n pointer-events: none; animation: copilotz-arrived 2.6s ease-in-out forwards; }\n.copilotz-arrived b { font-weight: 650; }\n.copilotz-arrived > .copilotz-icon { color: var(--success-text); }\n.copilotz-arrived[data-long] { border-radius: var(--radius-xl); animation-duration: 5.2s; }\n.copilotz-arrived[data-long] > .copilotz-icon { color: var(--info-text); }\n.copilotz-arrived[data-staff] { border-color: var(--warning-border); }\n.copilotz-arrived[data-staff] > .copilotz-icon { color: var(--warning-text); }\n@keyframes copilotz-arrived {\n 0% { opacity: 0; transform: translate(-50%, 10px); }\n 10%, 88% { opacity: 1; transform: translate(-50%, 0); }\n 100% { opacity: 0; transform: translate(-50%, 4px); }\n}\n\n/* Staff in someone's org: a line along the top, always */\n.copilotz-staff-line { position: fixed; z-index: 80; inset: 0 0 auto; height: 3px; background: var(--warning);\n pointer-events: none; }\n\n/* The org's page */\n.copilotz-org-held { margin-bottom: 12px; }\n.copilotz-org-tabs { position: sticky; top: 0; z-index: 4; display: flex; width: 100%; margin-top: -2px;\n background: var(--background); }\n.copilotz-org-tabs .copilotz-tab { padding: 0 10px; }\n.copilotz-org-section { padding-top: 22px; }\n.copilotz-org-loading { display: grid; gap: 14px; margin-top: 8px; }\n.copilotz-org-missing { display: grid; place-items: center; padding: 32px; }\n.copilotz-org-page .copilotz-page-badges .copilotz-badge { gap: 4px; }\n\n/* Staff's console: dense, calm */\n.console-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }\n.console-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);\n background: var(--card); }\n.console-stat-label { color: var(--muted-foreground); font-size: 12px; font-weight: 600; }\n.console-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em;\n line-height: 1.2; font-variant-numeric: tabular-nums; }\n.console-stat[data-tone=warning] .console-stat-value { color: var(--warning-text); }\n.console-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;\n margin: 22px 0 12px; }\n.console-search { flex: 1 1 280px; max-width: 420px; }\n.console-notice { margin-bottom: 12px; }\n.console-loading { display: grid; gap: 6px; }\n.console-table { container: console / inline-size; display: grid; border: 1px solid var(--border);\n border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }\n.console-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) 64px 64px minmax(92px, .9fr) minmax(110px, 1fr) 92px 176px;\n align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; font-size: 13.5px; }\n.console-row + .console-row { border-top: 1px solid var(--border); }\n.console-row:not(.console-head):hover { background: color-mix(in oklab, var(--muted) 45%, var(--card)); }\n.console-row[data-suspended] { background: color-mix(in oklab, var(--warning-soft) 35%, var(--card)); }\n.console-head { min-height: 38px; background: color-mix(in oklab, var(--muted) 55%, var(--card)); color: var(--muted-foreground);\n font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }\n.console-num { text-align: right; font-variant-numeric: tabular-nums; }\n.console-org { display: flex; align-items: center; gap: 11px; min-width: 0; }\n.console-org-text { display: grid; gap: 1px; min-width: 0; }\n.console-org-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-weight: 620;\n text-overflow: ellipsis; white-space: nowrap; }\n.console-org-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);\n font-size: 12px; }\n.console-org-meta code { min-width: 0; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }\n.console-org-meta .copilotz-copy { margin: -4px 0; }\n.console-error { color: var(--destructive-text); font-size: 12px; }\n.console-active { color: var(--secondary-foreground); }\n.console-active .copilotz-time { font-size: 13px; }\n.console-placement { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }\n.console-placement code { min-width: 0; overflow: hidden; color: var(--secondary-foreground); font-size: 12.5px;\n text-overflow: ellipsis; white-space: nowrap; }\n.console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n.console-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.console-foot { margin: 12px 2px 0; color: var(--muted-foreground); font-size: 12.5px; }\n.console-dialog-text { margin: 0 0 12px; color: var(--secondary-foreground); font-size: 14px; line-height: 1.55; }\n.console-move { display: grid; gap: 4px; }\n.console-move-from { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted-foreground);\n font-size: 13px; }\n.console-move-from code { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--muted);\n color: var(--foreground); font-size: 12.5px; }\n.console-mono input { font-family: var(--font-mono); }\n.console-delete { display: grid; gap: 14px; }\n.console-export { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--primary-text);\n font-size: 13.5px; font-weight: 560; text-underline-offset: 3px; }\n.console-name { font-family: var(--font-mono); font-weight: 650; }\n@container console (max-width: 900px) {\n .console-row.console-head { display: none; }\n .console-row > [data-label=Placement] { display: none; }\n .console-row:not([data-suspended]) > [data-label=Status] { display: none; }\n .console-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 10px 12px 14px; }\n .console-row::after { content: \"\"; order: 1; flex-basis: 100%; height: 0; }\n .console-org { flex: 1 1 0; }\n .console-row > [data-label] { order: 2; color: var(--muted-foreground); font-size: 12.5px; text-align: left; }\n .console-row > [data-label=People] { margin-left: 41px; }\n .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,\n .console-row > [data-label=\"Last active\"]::before { content: attr(data-label) \" \"; }\n .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,\n .console-row > [data-label=\"Last active\"]::before { color: var(--muted-foreground); }\n .console-row > [data-label] .copilotz-time, .console-row > [data-label] code { color: var(--foreground); font-size: 12.5px; }\n .console-row > .console-num { color: var(--foreground); }\n}\n@container console (max-width: 520px) {\n .console-actions .copilotz-button { padding: 0 9px; }\n}\n@media (max-width: 760px) {\n .console-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .console-search { max-width: none; }\n .copilotz-org-tabs { position: static; }\n}\n";
@@ -1,197 +0,0 @@
1
- /**
2
- * The directory's front end, its layout: the switcher and what it opens, making an org,
3
- * going between orgs, staff's line along the top, the org's page and staff's console. Only
4
- * layout, on the theme's variables.
5
- */
6
- export const STYLE = `
7
- /* The switcher, at the top of the sidebar beside the app's mark */
8
- .copilotz-org { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px;
9
- padding: 6px 8px 6px 7px; border: 1px solid transparent; border-radius: var(--radius-lg); background: transparent;
10
- color: var(--sidebar-foreground); text-align: left; cursor: pointer; transition: background-color .12s, border-color .12s; }
11
- .copilotz-org:hover, .copilotz-org[aria-expanded=true] { background: var(--sidebar-accent); }
12
- .copilotz-org[aria-expanded=true] { border-color: var(--sidebar-border); }
13
- .copilotz-org-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }
14
- .copilotz-org-name { overflow: hidden; font-family: var(--font-display); font-size: 14.5px; font-weight: 650;
15
- letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
16
- .copilotz-org-sub { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden;
17
- color: var(--muted-foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
18
- .copilotz-org[data-staff] .copilotz-org-sub { color: var(--warning-text); font-weight: 620; }
19
- .copilotz-org[data-staff] > .copilotz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }
20
- .copilotz-org-rail[data-staff] > .copilotz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }
21
- .copilotz-org-chevron { flex: none; color: var(--muted-foreground); }
22
- .copilotz-org-dot { flex: none; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px;
23
- border-radius: var(--radius-full); background: var(--primary); color: var(--primary-foreground); font-size: 11px;
24
- font-weight: 700; font-variant-numeric: tabular-nums; }
25
-
26
- /* What the switcher opens */
27
- .copilotz-orgs-box { display: grid; gap: 2px; }
28
- .copilotz-orgs-who { margin: 4px 8px 6px; overflow: hidden; color: var(--muted-foreground); font-size: 12.5px;
29
- text-overflow: ellipsis; white-space: nowrap; }
30
- .copilotz-orgs-who b { color: var(--foreground); font-weight: 600; }
31
- .copilotz-orgs-staff { display: flex; align-items: flex-start; gap: 8px; margin: 0 2px 6px; padding: 9px 10px;
32
- border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft);
33
- color: var(--warning-text); font-size: 12.5px; line-height: 1.45; }
34
- .copilotz-orgs-staff > .copilotz-icon { margin-top: 1px; }
35
- .copilotz-orgs-staff b { font-weight: 650; }
36
- .copilotz-orgs-staff-back { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: inherit;
37
- font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
38
- .copilotz-orgs-list, .copilotz-orgs-invites ul { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; }
39
- .copilotz-orgs-row, .copilotz-orgs-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
40
- padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit;
41
- font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; outline: none; }
42
- .copilotz-orgs-row:hover, .copilotz-orgs-row:focus-visible, .copilotz-orgs-action:hover,
43
- .copilotz-orgs-action:focus-visible { background: var(--accent); color: var(--accent-foreground); }
44
- .copilotz-orgs-row:focus-visible, .copilotz-orgs-action:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
45
- .copilotz-orgs-row[aria-current] { background: color-mix(in oklab, var(--primary-soft) 60%, transparent); }
46
- .copilotz-orgs-row[aria-disabled] { opacity: .62; cursor: not-allowed; }
47
- .copilotz-orgs-row-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
48
- .copilotz-orgs-row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
49
- .copilotz-orgs-row-sub { color: var(--muted-foreground); font-size: 12px; }
50
- .copilotz-orgs-row-error { color: var(--destructive-text); font-size: 12px; white-space: normal; }
51
- .copilotz-orgs-check { flex: none; color: var(--primary-text); }
52
- .copilotz-orgs-invites { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
53
- .copilotz-orgs-invites h3 { display: flex; align-items: center; gap: 6px; margin: 0 8px 8px; color: var(--muted-foreground);
54
- font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
55
- .copilotz-orgs-invites ul { gap: 6px; }
56
- .copilotz-orgs-invite { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0 2px; padding: 10px;
57
- border: 1px solid var(--primary-border); border-radius: var(--radius-lg);
58
- background: color-mix(in oklab, var(--primary-soft) 45%, var(--popover)); }
59
- .copilotz-orgs-invite-text { display: grid; gap: 1px; min-width: 0; }
60
- .copilotz-orgs-invite-name { margin: 0; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
61
- .copilotz-orgs-invite-meta { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
62
- .copilotz-orgs-invite-meta .copilotz-time { font-size: 12.5px; }
63
- .copilotz-orgs-invite-answers { display: flex; gap: 6px; margin-top: 8px; }
64
- .copilotz-orgs-actions { display: grid; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
65
- .copilotz-orgs-action { min-height: 38px; color: var(--secondary-foreground); }
66
- .copilotz-orgs-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted-foreground); }
67
- .copilotz-orgs-icon-new { border: 1px dashed var(--input); border-radius: var(--radius-sm); }
68
-
69
- /* Making one */
70
- .copilotz-new-org { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
71
- .copilotz-new-org-preview { padding-top: 25px; }
72
-
73
- /* Going into another org: over everything, until it's there; and a word once it is */
74
- .copilotz-switching { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
75
- border: 0; background: transparent; color: var(--foreground); outline: none; }
76
- .copilotz-switching::backdrop { background: color-mix(in oklab, var(--background) 84%, transparent);
77
- -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: copilotz-switching .22s ease-out; }
78
- .copilotz-switching[open] { display: grid; place-items: center; animation: copilotz-switching .22s ease-out; }
79
- .copilotz-switching-box { display: grid; justify-items: center; text-align: center;
80
- animation: copilotz-switching-in .36s cubic-bezier(.2, .8, .2, 1); }
81
- .copilotz-switching-box .copilotz-avatar { box-shadow: var(--shadow-md); }
82
- .copilotz-switching-personal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-full);
83
- background: var(--primary-soft); color: var(--primary-text); }
84
- .copilotz-switching-label { margin: 18px 0 2px; color: var(--muted-foreground); font-size: 13px; }
85
- .copilotz-switching-name { margin: 0 0 18px; max-width: min(520px, calc(100vw - 48px)); font-family: var(--font-display);
86
- font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
87
- .copilotz-switching .copilotz-spinner { color: var(--muted-foreground); }
88
- @keyframes copilotz-switching { from { opacity: 0; } }
89
- @keyframes copilotz-switching-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
90
- .copilotz-arrived { position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
91
- display: flex; align-items: center; gap: 9px; width: max-content; max-width: min(560px, calc(100vw - 32px));
92
- padding: 10px 16px;
93
- border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--popover);
94
- color: var(--popover-foreground); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4;
95
- pointer-events: none; animation: copilotz-arrived 2.6s ease-in-out forwards; }
96
- .copilotz-arrived b { font-weight: 650; }
97
- .copilotz-arrived > .copilotz-icon { color: var(--success-text); }
98
- .copilotz-arrived[data-long] { border-radius: var(--radius-xl); animation-duration: 5.2s; }
99
- .copilotz-arrived[data-long] > .copilotz-icon { color: var(--info-text); }
100
- .copilotz-arrived[data-staff] { border-color: var(--warning-border); }
101
- .copilotz-arrived[data-staff] > .copilotz-icon { color: var(--warning-text); }
102
- @keyframes copilotz-arrived {
103
- 0% { opacity: 0; transform: translate(-50%, 10px); }
104
- 10%, 88% { opacity: 1; transform: translate(-50%, 0); }
105
- 100% { opacity: 0; transform: translate(-50%, 4px); }
106
- }
107
-
108
- /* Staff in someone's org: a line along the top, always */
109
- .copilotz-staff-line { position: fixed; z-index: 80; inset: 0 0 auto; height: 3px; background: var(--warning);
110
- pointer-events: none; }
111
-
112
- /* The org's page */
113
- .copilotz-org-held { margin-bottom: 12px; }
114
- .copilotz-org-tabs { position: sticky; top: 0; z-index: 4; display: flex; width: 100%; margin-top: -2px;
115
- background: var(--background); }
116
- .copilotz-org-tabs .copilotz-tab { padding: 0 10px; }
117
- .copilotz-org-section { padding-top: 22px; }
118
- .copilotz-org-loading { display: grid; gap: 14px; margin-top: 8px; }
119
- .copilotz-org-missing { display: grid; place-items: center; padding: 32px; }
120
- .copilotz-org-page .copilotz-page-badges .copilotz-badge { gap: 4px; }
121
-
122
- /* Staff's console: dense, calm */
123
- .console-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
124
- .console-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
125
- background: var(--card); }
126
- .console-stat-label { color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
127
- .console-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em;
128
- line-height: 1.2; font-variant-numeric: tabular-nums; }
129
- .console-stat[data-tone=warning] .console-stat-value { color: var(--warning-text); }
130
- .console-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
131
- margin: 22px 0 12px; }
132
- .console-search { flex: 1 1 280px; max-width: 420px; }
133
- .console-notice { margin-bottom: 12px; }
134
- .console-loading { display: grid; gap: 6px; }
135
- .console-table { container: console / inline-size; display: grid; border: 1px solid var(--border);
136
- border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
137
- .console-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) 64px 64px minmax(92px, .9fr) minmax(110px, 1fr) 92px 176px;
138
- align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; font-size: 13.5px; }
139
- .console-row + .console-row { border-top: 1px solid var(--border); }
140
- .console-row:not(.console-head):hover { background: color-mix(in oklab, var(--muted) 45%, var(--card)); }
141
- .console-row[data-suspended] { background: color-mix(in oklab, var(--warning-soft) 35%, var(--card)); }
142
- .console-head { min-height: 38px; background: color-mix(in oklab, var(--muted) 55%, var(--card)); color: var(--muted-foreground);
143
- font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
144
- .console-num { text-align: right; font-variant-numeric: tabular-nums; }
145
- .console-org { display: flex; align-items: center; gap: 11px; min-width: 0; }
146
- .console-org-text { display: grid; gap: 1px; min-width: 0; }
147
- .console-org-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-weight: 620;
148
- text-overflow: ellipsis; white-space: nowrap; }
149
- .console-org-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);
150
- font-size: 12px; }
151
- .console-org-meta code { min-width: 0; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
152
- .console-org-meta .copilotz-copy { margin: -4px 0; }
153
- .console-error { color: var(--destructive-text); font-size: 12px; }
154
- .console-active { color: var(--secondary-foreground); }
155
- .console-active .copilotz-time { font-size: 13px; }
156
- .console-placement { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }
157
- .console-placement code { min-width: 0; overflow: hidden; color: var(--secondary-foreground); font-size: 12.5px;
158
- text-overflow: ellipsis; white-space: nowrap; }
159
- .console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
160
- .console-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
161
- .console-foot { margin: 12px 2px 0; color: var(--muted-foreground); font-size: 12.5px; }
162
- .console-dialog-text { margin: 0 0 12px; color: var(--secondary-foreground); font-size: 14px; line-height: 1.55; }
163
- .console-move { display: grid; gap: 4px; }
164
- .console-move-from { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted-foreground);
165
- font-size: 13px; }
166
- .console-move-from code { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--muted);
167
- color: var(--foreground); font-size: 12.5px; }
168
- .console-mono input { font-family: var(--font-mono); }
169
- .console-delete { display: grid; gap: 14px; }
170
- .console-export { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--primary-text);
171
- font-size: 13.5px; font-weight: 560; text-underline-offset: 3px; }
172
- .console-name { font-family: var(--font-mono); font-weight: 650; }
173
- @container console (max-width: 900px) {
174
- .console-row.console-head { display: none; }
175
- .console-row > [data-label=Placement] { display: none; }
176
- .console-row:not([data-suspended]) > [data-label=Status] { display: none; }
177
- .console-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 10px 12px 14px; }
178
- .console-row::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
179
- .console-org { flex: 1 1 0; }
180
- .console-row > [data-label] { order: 2; color: var(--muted-foreground); font-size: 12.5px; text-align: left; }
181
- .console-row > [data-label=People] { margin-left: 41px; }
182
- .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,
183
- .console-row > [data-label="Last active"]::before { content: attr(data-label) " "; }
184
- .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,
185
- .console-row > [data-label="Last active"]::before { color: var(--muted-foreground); }
186
- .console-row > [data-label] .copilotz-time, .console-row > [data-label] code { color: var(--foreground); font-size: 12.5px; }
187
- .console-row > .console-num { color: var(--foreground); }
188
- }
189
- @container console (max-width: 520px) {
190
- .console-actions .copilotz-button { padding: 0 9px; }
191
- }
192
- @media (max-width: 760px) {
193
- .console-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
194
- .console-search { max-width: none; }
195
- .copilotz-org-tabs { position: static; }
196
- }
197
- `;
@@ -1,81 +0,0 @@
1
- /**
2
- * Orgs in the shell, when the app serves many (`useOrgs`), through the web
3
- * shell's `orgs` slot: the switcher at the top of the sidebar, where the
4
- * app's identity sits (`orgs.switcher`: the org you're in, your standing
5
- * there; opened, your orgs, Personal first-class, invitations waiting with a
6
- * badge, to join or decline in place, a new org, the org's settings, and for
7
- * staff, every org); on the rail, the sidebar folded (`orgs.rail`), the same
8
- * as the org's face, named beside it, opening beside the rail; beside every
9
- * page (`orgs.overlay`), the small dialog
10
- * that makes an org and going between them: a short transition while the
11
- * page starts over in the other org, and a word once it's there; and what
12
- * the shell's menu and palette list (`useShellOrgs`). Staff in an org that
13
- * isn't theirs see it, quietly and all the time (a line along the top of
14
- * the window): what they do is on its record.
15
- */
16
- import { type ReactNode } from "react";
17
- import type { ViewContext } from "copilotz";
18
- import { type PaletteGroup } from "copilotz/web";
19
- import { type Org, type Orgs } from "./orgs.js";
20
- import { type OrgsShown, type Standing } from "copilotz/plugins/interfaces/contract";
21
- type Call = <R = unknown>(action: string, input?: unknown) => Promise<R>;
22
- /** The directory front end's styles, with whatever of it is drawn. */
23
- export declare const style: import("react").JSX.Element;
24
- /**
25
- * The switcher (`orgs.switcher`, the `orgs` slot's): where you are among your orgs, at the top
26
- * of the sidebar, once they're known (the shell draws it once `useShellOrgs` answers).
27
- */
28
- export declare const switcherView: (_: unknown, ctx: ViewContext<ReactNode>) => ReactNode;
29
- /**
30
- * The switcher on the rail (`orgs.rail`, the `orgs` slot's), the sidebar folded: the org's face,
31
- * named beside it, its invitations counted at its corner; it opens the same choices, beside it.
32
- */
33
- export declare const switcherRailView: (_: unknown, ctx: ViewContext<ReactNode>) => ReactNode;
34
- /**
35
- * Beside every page (`orgs.overlay`, the `orgs` slot's), outside the sidebar, which is a drawer
36
- * on a phone: the line along the top while in an org as staff, the dialog that makes an org,
37
- * and going into one.
38
- */
39
- export declare const overlayView: () => ReactNode;
40
- /**
41
- * What the shell's own parts list of the person's orgs (the `orgs` slot's hook): their email,
42
- * the org's page and (for staff) every org in their menu, and orgs in the palette. Nothing until
43
- * the orgs are known, or where the server serves one.
44
- */
45
- export declare function useShellOrgs(call: Call): OrgsShown | undefined;
46
- /** Opens the dialog that makes an org. */
47
- export declare const openNewOrg: () => void;
48
- /** An org's face: yours (Personal) is you; a team's, its initials. */
49
- export declare function OrgFace({ org, person, size }: {
50
- org: Pick<Org, "name" | "kind"> & {
51
- id?: string;
52
- };
53
- person: string;
54
- size?: number;
55
- }): ReactNode;
56
- export declare function OrgSwitcher({ orgs, here, standing, staff, onNew, rail }: {
57
- orgs: Orgs;
58
- /** The org the person is in. */
59
- here?: Org;
60
- standing?: Standing;
61
- /** In it as platform staff. */
62
- staff: boolean;
63
- /** Opens the dialog that makes one. */
64
- onNew(): void;
65
- /** On the rail, the sidebar folded: the org's face alone, opening beside it. */
66
- rail?: boolean;
67
- }): ReactNode;
68
- /** The small dialog that makes a team org: its name, then you're in it, its owner. */
69
- export declare function NewOrg({ open, onClose }: {
70
- open: boolean;
71
- onClose(): void;
72
- }): ReactNode;
73
- /** While the page goes into another org: its face and name, over everything, until it's there. */
74
- export declare function Switching(): ReactNode;
75
- /**
76
- * What the palette offers for orgs: the others to switch to, invitations to
77
- * join or decline (with the spaces' own, under one heading), a new org, the
78
- * org's settings, and for staff, every org.
79
- */
80
- export declare function orgsPalette(orgs: Orgs, here: Org | undefined, standing: Standing | undefined): PaletteGroup[];
81
- export {};