cursedbelt 6.30.0 → 6.31.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/dist/react/back/backName.d.ts +16 -0
- package/dist/react/back/backName.d.ts.map +1 -0
- package/dist/react/back/backName.js +19 -0
- package/dist/react/back/backName.js.map +1 -0
- package/dist/react/back/index.d.ts +1 -0
- package/dist/react/back/index.d.ts.map +1 -1
- package/dist/react/back/index.js +1 -0
- package/dist/react/back/index.js.map +1 -1
- package/dist/react/lib/apiClient.d.ts +24 -0
- package/dist/react/lib/apiClient.d.ts.map +1 -0
- package/dist/react/lib/apiClient.js +46 -0
- package/dist/react/lib/apiClient.js.map +1 -0
- package/dist/react/shell-doors/index.d.ts +8 -0
- package/dist/react/shell-doors/index.d.ts.map +1 -0
- package/dist/react/shell-doors/index.js +8 -0
- package/dist/react/shell-doors/index.js.map +1 -0
- package/dist/react/shell-doors/shellDoors.d.ts +79 -0
- package/dist/react/shell-doors/shellDoors.d.ts.map +1 -0
- package/dist/react/shell-doors/shellDoors.js +95 -0
- package/dist/react/shell-doors/shellDoors.js.map +1 -0
- package/dist/styles-areas/workspace-shell.css +25 -10
- package/dist/styles-utilities.css +44 -0
- package/dist/testing/designAudit.d.ts.map +1 -1
- package/dist/testing/designAudit.js +5 -1
- package/dist/testing/designAudit.js.map +1 -1
- package/package.json +15 -2
- package/scripts/styleAreas.ts +1 -1
- package/src/react/back/backName.spec.ts +27 -0
- package/src/react/back/backName.ts +24 -0
- package/src/react/back/index.ts +1 -0
- package/src/react/lib/apiClient.spec.ts +36 -0
- package/src/react/lib/apiClient.ts +57 -0
- package/src/react/shell-doors/index.ts +7 -0
- package/src/react/shell-doors/shellDoors.spec.tsx +93 -0
- package/src/react/shell-doors/shellDoors.tsx +150 -0
- package/src/styles-areas/workspace-shell.css +25 -10
- package/src/styles-utilities.css +44 -0
- package/src/testing/designAudit.ts +4 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a place is called in Back's "Back to …" — the `back.name` an app hands `WorkspaceShell` (forge task 5560; games,
|
|
3
|
+
* home and trivia each held this body). A record opened below a place is "Lists · one list", every other place its label.
|
|
4
|
+
*/
|
|
5
|
+
/** The places table's lookup: a place by id, the first place when the id is unknown. */
|
|
6
|
+
export declare function placeLookup<P extends {
|
|
7
|
+
id: string;
|
|
8
|
+
}>(places: readonly P[]): (id: P['id']) => P;
|
|
9
|
+
/** `parse` is the app's `links.parse`; `placeOf` its place lookup. */
|
|
10
|
+
export declare function makeBackName<V extends string>(parse: (href: string) => {
|
|
11
|
+
view: V;
|
|
12
|
+
path: readonly string[];
|
|
13
|
+
}, placeOf: (id: V) => {
|
|
14
|
+
label: string;
|
|
15
|
+
}): (href: string) => string;
|
|
16
|
+
//# sourceMappingURL=backName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backName.d.ts","sourceRoot":"","sources":["../../../src/react/back/backName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAE9F;AAKD,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAC3C,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAC7D,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAM1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a place is called in Back's "Back to …" — the `back.name` an app hands `WorkspaceShell` (forge task 5560; games,
|
|
3
|
+
* home and trivia each held this body). A record opened below a place is "Lists · one list", every other place its label.
|
|
4
|
+
*/
|
|
5
|
+
/** The places table's lookup: a place by id, the first place when the id is unknown. */
|
|
6
|
+
export function placeLookup(places) {
|
|
7
|
+
return (id) => places.find((place) => place.id === id) ?? places[0];
|
|
8
|
+
}
|
|
9
|
+
/** `Lists` → `list`, `Libraries` → `library`: the singular a "one …" says. */
|
|
10
|
+
const singular = (label) => label.toLowerCase().replace(/ies$/, 'y').replace(/s$/, '');
|
|
11
|
+
/** `parse` is the app's `links.parse`; `placeOf` its place lookup. */
|
|
12
|
+
export function makeBackName(parse, placeOf) {
|
|
13
|
+
return (href) => {
|
|
14
|
+
const at = parse(href);
|
|
15
|
+
const place = placeOf(at.view);
|
|
16
|
+
return at.path.length ? `${place.label} · one ${singular(place.label)}` : place.label;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=backName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backName.js","sourceRoot":"","sources":["../../../src/react/back/backName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAA2B,MAAoB;IACxE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,IAAK,MAAM,CAAC,CAAC,CAAO,CAAC;AAC7E,CAAC;AAED,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAEvG,sEAAsE;AACtE,MAAM,UAAU,YAAY,CAC1B,KAA6D,EAC7D,OAAqC;IAErC,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACxF,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { type BackRow, type BackStep, backRows } from './backTrail.js';
|
|
|
2
2
|
export { backReach, goBack, startBack, type StartBackOptions, useBackSteps } from './back.js';
|
|
3
3
|
export { type BackControl, NOWHERE_BACK, stepBack, useBack } from './useBack.js';
|
|
4
4
|
export { BackButton, type BackButtonProps } from './BackButton.js';
|
|
5
|
+
export { makeBackName, placeLookup } from './backName.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/back/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/back/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/react/back/index.js
CHANGED
|
@@ -4,4 +4,5 @@ export { backRows } from './backTrail.js';
|
|
|
4
4
|
export { backReach, goBack, startBack, useBackSteps } from './back.js';
|
|
5
5
|
export { NOWHERE_BACK, stepBack, useBack } from './useBack.js';
|
|
6
6
|
export { BackButton } from './BackButton.js';
|
|
7
|
+
export { makeBackName, placeLookup } from './backName.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/back/index.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,mEAAmE;AACnE,OAAO,EAA+B,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAyB,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAoB,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/back/index.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,mEAAmE;AACnE,OAAO,EAA+B,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAyB,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAoB,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An app's one road to its own `/api`: a typed JSON `request` that sends the session cookie, reads a refusal's own words
|
|
3
|
+
* and throws an `ApiError` carrying the status (forge task 5560 — games, home and trivia each held this body).
|
|
4
|
+
*
|
|
5
|
+
* 🔴 A non-JSON body is an error page in a costume (a 502 from a proxy, an Access redirect): the status says what
|
|
6
|
+
* happened, so the reason falls back to "The server answered 502." rather than to the page's HTML or a parse error.
|
|
7
|
+
*/
|
|
8
|
+
/** A request the server refused or could not answer: `status` is the HTTP status; the message is the server's `error` words. */
|
|
9
|
+
export declare class ApiError extends Error {
|
|
10
|
+
readonly status: number;
|
|
11
|
+
constructor(status: number, message: string);
|
|
12
|
+
}
|
|
13
|
+
export type ApiRequest = <T>(method: string, path: string, body?: unknown) => Promise<T>;
|
|
14
|
+
export interface ApiRequestOptions {
|
|
15
|
+
/** Headers sent on every call (trivia's reader zone). A function is asked afresh for each call. */
|
|
16
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
17
|
+
/** The `fetch` to call; the global one by default. */
|
|
18
|
+
fetch?: typeof fetch;
|
|
19
|
+
}
|
|
20
|
+
/** A `request` with its own always-on headers. A 204 answers `undefined`; JSON is sent for any body that is not `undefined`. */
|
|
21
|
+
export declare function createRequest(options?: ApiRequestOptions): ApiRequest;
|
|
22
|
+
/** The plain `request`: no extra headers. */
|
|
23
|
+
export declare const request: ApiRequest;
|
|
24
|
+
//# sourceMappingURL=apiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../src/react/lib/apiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gIAAgI;AAChI,qBAAa,QAAS,SAAQ,KAAK;IAE/B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM;CAIlB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAEzF,MAAM,WAAW,iBAAiB;IAChC,mGAAmG;IACnG,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClE,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,gIAAgI;AAChI,wBAAgB,aAAa,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAyBzE;AAED,6CAA6C;AAC7C,eAAO,MAAM,OAAO,EAAE,UAA4B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An app's one road to its own `/api`: a typed JSON `request` that sends the session cookie, reads a refusal's own words
|
|
3
|
+
* and throws an `ApiError` carrying the status (forge task 5560 — games, home and trivia each held this body).
|
|
4
|
+
*
|
|
5
|
+
* 🔴 A non-JSON body is an error page in a costume (a 502 from a proxy, an Access redirect): the status says what
|
|
6
|
+
* happened, so the reason falls back to "The server answered 502." rather than to the page's HTML or a parse error.
|
|
7
|
+
*/
|
|
8
|
+
/** A request the server refused or could not answer: `status` is the HTTP status; the message is the server's `error` words. */
|
|
9
|
+
export class ApiError extends Error {
|
|
10
|
+
status;
|
|
11
|
+
constructor(status, message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.status = status;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** A `request` with its own always-on headers. A 204 answers `undefined`; JSON is sent for any body that is not `undefined`. */
|
|
17
|
+
export function createRequest(options = {}) {
|
|
18
|
+
return async function request(method, path, body) {
|
|
19
|
+
const doFetch = options.fetch ?? fetch;
|
|
20
|
+
const always = typeof options.headers === 'function' ? options.headers() : (options.headers ?? {});
|
|
21
|
+
const response = await doFetch(path, {
|
|
22
|
+
method,
|
|
23
|
+
credentials: 'same-origin',
|
|
24
|
+
headers: { ...always, ...(body === undefined ? {} : { 'content-type': 'application/json' }) },
|
|
25
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
26
|
+
});
|
|
27
|
+
if (response.status === 204)
|
|
28
|
+
return undefined;
|
|
29
|
+
const text = await response.text();
|
|
30
|
+
let parsed = null;
|
|
31
|
+
try {
|
|
32
|
+
parsed = text ? JSON.parse(text) : null;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// A non-JSON body is an error page in a costume; the status says what happened.
|
|
36
|
+
}
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
const reason = parsed && typeof parsed === 'object' && 'error' in parsed ? String(parsed.error) : `The server answered ${response.status}.`;
|
|
39
|
+
throw new ApiError(response.status, reason);
|
|
40
|
+
}
|
|
41
|
+
return parsed;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** The plain `request`: no extra headers. */
|
|
45
|
+
export const request = createRequest();
|
|
46
|
+
//# sourceMappingURL=apiClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiClient.js","sourceRoot":"","sources":["../../../src/react/lib/apiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gIAAgI;AAChI,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEtB;IADX,YACW,MAAc,EACvB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,WAAM,GAAN,MAAM,CAAQ;IAIzB,CAAC;CACF;A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AO,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAE,MAA6B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,uBAAuB,QAAQ,CAAC,MAAM,GAAG,CAAC;YACvJ,MAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,MAAW,CAAC;IACrB,CAAC,CAAC;AACJ,CAAC;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAe,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cursedbelt/react/shell-doors` — the wiring a deep-linked app repeats around `WorkspaceShell` (forge task 5560).
|
|
3
|
+
* A subpath of its own, never re-exported by `./react/workspace-shell`: an app that lazy-loads a shell part through
|
|
4
|
+
* that barrel keeps every module the barrel names in the chunk, and this hook (with the deep-link router it reads)
|
|
5
|
+
* would ride into the shell chunk of an app that never calls it — arch's grew 5.40 → 6.87 kB gzip.
|
|
6
|
+
*/
|
|
7
|
+
export { COMPACT_TOASTER, railPlaces, type ShellDoors, type ShellSession, useShellDoors } from './shellDoors.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/shell-doors/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cursedbelt/react/shell-doors` — the wiring a deep-linked app repeats around `WorkspaceShell` (forge task 5560).
|
|
3
|
+
* A subpath of its own, never re-exported by `./react/workspace-shell`: an app that lazy-loads a shell part through
|
|
4
|
+
* that barrel keeps every module the barrel names in the chunk, and this hook (with the deep-link router it reads)
|
|
5
|
+
* would ride into the shell chunk of an app that never calls it — arch's grew 5.40 → 6.87 kB gzip.
|
|
6
|
+
*/
|
|
7
|
+
export { COMPACT_TOASTER, railPlaces, useShellDoors } from './shellDoors.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/shell-doors/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAsC,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wiring every deep-linked app shell repeats around `WorkspaceShell` (forge task 5560): the three badge doors
|
|
3
|
+
* (Notifications, Settings, Help) as paths, the banner lane, the connection dot, the account the badge shows, the
|
|
4
|
+
* suite's other apps, the ⌘K palette's open state, and the notifications page the Notifications door draws. games,
|
|
5
|
+
* home and trivia each wrote it out (~45 lines apiece); an app now passes what differs — its session, and the view
|
|
6
|
+
* it is on — and keeps the parts that are its own (its pages, its palette's contents, its title).
|
|
7
|
+
*
|
|
8
|
+
* Call it inside a `DeepLinkProvider`: the paths come from that provider's `links`.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
import { type DeepLinkLocation } from '../deep-link/index.js';
|
|
12
|
+
import type { ToasterProps } from '../Toast.js';
|
|
13
|
+
import { useIssueBanners } from '../notifications/index.js';
|
|
14
|
+
import type { ShellApp, ShellBadge, ShellConnection, ShellPlace } from '../workspace-shell/WorkspaceShell.js';
|
|
15
|
+
/** The part of an SSO session the doors read (`cursedauth/session-probe`'s `Session` satisfies it). */
|
|
16
|
+
export interface ShellSession {
|
|
17
|
+
user?: {
|
|
18
|
+
name?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
};
|
|
21
|
+
accountsUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ShellDoors<V extends string> {
|
|
24
|
+
/** The view the URL names. */
|
|
25
|
+
view: V;
|
|
26
|
+
location: DeepLinkLocation<V>;
|
|
27
|
+
/** Go to a path of this app (`/settings?at=keys`), as the deep links parse it. */
|
|
28
|
+
go: (path: string) => void;
|
|
29
|
+
goToRoot: (view: V) => void;
|
|
30
|
+
openNotifications: () => void;
|
|
31
|
+
/** Settings, opened at a section when one is named. */
|
|
32
|
+
openSettings: (at?: string) => void;
|
|
33
|
+
openHelp: () => void;
|
|
34
|
+
/** The banner lane's rows — none on the notifications page, which shows the issues in full. */
|
|
35
|
+
banners: ReturnType<typeof useIssueBanners>;
|
|
36
|
+
apps: readonly ShellApp[];
|
|
37
|
+
connection: ShellConnection;
|
|
38
|
+
/** The first trouble's title, for the connection dot's tooltip; absent while live. */
|
|
39
|
+
connectionLabel?: string;
|
|
40
|
+
/** What the settings page and the badge show of the signed-in person. */
|
|
41
|
+
account: {
|
|
42
|
+
name: string;
|
|
43
|
+
email: string;
|
|
44
|
+
accountsUrl: string;
|
|
45
|
+
};
|
|
46
|
+
/** The badge's props, from a name and a mark. */
|
|
47
|
+
badge: (name: string, mark: ReactNode) => ShellBadge;
|
|
48
|
+
palette: {
|
|
49
|
+
open: boolean;
|
|
50
|
+
mounted: boolean;
|
|
51
|
+
};
|
|
52
|
+
openPalette: () => void;
|
|
53
|
+
setPaletteOpen: (open: boolean) => void;
|
|
54
|
+
/** The notifications page, for the Notifications door — `/notifications?show=…` is where its filter lives. */
|
|
55
|
+
notificationsPlace: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export declare function useShellDoors<V extends string>(session: ShellSession): ShellDoors<V>;
|
|
58
|
+
/**
|
|
59
|
+
* The toaster's own stack, made compact (photos' forge task 5340): each toast as wide as its words and centered, the
|
|
60
|
+
* close × inline at the end. `!` because sonner's own `[data-sonner-toast]` rules land after the app's utilities.
|
|
61
|
+
*/
|
|
62
|
+
export declare const COMPACT_TOASTS: string;
|
|
63
|
+
/**
|
|
64
|
+
* `<LazyToaster {...COMPACT_TOASTER} />`: a small pill at the foot, centered, as wide as its words; above a phone's
|
|
65
|
+
* bottom bar.
|
|
66
|
+
*/
|
|
67
|
+
export declare const COMPACT_TOASTER: ToasterProps;
|
|
68
|
+
/**
|
|
69
|
+
* A place's rail row for each place that has a `section`, in the order given. `family` maps a section to the rail's
|
|
70
|
+
* family key; `include` leaves a place off (an owner-only place for anyone else).
|
|
71
|
+
*/
|
|
72
|
+
export declare function railPlaces<P extends {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
icon: ReactNode;
|
|
76
|
+
section?: string;
|
|
77
|
+
pinned?: true;
|
|
78
|
+
}>(places: readonly P[], rootHref: (id: P['id']) => string, family: Readonly<Record<string, string>>, include?: (place: P) => boolean): ShellPlace[];
|
|
79
|
+
//# sourceMappingURL=shellDoors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shellDoors.d.ts","sourceRoot":"","sources":["../../../src/react/shell-doors/shellDoors.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAsB,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAwB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAO9G,uGAAuG;AACvG,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM;IA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GAGG;AACH,eAAO,MAAM,eAAe,EAAE,YAM7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CAAE,EAClH,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,MAAM,EACjC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,OAAO,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAoB,GAC1C,UAAU,EAAE,CAWd"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The wiring every deep-linked app shell repeats around `WorkspaceShell` (forge task 5560): the three badge doors
|
|
4
|
+
* (Notifications, Settings, Help) as paths, the banner lane, the connection dot, the account the badge shows, the
|
|
5
|
+
* suite's other apps, the ⌘K palette's open state, and the notifications page the Notifications door draws. games,
|
|
6
|
+
* home and trivia each wrote it out (~45 lines apiece); an app now passes what differs — its session, and the view
|
|
7
|
+
* it is on — and keeps the parts that are its own (its pages, its palette's contents, its title).
|
|
8
|
+
*
|
|
9
|
+
* Call it inside a `DeepLinkProvider`: the paths come from that provider's `links`.
|
|
10
|
+
*/
|
|
11
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
12
|
+
import { useDeepLink } from '../deep-link/index.js';
|
|
13
|
+
import { lazyWithReload } from '../lazy/index.js';
|
|
14
|
+
import { issueNotifications } from '../workspace-shell/notificationSource.js';
|
|
15
|
+
import { useConnectionTrouble, useIssueBanners } from '../notifications/index.js';
|
|
16
|
+
import { useSuiteApps } from '../workspace-shell/suiteApps.js';
|
|
17
|
+
// Through the barrel, as every app's own lazy handle was: importing './NotificationsPlace.js' directly split it into a
|
|
18
|
+
// chunk of its own and pulled the shell's parts into SettingsView's (games' SettingsView chunk 4.3 -> 12.1 kB gzip).
|
|
19
|
+
const LazyNotificationsPlace = lazyWithReload(() => import('../workspace-shell/index.js').then((m) => ({ default: m.NotificationsPlace })));
|
|
20
|
+
export function useShellDoors(session) {
|
|
21
|
+
const { location, navigateTo, goToRoot, links } = useDeepLink();
|
|
22
|
+
const view = location.view;
|
|
23
|
+
const go = useCallback((path) => navigateTo(links.parse(path)), [navigateTo, links]);
|
|
24
|
+
const openNotifications = useCallback(() => go(links.root('notifications')), [go, links]);
|
|
25
|
+
const openSettings = useCallback((at) => go(at ? `/settings?at=${encodeURIComponent(at)}` : '/settings'), [go]);
|
|
26
|
+
const openHelp = useCallback(() => go(links.root('help')), [go, links]);
|
|
27
|
+
const issueBanners = useIssueBanners({ onView: openNotifications });
|
|
28
|
+
const banners = view === 'notifications' ? [] : issueBanners;
|
|
29
|
+
const [palette, setPalette] = useState({ open: false, mounted: false });
|
|
30
|
+
const apps = useSuiteApps(session.accountsUrl);
|
|
31
|
+
const trouble = useConnectionTrouble();
|
|
32
|
+
const connection = trouble.length === 0 ? 'live' : trouble.some((issue) => issue.area === 'offline') ? 'offline' : 'connecting';
|
|
33
|
+
const email = session.user?.email ?? '';
|
|
34
|
+
const name = session.user?.name || email;
|
|
35
|
+
const accountsUrl = session.accountsUrl ?? '';
|
|
36
|
+
const account = useMemo(() => ({ name, email, accountsUrl }), [name, email, accountsUrl]);
|
|
37
|
+
const show = (location.params.show ?? 'unread');
|
|
38
|
+
const notificationsPlace = (_jsx(LazyNotificationsPlace, { show: show, source: issueNotifications(), onShow: (next) => navigateTo(links.parse(next === 'unread' ? '/notifications' : `/notifications?show=${next}`), { replace: true }) }));
|
|
39
|
+
return {
|
|
40
|
+
view,
|
|
41
|
+
location,
|
|
42
|
+
go,
|
|
43
|
+
goToRoot: (next) => goToRoot(next),
|
|
44
|
+
openNotifications,
|
|
45
|
+
openSettings,
|
|
46
|
+
openHelp,
|
|
47
|
+
banners,
|
|
48
|
+
apps,
|
|
49
|
+
connection,
|
|
50
|
+
...(trouble[0] ? { connectionLabel: trouble[0].title } : {}),
|
|
51
|
+
account,
|
|
52
|
+
badge: (badgeName, mark) => ({ name: badgeName, mark, ...(email ? { detail: email } : {}) }),
|
|
53
|
+
palette,
|
|
54
|
+
openPalette: () => setPalette({ open: true, mounted: true }),
|
|
55
|
+
setPaletteOpen: (open) => setPalette((p) => ({ ...p, open })),
|
|
56
|
+
notificationsPlace,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The toaster's own stack, made compact (photos' forge task 5340): each toast as wide as its words and centered, the
|
|
61
|
+
* close × inline at the end. `!` because sonner's own `[data-sonner-toast]` rules land after the app's utilities.
|
|
62
|
+
*/
|
|
63
|
+
export const COMPACT_TOASTS = [
|
|
64
|
+
'[&_[data-sonner-toast]]:w-fit! [&_[data-sonner-toast]]:max-w-full! [&_[data-sonner-toast]]:inset-x-0! [&_[data-sonner-toast]]:mx-auto!',
|
|
65
|
+
'[&_[data-sonner-toast]]:gap-2! [&_[data-sonner-toast]]:py-1.5! [&_[data-sonner-toast]]:ps-3! [&_[data-sonner-toast]]:pe-1!',
|
|
66
|
+
'[&_[data-close-button]]:static! [&_[data-close-button]]:order-last! [&_[data-close-button]]:size-7! [&_[data-close-button]]:transform-none! [&_[data-close-button]]:border-0! [&_[data-close-button]]:bg-transparent!',
|
|
67
|
+
].join(' ');
|
|
68
|
+
/**
|
|
69
|
+
* `<LazyToaster {...COMPACT_TOASTER} />`: a small pill at the foot, centered, as wide as its words; above a phone's
|
|
70
|
+
* bottom bar.
|
|
71
|
+
*/
|
|
72
|
+
export const COMPACT_TOASTER = {
|
|
73
|
+
position: 'bottom-center',
|
|
74
|
+
offset: { bottom: '20px' },
|
|
75
|
+
mobileOffset: { bottom: 'calc(var(--cb-bottom-chrome-h, 0px) + 12px)', left: '12px', right: '12px' },
|
|
76
|
+
style: { '--width': '24rem' },
|
|
77
|
+
className: COMPACT_TOASTS,
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* A place's rail row for each place that has a `section`, in the order given. `family` maps a section to the rail's
|
|
81
|
+
* family key; `include` leaves a place off (an owner-only place for anyone else).
|
|
82
|
+
*/
|
|
83
|
+
export function railPlaces(places, rootHref, family, include = () => true) {
|
|
84
|
+
return places
|
|
85
|
+
.filter((place) => place.section && include(place))
|
|
86
|
+
.map((place) => ({
|
|
87
|
+
id: place.id,
|
|
88
|
+
label: place.label,
|
|
89
|
+
icon: place.icon,
|
|
90
|
+
href: rootHref(place.id),
|
|
91
|
+
family: family[place.section],
|
|
92
|
+
...(place.pinned ? { onBar: true } : {}),
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=shellDoors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shellDoors.js","sourceRoot":"","sources":["../../../src/react/shell-doors/shellDoors.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAO,EAAsC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAyB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAI/D,uHAAuH;AACvH,qHAAqH;AACrH,MAAM,sBAAsB,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAA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EAAmB;IAC9C,SAAS,EAAE,cAAc;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,MAAoB,EACpB,QAAiC,EACjC,MAAwC,EACxC,UAAiC,GAAG,EAAE,CAAC,IAAI;IAE3C,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;SAClD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAiB,CAAW;QACjD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -18,23 +18,38 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 117 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
25
25
|
* import closures rather than a hand-written list, is scripts/styleAreas.ts.
|
|
26
26
|
*/
|
|
27
|
-
@source inline("-my-1.5 @max-meta:hidden [&::-webkit-scrollbar]:hidden [&>svg]:opacity-45
|
|
28
|
-
@source inline("[
|
|
29
|
-
@source inline("
|
|
30
|
-
@source inline("
|
|
27
|
+
@source inline("-my-1.5 -right-0.5 -top-0.5 @max-meta:hidden [&::-webkit-scrollbar]:hidden [&>svg]:opacity-45");
|
|
28
|
+
@source inline("[&>svg]:size-5 [&_[data-cb-banner-icon]]:text-accent [&_[data-cb-banner-icon]]:text-destructive");
|
|
29
|
+
@source inline("[&_[data-cb-banner-icon]]:text-warning [&_[data-close-button]]:bg-transparent!");
|
|
30
|
+
@source inline("[&_[data-close-button]]:border-0! [&_[data-close-button]]:order-last!");
|
|
31
|
+
@source inline("[&_[data-close-button]]:size-7! [&_[data-close-button]]:static!");
|
|
32
|
+
@source inline("[&_[data-close-button]]:transform-none! [&_[data-sonner-toast]]:gap-2!");
|
|
33
|
+
@source inline("[&_[data-sonner-toast]]:inset-x-0! [&_[data-sonner-toast]]:max-w-full!");
|
|
34
|
+
@source inline("[&_[data-sonner-toast]]:mx-auto! [&_[data-sonner-toast]]:pe-1! [&_[data-sonner-toast]]:ps-3!");
|
|
35
|
+
@source inline("[&_[data-sonner-toast]]:py-1.5! [&_[data-sonner-toast]]:w-fit! [&_svg]:size-4.5");
|
|
36
|
+
@source inline("[&_svg]:text-accent [&_svg]:text-muted-foreground [scrollbar-width:none] bg-accent/15");
|
|
37
|
+
@source inline("bg-destructive/10 bg-foreground bg-muted/50 bg-warning/10 border-solid");
|
|
38
|
+
@source inline("bottom-[calc(env(safe-area-inset-bottom)+0.5rem)] flex-auto focus-visible:[&>svg]:opacity-100");
|
|
39
|
+
@source inline("group-focus-within:opacity-100 group-focus-within:pointer-events-auto");
|
|
40
|
+
@source inline("group-hover:pointer-events-auto h-14 h-[calc(3.5rem+env(safe-area-inset-bottom))]");
|
|
31
41
|
@source inline("hover:[&>svg]:opacity-100 hover:bg-accent-solid/90 hover:bg-muted/60 items-stretch left-2.5");
|
|
32
42
|
@source inline("left-[calc(env(safe-area-inset-left)+0.5rem)] list-none max-md:border-t-0 max-md:pt-0");
|
|
33
43
|
@source inline("md:[&:has(>[data-cb-place-actions]_[role=tablist])>[data-cb-place-name]]:min-w-24 md:bg-muted");
|
|
34
44
|
@source inline("md:block md:border-r md:flex md:h-12 md:has-[[role=tablist]]:min-w-0");
|
|
35
45
|
@source inline("md:has-[[role=tablist]]:shrink md:hidden md:px-6 md:px-8 md:py-6 md:shrink-0 md:text-foreground");
|
|
36
|
-
@source inline("md:w-64 min-h-2 mt-3 no-underline pb-12 pb-[env(safe-area-inset-bottom)]");
|
|
37
|
-
@source inline("pointer-coarse:
|
|
38
|
-
@source inline("pointer-coarse:pointer-
|
|
39
|
-
@source inline("pointer-coarse:
|
|
40
|
-
@source inline("
|
|
46
|
+
@source inline("md:w-64 min-h-10 min-h-2 ml-1.5 ml-2 mt-3 no-underline pb pb-12 pb-[env(safe-area-inset-bottom)]");
|
|
47
|
+
@source inline("place-items-center pointer-coarse:basis-full pointer-coarse:bg-transparent");
|
|
48
|
+
@source inline("pointer-coarse:justify-end pointer-coarse:landscape:pl-[calc(env(safe-area-inset-left)+3.75rem)]");
|
|
49
|
+
@source inline("pointer-coarse:p-0 pointer-coarse:pointer-events-auto");
|
|
50
|
+
@source inline("pointer-coarse:portrait:pb-[calc(env(safe-area-inset-bottom)+3.75rem)]");
|
|
51
|
+
@source inline("pointer-coarse:shadow-none pointer-coarse:size-11 pointer-coarse:static pr-16 pr-24 pr-9 pt pt-6");
|
|
52
|
+
@source inline("py-10 right-1 right-3 ring-1 ring-accent ring-destructive/25 ring-inset rotate rotate-180");
|
|
53
|
+
@source inline("scroll-mt-4 self-stretch sha shadow-md size-9 size-control-lg sm:flex-row sm:gap-4");
|
|
54
|
+
@source inline("sm:items-center sm:justify-between sm:w-60 text-background text-muted-foreground/50 text-success");
|
|
55
|
+
@source inline("top-1 top-3 w-14");
|
|
@@ -5762,6 +5762,26 @@
|
|
|
5762
5762
|
.\[\&_\[data-cb-page-subtitle\]\]\:mt-0 [data-cb-page-subtitle] {
|
|
5763
5763
|
margin-top: 0px;
|
|
5764
5764
|
}
|
|
5765
|
+
.\[\&_\[data-close-button\]\]\:static\! [data-close-button] {
|
|
5766
|
+
position: static !important;
|
|
5767
|
+
}
|
|
5768
|
+
.\[\&_\[data-close-button\]\]\:order-last\! [data-close-button] {
|
|
5769
|
+
order: 9999 !important;
|
|
5770
|
+
}
|
|
5771
|
+
.\[\&_\[data-close-button\]\]\:size-7\! [data-close-button] {
|
|
5772
|
+
width: calc(var(--spacing) * 7) !important;
|
|
5773
|
+
height: calc(var(--spacing) * 7) !important;
|
|
5774
|
+
}
|
|
5775
|
+
.\[\&_\[data-close-button\]\]\:transform-none\! [data-close-button] {
|
|
5776
|
+
transform: none !important;
|
|
5777
|
+
}
|
|
5778
|
+
.\[\&_\[data-close-button\]\]\:border-0\! [data-close-button] {
|
|
5779
|
+
border-style: var(--tw-border-style) !important;
|
|
5780
|
+
border-width: 0px !important;
|
|
5781
|
+
}
|
|
5782
|
+
.\[\&_\[data-close-button\]\]\:bg-transparent\! [data-close-button] {
|
|
5783
|
+
background-color: transparent !important;
|
|
5784
|
+
}
|
|
5765
5785
|
.\[\&_\[data-icon\]\]\:text-accent [data-icon] {
|
|
5766
5786
|
color: var(--accent);
|
|
5767
5787
|
}
|
|
@@ -5774,6 +5794,30 @@
|
|
|
5774
5794
|
.\[\&_\[data-icon\]\]\:text-warning [data-icon] {
|
|
5775
5795
|
color: var(--warning);
|
|
5776
5796
|
}
|
|
5797
|
+
.\[\&_\[data-sonner-toast\]\]\:inset-x-0\! [data-sonner-toast] {
|
|
5798
|
+
inset-inline: 0px !important;
|
|
5799
|
+
}
|
|
5800
|
+
.\[\&_\[data-sonner-toast\]\]\:mx-auto\! [data-sonner-toast] {
|
|
5801
|
+
margin-inline: auto !important;
|
|
5802
|
+
}
|
|
5803
|
+
.\[\&_\[data-sonner-toast\]\]\:w-fit\! [data-sonner-toast] {
|
|
5804
|
+
width: fit-content !important;
|
|
5805
|
+
}
|
|
5806
|
+
.\[\&_\[data-sonner-toast\]\]\:max-w-full\! [data-sonner-toast] {
|
|
5807
|
+
max-width: 100% !important;
|
|
5808
|
+
}
|
|
5809
|
+
.\[\&_\[data-sonner-toast\]\]\:gap-2\! [data-sonner-toast] {
|
|
5810
|
+
gap: calc(var(--spacing) * 2) !important;
|
|
5811
|
+
}
|
|
5812
|
+
.\[\&_\[data-sonner-toast\]\]\:py-1\.5\! [data-sonner-toast] {
|
|
5813
|
+
padding-block: calc(var(--spacing) * 1.5) !important;
|
|
5814
|
+
}
|
|
5815
|
+
.\[\&_\[data-sonner-toast\]\]\:ps-3\! [data-sonner-toast] {
|
|
5816
|
+
padding-inline-start: calc(var(--spacing) * 3) !important;
|
|
5817
|
+
}
|
|
5818
|
+
.\[\&_\[data-sonner-toast\]\]\:pe-1\! [data-sonner-toast] {
|
|
5819
|
+
padding-inline-end: var(--spacing) !important;
|
|
5820
|
+
}
|
|
5777
5821
|
.\[\&_button\:not\(\[role\=checkbox\]\)\]\:size-7 button:not([role=checkbox]) {
|
|
5778
5822
|
width: calc(var(--spacing) * 7);
|
|
5779
5823
|
height: calc(var(--spacing) * 7);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"designAudit.d.ts","sourceRoot":"","sources":["../../src/testing/designAudit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gFAAgF;AAChF,eAAO,MAAM,YAAY,kRAqCf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA0C,CAAC;AAE7F;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,YAAY,EAAgC,CAAC;AAEzF,iGAAiG;AACjG,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA6B3D,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,QAA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,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAU1H"}
|
|
@@ -378,7 +378,9 @@ export function designProbe({ rules, allowProse, specimens }) {
|
|
|
378
378
|
// A box is a region at least 48px tall and 120px wide that draws an edge on every side or
|
|
379
379
|
// paints a fill unlike the one behind it. Inside the page's main region (the canvas is level
|
|
380
380
|
// one), a third box nested in two others is the fourth level LAY-5 refuses. Controls, media,
|
|
381
|
-
// code and floating layers are not regions
|
|
381
|
+
// code and floating layers are not regions, and neither is one nobody can see: a scrim at
|
|
382
|
+
// opacity 0 until it is wanted (cb's `CanvasZoomHint` over a MapFrame, photos' Places map) is
|
|
383
|
+
// no box while it is not drawn.
|
|
382
384
|
if (on.has('LAY-5')) {
|
|
383
385
|
const NOT_REGION = `${CONTROL}, ${FLOATING}, img, video, canvas, svg, picture, iframe, pre, code, table, tr, td, th`;
|
|
384
386
|
const edged = (style) => ['Top', 'Right', 'Bottom', 'Left'].every((side) => {
|
|
@@ -400,6 +402,8 @@ export function designProbe({ rules, allowProse, specimens }) {
|
|
|
400
402
|
const box = el.getBoundingClientRect();
|
|
401
403
|
if (box.height < 48 || box.width < 120)
|
|
402
404
|
return false;
|
|
405
|
+
if (!drawn(el))
|
|
406
|
+
return false;
|
|
403
407
|
const style = getComputedStyle(el);
|
|
404
408
|
return edged(style) || (painted(style.backgroundColor) && style.backgroundColor !== fillBehind(el));
|
|
405
409
|
};
|