@threlte/theatre 3.0.4 → 3.0.5
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/sheet/Sheet.svelte +2 -4
- package/dist/sheet/Sheet.svelte.d.ts +8 -36
- package/dist/studio/InnerStudio.svelte +6 -4
- package/dist/studio/InnerStudio.svelte.d.ts +3 -27
- package/dist/studio/Studio.svelte +6 -9
- package/dist/studio/Studio.svelte.d.ts +4 -27
- package/dist/theatre/Theatre.svelte +2 -3
- package/dist/theatre/Theatre.svelte.d.ts +4 -27
- package/package.json +4 -4
package/dist/sheet/Sheet.svelte
CHANGED
|
@@ -4,9 +4,7 @@ import { globalSheets } from '../consts';
|
|
|
4
4
|
// parent context
|
|
5
5
|
export const project = getContext('theatre-project');
|
|
6
6
|
const projectName = project.address.projectId;
|
|
7
|
-
|
|
8
|
-
export let name = 'default';
|
|
9
|
-
export let instance = undefined;
|
|
7
|
+
let { name = 'default', instance = undefined, children } = $props();
|
|
10
8
|
// bindings
|
|
11
9
|
export const sheet = globalSheets.get(`${projectName}-${name}-${instance}`) ?? project.sheet(name, instance);
|
|
12
10
|
// register instance logic
|
|
@@ -18,4 +16,4 @@ const sequences = { default: sequence };
|
|
|
18
16
|
setContext('theatre-sheet', { sheet, sequences });
|
|
19
17
|
</script>
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
{@render children?.({ sheet })}
|
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import type { IProject } from '@theatre/core';
|
|
1
|
+
import type { IProject, ISheet } from '@theatre/core';
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
2
3
|
import { SequenceController } from '../sequence/SequenceController';
|
|
3
|
-
|
|
4
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
-
$$bindings?: Bindings;
|
|
6
|
-
} & Exports;
|
|
7
|
-
(internal: unknown, props: Props & {
|
|
8
|
-
$$events?: Events;
|
|
9
|
-
$$slots?: Slots;
|
|
10
|
-
}): Exports & {
|
|
11
|
-
$set?: any;
|
|
12
|
-
$on?: any;
|
|
13
|
-
};
|
|
14
|
-
z_$$bindings?: Bindings;
|
|
15
|
-
}
|
|
16
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
-
default: any;
|
|
18
|
-
} ? Props extends Record<string, never> ? any : {
|
|
19
|
-
children?: any;
|
|
20
|
-
} : {});
|
|
21
|
-
declare const Sheet: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
-
project?: IProject;
|
|
4
|
+
declare const Sheet: import("svelte").Component<{
|
|
23
5
|
name?: string;
|
|
24
6
|
instance?: string | undefined;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
default: {
|
|
29
|
-
sheet: import("@theatre/core").ISheet;
|
|
30
|
-
};
|
|
31
|
-
}>, {
|
|
32
|
-
[evt: string]: CustomEvent<any>;
|
|
33
|
-
}, {
|
|
34
|
-
default: {
|
|
35
|
-
sheet: import("@theatre/core").ISheet;
|
|
36
|
-
};
|
|
7
|
+
children?: Snippet<[{
|
|
8
|
+
sheet: ISheet;
|
|
9
|
+
}]>;
|
|
37
10
|
}, {
|
|
38
11
|
project: IProject;
|
|
39
|
-
sheet:
|
|
12
|
+
sheet: ISheet;
|
|
40
13
|
sequence: SequenceController;
|
|
41
|
-
},
|
|
42
|
-
type Sheet = InstanceType<typeof Sheet>;
|
|
14
|
+
}, "">;
|
|
43
15
|
export default Sheet;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script
|
|
2
2
|
lang="ts"
|
|
3
|
-
|
|
3
|
+
module
|
|
4
4
|
>import Studio from '@theatre/studio';
|
|
5
5
|
import { studio } from '../consts';
|
|
6
6
|
Studio.initialize();
|
|
@@ -9,9 +9,11 @@ studio.set(Studio);
|
|
|
9
9
|
|
|
10
10
|
<script lang="ts">import { watch } from '@threlte/core';
|
|
11
11
|
import { writable } from 'svelte/store';
|
|
12
|
-
|
|
12
|
+
let { hide, children } = $props();
|
|
13
13
|
const hideStore = writable(hide);
|
|
14
|
-
|
|
14
|
+
$effect(() => {
|
|
15
|
+
hideStore.set(hide);
|
|
16
|
+
});
|
|
15
17
|
watch([studio, hideStore], ([studio, hide]) => {
|
|
16
18
|
if (hide) {
|
|
17
19
|
studio?.ui.hide();
|
|
@@ -25,4 +27,4 @@ watch([studio, hideStore], ([studio, hide]) => {
|
|
|
25
27
|
});
|
|
26
28
|
</script>
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
{@render children?.()}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const InnerStudio: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
declare const InnerStudio: import("svelte").Component<{
|
|
20
2
|
hide: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}>, {
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {
|
|
26
|
-
default: {};
|
|
27
|
-
}, {}, string>;
|
|
28
|
-
type InnerStudio = InstanceType<typeof InnerStudio>;
|
|
3
|
+
children?: import("svelte").Snippet;
|
|
4
|
+
}, {}, "">;
|
|
29
5
|
export default InnerStudio;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
export let hide = false;
|
|
1
|
+
<script lang="ts">let { enabled = true, hide = false, children } = $props();
|
|
3
2
|
const browser = typeof window !== 'undefined';
|
|
3
|
+
export {};
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
{#if browser && enabled}
|
|
7
7
|
{#await import('./InnerStudio.svelte') then Component}
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
<slot />
|
|
13
|
-
</svelte:component>
|
|
8
|
+
<Component.default {hide}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</Component.default>
|
|
14
11
|
{/await}
|
|
15
12
|
{:else}
|
|
16
|
-
|
|
13
|
+
{@render children?.()}
|
|
17
14
|
{/if}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Studio: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
declare const Studio: import("svelte").Component<{
|
|
20
3
|
enabled?: boolean;
|
|
21
4
|
hide?: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}>, {
|
|
25
|
-
[evt: string]: CustomEvent<any>;
|
|
26
|
-
}, {
|
|
27
|
-
default: {};
|
|
28
|
-
}, {}, string>;
|
|
29
|
-
type Studio = InstanceType<typeof Studio>;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}, {}, "">;
|
|
30
7
|
export default Studio;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts">import { Project, Sheet, Studio } from '..';
|
|
2
|
-
|
|
3
|
-
export let config = undefined;
|
|
2
|
+
let { studio = {}, config = undefined, children } = $props();
|
|
4
3
|
</script>
|
|
5
4
|
|
|
6
5
|
<Studio {...studio}>
|
|
7
6
|
<Project {config}>
|
|
8
7
|
<Sheet>
|
|
9
|
-
|
|
8
|
+
{@render children?.()}
|
|
10
9
|
</Sheet>
|
|
11
10
|
</Project>
|
|
12
11
|
</Studio>
|
|
@@ -1,34 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { IProjectConfig } from '@theatre/core';
|
|
2
|
-
|
|
3
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: Props & {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
-
default: any;
|
|
17
|
-
} ? Props extends Record<string, never> ? any : {
|
|
18
|
-
children?: any;
|
|
19
|
-
} : {});
|
|
20
|
-
declare const Theatre: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
+
declare const Theatre: import("svelte").Component<{
|
|
21
4
|
studio?: {
|
|
22
5
|
enabled?: boolean;
|
|
23
6
|
hide?: boolean;
|
|
24
7
|
};
|
|
25
8
|
config?: IProjectConfig | undefined;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}>, {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {
|
|
31
|
-
default: {};
|
|
32
|
-
}, {}, string>;
|
|
33
|
-
type Theatre = InstanceType<typeof Theatre>;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
}, {}, "">;
|
|
34
11
|
export default Theatre;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/theatre",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Threlte Components for Theatre, an animation library with a professional motion design toolset",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"prettier-plugin-svelte": "^3.2.2",
|
|
21
21
|
"publint": "^0.2.7",
|
|
22
22
|
"rimraf": "^5.0.5",
|
|
23
|
-
"svelte": "
|
|
23
|
+
"svelte": "5.26.2",
|
|
24
24
|
"svelte-check": "^4.1.7",
|
|
25
25
|
"svelte-preprocess": "^5.1.3",
|
|
26
26
|
"svelte2tsx": "^0.7.6",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"typescript": "^5.6.3",
|
|
31
31
|
"typescript-eslint": "^8.32.0",
|
|
32
32
|
"vite": "^5.2.8",
|
|
33
|
-
"@threlte/core": "8.
|
|
34
|
-
"@threlte/extras": "9.
|
|
33
|
+
"@threlte/core": "8.1.3",
|
|
34
|
+
"@threlte/extras": "9.4.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@theatre/core": ">=0.6",
|