@thi.ng/imgui 3.2.0 → 3.2.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-02-05T13:48:14Z
3
+ - **Last updated**: 2025-02-05T15:49:26Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [3.2.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/imgui@3.2.1) (2025-02-05)
15
+
16
+ #### 🩹 Bug fixes
17
+
18
+ - update dropdown label handling ([8dc2e93](https://github.com/thi-ng/umbrella/commit/8dc2e93))
19
+ - show label in default state if selected value is undefined
20
+ (e.g. because `value` was set to -1)
21
+ - update ramp color handling, add `fill` option ([874d701](https://github.com/thi-ng/umbrella/commit/874d701))
22
+
14
23
  ## [3.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/imgui@3.2.0) (2025-02-05)
15
24
 
16
25
  #### 🚀 Features
@@ -70,7 +70,7 @@ const dropdown = ({
70
70
  gui,
71
71
  layout: box,
72
72
  id: `${id}-${value}`,
73
- label: items[value],
73
+ label: items[value] ?? label,
74
74
  labelHover: label,
75
75
  info
76
76
  })) {
@@ -1,6 +1,6 @@
1
1
  import type { Maybe } from "@thi.ng/api";
2
2
  import type { Ramp } from "@thi.ng/ramp";
3
- import { type ComponentOpts } from "../api.js";
3
+ import { type Color, type ComponentOpts } from "../api.js";
4
4
  export interface RampOpts extends Omit<ComponentOpts, "label"> {
5
5
  ramp: Ramp<number>;
6
6
  /**
@@ -23,6 +23,10 @@ export interface RampOpts extends Omit<ComponentOpts, "label"> {
23
23
  * @defaultValue 100
24
24
  */
25
25
  samples?: number;
26
+ /**
27
+ * Optional fill color override (default: GUI text color)
28
+ */
29
+ fill?: Color;
26
30
  }
27
- export declare const ramp: ({ gui, layout, id, ramp, mode, info, eps, samples, }: RampOpts) => Maybe<Ramp<number>>;
31
+ export declare const ramp: ({ gui, layout, id, ramp, mode, info, eps, samples, fill, }: RampOpts) => Maybe<Ramp<number>>;
28
32
  //# sourceMappingURL=ramp.d.ts.map
@@ -23,7 +23,8 @@ const ramp = ({
23
23
  mode = 0,
24
24
  info,
25
25
  eps = 0.05,
26
- samples = 100
26
+ samples = 100,
27
+ fill = gui.textColor(false)
27
28
  }) => {
28
29
  const { x, y, w, h } = layoutBox(layout);
29
30
  const maxX = x + w;
@@ -33,7 +34,6 @@ const ramp = ({
33
34
  const key = hash([x, y, w, h]);
34
35
  gui.registerID(id, key);
35
36
  const box = gui.resource(id, key, () => rect([x, y], [w, h]));
36
- const col = gui.textColor(false);
37
37
  const hover = isHoverSlider(gui, id, box, "move");
38
38
  const stops = ramp2.stops;
39
39
  let selID = -1;
@@ -79,7 +79,7 @@ const ramp = ({
79
79
  mix2([], pos, maxPos, [1, stops[stops.length - 1][1]]),
80
80
  [maxX, maxY]
81
81
  ],
82
- { fill: col }
82
+ { fill }
83
83
  )
84
84
  ),
85
85
  ...stops.map(([t], i) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/imgui",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Immediate mode GUI with flexible state handling & data only shape output",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -162,5 +162,5 @@
162
162
  ],
163
163
  "year": 2019
164
164
  },
165
- "gitHead": "71aa5c93fddd00b159db8f46cb6a53e413e0e261\n"
165
+ "gitHead": "c89ca042d58976982c31c1a7791bc64998e09128\n"
166
166
  }