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.
- package/dist/control/Button.svelte.d.ts +3 -2
- package/dist/control/ButtonGrid.svelte.d.ts +20 -9
- package/dist/control/Checkbox.svelte +3 -1
- package/dist/control/Checkbox.svelte.d.ts +28 -7
- package/dist/control/Color.svelte +1 -0
- package/dist/control/Color.svelte.d.ts +28 -7
- package/dist/control/CubicBezier.svelte +36 -11
- package/dist/control/CubicBezier.svelte.d.ts +40 -13
- package/dist/control/Image.svelte +1 -1
- package/dist/control/Image.svelte.d.ts +32 -7
- package/dist/control/IntervalSlider.svelte +1 -1
- package/dist/control/IntervalSlider.svelte.d.ts +29 -8
- package/dist/control/List.svelte +19 -2
- package/dist/control/List.svelte.d.ts +34 -9
- package/dist/control/Point.svelte +1 -0
- package/dist/control/Point.svelte.d.ts +39 -10
- package/dist/control/RadioGrid.svelte +4 -2
- package/dist/control/RadioGrid.svelte.d.ts +38 -13
- package/dist/control/Ring.svelte +1 -1
- package/dist/control/Ring.svelte.d.ts +36 -10
- package/dist/control/RotationEuler.svelte +1 -0
- package/dist/control/RotationEuler.svelte.d.ts +43 -74
- package/dist/control/RotationQuaternion.svelte +1 -0
- package/dist/control/RotationQuaternion.svelte.d.ts +28 -12
- package/dist/control/Slider.svelte +3 -1
- package/dist/control/Slider.svelte.d.ts +32 -11
- package/dist/control/Text.svelte +7 -9
- package/dist/control/Text.svelte.d.ts +28 -7
- package/dist/control/Textarea.svelte +20 -6
- package/dist/control/Textarea.svelte.d.ts +28 -7
- package/dist/control/Wheel.svelte +3 -1
- package/dist/control/Wheel.svelte.d.ts +30 -9
- package/dist/core/Binding.svelte +39 -7
- package/dist/core/Binding.svelte.d.ts +28 -7
- package/dist/core/Blade.svelte.d.ts +17 -7
- package/dist/core/Pane.svelte +9 -3
- package/dist/core/Pane.svelte.d.ts +98 -71
- package/dist/core/Separator.svelte.d.ts +12 -6
- package/dist/extra/AutoObject.svelte +28 -5
- package/dist/extra/AutoObject.svelte.d.ts +17 -3
- package/dist/extra/AutoValue.svelte +4 -2
- package/dist/extra/AutoValue.svelte.d.ts +29 -9
- package/dist/extra/Element.svelte.d.ts +13 -7
- package/dist/index.d.ts +29 -12
- package/dist/internal/GenericBinding.svelte +1 -1
- package/dist/internal/GenericBinding.svelte.d.ts +14 -6
- package/dist/internal/GenericBladeFolding.svelte.d.ts +12 -6
- package/dist/internal/GenericInput.svelte +1 -1
- package/dist/internal/GenericInput.svelte.d.ts +14 -6
- package/dist/internal/GenericInputFolding.svelte +1 -1
- package/dist/internal/GenericInputFolding.svelte.d.ts +14 -6
- package/dist/internal/GenericMonitor.svelte.d.ts +11 -5
- package/dist/internal/GenericPane.svelte +21 -21
- package/dist/internal/GenericPane.svelte.d.ts +12 -2
- package/dist/internal/GenericSlider.svelte +1 -1
- package/dist/internal/GenericSlider.svelte.d.ts +15 -7
- package/dist/internal/InternalMonitorBoolean.svelte.d.ts +11 -5
- package/dist/internal/InternalMonitorNumber.svelte.d.ts +18 -7
- package/dist/internal/InternalMonitorString.svelte.d.ts +11 -5
- package/dist/internal/InternalPaneDraggable.svelte +18 -12
- package/dist/internal/InternalPaneDraggable.svelte.d.ts +13 -4
- package/dist/internal/InternalPaneFixed.svelte +3 -3
- package/dist/internal/InternalPaneFixed.svelte.d.ts +13 -4
- package/dist/internal/InternalPaneInline.svelte +6 -6
- package/dist/internal/InternalPaneInline.svelte.d.ts +72 -66
- package/dist/monitor/FpsGraph.svelte.d.ts +12 -6
- package/dist/monitor/Monitor.svelte.d.ts +45 -21
- package/dist/monitor/Profiler.svelte.d.ts +22 -9
- package/dist/monitor/WaveformMonitor.svelte.d.ts +11 -5
- package/dist/utils.d.ts +15 -0
- package/package.json +18 -13
- package/readme.md +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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` (
|
|
35
|
-
* the
|
|
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;
|
|
@@ -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
|
|
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
|
|
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(): {};
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
21
|
-
console.warn(`
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
47
|
+
if (tpPane) {
|
|
48
48
|
if (scale2 === 1) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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 (
|
|
62
|
-
|
|
61
|
+
if (tpPane) {
|
|
62
|
+
tpPane.expanded = _expanded;
|
|
63
63
|
}
|
|
64
64
|
expanded = _expanded;
|
|
65
65
|
}
|
|
66
|
-
$:
|
|
67
|
-
$:
|
|
68
|
-
$:
|
|
69
|
-
$:
|
|
70
|
-
$:
|
|
71
|
-
$: _expanded,
|
|
72
|
-
$:
|
|
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
|
-
*
|
|
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
|
-
* */
|
|
68
|
+
* */ tpPane?: TpPane | undefined;
|
|
59
69
|
};
|
|
60
70
|
events: {
|
|
61
71
|
[evt: string]: CustomEvent<any>;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
112
|
-
|
|
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
|
-
|
|
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 (
|
|
169
|
-
containerElement.append(
|
|
174
|
+
if (tpPane) {
|
|
175
|
+
containerElement.append(tpPane.element);
|
|
170
176
|
} else {
|
|
171
|
-
console.warn('no
|
|
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
|
-
$:
|
|
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(
|
|
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:
|
|
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
|
-
*
|
|
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
|
-
|
|
74
|
+
tpPane?: import('tweakpane').Pane | undefined;
|
|
66
75
|
},
|
|
67
|
-
'userCreatedPane'
|
|
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
|
|
9
|
+
export let tpPane = void 0;
|
|
10
10
|
let paneContainer;
|
|
11
|
-
$:
|
|
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:
|
|
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
|
-
*
|
|
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
|
-
|
|
74
|
+
tpPane?: import('tweakpane').Pane | undefined;
|
|
66
75
|
},
|
|
67
|
-
'userCreatedPane'
|
|
76
|
+
'userCreatedPane'
|
|
68
77
|
> & {
|
|
69
78
|
/**
|
|
70
79
|
* Horizontal position of the pane relative to the left edge of the window, in pixels.
|