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
@@ -14,6 +14,7 @@
14
14
  const titlebarWindowShadeDoubleClick = false;
15
15
  export let storePositionLocally = true;
16
16
  export let localStoreId = localStoreDefaultId;
17
+ export let tpPane = void 0;
17
18
  let positionStore;
18
19
  if (storePositionLocally) {
19
20
  positionStore = persisted(`${localStorePrefix}${localStoreId}`, {
@@ -35,7 +36,6 @@
35
36
  export let title = 'Tweakpane';
36
37
  export let scale = 1;
37
38
  export let padding = '0';
38
- let paneRef;
39
39
  let containerElement;
40
40
  let dragBarElement;
41
41
  let widthHandleElement;
@@ -108,8 +108,13 @@
108
108
  if (event.target) {
109
109
  if (width !== void 0 && event.target === widthHandleElement) {
110
110
  width = width < maxAvailablePanelWidth ? maxAvailablePanelWidth : minWidth;
111
- } else if (titlebarWindowShadeDoubleClick && event.target === dragBarElement) {
112
- paneRef.expanded = !paneRef.expanded;
111
+ } else if (
112
+ // If (moveDistance < 3 && userExpandable)
113
+ titlebarWindowShadeDoubleClick &&
114
+ event.target === dragBarElement && //
115
+ tpPane
116
+ ) {
117
+ tpPane.expanded = !tpPane.expanded;
113
118
  }
114
119
  }
115
120
  };
@@ -155,9 +160,10 @@
155
160
  titlebarWindowShadeSingleClick &&
156
161
  event.target === dragBarElement &&
157
162
  moveDistance < 3 &&
158
- userExpandable
163
+ userExpandable &&
164
+ tpPane
159
165
  )
160
- paneRef.expanded = !paneRef.expanded;
166
+ tpPane.expanded = !tpPane.expanded;
161
167
  }
162
168
  };
163
169
  const touchScrollBlocker = (event) => {
@@ -165,10 +171,10 @@
165
171
  };
166
172
  onMount(() => {
167
173
  setDocumentSize();
168
- if (paneRef) {
169
- containerElement.append(paneRef.element);
174
+ if (tpPane) {
175
+ containerElement.append(tpPane.element);
170
176
  } else {
171
- console.warn('no pane ref in draggable');
177
+ console.warn('no tpPane in draggable');
172
178
  }
173
179
  containerElement.addEventListener('touchmove', touchScrollBlocker, { passive: false });
174
180
  const dragBarElementCheck = containerElement.querySelector('.tp-rotv_t');
@@ -214,7 +220,7 @@
214
220
  widthHandleElement.style.display = isResizable ? 'block' : 'none';
215
221
  }
216
222
  }
217
- $: paneRef && resizable && updateResizability(resizable);
223
+ $: tpPane && resizable && updateResizability(resizable);
218
224
  function recursiveCollapse(children, maxToCollapse = Number.MAX_SAFE_INTEGER) {
219
225
  if (maxToCollapse > 0) {
220
226
  for (const child of children) {
@@ -246,8 +252,8 @@
246
252
  minWidth !== void 0 &&
247
253
  maxWidth !== void 0
248
254
  ) {
249
- if (collapseChildrenToFit && containerHeightScaled > documentHeight) {
250
- recursiveCollapse(paneRef.children);
255
+ if (collapseChildrenToFit && containerHeightScaled > documentHeight && tpPane) {
256
+ recursiveCollapse(tpPane.children);
251
257
  }
252
258
  x = clamp(x, 0, Math.max(0, documentWidth - containerWidth));
253
259
  y = clamp(y, 0, Math.max(0, documentHeight - containerHeightScaled));
@@ -301,7 +307,7 @@
301
307
  style:width="{width}px"
302
308
  style:z-index={zIndexLocal}
303
309
  >
304
- <GenericPane bind:expanded bind:paneRef {scale} {title} {...removeKeys($$restProps, 'position')}>
310
+ <GenericPane bind:expanded bind:tpPane {scale} {title} {...removeKeys($$restProps, 'position')}>
305
311
  <slot />
306
312
  </GenericPane>
307
313
  </div>
@@ -1,5 +1,4 @@
1
1
  import { SvelteComponent } from 'svelte';
2
- import type { Pane as TpPane } from 'tweakpane';
3
2
  declare const __propDef: {
4
3
  props: Omit<
5
4
  {
@@ -59,12 +58,22 @@ declare const __propDef: {
59
58
  /** Internal use only. */
60
59
  userCreatedPane?: boolean | undefined;
61
60
  /**
62
- * Internal use only.
61
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
62
+ *
63
+ * This property is exposed for advanced use cases only.
64
+ *
65
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
66
+ *
67
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
68
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
69
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
70
+ *
71
+ * @bindable
63
72
  * @readonly
64
73
  */
65
- paneRef?: TpPane | undefined;
74
+ tpPane?: import('tweakpane').Pane | undefined;
66
75
  },
67
- 'userCreatedPane' | 'paneRef'
76
+ 'userCreatedPane'
68
77
  > & {
69
78
  /**
70
79
  * Horizontal position of the pane relative to the left edge of the window, in pixels.
@@ -6,9 +6,9 @@
6
6
  export let y = void 0;
7
7
  export let width = void 0;
8
8
  export let title = 'Tweakpane';
9
- let paneRef;
9
+ export let tpPane = void 0;
10
10
  let paneContainer;
11
- $: paneRef?.element.parentElement && (paneContainer = paneRef.element.parentElement);
11
+ $: tpPane?.element.parentElement && (paneContainer = tpPane.element.parentElement);
12
12
  $: paneContainer !== void 0 &&
13
13
  x !== void 0 &&
14
14
  (paneContainer.style.setProperty('right', 'unset'),
@@ -20,7 +20,7 @@
20
20
  </script>
21
21
 
22
22
  <div style="display: none;">
23
- <GenericPane bind:expanded bind:paneRef {title} {...removeKeys($$restProps, 'position')}>
23
+ <GenericPane bind:expanded bind:tpPane {title} {...removeKeys($$restProps, 'position')}>
24
24
  <slot />
25
25
  </GenericPane>
26
26
  </div>
@@ -1,5 +1,4 @@
1
1
  import { SvelteComponent } from 'svelte';
2
- import type { Pane as TpPane } from 'tweakpane';
3
2
  declare const __propDef: {
4
3
  props: Omit<
5
4
  {
@@ -59,12 +58,22 @@ declare const __propDef: {
59
58
  /** Internal use only. */
60
59
  userCreatedPane?: boolean | undefined;
61
60
  /**
62
- * Internal use only.
61
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
62
+ *
63
+ * This property is exposed for advanced use cases only.
64
+ *
65
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
66
+ *
67
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
68
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
69
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
70
+ *
71
+ * @bindable
63
72
  * @readonly
64
73
  */
65
- paneRef?: TpPane | undefined;
74
+ tpPane?: import('tweakpane').Pane | undefined;
66
75
  },
67
- 'userCreatedPane' | 'paneRef'
76
+ 'userCreatedPane'
68
77
  > & {
69
78
  /**
70
79
  * Horizontal position of the pane relative to the left edge of the window, in pixels.
@@ -4,26 +4,26 @@
4
4
  import { onMount } from 'svelte';
5
5
  export let expanded = void 0;
6
6
  export let width = void 0;
7
+ export let tpPane = void 0;
7
8
  export let theme = {
8
9
  baseBorderRadius: '0px',
9
10
  baseShadowColor: 'hsla(0, 0%, 0%, 0)'
10
11
  // BladeBorderRadius: '0px'
11
12
  };
12
- let paneRef;
13
13
  let containerElement;
14
14
  onMount(() => {
15
- if (paneRef) {
16
- const fixedContainer = paneRef.element.parentElement;
17
- containerElement.append(paneRef.element);
15
+ if (tpPane) {
16
+ const fixedContainer = tpPane.element.parentElement;
17
+ containerElement.append(tpPane.element);
18
18
  fixedContainer?.remove();
19
19
  } else {
20
- console.warn('paneRef is undefined');
20
+ console.warn('tpPane is undefined');
21
21
  }
22
22
  });
23
23
  </script>
24
24
 
25
25
  <div bind:this={containerElement} style:width={width === undefined ? null : `${width}px`}>
26
- <GenericPane bind:expanded bind:paneRef {theme} {...removeKeys($$restProps, 'position')}>
26
+ <GenericPane bind:expanded bind:tpPane {theme} {...removeKeys($$restProps, 'position')}>
27
27
  <slot />
28
28
  </GenericPane>
29
29
  </div>
@@ -1,71 +1,77 @@
1
1
  import { SvelteComponent } from 'svelte';
2
- import type { Pane as TpPane } from 'tweakpane';
3
2
  declare const __propDef: {
4
- props: Omit<
5
- {
6
- /**
7
- * Text in the pane's title bar.
8
- * @default `Tweakpane` \
9
- * Unless `position='inline'`, in which case the default is `undefined` and no title bar is
10
- * shown.
11
- */
12
- title?: string | undefined;
13
- /**
14
- * Allow users to interactively expand / contract the pane by clicking its title bar.
15
- *
16
- * Hides the collapse button from the title bar when `false`.
17
- * @default `true`
18
- */
19
- userExpandable?: boolean | undefined;
20
- /**
21
- * Expand or collapse the pane into its title bar.
22
- * @default `true`
23
- * @bindable
24
- */
25
- expanded?: boolean | undefined;
26
- /**
27
- * Custom color scheme.
28
- *
29
- * Applies to all child components, but note that setting a different `theme` on a child
30
- * component's prop will **not** override the parent pane's theme.
31
- *
32
- * Note that `<Pane position="inline' ...>` squares off rounded corners by default to better
33
- * integrate with surrounding content.
34
- *
35
- * Simply pass a custom or default theme like `ThemeUtils.presets.standard` if you want rounded
36
- * corners on an `inline` pane.
37
- *
38
- * See also the `setGlobalDefaultTheme()` for a way to set a custom default theme for all panes
39
- * on the page.
40
- * @default `undefined` \
41
- * Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
42
- * set with `setGlobalDefaultTheme()`.
43
- */
44
- theme?: import('..').Theme | undefined;
45
- /**
46
- * Scales the pane's elements by a factor of `scale` to make it easier to see.
47
- *
48
- * Holds the width of the pane constant, so the pane will grow taller as it is scaled and will
49
- * continue to respect position- and size-related props. If you need more breathing room, set
50
- * the `width` property on the pane.
51
- *
52
- * Note that the scaling prop is only available on `<Pane>`, not on stand-alone (implicitly
53
- * wrapped) inline elements.
54
- *
55
- * Negative values are ignored.
56
- * @default `1`
57
- */
58
- scale?: number | undefined;
59
- /** Internal use only. */
60
- userCreatedPane?: boolean | undefined;
61
- /**
62
- * Internal use only.
63
- * @readonly
64
- */
65
- paneRef?: TpPane | undefined;
66
- },
67
- 'paneRef'
68
- > & {
3
+ props: {
4
+ /**
5
+ * Text in the pane's title bar.
6
+ * @default `Tweakpane` \
7
+ * Unless `position='inline'`, in which case the default is `undefined` and no title bar is
8
+ * shown.
9
+ */
10
+ title?: string | undefined;
11
+ /**
12
+ * Allow users to interactively expand / contract the pane by clicking its title bar.
13
+ *
14
+ * Hides the collapse button from the title bar when `false`.
15
+ * @default `true`
16
+ */
17
+ userExpandable?: boolean | undefined;
18
+ /**
19
+ * Expand or collapse the pane into its title bar.
20
+ * @default `true`
21
+ * @bindable
22
+ */
23
+ expanded?: boolean | undefined;
24
+ /**
25
+ * Custom color scheme.
26
+ *
27
+ * Applies to all child components, but note that setting a different `theme` on a child
28
+ * component's prop will **not** override the parent pane's theme.
29
+ *
30
+ * Note that `<Pane position="inline' ...>` squares off rounded corners by default to better
31
+ * integrate with surrounding content.
32
+ *
33
+ * Simply pass a custom or default theme like `ThemeUtils.presets.standard` if you want rounded
34
+ * corners on an `inline` pane.
35
+ *
36
+ * See also the `setGlobalDefaultTheme()` for a way to set a custom default theme for all panes
37
+ * on the page.
38
+ * @default `undefined` \
39
+ * Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
40
+ * set with `setGlobalDefaultTheme()`.
41
+ */
42
+ theme?: import('..').Theme | undefined;
43
+ /**
44
+ * Scales the pane's elements by a factor of `scale` to make it easier to see.
45
+ *
46
+ * Holds the width of the pane constant, so the pane will grow taller as it is scaled and will
47
+ * continue to respect position- and size-related props. If you need more breathing room, set
48
+ * the `width` property on the pane.
49
+ *
50
+ * Note that the scaling prop is only available on `<Pane>`, not on stand-alone (implicitly
51
+ * wrapped) inline elements.
52
+ *
53
+ * Negative values are ignored.
54
+ * @default `1`
55
+ */
56
+ scale?: number | undefined;
57
+ /** Internal use only. */
58
+ userCreatedPane?: boolean | undefined;
59
+ /**
60
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
61
+ *
62
+ * This property is exposed for advanced use cases only.
63
+ *
64
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
65
+ *
66
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
67
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
68
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
69
+ *
70
+ * @bindable
71
+ * @readonly
72
+ */
73
+ tpPane?: import('tweakpane').Pane | undefined;
74
+ } & {
69
75
  /**
70
76
  * Width of the pane, in pixels.
71
77
  *
@@ -44,18 +44,24 @@ declare const __propDef: {
44
44
  * Reference to internal Tweakpane
45
45
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
46
46
  *
47
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
48
- * functionality.
47
+ * This property is exposed for advanced use cases only, such as when implementing convenience
48
+ * components wrapping `<Blade>`'s functionality.
49
+ *
50
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
51
+ *
49
52
  * @bindable
50
53
  * @readonly
51
54
  */
52
55
  ref?: FpsGraphRef | undefined;
53
56
  /**
54
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
55
- * the blade.
57
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
58
+ * the `<Blade>`'s containing `<Pane>`.
59
+ *
60
+ * This property is exposed for advanced use cases only, such as when implementing convenience
61
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
62
+ *
63
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
56
64
  *
57
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
58
- * functionality in combination with a Tweakpane plugin.
59
65
  * @default `undefined`
60
66
  */
61
67
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -54,18 +54,24 @@ declare class __sveltets_Render<W extends number | string | boolean | unknown> {
54
54
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
55
55
  * this control.
56
56
  *
57
- * This is primarily for internal use, when implementing convenience components wrapping
58
- * Binding's functionality.
57
+ * This property is exposed for advanced use cases only, such as when implementing convenience
58
+ * components wrapping `<Binding>`'s functionality.
59
+ *
60
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
61
+ *
59
62
  * @bindable
60
63
  * @readonly
61
64
  */
62
65
  ref?: import('../internal/GenericMonitor.svelte').GenericMonitorRef | undefined;
63
66
  /**
64
67
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
65
- * the binding's containing `<Pane>`.
68
+ * the `<Binding>`'s containing `<Pane>`.
69
+ *
70
+ * This property is exposed for advanced use cases only, such as when implementing convenience
71
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
72
+ *
73
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
66
74
  *
67
- * This is primarily for internal use, when implementing convenience components wrapping
68
- * Binding's functionality in combination with a Tweakpane plugin.
69
75
  * @default `undefined`
70
76
  */
71
77
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -150,18 +156,24 @@ declare class __sveltets_Render<W extends number | string | boolean | unknown> {
150
156
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
151
157
  * this control.
152
158
  *
153
- * This is primarily for internal use, when implementing convenience components wrapping
154
- * Binding's functionality.
159
+ * This property is exposed for advanced use cases only, such as when implementing convenience
160
+ * components wrapping `<Binding>`'s functionality.
161
+ *
162
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
163
+ *
155
164
  * @bindable
156
165
  * @readonly
157
166
  */
158
167
  ref?: import('../internal/GenericMonitor.svelte').GenericMonitorRef | undefined;
159
168
  /**
160
169
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
161
- * the binding's containing `<Pane>`.
170
+ * the `<Binding>`'s containing `<Pane>`.
171
+ *
172
+ * This property is exposed for advanced use cases only, such as when implementing convenience
173
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
174
+ *
175
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
162
176
  *
163
- * This is primarily for internal use, when implementing convenience components wrapping
164
- * Binding's functionality in combination with a Tweakpane plugin.
165
177
  * @default `undefined`
166
178
  */
167
179
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -257,18 +269,24 @@ declare class __sveltets_Render<W extends number | string | boolean | unknown> {
257
269
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
258
270
  * this control.
259
271
  *
260
- * This is primarily for internal use, when implementing convenience components wrapping
261
- * Binding's functionality.
272
+ * This property is exposed for advanced use cases only, such as when implementing convenience
273
+ * components wrapping `<Binding>`'s functionality.
274
+ *
275
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
276
+ *
262
277
  * @bindable
263
278
  * @readonly
264
279
  */
265
280
  ref?: import('../internal/GenericMonitor.svelte').GenericMonitorRef | undefined;
266
281
  /**
267
282
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
268
- * the binding's containing `<Pane>`.
283
+ * the `<Binding>`'s containing `<Pane>`.
284
+ *
285
+ * This property is exposed for advanced use cases only, such as when implementing convenience
286
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
287
+ *
288
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
269
289
  *
270
- * This is primarily for internal use, when implementing convenience components wrapping
271
- * Binding's functionality in combination with a Tweakpane plugin.
272
290
  * @default `undefined`
273
291
  */
274
292
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -359,18 +377,24 @@ declare class __sveltets_Render<W extends number | string | boolean | unknown> {
359
377
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
360
378
  * this control.
361
379
  *
362
- * This is primarily for internal use, when implementing convenience components wrapping
363
- * Binding's functionality.
380
+ * This property is exposed for advanced use cases only, such as when implementing convenience
381
+ * components wrapping `<Binding>`'s functionality.
382
+ *
383
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
384
+ *
364
385
  * @bindable
365
386
  * @readonly
366
387
  */
367
388
  ref?: import('../internal/GenericMonitor.svelte').GenericMonitorRef | undefined;
368
389
  /**
369
390
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
370
- * the binding's containing `<Pane>`.
391
+ * the `<Binding>`'s containing `<Pane>`.
392
+ *
393
+ * This property is exposed for advanced use cases only, such as when implementing convenience
394
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
395
+ *
396
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
371
397
  *
372
- * This is primarily for internal use, when implementing convenience components wrapping
373
- * Binding's functionality in combination with a Tweakpane plugin.
374
398
  * @default `undefined`
375
399
  */
376
400
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -424,7 +448,7 @@ declare class __sveltets_Render<W extends number | string | boolean | unknown> {
424
448
  */
425
449
  max?: number | undefined;
426
450
  /**
427
- * A function to customize the number's formatting (e.g. rounding, etc.).
451
+ * A function to customize the number's string representation (e.g. rounding, etc.).
428
452
  * @default `undefined` \
429
453
  * Normal `.toString()` formatting.
430
454
  */
@@ -2,13 +2,13 @@ import { SvelteComponent } from 'svelte';
2
2
  import type { ProfilerBladeMeasureHandler } from '@0b5vr/tweakpane-plugin-profiler';
3
3
  import type { Simplify } from '../utils';
4
4
  export type ProfilerCalcMode = 'frame' | 'mean' | 'median';
5
- export type ProfilerChangeEvent = CustomEvent<number>;
6
5
  export type ProfilerMeasure = (name: string, functionToMeasure: () => void) => void;
7
6
  export type ProfilerMeasureAsync = (
8
7
  name: string,
9
8
  functionToMeasure: () => Promise<void>
10
9
  ) => Promise<void>;
11
10
  export type ProfilerMeasureHandler = Simplify<ProfilerBladeMeasureHandler>;
11
+ export type ProfilerChangeEvent = CustomEvent<number>;
12
12
  import type { ProfilerBladeApi as ProfilerRef } from '@0b5vr/tweakpane-plugin-profiler/dist/types/ProfilerBladeApi.js';
13
13
  import type { ProfilerBladePluginParams as ProfilerOptions } from '@0b5vr/tweakpane-plugin-profiler/dist/types/ProfilerBladePluginParams.js';
14
14
  declare const __propDef: {
@@ -60,18 +60,24 @@ declare const __propDef: {
60
60
  * Reference to internal Tweakpane
61
61
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
62
62
  *
63
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
64
- * functionality.
63
+ * This property is exposed for advanced use cases only, such as when implementing convenience
64
+ * components wrapping `<Blade>`'s functionality.
65
+ *
66
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
67
+ *
65
68
  * @bindable
66
69
  * @readonly
67
70
  */
68
71
  ref?: ProfilerRef | undefined;
69
72
  /**
70
- * Imported Tweakpane `TpPluginBundle` (Aliased as `Plugin`) module to register before creating
71
- * the blade.
73
+ * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
74
+ * the `<Blade>`'s containing `<Pane>`.
75
+ *
76
+ * This property is exposed for advanced use cases only, such as when implementing convenience
77
+ * components wrapping `<Blade>`'s functionality in combination with a Tweakpane plugin.
78
+ *
79
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
72
80
  *
73
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
74
- * functionality in combination with a Tweakpane plugin.
75
81
  * @default `undefined`
76
82
  */
77
83
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -195,7 +201,11 @@ export type ProfilerSlots = typeof __propDef.slots;
195
201
  * ```svelte
196
202
  * <script lang="ts">
197
203
  * import { onMount } from 'svelte';
198
- * import { Profiler, type ProfilerMeasure, Slider } from 'svelte-tweakpane-ui';
204
+ * import {
205
+ * Profiler,
206
+ * type ProfilerMeasure,
207
+ * Slider
208
+ * } from 'svelte-tweakpane-ui';
199
209
  *
200
210
  * // this is a readonly function handle assigned by Profiler component
201
211
  * // first used in onMount since it is not bound until then
@@ -204,7 +214,10 @@ export type ProfilerSlots = typeof __propDef.slots;
204
214
  * let loopExponent = 1;
205
215
  *
206
216
  * // helper to test Math functions
207
- * function hardWork(function_: (n: number) => number, exponent: number): void {
217
+ * function hardWork(
218
+ * function_: (n: number) => number,
219
+ * exponent: number
220
+ * ): void {
208
221
  * measure(function_.name, () => {
209
222
  * for (let sum = 0; sum < Number('1e' + exponent); sum++) {
210
223
  * function_(sum);
@@ -54,18 +54,24 @@ declare const __propDef: {
54
54
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
55
55
  * this control.
56
56
  *
57
- * This is primarily for internal use, when implementing convenience components wrapping
58
- * Binding's functionality.
57
+ * This property is exposed for advanced use cases only, such as when implementing convenience
58
+ * components wrapping `<Binding>`'s functionality.
59
+ *
60
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
61
+ *
59
62
  * @bindable
60
63
  * @readonly
61
64
  */
62
65
  ref?: import('../internal/GenericMonitor.svelte').GenericMonitorRef | undefined;
63
66
  /**
64
67
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
65
- * the binding's containing `<Pane>`.
68
+ * the `<Binding>`'s containing `<Pane>`.
69
+ *
70
+ * This property is exposed for advanced use cases only, such as when implementing convenience
71
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
72
+ *
73
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
66
74
  *
67
- * This is primarily for internal use, when implementing convenience components wrapping
68
- * Binding's functionality in combination with a Tweakpane plugin.
69
75
  * @default `undefined`
70
76
  */
71
77
  plugin?: import('tweakpane').TpPluginBundle | undefined;
package/dist/utils.d.ts CHANGED
@@ -13,6 +13,21 @@ export type HasKey<U, V extends PropertyKey> = V extends keyof U ? U[V] : unknow
13
13
  import type { Bindable, BladeApi, BladeController, TpPluginBundle, View } from '@tweakpane/core';
14
14
  export type BindingObject = Bindable;
15
15
  export type Plugin = TpPluginBundle;
16
+ /**
17
+ * The base event type for value change notification events emitted by various controls.
18
+ */
19
+ export type ValueChangeEvent<V> = CustomEvent<{
20
+ /**
21
+ * A copy of the value at the time of the event.
22
+ */
23
+ value: V;
24
+ /**
25
+ * The origin of the event.
26
+ * Changes resulting from the user's direct manipulation of the control will are marked as `internal`.
27
+ * Changes resulting from manipulation of the bound value from _outside_ the component are marked as `external`.
28
+ */
29
+ origin: 'external' | 'internal';
30
+ }>;
16
31
  /**
17
32
  * Needed to conveniently use $$Events as the single source of truth for component events Performs
18
33
  * the transformation necessary (extracting detail types) to pass the $$Events type into
package/license.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Eric Mika
3
+ Copyright (c) 2023-2024 Eric Mika
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal