@skillcdn/console 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/api.d.ts +2 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -2
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +6 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +83 -42
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +8 -1
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +11 -2
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +22 -10
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/keys.d.ts +10 -0
- package/dist/cli/keys.d.ts.map +1 -0
- package/dist/cli/keys.js +59 -0
- package/dist/cli/keys.js.map +1 -0
- package/dist/cli/main.js +2 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/terminal.d.ts +7 -0
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +39 -0
- package/dist/cli/terminal.js.map +1 -1
- package/dist/client.d.ts +9 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -1
- package/dist/client.js.map +1 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +73 -17
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/sessions.d.ts +15 -0
- package/dist/components/sessions.d.ts.map +1 -0
- package/dist/components/sessions.js +17 -0
- package/dist/components/sessions.js.map +1 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +198 -28
- package/dist/components/shell.js.map +1 -1
- package/dist/components/workspace.d.ts +2 -0
- package/dist/components/workspace.d.ts.map +1 -1
- package/dist/components/workspace.js +19 -4
- package/dist/components/workspace.js.map +1 -1
- package/dist/console.css +228 -21
- package/dist/console.d.ts +5 -2
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +106 -21
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +7 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +26 -5
- package/dist/data.js.map +1 -1
- package/dist/i18n/en.d.ts +24 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +21 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -3
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +23 -2
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/bridge.d.ts +7 -3
- package/dist/plugin/bridge.d.ts.map +1 -1
- package/dist/plugin/bridge.js +1 -0
- package/dist/plugin/bridge.js.map +1 -1
- package/dist/plugin/context.d.ts +16 -1
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +6 -3
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +8 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/web.d.ts +16 -3
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +8 -1
- package/dist/plugin/web.js.map +1 -1
- package/dist/router.d.ts +6 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +5 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +38 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +37 -1
- package/dist/schemas.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +1 -0
- package/dist/tokens.js.map +1 -1
- package/dist/vocabulary.d.ts +6 -0
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +7 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +5 -5
- package/docs/specs/plugins.md +28 -15
- package/docs/specs/rest.md +12 -8
- package/package.json +1 -1
- package/skills/building-a-plugin/SKILL.md +3 -3
- package/skills/planning-the-board/references/setting-up.md +1 -1
- package/src/api.ts +6 -0
- package/src/cli/cli.ts +115 -43
- package/src/cli/format.ts +15 -2
- package/src/cli/help.ts +22 -10
- package/src/cli/keys.ts +69 -0
- package/src/cli/main.ts +2 -1
- package/src/cli/terminal.ts +40 -0
- package/src/client.ts +18 -0
- package/src/components/plugin-frame.tsx +92 -24
- package/src/components/sessions.tsx +108 -0
- package/src/components/shell.tsx +265 -52
- package/src/components/workspace.tsx +46 -2
- package/src/console.tsx +181 -16
- package/src/data.ts +33 -5
- package/src/i18n/en.ts +25 -0
- package/src/i18n/index.ts +11 -3
- package/src/i18n/ko.ts +27 -2
- package/src/index.ts +1 -0
- package/src/plugin/bridge.ts +8 -3
- package/src/plugin/context.ts +16 -1
- package/src/plugin/define.ts +10 -2
- package/src/plugin/sandbox.ts +9 -1
- package/src/plugin/web.ts +21 -4
- package/src/router.ts +7 -0
- package/src/routes.ts +3 -1
- package/src/schemas.ts +41 -0
- package/src/styles/console.css +228 -21
- package/src/tokens.ts +1 -0
- package/src/vocabulary.ts +9 -0
package/src/plugin/context.ts
CHANGED
|
@@ -255,7 +255,7 @@ export interface PersonCaller {
|
|
|
255
255
|
readonly roles: readonly string[];
|
|
256
256
|
/** The caller's open run in the board project, if any. */
|
|
257
257
|
readonly run: { readonly id: string; readonly taskNumber: number | null } | null;
|
|
258
|
-
/** The project the call is on, if any. */
|
|
258
|
+
/** The project the call is on, if any: one the plugin acts in only where it is placed on it (ADR-0080). */
|
|
259
259
|
readonly project: CallerProject | null;
|
|
260
260
|
}
|
|
261
261
|
|
|
@@ -287,6 +287,15 @@ export type PluginCaller = PersonCaller | ConsoleCaller | PluginAsCaller;
|
|
|
287
287
|
|
|
288
288
|
export interface PluginWorkspace {
|
|
289
289
|
readonly name: string;
|
|
290
|
+
/**
|
|
291
|
+
* The language for whoever has none of their own (ADR-0081): the workspace's, else `en`, as
|
|
292
|
+
* `languageSet` says, so that what a plugin writes to someone who never opened the pages, in a
|
|
293
|
+
* decision, a task or a message elsewhere, is in the organization's language.
|
|
294
|
+
*/
|
|
295
|
+
readonly language: string;
|
|
296
|
+
/** Whether an administrator set the workspace's language: `false` where it is English because nobody said otherwise. */
|
|
297
|
+
readonly languageSet: boolean;
|
|
298
|
+
/** The languages the console speaks, `language` first. */
|
|
290
299
|
readonly languages: readonly string[];
|
|
291
300
|
/** The zone the workspace's times of day are read in; `UTC` where none is set, as `timeZoneSet` says. */
|
|
292
301
|
readonly timeZone: string;
|
|
@@ -371,6 +380,12 @@ export interface PluginConsole {
|
|
|
371
380
|
decisions: {
|
|
372
381
|
list(project: string): Promise<readonly RestDecision[]>;
|
|
373
382
|
get(id: string): Promise<RestDecision | null>;
|
|
383
|
+
/**
|
|
384
|
+
* Raises a decision in a project the plugin reaches, its board project or one it is placed on
|
|
385
|
+
* (`board:decisions`); for a person, one they may see, or the board project whether they see
|
|
386
|
+
* it or not, where whoever may use the plugin is a requester (ADR-0080): the decision reaches
|
|
387
|
+
* them as its raiser, and nothing else of the project opens to them.
|
|
388
|
+
*/
|
|
374
389
|
ask(project: string, decision: DecisionAsk): Promise<RestDecision>;
|
|
375
390
|
/**
|
|
376
391
|
* Answers a decision for a person who answered elsewhere (ADR-0072), with `people:act`: one on
|
package/src/plugin/define.ts
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
PLUGIN_KEY_PATTERN,
|
|
29
29
|
RESERVED_ARG_NAMES,
|
|
30
30
|
RESERVED_COMMAND_NAMES,
|
|
31
|
+
SETTING_KEY_PATTERN,
|
|
31
32
|
} from "./manifest.js";
|
|
32
33
|
|
|
33
34
|
const FIELD = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
|
|
@@ -363,8 +364,15 @@ export function defineEndpoint(input: EndpointInput): EndpointDefinition {
|
|
|
363
364
|
if (input?.auth === "webhook" && input.roles !== undefined) {
|
|
364
365
|
problems.push("a webhook endpoint names no roles: nobody is signed in");
|
|
365
366
|
}
|
|
366
|
-
if (
|
|
367
|
-
|
|
367
|
+
if (
|
|
368
|
+
input?.secret !== undefined &&
|
|
369
|
+
(typeof input.secret !== "string" ||
|
|
370
|
+
!SETTING_KEY_PATTERN.test(input.secret) ||
|
|
371
|
+
input.auth !== "webhook")
|
|
372
|
+
) {
|
|
373
|
+
problems.push(
|
|
374
|
+
"an endpoint's secret names a secret setting, as settings are named (slackSigningSecret), for a webhook alone",
|
|
375
|
+
);
|
|
368
376
|
}
|
|
369
377
|
const methods = input?.methods ?? ["POST"];
|
|
370
378
|
if (
|
package/src/plugin/sandbox.ts
CHANGED
|
@@ -58,7 +58,15 @@ export function forbiddenImportsIn(source: string): string[] {
|
|
|
58
58
|
return [...found];
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* A call of a removed global by its bare name, or through the global object, `globalThis` or
|
|
63
|
+
* Node's `global`: `fetch(`, `globalThis.fetch(` and `global?.fetch(`, and not `ctx.fetch(` or
|
|
64
|
+
* `this.#fetch(`, a member, which is what the host offers in the global's place. Text, not a
|
|
65
|
+
* parse: a name bound to the context's fetch, `({ fetch }) => fetch(url)`, or a method of that
|
|
66
|
+
* name, reads as the global too.
|
|
67
|
+
*/
|
|
68
|
+
const GLOBAL_USES =
|
|
69
|
+
/(?:\b(?:globalThis|global)\s*\??\.\s*|(?<![.\w$#]))(fetch|WebSocket|EventSource|process\.binding|process\.dlopen)\s*\(/g;
|
|
62
70
|
|
|
63
71
|
/** The removed globals a bundle's text calls, each once; a plugin that calls them fails at runtime. */
|
|
64
72
|
export function removedGlobalsIn(source: string): string[] {
|
package/src/plugin/web.ts
CHANGED
|
@@ -51,6 +51,13 @@ export interface FrameWindow {
|
|
|
51
51
|
};
|
|
52
52
|
addEventListener(type: "message", listener: (event: FrameMessageEvent) => void): void;
|
|
53
53
|
removeEventListener(type: "message", listener: (event: FrameMessageEvent) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* The browser's own way to open a window, which it holds to a press in the frame (ADR-0078).
|
|
56
|
+
* A frame of a console before 0.4.6 has one too, whose sandbox lets it open nothing.
|
|
57
|
+
*/
|
|
58
|
+
open?(url: string, target: string, features: string): unknown;
|
|
59
|
+
/** The browser's word on whether a person pressed something in this frame a moment ago, where it has one. */
|
|
60
|
+
readonly navigator?: { readonly userActivation?: { readonly isActive: boolean } };
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
/** As much of `document` as the bridge uses. */
|
|
@@ -124,9 +131,11 @@ export interface PluginFrame {
|
|
|
124
131
|
/** The console's page follows a path of the console's in place; a URL is refused. */
|
|
125
132
|
navigate(path: string): void;
|
|
126
133
|
/**
|
|
127
|
-
*
|
|
128
|
-
* person pressed:
|
|
129
|
-
*
|
|
134
|
+
* Opens a web or a mail address in a new tab, with no opener and no referrer, for a link a
|
|
135
|
+
* person pressed (ADR-0067, ADR-0078): the browser opens it for a press in the frame and for
|
|
136
|
+
* nothing else, one window a press, so call it from the press itself; without a recent press
|
|
137
|
+
* it is refused, where the browser can say so. Anything else, a path of the console's included,
|
|
138
|
+
* is refused; `navigate` takes those. Needs a console from 0.4.6, whose frames may open a window.
|
|
130
139
|
*/
|
|
131
140
|
open(url: string): void;
|
|
132
141
|
/** The console's page downloads a file of this plugin. */
|
|
@@ -365,7 +374,15 @@ export function connect(options: ConnectOptions = {}): Promise<PluginFrame> {
|
|
|
365
374
|
"open takes a web or a mail address; navigate takes a path of the console's",
|
|
366
375
|
});
|
|
367
376
|
}
|
|
368
|
-
|
|
377
|
+
// The browser holds the frame to a press in it (ADR-0078), and says so where it can.
|
|
378
|
+
if (win.navigator?.userActivation?.isActive === false) {
|
|
379
|
+
throw new PluginBridgeError({
|
|
380
|
+
code: "plugin.forbidden",
|
|
381
|
+
message:
|
|
382
|
+
"open opens a link right after a person pressed in the frame, and not otherwise",
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
win.open?.(url, "_blank", "noopener,noreferrer");
|
|
369
386
|
},
|
|
370
387
|
download: (id) => post({ v: PLUGIN_BRIDGE_VERSION, t: "download", id }),
|
|
371
388
|
setTitle: (text) => {
|
package/src/router.ts
CHANGED
|
@@ -93,6 +93,8 @@ export type Route =
|
|
|
93
93
|
readonly name: "workspace-settings";
|
|
94
94
|
readonly form: "rules" | "workspace" | "pack-token" | undefined;
|
|
95
95
|
}
|
|
96
|
+
/** The browsers whoever is signed in is signed in on (board #309): the settings' view of their own. */
|
|
97
|
+
| { readonly name: "sessions" }
|
|
96
98
|
| { readonly name: "people" }
|
|
97
99
|
/** The form where an administrator lets someone in by login (ADR-0022). */
|
|
98
100
|
| { readonly name: "new-listing" }
|
|
@@ -184,6 +186,8 @@ export const PATHS = {
|
|
|
184
186
|
categories: "/categories",
|
|
185
187
|
/** The workspace's settings: the rules, the categories, the skills (ADR-0023). */
|
|
186
188
|
settings: "/settings",
|
|
189
|
+
/** The browsers whoever is signed in is signed in on: the settings' view of their own (board #309). */
|
|
190
|
+
sessions: "/settings/sessions",
|
|
187
191
|
/** Where the pages a console adds of its own are: `/pages/<key>`, and `/projects/<key>/pages/<page>` on a project. */
|
|
188
192
|
pages: "/pages",
|
|
189
193
|
/** Where the plugins' pages are: `/plugins/<key>[/<page>[/<rest>]]`, and `/projects/<key>/plugins/<key>...` on a project (ADR-0054). */
|
|
@@ -328,6 +332,9 @@ export function matchRoute(pathname: string, search = ""): Route {
|
|
|
328
332
|
if (path === PATHS.categories) {
|
|
329
333
|
return { name: "categories" };
|
|
330
334
|
}
|
|
335
|
+
if (path === PATHS.sessions) {
|
|
336
|
+
return { name: "sessions" };
|
|
337
|
+
}
|
|
331
338
|
if (path === PATHS.pluginSettings) {
|
|
332
339
|
return { name: "plugins-settings", plugin: undefined };
|
|
333
340
|
}
|
package/src/routes.ts
CHANGED
|
@@ -27,6 +27,8 @@ export const REST_ROUTES = {
|
|
|
27
27
|
events: "/api/v1/events",
|
|
28
28
|
/** The tokens of whoever asks: what their agents, scripts and consoles act as them with. */
|
|
29
29
|
tokens: "/api/v1/tokens",
|
|
30
|
+
/** The browsers whoever asks is signed in on (board #309), seen and ended by a person on the console's own pages; `/others` under it ends every other. */
|
|
31
|
+
sessions: "/api/v1/sessions",
|
|
30
32
|
/** Connecting an agent (ADR-0011): begun as nobody, approved by a person, claimed by the command. */
|
|
31
33
|
connect: "/api/v1/connect",
|
|
32
34
|
/** The categories tasks are sorted into (ADR-0019): the workspace's vocabulary, kept by an administrator. */
|
|
@@ -143,7 +145,7 @@ export function signInPath(page: string, failure: SignInFailure): string {
|
|
|
143
145
|
|
|
144
146
|
/** The REST path of one person, listing, token, project or team: the collection, then the id or the key. */
|
|
145
147
|
export function restPath(
|
|
146
|
-
collection: "people" | "listings" | "tokens" | "projects" | "teams",
|
|
148
|
+
collection: "people" | "listings" | "tokens" | "sessions" | "projects" | "teams",
|
|
147
149
|
id: string,
|
|
148
150
|
): string {
|
|
149
151
|
return `${REST_ROUTES[collection]}/${encodeURIComponent(id)}`;
|
package/src/schemas.ts
CHANGED
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
ARTIFACT_KINDS,
|
|
54
54
|
CATEGORY_COLORS,
|
|
55
55
|
COLOR_NAMES,
|
|
56
|
+
CONSOLE_LANGUAGES,
|
|
56
57
|
EVENT_KINDS,
|
|
57
58
|
GOAL_STATES,
|
|
58
59
|
LINK_SOURCES,
|
|
@@ -363,6 +364,13 @@ export const restWorkspaceSchema = z.object({
|
|
|
363
364
|
* none, when they stay as the API gives them, in UTC. Optional as above; none then.
|
|
364
365
|
*/
|
|
365
366
|
timeZone: z.optional(z.nullable(timeZoneName)),
|
|
367
|
+
/**
|
|
368
|
+
* The workspace's language (ADR-0081), one the console speaks: the pages speak it to whoever
|
|
369
|
+
* has no language of their own and a browser that asks for none the console speaks, and a
|
|
370
|
+
* plugin writes to whoever has none in it; `null` for none set, English then. Optional as
|
|
371
|
+
* above; none then.
|
|
372
|
+
*/
|
|
373
|
+
language: z.optional(z.nullable(languageTag)),
|
|
366
374
|
});
|
|
367
375
|
export type RestWorkspace = z.infer<typeof restWorkspaceSchema>;
|
|
368
376
|
|
|
@@ -373,6 +381,8 @@ export const restWorkspacePatchSchema = z
|
|
|
373
381
|
weekStart: z.optional(z.enum(WEEK_STARTS)),
|
|
374
382
|
/** A zone's name, or `null` for none. */
|
|
375
383
|
timeZone: z.optional(z.nullable(timeZoneName)),
|
|
384
|
+
/** One of the languages the console speaks, or `null` for none. */
|
|
385
|
+
language: z.optional(z.nullable(z.enum(CONSOLE_LANGUAGES))),
|
|
376
386
|
})
|
|
377
387
|
.check(
|
|
378
388
|
z.refine((patch) => Object.values(patch).some((value) => value !== undefined), {
|
|
@@ -1224,6 +1234,37 @@ export type RestToken = z.infer<typeof restTokenSchema>;
|
|
|
1224
1234
|
export const restTokensSchema = z.object({ items: z.array(restTokenSchema) });
|
|
1225
1235
|
export type RestTokens = z.infer<typeof restTokensSchema>;
|
|
1226
1236
|
|
|
1237
|
+
/**
|
|
1238
|
+
* A browser a person is signed in on, as their own page lists it (board #309): what the browser
|
|
1239
|
+
* called itself, read as a browser and a platform, where it last came from and when; never the
|
|
1240
|
+
* cookie's token.
|
|
1241
|
+
*/
|
|
1242
|
+
export const restSessionSchema = z.object({
|
|
1243
|
+
id: uuid,
|
|
1244
|
+
/** Whether it is the session the request was made on: the browser the person looks from. */
|
|
1245
|
+
current: z.boolean(),
|
|
1246
|
+
createdAt: instant,
|
|
1247
|
+
/** When the session was last used, noted at most hourly. */
|
|
1248
|
+
lastSeenAt: instant,
|
|
1249
|
+
/** When it ends unless it is used before: the idle limit from the last use. */
|
|
1250
|
+
expiresAt: instant,
|
|
1251
|
+
/** The browser by family (`Chrome`), or `null` when what it called itself names none the console knows. */
|
|
1252
|
+
browser: z.nullable(z.string()),
|
|
1253
|
+
/** The platform by family (`Windows`), or `null`. */
|
|
1254
|
+
platform: z.nullable(z.string()),
|
|
1255
|
+
/** Where the browser last came from, as the server saw it, or `null` until seen. */
|
|
1256
|
+
address: z.nullable(z.string()),
|
|
1257
|
+
});
|
|
1258
|
+
export type RestSession = z.infer<typeof restSessionSchema>;
|
|
1259
|
+
|
|
1260
|
+
/** `GET /api/v1/sessions`: the sessions of whoever asks, the current first and then the last used first, and how long one lives unused. */
|
|
1261
|
+
export const restSessionsSchema = z.object({
|
|
1262
|
+
items: z.array(restSessionSchema),
|
|
1263
|
+
/** How many days a session lasts without being used: the deployment's `SESSION_TTL_DAYS`. */
|
|
1264
|
+
idleDays: z.int(),
|
|
1265
|
+
});
|
|
1266
|
+
export type RestSessions = z.infer<typeof restSessionsSchema>;
|
|
1267
|
+
|
|
1227
1268
|
/** What `POST /api/v1/tokens` is sent: a name, and for how many days it is good. */
|
|
1228
1269
|
export const restTokenInputSchema = z.object({
|
|
1229
1270
|
name: line(MAX_TOKEN_NAME_LENGTH),
|
package/src/styles/console.css
CHANGED
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
0 0.5rem 1.25rem -0.5rem color-mix(in srgb, var(--sc-color-accent-solid) 22%, transparent),
|
|
87
87
|
0 1.25rem 3rem -1rem color-mix(in srgb, var(--sc-color-accent-solid) 11%, transparent);
|
|
88
88
|
--sc-shadow-stage: 0 1.25rem 3.5rem #1a2b552e;
|
|
89
|
+
/* What a menu casts, open over the page: close under it, and soft. */
|
|
90
|
+
--sc-shadow-menu: 0 0.75rem 2rem -0.5rem #1a2b5533, 0 0.125rem 0.375rem #1a2b5514;
|
|
89
91
|
|
|
90
92
|
/* Type. The Korean face comes first where the page provides it; the Latin stays with the
|
|
91
93
|
system's faces. */
|
|
@@ -487,25 +489,38 @@ table {
|
|
|
487
489
|
color: var(--sc-color-text);
|
|
488
490
|
}
|
|
489
491
|
|
|
490
|
-
/* A tab that opens a list of pages: a group of several plugins (ADR-0054).
|
|
492
|
+
/* A tab that opens a list of pages: a group of several plugins (ADR-0054). A button; its list is
|
|
493
|
+
a popover, .sc-tab-group-panel below the menu's panel. */
|
|
491
494
|
|
|
492
495
|
.sc-tab-group {
|
|
493
|
-
|
|
496
|
+
display: inline-flex;
|
|
494
497
|
}
|
|
495
498
|
|
|
496
499
|
.sc-tab-summary {
|
|
497
|
-
|
|
500
|
+
font-family: inherit;
|
|
501
|
+
line-height: inherit;
|
|
498
502
|
cursor: pointer;
|
|
499
503
|
}
|
|
500
504
|
|
|
501
|
-
.
|
|
502
|
-
|
|
505
|
+
/* The caret turns while the list is open. */
|
|
506
|
+
.sc-tab-summary .sc-menu-caret {
|
|
507
|
+
transition: transform var(--sc-transition);
|
|
503
508
|
}
|
|
504
509
|
|
|
505
|
-
.sc-tab-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
510
|
+
.sc-tab-summary[aria-expanded="true"] .sc-menu-caret {
|
|
511
|
+
transform: rotate(180deg);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.sc-tab-summary[aria-expanded="true"] {
|
|
515
|
+
color: var(--sc-color-text);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* A tab's name: a long one stops short with an ellipsis, and the tab's title says it whole. */
|
|
519
|
+
.sc-tab-label {
|
|
520
|
+
min-width: 0;
|
|
521
|
+
max-width: 15rem;
|
|
522
|
+
overflow: hidden;
|
|
523
|
+
text-overflow: ellipsis;
|
|
509
524
|
}
|
|
510
525
|
|
|
511
526
|
/* The pages of a plugin: the header's tabs going on a row lower, on the same gutters, the line
|
|
@@ -548,25 +563,45 @@ table {
|
|
|
548
563
|
color: var(--sc-color-text);
|
|
549
564
|
}
|
|
550
565
|
|
|
551
|
-
/* A plugin's frame: the width of the page, as tall as the frame
|
|
566
|
+
/* A plugin's frame, in a box the console draws: the width of the page, as tall as the frame
|
|
567
|
+
says; until the plugin's page has drawn, a spinner stands in the box, over a frame not shown. */
|
|
552
568
|
|
|
553
|
-
.sc-plugin-frame {
|
|
569
|
+
.sc-plugin-frame-box {
|
|
570
|
+
position: relative;
|
|
554
571
|
display: block;
|
|
555
572
|
width: 100%;
|
|
556
573
|
min-height: 2.5rem;
|
|
557
|
-
border: 0;
|
|
558
|
-
border-radius: var(--sc-radius-lg);
|
|
559
|
-
background: transparent;
|
|
560
574
|
}
|
|
561
575
|
|
|
562
576
|
/* A page pads itself by a step, for the shadows of what is in it, which the frame would cut. The
|
|
563
577
|
frame stands that step outside the page's column, so that the page's first words line up with
|
|
564
578
|
the tabs above it, and with every other page's. */
|
|
565
|
-
.sc-plugin-frame-page {
|
|
579
|
+
.sc-plugin-frame-box-page {
|
|
566
580
|
width: calc(100% + 2 * var(--sc-space-4));
|
|
567
581
|
margin: calc(var(--sc-space-4) * -1);
|
|
568
582
|
}
|
|
569
583
|
|
|
584
|
+
.sc-plugin-frame {
|
|
585
|
+
display: block;
|
|
586
|
+
width: 100%;
|
|
587
|
+
height: 100%;
|
|
588
|
+
border: 0;
|
|
589
|
+
border-radius: var(--sc-radius-lg);
|
|
590
|
+
background: transparent;
|
|
591
|
+
transition: opacity var(--sc-transition);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.sc-plugin-frame-loading .sc-plugin-frame {
|
|
595
|
+
opacity: 0;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.sc-plugin-frame-wait {
|
|
599
|
+
position: absolute;
|
|
600
|
+
inset: 0;
|
|
601
|
+
display: grid;
|
|
602
|
+
place-items: center;
|
|
603
|
+
}
|
|
604
|
+
|
|
570
605
|
/* A plugin's frame document, which the console serves marked with data-console: it paints no
|
|
571
606
|
background and is as tall as its content, so that the box the console draws shows through and
|
|
572
607
|
the frame shrinks as well as grows; no room is kept for a scrollbar it never shows. */
|
|
@@ -659,8 +694,67 @@ html[data-console] body {
|
|
|
659
694
|
padding: var(--sc-space-1);
|
|
660
695
|
border: var(--sc-border);
|
|
661
696
|
border-radius: var(--sc-radius-lg);
|
|
662
|
-
background: var(--sc-color-bg-
|
|
663
|
-
box-shadow: var(--sc-shadow-
|
|
697
|
+
background: var(--sc-color-bg-raised);
|
|
698
|
+
box-shadow: var(--sc-shadow-menu);
|
|
699
|
+
/* A menu longer than the window has room for under the header scrolls within itself, so that
|
|
700
|
+
its last items, the way out among them, are always reached. */
|
|
701
|
+
max-height: calc(100dvh - 4.5rem);
|
|
702
|
+
overflow-y: auto;
|
|
703
|
+
overscroll-behavior: contain;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/* The list a group tab opens: a popover in the top layer, placed under its tab by the shell, so
|
|
707
|
+
that the row of tabs, which scrolls sideways and clips whatever hangs out of it, clips nothing
|
|
708
|
+
of the list. In the type of the tabs; as wide as its names, within a column a name reads at a
|
|
709
|
+
glance in, and within the window. */
|
|
710
|
+
.sc-tab-group-panel {
|
|
711
|
+
position: fixed;
|
|
712
|
+
inset: auto;
|
|
713
|
+
min-width: 11rem;
|
|
714
|
+
max-width: min(18rem, calc(100vw - 1rem));
|
|
715
|
+
margin: 0;
|
|
716
|
+
color: var(--sc-color-text);
|
|
717
|
+
font-size: var(--sc-text-sm);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/* Where the browser has no popover, the tab shows and hides the list itself. */
|
|
721
|
+
.sc-tab-group-panel[hidden] {
|
|
722
|
+
display: none;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.sc-tab-group-panel:popover-open {
|
|
726
|
+
animation: sc-menu-in 120ms ease-out;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
@keyframes sc-menu-in {
|
|
730
|
+
from {
|
|
731
|
+
opacity: 0;
|
|
732
|
+
transform: translateY(-0.25rem);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
@media (prefers-reduced-motion: reduce) {
|
|
737
|
+
.sc-tab-group-panel:popover-open {
|
|
738
|
+
animation: none;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/* A plugin in a group's list: its name alone, lined up under the tab's, which wraps rather than
|
|
743
|
+
run out of the list. The one the page is on is in the accent. */
|
|
744
|
+
.sc-menu-link.sc-group-link {
|
|
745
|
+
padding: var(--sc-space-2) 0.625rem;
|
|
746
|
+
color: var(--sc-color-text);
|
|
747
|
+
line-height: var(--sc-leading-snug);
|
|
748
|
+
overflow-wrap: anywhere;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.sc-group-link + .sc-group-link {
|
|
752
|
+
margin-top: 0.125rem;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.sc-group-link[aria-current="page"] {
|
|
756
|
+
background: color-mix(in srgb, var(--sc-color-accent-subtle) 55%, transparent);
|
|
757
|
+
color: var(--sc-color-accent);
|
|
664
758
|
}
|
|
665
759
|
|
|
666
760
|
.sc-menu-who {
|
|
@@ -702,7 +796,7 @@ html[data-console] body {
|
|
|
702
796
|
}
|
|
703
797
|
|
|
704
798
|
.sc-menu-link:hover {
|
|
705
|
-
background: var(--sc-color-bg-
|
|
799
|
+
background: var(--sc-color-bg-inset);
|
|
706
800
|
color: var(--sc-color-text);
|
|
707
801
|
}
|
|
708
802
|
|
|
@@ -2923,6 +3017,119 @@ select.sc-input-quiet {
|
|
|
2923
3017
|
align-items: baseline;
|
|
2924
3018
|
}
|
|
2925
3019
|
|
|
3020
|
+
/* The views of the settings: the workspace's, and the browsers the person is signed in on. */
|
|
3021
|
+
.sc-settings-views {
|
|
3022
|
+
margin-bottom: var(--sc-space-5);
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
/* The sessions (board #309): a row for each browser in the panel, parted by hairlines, a screen or
|
|
3026
|
+
a phone drawn before it, the current one in the accent; what it is first, then when it was
|
|
3027
|
+
last used, where from and the day it signed in, in the small type of a row's facts. */
|
|
3028
|
+
.sc-session-list {
|
|
3029
|
+
margin: var(--sc-space-4) 0 0;
|
|
3030
|
+
padding: 0;
|
|
3031
|
+
list-style: none;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
.sc-session {
|
|
3035
|
+
display: flex;
|
|
3036
|
+
align-items: center;
|
|
3037
|
+
gap: var(--sc-space-3);
|
|
3038
|
+
padding-block: var(--sc-space-3);
|
|
3039
|
+
border-top: var(--sc-hairline);
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
.sc-session:last-child {
|
|
3043
|
+
padding-bottom: 0;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
.sc-session-icon {
|
|
3047
|
+
display: inline-flex;
|
|
3048
|
+
flex: none;
|
|
3049
|
+
align-items: center;
|
|
3050
|
+
justify-content: center;
|
|
3051
|
+
width: 2.25rem;
|
|
3052
|
+
height: 2.25rem;
|
|
3053
|
+
border-radius: var(--sc-radius-md);
|
|
3054
|
+
background: var(--sc-color-bg-inset);
|
|
3055
|
+
color: var(--sc-color-text-muted);
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
.sc-session-current .sc-session-icon {
|
|
3059
|
+
background: var(--sc-color-accent-subtle);
|
|
3060
|
+
color: var(--sc-color-accent);
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
.sc-session-icon svg {
|
|
3064
|
+
width: 1.25rem;
|
|
3065
|
+
height: 1.25rem;
|
|
3066
|
+
fill: none;
|
|
3067
|
+
stroke: currentColor;
|
|
3068
|
+
stroke-width: 1.5;
|
|
3069
|
+
stroke-linecap: round;
|
|
3070
|
+
stroke-linejoin: round;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
.sc-session-body {
|
|
3074
|
+
flex: 1;
|
|
3075
|
+
min-width: 0;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
.sc-session-name {
|
|
3079
|
+
display: flex;
|
|
3080
|
+
flex-wrap: wrap;
|
|
3081
|
+
align-items: center;
|
|
3082
|
+
gap: var(--sc-space-1) var(--sc-space-2);
|
|
3083
|
+
font-weight: var(--sc-weight-medium);
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
.sc-session-meta {
|
|
3087
|
+
display: flex;
|
|
3088
|
+
flex-wrap: wrap;
|
|
3089
|
+
gap: 0 var(--sc-space-2);
|
|
3090
|
+
margin-top: 0.125rem;
|
|
3091
|
+
color: var(--sc-color-text-faint);
|
|
3092
|
+
font-size: var(--sc-text-xs);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.sc-session-meta > span {
|
|
3096
|
+
white-space: nowrap;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
.sc-session-meta > span + span {
|
|
3100
|
+
padding-inline-start: var(--sc-space-2);
|
|
3101
|
+
border-inline-start: var(--sc-hairline);
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
.sc-session-end {
|
|
3105
|
+
flex: none;
|
|
3106
|
+
align-self: center;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
/* On a phone the facts of a row stand one under another, where a line has no room for them. */
|
|
3110
|
+
@media (max-width: 40rem) {
|
|
3111
|
+
.sc-session {
|
|
3112
|
+
align-items: flex-start;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
.sc-session-meta {
|
|
3116
|
+
flex-direction: column;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.sc-session-meta > span {
|
|
3120
|
+
white-space: normal;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
.sc-session-meta > span + span {
|
|
3124
|
+
padding-inline-start: 0;
|
|
3125
|
+
border-inline-start: 0;
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
.sc-session-end {
|
|
3129
|
+
align-self: flex-start;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
|
|
2926
3133
|
.sc-tab-count {
|
|
2927
3134
|
color: var(--sc-color-text-faint);
|
|
2928
3135
|
font-size: var(--sc-text-xs);
|
|
@@ -5417,8 +5624,8 @@ select.sc-input-quiet {
|
|
|
5417
5624
|
padding: var(--sc-space-1);
|
|
5418
5625
|
border: var(--sc-border);
|
|
5419
5626
|
border-radius: var(--sc-radius-md);
|
|
5420
|
-
background: var(--sc-color-bg-
|
|
5421
|
-
box-shadow: var(--sc-shadow-
|
|
5627
|
+
background: var(--sc-color-bg-raised);
|
|
5628
|
+
box-shadow: var(--sc-shadow-menu);
|
|
5422
5629
|
font-size: var(--sc-text-sm);
|
|
5423
5630
|
}
|
|
5424
5631
|
|
|
@@ -6653,7 +6860,7 @@ a.sc-tile-project:focus-visible {
|
|
|
6653
6860
|
white-space: nowrap;
|
|
6654
6861
|
}
|
|
6655
6862
|
|
|
6656
|
-
.sc-tile-widget .sc-plugin-frame-
|
|
6863
|
+
.sc-tile-widget .sc-plugin-frame-box {
|
|
6657
6864
|
height: 100%;
|
|
6658
6865
|
min-height: 0;
|
|
6659
6866
|
}
|
package/src/tokens.ts
CHANGED
package/src/vocabulary.ts
CHANGED
|
@@ -62,6 +62,15 @@ export type ProjectIconType = (typeof PROJECT_ICON_TYPES)[number];
|
|
|
62
62
|
/** The identity providers people may sign in through: the git host, and Google (Workspace). */
|
|
63
63
|
/** The languages the console's pages speak, and a plugin's words are given in. */
|
|
64
64
|
export const CONSOLE_LANGUAGES = ["en", "ko"] as const;
|
|
65
|
+
export type ConsoleLanguage = (typeof CONSOLE_LANGUAGES)[number];
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The languages the console speaks with one of them first: the workspace's (ADR-0081), so that
|
|
69
|
+
* the first of what a plugin reads as `languages` is the language for whoever has none of their own.
|
|
70
|
+
*/
|
|
71
|
+
export function languagesFirst(first: string): string[] {
|
|
72
|
+
return [first, ...CONSOLE_LANGUAGES.filter((tag) => tag !== first)];
|
|
73
|
+
}
|
|
65
74
|
|
|
66
75
|
export const PROVIDER_KEYS = ["gh", "google"] as const;
|
|
67
76
|
|