@tearleads/windowing 0.2.22 → 0.2.24
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 +94 -0
- package/desktop/DesktopIcon.d.ts +28 -0
- package/desktop/DesktopIcon.js +38 -0
- package/desktop/DesktopIcon.js.map +1 -0
- package/desktop/DesktopIconMenu.d.ts +18 -0
- package/desktop/DesktopIconMenu.js +14 -0
- package/desktop/DesktopIconMenu.js.map +1 -0
- package/desktop/DesktopIcons.css +69 -0
- package/desktop/DesktopIcons.d.ts +26 -0
- package/desktop/DesktopIcons.js +43 -0
- package/desktop/DesktopIcons.js.map +1 -0
- package/desktop/desktopState.d.ts +43 -0
- package/desktop/desktopState.js +142 -0
- package/desktop/desktopState.js.map +1 -0
- package/desktop/desktopStateStorage.d.ts +21 -0
- package/desktop/desktopStateStorage.js +66 -0
- package/desktop/desktopStateStorage.js.map +1 -0
- package/desktop/useDesktopIconDrag.d.ts +24 -0
- package/desktop/useDesktopIconDrag.js +70 -0
- package/desktop/useDesktopIconDrag.js.map +1 -0
- package/desktop/useDesktopIconSelection.d.ts +12 -0
- package/desktop/useDesktopIconSelection.js +46 -0
- package/desktop/useDesktopIconSelection.js.map +1 -0
- package/desktop/useDesktopIconState.d.ts +17 -0
- package/desktop/useDesktopIconState.js +77 -0
- package/desktop/useDesktopIconState.js.map +1 -0
- package/desktop/useDesktopSurface.d.ts +10 -0
- package/desktop/useDesktopSurface.js +27 -0
- package/desktop/useDesktopSurface.js.map +1 -0
- package/display/DisplayProperties.css +106 -0
- package/display/DisplayProperties.d.ts +8 -0
- package/display/DisplayProperties.js +36 -0
- package/display/DisplayProperties.js.map +1 -0
- package/index.d.ts +9 -0
- package/index.js +10 -2
- package/index.js.map +1 -1
- package/launcher/LauncherNavigationProvider.js +1 -0
- package/launcher/LauncherNavigationProvider.js.map +1 -1
- package/launcher/launcherDefinition.d.ts +6 -0
- package/launcher/launcherDefinition.js.map +1 -1
- package/package.json +1 -1
- package/wallpaper/DesktopWallpaper.d.ts +15 -0
- package/wallpaper/DesktopWallpaper.js +22 -0
- package/wallpaper/DesktopWallpaper.js.map +1 -0
- package/wallpaper/Wallpaper.css +34 -0
- package/wallpaper/WallpaperProvider.d.ts +33 -0
- package/wallpaper/WallpaperProvider.js +37 -0
- package/wallpaper/WallpaperProvider.js.map +1 -0
- package/wallpaper/tessellations.d.ts +13 -0
- package/wallpaper/tessellations.js +151 -0
- package/wallpaper/tessellations.js.map +1 -0
- package/wallpaper/wallpapers.d.ts +52 -0
- package/wallpaper/wallpapers.js +28 -0
- package/wallpaper/wallpapers.js.map +1 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One tile of a repeating wallpaper pattern. The tile's SVG is a mask, not a
|
|
4
|
+
* picture: where its shapes are opaque the wallpaper paints its ink, where
|
|
5
|
+
* they are translucent (`fill-opacity`, `stroke-opacity`) it paints that share
|
|
6
|
+
* of the ink, and elsewhere the base shows. The markup's own colors are
|
|
7
|
+
* ignored, so one tile follows every theme.
|
|
8
|
+
*/
|
|
9
|
+
export interface WallpaperTile {
|
|
10
|
+
/** The tile's height in CSS pixels; the pattern repeats at this size. */
|
|
11
|
+
readonly height: number;
|
|
12
|
+
/**
|
|
13
|
+
* The tile as a standalone SVG document (with its `xmlns`), drawn edge to
|
|
14
|
+
* edge across `width` by `height` so neighboring tiles meet seamlessly.
|
|
15
|
+
*/
|
|
16
|
+
readonly svg: string;
|
|
17
|
+
/** The tile's width in CSS pixels. */
|
|
18
|
+
readonly width: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A desktop wallpaper a host offers: a base color and, optionally, a pattern
|
|
22
|
+
* repeated over it in an ink color. Unless it names its own, the colors come
|
|
23
|
+
* from the theme: the `--desktop-wallpaper-base` and `--desktop-wallpaper-ink`
|
|
24
|
+
* tokens where a host sets them, else the desk color (`--desktop-background`,
|
|
25
|
+
* then `--color-light`) under a faint wash of `--color-dark`.
|
|
26
|
+
*/
|
|
27
|
+
export interface WallpaperDefinition<Id extends string = string> {
|
|
28
|
+
/** A CSS color under the pattern. */
|
|
29
|
+
readonly base?: string | undefined;
|
|
30
|
+
readonly id: Id;
|
|
31
|
+
/** A CSS color the pattern paints in. */
|
|
32
|
+
readonly ink?: string | undefined;
|
|
33
|
+
/** The wallpaper's name, as Display Properties lists it. */
|
|
34
|
+
readonly label: string;
|
|
35
|
+
/** The repeating pattern. Without one the wallpaper is its base alone. */
|
|
36
|
+
readonly tile?: WallpaperTile | undefined;
|
|
37
|
+
}
|
|
38
|
+
type WallpaperStyle = CSSProperties & {
|
|
39
|
+
"--wallpaper-base": string;
|
|
40
|
+
"--wallpaper-ink": string;
|
|
41
|
+
"--wallpaper-mask"?: string;
|
|
42
|
+
"--wallpaper-size"?: string;
|
|
43
|
+
};
|
|
44
|
+
/** The tile's SVG as a `url()` value. */
|
|
45
|
+
export declare function wallpaperTileUrl(tile: WallpaperTile): string;
|
|
46
|
+
/**
|
|
47
|
+
* The custom properties a `.wallpaper-pattern` element paints a wallpaper
|
|
48
|
+
* from: its colors, and its tile as a mask repeated at the tile's size.
|
|
49
|
+
*/
|
|
50
|
+
export declare function wallpaperStyle(wallpaper: WallpaperDefinition): WallpaperStyle;
|
|
51
|
+
export declare function findWallpaper<Id extends string>(wallpapers: readonly WallpaperDefinition<Id>[], id: string | null | undefined): WallpaperDefinition<Id> | undefined;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The theme's colors, resolved on the wallpaper's own element, so a theme
|
|
2
|
+
// scoped below the document root reaches the desktop and the previews alike.
|
|
3
|
+
const THEME_BASE = "var(--desktop-wallpaper-base, var(--desktop-background, var(--color-light)))";
|
|
4
|
+
const THEME_INK = "var(--desktop-wallpaper-ink, color-mix(in srgb, var(--color-dark) 12%, transparent))";
|
|
5
|
+
/** The tile's SVG as a `url()` value. */
|
|
6
|
+
export function wallpaperTileUrl(tile) {
|
|
7
|
+
return `url("data:image/svg+xml,${encodeURIComponent(tile.svg)}")`;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The custom properties a `.wallpaper-pattern` element paints a wallpaper
|
|
11
|
+
* from: its colors, and its tile as a mask repeated at the tile's size.
|
|
12
|
+
*/
|
|
13
|
+
export function wallpaperStyle(wallpaper) {
|
|
14
|
+
const style = {
|
|
15
|
+
"--wallpaper-base": wallpaper.base ?? THEME_BASE,
|
|
16
|
+
"--wallpaper-ink": wallpaper.ink ?? THEME_INK,
|
|
17
|
+
};
|
|
18
|
+
if (wallpaper.tile) {
|
|
19
|
+
style["--wallpaper-mask"] = wallpaperTileUrl(wallpaper.tile);
|
|
20
|
+
style["--wallpaper-size"] =
|
|
21
|
+
`${wallpaper.tile.width}px ${wallpaper.tile.height}px`;
|
|
22
|
+
}
|
|
23
|
+
return style;
|
|
24
|
+
}
|
|
25
|
+
export function findWallpaper(wallpapers, id) {
|
|
26
|
+
return wallpapers.find((wallpaper) => wallpaper.id === id);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=wallpapers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallpapers.js","sourceRoot":"","sources":["../../../home/runner/work/tearleads/tearleads/packages/windowing/src/wallpaper/wallpapers.ts"],"names":[],"mappings":"AAwCA,0EAA0E;AAC1E,6EAA6E;AAC7E,MAAM,UAAU,GACd,8EAA8E,CAAC;AACjF,MAAM,SAAS,GACb,sFAAsF,CAAC;AASzF,yCAAyC;AACzC,MAAM,UAAU,gBAAgB,CAAC,IAAmB;IAClD,OAAO,2BAA2B,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B;IAC3D,MAAM,KAAK,GAAmB;QAC5B,kBAAkB,EAAE,SAAS,CAAC,IAAI,IAAI,UAAU;QAChD,iBAAiB,EAAE,SAAS,CAAC,GAAG,IAAI,SAAS;KAC9C,CAAC;IACF,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,CAAC,kBAAkB,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7D,KAAK,CAAC,kBAAkB,CAAC;YACvB,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC;IAC3D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,UAA8C,EAC9C,EAA6B;IAE7B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import type { CSSProperties } from \"react\";\n\n/**\n * One tile of a repeating wallpaper pattern. The tile's SVG is a mask, not a\n * picture: where its shapes are opaque the wallpaper paints its ink, where\n * they are translucent (`fill-opacity`, `stroke-opacity`) it paints that share\n * of the ink, and elsewhere the base shows. The markup's own colors are\n * ignored, so one tile follows every theme.\n */\nexport interface WallpaperTile {\n /** The tile's height in CSS pixels; the pattern repeats at this size. */\n readonly height: number;\n /**\n * The tile as a standalone SVG document (with its `xmlns`), drawn edge to\n * edge across `width` by `height` so neighboring tiles meet seamlessly.\n */\n readonly svg: string;\n /** The tile's width in CSS pixels. */\n readonly width: number;\n}\n\n/**\n * A desktop wallpaper a host offers: a base color and, optionally, a pattern\n * repeated over it in an ink color. Unless it names its own, the colors come\n * from the theme: the `--desktop-wallpaper-base` and `--desktop-wallpaper-ink`\n * tokens where a host sets them, else the desk color (`--desktop-background`,\n * then `--color-light`) under a faint wash of `--color-dark`.\n */\nexport interface WallpaperDefinition<Id extends string = string> {\n /** A CSS color under the pattern. */\n readonly base?: string | undefined;\n readonly id: Id;\n /** A CSS color the pattern paints in. */\n readonly ink?: string | undefined;\n /** The wallpaper's name, as Display Properties lists it. */\n readonly label: string;\n /** The repeating pattern. Without one the wallpaper is its base alone. */\n readonly tile?: WallpaperTile | undefined;\n}\n\n// The theme's colors, resolved on the wallpaper's own element, so a theme\n// scoped below the document root reaches the desktop and the previews alike.\nconst THEME_BASE =\n \"var(--desktop-wallpaper-base, var(--desktop-background, var(--color-light)))\";\nconst THEME_INK =\n \"var(--desktop-wallpaper-ink, color-mix(in srgb, var(--color-dark) 12%, transparent))\";\n\ntype WallpaperStyle = CSSProperties & {\n \"--wallpaper-base\": string;\n \"--wallpaper-ink\": string;\n \"--wallpaper-mask\"?: string;\n \"--wallpaper-size\"?: string;\n};\n\n/** The tile's SVG as a `url()` value. */\nexport function wallpaperTileUrl(tile: WallpaperTile): string {\n return `url(\"data:image/svg+xml,${encodeURIComponent(tile.svg)}\")`;\n}\n\n/**\n * The custom properties a `.wallpaper-pattern` element paints a wallpaper\n * from: its colors, and its tile as a mask repeated at the tile's size.\n */\nexport function wallpaperStyle(wallpaper: WallpaperDefinition): WallpaperStyle {\n const style: WallpaperStyle = {\n \"--wallpaper-base\": wallpaper.base ?? THEME_BASE,\n \"--wallpaper-ink\": wallpaper.ink ?? THEME_INK,\n };\n if (wallpaper.tile) {\n style[\"--wallpaper-mask\"] = wallpaperTileUrl(wallpaper.tile);\n style[\"--wallpaper-size\"] =\n `${wallpaper.tile.width}px ${wallpaper.tile.height}px`;\n }\n return style;\n}\n\nexport function findWallpaper<Id extends string>(\n wallpapers: readonly WallpaperDefinition<Id>[],\n id: string | null | undefined,\n): WallpaperDefinition<Id> | undefined {\n return wallpapers.find((wallpaper) => wallpaper.id === id);\n}\n"]}
|