svelte-tweakpane-ui 1.5.3 → 1.5.4
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 +30 -30
- package/dist/control/Button.svelte.d.ts +18 -18
- package/dist/control/ButtonGrid.svelte +25 -25
- package/dist/control/ButtonGrid.svelte.d.ts +35 -35
- package/dist/control/Checkbox.svelte +2 -2
- package/dist/control/Checkbox.svelte.d.ts +23 -23
- package/dist/control/Color.svelte +34 -34
- package/dist/control/Color.svelte.d.ts +40 -40
- package/dist/control/CubicBezier.svelte +30 -30
- package/dist/control/CubicBezier.svelte.d.ts +47 -47
- package/dist/control/File.svelte +20 -20
- package/dist/control/File.svelte.d.ts +38 -38
- package/dist/control/Image.svelte +22 -22
- package/dist/control/Image.svelte.d.ts +31 -31
- package/dist/control/IntervalSlider.svelte +24 -24
- package/dist/control/IntervalSlider.svelte.d.ts +39 -39
- package/dist/control/List.svelte +35 -35
- package/dist/control/List.svelte.d.ts +31 -31
- package/dist/control/Point.svelte +31 -31
- package/dist/control/Point.svelte.d.ts +81 -81
- package/dist/control/RadioGrid.svelte +24 -24
- package/dist/control/RadioGrid.svelte.d.ts +40 -40
- package/dist/control/Ring.svelte +9 -9
- package/dist/control/Ring.svelte.d.ts +40 -40
- package/dist/control/RotationEuler.svelte +25 -25
- package/dist/control/RotationEuler.svelte.d.ts +53 -53
- package/dist/control/RotationQuaternion.svelte +24 -24
- package/dist/control/RotationQuaternion.svelte.d.ts +47 -47
- package/dist/control/Slider.svelte +9 -9
- package/dist/control/Slider.svelte.d.ts +32 -32
- package/dist/control/Stepper.svelte +16 -16
- package/dist/control/Stepper.svelte.d.ts +32 -32
- package/dist/control/Text.svelte +13 -13
- package/dist/control/Text.svelte.d.ts +26 -26
- package/dist/control/Textarea.svelte +34 -34
- package/dist/control/Textarea.svelte.d.ts +29 -29
- package/dist/control/Wheel.svelte +8 -8
- package/dist/control/Wheel.svelte.d.ts +32 -32
- package/dist/core/Binding.svelte +60 -60
- package/dist/core/Binding.svelte.d.ts +33 -33
- package/dist/core/Blade.svelte +30 -30
- package/dist/core/Blade.svelte.d.ts +21 -21
- package/dist/core/Folder.svelte +34 -34
- package/dist/core/Folder.svelte.d.ts +22 -22
- package/dist/core/Pane.svelte +17 -17
- package/dist/core/Pane.svelte.d.ts +56 -56
- package/dist/core/Separator.svelte +5 -5
- package/dist/core/Separator.svelte.d.ts +20 -20
- package/dist/core/TabGroup.svelte +29 -29
- package/dist/core/TabGroup.svelte.d.ts +18 -18
- package/dist/core/TabPage.svelte +36 -36
- package/dist/core/TabPage.svelte.d.ts +21 -21
- package/dist/extra/AutoObject.svelte +20 -20
- package/dist/extra/AutoObject.svelte.d.ts +22 -22
- package/dist/extra/AutoValue.svelte +3 -3
- package/dist/extra/AutoValue.svelte.d.ts +26 -26
- package/dist/extra/Element.svelte +10 -10
- package/dist/extra/Element.svelte.d.ts +26 -26
- package/dist/index.d.ts +48 -48
- package/dist/index.js +35 -35
- package/dist/internal/ClsPad.svelte +11 -11
- package/dist/internal/ClsPad.svelte.d.ts +17 -17
- package/dist/internal/GenericBinding.svelte +11 -11
- package/dist/internal/GenericBinding.svelte.d.ts +25 -25
- package/dist/internal/GenericBladeFolding.svelte +19 -19
- package/dist/internal/GenericBladeFolding.svelte.d.ts +20 -20
- package/dist/internal/GenericInput.svelte +7 -7
- package/dist/internal/GenericInput.svelte.d.ts +27 -27
- package/dist/internal/GenericInputFolding.svelte +21 -21
- package/dist/internal/GenericInputFolding.svelte.d.ts +32 -32
- package/dist/internal/GenericMonitor.svelte +10 -10
- package/dist/internal/GenericMonitor.svelte.d.ts +29 -29
- package/dist/internal/GenericPane.svelte +48 -48
- package/dist/internal/GenericPane.svelte.d.ts +22 -22
- package/dist/internal/GenericSlider.svelte +15 -15
- package/dist/internal/GenericSlider.svelte.d.ts +29 -29
- package/dist/internal/InternalMonitorBoolean.svelte +5 -5
- package/dist/internal/InternalMonitorBoolean.svelte.d.ts +31 -31
- package/dist/internal/InternalMonitorNumber.svelte +14 -14
- package/dist/internal/InternalMonitorNumber.svelte.d.ts +37 -37
- package/dist/internal/InternalMonitorString.svelte +9 -9
- package/dist/internal/InternalMonitorString.svelte.d.ts +32 -32
- package/dist/internal/InternalPaneDraggable.svelte +169 -173
- package/dist/internal/InternalPaneDraggable.svelte.d.ts +30 -30
- package/dist/internal/InternalPaneFixed.svelte +13 -13
- package/dist/internal/InternalPaneFixed.svelte.d.ts +23 -23
- package/dist/internal/InternalPaneInline.svelte +14 -14
- package/dist/internal/InternalPaneInline.svelte.d.ts +21 -21
- package/dist/monitor/FpsGraph.svelte +35 -35
- package/dist/monitor/FpsGraph.svelte.d.ts +50 -42
- package/dist/monitor/Monitor.svelte +4 -4
- package/dist/monitor/Monitor.svelte.d.ts +87 -88
- package/dist/monitor/Profiler.svelte +37 -37
- package/dist/monitor/Profiler.svelte.d.ts +78 -76
- package/dist/monitor/WaveformMonitor.svelte +12 -12
- package/dist/monitor/WaveformMonitor.svelte.d.ts +39 -39
- package/dist/theme.d.ts +61 -61
- package/dist/theme.js +49 -53
- package/dist/utils.d.ts +62 -66
- package/dist/utils.js +78 -78
- package/license.txt +1 -1
- package/package.json +100 -115
- package/readme.md +1 -1
package/dist/core/TabPage.svelte
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import TabGroup from './TabGroup.svelte'
|
|
3
|
-
import ClsPad from '../internal/ClsPad.svelte'
|
|
4
|
-
import InternalPaneInline from '../internal/InternalPaneInline.svelte'
|
|
5
|
-
import { getElementIndex, isRootPane } from '../utils.js'
|
|
6
|
-
import { BROWSER } from 'esm-env'
|
|
7
|
-
import { getContext, onDestroy, onMount, setContext } from 'svelte'
|
|
8
|
-
import { writable } from 'svelte/store'
|
|
9
|
-
export let title = 'Tab Page'
|
|
10
|
-
export let disabled = false
|
|
11
|
-
export let selected = false
|
|
12
|
-
export let theme = void 0
|
|
13
|
-
const tabGroupStore = getContext('tabGroupStore')
|
|
14
|
-
const tabIndexStore = getContext('tabIndexStore')
|
|
15
|
-
const userCreatedPane = getContext('userCreatedPane')
|
|
16
|
-
const parentStore = getContext('parentStore')
|
|
17
|
-
const tabPageStore = writable()
|
|
18
|
-
setContext('parentStore', tabPageStore)
|
|
19
|
-
let indexElement
|
|
20
|
-
let index
|
|
2
|
+
import TabGroup from './TabGroup.svelte'
|
|
3
|
+
import ClsPad from '../internal/ClsPad.svelte'
|
|
4
|
+
import InternalPaneInline from '../internal/InternalPaneInline.svelte'
|
|
5
|
+
import { getElementIndex, isRootPane } from '../utils.js'
|
|
6
|
+
import { BROWSER } from 'esm-env'
|
|
7
|
+
import { getContext, onDestroy, onMount, setContext } from 'svelte'
|
|
8
|
+
import { writable } from 'svelte/store'
|
|
9
|
+
export let title = 'Tab Page'
|
|
10
|
+
export let disabled = false
|
|
11
|
+
export let selected = false
|
|
12
|
+
export let theme = void 0
|
|
13
|
+
const tabGroupStore = getContext('tabGroupStore')
|
|
14
|
+
const tabIndexStore = getContext('tabIndexStore')
|
|
15
|
+
const userCreatedPane = getContext('userCreatedPane')
|
|
16
|
+
const parentStore = getContext('parentStore')
|
|
17
|
+
const tabPageStore = writable()
|
|
18
|
+
setContext('parentStore', tabPageStore)
|
|
19
|
+
let indexElement
|
|
20
|
+
let index
|
|
21
21
|
onMount(() => {
|
|
22
|
-
index = indexElement ? getElementIndex(indexElement) : 0
|
|
23
|
-
})
|
|
22
|
+
index = indexElement ? getElementIndex(indexElement) : 0
|
|
23
|
+
})
|
|
24
24
|
function create() {
|
|
25
25
|
if (!$tabGroupStore) {
|
|
26
26
|
$tabGroupStore = $parentStore.addTab({
|
|
@@ -28,30 +28,30 @@
|
|
|
28
28
|
disabled: false,
|
|
29
29
|
index: $tabIndexStore,
|
|
30
30
|
// Could be cleaner to have children create the tab as needed?
|
|
31
|
-
pages: [{ title }]
|
|
32
|
-
})
|
|
33
|
-
$tabPageStore = $tabGroupStore.pages[0]
|
|
34
|
-
selected = true
|
|
31
|
+
pages: [{ title }],
|
|
32
|
+
})
|
|
33
|
+
$tabPageStore = $tabGroupStore.pages[0]
|
|
34
|
+
selected = true
|
|
35
35
|
} else if (!$tabPageStore && $tabGroupStore) {
|
|
36
|
-
$tabPageStore = $tabGroupStore.addPage({ index, title })
|
|
36
|
+
$tabPageStore = $tabGroupStore.addPage({ index, title })
|
|
37
37
|
}
|
|
38
38
|
$tabGroupStore?.on('select', () => {
|
|
39
|
-
$tabPageStore && (selected = $tabPageStore.selected)
|
|
40
|
-
})
|
|
39
|
+
$tabPageStore && (selected = $tabPageStore.selected)
|
|
40
|
+
})
|
|
41
41
|
}
|
|
42
42
|
onDestroy(() => {
|
|
43
|
-
$tabPageStore?.dispose()
|
|
44
|
-
})
|
|
45
|
-
$: index !== void 0 && $parentStore && $tabIndexStore !== void 0 && create()
|
|
46
|
-
$: $tabPageStore && ($tabPageStore.title = title)
|
|
47
|
-
$: $tabPageStore && ($tabPageStore.disabled = disabled)
|
|
48
|
-
$: $tabPageStore && ($tabPageStore.selected = selected)
|
|
43
|
+
$tabPageStore?.dispose()
|
|
44
|
+
})
|
|
45
|
+
$: index !== void 0 && $parentStore && $tabIndexStore !== void 0 && create()
|
|
46
|
+
$: $tabPageStore && ($tabPageStore.title = title)
|
|
47
|
+
$: $tabPageStore && ($tabPageStore.disabled = disabled)
|
|
48
|
+
$: $tabPageStore && ($tabPageStore.selected = selected)
|
|
49
49
|
$: theme &&
|
|
50
50
|
$parentStore &&
|
|
51
51
|
(userCreatedPane || !isRootPane($parentStore)) &&
|
|
52
52
|
console.warn(
|
|
53
|
-
'Set theme on the <Pane> component, not on its children! (Check nested <TabPage> components for a theme prop.)'
|
|
54
|
-
)
|
|
53
|
+
'Set theme on the <Pane> component, not on its children! (Check nested <TabPage> components for a theme prop.)',
|
|
54
|
+
)
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
{#if parentStore && tabIndexStore !== undefined}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { SvelteComponent } from 'svelte'
|
|
2
|
-
import type { Theme } from '../theme.js'
|
|
1
|
+
import { SvelteComponent } from 'svelte'
|
|
2
|
+
import type { Theme } from '../theme.js'
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
/**
|
|
6
6
|
* Text in the tab.
|
|
7
7
|
* @default `'Tab Page'`
|
|
8
|
-
* */ title?: string
|
|
8
|
+
* */ title?: string
|
|
9
9
|
/**
|
|
10
10
|
* Prevent interactivity and gray out the control.
|
|
11
11
|
* @default `false`
|
|
12
|
-
* */ disabled?: boolean
|
|
12
|
+
* */ disabled?: boolean
|
|
13
13
|
/**
|
|
14
14
|
* Sets the page is the active tab.
|
|
15
15
|
*
|
|
16
16
|
* When bound it will indicate whether the tab is active.
|
|
17
17
|
* @default `false`
|
|
18
18
|
* @bindable
|
|
19
|
-
* */ selected?: boolean
|
|
19
|
+
* */ selected?: boolean
|
|
20
20
|
/**
|
|
21
21
|
* Custom color scheme.
|
|
22
22
|
* @default `undefined` \
|
|
23
23
|
* Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
|
|
24
24
|
* set with `setGlobalDefaultTheme()`.)
|
|
25
|
-
* */ theme?: Theme | undefined
|
|
26
|
-
}
|
|
25
|
+
* */ theme?: Theme | undefined
|
|
26
|
+
}
|
|
27
27
|
events: {
|
|
28
|
-
[evt: string]: CustomEvent<any
|
|
29
|
-
}
|
|
28
|
+
[evt: string]: CustomEvent<any>
|
|
29
|
+
}
|
|
30
30
|
slots: {
|
|
31
31
|
/**
|
|
32
32
|
* Any Tweakpane component, except a `<Pane>`.
|
|
33
33
|
*/
|
|
34
|
-
default: {}
|
|
35
|
-
}
|
|
36
|
-
exports?: {} | undefined
|
|
37
|
-
bindings?: string | undefined
|
|
38
|
-
}
|
|
39
|
-
export type TabPageProps = typeof __propDef.props
|
|
40
|
-
export type TabPageEvents = typeof __propDef.events
|
|
41
|
-
export type TabPageSlots = typeof __propDef.slots
|
|
34
|
+
default: {}
|
|
35
|
+
}
|
|
36
|
+
exports?: {} | undefined
|
|
37
|
+
bindings?: string | undefined
|
|
38
|
+
}
|
|
39
|
+
export type TabPageProps = typeof __propDef.props
|
|
40
|
+
export type TabPageEvents = typeof __propDef.events
|
|
41
|
+
export type TabPageSlots = typeof __propDef.slots
|
|
42
42
|
/**
|
|
43
43
|
* Contains a collection of Tweakpane controls to be presented as a single group inside a `<TabGroup>`
|
|
44
44
|
* component.
|
|
@@ -56,10 +56,10 @@ export type TabPageSlots = typeof __propDef.slots;
|
|
|
56
56
|
* @example
|
|
57
57
|
* ```svelte
|
|
58
58
|
* <script lang="ts">
|
|
59
|
-
* import { Button, TabGroup, TabPage } from 'svelte-tweakpane-ui'
|
|
59
|
+
* import { Button, TabGroup, TabPage } from 'svelte-tweakpane-ui'
|
|
60
60
|
*
|
|
61
|
-
* let countA = 0
|
|
62
|
-
* let countB = 0
|
|
61
|
+
* let countA = 0
|
|
62
|
+
* let countB = 0
|
|
63
63
|
* </script>
|
|
64
64
|
*
|
|
65
65
|
* <TabGroup>
|
|
@@ -81,4 +81,4 @@ export type TabPageSlots = typeof __propDef.slots;
|
|
|
81
81
|
* [TabPage.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/core/TabPage.svelte)
|
|
82
82
|
*/
|
|
83
83
|
export default class TabPage extends SvelteComponent<TabPageProps, TabPageEvents, TabPageSlots> {}
|
|
84
|
-
export {}
|
|
84
|
+
export {}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>
|
|
4
|
-
import Text from '../control/Text.svelte'
|
|
5
|
-
import Binding from '../core/Binding.svelte'
|
|
6
|
-
import Folder from '../core/Folder.svelte'
|
|
7
|
-
import InternalPaneInline from '../internal/InternalPaneInline.svelte'
|
|
8
|
-
import { isColorObject } from '@tweakpane/core'
|
|
9
|
-
import { Point2d } from '@tweakpane/core/dist/input-binding/point-2d/model/point-2d.js'
|
|
10
|
-
import { Point3d } from '@tweakpane/core/dist/input-binding/point-3d/model/point-3d.js'
|
|
11
|
-
import { Point4d } from '@tweakpane/core/dist/input-binding/point-4d/model/point-4d.js'
|
|
12
|
-
import copy from 'fast-copy'
|
|
13
|
-
import { createEventDispatcher, getContext } from 'svelte'
|
|
14
|
-
export let theme = void 0
|
|
15
|
-
export let prettyLabels = true
|
|
16
|
-
export let object
|
|
17
|
-
const dispatch = createEventDispatcher()
|
|
18
|
-
const parentStore = getContext('parentStore')
|
|
4
|
+
import Text from '../control/Text.svelte'
|
|
5
|
+
import Binding from '../core/Binding.svelte'
|
|
6
|
+
import Folder from '../core/Folder.svelte'
|
|
7
|
+
import InternalPaneInline from '../internal/InternalPaneInline.svelte'
|
|
8
|
+
import { isColorObject } from '@tweakpane/core'
|
|
9
|
+
import { Point2d } from '@tweakpane/core/dist/input-binding/point-2d/model/point-2d.js'
|
|
10
|
+
import { Point3d } from '@tweakpane/core/dist/input-binding/point-3d/model/point-3d.js'
|
|
11
|
+
import { Point4d } from '@tweakpane/core/dist/input-binding/point-4d/model/point-4d.js'
|
|
12
|
+
import copy from 'fast-copy'
|
|
13
|
+
import { createEventDispatcher, getContext } from 'svelte'
|
|
14
|
+
export let theme = void 0
|
|
15
|
+
export let prettyLabels = true
|
|
16
|
+
export let object
|
|
17
|
+
const dispatch = createEventDispatcher()
|
|
18
|
+
const parentStore = getContext('parentStore')
|
|
19
19
|
function isPointObject(testObject) {
|
|
20
20
|
return (
|
|
21
21
|
Point2d.isObject(testObject) || Point3d.isObject(testObject) || Point4d.isObject(testObject)
|
|
22
|
-
)
|
|
22
|
+
)
|
|
23
23
|
}
|
|
24
24
|
function prettify(value, active = true) {
|
|
25
|
-
if (!active) return value
|
|
25
|
+
if (!active) return value
|
|
26
26
|
return value
|
|
27
27
|
.replaceAll(/([\da-z])([A-Z])/g, '$1 $2')
|
|
28
28
|
.replaceAll(/[_-]+/g, ' ')
|
|
29
29
|
.toLowerCase()
|
|
30
|
-
.replaceAll(/\b[a-z]/g, (letter) => letter.toUpperCase())
|
|
30
|
+
.replaceAll(/\b[a-z]/g, (letter) => letter.toUpperCase())
|
|
31
31
|
}
|
|
32
32
|
function changeEventAggregator(event) {
|
|
33
33
|
dispatch('change', {
|
|
34
34
|
value: copy(object),
|
|
35
|
-
origin: event.detail.origin
|
|
36
|
-
})
|
|
35
|
+
origin: event.detail.origin,
|
|
36
|
+
})
|
|
37
37
|
}
|
|
38
38
|
</script>
|
|
39
39
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SvelteComponent } from 'svelte'
|
|
2
|
-
import type { BindingObject, ValueChangeEvent } from '../utils.js'
|
|
3
|
-
export type AutoObjectChangeEvent = ValueChangeEvent<BindingObject
|
|
4
|
-
import type { Theme } from '../theme.js'
|
|
1
|
+
import { SvelteComponent } from 'svelte'
|
|
2
|
+
import type { BindingObject, ValueChangeEvent } from '../utils.js'
|
|
3
|
+
export type AutoObjectChangeEvent = ValueChangeEvent<BindingObject>
|
|
4
|
+
import type { Theme } from '../theme.js'
|
|
5
5
|
declare const __propDef: {
|
|
6
6
|
props: {
|
|
7
7
|
/**
|
|
@@ -9,21 +9,21 @@ declare const __propDef: {
|
|
|
9
9
|
* @default `undefined` \
|
|
10
10
|
* Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
|
|
11
11
|
* set with `setGlobalDefaultTheme()`.
|
|
12
|
-
* */ theme?: Theme | undefined
|
|
12
|
+
* */ theme?: Theme | undefined
|
|
13
13
|
/**
|
|
14
14
|
* Transforms keys into more pleasant control labels (e.g. capitalization and spaces in lieu of
|
|
15
15
|
* camelCase, kebab-case, etc.)
|
|
16
16
|
* @default `true`
|
|
17
|
-
* */ prettyLabels?: boolean
|
|
17
|
+
* */ prettyLabels?: boolean
|
|
18
18
|
/**
|
|
19
19
|
* Object to create an automatic set of Tweakpane controls for.
|
|
20
20
|
*
|
|
21
21
|
* Keys will be used as labels, and a (reasonably) appropriate Tweakpane control will be used
|
|
22
22
|
* for each value's type.
|
|
23
23
|
* @bindable
|
|
24
|
-
* */ object: BindingObject
|
|
25
|
-
}
|
|
26
|
-
slots: {}
|
|
24
|
+
* */ object: BindingObject
|
|
25
|
+
}
|
|
26
|
+
slots: {}
|
|
27
27
|
events: {
|
|
28
28
|
/**
|
|
29
29
|
* Fires when a value in the `object` changes.
|
|
@@ -36,12 +36,12 @@ declare const __propDef: {
|
|
|
36
36
|
* @extends ValueChangeEvent
|
|
37
37
|
* @event
|
|
38
38
|
* */
|
|
39
|
-
change: AutoObjectChangeEvent
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export type AutoObjectProps = typeof __propDef.props
|
|
43
|
-
export type AutoObjectEvents = typeof __propDef.events
|
|
44
|
-
export type AutoObjectSlots = typeof __propDef.slots
|
|
39
|
+
change: AutoObjectChangeEvent
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export type AutoObjectProps = typeof __propDef.props
|
|
43
|
+
export type AutoObjectEvents = typeof __propDef.events
|
|
44
|
+
export type AutoObjectSlots = typeof __propDef.slots
|
|
45
45
|
/**
|
|
46
46
|
* Rapid-development component which automatically creates a set of Tweakpane controls for an arbitrary
|
|
47
47
|
* object.
|
|
@@ -76,7 +76,7 @@ export type AutoObjectSlots = typeof __propDef.slots;
|
|
|
76
76
|
* @example
|
|
77
77
|
* ```svelte
|
|
78
78
|
* <script lang="ts">
|
|
79
|
-
* import { AutoObject } from 'svelte-tweakpane-ui'
|
|
79
|
+
* import { AutoObject } from 'svelte-tweakpane-ui'
|
|
80
80
|
*
|
|
81
81
|
* let object = {
|
|
82
82
|
* // Creates a <Checkbox>
|
|
@@ -86,24 +86,24 @@ export type AutoObjectSlots = typeof __propDef.slots;
|
|
|
86
86
|
* r: 255,
|
|
87
87
|
* g: 0,
|
|
88
88
|
*
|
|
89
|
-
* b: 55
|
|
89
|
+
* b: 55,
|
|
90
90
|
* },
|
|
91
91
|
* // Wraps children in a <Folder>
|
|
92
92
|
* someFolder: {
|
|
93
93
|
* b: 2,
|
|
94
94
|
* a: 1,
|
|
95
|
-
* c: 3
|
|
95
|
+
* c: 3,
|
|
96
96
|
* },
|
|
97
97
|
* // Creates a <Slider>
|
|
98
98
|
* someNumber: 1,
|
|
99
99
|
* // creates a <Point>
|
|
100
100
|
* somePoint: {
|
|
101
101
|
* x: 1,
|
|
102
|
-
* y: 2
|
|
102
|
+
* y: 2,
|
|
103
103
|
* },
|
|
104
104
|
* // Creates a <Text>
|
|
105
|
-
* someString: 'test'
|
|
106
|
-
* }
|
|
105
|
+
* someString: 'test',
|
|
106
|
+
* }
|
|
107
107
|
* </script>
|
|
108
108
|
*
|
|
109
109
|
* <AutoObject bind:object />
|
|
@@ -119,4 +119,4 @@ export default class AutoObject extends SvelteComponent<
|
|
|
119
119
|
AutoObjectEvents,
|
|
120
120
|
AutoObjectSlots
|
|
121
121
|
> {}
|
|
122
|
-
export {}
|
|
122
|
+
export {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>
|
|
4
|
-
import Text from '../control/Text.svelte'
|
|
5
|
-
import GenericBinding from '../internal/GenericBinding.svelte'
|
|
6
|
-
export let value
|
|
4
|
+
import Text from '../control/Text.svelte'
|
|
5
|
+
import GenericBinding from '../internal/GenericBinding.svelte'
|
|
6
|
+
export let value
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
{#if typeof value === 'string'}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SvelteComponent } from 'svelte'
|
|
2
|
-
import type { ValueChangeEvent } from '../utils.js'
|
|
3
|
-
export type AutoValueChangeEvent = ValueChangeEvent<boolean | number | object | string
|
|
1
|
+
import { SvelteComponent } from 'svelte'
|
|
2
|
+
import type { ValueChangeEvent } from '../utils.js'
|
|
3
|
+
export type AutoValueChangeEvent = ValueChangeEvent<boolean | number | object | string>
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: Omit<
|
|
6
6
|
{
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
* The value to control.
|
|
9
9
|
* @bindable
|
|
10
10
|
*/
|
|
11
|
-
value: string | number | boolean | object
|
|
11
|
+
value: string | number | boolean | object
|
|
12
12
|
} & Omit<
|
|
13
13
|
{
|
|
14
14
|
/**
|
|
@@ -16,19 +16,19 @@ declare const __propDef: {
|
|
|
16
16
|
* @bindable
|
|
17
17
|
*/
|
|
18
18
|
object: import('@tweakpane/core').Bindable &
|
|
19
|
-
Record<string, string | number | boolean | object
|
|
19
|
+
Record<string, string | number | boolean | object>
|
|
20
20
|
/** The key for the value in the target `object` that the control should manipulate. */
|
|
21
|
-
key: string
|
|
21
|
+
key: string
|
|
22
22
|
/**
|
|
23
23
|
* Prevent interactivity and gray out the control.
|
|
24
24
|
* @default `false`
|
|
25
25
|
*/
|
|
26
|
-
disabled?: boolean
|
|
26
|
+
disabled?: boolean
|
|
27
27
|
/**
|
|
28
28
|
* Text displayed next to control.
|
|
29
29
|
* @default `undefined`
|
|
30
30
|
*/
|
|
31
|
-
label?: string | undefined
|
|
31
|
+
label?: string | undefined
|
|
32
32
|
/**
|
|
33
33
|
* Tweakpane's internal options object.
|
|
34
34
|
*
|
|
@@ -41,7 +41,7 @@ declare const __propDef: {
|
|
|
41
41
|
* Tweakpane UI_.
|
|
42
42
|
* @default `undefined`
|
|
43
43
|
*/
|
|
44
|
-
options?: import('tweakpane').BindingParams | undefined
|
|
44
|
+
options?: import('tweakpane').BindingParams | undefined
|
|
45
45
|
/**
|
|
46
46
|
* Custom color scheme.
|
|
47
47
|
*
|
|
@@ -49,7 +49,7 @@ declare const __propDef: {
|
|
|
49
49
|
* Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
|
|
50
50
|
* set with `setGlobalDefaultTheme()`.
|
|
51
51
|
*/
|
|
52
|
-
theme?: import('..').Theme | undefined
|
|
52
|
+
theme?: import('..').Theme | undefined
|
|
53
53
|
/**
|
|
54
54
|
* Reference to internal Tweakpane
|
|
55
55
|
* [`BindingApi`](https://tweakpane.github.io/docs/api/classes/_internal_.BindingApi.html) for
|
|
@@ -63,7 +63,7 @@ declare const __propDef: {
|
|
|
63
63
|
* @bindable
|
|
64
64
|
* @readonly
|
|
65
65
|
*/
|
|
66
|
-
ref?: import('..').BindingRef | undefined
|
|
66
|
+
ref?: import('..').BindingRef | undefined
|
|
67
67
|
/**
|
|
68
68
|
* Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
|
|
69
69
|
* the `<Binding>`'s containing `<Pane>`.
|
|
@@ -75,13 +75,13 @@ declare const __propDef: {
|
|
|
75
75
|
*
|
|
76
76
|
* @default `undefined`
|
|
77
77
|
*/
|
|
78
|
-
plugin?: import('../utils.js').Plugin | undefined
|
|
78
|
+
plugin?: import('../utils.js').Plugin | undefined
|
|
79
79
|
},
|
|
80
80
|
'object' | 'key'
|
|
81
81
|
>,
|
|
82
82
|
'ref' | 'options' | 'plugin'
|
|
83
|
-
|
|
84
|
-
slots: {}
|
|
83
|
+
>
|
|
84
|
+
slots: {}
|
|
85
85
|
events: {
|
|
86
86
|
/**
|
|
87
87
|
* Fires when `value` changes.
|
|
@@ -94,12 +94,12 @@ declare const __propDef: {
|
|
|
94
94
|
* @extends ValueChangeEvent
|
|
95
95
|
* @event
|
|
96
96
|
* */
|
|
97
|
-
change: AutoValueChangeEvent
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
export type AutoValueProps = typeof __propDef.props
|
|
101
|
-
export type AutoValueEvents = typeof __propDef.events
|
|
102
|
-
export type AutoValueSlots = typeof __propDef.slots
|
|
97
|
+
change: AutoValueChangeEvent
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export type AutoValueProps = typeof __propDef.props
|
|
101
|
+
export type AutoValueEvents = typeof __propDef.events
|
|
102
|
+
export type AutoValueSlots = typeof __propDef.slots
|
|
103
103
|
/**
|
|
104
104
|
* Rapid-development component which automatically creates a Tweakpane control for an arbitrary value.
|
|
105
105
|
*
|
|
@@ -120,12 +120,12 @@ export type AutoValueSlots = typeof __propDef.slots;
|
|
|
120
120
|
* @example
|
|
121
121
|
* ```svelte
|
|
122
122
|
* <script lang="ts">
|
|
123
|
-
* import { AutoValue } from 'svelte-tweakpane-ui'
|
|
123
|
+
* import { AutoValue } from 'svelte-tweakpane-ui'
|
|
124
124
|
*
|
|
125
|
-
* let number = 0
|
|
126
|
-
* let color = { r: 255, g: 0, b: 255 }
|
|
127
|
-
* let point = { x: 0, y: 0 }
|
|
128
|
-
* let text = 'Cosmic manifold'
|
|
125
|
+
* let number = 0
|
|
126
|
+
* let color = { r: 255, g: 0, b: 255 }
|
|
127
|
+
* let point = { x: 0, y: 0 }
|
|
128
|
+
* let text = 'Cosmic manifold'
|
|
129
129
|
* </script>
|
|
130
130
|
*
|
|
131
131
|
* <AutoValue bind:value={number} label="Number" />
|
|
@@ -142,4 +142,4 @@ export default class AutoValue extends SvelteComponent<
|
|
|
142
142
|
AutoValueEvents,
|
|
143
143
|
AutoValueSlots
|
|
144
144
|
> {}
|
|
145
|
-
export {}
|
|
145
|
+
export {}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Blade from '../core/Blade.svelte'
|
|
3
|
-
import ClsPad from '../internal/ClsPad.svelte'
|
|
4
|
-
import { BROWSER } from 'esm-env'
|
|
5
|
-
export let maxHeight = void 0
|
|
6
|
-
export let resetStyle = true
|
|
2
|
+
import Blade from '../core/Blade.svelte'
|
|
3
|
+
import ClsPad from '../internal/ClsPad.svelte'
|
|
4
|
+
import { BROWSER } from 'esm-env'
|
|
5
|
+
export let maxHeight = void 0
|
|
6
|
+
export let resetStyle = true
|
|
7
7
|
const options = {
|
|
8
|
-
view: 'separator'
|
|
9
|
-
}
|
|
10
|
-
let ref
|
|
11
|
-
let sourceDiv
|
|
12
|
-
$: ref?.element.replaceChildren(sourceDiv)
|
|
8
|
+
view: 'separator',
|
|
9
|
+
}
|
|
10
|
+
let ref
|
|
11
|
+
let sourceDiv
|
|
12
|
+
$: ref?.element.replaceChildren(sourceDiv)
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
{#if BROWSER}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SvelteComponent } from 'svelte'
|
|
2
|
-
import type { BladeRef } from '../core/Blade.svelte'
|
|
1
|
+
import { SvelteComponent } from 'svelte'
|
|
2
|
+
import type { BladeRef } from '../core/Blade.svelte'
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
/**
|
|
@@ -14,14 +14,14 @@ declare const __propDef: {
|
|
|
14
14
|
* @default `undefined` \
|
|
15
15
|
* No max height.
|
|
16
16
|
*/
|
|
17
|
-
maxHeight?: number
|
|
17
|
+
maxHeight?: number
|
|
18
18
|
/**
|
|
19
19
|
* Whether to reset the CSS of the element block to its default values.
|
|
20
20
|
* Avoids inheritance of Tweakpane's CSS styles. Note that this uses a
|
|
21
21
|
* simple `all: initial;` rule.
|
|
22
22
|
* @default `true`
|
|
23
23
|
*/
|
|
24
|
-
resetStyle?: boolean
|
|
24
|
+
resetStyle?: boolean
|
|
25
25
|
} & Omit<
|
|
26
26
|
{
|
|
27
27
|
/**
|
|
@@ -29,19 +29,19 @@ declare const __propDef: {
|
|
|
29
29
|
* [`BladeParams`](https://tweakpane.github.io/docs/api/interfaces/BaseBladeParams.html).
|
|
30
30
|
*
|
|
31
31
|
*/
|
|
32
|
-
options: import('tweakpane').BaseBladeParams
|
|
32
|
+
options: import('tweakpane').BaseBladeParams
|
|
33
33
|
/**
|
|
34
34
|
* Prevent interactivity and gray out the control.
|
|
35
35
|
* @default `false`
|
|
36
36
|
*/
|
|
37
|
-
disabled?: boolean
|
|
37
|
+
disabled?: boolean
|
|
38
38
|
/**
|
|
39
39
|
* Custom color scheme.
|
|
40
40
|
* @default `undefined` \
|
|
41
41
|
* Inherits default Tweakpane theme equivalent to `ThemeUtils.presets.standard`, or the theme
|
|
42
42
|
* set with `setGlobalDefaultTheme()`.
|
|
43
43
|
*/
|
|
44
|
-
theme?: import('..').Theme | undefined
|
|
44
|
+
theme?: import('..').Theme | undefined
|
|
45
45
|
/**
|
|
46
46
|
* Reference to internal Tweakpane
|
|
47
47
|
* [`BladeApi`](https://tweakpane.github.io/docs/api/classes/BladeApi.html) for this blade.
|
|
@@ -54,7 +54,7 @@ declare const __propDef: {
|
|
|
54
54
|
* @bindable
|
|
55
55
|
* @readonly
|
|
56
56
|
*/
|
|
57
|
-
ref?: BladeRef | undefined
|
|
57
|
+
ref?: BladeRef | undefined
|
|
58
58
|
/**
|
|
59
59
|
* Imported Tweakpane `TpPluginBundle` (aliased as `Plugin`) module to automatically register in
|
|
60
60
|
* the `<Blade>`'s containing `<Pane>`.
|
|
@@ -66,25 +66,25 @@ declare const __propDef: {
|
|
|
66
66
|
*
|
|
67
67
|
* @default `undefined`
|
|
68
68
|
*/
|
|
69
|
-
plugin?: import('../core/Blade.svelte').Plugin | undefined
|
|
69
|
+
plugin?: import('../core/Blade.svelte').Plugin | undefined
|
|
70
70
|
},
|
|
71
71
|
'ref' | 'disabled' | 'options' | 'plugin'
|
|
72
|
-
|
|
72
|
+
>
|
|
73
73
|
events: {
|
|
74
|
-
[evt: string]: CustomEvent<any
|
|
75
|
-
}
|
|
74
|
+
[evt: string]: CustomEvent<any>
|
|
75
|
+
}
|
|
76
76
|
slots: {
|
|
77
77
|
/**
|
|
78
78
|
* Any HTML Element.
|
|
79
79
|
*/
|
|
80
|
-
default: {}
|
|
81
|
-
}
|
|
82
|
-
exports?: {} | undefined
|
|
83
|
-
bindings?: string | undefined
|
|
84
|
-
}
|
|
85
|
-
export type ElementProps = typeof __propDef.props
|
|
86
|
-
export type ElementEvents = typeof __propDef.events
|
|
87
|
-
export type ElementSlots = typeof __propDef.slots
|
|
80
|
+
default: {}
|
|
81
|
+
}
|
|
82
|
+
exports?: {} | undefined
|
|
83
|
+
bindings?: string | undefined
|
|
84
|
+
}
|
|
85
|
+
export type ElementProps = typeof __propDef.props
|
|
86
|
+
export type ElementEvents = typeof __propDef.events
|
|
87
|
+
export type ElementSlots = typeof __propDef.slots
|
|
88
88
|
/**
|
|
89
89
|
* A component for embedding arbitrary HTML elements into a pane.
|
|
90
90
|
*
|
|
@@ -116,10 +116,10 @@ export type ElementSlots = typeof __propDef.slots;
|
|
|
116
116
|
* @example
|
|
117
117
|
* ```svelte
|
|
118
118
|
* <script lang="ts">
|
|
119
|
-
* import { Button, Element, Pane, Wheel } from 'svelte-tweakpane-ui'
|
|
119
|
+
* import { Button, Element, Pane, Wheel } from 'svelte-tweakpane-ui'
|
|
120
120
|
*
|
|
121
|
-
* let gradientAngle = 45
|
|
122
|
-
* let textAngle = 0
|
|
121
|
+
* let gradientAngle = 45
|
|
122
|
+
* let textAngle = 0
|
|
123
123
|
* </script>
|
|
124
124
|
*
|
|
125
125
|
* <Pane position="inline" title="Element Demo">
|
|
@@ -148,8 +148,8 @@ export type ElementSlots = typeof __propDef.slots;
|
|
|
148
148
|
* </Element>
|
|
149
149
|
* <Button
|
|
150
150
|
* on:click={() => {
|
|
151
|
-
* gradientAngle = 45
|
|
152
|
-
* textAngle = 0
|
|
151
|
+
* gradientAngle = 45
|
|
152
|
+
* textAngle = 0
|
|
153
153
|
* }}
|
|
154
154
|
* disabled={gradientAngle === 45 && textAngle === 0}
|
|
155
155
|
* title="Reset"
|
|
@@ -182,4 +182,4 @@ export type ElementSlots = typeof __propDef.slots;
|
|
|
182
182
|
* [Element.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/extra/Element.svelte)
|
|
183
183
|
*/
|
|
184
184
|
export default class Element extends SvelteComponent<ElementProps, ElementEvents, ElementSlots> {}
|
|
185
|
-
export {}
|
|
185
|
+
export {}
|