@encorejs/r3f 1.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.
- package/LICENSE +203 -0
- package/README.md +104 -0
- package/dist/drei/OrthographicCamera.d.ts +13 -0
- package/dist/drei/OrthographicCamera.d.ts.map +1 -0
- package/dist/drei/PerspectiveCamera.d.ts +13 -0
- package/dist/drei/PerspectiveCamera.d.ts.map +1 -0
- package/dist/drei/index.d.ts +3 -0
- package/dist/drei/index.d.ts.map +1 -0
- package/dist/extension/InfiniteGridHelper/index.d.ts +12 -0
- package/dist/extension/InfiniteGridHelper/index.d.ts.map +1 -0
- package/dist/extension/components/DragDetector.d.ts +8 -0
- package/dist/extension/components/DragDetector.d.ts.map +1 -0
- package/dist/extension/components/EditableProxy.d.ts +9 -0
- package/dist/extension/components/EditableProxy.d.ts.map +1 -0
- package/dist/extension/components/OrbitControls/OrbitControlsImpl.d.ts +69 -0
- package/dist/extension/components/OrbitControls/OrbitControlsImpl.d.ts.map +1 -0
- package/dist/extension/components/OrbitControls/index.d.ts +23 -0
- package/dist/extension/components/OrbitControls/index.d.ts.map +1 -0
- package/dist/extension/components/ProxyManager.d.ts +9 -0
- package/dist/extension/components/ProxyManager.d.ts.map +1 -0
- package/dist/extension/components/ReferenceWindow/ReferenceWindow.d.ts +10 -0
- package/dist/extension/components/ReferenceWindow/ReferenceWindow.d.ts.map +1 -0
- package/dist/extension/components/ReferenceWindow/noiseImage.d.ts +3 -0
- package/dist/extension/components/ReferenceWindow/noiseImage.d.ts.map +1 -0
- package/dist/extension/components/SnapshotEditor.d.ts +6 -0
- package/dist/extension/components/SnapshotEditor.d.ts.map +1 -0
- package/dist/extension/components/TransformControls.d.ts +23 -0
- package/dist/extension/components/TransformControls.d.ts.map +1 -0
- package/dist/extension/components/useRefAndState.d.ts +18 -0
- package/dist/extension/components/useRefAndState.d.ts.map +1 -0
- package/dist/extension/components/useSelected.d.ts +3 -0
- package/dist/extension/components/useSelected.d.ts.map +1 -0
- package/dist/extension/components/useSnapshotEditorCamera.d.ts +9 -0
- package/dist/extension/components/useSnapshotEditorCamera.d.ts.map +1 -0
- package/dist/extension/editorStuff.d.ts +18 -0
- package/dist/extension/editorStuff.d.ts.map +1 -0
- package/dist/extension/icons.d.ts +13 -0
- package/dist/extension/icons.d.ts.map +1 -0
- package/dist/extension/index.d.ts +4 -0
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.esm.js +33733 -0
- package/dist/extension/index.esm.js.map +7 -0
- package/dist/extension/index.js +33701 -0
- package/dist/extension/index.js.map +7 -0
- package/dist/extension/useExtensionStore.d.ts +3 -0
- package/dist/extension/useExtensionStore.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +782 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +780 -0
- package/dist/index.js.map +7 -0
- package/dist/main/RafDriverProvider.d.ts +10 -0
- package/dist/main/RafDriverProvider.d.ts.map +1 -0
- package/dist/main/RefreshSnapshot.d.ts +19 -0
- package/dist/main/RefreshSnapshot.d.ts.map +1 -0
- package/dist/main/SheetProvider.d.ts +10 -0
- package/dist/main/SheetProvider.d.ts.map +1 -0
- package/dist/main/defaultEditableFactoryConfig.d.ts +579 -0
- package/dist/main/defaultEditableFactoryConfig.d.ts.map +1 -0
- package/dist/main/editable.d.ts +118 -0
- package/dist/main/editable.d.ts.map +1 -0
- package/dist/main/editableFactoryConfigUtils.d.ts +59 -0
- package/dist/main/editableFactoryConfigUtils.d.ts.map +1 -0
- package/dist/main/store.d.ts +46 -0
- package/dist/main/store.d.ts.map +1 -0
- package/dist/main/useInvalidate.d.ts +2 -0
- package/dist/main/useInvalidate.d.ts.map +1 -0
- package/dist/main/utils.d.ts +4 -0
- package/dist/main/utils.d.ts.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { ComponentType, Ref } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ThreeElements } from '@react-three/fiber';
|
|
4
|
+
import type { $FixMe } from '../types';
|
|
5
|
+
declare const editable: (<T extends keyof ThreeElements | ComponentType<any>, U extends "spotLight" | "orthographicCamera" | "perspectiveCamera" | "ambientLight" | "directionalLight" | "hemisphereLight" | "pointLight" | "group" | "lineLoop" | "lineSegments" | "mesh" | "points" | "fog" | "threeLine">(Component: T, type: T extends "primitive" ? null : U) => React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>) & {
|
|
6
|
+
spotLight: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").SpotLight, import("@react-three/fiber").MathProps<import("three").SpotLight> & import("@react-three/fiber").ReactProps<import("three").SpotLight> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").SpotLight, typeof import("three").SpotLight>, "object">>>, "visible"> & {
|
|
7
|
+
theatreKey: string;
|
|
8
|
+
visible?: boolean | "editor" | undefined;
|
|
9
|
+
additionalProps?: $FixMe;
|
|
10
|
+
objRef?: $FixMe;
|
|
11
|
+
ref?: Ref<unknown> | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
orthographicCamera: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").OrthographicCamera, import("@react-three/fiber").MathProps<import("three").OrthographicCamera> & import("@react-three/fiber").ReactProps<import("three").OrthographicCamera> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").OrthographicCamera, typeof import("three").OrthographicCamera>, "object">>>, "visible"> & {
|
|
14
|
+
theatreKey: string;
|
|
15
|
+
visible?: boolean | "editor" | undefined;
|
|
16
|
+
additionalProps?: $FixMe;
|
|
17
|
+
objRef?: $FixMe;
|
|
18
|
+
ref?: Ref<unknown> | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
perspectiveCamera: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").PerspectiveCamera, import("@react-three/fiber").MathProps<import("three").PerspectiveCamera> & import("@react-three/fiber").ReactProps<import("three").PerspectiveCamera> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").PerspectiveCamera, typeof import("three").PerspectiveCamera>, "object">>>, "visible"> & {
|
|
21
|
+
theatreKey: string;
|
|
22
|
+
visible?: boolean | "editor" | undefined;
|
|
23
|
+
additionalProps?: $FixMe;
|
|
24
|
+
objRef?: $FixMe;
|
|
25
|
+
ref?: Ref<unknown> | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
ambientLight: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").AmbientLight, import("@react-three/fiber").MathProps<import("three").AmbientLight> & import("@react-three/fiber").ReactProps<import("three").AmbientLight> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").AmbientLight, typeof import("three").AmbientLight>, "object">>>, "visible"> & {
|
|
28
|
+
theatreKey: string;
|
|
29
|
+
visible?: boolean | "editor" | undefined;
|
|
30
|
+
additionalProps?: $FixMe;
|
|
31
|
+
objRef?: $FixMe;
|
|
32
|
+
ref?: Ref<unknown> | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
directionalLight: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").DirectionalLight, import("@react-three/fiber").MathProps<import("three").DirectionalLight> & import("@react-three/fiber").ReactProps<import("three").DirectionalLight> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").DirectionalLight, typeof import("three").DirectionalLight>, "object">>>, "visible"> & {
|
|
35
|
+
theatreKey: string;
|
|
36
|
+
visible?: boolean | "editor" | undefined;
|
|
37
|
+
additionalProps?: $FixMe;
|
|
38
|
+
objRef?: $FixMe;
|
|
39
|
+
ref?: Ref<unknown> | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
hemisphereLight: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").HemisphereLight, import("@react-three/fiber").MathProps<import("three").HemisphereLight> & import("@react-three/fiber").ReactProps<import("three").HemisphereLight> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").HemisphereLight, typeof import("three").HemisphereLight>, "object">>>, "visible"> & {
|
|
42
|
+
theatreKey: string;
|
|
43
|
+
visible?: boolean | "editor" | undefined;
|
|
44
|
+
additionalProps?: $FixMe;
|
|
45
|
+
objRef?: $FixMe;
|
|
46
|
+
ref?: Ref<unknown> | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
pointLight: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").PointLight, import("@react-three/fiber").MathProps<import("three").PointLight> & import("@react-three/fiber").ReactProps<import("three").PointLight> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").PointLight, typeof import("three").PointLight>, "object">>>, "visible"> & {
|
|
49
|
+
theatreKey: string;
|
|
50
|
+
visible?: boolean | "editor" | undefined;
|
|
51
|
+
additionalProps?: $FixMe;
|
|
52
|
+
objRef?: $FixMe;
|
|
53
|
+
ref?: Ref<unknown> | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
group: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").Group<import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").Group<import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").Group<import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").Group<import("three").Object3DEventMap>, typeof import("three").Group>, "object">>>, "visible"> & {
|
|
56
|
+
theatreKey: string;
|
|
57
|
+
visible?: boolean | "editor" | undefined;
|
|
58
|
+
additionalProps?: $FixMe;
|
|
59
|
+
objRef?: $FixMe;
|
|
60
|
+
ref?: Ref<unknown> | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
lineLoop: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").LineLoop<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").LineLoop<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").LineLoop<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").LineLoop<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, typeof import("three").LineLoop>, "object">>>, "visible"> & {
|
|
63
|
+
theatreKey: string;
|
|
64
|
+
visible?: boolean | "editor" | undefined;
|
|
65
|
+
additionalProps?: $FixMe;
|
|
66
|
+
objRef?: $FixMe;
|
|
67
|
+
ref?: Ref<unknown> | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
lineSegments: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").LineSegments<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").LineSegments<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").LineSegments<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").LineSegments<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, typeof import("three").LineSegments>, "object">>>, "visible"> & {
|
|
70
|
+
theatreKey: string;
|
|
71
|
+
visible?: boolean | "editor" | undefined;
|
|
72
|
+
additionalProps?: $FixMe;
|
|
73
|
+
objRef?: $FixMe;
|
|
74
|
+
ref?: Ref<unknown> | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
mesh: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, typeof import("three").Mesh>, "object">>>, "visible"> & {
|
|
77
|
+
theatreKey: string;
|
|
78
|
+
visible?: boolean | "editor" | undefined;
|
|
79
|
+
additionalProps?: $FixMe;
|
|
80
|
+
objRef?: $FixMe;
|
|
81
|
+
ref?: Ref<unknown> | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
points: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").Points<import("three").BufferGeometry<import("three").NormalOrGLBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").Points<import("three").BufferGeometry<import("three").NormalOrGLBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").Points<import("three").BufferGeometry<import("three").NormalOrGLBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").Points<import("three").BufferGeometry<import("three").NormalOrGLBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, typeof import("three").Points>, "object">>>, "visible"> & {
|
|
84
|
+
theatreKey: string;
|
|
85
|
+
visible?: boolean | "editor" | undefined;
|
|
86
|
+
additionalProps?: $FixMe;
|
|
87
|
+
objRef?: $FixMe;
|
|
88
|
+
ref?: Ref<unknown> | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
fog: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").Fog, import("@react-three/fiber").MathProps<import("three").Fog> & import("@react-three/fiber").ReactProps<import("three").Fog>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").Fog, typeof import("three").Fog>, "object">>>, "visible"> & {
|
|
91
|
+
theatreKey: string;
|
|
92
|
+
visible?: boolean | "editor" | undefined;
|
|
93
|
+
additionalProps?: $FixMe;
|
|
94
|
+
objRef?: $FixMe;
|
|
95
|
+
ref?: Ref<unknown> | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
threeLine: React.ForwardRefExoticComponent<Omit<import("@react-three/fiber/dist/declarations/src/core/utils").Mutable<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<Partial<import("@react-three/fiber/dist/declarations/src/core/utils").Overwrite<import("three").Line<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, import("@react-three/fiber").MathProps<import("three").Line<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & import("@react-three/fiber").ReactProps<import("three").Line<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>> & Partial<import("@react-three/fiber").EventHandlers>>>, Omit<import("@react-three/fiber").InstanceProps<import("three").Line<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>, typeof import("three").Line>, "object">>>, "visible"> & {
|
|
98
|
+
theatreKey: string;
|
|
99
|
+
visible?: boolean | "editor" | undefined;
|
|
100
|
+
additionalProps?: $FixMe;
|
|
101
|
+
objRef?: $FixMe;
|
|
102
|
+
ref?: Ref<unknown> | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
} & {
|
|
105
|
+
primitive: React.ForwardRefExoticComponent<{
|
|
106
|
+
object: any;
|
|
107
|
+
theatreKey: string;
|
|
108
|
+
visible?: boolean | "editor" | undefined;
|
|
109
|
+
additionalProps?: $FixMe;
|
|
110
|
+
objRef?: $FixMe;
|
|
111
|
+
editableType: keyof ThreeElements;
|
|
112
|
+
ref?: Ref<unknown> | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
[props: string]: any;
|
|
115
|
+
}>;
|
|
116
|
+
};
|
|
117
|
+
export default editable;
|
|
118
|
+
//# sourceMappingURL=editable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../../src/main/editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,aAAa,EAAE,GAAG,EAAC,MAAM,OAAO,CAAA;AAE7D,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAQrD,OAAO,KAAK,EAAC,MAAM,EAAkB,MAAM,UAAU,CAAA;AA2RrD,QAAA,MAAM,QAAQ;;oBA9BM,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;oBAHH,MAAM;;0BAEA,MAAM;iBACf,MAAM;;;;;gBAQP,GAAG;oBACC,MAAM;;0BAEA,MAAM;iBACf,MAAM;sBACD,MAAM,aAAa;;;;;CAgBxC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { UnknownShorthandCompoundProps } from '@encorejs/core';
|
|
2
|
+
import type { ThreeElements } from '@react-three/fiber';
|
|
3
|
+
import type { Object3D } from 'three';
|
|
4
|
+
import type { IconID } from '../extension/icons';
|
|
5
|
+
import { Color } from 'three';
|
|
6
|
+
export type Helper = Object3D & {
|
|
7
|
+
update?: () => void;
|
|
8
|
+
};
|
|
9
|
+
type PropConfig<T> = {
|
|
10
|
+
parse: (props: Record<string, any>) => T;
|
|
11
|
+
apply: (value: T, object: any) => void;
|
|
12
|
+
type: UnknownShorthandCompoundProps;
|
|
13
|
+
};
|
|
14
|
+
type Props = Record<string, PropConfig<any>>;
|
|
15
|
+
type Meta<T> = {
|
|
16
|
+
useTransformControls: boolean;
|
|
17
|
+
updateObject?: (object: T) => void;
|
|
18
|
+
icon: IconID;
|
|
19
|
+
dimensionless?: boolean;
|
|
20
|
+
createHelper?: (object: T) => Helper;
|
|
21
|
+
};
|
|
22
|
+
export type ObjectConfig<T> = {
|
|
23
|
+
props: Props;
|
|
24
|
+
} & Meta<T>;
|
|
25
|
+
export type EditableFactoryConfig = Partial<Record<keyof ThreeElements, ObjectConfig<any>>>;
|
|
26
|
+
type Vector3 = {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
z: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const createVector: (components?: [number, number, number]) => {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
z: number;
|
|
35
|
+
};
|
|
36
|
+
export declare const createVectorPropConfig: (key: string, defaultValue?: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
z: number;
|
|
40
|
+
}, { nudgeMultiplier }?: {
|
|
41
|
+
nudgeMultiplier?: number | undefined;
|
|
42
|
+
}) => PropConfig<Vector3>;
|
|
43
|
+
export declare const createNumberPropConfig: (key: string, defaultValue?: number, { nudgeMultiplier }?: {
|
|
44
|
+
nudgeMultiplier?: number | undefined;
|
|
45
|
+
}) => PropConfig<number>;
|
|
46
|
+
export type Rgba = {
|
|
47
|
+
r: number;
|
|
48
|
+
g: number;
|
|
49
|
+
b: number;
|
|
50
|
+
a: number;
|
|
51
|
+
};
|
|
52
|
+
export declare const createColorPropConfig: (key: string, defaultValue?: Color) => PropConfig<Rgba>;
|
|
53
|
+
export declare const extendObjectProps: <T extends {
|
|
54
|
+
props: {};
|
|
55
|
+
}>(objectConfig: T, extension: Props) => T & {
|
|
56
|
+
props: {};
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=editableFactoryConfigUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editableFactoryConfigUtils.d.ts","sourceRoot":"","sources":["../../src/main/editableFactoryConfigUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,gBAAgB,CAAA;AAGjE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAA;AAE3B,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AACD,KAAK,UAAU,CAAC,CAAC,IAAI;IACnB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CA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AAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV,CAAA;AAED,eAAO,MAAM,qBAAqB,QAC3B,MAAM,2BAEV,WAAW,IAAI,CAUhB,CAAA;AAEF,eAAO,MAAM,iBAAiB;WAAsB,EAAE;+BAEzC,KAAK;;CAIhB,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Object3D, Scene, WebGLRenderer } from 'three';
|
|
2
|
+
import { Group } from 'three';
|
|
3
|
+
import type { ISheetObject } from '@encorejs/core';
|
|
4
|
+
import type { ObjectConfig } from './editableFactoryConfigUtils';
|
|
5
|
+
export type TransformControlsMode = 'translate' | 'rotate' | 'scale';
|
|
6
|
+
export type TransformControlsSpace = 'world' | 'local';
|
|
7
|
+
export type ViewportShading = 'wireframe' | 'flat' | 'solid' | 'rendered';
|
|
8
|
+
export type BaseSheetObjectType = ISheetObject<any>;
|
|
9
|
+
export declare const allRegisteredObjects: WeakSet<BaseSheetObjectType>;
|
|
10
|
+
export interface Editable<T> {
|
|
11
|
+
type: string;
|
|
12
|
+
sheetObject: ISheetObject<any>;
|
|
13
|
+
objectConfig: ObjectConfig<T>;
|
|
14
|
+
visibleOnlyInEditor: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type EditableSnapshot<T extends Editable<any> = Editable<any>> = {
|
|
17
|
+
proxyObject?: Object3D | null;
|
|
18
|
+
} & T;
|
|
19
|
+
export interface SerializedEditable {
|
|
20
|
+
type: string;
|
|
21
|
+
}
|
|
22
|
+
export interface EditableState {
|
|
23
|
+
editables: Record<string, SerializedEditable>;
|
|
24
|
+
}
|
|
25
|
+
export type EditorStore = {
|
|
26
|
+
scene: Scene | null;
|
|
27
|
+
gl: WebGLRenderer | null;
|
|
28
|
+
helpersRoot: Group;
|
|
29
|
+
editables: Record<string, Editable<any>>;
|
|
30
|
+
canvasName: string;
|
|
31
|
+
sceneSnapshot: Scene | null;
|
|
32
|
+
editablesSnapshot: Record<string, EditableSnapshot> | null;
|
|
33
|
+
init: (scene: Scene, gl: WebGLRenderer) => void;
|
|
34
|
+
addEditable: (theatreKey: string, editable: Editable<any>) => void;
|
|
35
|
+
removeEditable: (theatreKey: string) => void;
|
|
36
|
+
createSnapshot: () => void;
|
|
37
|
+
setSnapshotProxyObject: (proxyObject: Object3D | null, theatreKey: string) => void;
|
|
38
|
+
};
|
|
39
|
+
export declare const editorStore: import("zustand").StoreApi<EditorStore>;
|
|
40
|
+
export type BindFunction = (options: {
|
|
41
|
+
allowImplicitInstancing?: boolean;
|
|
42
|
+
gl: WebGLRenderer;
|
|
43
|
+
scene: Scene;
|
|
44
|
+
}) => void;
|
|
45
|
+
export declare const bindToCanvas: BindFunction;
|
|
46
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/main/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAC,MAAM,OAAO,CAAA;AACzD,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAA;AAC3B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AAE9D,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAA;AACpE,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,CAAA;AACtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;AAEnD,eAAO,MAAM,oBAAoB,8BAAqC,CAAA;AAEtE,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,YAAY,CAAC,GAAG,CAAC,CAAA;IAC9B,Y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EtD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,EAAE,EAAE,aAAa,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb,KAAK,IAAI,CAAA;AAEV,eAAO,MAAM,YAAY,EAAE,YAG1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInvalidate.d.ts","sourceRoot":"","sources":["../../src/main/useInvalidate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,aAAa,0CAEpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/main/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,eAAe,YAAwC,CAAA;AAEpE,eAAO,MAAM,YAAY,uBAAwB,YAAY,CAAC,SAAS,CAAC,WAC+B,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,GAAG,CAAA;AACxB,MAAM,MAAM,eAAe,GAAG,GAAG,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@encorejs/r3f",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"authors": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Andrew Prifer",
|
|
8
|
+
"email": "andrew.prifer@gmail.com",
|
|
9
|
+
"url": "https://github.com/AndrewPrifer"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "Aria Minaei",
|
|
13
|
+
"email": "aria@theatrejs.com",
|
|
14
|
+
"url": "https://github.com/AriaMinaei"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/ikanishakm/encore",
|
|
20
|
+
"directory": "packages/r3f"
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/index.js",
|
|
23
|
+
"module": "dist/index.esm.js",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/**/*"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.esm.js",
|
|
31
|
+
"require": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./dist/extension": {
|
|
35
|
+
"import": "./dist/extension/index.esm.js",
|
|
36
|
+
"require": "./dist/extension/index.js",
|
|
37
|
+
"types": "./dist/extension/index.d.ts"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"prepack": "yarn run build",
|
|
42
|
+
"typecheck": "yarn run build",
|
|
43
|
+
"build": "run-s build:ts build:js",
|
|
44
|
+
"build:js": "tsx devEnv/bundle.ts",
|
|
45
|
+
"build:ts": "tsc --build ./tsconfig.json",
|
|
46
|
+
"prepublish": "yarn run build",
|
|
47
|
+
"clean": "rm -rf ./dist && rm -f tsconfig.tsbuildinfo"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@encorejs/dataverse": "1.0.0",
|
|
51
|
+
"@encorejs/react": "1.0.0",
|
|
52
|
+
"@react-three/drei": "^10.7.7",
|
|
53
|
+
"@react-three/fiber": "^9.6.1",
|
|
54
|
+
"@types/jest": "^26.0.23",
|
|
55
|
+
"@types/lodash-es": "^4.17.4",
|
|
56
|
+
"@types/node": "^15.6.2",
|
|
57
|
+
"@types/react": "^19.2.17",
|
|
58
|
+
"@types/react-dom": "^19.2.3",
|
|
59
|
+
"@types/three": "0.184.1",
|
|
60
|
+
"esbuild": "^0.18.17",
|
|
61
|
+
"lodash-es": "^4.17.21",
|
|
62
|
+
"npm-run-all": "^4.1.5",
|
|
63
|
+
"polished": "^4.1.3",
|
|
64
|
+
"react": "^19.2.7",
|
|
65
|
+
"react-dom": "^19.2.7",
|
|
66
|
+
"react-icons": "^4.2.0",
|
|
67
|
+
"react-merge-refs": "^2.0.2",
|
|
68
|
+
"react-shadow": "^20.4.0",
|
|
69
|
+
"react-use-measure": "^2.1.1",
|
|
70
|
+
"reakit": "^1.3.8",
|
|
71
|
+
"styled-components": "^6.1.13",
|
|
72
|
+
"three": "0.184.0",
|
|
73
|
+
"three-stdlib": "^2.36.1",
|
|
74
|
+
"tsx": "4.7.0",
|
|
75
|
+
"typescript": "5.1.6",
|
|
76
|
+
"zustand": "^3.5.1"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@encorejs/core": "*",
|
|
80
|
+
"@encorejs/studio": "*",
|
|
81
|
+
"@react-three/fiber": "^9.0.0",
|
|
82
|
+
"react": ">=19",
|
|
83
|
+
"react-dom": ">=19",
|
|
84
|
+
"three": ">=0.156"
|
|
85
|
+
}
|
|
86
|
+
}
|