svelte-tweakpane-ui 1.1.4 → 1.2.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.
Files changed (72) 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 +20 -6
  30. package/dist/control/Textarea.svelte.d.ts +28 -7
  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/package.json +18 -13
  72. package/readme.md +1 -1
@@ -25,17 +25,23 @@ declare class __sveltets_Render<U extends BladeOptions, V extends BladeRef> {
25
25
  * Reference to internal Tweakpane
26
26
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
27
27
  *
28
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
29
- * functionality.
28
+ * This property is exposed for advanced use cases only, such as when implementing convenience
29
+ * components wrapping `<Blade>`'s functionality.
30
+ *
31
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
32
+ *
30
33
  * @bindable
31
34
  * @readonly
32
35
  * */ ref?: V | undefined;
33
36
  /**
34
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
35
- * the blade.
37
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
38
+ * the `<Blade>`'s containing `<Pane>`.
39
+ *
40
+ * This property is exposed for advanced use cases only, such as when implementing convenience
41
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
42
+ *
43
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
36
44
  *
37
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
38
- * functionality in combination with a Tweakpane plugin.
39
45
  * @default `undefined`
40
46
  * */ plugin?: import('tweakpane').TpPluginBundle | undefined;
41
47
  };
@@ -77,7 +83,11 @@ export type BladeSlots<U extends BladeOptions, V extends BladeRef> = ReturnType<
77
83
  * import { Blade } from 'svelte-tweakpane-ui';
78
84
  * </script>
79
85
  *
80
- * <Blade options={{ view: 'separator' }} />
86
+ * <Blade
87
+ * options={{
88
+ * view: 'separator'
89
+ * }}
90
+ * />
81
91
  * ```
82
92
  *
83
93
  * @sourceLink
@@ -10,6 +10,7 @@
10
10
  export let expanded = void 0;
11
11
  export let position = void 0;
12
12
  export let width = void 0;
13
+ export let tpPane = void 0;
13
14
  export let x = void 0;
14
15
  export let y = void 0;
15
16
  beforeUpdate(() => {
@@ -26,7 +27,7 @@
26
27
  -->
27
28
  {#if position === undefined || position === 'draggable'}
28
29
  {#if BROWSER}
29
- <InternalPaneDraggable bind:expanded bind:width bind:x bind:y {...$$restProps}>
30
+ <InternalPaneDraggable bind:expanded bind:tpPane bind:width bind:x bind:y {...$$restProps}>
30
31
  <slot />
31
32
  </InternalPaneDraggable>
32
33
  {:else}
@@ -35,12 +36,17 @@
35
36
  </div>
36
37
  {/if}
37
38
  {:else if position === 'inline'}
38
- <InternalPaneInline bind:expanded {width} {...removeKeys($$restProps, 'storePositionLocally')}>
39
+ <InternalPaneInline
40
+ bind:expanded
41
+ bind:tpPane
42
+ {width}
43
+ {...removeKeys($$restProps, 'storePositionLocally')}
44
+ >
39
45
  <slot />
40
46
  </InternalPaneInline>
41
47
  {:else if position === 'fixed'}
42
48
  {#if BROWSER}
43
- <InternalPaneFixed bind:expanded bind:x bind:y {width} {...$$restProps}>
49
+ <InternalPaneFixed bind:expanded bind:tpPane bind:x bind:y {width} {...$$restProps}>
44
50
  <slot />
45
51
  </InternalPaneFixed>
46
52
  {:else}
@@ -60,12 +60,22 @@ declare const __propDef: {
60
60
  /** Internal use only. */
61
61
  userCreatedPane?: boolean | undefined;
62
62
  /**
63
- * Internal use only.
63
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
64
+ *
65
+ * This property is exposed for advanced use cases only.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
68
+ *
69
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
70
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
71
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
72
+ *
73
+ * @bindable
64
74
  * @readonly
65
75
  */
66
- paneRef?: import('tweakpane').Pane | undefined;
76
+ tpPane?: import('tweakpane').Pane | undefined;
67
77
  },
68
- 'userCreatedPane' | 'paneRef'
78
+ 'userCreatedPane'
69
79
  > & {
70
80
  /**
71
81
  * Horizontal position of the pane relative to the left edge of the window, in pixels.
@@ -219,12 +229,22 @@ declare const __propDef: {
219
229
  /** Internal use only. */
220
230
  userCreatedPane?: boolean | undefined;
221
231
  /**
222
- * Internal use only.
232
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
233
+ *
234
+ * This property is exposed for advanced use cases only.
235
+ *
236
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
237
+ *
238
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
239
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
240
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
241
+ *
242
+ * @bindable
223
243
  * @readonly
224
244
  */
225
- paneRef?: import('tweakpane').Pane | undefined;
245
+ tpPane?: import('tweakpane').Pane | undefined;
226
246
  },
227
- 'userCreatedPane' | 'paneRef'
247
+ 'userCreatedPane'
228
248
  > & {
229
249
  /**
230
250
  * Horizontal position of the pane relative to the left edge of the window, in pixels.
@@ -275,71 +295,78 @@ declare const __propDef: {
275
295
  position: 'fixed';
276
296
  })
277
297
  | (Omit<
278
- Omit<
279
- {
280
- /**
281
- * Text in the pane's title bar.
282
- * @default `Tweakpane` \
283
- * Unless `position='inline'`, in which case the default is `undefined` and no title bar is
284
- * shown.
285
- */
286
- title?: string | undefined;
287
- /**
288
- * Allow users to interactively expand / contract the pane by clicking its title bar.
289
- *
290
- * Hides the collapse button from the title bar when `false`.
291
- * @default `true`
292
- */
293
- userExpandable?: boolean | undefined;
294
- /**
295
- * Expand or collapse the pane into its title bar.
296
- * @default `true`
297
- * @bindable
298
- */
299
- expanded?: boolean | undefined;
300
- /**
301
- * Custom color scheme.
302
- *
303
- * Applies to all child components, but note that setting a different `theme` on a child
304
- * component's prop will **not** override the parent pane's theme.
305
- *
306
- * Note that `<Pane position="inline' ...>` squares off rounded corners by default to better
307
- * integrate with surrounding content.
308
- *
309
- * Simply pass a custom or default theme like `ThemeUtils.presets.standard` if you want rounded
310
- * corners on an `inline` pane.
311
- *
312
- * See also the `setGlobalDefaultTheme()` for a way to set a custom default theme for all panes
313
- * on the page.
314
- * @default `undefined` \
315
- * Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
316
- * set with `setGlobalDefaultTheme()`.
317
- */
318
- theme?: import('..').Theme | undefined;
319
- /**
320
- * Scales the pane's elements by a factor of `scale` to make it easier to see.
321
- *
322
- * Holds the width of the pane constant, so the pane will grow taller as it is scaled and will
323
- * continue to respect position- and size-related props. If you need more breathing room, set
324
- * the `width` property on the pane.
325
- *
326
- * Note that the scaling prop is only available on `<Pane>`, not on stand-alone (implicitly
327
- * wrapped) inline elements.
328
- *
329
- * Negative values are ignored.
330
- * @default `1`
331
- */
332
- scale?: number | undefined;
333
- /** Internal use only. */
334
- userCreatedPane?: boolean | undefined;
335
- /**
336
- * Internal use only.
337
- * @readonly
338
- */
339
- paneRef?: import('tweakpane').Pane | undefined;
340
- },
341
- 'paneRef'
342
- > & {
298
+ {
299
+ /**
300
+ * Text in the pane's title bar.
301
+ * @default `Tweakpane` \
302
+ * Unless `position='inline'`, in which case the default is `undefined` and no title bar is
303
+ * shown.
304
+ */
305
+ title?: string | undefined;
306
+ /**
307
+ * Allow users to interactively expand / contract the pane by clicking its title bar.
308
+ *
309
+ * Hides the collapse button from the title bar when `false`.
310
+ * @default `true`
311
+ */
312
+ userExpandable?: boolean | undefined;
313
+ /**
314
+ * Expand or collapse the pane into its title bar.
315
+ * @default `true`
316
+ * @bindable
317
+ */
318
+ expanded?: boolean | undefined;
319
+ /**
320
+ * Custom color scheme.
321
+ *
322
+ * Applies to all child components, but note that setting a different `theme` on a child
323
+ * component's prop will **not** override the parent pane's theme.
324
+ *
325
+ * Note that `<Pane position="inline' ...>` squares off rounded corners by default to better
326
+ * integrate with surrounding content.
327
+ *
328
+ * Simply pass a custom or default theme like `ThemeUtils.presets.standard` if you want rounded
329
+ * corners on an `inline` pane.
330
+ *
331
+ * See also the `setGlobalDefaultTheme()` for a way to set a custom default theme for all panes
332
+ * on the page.
333
+ * @default `undefined` \
334
+ * Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
335
+ * set with `setGlobalDefaultTheme()`.
336
+ */
337
+ theme?: import('..').Theme | undefined;
338
+ /**
339
+ * Scales the pane's elements by a factor of `scale` to make it easier to see.
340
+ *
341
+ * Holds the width of the pane constant, so the pane will grow taller as it is scaled and will
342
+ * continue to respect position- and size-related props. If you need more breathing room, set
343
+ * the `width` property on the pane.
344
+ *
345
+ * Note that the scaling prop is only available on `<Pane>`, not on stand-alone (implicitly
346
+ * wrapped) inline elements.
347
+ *
348
+ * Negative values are ignored.
349
+ * @default `1`
350
+ */
351
+ scale?: number | undefined;
352
+ /** Internal use only. */
353
+ userCreatedPane?: boolean | undefined;
354
+ /**
355
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
356
+ *
357
+ * This property is exposed for advanced use cases only.
358
+ *
359
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
360
+ *
361
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
362
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
363
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
364
+ *
365
+ * @bindable
366
+ * @readonly
367
+ */
368
+ tpPane?: import('tweakpane').Pane | undefined;
369
+ } & {
343
370
  /**
344
371
  * Width of the pane, in pixels.
345
372
  *
@@ -28,18 +28,24 @@ declare const __propDef: {
28
28
  * Reference to internal Tweakpane
29
29
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
30
30
  *
31
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
32
- * functionality.
31
+ * This property is exposed for advanced use cases only, such as when implementing convenience
32
+ * components wrapping `<Blade>`'s functionality.
33
+ *
34
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
35
+ *
33
36
  * @bindable
34
37
  * @readonly
35
38
  */
36
39
  ref?: SeparatorBladeRef | undefined;
37
40
  /**
38
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
39
- * the blade.
41
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
42
+ * the `<Blade>`'s containing `<Pane>`.
43
+ *
44
+ * This property is exposed for advanced use cases only, such as when implementing convenience
45
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
46
+ *
47
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
40
48
  *
41
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
42
- * functionality in combination with a Tweakpane plugin.
43
49
  * @default `undefined`
44
50
  */
45
51
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -1,3 +1,5 @@
1
+ <script context="module"></script>
2
+
1
3
  <script>
2
4
  import { isColorObject } from '@tweakpane/core';
3
5
  import { Point2d } from '@tweakpane/core/dist/input-binding/point-2d/model/point-2d.js';
@@ -7,10 +9,12 @@
7
9
  import Binding from '../core/Binding.svelte';
8
10
  import Folder from '../core/Folder.svelte';
9
11
  import InternalPaneInline from '../internal/InternalPaneInline.svelte';
10
- import { getContext } from 'svelte';
12
+ import copy from 'fast-copy';
13
+ import { createEventDispatcher, getContext } from 'svelte';
11
14
  export let theme = void 0;
12
15
  export let prettyLabels = true;
13
16
  export let object;
17
+ const dispatch = createEventDispatcher();
14
18
  const parentStore = getContext('parentStore');
15
19
  function isPointObject(testObject) {
16
20
  return (
@@ -25,22 +29,41 @@
25
29
  .toLowerCase()
26
30
  .replaceAll(/\b[a-z]/g, (letter) => letter.toUpperCase());
27
31
  }
32
+ function changeEventAggregator(event) {
33
+ dispatch('change', {
34
+ value: copy(object),
35
+ origin: event.detail.origin
36
+ });
37
+ }
28
38
  </script>
29
39
 
30
40
  {#if parentStore}
31
41
  {#each Object.keys(object) as key (key)}
32
42
  {#if object[key].constructor === Object && !isColorObject(object[key]) && !isPointObject(object[key])}
33
43
  <Folder title={prettify(key, prettyLabels)}>
34
- <svelte:self bind:object={object[key]} bind:prettyLabels />
44
+ <svelte:self
45
+ bind:object={object[key]}
46
+ bind:prettyLabels
47
+ on:change={changeEventAggregator}
48
+ />
35
49
  </Folder>
36
50
  {:else if typeof object[key] === 'string'}
37
- <Text bind:value={object[key]} label={prettify(key, prettyLabels)} />
51
+ <Text
52
+ bind:value={object[key]}
53
+ on:change={changeEventAggregator}
54
+ label={prettify(key, prettyLabels)}
55
+ />
38
56
  {:else}
39
- <Binding bind:object {key} label={prettify(key, prettyLabels)} />
57
+ <Binding
58
+ bind:object
59
+ on:change={changeEventAggregator}
60
+ {key}
61
+ label={prettify(key, prettyLabels)}
62
+ />
40
63
  {/if}
41
64
  {/each}
42
65
  {:else}
43
66
  <InternalPaneInline {theme} userCreatedPane={false}>
44
- <svelte:self bind:object bind:prettyLabels />
67
+ <svelte:self bind:object bind:prettyLabels on:change={changeEventAggregator} />
45
68
  </InternalPaneInline>
46
69
  {/if}
@@ -1,6 +1,7 @@
1
1
  import { SvelteComponent } from 'svelte';
2
+ import type { BindingObject, ValueChangeEvent } from '../utils.js';
3
+ export type AutoObjectChangeEvent = ValueChangeEvent<BindingObject>;
2
4
  import type { Theme } from '../theme.js';
3
- import type { BindingObject } from '../utils.js';
4
5
  declare const __propDef: {
5
6
  props: {
6
7
  /**
@@ -22,10 +23,21 @@ declare const __propDef: {
22
23
  * @bindable
23
24
  * */ object: BindingObject;
24
25
  };
26
+ slots: {};
25
27
  events: {
26
- [evt: string]: CustomEvent<any>;
28
+ /**
29
+ * Fires when a value in the `object` changes.
30
+ *
31
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `object` prop instead._
32
+ *
33
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
34
+ * and changes resulting from programmatic manipulation of the `object` (`external`).
35
+ *
36
+ * @extends ValueChangeEvent
37
+ * @event
38
+ * */
39
+ change: AutoObjectChangeEvent;
27
40
  };
28
- slots: {};
29
41
  };
30
42
  export type AutoObjectProps = typeof __propDef.props;
31
43
  export type AutoObjectEvents = typeof __propDef.events;
@@ -59,6 +71,8 @@ export type AutoObjectSlots = typeof __propDef.slots;
59
71
  *
60
72
  * Plugin component behavior is not available in `<AutoObject>`.
61
73
  *
74
+ * @emits {AutoObjectChangeEvent} change - When `object` changes. (This event is provided for advanced use cases. Prefer binding to `object`.)
75
+ *
62
76
  * @example
63
77
  * ```svelte
64
78
  * <script lang="ts">
@@ -1,3 +1,5 @@
1
+ <script context="module"></script>
2
+
1
3
  <script>
2
4
  import Text from '../control/Text.svelte';
3
5
  import GenericBinding from '../internal/GenericBinding.svelte';
@@ -5,7 +7,7 @@
5
7
  </script>
6
8
 
7
9
  {#if typeof value === 'string'}
8
- <Text bind:value {...$$restProps} />
10
+ <Text bind:value on:change {...$$restProps} />
9
11
  {:else}
10
- <GenericBinding bind:value {...$$restProps} />
12
+ <GenericBinding bind:value on:change {...$$restProps} />
11
13
  {/if}
@@ -1,4 +1,6 @@
1
1
  import { SvelteComponent } from 'svelte';
2
+ import type { ValueChangeEvent } from '../utils.js';
3
+ export type AutoValueChangeEvent = ValueChangeEvent<boolean | number | object | string>;
2
4
  declare const __propDef: {
3
5
  props: Omit<
4
6
  Omit<
@@ -47,18 +49,24 @@ declare const __propDef: {
47
49
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
48
50
  * this control.
49
51
  *
50
- * This is primarily for internal use, when implementing convenience components wrapping
51
- * Binding's functionality.
52
+ * This property is exposed for advanced use cases only, such as when implementing convenience
53
+ * components wrapping `<Binding>`'s functionality.
54
+ *
55
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
56
+ *
52
57
  * @bindable
53
58
  * @readonly
54
59
  */
55
60
  ref?: import('..').BindingRef | undefined;
56
61
  /**
57
62
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
58
- * the binding's containing `<Pane>`.
63
+ * the `<Binding>`'s containing `<Pane>`.
64
+ *
65
+ * This property is exposed for advanced use cases only, such as when implementing convenience
66
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
67
+ *
68
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
59
69
  *
60
- * This is primarily for internal use, when implementing convenience components wrapping
61
- * Binding's functionality in combination with a Tweakpane plugin.
62
70
  * @default `undefined`
63
71
  */
64
72
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -73,10 +81,21 @@ declare const __propDef: {
73
81
  },
74
82
  'ref' | 'options' | 'plugin'
75
83
  >;
84
+ slots: {};
76
85
  events: {
77
- [evt: string]: CustomEvent<any>;
86
+ /**
87
+ * Fires when `value` changes.
88
+ *
89
+ * _This event is provided for advanced use cases. It's usually preferred to bind to the `value` prop instead._
90
+ *
91
+ * The `event.details` payload includes a copy of the value and an `origin` field to distinguish between user-interactive changes (`internal`)
92
+ * and changes resulting from programmatic manipulation of the `value` (`external`).
93
+ *
94
+ * @extends ValueChangeEvent
95
+ * @event
96
+ * */
97
+ change: AutoValueChangeEvent;
78
98
  };
79
- slots: {};
80
99
  };
81
100
  export type AutoValueProps = typeof __propDef.props;
82
101
  export type AutoValueEvents = typeof __propDef.events;
@@ -89,14 +108,15 @@ export type AutoValueSlots = typeof __propDef.slots;
89
108
  * This component is intended for quick tests where you don't want to fuss with component selection or
90
109
  * customization.
91
110
  *
92
- * See `<AutoObject>` for a variation that works directly on a stand-alone value that isn't wrapped in
93
- * an object.
111
+ * See `<AutoObject>` for a variation that creates controls for multiple values in an object.
94
112
  *
95
113
  * The value is generally mapped to controls according to the logic outlined in the [Tweakpane input
96
114
  * binding documentation](https://tweakpane.github.io/docs/input-bindings/).
97
115
  *
98
116
  * Plugin component behavior is not available in `<AutoValue>`.
99
117
  *
118
+ * @emits {AutoValueChangeEvent} change - When `value` changes. (This event is provided for advanced use cases. Prefer binding to `value`.)
119
+ *
100
120
  * @example
101
121
  * ```svelte
102
122
  * <script lang="ts">
@@ -25,18 +25,24 @@ declare const __propDef: {
25
25
  * Reference to internal Tweakpane
26
26
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
27
27
  *
28
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
29
- * functionality.
28
+ * This property is exposed for advanced use cases only, such as when implementing convenience
29
+ * components wrapping `<Blade>`'s functionality.
30
+ *
31
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
32
+ *
30
33
  * @bindable
31
34
  * @readonly
32
35
  */
33
36
  ref?: BladeRef | undefined;
34
37
  /**
35
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
36
- * the blade.
38
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
39
+ * the `<Blade>`'s containing `<Pane>`.
40
+ *
41
+ * This property is exposed for advanced use cases only, such as when implementing convenience
42
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
43
+ *
44
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
37
45
  *
38
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
39
- * functionality in combination with a Tweakpane plugin.
40
46
  * @default `undefined`
41
47
  */
42
48
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -91,7 +97,7 @@ export type ElementSlots = typeof __propDef.slots;
91
97
  * Think of `<Element>` as an escape hatch for getting something into the pane that
92
98
  * you couldn't otherwise. Generally, it's recommended to abstract new
93
99
  * functionality for reuse by extending one of the internal component types in
94
- * 'svelte-tweakpane-ui', or better yet by creating a new [Tweakpane
100
+ * Svelte Tweakpane UI, or better yet by creating a new [Tweakpane
95
101
  * Plugin](https://github.com/tweakpane/plugin-template) — but sometimes you just
96
102
  * need to get something into the pane quickly.
97
103
  *
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export { type ButtonClickEvent, default as Button } from './control/Button.svelte';
2
2
  export { type ButtonGridClickEvent, default as ButtonGrid } from './control/ButtonGrid.svelte';
3
- export { default as Checkbox } from './control/Checkbox.svelte';
3
+ export { type CheckboxChangeEvent, default as Checkbox } from './control/Checkbox.svelte';
4
4
  export {
5
+ type ColorChangeEvent,
5
6
  type ColorValue,
6
7
  type ColorValueRgbObject,
7
8
  type ColorValueRgbTuple,
@@ -11,19 +12,22 @@ export {
11
12
  default as Color
12
13
  } from './control/Color.svelte';
13
14
  export {
15
+ type CubicBezierChangeEvent,
14
16
  type CubicBezierValue,
15
17
  type CubicBezierValueObject,
16
18
  type CubicBezierValueTuple,
17
19
  default as CubicBezier
18
20
  } from './control/CubicBezier.svelte';
19
- export { type ImageValue, default as Image } from './control/Image.svelte';
21
+ export { type ImageChangeEvent, type ImageValue, default as Image } from './control/Image.svelte';
20
22
  export {
23
+ type IntervalSliderChangeEvent,
21
24
  type IntervalSliderValue,
22
25
  type IntervalSliderValueObject,
23
26
  type IntervalSliderValueTuple,
24
27
  default as IntervalSlider
25
28
  } from './control/IntervalSlider.svelte';
26
29
  export {
30
+ type ListChangeEvent,
27
31
  type ListOptions,
28
32
  type ListOptionsArray,
29
33
  type ListOptionsObjectArray,
@@ -31,6 +35,7 @@ export {
31
35
  default as List
32
36
  } from './control/List.svelte';
33
37
  export {
38
+ type PointChangeEvent,
34
39
  type PointOptions,
35
40
  type PointValue2d,
36
41
  type PointValue2dObject,
@@ -43,9 +48,15 @@ export {
43
48
  type PointValue4dTuple,
44
49
  default as Point
45
50
  } from './control/Point.svelte';
46
- export { default as RadioGrid } from './control/RadioGrid.svelte';
47
- export { type RingSeries, type RingUnit, default as Ring } from './control/Ring.svelte';
51
+ export { type RadioGridChangeEvent, default as RadioGrid } from './control/RadioGrid.svelte';
48
52
  export {
53
+ type RingChangeEvent,
54
+ type RingSeries,
55
+ type RingUnit,
56
+ default as Ring
57
+ } from './control/Ring.svelte';
58
+ export {
59
+ type RotationEulerChangeEvent,
49
60
  type RotationEulerOptions,
50
61
  type RotationEulerOrder,
51
62
  type RotationEulerUnit,
@@ -55,25 +66,31 @@ export {
55
66
  default as RotationEuler
56
67
  } from './control/RotationEuler.svelte';
57
68
  export {
69
+ type RotationQuaternionChangeEvent,
58
70
  type RotationQuaternionOptions,
59
71
  type RotationQuaternionValue,
60
72
  type RotationQuaternionValueObject,
61
73
  type RotationQuaternionValueTuple,
62
74
  default as RotationQuaternion
63
75
  } from './control/RotationQuaternion.svelte';
64
- export { default as Slider } from './control/Slider.svelte';
65
- export { default as Text } from './control/Text.svelte';
66
- export { default as Textarea } from './control/Textarea.svelte';
67
- export { default as Wheel } from './control/Wheel.svelte';
68
- export { type BindingOptions, type BindingRef, default as Binding } from './core/Binding.svelte';
76
+ export { type SliderChangeEvent, default as Slider } from './control/Slider.svelte';
77
+ export { type TextChangeEvent, default as Text } from './control/Text.svelte';
78
+ export { type TextareaChangeEvent, default as Textarea } from './control/Textarea.svelte';
79
+ export { type WheelChangeEvent, default as Wheel } from './control/Wheel.svelte';
80
+ export {
81
+ type BindingChangeEvent,
82
+ type BindingOptions,
83
+ type BindingRef,
84
+ default as Binding
85
+ } from './core/Binding.svelte';
69
86
  export { type BladeOptions, type BladeRef, default as Blade } from './core/Blade.svelte';
70
87
  export { default as Folder } from './core/Folder.svelte';
71
88
  export { type PanePosition, default as Pane } from './core/Pane.svelte';
72
89
  export { default as Separator } from './core/Separator.svelte';
73
90
  export { default as TabGroup } from './core/TabGroup.svelte';
74
91
  export { default as TabPage } from './core/TabPage.svelte';
75
- export { default as AutoObject } from './extra/AutoObject.svelte';
76
- export { default as AutoValue } from './extra/AutoValue.svelte';
92
+ export { type AutoObjectChangeEvent, default as AutoObject } from './extra/AutoObject.svelte';
93
+ export { type AutoValueChangeEvent, default as AutoValue } from './extra/AutoValue.svelte';
77
94
  export { default as Element } from './extra/Element.svelte';
78
95
  export { type FpsGraphChangeEvent, default as FpsGraph } from './monitor/FpsGraph.svelte';
79
96
  export { default as Monitor } from './monitor/Monitor.svelte';
@@ -90,5 +107,5 @@ export {
90
107
  } from './monitor/WaveformMonitor.svelte';
91
108
  export type { Theme, ThemeColorValue } from './theme.js';
92
109
  export { default as ThemeUtils } from './theme.js';
93
- export type { BindingObject, Plugin } from './utils.js';
110
+ export type { BindingObject, Plugin, ValueChangeEvent } from './utils.js';
94
111
  export { default as Utils } from './utils.js';