@domicile-desktop/sdk-react 0.0.0-alpha-71aa7ccc506a → 0.0.0-alpha-59fc4d9728f0
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 +2 -4
- package/package.json +4 -12
- package/dist/followed-icon-theme.d.ts +0 -14
- package/dist/followed-icon-theme.js +0 -29
- package/dist/per-desktop.d.ts +0 -7
- package/dist/per-desktop.js +0 -19
package/README.md
CHANGED
|
@@ -42,8 +42,6 @@ export const Shell = mount(Focused);
|
|
|
42
42
|
and says which are pending and which were refused.
|
|
43
43
|
- `./use-named-icons`: `useNamedIcons(domicile, names, icons, failure)`, the
|
|
44
44
|
icons a lookup finds for `names`.
|
|
45
|
-
- `./followed-icon-theme`: `sharedIconTheme(domicile)`, the config's icon
|
|
46
|
-
theme followed once per desktop.
|
|
47
45
|
- `./superseded`: `superseded(error)`, whether a host request such as
|
|
48
46
|
`searchFiles` failed only because a newer one replaced it.
|
|
49
47
|
- Hooks over the desktop's core state, each rerendering on change:
|
|
@@ -63,9 +61,9 @@ export const Shell = mount(Focused);
|
|
|
63
61
|
- Shared watches, for state a library watches (UPower, BlueZ, `pactl`):
|
|
64
62
|
- `./shared-watch`: `sharedWatch(start)` runs one watch for every
|
|
65
63
|
subscriber, from the first to the last.
|
|
66
|
-
- `./per-desktop`: `perDesktop(make)`, one value per desktop.
|
|
67
64
|
- `./use-shared-watch`: `useSharedWatch(watch)`, and `useDeskWatch(desk)`
|
|
68
|
-
for a `perDesktop` watch
|
|
65
|
+
for a `perDesktop` watch (from `@domicile-desktop/sdk/per-desktop`) of
|
|
66
|
+
the desktop above.
|
|
69
67
|
- `./watch-presence`: `watchPresence(read, onPresent)` looks for hardware
|
|
70
68
|
in `/sys` every 10 seconds; `isAbsent` says whether to hide for want of
|
|
71
69
|
it.
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@cprussin/option-result": "^2.0.1",
|
|
4
|
-
"@domicile-desktop/sdk": "0.0.0-alpha-
|
|
4
|
+
"@domicile-desktop/sdk": "0.0.0-alpha-59fc4d9728f0"
|
|
5
5
|
},
|
|
6
6
|
"description": "React for a Domicile shell or app: mount it on the desktop, read the desktop from context, and follow its state with hooks.",
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@cprussin/tsconfig": "^5.0.0",
|
|
9
|
-
"@domicile-desktop/system-apps": "0.0.0-alpha-
|
|
9
|
+
"@domicile-desktop/system-apps": "0.0.0-alpha-59fc4d9728f0",
|
|
10
10
|
"@domicile-desktop/test-support": "0.0.2",
|
|
11
11
|
"@testing-library/react": "^16.3.3",
|
|
12
12
|
"@types/bun": "^1.4.4",
|
|
@@ -39,10 +39,6 @@
|
|
|
39
39
|
"types": "./dist/fake-domicile.d.ts",
|
|
40
40
|
"default": "./dist/fake-domicile.js"
|
|
41
41
|
},
|
|
42
|
-
"./followed-icon-theme": {
|
|
43
|
-
"types": "./dist/followed-icon-theme.d.ts",
|
|
44
|
-
"default": "./dist/followed-icon-theme.js"
|
|
45
|
-
},
|
|
46
42
|
"./mount": {
|
|
47
43
|
"types": "./dist/mount.d.ts",
|
|
48
44
|
"default": "./dist/mount.js"
|
|
@@ -51,10 +47,6 @@
|
|
|
51
47
|
"types": "./dist/nested-shell.d.ts",
|
|
52
48
|
"default": "./dist/nested-shell.js"
|
|
53
49
|
},
|
|
54
|
-
"./per-desktop": {
|
|
55
|
-
"types": "./dist/per-desktop.d.ts",
|
|
56
|
-
"default": "./dist/per-desktop.js"
|
|
57
|
-
},
|
|
58
50
|
"./pointer-confinement": {
|
|
59
51
|
"types": "./dist/pointer-confinement.d.ts",
|
|
60
52
|
"default": "./dist/pointer-confinement.js"
|
|
@@ -140,10 +132,10 @@
|
|
|
140
132
|
"test:unit": "bun test"
|
|
141
133
|
},
|
|
142
134
|
"type": "module",
|
|
143
|
-
"version": "0.0.0-alpha-
|
|
135
|
+
"version": "0.0.0-alpha-59fc4d9728f0",
|
|
144
136
|
"repository": {
|
|
145
137
|
"type": "git",
|
|
146
138
|
"url": "git+https://github.com/cprussin/domicile.git",
|
|
147
|
-
"directory": "
|
|
139
|
+
"directory": "platform/sdk/react"
|
|
148
140
|
}
|
|
149
141
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Domicile } from "@domicile-desktop/sdk/desktop/desktop";
|
|
2
|
-
import type { IconThemeDesktop } from "@domicile-desktop/sdk/icon-theme";
|
|
3
|
-
import { watchIconTheme } from "@domicile-desktop/sdk/icon-theme";
|
|
4
|
-
/** The icon theme as last read, or `undefined` for `hicolor` only. */
|
|
5
|
-
export type IconTheme = () => Promise<string | undefined>;
|
|
6
|
-
/** {@link followIconTheme} for `domicile`, started on first use. */
|
|
7
|
-
export declare const sharedIconTheme: (domicile: Domicile) => IconTheme;
|
|
8
|
-
/**
|
|
9
|
-
* Follows the icon theme from now on. Answers once the first read settles.
|
|
10
|
-
*
|
|
11
|
-
* A theme that cannot be read is logged and answered as `hicolor`: missing
|
|
12
|
-
* icons are cosmetic, and a launcher or menu should still open.
|
|
13
|
-
*/
|
|
14
|
-
export declare const followIconTheme: (host: IconThemeDesktop, watch?: typeof watchIconTheme) => IconTheme;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// The config's icon theme, followed once per desktop and shared by everything
|
|
2
|
-
// that draws icons by name.
|
|
3
|
-
import { watchIconTheme } from "@domicile-desktop/sdk/icon-theme";
|
|
4
|
-
import { perDesktop } from "./per-desktop";
|
|
5
|
-
/** {@link followIconTheme} for `domicile`, started on first use. */
|
|
6
|
-
export const sharedIconTheme = perDesktop((domicile) => followIconTheme(domicile));
|
|
7
|
-
/**
|
|
8
|
-
* Follows the icon theme from now on. Answers once the first read settles.
|
|
9
|
-
*
|
|
10
|
-
* A theme that cannot be read is logged and answered as `hicolor`: missing
|
|
11
|
-
* icons are cosmetic, and a launcher or menu should still open.
|
|
12
|
-
*/
|
|
13
|
-
export const followIconTheme = (host, watch = watchIconTheme) => {
|
|
14
|
-
const first = Promise.withResolvers();
|
|
15
|
-
const state = { latest: first.promise };
|
|
16
|
-
watch(host, (read) => {
|
|
17
|
-
const theme = read.match({
|
|
18
|
-
Err: (error) => {
|
|
19
|
-
// biome-ignore lint/suspicious/noConsole: icons fall back to hicolor; say why
|
|
20
|
-
console.error("Could not read the icon theme; drawing hicolor icons", error);
|
|
21
|
-
return undefined;
|
|
22
|
-
},
|
|
23
|
-
Ok: (found) => found.match({ None: () => undefined, Some: (name) => name }),
|
|
24
|
-
});
|
|
25
|
-
first.resolve(theme);
|
|
26
|
-
state.latest = Promise.resolve(theme);
|
|
27
|
-
});
|
|
28
|
-
return () => state.latest;
|
|
29
|
-
};
|
package/dist/per-desktop.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Domicile } from "@domicile-desktop/sdk/desktop/desktop";
|
|
2
|
-
/**
|
|
3
|
-
* `make`, run once per desktop: every caller with the same `domicile` gets the
|
|
4
|
-
* same value. For watches and stores that every bar, panel and the lock
|
|
5
|
-
* screen share without a provider passing them down.
|
|
6
|
-
*/
|
|
7
|
-
export declare const perDesktop: <T>(make: (domicile: Domicile) => T) => ((domicile: Domicile) => T);
|
package/dist/per-desktop.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `make`, run once per desktop: every caller with the same `domicile` gets the
|
|
3
|
-
* same value. For watches and stores that every bar, panel and the lock
|
|
4
|
-
* screen share without a provider passing them down.
|
|
5
|
-
*/
|
|
6
|
-
export const perDesktop = (make) => {
|
|
7
|
-
const made = new WeakMap();
|
|
8
|
-
return (domicile) => {
|
|
9
|
-
const known = made.get(domicile);
|
|
10
|
-
if (known === undefined) {
|
|
11
|
-
const value = make(domicile);
|
|
12
|
-
made.set(domicile, value);
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return known;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
};
|