@threlte/theatre 3.0.0-next.0 → 3.0.0-next.10
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/project/Project.svelte +4 -8
- package/dist/project/Project.svelte.d.ts +12 -25
- package/dist/sequence/Sequence.svelte +1 -1
- package/dist/sequence/Sequence.svelte.d.ts +71 -59
- package/dist/sequence/SequenceController.d.ts +0 -2
- package/dist/sheet/Sheet.svelte +1 -1
- package/dist/sheet/Sheet.svelte.d.ts +38 -24
- package/dist/sheet/createSheetObjectAction.d.ts +2 -2
- package/dist/sheetObject/SheetObject.svelte +22 -18
- package/dist/sheetObject/SheetObject.svelte.d.ts +19 -29
- package/dist/sheetObject/declare/Declare.svelte +10 -6
- package/dist/sheetObject/declare/Declare.svelte.d.ts +19 -14
- package/dist/sheetObject/declare/types.d.ts +9 -0
- package/dist/sheetObject/declare/types.js +1 -0
- package/dist/sheetObject/sync/Sync.svelte +15 -9
- package/dist/sheetObject/sync/Sync.svelte.d.ts +20 -69
- package/dist/sheetObject/sync/types.d.ts +30 -0
- package/dist/sheetObject/sync/types.js +1 -0
- package/dist/sheetObject/sync/utils/isComplexProp.d.ts +1 -1
- package/dist/sheetObject/sync/utils/isStringProp.d.ts +1 -1
- package/dist/sheetObject/sync/utils/parsePropLabel.d.ts +1 -1
- package/dist/sheetObject/transform/Transform.svelte +36 -36
- package/dist/sheetObject/transform/Transform.svelte.d.ts +18 -20
- package/dist/sheetObject/transform/types.d.ts +14 -0
- package/dist/sheetObject/transform/types.js +1 -0
- package/dist/sheetObject/types.d.ts +24 -0
- package/dist/sheetObject/types.js +1 -0
- package/dist/sheetObject/useSheet.d.ts +10 -0
- package/dist/sheetObject/useSheet.js +8 -0
- package/dist/studio/InnerStudio.svelte +2 -2
- package/dist/studio/InnerStudio.svelte.d.ts +27 -16
- package/dist/studio/Studio.svelte +1 -1
- package/dist/studio/Studio.svelte.d.ts +28 -17
- package/dist/theatre/Theatre.svelte +1 -1
- package/dist/theatre/Theatre.svelte.d.ts +31 -20
- package/package.json +45 -25
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<script>import { globalProjects } from '../consts';
|
|
1
|
+
<script lang="ts">import { globalProjects } from '../consts';
|
|
2
2
|
import { getProject } from '../theatre';
|
|
3
3
|
import { setContext } from 'svelte';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let config = undefined;
|
|
7
|
-
// BINDINGS
|
|
8
|
-
export const project = globalProjects.get(name) ?? getProject(name, config);
|
|
4
|
+
let { name = 'default', config, project = $bindable(), isReady = $bindable(), children } = $props();
|
|
5
|
+
project = globalProjects.get(name) ?? getProject(name, config);
|
|
9
6
|
globalProjects.set(name, project);
|
|
10
|
-
export let isReady = false;
|
|
11
7
|
const syncReady = async () => {
|
|
12
8
|
await project.ready;
|
|
13
9
|
isReady = true;
|
|
@@ -18,5 +14,5 @@ setContext(`theatre-project`, project);
|
|
|
18
14
|
</script>
|
|
19
15
|
|
|
20
16
|
{#await project.ready then}
|
|
21
|
-
|
|
17
|
+
{@render children?.({ project })}
|
|
22
18
|
{/await}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IProjectConfig } from '@theatre/core';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
slots: {
|
|
14
|
-
default: {
|
|
15
|
-
project: import("@theatre/core").IProject;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type ProjectProps = typeof __propDef.props;
|
|
20
|
-
export type ProjectEvents = typeof __propDef.events;
|
|
21
|
-
export type ProjectSlots = typeof __propDef.slots;
|
|
22
|
-
export default class Project extends SvelteComponent<ProjectProps, ProjectEvents, ProjectSlots> {
|
|
23
|
-
get project(): import("@theatre/core").IProject;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { IProject, IProjectConfig } from '@theatre/core';
|
|
3
|
+
declare const Project: import("svelte").Component<{
|
|
4
|
+
name: string;
|
|
5
|
+
config?: IProjectConfig | undefined;
|
|
6
|
+
project?: IProject;
|
|
7
|
+
isReady?: boolean;
|
|
8
|
+
children?: Snippet<[{
|
|
9
|
+
project: IProject;
|
|
10
|
+
}]>;
|
|
11
|
+
}, {}, "project" | "isReady">;
|
|
12
|
+
export default Project;
|
|
@@ -1,63 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IRafDriver } from '@theatre/core';
|
|
1
|
+
import type { IRafDriver, ISequence } from '@theatre/core';
|
|
3
2
|
import type { Autoreset, IterationCount, PlaybackDirection, PlaybackRange, SequenceAudioOptions } from './types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
autopause?: boolean | undefined;
|
|
15
|
-
delay?: number | undefined;
|
|
16
|
-
sequence?: import("./SequenceController").SequenceController | undefined;
|
|
17
|
-
position?: number | undefined;
|
|
18
|
-
playing?: boolean | undefined;
|
|
19
|
-
length?: number | undefined;
|
|
20
|
-
play?: ((conf?: {
|
|
21
|
-
iterationCount?: number | undefined;
|
|
22
|
-
range?: [from: number, to: number] | undefined;
|
|
23
|
-
rate?: number | undefined;
|
|
24
|
-
direction?: ("reverse" | "alternate" | "normal" | "alternateReverse") | undefined;
|
|
25
|
-
rafDriver?: IRafDriver | undefined;
|
|
26
|
-
} | undefined) => Promise<boolean>) | undefined;
|
|
27
|
-
pause?: (() => void) | undefined;
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
28
13
|
};
|
|
29
|
-
|
|
30
|
-
|
|
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 Sequence: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
+
rate?: number;
|
|
23
|
+
range?: PlaybackRange;
|
|
24
|
+
iterationCount?: IterationCount;
|
|
25
|
+
direction?: PlaybackDirection;
|
|
26
|
+
rafDriver?: IRafDriver | undefined;
|
|
27
|
+
audio?: SequenceAudioOptions | undefined;
|
|
28
|
+
autoplay?: boolean;
|
|
29
|
+
autoreset?: Autoreset;
|
|
30
|
+
autopause?: boolean;
|
|
31
|
+
delay?: number;
|
|
32
|
+
sequence?: import("./SequenceController").SequenceController;
|
|
33
|
+
position?: number;
|
|
34
|
+
playing?: boolean;
|
|
35
|
+
length?: number;
|
|
36
|
+
play?: ISequence["play"];
|
|
37
|
+
pause?: ISequence["pause"];
|
|
38
|
+
}, {
|
|
39
|
+
default: {
|
|
40
|
+
sequence: import("./SequenceController").SequenceController;
|
|
41
|
+
position: number;
|
|
42
|
+
playing: boolean;
|
|
43
|
+
play: (conf?: {
|
|
44
|
+
iterationCount?: number;
|
|
45
|
+
range?: [from: number, to: number];
|
|
46
|
+
rate?: number;
|
|
47
|
+
direction?: "reverse" | "alternate" | "normal" | "alternateReverse";
|
|
48
|
+
rafDriver?: IRafDriver;
|
|
49
|
+
}) => Promise<boolean>;
|
|
50
|
+
pause: () => void;
|
|
31
51
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
52
|
+
}>, {
|
|
53
|
+
[evt: string]: CustomEvent<any>;
|
|
54
|
+
}, {
|
|
55
|
+
default: {
|
|
56
|
+
sequence: import("./SequenceController").SequenceController;
|
|
57
|
+
position: number;
|
|
58
|
+
playing: boolean;
|
|
59
|
+
play: (conf?: {
|
|
60
|
+
iterationCount?: number;
|
|
61
|
+
range?: [from: number, to: number];
|
|
62
|
+
rate?: number;
|
|
63
|
+
direction?: "reverse" | "alternate" | "normal" | "alternateReverse";
|
|
64
|
+
rafDriver?: IRafDriver;
|
|
65
|
+
}) => Promise<boolean>;
|
|
66
|
+
pause: () => void;
|
|
46
67
|
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
iterationCount?: number | undefined;
|
|
56
|
-
range?: [from: number, to: number] | undefined;
|
|
57
|
-
rate?: number | undefined;
|
|
58
|
-
direction?: ("reverse" | "alternate" | "normal" | "alternateReverse") | undefined;
|
|
59
|
-
rafDriver?: IRafDriver | undefined;
|
|
60
|
-
} | undefined) => Promise<boolean>;
|
|
61
|
-
get pause(): () => void;
|
|
62
|
-
}
|
|
63
|
-
export {};
|
|
68
|
+
}, {
|
|
69
|
+
sequence: import("./SequenceController").SequenceController;
|
|
70
|
+
length: number;
|
|
71
|
+
play: ISequence["play"];
|
|
72
|
+
pause: ISequence["pause"];
|
|
73
|
+
}, string>;
|
|
74
|
+
type Sequence = InstanceType<typeof Sequence>;
|
|
75
|
+
export default Sequence;
|
package/dist/sheet/Sheet.svelte
CHANGED
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { IProject } from '@theatre/core';
|
|
3
2
|
import { SequenceController } from '../sequence/SequenceController';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
11
13
|
};
|
|
12
|
-
|
|
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;
|
|
23
|
+
name?: string;
|
|
24
|
+
instance?: string | undefined;
|
|
25
|
+
sheet?: import("@theatre/core").ISheet;
|
|
26
|
+
sequence?: SequenceController;
|
|
27
|
+
}, {
|
|
28
|
+
default: {
|
|
29
|
+
sheet: import("@theatre/core").ISheet;
|
|
14
30
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
}>, {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {
|
|
34
|
+
default: {
|
|
35
|
+
sheet: import("@theatre/core").ISheet;
|
|
19
36
|
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
get sequence(): SequenceController;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
37
|
+
}, {
|
|
38
|
+
project: IProject;
|
|
39
|
+
sheet: import("@theatre/core").ISheet;
|
|
40
|
+
sequence: SequenceController;
|
|
41
|
+
}, string>;
|
|
42
|
+
type Sheet = InstanceType<typeof Sheet>;
|
|
43
|
+
export default Sheet;
|
|
@@ -5,8 +5,8 @@ export declare function createSheetObjectAction<Props extends UnknownShorthandCo
|
|
|
5
5
|
props: Props;
|
|
6
6
|
callback: (node: T, props: PropsValue<Props>) => void;
|
|
7
7
|
options?: {
|
|
8
|
-
reconfigure?: boolean
|
|
9
|
-
}
|
|
8
|
+
reconfigure?: boolean;
|
|
9
|
+
};
|
|
10
10
|
}) => {
|
|
11
11
|
destroy(): void;
|
|
12
12
|
};
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
- Creating namespaces
|
|
4
4
|
- Potentially Providing a sheet object
|
|
5
5
|
-->
|
|
6
|
-
<script
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<script
|
|
7
|
+
lang="ts"
|
|
8
|
+
generics="Props extends UnknownShorthandCompoundProps"
|
|
9
|
+
>import { useStudio } from '../studio/useStudio';
|
|
10
|
+
import { currentWritable, useThrelte, watch } from '@threlte/core';
|
|
11
|
+
import { getContext, onDestroy, onMount } from 'svelte';
|
|
9
12
|
import Declare from './declare/Declare.svelte';
|
|
10
13
|
import Sync from './sync/Sync.svelte';
|
|
11
14
|
import Transform from './transform/Transform.svelte';
|
|
12
|
-
|
|
15
|
+
import { createSheetContext } from './useSheet';
|
|
16
|
+
let { key, detach = false, props, selected = $bindable(false), onchange, children } = $props();
|
|
13
17
|
const { invalidate } = useThrelte();
|
|
14
18
|
let aggregatedProps = { ...props };
|
|
15
19
|
const { sheet } = getContext('theatre-sheet');
|
|
@@ -21,7 +25,7 @@ onMount(() => {
|
|
|
21
25
|
// values change, we're emitting the initial value here. Doing this in
|
|
22
26
|
// onMount also means that child components which might add props to the
|
|
23
27
|
// sheet object have already been mounted.
|
|
24
|
-
|
|
28
|
+
onchange?.(sheetObject.current.value);
|
|
25
29
|
});
|
|
26
30
|
// This flag is used to prevent the sheet object from being created after it
|
|
27
31
|
// has been detached.
|
|
@@ -69,15 +73,15 @@ const removeProps = (propNames) => {
|
|
|
69
73
|
updateSheetObject();
|
|
70
74
|
}
|
|
71
75
|
};
|
|
72
|
-
|
|
76
|
+
createSheetContext({
|
|
73
77
|
sheetObject,
|
|
74
78
|
addProps,
|
|
75
79
|
removeProps
|
|
76
80
|
});
|
|
77
|
-
let values = $sheetObject?.value;
|
|
81
|
+
let values = $state($sheetObject?.value);
|
|
78
82
|
watch(sheetObject, (sheetObject) => {
|
|
79
83
|
return sheetObject.onValuesChange((newValues) => {
|
|
80
|
-
|
|
84
|
+
onchange?.(newValues);
|
|
81
85
|
values = newValues;
|
|
82
86
|
// this invalidation also invalidates changes catched by slotted
|
|
83
87
|
// components such as <Sync> or <Declare>.
|
|
@@ -104,13 +108,13 @@ const deselect = () => {
|
|
|
104
108
|
};
|
|
105
109
|
</script>
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
sheetObject
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
{@render children?.({
|
|
112
|
+
values,
|
|
113
|
+
selected,
|
|
114
|
+
select,
|
|
115
|
+
deselect,
|
|
116
|
+
sheetObject: $sheetObject,
|
|
117
|
+
Sync,
|
|
118
|
+
Transform,
|
|
119
|
+
Declare
|
|
120
|
+
})}
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
selected: boolean
|
|
21
|
-
select: () => void
|
|
22
|
-
deselect: () => void
|
|
23
|
-
sheetObject: ISheetObject<T>
|
|
24
|
-
Sync: typeof Sync
|
|
25
|
-
Transform: typeof Transform
|
|
26
|
-
Declare: typeof Declare
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
> {}
|
|
1
|
+
import type { UnknownShorthandCompoundProps } from '@theatre/core';
|
|
2
|
+
import type { SheetObjectProps } from './types';
|
|
3
|
+
declare class __sveltets_Render<Props extends UnknownShorthandCompoundProps> {
|
|
4
|
+
props(): SheetObjectProps<Props>;
|
|
5
|
+
events(): {};
|
|
6
|
+
slots(): {};
|
|
7
|
+
bindings(): "selected";
|
|
8
|
+
exports(): {};
|
|
9
|
+
}
|
|
10
|
+
interface $$IsomorphicComponent {
|
|
11
|
+
new <Props extends UnknownShorthandCompoundProps>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Props>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Props>['props']>, ReturnType<__sveltets_Render<Props>['events']>, ReturnType<__sveltets_Render<Props>['slots']>> & {
|
|
12
|
+
$$bindings?: ReturnType<__sveltets_Render<Props>['bindings']>;
|
|
13
|
+
} & ReturnType<__sveltets_Render<Props>['exports']>;
|
|
14
|
+
<Props extends UnknownShorthandCompoundProps>(internal: unknown, props: ReturnType<__sveltets_Render<Props>['props']> & {}): ReturnType<__sveltets_Render<Props>['exports']>;
|
|
15
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
16
|
+
}
|
|
17
|
+
declare const SheetObject: $$IsomorphicComponent;
|
|
18
|
+
type SheetObject<Props extends UnknownShorthandCompoundProps> = InstanceType<typeof SheetObject<Props>>;
|
|
19
|
+
export default SheetObject;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="P extends UnknownShorthandCompoundProps"
|
|
4
|
+
>import { watch } from '@threlte/core';
|
|
5
|
+
import { onDestroy } from 'svelte';
|
|
6
|
+
import { useSheet } from '../useSheet';
|
|
7
|
+
let { props, children } = $props();
|
|
8
|
+
const { sheetObject, addProps, removeProps } = useSheet();
|
|
9
|
+
let values = $state($sheetObject?.value);
|
|
6
10
|
addProps(props);
|
|
7
11
|
onDestroy(() => {
|
|
8
12
|
removeProps(Object.keys(props));
|
|
@@ -14,4 +18,4 @@ watch(sheetObject, (sheetObject) => {
|
|
|
14
18
|
});
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
{@render children?.({ values })}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
> {}
|
|
1
|
+
import type { UnknownShorthandCompoundProps } from '@theatre/core';
|
|
2
|
+
import type { DeclareProps } from './types';
|
|
3
|
+
declare class __sveltets_Render<P extends UnknownShorthandCompoundProps> {
|
|
4
|
+
props(): DeclareProps<P>;
|
|
5
|
+
events(): {};
|
|
6
|
+
slots(): {};
|
|
7
|
+
bindings(): "";
|
|
8
|
+
exports(): {};
|
|
9
|
+
}
|
|
10
|
+
interface $$IsomorphicComponent {
|
|
11
|
+
new <P extends UnknownShorthandCompoundProps>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<P>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<P>['props']>, ReturnType<__sveltets_Render<P>['events']>, ReturnType<__sveltets_Render<P>['slots']>> & {
|
|
12
|
+
$$bindings?: ReturnType<__sveltets_Render<P>['bindings']>;
|
|
13
|
+
} & ReturnType<__sveltets_Render<P>['exports']>;
|
|
14
|
+
<P extends UnknownShorthandCompoundProps>(internal: unknown, props: ReturnType<__sveltets_Render<P>['props']> & {}): ReturnType<__sveltets_Render<P>['exports']>;
|
|
15
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
16
|
+
}
|
|
17
|
+
declare const Declare: $$IsomorphicComponent;
|
|
18
|
+
type Declare<P extends UnknownShorthandCompoundProps> = InstanceType<typeof Declare<P>>;
|
|
19
|
+
export default Declare;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ISheetObject, UnknownShorthandCompoundProps } from '@theatre/core';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export type DeclareProps<T extends UnknownShorthandCompoundProps> = {
|
|
4
|
+
props: T;
|
|
5
|
+
children?: Snippet<[{
|
|
6
|
+
values: ISheetObject<T>['value'];
|
|
7
|
+
}]>;
|
|
8
|
+
};
|
|
9
|
+
export type Values<T> = T extends UnknownShorthandCompoundProps ? ISheetObject<T>['value'] : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="Type"
|
|
4
|
+
>import { resolvePropertyPath, useParent, watch } from '@threlte/core';
|
|
5
|
+
import { onDestroy } from 'svelte';
|
|
6
|
+
import { useStudio } from '../../studio/useStudio';
|
|
7
|
+
import { useSheet } from '../useSheet';
|
|
3
8
|
import { getInitialValue } from './utils/getInitialValue';
|
|
4
9
|
import { isComplexProp } from './utils/isComplexProp';
|
|
10
|
+
import { isStringProp } from './utils/isStringProp';
|
|
5
11
|
import { makeAlphanumeric } from './utils/makeAlphanumeric';
|
|
6
12
|
import { parsePropLabel } from './utils/parsePropLabel';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// used for type hinting auto props
|
|
10
|
-
export let type = undefined;
|
|
11
|
-
const { sheetObject, addProps, removeProps } = getContext('threlte-theater-sheet-context');
|
|
13
|
+
let { type, children, ...rest } = $props();
|
|
14
|
+
const { sheetObject, addProps, removeProps } = useSheet();
|
|
12
15
|
const parent = useParent();
|
|
13
16
|
// serves as a map to map (custom) prop names to object target properties
|
|
14
17
|
let propMappings = {};
|
|
15
18
|
const initProps = () => {
|
|
16
19
|
const props = {};
|
|
17
20
|
// propertyPath is for example "position.x" or "intensity", so a property path on the parent object
|
|
18
|
-
Object.entries(
|
|
21
|
+
Object.entries(rest).forEach(([propertyPath, propertyValue]) => {
|
|
19
22
|
// The prop might have a custom name, for example "intensity" might be mapped to "light-intensity"
|
|
20
23
|
const customKey = isComplexProp(propertyValue)
|
|
21
24
|
? propertyValue.key
|
|
@@ -73,6 +76,9 @@ watch([parent, sheetObject], ([parent, sheetObject]) => {
|
|
|
73
76
|
});
|
|
74
77
|
initProps();
|
|
75
78
|
const studio = useStudio();
|
|
79
|
+
/**
|
|
80
|
+
* Capture the current values of the props
|
|
81
|
+
*/
|
|
76
82
|
export const capture = () => {
|
|
77
83
|
if (!$studio)
|
|
78
84
|
return;
|
|
@@ -96,4 +102,4 @@ onDestroy(() => {
|
|
|
96
102
|
});
|
|
97
103
|
</script>
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
{@render children?.({ capture })}
|
|
@@ -1,71 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
| 'id'
|
|
13
|
-
| 'children'
|
|
14
|
-
| `is${string}` // isMesh, isObject3D, etc
|
|
15
|
-
| 'parent'
|
|
16
|
-
| 'uuid'
|
|
17
|
-
| 'name'
|
|
18
|
-
type AnyClass = new (...args: any) => any
|
|
19
|
-
type AnyFn = (...args: any) => any
|
|
20
|
-
type MaybeInstance<Type extends any> = Type extends AnyClass ? InstanceType<Type> : Type
|
|
21
|
-
type InstanceProps<Type extends any> = Partial<
|
|
22
|
-
Omit<
|
|
23
|
-
MaybeInstance<Type> extends Primitive
|
|
24
|
-
? Record<string, unknown>
|
|
25
|
-
: {
|
|
26
|
-
[K in keyof MaybeInstance<Type>]?: MaybeInstance<Type>[K] extends {
|
|
27
|
-
set: (...args: any[]) => any
|
|
28
|
-
}
|
|
29
|
-
?
|
|
30
|
-
| Parameters<MaybeInstance<Type>[K]['set']>
|
|
31
|
-
| Parameters<MaybeInstance<Type>[K]['set']>[0]
|
|
32
|
-
: MaybeInstance<Type>[K] extends AnyFn
|
|
33
|
-
? never
|
|
34
|
-
: MaybeInstance<Type>[K]
|
|
35
|
-
},
|
|
36
|
-
ConditionalKeys<MaybeInstance<Type>, AnyFn> | OmittedPropKeys
|
|
37
|
-
>
|
|
38
|
-
>
|
|
39
|
-
/* COPIED FROM @threlte/core END */
|
|
40
|
-
|
|
41
|
-
type ObjectProp<T> = {
|
|
42
|
-
type?: T
|
|
1
|
+
import type { SyncProps } from './types';
|
|
2
|
+
declare class __sveltets_Render<Type> {
|
|
3
|
+
props(): SyncProps<Type>;
|
|
4
|
+
events(): {};
|
|
5
|
+
slots(): {};
|
|
6
|
+
bindings(): "";
|
|
7
|
+
exports(): {
|
|
8
|
+
/**
|
|
9
|
+
* Capture the current values of the props
|
|
10
|
+
*/ capture: () => void;
|
|
11
|
+
};
|
|
43
12
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
13
|
+
interface $$IsomorphicComponent {
|
|
14
|
+
new <Type>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Type>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Type>['props']>, ReturnType<__sveltets_Render<Type>['events']>, ReturnType<__sveltets_Render<Type>['slots']>> & {
|
|
15
|
+
$$bindings?: ReturnType<__sveltets_Render<Type>['bindings']>;
|
|
16
|
+
} & ReturnType<__sveltets_Render<Type>['exports']>;
|
|
17
|
+
<Type>(internal: unknown, props: ReturnType<__sveltets_Render<Type>['props']> & {}): ReturnType<__sveltets_Render<Type>['exports']>;
|
|
18
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
49
19
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
type AnyProps<T> = {
|
|
54
|
-
[P in keyof InstanceProps<T>]?: AnyProp
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
type AllProps<T> = AnyProps<T> &
|
|
58
|
-
ObjectProp<T> &
|
|
59
|
-
Record<string, AnyProp | T> & {
|
|
60
|
-
capture?: () => void
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export default class Sync<T> extends SvelteComponent<
|
|
64
|
-
AllProps<T>,
|
|
65
|
-
Record<string, any>,
|
|
66
|
-
{
|
|
67
|
-
default: {
|
|
68
|
-
capture: () => void
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
> {}
|
|
20
|
+
declare const Sync: $$IsomorphicComponent;
|
|
21
|
+
type Sync<Type> = InstanceType<typeof Sync<Type>>;
|
|
22
|
+
export default Sync;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ConditionalKeys, Primitive } from 'type-fest';
|
|
3
|
+
import type { Transformer } from '../transfomers/types';
|
|
4
|
+
type OmittedPropKeys = 'type' | 'args' | 'attach' | 'manual' | 'makeDefault' | 'id' | 'children' | `is${string}` | 'parent' | 'uuid' | 'name';
|
|
5
|
+
type AnyClass = new (...args: any) => any;
|
|
6
|
+
type AnyFn = (...args: any) => any;
|
|
7
|
+
type MaybeInstance<Type extends any> = Type extends AnyClass ? InstanceType<Type> : Type;
|
|
8
|
+
type InstanceProps<Type extends any> = Partial<Omit<MaybeInstance<Type> extends Primitive ? Record<string, unknown> : {
|
|
9
|
+
[K in keyof MaybeInstance<Type>]?: MaybeInstance<Type>[K] extends {
|
|
10
|
+
set: (...args: any[]) => any;
|
|
11
|
+
} ? Parameters<MaybeInstance<Type>[K]['set']> | Parameters<MaybeInstance<Type>[K]['set']>[0] : MaybeInstance<Type>[K] extends AnyFn ? never : MaybeInstance<Type>[K];
|
|
12
|
+
}, ConditionalKeys<MaybeInstance<Type>, AnyFn> | OmittedPropKeys>>;
|
|
13
|
+
type ObjectProp<T> = {
|
|
14
|
+
type?: T;
|
|
15
|
+
};
|
|
16
|
+
export type ComplexProp = {
|
|
17
|
+
transformer?: Transformer;
|
|
18
|
+
label?: string;
|
|
19
|
+
key?: string;
|
|
20
|
+
};
|
|
21
|
+
export type AnyProp = string | boolean | ComplexProp;
|
|
22
|
+
type AnyProps<T> = {
|
|
23
|
+
[P in keyof InstanceProps<T>]?: AnyProp;
|
|
24
|
+
};
|
|
25
|
+
export type SyncProps<T> = AnyProps<T> & ObjectProp<T> & Record<string, AnyProp | T> & {
|
|
26
|
+
children?: Snippet<[{
|
|
27
|
+
capture: () => void;
|
|
28
|
+
}]>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AnyProp, ComplexProp } from '../
|
|
1
|
+
import type { AnyProp, ComplexProp } from '../types';
|
|
2
2
|
export declare const isComplexProp: (prop: AnyProp) => prop is ComplexProp;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AnyProp } from '../
|
|
1
|
+
import type { AnyProp } from '../types';
|
|
2
2
|
export declare const isStringProp: (prop: AnyProp) => prop is string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AnyProp } from '../
|
|
1
|
+
import type { AnyProp } from '../types';
|
|
2
2
|
export declare const parsePropLabel: (alphaNumericKey: string, propValue: AnyProp) => string;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="Label extends string | undefined"
|
|
4
|
+
>import { T, watch } from '@threlte/core';
|
|
3
5
|
import { TransformControls } from '@threlte/extras';
|
|
4
|
-
import { onMount
|
|
6
|
+
import { onMount } from 'svelte';
|
|
5
7
|
import { Group } from 'three';
|
|
6
8
|
import { RAD2DEG } from 'three/src/math/MathUtils.js';
|
|
7
9
|
import { useStudio } from '../../studio/useStudio';
|
|
10
|
+
import { types } from '../../theatre';
|
|
8
11
|
import { getDefaultTransformer } from '../transfomers/getDefaultTransformer';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
controls.setScaleSnap(null);
|
|
12
|
+
import { useSheet } from '../useSheet';
|
|
13
|
+
let { label, key, mode = 'translate', space, translationSnap, rotationSnap, scaleSnap, children } = $props();
|
|
14
|
+
const { sheetObject, addProps, removeProps } = useSheet();
|
|
15
|
+
let controls = $state(undefined);
|
|
16
|
+
$effect.pre(() => {
|
|
17
|
+
if (controls) {
|
|
18
|
+
if (translationSnap) {
|
|
19
|
+
controls.setTranslationSnap(translationSnap);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
controls.setTranslationSnap(null);
|
|
23
|
+
}
|
|
24
|
+
if (rotationSnap) {
|
|
25
|
+
controls.setRotationSnap(rotationSnap);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
controls.setRotationSnap(null);
|
|
29
|
+
}
|
|
30
|
+
if (scaleSnap) {
|
|
31
|
+
controls.setScaleSnap(scaleSnap);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
controls.setScaleSnap(null);
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
});
|
|
38
38
|
const group = new Group();
|
|
39
39
|
const positionTransformer = getDefaultTransformer(group, 'position', 'position');
|
|
40
40
|
const rotationTransformer = getDefaultTransformer(group, 'rotation', 'rotation');
|
|
@@ -90,7 +90,7 @@ onMount(() => {
|
|
|
90
90
|
});
|
|
91
91
|
const studio = useStudio();
|
|
92
92
|
let scrub;
|
|
93
|
-
let isSelected = false;
|
|
93
|
+
let isSelected = $state(false);
|
|
94
94
|
watch([studio], ([studio]) => {
|
|
95
95
|
return studio?.onSelectionChange((selection) => {
|
|
96
96
|
if (!$sheetObject)
|
|
@@ -141,11 +141,11 @@ const groupRef = group;
|
|
|
141
141
|
{mode}
|
|
142
142
|
{space}
|
|
143
143
|
bind:controls
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
onmouseDown={onMouseDown}
|
|
145
|
+
onobjectChange={onChange}
|
|
146
|
+
onmouseUp={onMouseUp}
|
|
147
147
|
/>
|
|
148
148
|
{/if}
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
{@render children?.()}
|
|
151
151
|
</T>
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Record<string, unknown>
|
|
20
|
-
> {}
|
|
1
|
+
import type { TransformProps } from './types';
|
|
2
|
+
declare class __sveltets_Render<Label extends string | undefined> {
|
|
3
|
+
props(): TransformProps<Label>;
|
|
4
|
+
events(): {};
|
|
5
|
+
slots(): {};
|
|
6
|
+
bindings(): "";
|
|
7
|
+
exports(): {};
|
|
8
|
+
}
|
|
9
|
+
interface $$IsomorphicComponent {
|
|
10
|
+
new <Label extends string | undefined>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Label>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Label>['props']>, ReturnType<__sveltets_Render<Label>['events']>, ReturnType<__sveltets_Render<Label>['slots']>> & {
|
|
11
|
+
$$bindings?: ReturnType<__sveltets_Render<Label>['bindings']>;
|
|
12
|
+
} & ReturnType<__sveltets_Render<Label>['exports']>;
|
|
13
|
+
<Label extends string | undefined>(internal: unknown, props: ReturnType<__sveltets_Render<Label>['props']> & {}): ReturnType<__sveltets_Render<Label>['exports']>;
|
|
14
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
15
|
+
}
|
|
16
|
+
declare const Transform: $$IsomorphicComponent;
|
|
17
|
+
type Transform<Label extends string | undefined> = InstanceType<typeof Transform<Label>>;
|
|
18
|
+
export default Transform;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type TransformProps<T extends string | undefined> = {
|
|
3
|
+
label?: T;
|
|
4
|
+
mode?: 'translate' | 'rotate' | 'scale';
|
|
5
|
+
translationSnap?: number;
|
|
6
|
+
rotationSnap?: number;
|
|
7
|
+
scaleSnap?: number;
|
|
8
|
+
space?: 'world' | 'local';
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
} & (T extends string ? {
|
|
11
|
+
key: string;
|
|
12
|
+
} : {
|
|
13
|
+
key?: string;
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ISheetObject, UnknownShorthandCompoundProps } from '@theatre/core';
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
|
+
import type Declare from './declare/Declare.svelte';
|
|
4
|
+
import type Sync from './sync/Sync.svelte';
|
|
5
|
+
import type Transform from './transform/Transform.svelte';
|
|
6
|
+
export type SheetObjectProps<T extends UnknownShorthandCompoundProps> = {
|
|
7
|
+
key: string;
|
|
8
|
+
detach?: boolean;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
props?: T;
|
|
11
|
+
children?: Snippet<[
|
|
12
|
+
{
|
|
13
|
+
values: ISheetObject['value'];
|
|
14
|
+
selected: boolean;
|
|
15
|
+
select: () => void;
|
|
16
|
+
deselect: () => void;
|
|
17
|
+
sheetObject: ISheetObject<T>;
|
|
18
|
+
Sync: typeof Sync;
|
|
19
|
+
Transform: typeof Transform;
|
|
20
|
+
Declare: typeof Declare;
|
|
21
|
+
}
|
|
22
|
+
]>;
|
|
23
|
+
onchange?: (sheet: ISheetObject<T>['value']) => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ISheetObject, UnknownShorthandCompoundProps } from '@theatre/core';
|
|
2
|
+
import type { CurrentWritable } from '@threlte/core';
|
|
3
|
+
type Context<T extends UnknownShorthandCompoundProps = {}> = {
|
|
4
|
+
sheetObject: CurrentWritable<ISheetObject<T>>;
|
|
5
|
+
addProps: (props: UnknownShorthandCompoundProps) => void;
|
|
6
|
+
removeProps: (names: string[]) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const createSheetContext: (context: Context) => void;
|
|
9
|
+
export declare const useSheet: <T extends UnknownShorthandCompoundProps = {}>() => Context<T>;
|
|
10
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script
|
|
2
|
-
|
|
2
|
+
lang="ts"
|
|
3
3
|
context="module"
|
|
4
4
|
>import Studio from '@theatre/studio';
|
|
5
5
|
import { studio } from '../consts';
|
|
@@ -7,7 +7,7 @@ Studio.initialize();
|
|
|
7
7
|
studio.set(Studio);
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<script>import { watch } from '@threlte/core';
|
|
10
|
+
<script lang="ts">import { watch } from '@threlte/core';
|
|
11
11
|
import { writable } from 'svelte/store';
|
|
12
12
|
export let hide;
|
|
13
13
|
const hideStore = writable(hide);
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type InnerStudioProps = typeof __propDef.props;
|
|
14
|
-
export type InnerStudioEvents = typeof __propDef.events;
|
|
15
|
-
export type InnerStudioSlots = typeof __propDef.slots;
|
|
16
|
-
export default class InnerStudio extends SvelteComponent<InnerStudioProps, InnerStudioEvents, InnerStudioSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
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<{
|
|
20
|
+
hide: boolean;
|
|
21
|
+
}, {
|
|
22
|
+
default: {};
|
|
23
|
+
}>, {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}, {}, string>;
|
|
28
|
+
type InnerStudio = InstanceType<typeof InnerStudio>;
|
|
29
|
+
export default InnerStudio;
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type StudioProps = typeof __propDef.props;
|
|
15
|
-
export type StudioEvents = typeof __propDef.events;
|
|
16
|
-
export type StudioSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Studio extends SvelteComponent<StudioProps, StudioEvents, StudioSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
18
13
|
}
|
|
19
|
-
|
|
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<{
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
hide?: boolean;
|
|
22
|
+
}, {
|
|
23
|
+
default: {};
|
|
24
|
+
}>, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}, {}, string>;
|
|
29
|
+
type Studio = InstanceType<typeof Studio>;
|
|
30
|
+
export default Studio;
|
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { IProjectConfig } from '@theatre/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
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;
|
|
10
12
|
};
|
|
11
|
-
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type TheatreProps = typeof __propDef.props;
|
|
19
|
-
export type TheatreEvents = typeof __propDef.events;
|
|
20
|
-
export type TheatreSlots = typeof __propDef.slots;
|
|
21
|
-
export default class Theatre extends SvelteComponent<TheatreProps, TheatreEvents, TheatreSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
22
14
|
}
|
|
23
|
-
|
|
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<{
|
|
21
|
+
studio?: {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
hide?: boolean;
|
|
24
|
+
};
|
|
25
|
+
config?: IProjectConfig | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}>, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {};
|
|
32
|
+
}, {}, string>;
|
|
33
|
+
type Theatre = InstanceType<typeof Theatre>;
|
|
34
|
+
export default Theatre;
|
package/package.json
CHANGED
|
@@ -1,46 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/theatre",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.10",
|
|
4
4
|
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"description": "Threlte Components for Theatre, an animation library with a professional motion design toolset",
|
|
6
7
|
"devDependencies": {
|
|
7
|
-
"@sveltejs/adapter-auto": "^3.
|
|
8
|
-
"@sveltejs/kit": "^2.
|
|
9
|
-
"@sveltejs/package": "^2.
|
|
10
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
11
|
-
"@types/node": "^20.
|
|
12
|
-
"@types/three": "^0.
|
|
13
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
14
|
-
"@typescript-eslint/parser": "^6.
|
|
8
|
+
"@sveltejs/adapter-auto": "^3.3.1",
|
|
9
|
+
"@sveltejs/kit": "^2.7.7",
|
|
10
|
+
"@sveltejs/package": "^2.3.7",
|
|
11
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
12
|
+
"@types/node": "^20.12.7",
|
|
13
|
+
"@types/three": "^0.169.0",
|
|
14
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
15
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
15
16
|
"@yushijinhun/three-minifier-rollup": "^0.4.0",
|
|
16
|
-
"eslint": "^
|
|
17
|
+
"eslint": "^9.0.0",
|
|
17
18
|
"eslint-config-prettier": "^9.1.0",
|
|
18
|
-
"eslint-plugin-svelte": "^2.
|
|
19
|
-
"prettier": "^3.2.
|
|
20
|
-
"prettier-plugin-svelte": "^3.
|
|
19
|
+
"eslint-plugin-svelte": "^2.36.0",
|
|
20
|
+
"prettier": "^3.2.5",
|
|
21
|
+
"prettier-plugin-svelte": "^3.2.2",
|
|
21
22
|
"publint": "^0.2.7",
|
|
22
23
|
"rimraf": "^5.0.5",
|
|
23
|
-
"svelte": "^
|
|
24
|
-
"svelte-check": "^3.6.
|
|
24
|
+
"svelte": "^5.1.10",
|
|
25
|
+
"svelte-check": "^3.6.9",
|
|
25
26
|
"svelte-preprocess": "^5.1.3",
|
|
26
|
-
"svelte2tsx": "^0.7.
|
|
27
|
-
"three": "^0.
|
|
27
|
+
"svelte2tsx": "^0.7.6",
|
|
28
|
+
"three": "^0.170.0",
|
|
28
29
|
"tslib": "^2.6.2",
|
|
29
|
-
"type-fest": "^4.
|
|
30
|
-
"typescript": "^5.
|
|
31
|
-
"vite": "^5.
|
|
32
|
-
"@threlte/core": "8.0.0-next.
|
|
33
|
-
"@threlte/extras": "9.0.0-next.
|
|
30
|
+
"type-fest": "^4.15.0",
|
|
31
|
+
"typescript": "^5.6.3",
|
|
32
|
+
"vite": "^5.2.8",
|
|
33
|
+
"@threlte/core": "8.0.0-next.33",
|
|
34
|
+
"@threlte/extras": "9.0.0-next.44"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"svelte": ">=4",
|
|
37
|
-
"three": ">=0.
|
|
38
|
+
"three": ">=0.155",
|
|
38
39
|
"@threlte/core": ">=8.0.0-next.0",
|
|
39
40
|
"@threlte/extras": ">=9.0.0-next.0",
|
|
40
41
|
"@theatre/core": ">=0.6",
|
|
41
42
|
"@theatre/studio": ">=0.6"
|
|
42
43
|
},
|
|
43
44
|
"type": "module",
|
|
45
|
+
"keywords": [
|
|
46
|
+
"theatre",
|
|
47
|
+
"threlte",
|
|
48
|
+
"svelte",
|
|
49
|
+
"three",
|
|
50
|
+
"three.js",
|
|
51
|
+
"3d",
|
|
52
|
+
"animation",
|
|
53
|
+
"motion"
|
|
54
|
+
],
|
|
55
|
+
"homepage": "https://threlte.xyz",
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "https://github.com/threlte/threlte.git",
|
|
59
|
+
"directory": "packages/theatre"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/threlte/threlte/issues"
|
|
63
|
+
},
|
|
44
64
|
"exports": {
|
|
45
65
|
".": {
|
|
46
66
|
"types": "./dist/index.d.ts",
|
|
@@ -57,8 +77,8 @@
|
|
|
57
77
|
"package": "svelte-kit sync && svelte-package && node ./scripts/cleanupPackage.js && publint",
|
|
58
78
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
59
79
|
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
60
|
-
"lint": "prettier --check
|
|
61
|
-
"format": "prettier --write
|
|
80
|
+
"lint": "prettier --check .",
|
|
81
|
+
"format": "prettier --write .",
|
|
62
82
|
"cleanup": "rimraf node_modules .svelte-kit dist"
|
|
63
83
|
}
|
|
64
84
|
}
|