@phreshos/core 0.1.6 → 0.1.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 +27 -25
- package/dist/local-window.d.ts +4 -4
- package/dist/main.d.ts +1 -1
- package/dist/theme.d.ts +35 -2
- package/dist/theme.js +15 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,23 +59,23 @@ explicit, asynchronous read of one complete, immutable value. `Theme` extends
|
|
|
59
59
|
the ordinary `Subscribable` capability with a `change` event; it has no
|
|
60
60
|
dedicated subscription shape of its own.
|
|
61
61
|
|
|
62
|
-
Theme properties are expressed as concrete
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
Theme properties are expressed as concrete values. `themeLimits` declares the
|
|
63
|
+
contractual customization bounds for spacing, corner radius, glass-material,
|
|
64
|
+
and Surface properties; implementing authorities validate replacements against those
|
|
65
|
+
bounds. Core defines one fixed numeric scale around any explicit number and one
|
|
66
|
+
fixed color scale around any explicit CSS color. `standardTheme` is the
|
|
67
|
+
canonical reusable default value for that contract, shared by systems,
|
|
68
|
+
interfaces, websites, and Programs that need the same baseline. It is not an
|
|
69
|
+
authoritative environment's mutable Theme state. Background, foreground, and
|
|
70
|
+
accent remain independent CSS color sources. Surface adds a concrete color,
|
|
71
|
+
grain intensity, animation rate, optional backdrop blur, and material opacity;
|
|
72
|
+
its standard backdrop is zero, so blur is opt-in. The declared glass-opacity
|
|
73
|
+
range ends at `0.3`.
|
|
74
|
+
|
|
75
|
+
`createThemeSnapshot()` copies and freezes one complete value at the contract
|
|
76
|
+
boundary. An implementing authority remains responsible for validation,
|
|
77
|
+
persistence, and the current value; its own schema may derive its defaults from
|
|
78
|
+
`standardTheme` rather than duplicating them.
|
|
79
79
|
|
|
80
80
|
Derived variants are calculations, not persisted `Theme` state. `numericScale()`
|
|
81
81
|
produces `xsmall`, `small`, `medium`, `large`, and `xlarge`, preserving the
|
|
@@ -86,9 +86,9 @@ supplied value exactly at `medium`. `color()` produces `subtle`, `soft`, `base`,
|
|
|
86
86
|
after that registration exists. It never supplies an initial snapshot and
|
|
87
87
|
never replays a change published earlier; Programs request the current
|
|
88
88
|
snapshot explicitly when they need one. `WritableTheme` adds asynchronous
|
|
89
|
-
authority to replace the value
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
authority to replace the value. A read-only environment exposes `Theme`, while
|
|
90
|
+
an authorized environment may expose `WritableTheme` without altering the
|
|
91
|
+
shared lifecycle.
|
|
92
92
|
|
|
93
93
|
`Colorable`, `Sizable`, `Shapeable`, `Variantable`, and `Elevatable` are
|
|
94
94
|
independent element capabilities whose concrete value vocabularies are defined
|
|
@@ -237,11 +237,13 @@ persistence, upload, Process creation, or rendering implementation.
|
|
|
237
237
|
## Local representation
|
|
238
238
|
|
|
239
239
|
`Window` is the authoritative, subscribable presentation state shared through
|
|
240
|
-
the system. `LocalWindow`
|
|
241
|
-
the current
|
|
242
|
-
never change or publish authoritative state.
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
the system. `LocalWindow` describes one Client Window's physical representation
|
|
241
|
+
on the current desktop. Its reads and commands are deliberately eventless and
|
|
242
|
+
never change or publish authoritative state. Client SDKs may attach this
|
|
243
|
+
capability to their Window handles; Server SDKs must not. A desktop projects
|
|
244
|
+
authoritative changes onto an ordinary `window` layer, while `under` and `over`
|
|
245
|
+
representations receive their initial truth and control their local projection
|
|
246
|
+
thereafter.
|
|
245
247
|
|
|
246
248
|
`SurfaceSettings` describes optional host-rendered material belonging to one
|
|
247
249
|
live `under` or `over` representation. Calling `set()` without settings creates
|
package/dist/local-window.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type SurfaceSettings = Readonly<{
|
|
|
9
9
|
/** A Theme level, CSS pixels, or maximum proportional rounding. */
|
|
10
10
|
radius?: ScaleLevel | number | "full";
|
|
11
11
|
}>;
|
|
12
|
-
/** Local Surface commands for
|
|
12
|
+
/** Local Surface commands for one Client Window representation. */
|
|
13
13
|
export interface LocalWindowSurface {
|
|
14
14
|
/** Creates or replaces the Surface, optionally as a visual transaction. */
|
|
15
15
|
set(settings?: SurfaceSettings, transaction?: Transaction): Promise<void>;
|
|
@@ -17,9 +17,9 @@ export interface LocalWindowSurface {
|
|
|
17
17
|
remove(): Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* One Client Window's physical representation on the current desktop. It has
|
|
21
|
+
* no events: its commands neither change authoritative state nor broadcast
|
|
22
|
+
* anything.
|
|
23
23
|
*/
|
|
24
24
|
export interface LocalWindow {
|
|
25
25
|
readonly surface: LocalWindowSurface;
|
package/dist/main.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { type DesktopWallpaper, type FileWallpaper, type WallpaperLaunch } from
|
|
|
10
10
|
export { isRelativeValue, parseRelativeValue, type RelativeValue, type Value } from "./value.js";
|
|
11
11
|
export { color, type ColorLevel, type ColorScale } from "./color.js";
|
|
12
12
|
export { isScaleLevel, numericScale, scale, scaleMultiplier, type NumericScale, type ScaleLevel } from "./scale.js";
|
|
13
|
-
export { createThemeSnapshot, standardTheme, themeLimits, type Colorable, type Elevatable, type Shapeable, type Sizable, type Theme, type ThemeEvents, type ThemeGlass, type ThemeProperties, type ThemeRange, type Variantable, type WritableTheme } from "./theme.js";
|
|
13
|
+
export { createThemeSnapshot, standardTheme, themeLimits, type Colorable, type Elevatable, type Shapeable, type Sizable, type Theme, type ThemeEvents, type ThemeGlass, type ThemeProperties, type ThemeRange, type ThemeSurface, type Variantable, type WritableTheme } from "./theme.js";
|
|
14
14
|
export { type DirectoryStat, type EntryStat, type FileStat, type OtherStat, type ProgramArea, type ProgramStore } from "./storage.js";
|
|
15
15
|
export { type LogKind, type LogRecord, type LogSource, type ProgramSql } from "./sql.js";
|
|
16
16
|
export { Endpoint, type AskCapture, type AskMessage, type AskObserver, type EndpointTraffic, type TrafficCapture, type TrafficEvents, type TrafficMessage } from "./endpoint.js";
|
package/dist/theme.d.ts
CHANGED
|
@@ -19,9 +19,20 @@ export type ThemeGlass = Readonly<{
|
|
|
19
19
|
/** Default material opacity from zero to the system's glass cap. */
|
|
20
20
|
opacity: number;
|
|
21
21
|
}>;
|
|
22
|
+
/** Concrete defaults for the shared opaque Surface material. */
|
|
23
|
+
export type ThemeSurface = Readonly<{
|
|
24
|
+
/** Grain intensity from zero to one. */
|
|
25
|
+
grain: number;
|
|
26
|
+
/** Grain texture changes per second. */
|
|
27
|
+
animation: number;
|
|
28
|
+
/** Optional backdrop blur in CSS pixels. */
|
|
29
|
+
backdrop: number;
|
|
30
|
+
/** Material opacity from zero to one. */
|
|
31
|
+
opacity: number;
|
|
32
|
+
}>;
|
|
22
33
|
/** The complete set of system-defined Theme properties. */
|
|
23
34
|
export type ThemeProperties = Readonly<{
|
|
24
|
-
/** CSS color underlying
|
|
35
|
+
/** CSS color underlying interfaces and painted by Surface materials. */
|
|
25
36
|
background: string;
|
|
26
37
|
/** CSS color used for shared interface content. */
|
|
27
38
|
foreground: string;
|
|
@@ -33,6 +44,8 @@ export type ThemeProperties = Readonly<{
|
|
|
33
44
|
radius: number;
|
|
34
45
|
/** Default values for the shared glass material. */
|
|
35
46
|
glass: ThemeGlass;
|
|
47
|
+
/** Default values for the shared opaque Surface material. */
|
|
48
|
+
surface: ThemeSurface;
|
|
36
49
|
}>;
|
|
37
50
|
/** System-owned bounds for Theme customization. */
|
|
38
51
|
export declare const themeLimits: Readonly<{
|
|
@@ -66,10 +79,28 @@ export declare const themeLimits: Readonly<{
|
|
|
66
79
|
maximum: 0.3;
|
|
67
80
|
}>;
|
|
68
81
|
}>;
|
|
82
|
+
surface: Readonly<{
|
|
83
|
+
grain: Readonly<{
|
|
84
|
+
minimum: 0;
|
|
85
|
+
maximum: 1;
|
|
86
|
+
}>;
|
|
87
|
+
animation: Readonly<{
|
|
88
|
+
minimum: 0;
|
|
89
|
+
maximum: 16;
|
|
90
|
+
}>;
|
|
91
|
+
backdrop: Readonly<{
|
|
92
|
+
minimum: 0;
|
|
93
|
+
maximum: 24;
|
|
94
|
+
}>;
|
|
95
|
+
opacity: Readonly<{
|
|
96
|
+
minimum: 0;
|
|
97
|
+
maximum: 1;
|
|
98
|
+
}>;
|
|
99
|
+
}>;
|
|
69
100
|
}>;
|
|
70
101
|
/** Complete standard Theme available to every environment. */
|
|
71
102
|
export declare const standardTheme: Readonly<{
|
|
72
|
-
/** CSS color underlying
|
|
103
|
+
/** CSS color underlying interfaces and painted by Surface materials. */
|
|
73
104
|
background: string;
|
|
74
105
|
/** CSS color used for shared interface content. */
|
|
75
106
|
foreground: string;
|
|
@@ -81,6 +112,8 @@ export declare const standardTheme: Readonly<{
|
|
|
81
112
|
radius: number;
|
|
82
113
|
/** Default values for the shared glass material. */
|
|
83
114
|
glass: ThemeGlass;
|
|
115
|
+
/** Default values for the shared opaque Surface material. */
|
|
116
|
+
surface: ThemeSurface;
|
|
84
117
|
}>;
|
|
85
118
|
/** Creates a complete immutable Theme snapshot at the contract boundary. */
|
|
86
119
|
export declare function createThemeSnapshot(theme: ThemeProperties): ThemeProperties;
|
package/dist/theme.js
CHANGED
|
@@ -8,11 +8,17 @@ export const themeLimits = Object.freeze({
|
|
|
8
8
|
saturation: Object.freeze({ minimum: 1.25, maximum: 1.8 }),
|
|
9
9
|
brightness: Object.freeze({ minimum: 1.02, maximum: 1.1 }),
|
|
10
10
|
opacity: Object.freeze({ minimum: 0, maximum: 0.3 })
|
|
11
|
+
}),
|
|
12
|
+
surface: Object.freeze({
|
|
13
|
+
grain: Object.freeze({ minimum: 0, maximum: 1 }),
|
|
14
|
+
animation: Object.freeze({ minimum: 0, maximum: 16 }),
|
|
15
|
+
backdrop: Object.freeze({ minimum: 0, maximum: 24 }),
|
|
16
|
+
opacity: Object.freeze({ minimum: 0, maximum: 1 })
|
|
11
17
|
})
|
|
12
18
|
});
|
|
13
19
|
/** Complete standard Theme available to every environment. */
|
|
14
20
|
export const standardTheme = createThemeSnapshot({
|
|
15
|
-
background: "#
|
|
21
|
+
background: "#f5f4ee",
|
|
16
22
|
foreground: "#183447",
|
|
17
23
|
accent: "#4c9cff",
|
|
18
24
|
spacing: 12,
|
|
@@ -23,12 +29,19 @@ export const standardTheme = createThemeSnapshot({
|
|
|
23
29
|
saturation: 1.8,
|
|
24
30
|
brightness: 1.06,
|
|
25
31
|
opacity: 0.12
|
|
32
|
+
},
|
|
33
|
+
surface: {
|
|
34
|
+
grain: 0.04,
|
|
35
|
+
animation: 0,
|
|
36
|
+
backdrop: 0,
|
|
37
|
+
opacity: 1
|
|
26
38
|
}
|
|
27
39
|
});
|
|
28
40
|
/** Creates a complete immutable Theme snapshot at the contract boundary. */
|
|
29
41
|
export function createThemeSnapshot(theme) {
|
|
30
42
|
return Object.freeze({
|
|
31
43
|
...theme,
|
|
32
|
-
glass: Object.freeze({ ...theme.glass })
|
|
44
|
+
glass: Object.freeze({ ...theme.glass }),
|
|
45
|
+
surface: Object.freeze({ ...theme.surface })
|
|
33
46
|
});
|
|
34
47
|
}
|