@threlte/theatre 0.0.1 → 0.0.3-next.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/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @threlte/extras
2
2
 
3
+ ## 0.0.3-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d41cb6cf: Adapted theatre package to new TransformControls syntax
8
+
9
+ ## 0.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 8e1b3d4: Unsubscribe from theatre.js sheet object onDestroy
14
+
3
15
  ## 0.5.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,6 @@
1
- <script>import { TransformControls, useParent, useThrelte } from '@threlte/core';
2
- import { getContext } from 'svelte';
1
+ <script>import { useParent, useThrelte } from '@threlte/core';
2
+ import { TransformControls } from '@threlte/extras';
3
+ import { getContext, onDestroy } from 'svelte';
3
4
  import { DEG2RAD, RAD2DEG } from 'three/src/math/MathUtils';
4
5
  import { globalObjects, globalStudio } from '../consts';
5
6
  import { createRawEventDispatcher } from './createRawEventDispatcher';
@@ -138,7 +139,7 @@ const updateProjectionMatrixKeys = [
138
139
  'bottom',
139
140
  'aspect'
140
141
  ];
141
- object.onValuesChange((newValues) => {
142
+ const unsubscribe = object.onValuesChange((newValues) => {
142
143
  // assign new values to slot prop
143
144
  values = newValues;
144
145
  // dispatch events to parent component callbacks
@@ -176,6 +177,7 @@ object.onValuesChange((newValues) => {
176
177
  invalidate();
177
178
  });
178
179
  });
180
+ onDestroy(unsubscribe);
179
181
  export const read = () => {
180
182
  if (!$globalStudio)
181
183
  return;
@@ -275,15 +277,12 @@ const onKeyUp = (e) => {
275
277
  };
276
278
  </script>
277
279
 
278
- <svelte:window
279
- on:keypress={onKeyPress}
280
- on:keydown={onKeyDown}
281
- on:keyup={onKeyUp}
282
- />
280
+ <svelte:window on:keypress={onKeyPress} on:keydown={onKeyDown} on:keyup={onKeyUp} />
283
281
 
284
282
  {#if selected && isObject3D($parent) && transform && controls}
285
283
  <TransformControls
286
284
  {mode}
285
+ object={$parent}
287
286
  translationSnap={snapActive ? snapValues.translate : null}
288
287
  rotationSnap={snapActive ? snapValues.rotate : null}
289
288
  scaleSnap={snapActive ? snapValues.scale : null}
@@ -293,9 +292,4 @@ const onKeyUp = (e) => {
293
292
  />
294
293
  {/if}
295
294
 
296
- <slot
297
- {values}
298
- {read}
299
- {sheet}
300
- {object}
301
- />
295
+ <slot {values} {read} {sheet} {object} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/theatre",
3
- "version": "0.0.1",
3
+ "version": "0.0.3-next.0",
4
4
  "author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
5
5
  "license": "MIT",
6
6
  "devDependencies": {
@@ -9,7 +9,8 @@
9
9
  "@sveltejs/kit": "1.0.0-next.377",
10
10
  "@theatre/core": "0.5.1-rc.1",
11
11
  "@theatre/studio": "0.5.1-rc.1",
12
- "@threlte/core": "5.0.7",
12
+ "@threlte/core": "6.0.0-next.0",
13
+ "@threlte/extras": "5.0.0-next.0",
13
14
  "@types/node": "^18.0.3",
14
15
  "@types/three": "^0.144.0",
15
16
  "@typescript-eslint/eslint-plugin": "^4.31.1",