@weasel-js/hud 1.11.1 → 1.13.0-rc.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/widget.d.ts CHANGED
@@ -24,7 +24,7 @@ export interface HudDrawCtx {
24
24
  * caller rather than read back off the DOM, so a HUD drawn headlessly is
25
25
  * themed the same way one drawn in a browser is. */
26
26
  tokens: ResolvedTheme;
27
- /** A color source as a hex, resolved against the theme, tone list, and
27
+ /** A color source as a hex, resolved against the theme, tint list, and
28
28
  * palette the hud was attached with; `undefined` for one nothing answers. */
29
29
  color(source: ColorSource): string | undefined;
30
30
  }
@@ -1,7 +1,7 @@
1
1
  import type { Widget, WidgetBounds, HudContentCtx } from '../../widget';
2
2
  import type { DrawCommand } from '@weasel-js/core/renderer';
3
3
  import { type ColorSource } from '@weasel-js/paint';
4
- import { type Stance } from '@weasel-js/theme';
4
+ import { type Emphasis, type Grade, type Stance } from '@weasel-js/theme';
5
5
  import { type WindowMetrics } from './zones';
6
6
  /** Options for a window widget. */
7
7
  export interface WindowOptions {
@@ -23,9 +23,15 @@ export interface WindowOptions {
23
23
  * `--wzl-stance-<stance>-<slot>` values restyle its fill, border and title,
24
24
  * as they do a DOM panel's. */
25
25
  stance?: Stance;
26
- /** Which of its peers the window is: an index into the theme's tone list,
27
- * or a color source. Mixed into the fill at the stance's `tone-mix`. */
28
- tone?: number | ColorSource;
26
+ /** How serious it is. Paints the tint, border, and title in the grade's
27
+ * color, over the stance's, as it does a DOM panel's. */
28
+ grade?: Grade;
29
+ /** How loudly it reads: `high` draws the border and title in the accent,
30
+ * `low` draws the title muted. A grade outranks it. */
31
+ emphasis?: Emphasis;
32
+ /** Which of its peers the window is: an index into the theme's tint list,
33
+ * or a color source. Mixed into the fill at the stance's `tint-mix`. */
34
+ tint?: number | ColorSource;
29
35
  /** Paints the interior. Drawn beneath every widget frame, clipped to
30
36
  * `contentRect`. Receives the scene data and view the hud layer was
31
37
  * handed — the one place hud sees either. */
@@ -66,7 +72,9 @@ export interface WindowWidget extends Widget {
66
72
  setHidden(hidden: boolean): void;
67
73
  setTitle(title: string): void;
68
74
  setStance(stance: Stance | undefined): void;
69
- setTone(tone: number | ColorSource | undefined): void;
75
+ setGrade(grade: Grade | undefined): void;
76
+ setEmphasis(emphasis: Emphasis | undefined): void;
77
+ setTint(tint: number | ColorSource | undefined): void;
70
78
  dispose(): void;
71
79
  }
72
80
  export declare function createWindow(opts: WindowOptions): WindowWidget;
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/widgets/window/window.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAAE,YAAY,EAAc,aAAa,EAChD,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,0BAA0B,CAAC;AAG7E,OAAO,EAAgC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAqD,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAEmB,KAAK,aAAa,EAC3C,MAAM,SAAS,CAAC;AAEjB,mCAAmC;AACnC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;4DAGwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACjC;;oCAEgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;6EACyE;IACzE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC5B;;kDAE8C;IAC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;uDAEmD;IACnD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IACtD,OAAO,IAAI,IAAI,CAAC;CACjB;AA2BD,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,CAmO9D"}
@@ -0,0 +1,12 @@
1
+ import { type Emphasis, type Grade, type Stance } from '@weasel-js/theme';
2
+ export type WindowLook = Record<'surface' | 'border-color' | 'border-style' | 'border-width' | 'tint-mix' | 'tint' | 'title-color' | 'title-case', string>;
3
+ /**
4
+ * The slots a window draws from, resolved as its DOM twin's generated CSS
5
+ * does: the stance's values, then the emphasis's, then the grade's.
6
+ */
7
+ export declare function windowLook(tokens: Readonly<Record<string, string>>, { stance, grade, emphasis }: {
8
+ stance?: Stance;
9
+ grade?: Grade;
10
+ emphasis?: Emphasis;
11
+ }): WindowLook;
12
+ //# sourceMappingURL=windowLook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windowLook.d.ts","sourceRoot":"","sources":["../../../src/widgets/window/windowLook.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EACvC,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,MAAM,CAC7B,SAAS,GAAG,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,EACjH,MAAM,CACP,CAAC;AAQF;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,GACnF,UAAU,CAqBZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasel-js/hud",
3
- "version": "1.11.1",
3
+ "version": "1.13.0-rc.0",
4
4
  "description": "WebGL-rendered UI widgets that composite into a weasel canvas",
5
5
  "weasel": {
6
6
  "needs": ["webgl2"]
@@ -24,18 +24,18 @@
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=18",
27
- "@weasel-js/core": "1.11.1",
28
- "@weasel-js/font": "1.11.1"
27
+ "@weasel-js/core": "1.13.0-rc.0",
28
+ "@weasel-js/font": "1.13.0-rc.0"
29
29
  },
30
30
  "dependencies": {
31
- "@weasel-js/geom": "1.11.1",
32
- "@weasel-js/gestures": "1.11.1",
33
- "@weasel-js/icons": "1.11.1",
34
- "@weasel-js/loupe": "1.11.1",
35
- "@weasel-js/menu": "1.11.1",
36
- "@weasel-js/paint": "1.11.1",
37
- "@weasel-js/registry": "1.11.1",
38
- "@weasel-js/theme": "1.11.1"
31
+ "@weasel-js/geom": "1.13.0-rc.0",
32
+ "@weasel-js/gestures": "1.13.0-rc.0",
33
+ "@weasel-js/icons": "1.13.0-rc.0",
34
+ "@weasel-js/loupe": "1.13.0-rc.0",
35
+ "@weasel-js/menu": "1.13.0-rc.0",
36
+ "@weasel-js/paint": "1.13.0-rc.0",
37
+ "@weasel-js/registry": "1.13.0-rc.0",
38
+ "@weasel-js/theme": "1.13.0-rc.0"
39
39
  },
40
40
  "author": "orochi235",
41
41
  "homepage": "https://orochi235.github.io/weasel/",