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
@@ -19,4 +19,4 @@
19
19
  $: value, setValue();
20
20
  </script>
21
21
 
22
- <Binding bind:object bind:ref {key} {options} {...$$restProps} />
22
+ <Binding bind:object bind:ref on:change {key} {options} {...$$restProps} />
@@ -50,18 +50,24 @@ declare class __sveltets_Render<
50
50
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
51
51
  * this control.
52
52
  *
53
- * This is primarily for internal use, when implementing convenience components wrapping
54
- * Binding's functionality.
53
+ * This property is exposed for advanced use cases only, such as when implementing convenience
54
+ * components wrapping `<Binding>`'s functionality.
55
+ *
56
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
57
+ *
55
58
  * @bindable
56
59
  * @readonly
57
60
  */
58
61
  ref?: V | undefined;
59
62
  /**
60
63
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
61
- * the binding's containing `<Pane>`.
64
+ * the `<Binding>`'s containing `<Pane>`.
65
+ *
66
+ * This property is exposed for advanced use cases only, such as when implementing convenience
67
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
68
+ *
69
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
62
70
  *
63
- * This is primarily for internal use, when implementing convenience components wrapping
64
- * Binding's functionality in combination with a Tweakpane plugin.
65
71
  * @default `undefined`
66
72
  */
67
73
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -74,7 +80,9 @@ declare class __sveltets_Render<
74
80
  * */
75
81
  value: T;
76
82
  };
77
- events(): {} & {
83
+ events(): {
84
+ change: import('../core/Binding.svelte').BindingChangeEvent;
85
+ } & {
78
86
  [evt: string]: CustomEvent<any>;
79
87
  };
80
88
  slots(): {};
@@ -24,18 +24,24 @@ declare class __sveltets_Render<T extends BladeOptions, U extends BladeRef> {
24
24
  * Reference to internal Tweakpane
25
25
  * [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
26
26
  *
27
- * This is primarily for internal use, when implementing convenience components wrapping Blade's
28
- * functionality.
27
+ * This property is exposed for advanced use cases only, such as when implementing convenience
28
+ * components wrapping `<Blade>`'s functionality.
29
+ *
30
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
31
+ *
29
32
  * @bindable
30
33
  * @readonly
31
34
  */
32
35
  ref?: U | 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
  */
41
47
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -14,4 +14,4 @@
14
14
  };
15
15
  </script>
16
16
 
17
- <GenericBinding bind:value bind:ref options={optionsInternal} {...$$restProps} />
17
+ <GenericBinding bind:value bind:ref on:change options={optionsInternal} {...$$restProps} />
@@ -52,18 +52,24 @@ declare class __sveltets_Render<
52
52
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
53
53
  * this control.
54
54
  *
55
- * This is primarily for internal use, when implementing convenience components wrapping
56
- * Binding's functionality.
55
+ * This property is exposed for advanced use cases only, such as when implementing convenience
56
+ * components wrapping `<Binding>`'s functionality.
57
+ *
58
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
59
+ *
57
60
  * @bindable
58
61
  * @readonly
59
62
  */
60
63
  ref?: V | undefined;
61
64
  /**
62
65
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
63
- * the binding's containing `<Pane>`.
66
+ * the `<Binding>`'s containing `<Pane>`.
67
+ *
68
+ * This property is exposed for advanced use cases only, such as when implementing convenience
69
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
70
+ *
71
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
64
72
  *
65
- * This is primarily for internal use, when implementing convenience components wrapping
66
- * Binding's functionality in combination with a Tweakpane plugin.
67
73
  * @default `undefined`
68
74
  */
69
75
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -76,7 +82,9 @@ declare class __sveltets_Render<
76
82
  */
77
83
  value: T;
78
84
  };
79
- events(): {} & {
85
+ events(): {
86
+ change: import('..').BindingChangeEvent;
87
+ } & {
80
88
  [evt: string]: CustomEvent<any>;
81
89
  };
82
90
  slots(): {};
@@ -37,4 +37,4 @@
37
37
  ref.element.querySelector(`.${buttonClass}`)?.click();
38
38
  </script>
39
39
 
40
- <GenericInput bind:value bind:ref options={optionsInternal} {...$$restProps} />
40
+ <GenericInput bind:value bind:ref on:change options={optionsInternal} {...$$restProps} />
@@ -54,18 +54,24 @@ declare class __sveltets_Render<
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?: V | 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;
@@ -100,7 +106,9 @@ declare class __sveltets_Render<
100
106
  * */
101
107
  userExpandable?: boolean | undefined;
102
108
  };
103
- events(): {} & {
109
+ events(): {
110
+ change: import('..').BindingChangeEvent;
111
+ } & {
104
112
  [evt: string]: CustomEvent<any>;
105
113
  };
106
114
  slots(): {};
@@ -52,18 +52,24 @@ declare class __sveltets_Render<
52
52
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
53
53
  * this control.
54
54
  *
55
- * This is primarily for internal use, when implementing convenience components wrapping
56
- * Binding's functionality.
55
+ * This property is exposed for advanced use cases only, such as when implementing convenience
56
+ * components wrapping `<Binding>`'s functionality.
57
+ *
58
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
59
+ *
57
60
  * @bindable
58
61
  * @readonly
59
62
  */
60
63
  ref?: V | undefined;
61
64
  /**
62
65
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
63
- * the binding's containing `<Pane>`.
66
+ * the `<Binding>`'s containing `<Pane>`.
67
+ *
68
+ * This property is exposed for advanced use cases only, such as when implementing convenience
69
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
70
+ *
71
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
64
72
  *
65
- * This is primarily for internal use, when implementing convenience components wrapping
66
- * Binding's functionality in combination with a Tweakpane plugin.
67
73
  * @default `undefined`
68
74
  */
69
75
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -12,15 +12,15 @@
12
12
  export let theme = void 0;
13
13
  export let scale = 1;
14
14
  export let userCreatedPane = true;
15
- export let paneRef = void 0;
15
+ export let tpPane = void 0;
16
16
  const parentStore = writable();
17
17
  const existingParentStore = getContext('parentStore');
18
18
  let pluginsRegistered = [];
19
19
  const registerPlugin = (plugin) => {
20
- if (paneRef === void 0) {
21
- console.warn(`paneRef is undefined, failed to register plugin "${plugin.id}"`);
20
+ if (tpPane === void 0) {
21
+ console.warn(`tpPane is undefined, failed to register plugin "${plugin.id}"`);
22
22
  } else if (!pluginsRegistered.includes(plugin.id)) {
23
- paneRef?.registerPlugin(plugin);
23
+ tpPane?.registerPlugin(plugin);
24
24
  pluginsRegistered.push(plugin.id);
25
25
  }
26
26
  };
@@ -35,7 +35,7 @@
35
35
  $parentStore.on('fold', () => {
36
36
  _expanded = $parentStore.expanded;
37
37
  });
38
- paneRef = $parentStore;
38
+ tpPane = $parentStore;
39
39
  setContext('parentStore', parentStore);
40
40
  onDestroy(() => {
41
41
  $parentStore.dispose();
@@ -44,32 +44,32 @@
44
44
  setContext('parentStore', writable(true));
45
45
  }
46
46
  function setScale(scale2) {
47
- if (paneRef) {
47
+ if (tpPane) {
48
48
  if (scale2 === 1) {
49
- paneRef.element.style.removeProperty('transform-origin');
50
- paneRef.element.style.removeProperty('transform');
51
- paneRef.element.style.removeProperty('width');
49
+ tpPane.element.style.removeProperty('transform-origin');
50
+ tpPane.element.style.removeProperty('transform');
51
+ tpPane.element.style.removeProperty('width');
52
52
  } else {
53
53
  const clampedScale = Math.max(0, scale2);
54
- paneRef.element.style.transformOrigin = '0 0';
55
- paneRef.element.style.transform = `scale(${clampedScale})`;
56
- paneRef.element.style.width = `${100 / clampedScale}%`;
54
+ tpPane.element.style.transformOrigin = '0 0';
55
+ tpPane.element.style.transform = `scale(${clampedScale})`;
56
+ tpPane.element.style.width = `${100 / clampedScale}%`;
57
57
  }
58
58
  }
59
59
  }
60
60
  function syncFolded() {
61
- if (paneRef) {
62
- paneRef.expanded = _expanded;
61
+ if (tpPane) {
62
+ tpPane.expanded = _expanded;
63
63
  }
64
64
  expanded = _expanded;
65
65
  }
66
- $: paneRef?.element && paneRef?.element.classList.add('svelte-tweakpane-ui');
67
- $: paneRef && setScale(scale);
68
- $: paneRef && updateCollapsibility(userExpandable, paneRef.element, 'tp-rotv_b', 'tp-rotv_m');
69
- $: paneRef && title && (paneRef.title = title);
70
- $: paneRef && applyTheme(paneRef.element, theme);
71
- $: _expanded, paneRef && syncFolded();
72
- $: paneRef && (_expanded = expanded);
66
+ $: tpPane?.element && tpPane?.element.classList.add('svelte-tweakpane-ui');
67
+ $: tpPane && setScale(scale);
68
+ $: tpPane && updateCollapsibility(userExpandable, tpPane.element, 'tp-rotv_b', 'tp-rotv_m');
69
+ $: tpPane && title && (tpPane.title = title);
70
+ $: tpPane && applyTheme(tpPane.element, theme);
71
+ $: _expanded, tpPane && expanded !== void 0 && syncFolded();
72
+ $: tpPane && (_expanded = expanded);
73
73
  </script>
74
74
 
75
75
  {#if BROWSER}
@@ -53,9 +53,19 @@ declare const __propDef: {
53
53
  */ scale?: number | undefined;
54
54
  /** Internal use only. */ userCreatedPane?: boolean | undefined;
55
55
  /**
56
- * Internal use only.
56
+ * The internal Tweakpane [`Pane`](https://tweakpane.github.io/docs/api/classes/Pane.html) object.
57
+ *
58
+ * This property is exposed for advanced use cases only.
59
+ *
60
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
61
+ *
62
+ * Note that the `Pane` type for this property comes from the core Tweakpane library.
63
+ * Creating an alias is suggested to avoid confusion with the _Svelte Tweakpane UI_ `Pane`
64
+ * component: e.g. `import { type Pane as TpPane } from 'tweakpane'`
65
+ *
66
+ * @bindable
57
67
  * @readonly
58
- * */ paneRef?: TpPane | undefined;
68
+ * */ tpPane?: TpPane | undefined;
59
69
  };
60
70
  events: {
61
71
  [evt: string]: CustomEvent<any>;
@@ -22,4 +22,4 @@
22
22
  };
23
23
  </script>
24
24
 
25
- <GenericInput bind:value options={optionsInternal} {...$$restProps} />
25
+ <GenericInput bind:value on:change options={optionsInternal} {...$$restProps} />
@@ -48,18 +48,24 @@ declare class __sveltets_Render<T extends number | IntervalSliderValue> {
48
48
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
49
49
  * this control.
50
50
  *
51
- * This is primarily for internal use, when implementing convenience components wrapping
52
- * Binding's functionality.
51
+ * This property is exposed for advanced use cases only, such as when implementing convenience
52
+ * components wrapping `<Binding>`'s functionality.
53
+ *
54
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
55
+ *
53
56
  * @bindable
54
57
  * @readonly
55
58
  */
56
59
  ref?: GenericSliderRef | undefined;
57
60
  /**
58
61
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
59
- * the binding's containing `<Pane>`.
62
+ * the `<Binding>`'s containing `<Pane>`.
63
+ *
64
+ * This property is exposed for advanced use cases only, such as when implementing convenience
65
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
60
68
  *
61
- * This is primarily for internal use, when implementing convenience components wrapping
62
- * Binding's functionality in combination with a Tweakpane plugin.
63
69
  * @default `undefined`
64
70
  */
65
71
  plugin?: import('tweakpane').TpPluginBundle | undefined;
@@ -87,7 +93,7 @@ declare class __sveltets_Render<T extends number | IntervalSliderValue> {
87
93
  * */
88
94
  max?: number | undefined;
89
95
  /**
90
- * A function to customize the point value's formatting (e.g. rounding, etc.).
96
+ * A function to customize the point value's string representation (e.g. rounding, etc.).
91
97
  * @default `undefined` \
92
98
  * Normal `.toString()` formatting.
93
99
  * */
@@ -112,7 +118,9 @@ declare class __sveltets_Render<T extends number | IntervalSliderValue> {
112
118
  * */
113
119
  step?: number | undefined;
114
120
  };
115
- events(): {} & {
121
+ events(): {
122
+ change: import('..').BindingChangeEvent;
123
+ } & {
116
124
  [evt: string]: CustomEvent<any>;
117
125
  };
118
126
  slots(): {};
@@ -48,18 +48,24 @@ declare const __propDef: {
48
48
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
49
49
  * this control.
50
50
  *
51
- * This is primarily for internal use, when implementing convenience components wrapping
52
- * Binding's functionality.
51
+ * This property is exposed for advanced use cases only, such as when implementing convenience
52
+ * components wrapping `<Binding>`'s functionality.
53
+ *
54
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
55
+ *
53
56
  * @bindable
54
57
  * @readonly
55
58
  */
56
59
  ref?: import('./GenericMonitor.svelte').GenericMonitorRef | undefined;
57
60
  /**
58
61
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
59
- * the binding's containing `<Pane>`.
62
+ * the `<Binding>`'s containing `<Pane>`.
63
+ *
64
+ * This property is exposed for advanced use cases only, such as when implementing convenience
65
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
60
68
  *
61
- * This is primarily for internal use, when implementing convenience components wrapping
62
- * Binding's functionality in combination with a Tweakpane plugin.
63
69
  * @default `undefined`
64
70
  */
65
71
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -48,18 +48,24 @@ declare const __propDef: {
48
48
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
49
49
  * this control.
50
50
  *
51
- * This is primarily for internal use, when implementing convenience components wrapping
52
- * Binding's functionality.
51
+ * This property is exposed for advanced use cases only, such as when implementing convenience
52
+ * components wrapping `<Binding>`'s functionality.
53
+ *
54
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
55
+ *
53
56
  * @bindable
54
57
  * @readonly
55
58
  */
56
59
  ref?: import('./GenericMonitor.svelte').GenericMonitorRef | undefined;
57
60
  /**
58
61
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
59
- * the binding's containing `<Pane>`.
62
+ * the `<Binding>`'s containing `<Pane>`.
63
+ *
64
+ * This property is exposed for advanced use cases only, such as when implementing convenience
65
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
60
68
  *
61
- * This is primarily for internal use, when implementing convenience components wrapping
62
- * Binding's functionality in combination with a Tweakpane plugin.
63
69
  * @default `undefined`
64
70
  */
65
71
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -111,7 +117,7 @@ declare const __propDef: {
111
117
  * */
112
118
  max?: number | undefined;
113
119
  /**
114
- * A function to customize the number's formatting (e.g. rounding, etc.).
120
+ * A function to customize the number's string representation (e.g. rounding, etc.).
115
121
  * @default `undefined` \
116
122
  * Normal `.toString()` formatting.
117
123
  * */
@@ -162,7 +168,12 @@ export type InternalMonitorNumberSlots = typeof __propDef.slots;
162
168
  * }, 100);
163
169
  * </script>
164
170
  *
165
- * <InternalMonitorNumber value={numberToMonitor} min={-1} max={1} graph={true} />
171
+ * <InternalMonitorNumber
172
+ * value={numberToMonitor}
173
+ * min={-1}
174
+ * max={1}
175
+ * graph={true}
176
+ * />
166
177
  * ```
167
178
  *
168
179
  * @sourceLink
@@ -48,18 +48,24 @@ declare const __propDef: {
48
48
  * [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
49
49
  * this control.
50
50
  *
51
- * This is primarily for internal use, when implementing convenience components wrapping
52
- * Binding's functionality.
51
+ * This property is exposed for advanced use cases only, such as when implementing convenience
52
+ * components wrapping `<Binding>`'s functionality.
53
+ *
54
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
55
+ *
53
56
  * @bindable
54
57
  * @readonly
55
58
  */
56
59
  ref?: import('./GenericMonitor.svelte').GenericMonitorRef | undefined;
57
60
  /**
58
61
  * Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
59
- * the binding's containing `<Pane>`.
62
+ * the `<Binding>`'s containing `<Pane>`.
63
+ *
64
+ * This property is exposed for advanced use cases only, such as when implementing convenience
65
+ * components wrapping `<Binding>`'s functionality in combination with a Tweakpane plugin.
66
+ *
67
+ * Direct manipulation of Tweakpane's internals can break _Svelte Tweakpane UI_ abstractions.
60
68
  *
61
- * This is primarily for internal use, when implementing convenience components wrapping
62
- * Binding's functionality in combination with a Tweakpane plugin.
63
69
  * @default `undefined`
64
70
  */
65
71
  plugin?: import('@tweakpane/core').TpPluginBundle | undefined;
@@ -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.