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
|
@@ -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 (
|
|
16
|
-
const fixedContainer =
|
|
17
|
-
containerElement.append(
|
|
15
|
+
if (tpPane) {
|
|
16
|
+
const fixedContainer = tpPane.element.parentElement;
|
|
17
|
+
containerElement.append(tpPane.element);
|
|
18
18
|
fixedContainer?.remove();
|
|
19
19
|
} else {
|
|
20
|
-
console.warn('
|
|
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:
|
|
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:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
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` (
|
|
55
|
-
* the
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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` (
|
|
71
|
-
* the
|
|
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 {
|
|
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(
|
|
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
|
|
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
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tweakpane-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wraps UI elements from Tweakpane in a collection of idiomatic Svelte components, and augments Tweakpane with a few extra features for your convenience and enjoyment.",
|
|
6
6
|
"repository": {
|
|
@@ -192,39 +192,42 @@
|
|
|
192
192
|
"@tweakpane/plugin-camerakit": "^0.3.0",
|
|
193
193
|
"@tweakpane/plugin-essentials": "^0.2.1",
|
|
194
194
|
"esm-env": "^1.0.0",
|
|
195
|
+
"fast-copy": "^3.0.1",
|
|
196
|
+
"fast-equals": "^5.0.1",
|
|
195
197
|
"nanoid": "^5.0.4",
|
|
196
198
|
"svelte-local-storage-store": "^0.6.4",
|
|
197
199
|
"tweakpane": "^4.0.3",
|
|
198
200
|
"tweakpane-plugin-waveform": "^1.0.0"
|
|
199
201
|
},
|
|
200
202
|
"devDependencies": {
|
|
201
|
-
"@kitschpatrol/shared-config": "^4.3.
|
|
203
|
+
"@kitschpatrol/shared-config": "^4.3.3",
|
|
202
204
|
"@phenomnomnominal/tsquery": "^6.1.3",
|
|
205
|
+
"@playwright/test": "^1.41.1",
|
|
203
206
|
"@stkb/rewrap": "^0.1.0",
|
|
204
207
|
"@sveltejs/adapter-static": "^3.0.1",
|
|
205
|
-
"@sveltejs/kit": "^2.0
|
|
206
|
-
"@sveltejs/package": "^2.2.
|
|
208
|
+
"@sveltejs/kit": "^2.5.0",
|
|
209
|
+
"@sveltejs/package": "^2.2.6",
|
|
207
210
|
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
|
208
|
-
"@types/eslint": "^8.56.
|
|
211
|
+
"@types/eslint": "^8.56.2",
|
|
209
212
|
"@types/fs-extra": "^11.0.4",
|
|
210
|
-
"@types/node": "^20.
|
|
211
|
-
"bumpp": "^9.
|
|
213
|
+
"@types/node": "^20.11.6",
|
|
214
|
+
"bumpp": "^9.3.0",
|
|
212
215
|
"eslint": "^8.56.0",
|
|
213
216
|
"fs-extra": "^11.2.0",
|
|
214
217
|
"glob": "^10.3.10",
|
|
215
218
|
"npm-run-all": "^4.1.5",
|
|
216
|
-
"postcss-html": "^1.
|
|
219
|
+
"postcss-html": "^1.6.0",
|
|
217
220
|
"publint": "^0.2.7",
|
|
218
221
|
"read-package-up": "^11.0.0",
|
|
219
|
-
"svelte": "^4.2.
|
|
220
|
-
"svelte-check": "^3.6.
|
|
221
|
-
"svelte-language-server": "^0.16.
|
|
222
|
-
"svelte2tsx": "^0.
|
|
222
|
+
"svelte": "^4.2.9",
|
|
223
|
+
"svelte-check": "^3.6.3",
|
|
224
|
+
"svelte-language-server": "^0.16.3",
|
|
225
|
+
"svelte2tsx": "^0.7.0",
|
|
223
226
|
"ts-morph": "^21.0.1",
|
|
224
227
|
"tslib": "^2.6.2",
|
|
225
228
|
"tsx": "^4.7.0",
|
|
226
229
|
"typescript": "^5.3.3",
|
|
227
|
-
"vite": "^5.0.
|
|
230
|
+
"vite": "^5.0.12",
|
|
228
231
|
"yaml": "^2.3.4"
|
|
229
232
|
},
|
|
230
233
|
"scripts": {
|
|
@@ -261,6 +264,8 @@
|
|
|
261
264
|
"release:2-version": "pnpm bumpp --commit 'Release: %s' --tag 'v%s'",
|
|
262
265
|
"release:3-publish": "pnpm publish --ignore-scripts --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')",
|
|
263
266
|
"rewrap": "rewrap -i --column 100 `find src \\( -name '*.svelte' -o -name '*.ts' -o -name '*.html' \\) -type f | grep -v src/examples`",
|
|
267
|
+
"test": "run-s --print-label test:*",
|
|
268
|
+
"test:integration": "playwright test",
|
|
264
269
|
"type-check": "tsc --noEmit"
|
|
265
270
|
}
|
|
266
271
|
}
|
package/readme.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
🎛️ **_Svelte Tweakpane UI_** wraps user-interface elements from the excellent [Tweakpane](https://
|
|
8
|
+
🎛️ **_Svelte Tweakpane UI_** wraps user-interface elements from the excellent [Tweakpane](https://tweakpane.github.io/docs/) library in a collection of 31 idiomatic, reactive, type-safe, carefully-crafted, and obsessively-documented [Svelte](https://svelte.dev) components.
|
|
9
9
|
|
|
10
10
|
The library makes it easy to quickly and declaratively add knobs and dials to your projects using components that feel like they were made for Svelte. It also augments Tweakpane with a few [extra features](https://kitschpatrol.com/svelte-tweakpane-ui/docs/features) for your convenience and enjoyment.
|
|
11
11
|
|