svelte-tweakpane-ui 1.2.7 → 1.3.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/IntervalSlider.svelte +18 -1
- package/dist/control/IntervalSlider.svelte.d.ts +8 -1
- package/dist/control/Ring.svelte.d.ts +6 -6
- package/dist/control/Slider.svelte +12 -1
- package/dist/control/Slider.svelte.d.ts +8 -1
- package/dist/control/Wheel.svelte.d.ts +6 -6
- package/dist/core/Folder.svelte.d.ts +3 -4
- package/dist/core/Pane.svelte.d.ts +2 -0
- package/dist/core/Separator.svelte.d.ts +2 -0
- package/dist/core/TabGroup.svelte.d.ts +2 -0
- package/dist/core/TabPage.svelte.d.ts +2 -0
- package/dist/extra/Element.svelte.d.ts +2 -0
- package/dist/internal/ClsPad.svelte.d.ts +2 -0
- package/dist/internal/GenericPane.svelte.d.ts +2 -0
- package/dist/internal/GenericSlider.svelte +2 -1
- package/dist/internal/GenericSlider.svelte.d.ts +6 -0
- package/dist/internal/InternalMonitorBoolean.svelte.d.ts +2 -0
- package/dist/internal/InternalMonitorNumber.svelte.d.ts +2 -0
- package/dist/internal/InternalMonitorString.svelte.d.ts +2 -0
- package/dist/internal/InternalPaneDraggable.svelte.d.ts +2 -0
- package/dist/internal/InternalPaneFixed.svelte.d.ts +2 -0
- package/dist/internal/InternalPaneInline.svelte.d.ts +2 -0
- package/dist/monitor/WaveformMonitor.svelte.d.ts +2 -0
- package/package.json +12 -12
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import GenericSlider from '../internal/GenericSlider.svelte';
|
|
6
6
|
export let value;
|
|
7
7
|
export let meanValue = void 0;
|
|
8
|
+
export let wide = void 0;
|
|
8
9
|
let internalValue;
|
|
9
10
|
function updateInternalValue() {
|
|
10
11
|
if (Array.isArray(value)) {
|
|
@@ -28,10 +29,26 @@
|
|
|
28
29
|
internalValue = { min: meanValue - r / 2, max: meanValue + r / 2 };
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
let ref;
|
|
33
|
+
function updateWide(wide2) {
|
|
34
|
+
const inputField = ref?.element.querySelector('div.tp-rsltxtv_t');
|
|
35
|
+
if (wide2) {
|
|
36
|
+
inputField?.style.setProperty('display', 'none');
|
|
37
|
+
} else {
|
|
38
|
+
inputField?.style.removeProperty('display');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
$: ref && wide !== void 0 && updateWide(wide);
|
|
31
42
|
$: value, updateInternalValue();
|
|
32
43
|
$: internalValue, updateValue();
|
|
33
44
|
$: meanValue = (internalValue.min + internalValue.max) / 2;
|
|
34
45
|
$: meanValue, updateValueFromMean();
|
|
35
46
|
</script>
|
|
36
47
|
|
|
37
|
-
<GenericSlider
|
|
48
|
+
<GenericSlider
|
|
49
|
+
bind:value={internalValue}
|
|
50
|
+
bind:ref
|
|
51
|
+
on:change
|
|
52
|
+
plugin={pluginModule}
|
|
53
|
+
{...$$restProps}
|
|
54
|
+
/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from 'svelte';
|
|
2
2
|
import type { Simplify } from '../utils';
|
|
3
3
|
import type { ValueChangeEvent } from '../utils.js';
|
|
4
|
+
import type { SliderInputBindingApi as GenericSliderRef } from 'tweakpane';
|
|
4
5
|
export type IntervalSliderValueTuple = [min: number, max: number];
|
|
5
6
|
export type IntervalSliderValueObject = {
|
|
6
7
|
min: number;
|
|
@@ -63,6 +64,12 @@ declare const __propDef: {
|
|
|
63
64
|
* No step constraint.
|
|
64
65
|
*/
|
|
65
66
|
step?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* When `true`, expand the width of the control at the expense of the numeric input
|
|
69
|
+
* field.
|
|
70
|
+
* @default `false`
|
|
71
|
+
*/
|
|
72
|
+
wide?: boolean | undefined;
|
|
66
73
|
} & {
|
|
67
74
|
/**
|
|
68
75
|
* Interval value to control.
|
|
@@ -124,7 +131,7 @@ declare const __propDef: {
|
|
|
124
131
|
* @bindable
|
|
125
132
|
* @readonly
|
|
126
133
|
*/
|
|
127
|
-
ref?:
|
|
134
|
+
ref?: GenericSliderRef | undefined;
|
|
128
135
|
/**
|
|
129
136
|
* Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
|
|
130
137
|
* the `<Binding>`'s containing `<Pane>`.
|
|
@@ -44,12 +44,6 @@ declare const __propDef: {
|
|
|
44
44
|
* @default `{ ticks: 5, pixels: 40, value: 10 }`
|
|
45
45
|
* */
|
|
46
46
|
unit?: RingUnit | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* When `true`, expand the width of the ring control at the expense of the numeric input
|
|
49
|
-
* field.
|
|
50
|
-
* @default `false`
|
|
51
|
-
* */
|
|
52
|
-
wide?: boolean | undefined;
|
|
53
47
|
} & Omit<
|
|
54
48
|
{
|
|
55
49
|
/**
|
|
@@ -91,6 +85,12 @@ declare const __propDef: {
|
|
|
91
85
|
* No step constraint.
|
|
92
86
|
*/
|
|
93
87
|
step?: number | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* When `true`, expand the width of the control at the expense of the numeric input
|
|
90
|
+
* field.
|
|
91
|
+
* @default `false`
|
|
92
|
+
*/
|
|
93
|
+
wide?: boolean | undefined;
|
|
94
94
|
} & {
|
|
95
95
|
/**
|
|
96
96
|
* A `number` value to control.
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
<script>
|
|
4
4
|
import GenericSlider from '../internal/GenericSlider.svelte';
|
|
5
5
|
export let value;
|
|
6
|
+
export let wide = void 0;
|
|
7
|
+
let ref;
|
|
8
|
+
function updateWide(wide2) {
|
|
9
|
+
const inputField = ref?.element.querySelector('div.tp-sldtxtv_t');
|
|
10
|
+
if (wide2) {
|
|
11
|
+
inputField?.style.setProperty('display', 'none');
|
|
12
|
+
} else {
|
|
13
|
+
inputField?.style.removeProperty('display');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
$: ref && wide !== void 0 && updateWide(wide);
|
|
6
17
|
</script>
|
|
7
18
|
|
|
8
|
-
<GenericSlider bind:value on:change {...$$restProps} />
|
|
19
|
+
<GenericSlider bind:value bind:ref bind:wide on:change {...$$restProps} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SvelteComponent } from 'svelte';
|
|
2
2
|
import type { ValueChangeEvent } from '../utils.js';
|
|
3
|
+
import type { SliderInputBindingApi as GenericSliderRef } from 'tweakpane';
|
|
3
4
|
export type SliderChangeEvent = ValueChangeEvent<number>;
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
@@ -49,6 +50,12 @@ declare const __propDef: {
|
|
|
49
50
|
* No step constraint.
|
|
50
51
|
*/
|
|
51
52
|
step?: number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* When `true`, expand the width of the control at the expense of the numeric input
|
|
55
|
+
* field.
|
|
56
|
+
* @default `false`
|
|
57
|
+
*/
|
|
58
|
+
wide?: boolean | undefined;
|
|
52
59
|
} & {
|
|
53
60
|
/**
|
|
54
61
|
* A `number` value to control.
|
|
@@ -108,7 +115,7 @@ declare const __propDef: {
|
|
|
108
115
|
* @bindable
|
|
109
116
|
* @readonly
|
|
110
117
|
*/
|
|
111
|
-
ref?:
|
|
118
|
+
ref?: GenericSliderRef | undefined;
|
|
112
119
|
/**
|
|
113
120
|
* Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
|
|
114
121
|
* the `<Binding>`'s containing `<Pane>`.
|
|
@@ -14,12 +14,6 @@ declare const __propDef: {
|
|
|
14
14
|
* `value`](https://github.com/cocopon/tweakpane/blob/66dfbea04bfe9b7f031673c955ceda1f92356e75/packages/core/src/common/number/util.ts#L54).
|
|
15
15
|
*/
|
|
16
16
|
amount?: number | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* When `true`, expand the width of the wheel control at the expense of the numeric input
|
|
19
|
-
* field.
|
|
20
|
-
* @default `false`
|
|
21
|
-
* */
|
|
22
|
-
wide?: boolean | undefined;
|
|
23
17
|
} & Omit<
|
|
24
18
|
{
|
|
25
19
|
/**
|
|
@@ -61,6 +55,12 @@ declare const __propDef: {
|
|
|
61
55
|
* No step constraint.
|
|
62
56
|
*/
|
|
63
57
|
step?: number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* When `true`, expand the width of the control at the expense of the numeric input
|
|
60
|
+
* field.
|
|
61
|
+
* @default `false`
|
|
62
|
+
*/
|
|
63
|
+
wide?: boolean | undefined;
|
|
64
64
|
} & {
|
|
65
65
|
/**
|
|
66
66
|
* A `number` value to control.
|
|
@@ -31,10 +31,7 @@ declare const __propDef: {
|
|
|
31
31
|
* set with `setGlobalDefaultTheme()`.
|
|
32
32
|
* */ theme?: Theme | undefined;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
* Prevent interactivity and gray out the control.
|
|
36
|
-
* @default `false`
|
|
37
|
-
* */ events: {
|
|
34
|
+
events: {
|
|
38
35
|
[evt: string]: CustomEvent<any>;
|
|
39
36
|
};
|
|
40
37
|
slots: {
|
|
@@ -43,6 +40,8 @@ declare const __propDef: {
|
|
|
43
40
|
*/
|
|
44
41
|
default: {};
|
|
45
42
|
};
|
|
43
|
+
exports?: {} | undefined;
|
|
44
|
+
bindings?: string | undefined;
|
|
46
45
|
};
|
|
47
46
|
export type FolderProps = typeof __propDef.props;
|
|
48
47
|
export type FolderEvents = typeof __propDef.events;
|
|
@@ -56,6 +56,8 @@ declare const __propDef: {
|
|
|
56
56
|
[evt: string]: CustomEvent<any>;
|
|
57
57
|
};
|
|
58
58
|
slots: {};
|
|
59
|
+
exports?: {} | undefined;
|
|
60
|
+
bindings?: string | undefined;
|
|
59
61
|
};
|
|
60
62
|
export type SeparatorProps = typeof __propDef.props;
|
|
61
63
|
export type SeparatorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export let pointerScale = void 0;
|
|
9
9
|
export let keyScale = void 0;
|
|
10
10
|
export let format = void 0;
|
|
11
|
+
export let ref = void 0;
|
|
11
12
|
let formatProxy = format;
|
|
12
13
|
$: formatProxy !== format && (formatProxy = format);
|
|
13
14
|
let optionsInternal;
|
|
@@ -22,4 +23,4 @@
|
|
|
22
23
|
};
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
|
-
<GenericInput bind:value on:change options={optionsInternal} {...$$restProps} />
|
|
26
|
+
<GenericInput bind:value bind:ref on:change options={optionsInternal} {...$$restProps} />
|
|
@@ -43,6 +43,12 @@ declare class __sveltets_Render<T extends number | IntervalSliderValue> {
|
|
|
43
43
|
* No step constraint.
|
|
44
44
|
* */
|
|
45
45
|
step?: number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* When `true`, expand the width of the control at the expense of the numeric input
|
|
48
|
+
* field.
|
|
49
|
+
* @default `false`
|
|
50
|
+
* */
|
|
51
|
+
wide?: boolean | undefined;
|
|
46
52
|
} & {
|
|
47
53
|
/**
|
|
48
54
|
* The value to control.
|
|
@@ -111,6 +111,8 @@ declare const __propDef: {
|
|
|
111
111
|
[evt: string]: CustomEvent<any>;
|
|
112
112
|
};
|
|
113
113
|
slots: {};
|
|
114
|
+
exports?: {} | undefined;
|
|
115
|
+
bindings?: string | undefined;
|
|
114
116
|
};
|
|
115
117
|
export type InternalMonitorBooleanProps = typeof __propDef.props;
|
|
116
118
|
export type InternalMonitorBooleanEvents = typeof __propDef.events;
|
|
@@ -132,6 +132,8 @@ declare const __propDef: {
|
|
|
132
132
|
[evt: string]: CustomEvent<any>;
|
|
133
133
|
};
|
|
134
134
|
slots: {};
|
|
135
|
+
exports?: {} | undefined;
|
|
136
|
+
bindings?: string | undefined;
|
|
135
137
|
};
|
|
136
138
|
export type InternalMonitorNumberProps = typeof __propDef.props;
|
|
137
139
|
export type InternalMonitorNumberEvents = typeof __propDef.events;
|
|
@@ -116,6 +116,8 @@ declare const __propDef: {
|
|
|
116
116
|
[evt: string]: CustomEvent<any>;
|
|
117
117
|
};
|
|
118
118
|
slots: {};
|
|
119
|
+
exports?: {} | undefined;
|
|
120
|
+
bindings?: string | undefined;
|
|
119
121
|
};
|
|
120
122
|
export type InternalMonitorStringProps = typeof __propDef.props;
|
|
121
123
|
export type InternalMonitorStringEvents = typeof __propDef.events;
|
|
@@ -169,6 +169,8 @@ declare const __propDef: {
|
|
|
169
169
|
*/
|
|
170
170
|
default: {};
|
|
171
171
|
};
|
|
172
|
+
exports?: {} | undefined;
|
|
173
|
+
bindings?: string | undefined;
|
|
172
174
|
};
|
|
173
175
|
export type InternalPaneDraggableProps = typeof __propDef.props;
|
|
174
176
|
export type InternalPaneDraggableEvents = typeof __propDef.events;
|
|
@@ -108,6 +108,8 @@ declare const __propDef: {
|
|
|
108
108
|
*/
|
|
109
109
|
default: {};
|
|
110
110
|
};
|
|
111
|
+
exports?: {} | undefined;
|
|
112
|
+
bindings?: string | undefined;
|
|
111
113
|
};
|
|
112
114
|
export type InternalPaneFixedProps = typeof __propDef.props;
|
|
113
115
|
export type InternalPaneFixedEvents = typeof __propDef.events;
|
|
@@ -134,6 +134,8 @@ declare const __propDef: {
|
|
|
134
134
|
[evt: string]: CustomEvent<any>;
|
|
135
135
|
};
|
|
136
136
|
slots: {};
|
|
137
|
+
exports?: {} | undefined;
|
|
138
|
+
bindings?: string | undefined;
|
|
137
139
|
};
|
|
138
140
|
export type WaveformMonitorProps = typeof __propDef.props;
|
|
139
141
|
export type WaveformMonitorEvents = typeof __propDef.events;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tweakpane-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Svelte component library wrapping UI elements from Tweakpane, plus some additional functionality for convenience and flexibility.",
|
|
6
6
|
"repository": {
|
|
@@ -202,32 +202,32 @@
|
|
|
202
202
|
"devDependencies": {
|
|
203
203
|
"@kitschpatrol/shared-config": "^4.6.6",
|
|
204
204
|
"@phenomnomnominal/tsquery": "^6.1.3",
|
|
205
|
-
"@playwright/test": "^1.44.
|
|
205
|
+
"@playwright/test": "^1.44.1",
|
|
206
206
|
"@stkb/rewrap": "^0.1.0",
|
|
207
207
|
"@sveltejs/adapter-static": "^3.0.1",
|
|
208
|
-
"@sveltejs/kit": "^2.5.
|
|
208
|
+
"@sveltejs/kit": "^2.5.10",
|
|
209
209
|
"@sveltejs/package": "^2.3.1",
|
|
210
|
-
"@sveltejs/vite-plugin-svelte": "^3.1.
|
|
210
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
211
211
|
"@types/eslint": "^8.56.10",
|
|
212
212
|
"@types/fs-extra": "^11.0.4",
|
|
213
|
-
"@types/node": "^20.12.
|
|
213
|
+
"@types/node": "^20.12.13",
|
|
214
214
|
"bumpp": "^9.4.1",
|
|
215
215
|
"eslint": "^8.57.0",
|
|
216
216
|
"fs-extra": "^11.2.0",
|
|
217
|
-
"glob": "^10.
|
|
217
|
+
"glob": "^10.4.1",
|
|
218
218
|
"npm-run-all": "^4.1.5",
|
|
219
219
|
"postcss-html": "^1.7.0",
|
|
220
220
|
"publint": "^0.2.8",
|
|
221
221
|
"read-package-up": "^11.0.0",
|
|
222
222
|
"svelte": "^4.2.17",
|
|
223
|
-
"svelte-check": "^3.
|
|
224
|
-
"svelte-language-server": "^0.16.
|
|
225
|
-
"svelte2tsx": "^0.7.
|
|
223
|
+
"svelte-check": "^3.8.0",
|
|
224
|
+
"svelte-language-server": "^0.16.10",
|
|
225
|
+
"svelte2tsx": "^0.7.9",
|
|
226
226
|
"ts-morph": "^22.0.0",
|
|
227
227
|
"tslib": "^2.6.2",
|
|
228
|
-
"tsx": "^4.
|
|
228
|
+
"tsx": "^4.11.0",
|
|
229
229
|
"typescript": "^5.4.5",
|
|
230
|
-
"vite": "^5.2.
|
|
230
|
+
"vite": "^5.2.12",
|
|
231
231
|
"yaml": "^2.4.2"
|
|
232
232
|
},
|
|
233
233
|
"scripts": {
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
"build:13-build-docs": "pnpm run docs-build",
|
|
248
248
|
"check": "svelte-kit sync && svelte-check --ignore ./scratch --tsconfig ./tsconfig.json",
|
|
249
249
|
"check-watch": "svelte-kit sync && svelte-check --ignore ./scratch --tsconfig ./tsconfig.json --watch",
|
|
250
|
-
"clean": "git clean -fdX",
|
|
250
|
+
"clean": "git clean -fdX && rm ./pnpm-lock.yaml",
|
|
251
251
|
"docs-build": "pnpm -C ./docs run build",
|
|
252
252
|
"docs-dev": "pnpm -C ./docs run dev",
|
|
253
253
|
"docs-preview": "pnpm -C ./docs run preview",
|