svelte-tweakpane-ui 1.3.3 → 1.4.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/Color.svelte +45 -25
- package/dist/control/Image.svelte.d.ts +4 -4
- package/dist/control/IntervalSlider.svelte +18 -14
- package/dist/control/Point.svelte +25 -26
- package/dist/control/RotationEuler.svelte +17 -12
- package/dist/control/RotationQuaternion.svelte +17 -12
- package/dist/core/Binding.svelte +1 -1
- package/dist/extra/AutoValue.svelte.d.ts +1 -1
- package/dist/extra/Element.svelte.d.ts +1 -1
- package/dist/internal/GenericBinding.svelte +4 -1
- package/dist/internal/GenericPane.svelte +12 -11
- package/dist/monitor/Profiler.svelte.d.ts +6 -0
- package/package.json +44 -39
- package/readme.md +2 -0
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
<script>
|
|
4
4
|
import ClsPad from '../internal/ClsPad.svelte';
|
|
5
5
|
import GenericInputFolding from '../internal/GenericInputFolding.svelte';
|
|
6
|
-
import { objectToTuple
|
|
6
|
+
import { objectToTuple } from '../utils';
|
|
7
7
|
import { fillWith } from '../utils';
|
|
8
|
-
import { isColorObject,
|
|
8
|
+
import { isColorObject, isRgbaColorObject, isRgbColorObject } from '@tweakpane/core';
|
|
9
9
|
import { BROWSER } from 'esm-env';
|
|
10
|
+
import { shallowEqual } from 'fast-equals';
|
|
10
11
|
export let value;
|
|
11
12
|
export let expanded = void 0;
|
|
12
13
|
export let type = void 0;
|
|
@@ -14,34 +15,53 @@
|
|
|
14
15
|
let options;
|
|
15
16
|
let ref;
|
|
16
17
|
const buttonClass = 'tp-colswv_b';
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
internalValue =
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
function updateInternalValueFromValue() {
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
if (internalValue !== value) {
|
|
21
|
+
internalValue = value;
|
|
22
|
+
}
|
|
23
|
+
} else if (isColorObject(value)) {
|
|
24
|
+
if (!shallowEqual(value, internalValue)) {
|
|
25
|
+
internalValue = { ...value };
|
|
26
|
+
}
|
|
27
|
+
} else if (Array.isArray(value)) {
|
|
28
|
+
let newInternalValue =
|
|
29
|
+
value.length === 4
|
|
30
|
+
? { r: value[0], g: value[1], b: value[2], a: value[3] }
|
|
31
|
+
: value.length === 3
|
|
32
|
+
? { r: value[0], g: value[1], b: value[2] }
|
|
33
|
+
: void 0;
|
|
34
|
+
if (newInternalValue === void 0) {
|
|
24
35
|
console.error('Unreachable');
|
|
36
|
+
} else if (!shallowEqual(newInternalValue, internalValue)) {
|
|
37
|
+
internalValue = newInternalValue;
|
|
25
38
|
}
|
|
26
39
|
} else {
|
|
27
|
-
|
|
40
|
+
console.error('Unreachable');
|
|
28
41
|
}
|
|
29
42
|
}
|
|
30
|
-
function
|
|
31
|
-
if (
|
|
32
|
-
if (
|
|
33
|
-
value =
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
function updateValueFromInternalValue() {
|
|
44
|
+
if (typeof value === 'string' && typeof internalValue === 'string') {
|
|
45
|
+
if (internalValue !== value) {
|
|
46
|
+
value = internalValue;
|
|
47
|
+
}
|
|
48
|
+
} else if (Array.isArray(value) && isColorObject(internalValue)) {
|
|
49
|
+
const newValue = isRgbaColorObject(internalValue)
|
|
50
|
+
? objectToTuple(internalValue, ['r', 'g', 'b', 'a'])
|
|
51
|
+
: isRgbColorObject(internalValue)
|
|
52
|
+
? objectToTuple(internalValue, ['r', 'g', 'b'])
|
|
53
|
+
: void 0;
|
|
54
|
+
if (newValue === void 0) {
|
|
55
|
+
console.error('Unreachable color type mismatch');
|
|
56
|
+
} else if (!shallowEqual(newValue, value)) {
|
|
57
|
+
value = newValue;
|
|
58
|
+
}
|
|
59
|
+
} else if (isColorObject(value) && isColorObject(internalValue)) {
|
|
60
|
+
if (!shallowEqual(internalValue, value)) {
|
|
61
|
+
value = { ...internalValue };
|
|
38
62
|
}
|
|
39
|
-
} else if (typeof value === 'string') {
|
|
40
|
-
value = internalValue;
|
|
41
|
-
} else if (isObject(value)) {
|
|
42
|
-
value = internalValue;
|
|
43
63
|
} else {
|
|
44
|
-
console.error('Unreachable');
|
|
64
|
+
console.error('Unreachable color type mismatch');
|
|
45
65
|
}
|
|
46
66
|
}
|
|
47
67
|
function addListeners() {
|
|
@@ -49,8 +69,8 @@
|
|
|
49
69
|
ref.refresh();
|
|
50
70
|
});
|
|
51
71
|
}
|
|
52
|
-
$: value,
|
|
53
|
-
$: internalValue,
|
|
72
|
+
$: value, updateInternalValueFromValue();
|
|
73
|
+
$: internalValue, updateValueFromInternalValue();
|
|
54
74
|
$: ref !== void 0 && addListeners();
|
|
55
75
|
$: options = {
|
|
56
76
|
color: {
|
|
@@ -147,10 +147,10 @@ export type ImageSlots = typeof __propDef.slots;
|
|
|
147
147
|
* let source = 'placeholder';
|
|
148
148
|
*
|
|
149
149
|
* async function getRandomKittenUrl() {
|
|
150
|
-
* const { url } = await fetch(
|
|
151
|
-
* '
|
|
152
|
-
*
|
|
153
|
-
* );
|
|
150
|
+
* const { url } = await fetch('https://loremflickr.com/800/800/kitten', {
|
|
151
|
+
* method: 'HEAD',
|
|
152
|
+
* redirect: 'follow'
|
|
153
|
+
* });
|
|
154
154
|
* return url;
|
|
155
155
|
* }
|
|
156
156
|
* </script>
|
|
@@ -3,30 +3,34 @@
|
|
|
3
3
|
<script>
|
|
4
4
|
import GenericSlider from '../internal/GenericSlider.svelte';
|
|
5
5
|
import * as pluginModule from '@kitschpatrol/tweakpane-plugin-essentials';
|
|
6
|
+
import { shallowEqual } from 'fast-equals';
|
|
6
7
|
export let value;
|
|
7
8
|
export let meanValue = void 0;
|
|
8
9
|
export let wide = void 0;
|
|
9
10
|
let internalValue;
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
internalValue = {
|
|
14
|
-
} else {
|
|
15
|
-
internalValue = value;
|
|
11
|
+
function updateInternalValueFromValue() {
|
|
12
|
+
const newInternalValue = Array.isArray(value) ? { min: value[0], max: value[1] } : value;
|
|
13
|
+
if (!shallowEqual(internalValue, newInternalValue)) {
|
|
14
|
+
internalValue = { ...newInternalValue };
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
function
|
|
17
|
+
function updateValueFromInternalValue() {
|
|
19
18
|
if (Array.isArray(value)) {
|
|
20
|
-
const
|
|
21
|
-
value
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const newValue = [internalValue.min, internalValue.max];
|
|
20
|
+
if (!shallowEqual(value, newValue)) {
|
|
21
|
+
value = newValue;
|
|
22
|
+
}
|
|
23
|
+
} else if (!shallowEqual(value, internalValue)) {
|
|
24
|
+
value = { ...internalValue };
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
function updateValueFromMean() {
|
|
27
28
|
if (meanValue !== void 0) {
|
|
28
29
|
const r = internalValue.max - internalValue.min;
|
|
29
|
-
|
|
30
|
+
const valueFromMean = { min: meanValue - r / 2, max: meanValue + r / 2 };
|
|
31
|
+
if (!shallowEqual(valueFromMean, internalValue)) {
|
|
32
|
+
internalValue = valueFromMean;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
let ref;
|
|
@@ -39,8 +43,8 @@
|
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
$: ref && wide !== void 0 && updateWide(wide);
|
|
42
|
-
$: value,
|
|
43
|
-
$: internalValue,
|
|
46
|
+
$: value, updateInternalValueFromValue();
|
|
47
|
+
$: internalValue, updateValueFromInternalValue();
|
|
44
48
|
$: meanValue = (internalValue.min + internalValue.max) / 2;
|
|
45
49
|
$: meanValue, updateValueFromMean();
|
|
46
50
|
</script>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import GenericInputFolding from '../internal/GenericInputFolding.svelte';
|
|
6
6
|
import { removeKeys } from '../utils';
|
|
7
7
|
import { BROWSER } from 'esm-env';
|
|
8
|
+
import { shallowEqual } from 'fast-equals';
|
|
8
9
|
export let value;
|
|
9
10
|
export let expanded = $$props.expanded ?? void 0;
|
|
10
11
|
let pointerScale = $$props['pointerScale'] ?? void 0;
|
|
@@ -20,40 +21,38 @@
|
|
|
20
21
|
let internalValue;
|
|
21
22
|
let options;
|
|
22
23
|
const buttonClass = 'tp-p2dv_b';
|
|
23
|
-
function
|
|
24
|
+
function updateInternalValueFromValue() {
|
|
24
25
|
if (Array.isArray(value)) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
internalValue = { x, y };
|
|
26
|
+
const newInternalValue =
|
|
27
|
+
value.length === 4
|
|
28
|
+
? { x: value[0], y: value[1], z: value[2], w: value[3] }
|
|
29
|
+
: value.length === 3
|
|
30
|
+
? { x: value[0], y: value[1], z: value[2] }
|
|
31
|
+
: { x: value[0], y: value[1] };
|
|
32
|
+
if (!shallowEqual(internalValue, newInternalValue)) {
|
|
33
|
+
internalValue = newInternalValue;
|
|
34
34
|
}
|
|
35
|
-
} else {
|
|
36
|
-
internalValue = value;
|
|
35
|
+
} else if (!shallowEqual(internalValue, value)) {
|
|
36
|
+
internalValue = { ...value };
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function updateValueFromInternalValue() {
|
|
40
40
|
if (Array.isArray(value)) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
value = [x, y];
|
|
41
|
+
const newValue =
|
|
42
|
+
'w' in internalValue
|
|
43
|
+
? [internalValue.x, internalValue.y, internalValue.z, internalValue.w]
|
|
44
|
+
: 'z' in internalValue
|
|
45
|
+
? [internalValue.x, internalValue.y, internalValue.z]
|
|
46
|
+
: [internalValue.x, internalValue.y];
|
|
47
|
+
if (!shallowEqual(value, newValue)) {
|
|
48
|
+
value = newValue;
|
|
50
49
|
}
|
|
51
|
-
} else {
|
|
52
|
-
value = internalValue;
|
|
50
|
+
} else if (!shallowEqual(value, internalValue)) {
|
|
51
|
+
value = { ...internalValue };
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
$: value,
|
|
56
|
-
$: internalValue,
|
|
54
|
+
$: value, updateInternalValueFromValue();
|
|
55
|
+
$: internalValue, updateValueFromInternalValue();
|
|
57
56
|
$: options = {
|
|
58
57
|
x: optionsX,
|
|
59
58
|
y: optionsY,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import GenericInputFolding from '../internal/GenericInputFolding.svelte';
|
|
6
6
|
import * as pluginModule from '@kitschpatrol/tweakpane-plugin-rotation';
|
|
7
7
|
import { BROWSER } from 'esm-env';
|
|
8
|
+
import { shallowEqual } from 'fast-equals';
|
|
8
9
|
export let value;
|
|
9
10
|
export let order = void 0;
|
|
10
11
|
export let unit = void 0;
|
|
@@ -15,24 +16,28 @@
|
|
|
15
16
|
let options;
|
|
16
17
|
let internalValue;
|
|
17
18
|
const buttonClass = 'tp-rotationswatchv_b';
|
|
18
|
-
function
|
|
19
|
+
function updateInternalValueFromValue() {
|
|
19
20
|
if (Array.isArray(value)) {
|
|
20
|
-
const [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const newInternalValue = { x: value[0], y: value[1], z: value[2] };
|
|
22
|
+
if (!shallowEqual(newInternalValue, internalValue)) {
|
|
23
|
+
internalValue = newInternalValue;
|
|
24
|
+
}
|
|
25
|
+
} else if (!shallowEqual(value, internalValue)) {
|
|
26
|
+
internalValue = { ...value };
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
|
-
function
|
|
29
|
+
function updateValueFromInternalValue() {
|
|
27
30
|
if (Array.isArray(value)) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const newValue = [internalValue.x, internalValue.y, internalValue.z];
|
|
32
|
+
if (!shallowEqual(newValue, value)) {
|
|
33
|
+
value = newValue;
|
|
34
|
+
}
|
|
35
|
+
} else if (!shallowEqual(internalValue, value)) {
|
|
36
|
+
value = { ...internalValue };
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
|
-
$: value,
|
|
35
|
-
$: internalValue,
|
|
39
|
+
$: value, updateInternalValueFromValue();
|
|
40
|
+
$: internalValue, updateValueFromInternalValue();
|
|
36
41
|
$: options = {
|
|
37
42
|
x: optionsX,
|
|
38
43
|
y: optionsY,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import GenericInputFolding from '../internal/GenericInputFolding.svelte';
|
|
6
6
|
import * as pluginModule from '@kitschpatrol/tweakpane-plugin-rotation';
|
|
7
7
|
import { BROWSER } from 'esm-env';
|
|
8
|
+
import { shallowEqual } from 'fast-equals';
|
|
8
9
|
export let value;
|
|
9
10
|
export let optionsX = void 0;
|
|
10
11
|
export let optionsY = void 0;
|
|
@@ -14,24 +15,28 @@
|
|
|
14
15
|
let options;
|
|
15
16
|
let internalValue;
|
|
16
17
|
const buttonClass = 'tp-rotationswatchv_b';
|
|
17
|
-
function
|
|
18
|
+
function updateInternalValueFromValue() {
|
|
18
19
|
if (Array.isArray(value)) {
|
|
19
|
-
const [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const newInternalValue = { x: value[0], y: value[1], z: value[2], w: value[3] };
|
|
21
|
+
if (!shallowEqual(newInternalValue, internalValue)) {
|
|
22
|
+
internalValue = newInternalValue;
|
|
23
|
+
}
|
|
24
|
+
} else if (!shallowEqual(value, internalValue)) {
|
|
25
|
+
internalValue = { ...value };
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
function
|
|
28
|
+
function updateValueFromInternalValue() {
|
|
26
29
|
if (Array.isArray(value)) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
const newValue = [internalValue.x, internalValue.y, internalValue.z, internalValue.w];
|
|
31
|
+
if (!shallowEqual(newValue, value)) {
|
|
32
|
+
value = newValue;
|
|
33
|
+
}
|
|
34
|
+
} else if (!shallowEqual(internalValue, value)) {
|
|
35
|
+
value = { ...internalValue };
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
|
-
$: value,
|
|
34
|
-
$: internalValue,
|
|
38
|
+
$: value, updateInternalValueFromValue();
|
|
39
|
+
$: internalValue, updateValueFromInternalValue();
|
|
35
40
|
$: options = {
|
|
36
41
|
x: optionsX,
|
|
37
42
|
y: optionsY,
|
package/dist/core/Binding.svelte
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
function onTweakpaneChange() {
|
|
73
73
|
internalChange = true;
|
|
74
|
-
object = object;
|
|
74
|
+
object[key] = copy(object[key]);
|
|
75
75
|
}
|
|
76
76
|
$: DEV && enforceReadonly(_ref, ref, 'Binding', 'ref', true);
|
|
77
77
|
$: options, $parentStore !== void 0 && index !== void 0 && create();
|
|
@@ -123,7 +123,7 @@ export type AutoValueSlots = typeof __propDef.slots;
|
|
|
123
123
|
* import { AutoValue } from 'svelte-tweakpane-ui';
|
|
124
124
|
*
|
|
125
125
|
* let number = 0;
|
|
126
|
-
* let color =
|
|
126
|
+
* let color = { r: 255, g: 0, b: 255 };
|
|
127
127
|
* let point = { x: 0, y: 0 };
|
|
128
128
|
* let text = 'Cosmic manifold';
|
|
129
129
|
* </script>
|
|
@@ -151,7 +151,7 @@ export type ElementSlots = typeof __propDef.slots;
|
|
|
151
151
|
* gradientAngle = 45;
|
|
152
152
|
* textAngle = 0;
|
|
153
153
|
* }}
|
|
154
|
-
* disabled={gradientAngle
|
|
154
|
+
* disabled={gradientAngle === 45 && textAngle === 0}
|
|
155
155
|
* title="Reset"
|
|
156
156
|
* />
|
|
157
157
|
* </Pane>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
generics="T extends any, U extends BindingOptions = BindingOptions, V extends BindingRef = BindingRef"
|
|
5
5
|
>
|
|
6
6
|
import Binding from '../core/Binding.svelte';
|
|
7
|
+
import { shallowEqual } from 'fast-equals';
|
|
7
8
|
export let value;
|
|
8
9
|
export let ref = void 0;
|
|
9
10
|
export let options = void 0;
|
|
@@ -12,7 +13,9 @@
|
|
|
12
13
|
return value;
|
|
13
14
|
}
|
|
14
15
|
function setValue() {
|
|
15
|
-
object[key]
|
|
16
|
+
if (!shallowEqual(value, object[key])) {
|
|
17
|
+
object[key] = value;
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
$: object = { [key]: getValue() };
|
|
18
21
|
$: value = object[key];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { applyTheme } from '../theme.js';
|
|
4
4
|
import { updateCollapsibility } from '../utils.js';
|
|
5
5
|
import { BROWSER } from 'esm-env';
|
|
6
|
-
import { getContext, onDestroy, setContext } from 'svelte';
|
|
6
|
+
import { getContext, onDestroy, setContext, tick } from 'svelte';
|
|
7
7
|
import { writable } from 'svelte/store';
|
|
8
8
|
import { Pane as TpPane } from 'tweakpane';
|
|
9
9
|
export let title = void 0;
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
if ($existingParentStore !== void 0) {
|
|
30
30
|
console.warn('<Panes> must not be nested');
|
|
31
31
|
}
|
|
32
|
-
let _expanded = expanded;
|
|
33
32
|
if (BROWSER) {
|
|
34
33
|
$parentStore = new TpPane({ expanded, title });
|
|
35
34
|
$parentStore.on('fold', () => {
|
|
36
|
-
|
|
35
|
+
if ($parentStore.expanded !== void 0 && expanded !== $parentStore.expanded) {
|
|
36
|
+
expanded = $parentStore.expanded;
|
|
37
|
+
}
|
|
37
38
|
});
|
|
38
39
|
tpPane = $parentStore;
|
|
39
40
|
setContext('parentStore', parentStore);
|
|
@@ -57,19 +58,19 @@
|
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
tpPane.expanded
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
function updateExpanded(expanded2) {
|
|
62
|
+
void tick().then(() => {
|
|
63
|
+
if (tpPane?.expanded !== void 0 && expanded2 !== void 0 && tpPane.expanded !== expanded2) {
|
|
64
|
+
tpPane.expanded = expanded2;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
65
67
|
}
|
|
66
68
|
$: tpPane?.element && tpPane?.element.classList.add('svelte-tweakpane-ui');
|
|
67
69
|
$: tpPane && setScale(scale);
|
|
68
70
|
$: tpPane && updateCollapsibility(userExpandable, tpPane.element, 'tp-rotv_b', 'tp-rotv_m');
|
|
69
|
-
$: tpPane && title && (tpPane.title = title);
|
|
71
|
+
$: tpPane && title !== void 0 && (tpPane.title = title.length > 0 ? title : ' ');
|
|
70
72
|
$: tpPane && applyTheme(tpPane.element, theme);
|
|
71
|
-
$:
|
|
72
|
-
$: tpPane && (_expanded = expanded);
|
|
73
|
+
$: tpPane && updateExpanded(expanded);
|
|
73
74
|
</script>
|
|
74
75
|
|
|
75
76
|
{#if BROWSER}
|
|
@@ -224,6 +224,8 @@ export type ProfilerSlots = typeof __propDef.slots;
|
|
|
224
224
|
* }
|
|
225
225
|
*
|
|
226
226
|
* onMount(() => {
|
|
227
|
+
* let animationFrameHandle: number;
|
|
228
|
+
*
|
|
227
229
|
* (function tick() {
|
|
228
230
|
* // Nesting measurements creates a hierarchy
|
|
229
231
|
* // in the Profile visualization
|
|
@@ -252,6 +254,10 @@ export type ProfilerSlots = typeof __propDef.slots;
|
|
|
252
254
|
*
|
|
253
255
|
* requestAnimationFrame(tick);
|
|
254
256
|
* })();
|
|
257
|
+
*
|
|
258
|
+
* return () => {
|
|
259
|
+
* cancelAnimationFrame(animationFrameHandle);
|
|
260
|
+
* };
|
|
255
261
|
* });
|
|
256
262
|
* </script>
|
|
257
263
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tweakpane-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=18.0.0",
|
|
22
|
+
"node": ">=18.0.0 <23.0.0",
|
|
23
23
|
"pnpm": ">=9.0.0"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"npm-package"
|
|
183
183
|
],
|
|
184
184
|
"peerDependencies": {
|
|
185
|
-
"svelte": "^4.0.0"
|
|
185
|
+
"svelte": "^4.0.0 || ^5.0.0"
|
|
186
186
|
},
|
|
187
187
|
"dependencies": {
|
|
188
188
|
"@kitschpatrol/tweakpane-plugin-camerakit": "0.3.1-beta.2",
|
|
@@ -196,48 +196,47 @@
|
|
|
196
196
|
"esm-env": "1.0.0",
|
|
197
197
|
"fast-copy": "3.0.2",
|
|
198
198
|
"fast-equals": "5.0.1",
|
|
199
|
-
"nanoid": "5.0.
|
|
199
|
+
"nanoid": "5.0.7",
|
|
200
200
|
"svelte-persisted-store": "0.11.0",
|
|
201
201
|
"tweakpane": "4.0.4"
|
|
202
202
|
},
|
|
203
203
|
"devDependencies": {
|
|
204
|
-
"@kitschpatrol/shared-config": "
|
|
205
|
-
"@phenomnomnominal/tsquery": "
|
|
206
|
-
"@playwright/test": "
|
|
207
|
-
"@stkb/rewrap": "
|
|
208
|
-
"@sveltejs/adapter-static": "
|
|
209
|
-
"@sveltejs/kit": "
|
|
210
|
-
"@sveltejs/package": "
|
|
211
|
-
"@sveltejs/vite-plugin-svelte": "
|
|
212
|
-
"@types/eslint": "
|
|
213
|
-
"@types/fs-extra": "
|
|
214
|
-
"@types/node": "18.
|
|
215
|
-
"bumpp": "
|
|
216
|
-
"eslint": "
|
|
217
|
-
"fs-extra": "
|
|
218
|
-
"glob": "
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"svelte": "
|
|
225
|
-
"svelte-
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"yaml": "^2.5.1"
|
|
204
|
+
"@kitschpatrol/shared-config": "4.7.11",
|
|
205
|
+
"@phenomnomnominal/tsquery": "6.1.3",
|
|
206
|
+
"@playwright/test": "1.48.1",
|
|
207
|
+
"@stkb/rewrap": "0.1.0",
|
|
208
|
+
"@sveltejs/adapter-static": "3.0.5",
|
|
209
|
+
"@sveltejs/kit": "2.7.2",
|
|
210
|
+
"@sveltejs/package": "2.3.5",
|
|
211
|
+
"@sveltejs/vite-plugin-svelte": "3.1.2",
|
|
212
|
+
"@types/eslint": "8.56.12",
|
|
213
|
+
"@types/fs-extra": "11.0.4",
|
|
214
|
+
"@types/node": "18.19.57",
|
|
215
|
+
"bumpp": "9.7.1",
|
|
216
|
+
"eslint": "8.57.1",
|
|
217
|
+
"fs-extra": "11.2.0",
|
|
218
|
+
"glob": "11.0.0",
|
|
219
|
+
"postcss-html": "1.7.0",
|
|
220
|
+
"publint": "0.2.11",
|
|
221
|
+
"read-package-up": "11.0.0",
|
|
222
|
+
"remark-mdat": "0.7.3",
|
|
223
|
+
"svelte": "4.2.19",
|
|
224
|
+
"svelte-check": "4.0.5",
|
|
225
|
+
"svelte-language-server": "0.17.0",
|
|
226
|
+
"svelte2tsx": "0.7.22",
|
|
227
|
+
"ts-morph": "24.0.0",
|
|
228
|
+
"tslib": "2.8.0",
|
|
229
|
+
"tsx": "4.19.1",
|
|
230
|
+
"typescript": "5.6.3",
|
|
231
|
+
"vite": "5.4.9",
|
|
232
|
+
"yaml": "2.6.0"
|
|
234
233
|
},
|
|
235
234
|
"publishConfig": {
|
|
236
235
|
"access": "public"
|
|
237
236
|
},
|
|
238
237
|
"scripts": {
|
|
239
|
-
"build": "run
|
|
240
|
-
"build:01-sync": "pnpm run check",
|
|
238
|
+
"build": "pnpm run --sequential /^build:/",
|
|
239
|
+
"build:01-sync": "pnpm run check && pnpm run svelte-5-check",
|
|
241
240
|
"build:02-exports": "tsx ./scripts/generate-exports.ts",
|
|
242
241
|
"build:03-add-source-links": "tsx ./scripts/add-source-links.ts",
|
|
243
242
|
"build:04-format": "pnpm run format && prettier-config --fix ./readme.md",
|
|
@@ -250,6 +249,8 @@
|
|
|
250
249
|
"build:11-examples-to-docs": "tsx ./scripts/generate-example-components.ts",
|
|
251
250
|
"build:12-acknowledgments-data": "mkdir -p ./docs/src/content/acknowledgments && pnpm licenses list --json > ./docs/src/content/acknowledgments/acknowledgments-lib.json",
|
|
252
251
|
"build:13-build-docs": "pnpm run docs-build",
|
|
252
|
+
"build:14-build-kit": "pnpm run kit-build",
|
|
253
|
+
"build:15-build-svelte-5": "pnpm run svelte-5-build",
|
|
253
254
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
254
255
|
"check-watch": "svelte-kit sync && svelte-check --ignore ./scratch --tsconfig ./tsconfig.json --watch",
|
|
255
256
|
"clean": "rm pnpm-lock.yaml ; git clean -fdX",
|
|
@@ -257,7 +258,7 @@
|
|
|
257
258
|
"docs-dev": "pnpm -C ./docs run dev",
|
|
258
259
|
"docs-preview": "pnpm -C ./docs run preview",
|
|
259
260
|
"fix": "shared-config --fix",
|
|
260
|
-
"format": "run
|
|
261
|
+
"format": "pnpm run --sequential /^format:/",
|
|
261
262
|
"format:1-shared": "shared-config --fix",
|
|
262
263
|
"format:2-embedded": "tsx ./scripts/format-embedded-code.ts",
|
|
263
264
|
"kit-build": "pnpm run kit-examples && vite build",
|
|
@@ -265,12 +266,16 @@
|
|
|
265
266
|
"kit-examples": "tsx ./scripts/generate-kit-examples.ts",
|
|
266
267
|
"kit-preview": "vite preview",
|
|
267
268
|
"lint": "shared-config --check",
|
|
268
|
-
"release": "run
|
|
269
|
+
"release": "pnpm run --sequential /^release:/",
|
|
269
270
|
"release:1-build": "pnpm run build",
|
|
270
271
|
"release:2-version": "bumpp --commit 'Release: %s'",
|
|
271
272
|
"release:3-publish": "pnpm publish --ignore-scripts --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')",
|
|
272
273
|
"rewrap": "rewrap -i --column 100 `find src \\( -name '*.svelte' -o -name '*.ts' -o -name '*.html' \\) -type f | grep -v src/examples`",
|
|
273
|
-
"
|
|
274
|
+
"svelte-5-build": "pnpm -C ./svelte-5 run build",
|
|
275
|
+
"svelte-5-check": "pnpm -C ./svelte-5 run check",
|
|
276
|
+
"svelte-5-dev": "pnpm -C ./svelte-5 run dev",
|
|
277
|
+
"svelte-5-preview": "pnpm -C ./svelte-5 run preview",
|
|
278
|
+
"test": "pnpm run --sequential /^test:/",
|
|
274
279
|
"test:integration": "playwright test",
|
|
275
280
|
"type-check": "tsc --noEmit"
|
|
276
281
|
}
|
package/readme.md
CHANGED
|
@@ -40,6 +40,8 @@ The library makes it easy to quickly and declaratively add knobs and dials to yo
|
|
|
40
40
|
|
|
41
41
|
[The components](https://kitschpatrol.com/svelte-tweakpane-ui/docs#components) should be useful for integrating controls and value monitoring in parametrically driven artworks, data visualizations, creative tools, simulations, etc.
|
|
42
42
|
|
|
43
|
+
The library is compatible with both Svelte 4 and Svelte 5.
|
|
44
|
+
|
|
43
45
|
## Demo
|
|
44
46
|
|
|
45
47
|

|