svelte-tweakpane-ui 1.1.4 → 1.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.
Files changed (73) hide show
  1. package/dist/control/Button.svelte.d.ts +3 -2
  2. package/dist/control/ButtonGrid.svelte.d.ts +20 -9
  3. package/dist/control/Checkbox.svelte +3 -1
  4. package/dist/control/Checkbox.svelte.d.ts +28 -7
  5. package/dist/control/Color.svelte +1 -0
  6. package/dist/control/Color.svelte.d.ts +28 -7
  7. package/dist/control/CubicBezier.svelte +36 -11
  8. package/dist/control/CubicBezier.svelte.d.ts +40 -13
  9. package/dist/control/Image.svelte +1 -1
  10. package/dist/control/Image.svelte.d.ts +32 -7
  11. package/dist/control/IntervalSlider.svelte +1 -1
  12. package/dist/control/IntervalSlider.svelte.d.ts +29 -8
  13. package/dist/control/List.svelte +19 -2
  14. package/dist/control/List.svelte.d.ts +34 -9
  15. package/dist/control/Point.svelte +1 -0
  16. package/dist/control/Point.svelte.d.ts +39 -10
  17. package/dist/control/RadioGrid.svelte +4 -2
  18. package/dist/control/RadioGrid.svelte.d.ts +38 -13
  19. package/dist/control/Ring.svelte +1 -1
  20. package/dist/control/Ring.svelte.d.ts +36 -10
  21. package/dist/control/RotationEuler.svelte +1 -0
  22. package/dist/control/RotationEuler.svelte.d.ts +43 -74
  23. package/dist/control/RotationQuaternion.svelte +1 -0
  24. package/dist/control/RotationQuaternion.svelte.d.ts +28 -12
  25. package/dist/control/Slider.svelte +3 -1
  26. package/dist/control/Slider.svelte.d.ts +32 -11
  27. package/dist/control/Text.svelte +7 -9
  28. package/dist/control/Text.svelte.d.ts +28 -7
  29. package/dist/control/Textarea.svelte +21 -7
  30. package/dist/control/Textarea.svelte.d.ts +38 -20
  31. package/dist/control/Wheel.svelte +3 -1
  32. package/dist/control/Wheel.svelte.d.ts +30 -9
  33. package/dist/core/Binding.svelte +39 -7
  34. package/dist/core/Binding.svelte.d.ts +28 -7
  35. package/dist/core/Blade.svelte.d.ts +17 -7
  36. package/dist/core/Pane.svelte +9 -3
  37. package/dist/core/Pane.svelte.d.ts +98 -71
  38. package/dist/core/Separator.svelte.d.ts +12 -6
  39. package/dist/extra/AutoObject.svelte +28 -5
  40. package/dist/extra/AutoObject.svelte.d.ts +17 -3
  41. package/dist/extra/AutoValue.svelte +4 -2
  42. package/dist/extra/AutoValue.svelte.d.ts +29 -9
  43. package/dist/extra/Element.svelte.d.ts +13 -7
  44. package/dist/index.d.ts +29 -12
  45. package/dist/internal/GenericBinding.svelte +1 -1
  46. package/dist/internal/GenericBinding.svelte.d.ts +14 -6
  47. package/dist/internal/GenericBladeFolding.svelte.d.ts +12 -6
  48. package/dist/internal/GenericInput.svelte +1 -1
  49. package/dist/internal/GenericInput.svelte.d.ts +14 -6
  50. package/dist/internal/GenericInputFolding.svelte +1 -1
  51. package/dist/internal/GenericInputFolding.svelte.d.ts +14 -6
  52. package/dist/internal/GenericMonitor.svelte.d.ts +11 -5
  53. package/dist/internal/GenericPane.svelte +21 -21
  54. package/dist/internal/GenericPane.svelte.d.ts +12 -2
  55. package/dist/internal/GenericSlider.svelte +1 -1
  56. package/dist/internal/GenericSlider.svelte.d.ts +15 -7
  57. package/dist/internal/InternalMonitorBoolean.svelte.d.ts +11 -5
  58. package/dist/internal/InternalMonitorNumber.svelte.d.ts +18 -7
  59. package/dist/internal/InternalMonitorString.svelte.d.ts +11 -5
  60. package/dist/internal/InternalPaneDraggable.svelte +18 -12
  61. package/dist/internal/InternalPaneDraggable.svelte.d.ts +13 -4
  62. package/dist/internal/InternalPaneFixed.svelte +3 -3
  63. package/dist/internal/InternalPaneFixed.svelte.d.ts +13 -4
  64. package/dist/internal/InternalPaneInline.svelte +6 -6
  65. package/dist/internal/InternalPaneInline.svelte.d.ts +72 -66
  66. package/dist/monitor/FpsGraph.svelte.d.ts +12 -6
  67. package/dist/monitor/Monitor.svelte.d.ts +45 -21
  68. package/dist/monitor/Profiler.svelte.d.ts +22 -9
  69. package/dist/monitor/WaveformMonitor.svelte.d.ts +11 -5
  70. package/dist/utils.d.ts +15 -0
  71. package/license.txt +1 -1
  72. package/package.json +22 -17
  73. package/readme.md +31 -4
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponent } from 'svelte';
2
2
  import type { Simplify } from '../utils';
3
+ import type { ValueChangeEvent } from '../utils.js';
3
4
  export type ListOptionsArray<T> = T[];
4
5
  export type ListOptionsObjectArray<T> = Array<{
5
6
  value: T;
@@ -9,6 +10,7 @@ export type ListOptionsRecord<T> = Record<string, T>;
9
10
  export type ListOptions<T> = Simplify<
10
11
  ListOptionsArray<T> | ListOptionsObjectArray<T> | ListOptionsRecord<T>
11
12
  >;
13
+ export type ListChangeEvent = ValueChangeEvent<unknown>;
12
14
  import type { ListBladeApi, ListBladeParams } from 'tweakpane';
13
15
  declare class __sveltets_Render<T extends any> {
14
16
  props(): Omit<
@@ -36,18 +38,24 @@ declare class __sveltets_Render<T extends any> {
36
38
  * Reference to internal Tweakpane
37
39
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
38
40
  *
39
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
40
- * functionality.
41
+ * This property is exposed for advanced use cases only, such as when implementing convenience
42
+ * components wrapping `<Blade>`'s functionality.
43
+ *
44
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
45
+ *
41
46
  * @bindable
42
47
  * @readonly
43
48
  */
44
49
  ref?: ListBladeApi<T> | undefined;
45
50
  /**
46
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
47
- * the blade.
51
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
52
+ * the `<Blade>`'s containing `<Pane>`.
53
+ *
54
+ * This property is exposed for advanced use cases only, such as when implementing convenience
55
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
56
+ *
57
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
48
58
  *
49
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
50
- * functionality in combination with a Tweakpane plugin.
51
59
  * @default `undefined`
52
60
  */
53
61
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -72,8 +80,19 @@ declare class __sveltets_Render<T extends any> {
72
80
  * */
73
81
  options: ListOptions<T>;
74
82
  };
75
- events(): {} & {
76
- [evt: string]: CustomEvent<any>;
83
+ events(): {
84
+ /**
85
+ * Fires when `value` changes.
86
+ *
87
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
88
+ *
89
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
90
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
91
+ *
92
+ * @extends ValueChangeEvent
93
+ * @event
94
+ * */
95
+ change: ListChangeEvent;
77
96
  };
78
97
  slots(): {};
79
98
  }
@@ -93,6 +112,8 @@ export type ListSlots<T extends any> = ReturnType<__sveltets_Render<T>['slots']>
93
112
  * Tweakpane's `addBlade` list variations is used instead of the `addBinding` method to allow for
94
113
  * additional value types. The `value` remains bindable via Svelte's reactivity.
95
114
  *
115
+ * @emits {ListChangeEvent} change - When `value` changes. (For advanced use cases. Prefer binding to `value`.)
116
+ *
96
117
  * Usage outside of a `<Pane>` component will implicitly wrap the color picker in `<Pane
97
118
  * position='inline'>`.
98
119
  *
@@ -101,7 +122,11 @@ export type ListSlots<T extends any> = ReturnType<__sveltets_Render<T>['slots']>
101
122
  * <script lang="ts">
102
123
  * import { List, type ListOptions } from 'svelte-tweakpane-ui';
103
124
  *
104
- * const options: ListOptions<number> = { b: 2, a: 1, c: 3 };
125
+ * const options: ListOptions<number> = {
126
+ * b: 2,
127
+ * a: 1,
128
+ * c: 3
129
+ * };
105
130
  * let selection: number = 1;
106
131
  * </script>
107
132
  *
@@ -71,6 +71,7 @@
71
71
  <GenericInputFolding
72
72
  bind:value={internalValue}
73
73
  bind:expanded
74
+ on:change
74
75
  {buttonClass}
75
76
  {options}
76
77
  {...removeKeys(
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponent } from 'svelte';
2
2
  import type { Simplify } from '../utils';
3
+ import type { ValueChangeEvent } from '../utils.js';
3
4
  import type { Point2dInputParams, Point3dInputParams, Point4dInputParams } from 'tweakpane';
4
5
  export type PointValue2dObject = {
5
6
  x: number;
@@ -35,6 +36,7 @@ export type PointOptions<
35
36
  : Dimensions extends '2'
36
37
  ? Point2dInputParams[Axis]
37
38
  : never;
39
+ export type PointChangeEvent = ValueChangeEvent<PointValue2d | PointValue3d | PointValue4d>;
38
40
  declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointValue4d> {
39
41
  props(): Omit<
40
42
  Omit<
@@ -90,18 +92,24 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
90
92
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
91
93
  * this control.
92
94
  *
93
- * This is primarily for internal use, when implementing convenience components wrapping
94
- * Binding's functionality.
95
+ * This property is exposed for advanced use cases only, such as when implementing convenience
96
+ * components wrapping `<Binding>`'s functionality.
97
+ *
98
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
99
+ *
95
100
  * @bindable
96
101
  * @readonly
97
102
  */
98
103
  ref?: import('../internal/GenericInput.svelte').GenericInputRef | undefined;
99
104
  /**
100
105
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
101
- * the binding's containing `<Pane>`.
106
+ * the `<Binding>`'s containing `<Pane>`.
107
+ *
108
+ * This property is exposed for advanced use cases only, such as when implementing convenience
109
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
110
+ *
111
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
102
112
  *
103
- * This is primarily for internal use, when implementing convenience components wrapping
104
- * Binding's functionality in combination with a Tweakpane plugin.
105
113
  * @default `undefined`
106
114
  */
107
115
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -166,7 +174,7 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
166
174
  * */
167
175
  max?: number | undefined;
168
176
  /**
169
- * A function to customize the point value's formatting (e.g. rounding, etc.).
177
+ * A function to customize the point value's string representation (e.g. rounding, etc.).
170
178
  * @default `undefined` \
171
179
  * Normal `.toString()` formatting.
172
180
  * */
@@ -286,8 +294,19 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
286
294
  | undefined;
287
295
  }
288
296
  : unknown);
289
- events(): {} & {
290
- [evt: string]: CustomEvent<any>;
297
+ events(): {
298
+ /**
299
+ * Fires when `value` changes.
300
+ *
301
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
302
+ *
303
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
304
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
305
+ *
306
+ * @extends ValueChangeEvent
307
+ * @event
308
+ * */
309
+ change: PointChangeEvent;
291
310
  };
292
311
  slots(): {};
293
312
  }
@@ -312,6 +331,8 @@ export type PointSlots<T extends PointValue2d | PointValue3d | PointValue4d> = R
312
331
  * `<Point>` is a dynamic component, and the availability of the `optionsZ` and `optionsW` props will
313
332
  * change depending on the number of dimensions in the `value`.
314
333
  *
334
+ * @emits {PointChangeEvent} change - When `value` changes. (This event is provided for advanced use cases. Prefer binding to `value`.)
335
+ *
315
336
  * Usage outside of a `<Pane>` component will implicitly wrap the point picker in a `<Pane
316
337
  * position='inline'>` component.
317
338
  *
@@ -332,9 +353,17 @@ export type PointSlots<T extends PointValue2d | PointValue3d | PointValue4d> = R
332
353
  * let point3d: PointValue3d = [0, 0, 0];
333
354
  *
334
355
  * // dimension-specific option type needs to know the type of the point value
335
- * let point3dXOptions: PointOptions<'3', 'x'> = { min: -100, max: 100 };
356
+ * let point3dXOptions: PointOptions<'3', 'x'> = {
357
+ * min: -100,
358
+ * max: 100
359
+ * };
336
360
  *
337
- * let point4d: PointValue4d = { x: 0, y: 0, z: 0, w: 0 };
361
+ * let point4d: PointValue4d = {
362
+ * x: 0,
363
+ * y: 0,
364
+ * z: 0,
365
+ * w: 0
366
+ * };
338
367
  * </script>
339
368
  *
340
369
  * <Point
@@ -1,4 +1,6 @@
1
- <script generics="T extends number | string | boolean">
1
+ <script context="module"></script>
2
+
3
+ <script generics="T extends boolean | number | string">
2
4
  import * as pluginModule from '@tweakpane/plugin-essentials';
3
5
  import ClsPad from '../internal/ClsPad.svelte';
4
6
  import GenericInput from '../internal/GenericInput.svelte';
@@ -35,7 +37,7 @@
35
37
  };
36
38
  </script>
37
39
 
38
- <GenericInput bind:value {options} plugin={pluginModule} {...$$restProps} />
40
+ <GenericInput bind:value on:change {options} plugin={pluginModule} {...$$restProps} />
39
41
  {#if !BROWSER}
40
42
  <ClsPad keysAdd={fillWith('containerUnitSize', gridDimensions.rows - 1)} theme={$$props.theme} />
41
43
  <div style:height={`${2 * (gridDimensions.rows - 1)}px`} />
@@ -1,5 +1,7 @@
1
1
  import { SvelteComponent } from 'svelte';
2
- declare class __sveltets_Render<T extends number | string | boolean> {
2
+ import type { ValueChangeEvent } from '../utils.js';
3
+ export type RadioGridChangeEvent = ValueChangeEvent<boolean | number | string>;
4
+ declare class __sveltets_Render<T extends boolean | number | string> {
3
5
  props(): Omit<
4
6
  Omit<
5
7
  {
@@ -59,18 +61,24 @@ declare class __sveltets_Render<T extends number | string | boolean> {
59
61
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
60
62
  * this control.
61
63
  *
62
- * This is primarily for internal use, when implementing convenience components wrapping
63
- * Binding's functionality.
64
+ * This property is exposed for advanced use cases only, such as when implementing convenience
65
+ * components wrapping `<Binding>`'s functionality.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
68
+ *
64
69
  * @bindable
65
70
  * @readonly
66
71
  */
67
72
  ref?: import('../internal/GenericInput.svelte').GenericInputRef | undefined;
68
73
  /**
69
74
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
70
- * the binding's containing `<Pane>`.
75
+ * the `<Binding>`'s containing `<Pane>`.
76
+ *
77
+ * This property is exposed for advanced use cases only, such as when implementing convenience
78
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
79
+ *
80
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
71
81
  *
72
- * This is primarily for internal use, when implementing convenience components wrapping
73
- * Binding's functionality in combination with a Tweakpane plugin.
74
82
  * @default `undefined`
75
83
  */
76
84
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -132,18 +140,29 @@ declare class __sveltets_Render<T extends number | string | boolean> {
132
140
  * */
133
141
  values: T[];
134
142
  };
135
- events(): {} & {
136
- [evt: string]: CustomEvent<any>;
143
+ events(): {
144
+ /**
145
+ * Fires when `value` changes.
146
+ *
147
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
148
+ *
149
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
150
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
151
+ *
152
+ * @extends ValueChangeEvent
153
+ * @event
154
+ * */
155
+ change: RadioGridChangeEvent;
137
156
  };
138
157
  slots(): {};
139
158
  }
140
- export type RadioGridProps<T extends number | string | boolean> = ReturnType<
159
+ export type RadioGridProps<T extends boolean | number | string> = ReturnType<
141
160
  __sveltets_Render<T>['props']
142
161
  >;
143
- export type RadioGridEvents<T extends number | string | boolean> = ReturnType<
162
+ export type RadioGridEvents<T extends boolean | number | string> = ReturnType<
144
163
  __sveltets_Render<T>['events']
145
164
  >;
146
- export type RadioGridSlots<T extends number | string | boolean> = ReturnType<
165
+ export type RadioGridSlots<T extends boolean | number | string> = ReturnType<
147
166
  __sveltets_Render<T>['slots']
148
167
  >;
149
168
  /**
@@ -168,6 +187,7 @@ export type RadioGridSlots<T extends number | string | boolean> = ReturnType<
168
187
  *
169
188
  * - If both `rows` _and_ `columns` props area provided, then buttons may be clipped if `rows * columns < values.length`.
170
189
  *
190
+ * @emits {RadioGridChangeEvent} change - When `value` changes. (This event is provided for advanced use cases. Prefer binding to `value`.)
171
191
  *
172
192
  * Usage outside of a `<Pane>` component will implicitly wrap the radio grid in `<Pane
173
193
  * position='inline'>`.
@@ -197,7 +217,12 @@ export type RadioGridSlots<T extends number | string | boolean> = ReturnType<
197
217
  *
198
218
  * <div class="demo">
199
219
  * {#key value}
200
- * <div class="swatch" style:--e={end} style:--s={start} transition:fade></div>
220
+ * <div
221
+ * class="swatch"
222
+ * style:--e={end}
223
+ * style:--s={start}
224
+ * transition:fade
225
+ * ></div>
201
226
  * {/key}
202
227
  * </div>
203
228
  *
@@ -221,7 +246,7 @@ export type RadioGridSlots<T extends number | string | boolean> = ReturnType<
221
246
  * @sourceLink
222
247
  * [RadioGrid.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/control/RadioGrid.svelte)
223
248
  */
224
- export default class RadioGrid<T extends number | string | boolean> extends SvelteComponent<
249
+ export default class RadioGrid<T extends boolean | number | string> extends SvelteComponent<
225
250
  RadioGridProps<T>,
226
251
  RadioGridEvents<T>,
227
252
  RadioGridSlots<T>
@@ -16,4 +16,4 @@
16
16
  };
17
17
  </script>
18
18
 
19
- <GenericSlider bind:value {options} plugin={pluginModule} {...$$restProps} />
19
+ <GenericSlider bind:value on:change {options} plugin={pluginModule} {...$$restProps} />
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponent } from 'svelte';
2
2
  import type { RingSeries } from '@tweakpane/plugin-camerakit/dist/types/util.js';
3
+ import type { ValueChangeEvent } from '../utils.js';
3
4
  type RingUnit = {
4
5
  /**
5
6
  * The value for the unit.
@@ -25,6 +26,7 @@ type RingUnit = {
25
26
  ticks: number;
26
27
  };
27
28
  export type { RingSeries, RingUnit };
29
+ export type RingChangeEvent = ValueChangeEvent<number>;
28
30
  declare const __propDef: {
29
31
  props: Omit<
30
32
  Omit<
@@ -72,18 +74,24 @@ declare const __propDef: {
72
74
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
73
75
  * this control.
74
76
  *
75
- * This is primarily for internal use, when implementing convenience components wrapping
76
- * Binding's functionality.
77
+ * This property is exposed for advanced use cases only, such as when implementing convenience
78
+ * components wrapping `<Binding>`'s functionality.
79
+ *
80
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
81
+ *
77
82
  * @bindable
78
83
  * @readonly
79
84
  */
80
85
  ref?: import('tweakpane').SliderInputBindingApi | undefined;
81
86
  /**
82
87
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
83
- * the binding's containing `<Pane>`.
88
+ * the `<Binding>`'s containing `<Pane>`.
89
+ *
90
+ * This property is exposed for advanced use cases only, such as when implementing convenience
91
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
92
+ *
93
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
84
94
  *
85
- * This is primarily for internal use, when implementing convenience components wrapping
86
- * Binding's functionality in combination with a Tweakpane plugin.
87
95
  * @default `undefined`
88
96
  */
89
97
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -109,9 +117,14 @@ declare const __propDef: {
109
117
  * Specifying both a `min` and a `max` prop turns the control into a slider.
110
118
  * @default `undefined`
111
119
  */
112
- max?: number | undefined;
120
+ max?: number | undefined /**
121
+ * The number of vertical tick marks between each `value` label on the ring.
122
+ *
123
+ * For example, if `pixels` is `100`, `value` is `10, and `ticks` is `10`, you will have a
124
+ * vertical tick mark every 10 pixels, and a value label every 100 pixels.
125
+ */;
113
126
  /**
114
- * A function to customize the point value's formatting (e.g. rounding, etc.).
127
+ * A function to customize the point value's string representation (e.g. rounding, etc.).
115
128
  * @default `undefined` \
116
129
  * Normal `.toString()` formatting.
117
130
  */
@@ -154,16 +167,27 @@ declare const __propDef: {
154
167
  * */
155
168
  unit?: RingUnit | undefined;
156
169
  /**
157
- * When `true`, expand the width of the ring control at the expense of the numerical input
170
+ * When `true`, expand the width of the ring control at the expense of the numeric input
158
171
  * field.
159
172
  * @default `false`
160
173
  * */
161
174
  wide?: boolean | undefined;
162
175
  };
176
+ slots: {};
163
177
  events: {
164
- [evt: string]: CustomEvent<any>;
178
+ /**
179
+ * Fires when `value` changes.
180
+ *
181
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
182
+ *
183
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
184
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
185
+ *
186
+ * @extends ValueChangeEvent
187
+ * @event
188
+ * */
189
+ change: RingChangeEvent;
165
190
  };
166
- slots: {};
167
191
  };
168
192
  export type RingProps = typeof __propDef.props;
169
193
  export type RingEvents = typeof __propDef.events;
@@ -177,6 +201,8 @@ export type RingSlots = typeof __propDef.slots;
177
201
  * control from Tweakpane-creator [Hiroki Kokubun's](https://cocopon.me) [Camerakit
178
202
  * plugin](https://github.com/tweakpane/plugin-camerakit).
179
203
  *
204
+ * @emits {RingChangeEvent} change - When `value` changes. (This event is provided for advanced use cases. Prefer binding to `value`.)
205
+ *
180
206
  * Usage outside of a `<Pane>` component will implicitly wrap the ring in `<Pane position='inline'>`.
181
207
  *
182
208
  * @example
@@ -47,6 +47,7 @@
47
47
  <GenericInputFolding
48
48
  bind:value={internalValue}
49
49
  bind:expanded
50
+ on:change
50
51
  {buttonClass}
51
52
  {options}
52
53
  plugin={pluginModule}
@@ -3,6 +3,7 @@ import type { EulerOrder } from '@0b5vr/tweakpane-plugin-rotation/dist/types/Eul
3
3
  import type { EulerUnit } from '@0b5vr/tweakpane-plugin-rotation/dist/types/EulerUnit.js';
4
4
  import type { PointDimensionParams } from '@tweakpane/core';
5
5
  import type { Simplify } from '../utils';
6
+ import type { ValueChangeEvent } from '../utils.js';
6
7
  export type RotationEulerOptions = Simplify<PointDimensionParams>;
7
8
  export type RotationEulerOrder = EulerOrder;
8
9
  export type RotationEulerUnit = EulerUnit;
@@ -13,6 +14,7 @@ export type RotationEulerValueObject = {
13
14
  };
14
15
  export type RotationEulerValueTuple = [x: number, y: number, z: number];
15
16
  export type RotationEulerValue = Simplify<RotationEulerValueObject | RotationEulerValueTuple>;
17
+ export type RotationEulerChangeEvent = ValueChangeEvent<RotationEulerValue>;
16
18
  import type { RotationInputPluginEulerParams as RotationEulerOptionsInternal } from '@0b5vr/tweakpane-plugin-rotation/dist/types/RotationInputPluginEulerParams';
17
19
  declare const __propDef: {
18
20
  props: Omit<
@@ -24,71 +26,7 @@ declare const __propDef: {
24
26
  */
25
27
  object: import('@tweakpane/core').Bindable & Record<string, RotationEulerValue>;
26
28
  /** The key for the value in the target `object` that the control should manipulate. */
27
- key: string /**
28
- * Integrates the [euler
29
- * rotation](https://github.com/0b5vr/tweakpane-plugin-rotation/blob/dev/src/RotationInputPluginEuler.ts)
30
- * control from [0b5vr's](https://0b5vr.com)
31
- * [tweakpane-plugin-rotation](https://github.com/0b5vr/tweakpane-plugin-rotation).
32
- *
33
- * _Svelte Tweakpane UI_ extends the original API to support tuple values in addition to object values.
34
- * (Useful when working with frameworks like [three.js](https://threejs.org) /
35
- * [threlte](https://threlte.xyz).)
36
- *
37
- * A utility function `Utils.eulerToCssTransform()` is also provided to easily convert a quaternion
38
- * value object or tuple into a CSS transform string.
39
- *
40
- * See also <RotationQuaternion> if you're feeling gimbal locked.
41
- *
42
- * Usage outside of a `<Pane>` component will implicitly wrap the profiler in `<Pane
43
- * position='inline'>`.
44
- *
45
- * @example
46
- * ```svelte
47
- * <script lang="ts">
48
- * import {
49
- * Button,
50
- * RotationEuler,
51
- * type RotationEulerValueObject,
52
- * Utils
53
- * } from 'svelte-tweakpane-ui';
54
- *
55
- * // Value could also be a tuple
56
- * // e.g. [0, 0, 0]
57
- * let value: RotationEulerValueObject = { x: 0, y: 0, z: 0 };
58
- *
59
- * $: transform = Utils.eulerToCssTransform(value);
60
- * $: valueRows = Object.values(value)
61
- * .map((v) => `${v >= 0 ? '+' : ''}${v.toFixed(6)}`)
62
- * .join('\n');
63
- * </script>
64
- *
65
- * <RotationEuler
66
- * bind:value
67
- * expanded={true}
68
- * label="CSS Rotation"
69
- * picker={'inline'}
70
- * />
71
- * <Button on:click={() => (value = { x: 0, y: 0, z: 0 })} title="Reset" />
72
- *
73
- * <div class="billboard" style:transform>
74
- * <pre>{valueRows}</pre>
75
- * </div>
76
- *
77
- * <style>
78
- * div.billboard {
79
- * display: flex;
80
- * align-items: center;
81
- * justify-content: center;
82
- * aspect-ratio: 1;
83
- * width: 100%;
84
- * background: linear-gradient(45deg, magenta, orange);
85
- * }
86
- * </style>
87
- * ```
88
- *
89
- * @sourceLink
90
- * [RotationEuler.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/control/RotationEuler.svelte)
91
- */;
29
+ key: string;
92
30
  /**
93
31
  * Prevent interactivity and gray out the control.
94
32
  * @default `false`
@@ -125,18 +63,24 @@ declare const __propDef: {
125
63
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
126
64
  * this control.
127
65
  *
128
- * This is primarily for internal use, when implementing convenience components wrapping
129
- * Binding's functionality.
66
+ * This property is exposed for advanced use cases only, such as when implementing convenience
67
+ * components wrapping `<Binding>`'s functionality.
68
+ *
69
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
70
+ *
130
71
  * @bindable
131
72
  * @readonly
132
73
  */
133
74
  ref?: import('../internal/GenericInput.svelte').GenericInputRef | undefined;
134
75
  /**
135
76
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
136
- * the binding's containing `<Pane>`.
77
+ * the `<Binding>`'s containing `<Pane>`.
78
+ *
79
+ * This property is exposed for advanced use cases only, such as when implementing convenience
80
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
81
+ *
82
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
137
83
  *
138
- * This is primarily for internal use, when implementing convenience components wrapping
139
- * Binding's functionality in combination with a Tweakpane plugin.
140
84
  * @default `undefined`
141
85
  */
142
86
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -254,10 +198,21 @@ declare const __propDef: {
254
198
  */
255
199
  unit?: EulerUnit | undefined;
256
200
  };
201
+ slots: {};
257
202
  events: {
258
- [evt: string]: CustomEvent<any>;
203
+ /**
204
+ * Fires when `value` changes.
205
+ *
206
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
207
+ *
208
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
209
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
210
+ *
211
+ * @extends ValueChangeEvent
212
+ * @event
213
+ * */
214
+ change: RotationEulerChangeEvent;
259
215
  };
260
- slots: {};
261
216
  };
262
217
  export type RotationEulerProps = typeof __propDef.props;
263
218
  export type RotationEulerEvents = typeof __propDef.events;
@@ -277,6 +232,8 @@ export type RotationEulerSlots = typeof __propDef.slots;
277
232
  *
278
233
  * See also <RotationQuaternion> if you're feeling gimbal locked.
279
234
  *
235
+ * @emits {RotationEulerChangeEvent} change - When `value` changes. (This event is provided for advanced use cases. Prefer binding to `value`.)
236
+ *
280
237
  * Usage outside of a `<Pane>` component will implicitly wrap the profiler in `<Pane
281
238
  * position='inline'>`.
282
239
  *
@@ -292,7 +249,11 @@ export type RotationEulerSlots = typeof __propDef.slots;
292
249
  *
293
250
  * // Value could also be a tuple
294
251
  * // e.g. [0, 0, 0]
295
- * let value: RotationEulerValueObject = { x: 0, y: 0, z: 0 };
252
+ * let value: RotationEulerValueObject = {
253
+ * x: 0,
254
+ * y: 0,
255
+ * z: 0
256
+ * };
296
257
  *
297
258
  * $: transform = Utils.eulerToCssTransform(value);
298
259
  * $: valueRows = Object.values(value)
@@ -306,7 +267,15 @@ export type RotationEulerSlots = typeof __propDef.slots;
306
267
  * label="CSS Rotation"
307
268
  * picker={'inline'}
308
269
  * />
309
- * <Button on:click={() => (value = { x: 0, y: 0, z: 0 })} title="Reset" />
270
+ * <Button
271
+ * on:click={() =>
272
+ * (value = {
273
+ * x: 0,
274
+ * y: 0,
275
+ * z: 0
276
+ * })}
277
+ * title="Reset"
278
+ * />
310
279
  *
311
280
  * <div class="billboard" style:transform>
312
281
  * <pre>{valueRows}</pre>
@@ -45,6 +45,7 @@
45
45
  <GenericInputFolding
46
46
  bind:value={internalValue}
47
47
  bind:expanded
48
+ on:change
48
49
  {buttonClass}
49
50
  {options}
50
51
  plugin={pluginModule}