svelte-tweakpane-ui 1.1.0 → 1.1.2
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.
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
<GenericInput value={_value} bind:ref {options} plugin={pluginModule} {...$$restProps} />
|
|
41
41
|
{#if !BROWSER}
|
|
42
42
|
<!-- TODO magic numbers -->
|
|
43
|
-
<div style:
|
|
43
|
+
<div style:height={`calc(${16 * (rows ?? 3)}px - 14px)`} />
|
|
44
44
|
<!-- <ClsPad keysAdd={fillWith('containerUnitSize', 1)} theme={$$props.theme} /> -->
|
|
45
45
|
{/if}
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
let implicitMode = true;
|
|
16
16
|
export function begin() {
|
|
17
17
|
implicitMode = false;
|
|
18
|
-
|
|
18
|
+
ref?.begin();
|
|
19
19
|
}
|
|
20
20
|
export function end() {
|
|
21
21
|
implicitMode = false;
|
|
22
|
-
|
|
22
|
+
ref?.end();
|
|
23
23
|
}
|
|
24
|
-
let
|
|
24
|
+
let ref;
|
|
25
25
|
let requestId;
|
|
26
26
|
const dispatch = createEventDispatcher();
|
|
27
27
|
onMount(() => {
|
|
@@ -29,44 +29,25 @@
|
|
|
29
29
|
});
|
|
30
30
|
onDestroy(() => {
|
|
31
31
|
stopInternalLoop();
|
|
32
|
-
stopObservingMeasuredFpsValue();
|
|
33
32
|
});
|
|
34
33
|
function startInternalLoop() {
|
|
35
34
|
loop();
|
|
36
35
|
}
|
|
37
36
|
function loop() {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
ref?.end();
|
|
38
|
+
ref?.begin();
|
|
40
39
|
requestId = requestAnimationFrame(loop);
|
|
41
40
|
}
|
|
42
41
|
function stopInternalLoop() {
|
|
43
42
|
requestId && cancelAnimationFrame(requestId);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!targetNode?.innerHTML) return;
|
|
50
|
-
observer = new MutationObserver((mutations) => {
|
|
51
|
-
for (const mutation of mutations) {
|
|
52
|
-
if (mutation.type === 'characterData' || mutation.type === 'childList') {
|
|
53
|
-
const fpsText = mutation.target.textContent;
|
|
54
|
-
if (fpsText !== null) {
|
|
55
|
-
const fps = Number.parseInt(fpsText, 10);
|
|
56
|
-
!Number.isNaN(fps) && dispatch('change', fps);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
44
|
+
function addListeners() {
|
|
45
|
+
ref.on('tick', () => {
|
|
46
|
+
if (ref.fps !== null) {
|
|
47
|
+
dispatch('change', ref.fps);
|
|
59
48
|
}
|
|
60
49
|
});
|
|
61
|
-
observer.observe(targetNode, { characterData: true, childList: true, subtree: true });
|
|
62
50
|
}
|
|
63
|
-
function stopObservingMeasuredFpsValue() {
|
|
64
|
-
if (observer) {
|
|
65
|
-
observer.disconnect();
|
|
66
|
-
observer = void 0;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
$: fpsBlade && startObservingMeasuredFpsValue();
|
|
70
51
|
let options;
|
|
71
52
|
$: options = {
|
|
72
53
|
min,
|
|
@@ -76,10 +57,11 @@
|
|
|
76
57
|
rows,
|
|
77
58
|
view: 'fpsgraph'
|
|
78
59
|
};
|
|
60
|
+
$: ref !== void 0 && addListeners();
|
|
79
61
|
$: !implicitMode && stopInternalLoop();
|
|
80
62
|
</script>
|
|
81
63
|
|
|
82
|
-
<Blade bind:ref
|
|
64
|
+
<Blade bind:ref {options} plugin={pluginModule} {...$$restProps} />
|
|
83
65
|
{#if !BROWSER}
|
|
84
66
|
{#if rows}
|
|
85
67
|
<ClsPad keysAdd={fillWith('containerUnitSize', rows)} theme={$$props.theme} />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tweakpane-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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": {
|
|
@@ -256,7 +256,10 @@
|
|
|
256
256
|
"kit-examples": "tsx ./scripts/generate-kit-examples.ts",
|
|
257
257
|
"kit-preview": "vite preview",
|
|
258
258
|
"lint": "shared-config --check",
|
|
259
|
-
"release": "
|
|
259
|
+
"release": "run-s --print-label release:*",
|
|
260
|
+
"release:1-build": "pnpm run build",
|
|
261
|
+
"release:2-version": "pnpm bumpp --commit 'Release: %s' --tag '%s'",
|
|
262
|
+
"release:3-publish": "pnpm publish --ignore-scripts --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')",
|
|
260
263
|
"rewrap": "rewrap -i --column 100 `find src \\( -name '*.svelte' -o -name '*.ts' -o -name '*.html' \\) -type f | grep -v src/examples`",
|
|
261
264
|
"type-check": "tsc --noEmit"
|
|
262
265
|
}
|