@threlte/theatre 1.0.5 → 2.0.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.
|
@@ -1,22 +1,14 @@
|
|
|
1
|
+
<script context="module">import Studio from '@theatre/studio';
|
|
2
|
+
import { studio } from '../consts';
|
|
3
|
+
Studio.initialize();
|
|
4
|
+
studio.set(Studio);
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<script>import { watch } from '@threlte/core';
|
|
2
|
-
import { onMount } from 'svelte';
|
|
3
8
|
import { writable } from 'svelte/store';
|
|
4
|
-
import { studio } from '../consts';
|
|
5
9
|
export let hide;
|
|
6
10
|
const hideStore = writable(hide);
|
|
7
11
|
$: hideStore.set(hide);
|
|
8
|
-
let initialized = false;
|
|
9
|
-
onMount(async () => {
|
|
10
|
-
if ($studio) {
|
|
11
|
-
initialized = true;
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const pkg = await import('@theatre/studio');
|
|
15
|
-
const Studio = pkg.default;
|
|
16
|
-
Studio.initialize();
|
|
17
|
-
studio.set(Studio);
|
|
18
|
-
initialized = true;
|
|
19
|
-
});
|
|
20
12
|
watch([studio, hideStore], ([studio, hide]) => {
|
|
21
13
|
if (hide) {
|
|
22
14
|
studio?.ui.hide();
|
|
@@ -30,6 +22,4 @@ watch([studio, hideStore], ([studio, hide]) => {
|
|
|
30
22
|
});
|
|
31
23
|
</script>
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
<slot />
|
|
35
|
-
{/if}
|
|
25
|
+
<slot />
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let enabled = true;
|
|
1
|
+
<script>export let enabled = true;
|
|
3
2
|
export let hide = false;
|
|
4
3
|
const browser = typeof window !== 'undefined';
|
|
5
4
|
</script>
|
|
6
5
|
|
|
7
6
|
{#if browser && enabled}
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
7
|
+
{#await import('./InnerStudio.svelte') then Component}
|
|
8
|
+
<svelte:component this={Component.default} {hide}>
|
|
9
|
+
<slot />
|
|
10
|
+
</svelte:component>
|
|
11
|
+
{/await}
|
|
11
12
|
{:else}
|
|
12
13
|
<slot />
|
|
13
14
|
{/if}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/theatre",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"devDependencies": {
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"typescript": "^5.0.0",
|
|
30
30
|
"vite": "^4.3.6",
|
|
31
31
|
"@threlte/core": "6.0.3",
|
|
32
|
-
"@threlte/extras": "5.0
|
|
32
|
+
"@threlte/extras": "5.1.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"svelte": ">=4",
|
|
36
36
|
"three": ">=0.133",
|
|
37
37
|
"@threlte/core": ">=6.0.3",
|
|
38
|
-
"@threlte/extras": ">=5.0
|
|
38
|
+
"@threlte/extras": ">=5.1.0",
|
|
39
39
|
"@theatre/core": ">=0.6",
|
|
40
40
|
"@theatre/studio": ">=0.6"
|
|
41
41
|
},
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"dist"
|
|
53
53
|
],
|
|
54
54
|
"scripts": {
|
|
55
|
+
"dev": "vite dev",
|
|
55
56
|
"package": "svelte-kit sync && svelte-package && node ./scripts/cleanupPackage.js && publint",
|
|
56
57
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
57
58
|
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|