API naming tweaks

This commit is contained in:
Aria Minaei 2021-09-01 10:36:44 +02:00
parent 36017c6a73
commit a8df97a06a
21 changed files with 86 additions and 74 deletions

View file

@ -6,6 +6,8 @@ import type {IProject, ISheet, ISheetObject} from '@theatre/core'
import {types as t} from '@theatre/core'
import type {IScrub, IStudio} from '@theatre/studio'
studio.initialize()
const boxObjectConfig = t.compound({
position: t.compound({
x: t.number(0),
@ -57,7 +59,7 @@ const Box: React.FC<{
},
onDrag(x, y) {
if (!firstOnDragCalled) {
studio.__experimental_setSelection([obj])
studio.setSelection([obj])
firstOnDragCalled = true
}
scrub!.capture(({set}) => {
@ -84,7 +86,7 @@ const Box: React.FC<{
return (
<div
onClick={() => {
studio.__experimental_setSelection([obj])
studio.setSelection([obj])
}}
ref={setDivRef}
style={{
@ -111,7 +113,7 @@ export const Scene: React.FC<{project: IProject}> = ({project}) => {
const [selection, setSelection] = useState<IStudio['selection']>()
useLayoutEffect(() => {
return studio.__experimental_onSelectionChange((newState) => {
return studio.onSelectionChange((newState) => {
setSelection(newState)
})
})

View file

@ -5,7 +5,7 @@ import {getProject} from '@theatre/core'
import {Scene} from './Scene'
import bg from '../../xeno/bgs/8.png'
studio.ui
studio.initialize()
document.body.style.cssText = `
background-image: url(${bg});