Commit graph

52 commits

Author SHA1 Message Date
Aria
d649858529 Feature: Custom RAFDrivers (#374)
Co-authored-by: Pete Feltham <dev@felthy.com>
Co-authored-by: Andrew Prifer <andrew.prifer@gmail.com>
2023-01-14 15:01:09 +01:00
Aria Minaei
a24a149a52 Remove Derivation.tapImmediate()
This is now just an extra flag on `Derivation.onChange()`
2023-01-04 20:49:43 +01:00
Aria Minaei
c58bc694ee Fix: Re-render the panels when object identity change
This fixes the pesky "Argument 'der' in 'useDerivation(der)' should not change between renders."
2022-12-31 22:54:52 +01:00
Aria Minaei
a8a9b5ef05 Rename deleteObject() and related params
Since `sheet.deleteObject()` doesn't actually delete the values
of the props of that object, I decided to rename it to `detachObject()`.

Also, the param `override` sounded too similar to the concept of value overrides,
so I renamed it to `reconfigure`.
2022-11-10 16:23:15 +01:00
Andrew Prifer
43714fdf17
Notification improvements (#324) 2022-10-21 20:32:53 +00:00
Andrew Prifer
965d7085dc
Add runtime type checks to r3f (#323)
* Add better error/warning messages to r3f

* Fix notifications playground
2022-10-21 19:17:45 +00:00
Aria Minaei
ef5752cbd3 Add a playground for dynamic trees in r3f 2022-10-18 11:43:54 +02:00
Aria Minaei
a9c3c00153 Implement dynamic scene trees in r3f
This makes it possible to add/remove objects on the fly, do hot-module reloading, change object configs on the fly, and more.
2022-10-18 11:43:54 +02:00
Andrew Prifer
e708463377
Remove useless TS type (#318) 2022-10-17 14:13:23 +00:00
Andrew Prifer
29e036638b
Normalize theatre keys in r3f (#317)
Also remove a stray console log and make makeStoreKey make more sense.
2022-10-16 16:02:35 +00:00
Andrew Prifer
54ed4c3c41
Improve light support in theatre/r3f (#316)
Add color to all light types and add ambient and hemisphere lights
2022-10-14 13:43:53 +00:00
Andrew Prifer
6497bf2097
Add instant editable cameras to the r3f extension (#315)
Add spruced up editable orthographic/perspective camera
2022-10-13 18:14:53 +00:00
Andrew Prifer
3ec8c20fa6
Warn about (possibly) incorrect custom camera (#308)
Print a warning if people use e.perspectiveCamera or e.orthographicCamera
2022-10-06 14:22:39 +00:00
Andrew Prifer
8680f9d89e
Replace uniqueName with theatreKey (#285) 2022-09-14 08:36:49 -04:00
Elliot
735bd983a5
Fix/0.5-compatability-tests (#293)
* Working changes

* Fix window undefined bug by updating lib

* Fix TransformControlsImpl import

* Fix compatibility tests>simple debuggable examples
2022-09-13 15:37:39 -04:00
Andrew Prifer
494c60d0c3
Require Opt modifier for orbiting (#286) 2022-08-25 19:55:47 +02:00
Andrew Prifer
14603bccbd
Make transform controls only update the props that are being manipulated in the current mode of the transform controls (#279)
Only update the transform that is being manipulated in the current mode
2022-08-15 15:15:37 +00:00
Cole Lawrence
8bd37a28d6 r3f fix: Pinching creates more than one undo level in r3f P-202
See https://linear.app/theatre/issue/P-202/pinching-creates-more-than-one-undo-level-in-r3f-history-bug
2022-08-02 16:06:15 -04:00
Cole Lawrence
984a61347f Use "Theatre.js" for name consistency
Co-authored-by: Fülöp <fulopkovacs@users.noreply.github.com>
2022-07-25 12:01:26 -04:00
Cole Lawrence
58f04685ad r3f: Accept function for objRef like for setState 2022-07-25 12:01:26 -04:00
Aria Minaei
00a039a713 Fix exports of @theatre/r3f so it is consistently interpreted across bundlers
Before this commit, the exports field of `@theatre/r3f` was:

```
"exports": {
  ".": "./dist/index.js",
  "./extension": "./dist/extension/index.js"
 },
 ```
So users could import the extension from '@theatre/r3f/extension'

However, if the user’s bundler doesn’t support the exports field, they’d have to import from @theatre/r3f/dist/extension. There are 3 problems with this approach:

1. We have to ask users to try both paths and see which works for their bundler.
2. Users can’t copy code from each other if their bundler setups are different.
3. To make matters worse, if a user’s bundler supports exports, they can’t import from @theatre/r3f/dist/extension.

This is all confusing, so we're fixing it by exposing @theatrer/3f/dist/extension and not @theatre/r3f/extension. Uglier, but more consistent, and avoids the above 3 problems.
2022-07-12 17:49:09 +02:00
Andrew Prifer
d1ef903355
Enable hiding the reference window (#241) 2022-06-29 15:06:24 +00:00
Andrew Prifer
a3d9892841
Relax editable TS types to allow creating editable versions of all the JSX.IntrinsicElements elements. (#237)
Enable custom editable components through relaxed typescript types
2022-06-28 16:11:28 +00:00
Andrew Prifer
b98c5d86b6
Fix editable TS (#235)
Fix primitive not being supported by the typings
2022-06-28 15:06:55 +00:00
Elliot
2854881e17
Add support for passing scalars to vector props (#228)
Co-authored-by: Andrew Prifer <AndrewPrifer@users.noreply.github.com>
2022-06-26 15:47:20 +00:00
Andrew Prifer
0e724d631d
Reference window fixes and improvements (#227) 2022-06-18 17:37:09 +02:00
Andrew Prifer
262d7d61d3
r3f fixes (#222)
* Minify r3f extension bundle, because it is expected by the React dead code elimination check, since we bundle React in it

* Add children to props, since it is required by React 18 types

* Fix getting context attributes for gl in ReferenceWindow

* Don't bundle threejs in extension

* Fix editor not responding to scene initialization

* Fix SnapshotEditor css
2022-06-18 00:59:45 +00:00
Aria
9b4aa4b0e0
Make @theatre/r3f play well with different vs of react,three,r3f #177 2022-05-27 21:59:51 +02:00
Andrew Prifer
0690a85ae2
UI improvements/sidebar pinning (#175)
Co-authored-by: Aria Minaei <aria.minaei@gmail.com>
2022-05-25 20:42:01 +02:00
Aria
ec18687a98
Re-do bundling, compat tests, and extension API (#174) 2022-05-25 00:37:18 +02:00
Don McCurdy
386a8fafac
theatre/r3f: Allow physical lighting in snapshot viewport (#114)
Co-authored-by: Andrew Prifer <andrew.prifer@gmail.com>
2022-05-19 12:48:59 +02:00
Andrew Prifer
95d4e1d315
Create reference window for r3f (#169)
* Add reference window (and fix tooltips)

* Replace image with data url so the build doesn't fail
2022-05-18 17:04:07 +02:00
Andrew Prifer
fc9df7c346
Support multiple sheet instances (#153)
* Support multiple/nested sheets and sheet instances

* Add playground for instances

* Fix playground and example

* Change r3f's objectKey to storeKey to avoid confusion

* Update all editable/uniqueName variables used as store key to storeKey too

* Fix lint warnings
2022-05-16 12:43:45 +02:00
Andrew Prifer
10b4954ee2
Support fog editing in r3f second try (#163)
* Add support for editable fog

* Oops
2022-05-15 22:04:00 +02:00
Andrew Prifer
ef96fa1974
Revert "Merge pull request #161" (#162)
This reverts commit 5bd224ae86.
2022-05-15 22:00:54 +02:00
Andrew Prifer
5bd224ae86
Merge pull request #161
* Add support for editable fog
2022-05-15 21:54:02 +02:00
Andrew Prifer
3eba08ff32
Merge pull request #159
* Fix raycasting-related perf issues
2022-05-13 19:43:09 +02:00
Andrew Prifer
a3b1938d43
Remove debouncedScrub() from r3f (#147) 2022-05-06 14:07:29 +02:00
Aria Minaei
c6a7c40339 Fix the type errors from the rebase 2022-05-05 14:21:46 +02:00
Andrew Prifer
c1e515a13f
Merge pull request #145
* Fix RefreshSnapshot component and make useRefreshSnapshot not a hook,…
2022-05-04 17:10:42 +02:00
Andrew Prifer
dceb3965d6
Make editable schema-based and add default schemas (#139)
* Make editable schema based and fix a couple UX issues

* Refactor the icons a bit

* Add support for points, lines, line segments, and line loops

* Adjust nudge multipliers

* Fix types

* Fix helpers not showing on hover in some cases
2022-05-04 16:43:44 +02:00
Andrew Prifer
39da042edc
Fix various issues with the build system (#129)
* Fix react-icons breaking in CRA 5 for some reason

* Replace fuzzysort with fuzzy so we don't break Webpack

Webpack messes up esbuild’s internal modules if the inlined module is an AMD module. Check any new dep you add if it is an AMD module.

* Inline dataverse deps.

Mainly because the CJS build consuming the ESM lodash-es broke some bundlers.

* react-icons fix nr 2

* Stop eslint breaking in CRA 5

* Update r3f-cra example to CRA 5 and fix double-bundling react & co

* Fix r3f tree-shaking and switch to ESM only output

* Make r3f example shake studio and its extension in prod

* Examples have separate and wildly differing build setups so remove them from the pre-commit hook linting

* Update out-of-date yarn.lock
2022-04-21 22:03:51 +02:00
Andrew Prifer
d522c84aac
Create a proper infinite grid helper (#95) 2022-03-04 15:06:48 +01:00
Aria Minaei
9dfe912f65 Get rid of the scrollbars in SnapshotEditor 2022-03-03 12:35:38 +01:00
Dan
72c7b2b9ce adding eslint-plugin-react-hooks plugin and fixing 1 error 2022-02-14 23:27:41 +01:00
Or Fleisher
9c7a491ca9 Remove additionalProps from the edtiable effect's dependencies 2021-10-13 20:23:35 +02:00
Or Fleisher
2794e0df26 Add ability to provide additional props to editable objects and get the sheet ref from the component 2021-10-13 20:23:35 +02:00
Aria Minaei
14173fde0a Formatting changes for api docs 2021-10-04 10:39:12 +02:00
Aria Minaei
69c6aa9af2 Lint rule changes 2021-10-02 14:12:25 +02:00
Aria Minaei
631bcba724 More docs and annotations 2021-09-18 21:43:29 +02:00