@threlte/flex 2.0.0-next.0 → 2.0.0-next.1

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.
@@ -1,4 +1,4 @@
1
- <script>import { HierarchicalObject, T } from '@threlte/core';
1
+ <script lang="ts">import { HierarchicalObject, T } from '@threlte/core';
2
2
  import { onDestroy } from 'svelte';
3
3
  import { Group } from 'three';
4
4
  import { useFlex } from '../Flex/context';
@@ -1,4 +1,4 @@
1
- <script>import { loadYoga } from 'yoga-layout';
1
+ <script lang="ts">import { loadYoga } from 'yoga-layout';
2
2
  import InnerFlex from './InnerFlex.svelte';
3
3
  let { ...props } = $props();
4
4
  let yoga = $state(undefined);
@@ -1,4 +1,4 @@
1
- <script>import { T, currentWritable, useTask } from '@threlte/core';
1
+ <script lang="ts">import { T, currentWritable, useTask } from '@threlte/core';
2
2
  import { onDestroy } from 'svelte';
3
3
  import { Box3, Group, Vector3 } from 'three';
4
4
  import { Direction } from 'yoga-layout';
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
1
  {
2
2
  "name": "@threlte/flex",
3
- "version": "2.0.0-next.0",
3
+ "version": "2.0.0-next.1",
4
4
  "author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
5
5
  "license": "MIT",
6
6
  "devDependencies": {
7
- "@sveltejs/adapter-auto": "^3.1.1",
8
- "@sveltejs/kit": "^2.4.3",
9
- "@sveltejs/package": "^2.2.6",
10
- "@sveltejs/vite-plugin-svelte": "^3.0.0",
11
- "@types/node": "^20.11.6",
12
- "@types/three": "^0.160.0",
13
- "@typescript-eslint/eslint-plugin": "^6.19.1",
14
- "@typescript-eslint/parser": "^6.19.1",
7
+ "@sveltejs/adapter-auto": "^3.2.0",
8
+ "@sveltejs/kit": "^2.5.5",
9
+ "@sveltejs/package": "^2.3.1",
10
+ "@sveltejs/vite-plugin-svelte": "^3.1.0",
11
+ "@types/node": "^20.12.7",
12
+ "@types/three": "^0.163.0",
13
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
14
+ "@typescript-eslint/parser": "^7.6.0",
15
15
  "@yushijinhun/three-minifier-rollup": "^0.4.0",
16
- "eslint": "^8.56.0",
16
+ "eslint": "^9.0.0",
17
17
  "eslint-config-prettier": "^9.1.0",
18
- "eslint-plugin-svelte": "^2.35.1",
19
- "prettier": "^3.2.4",
20
- "prettier-plugin-svelte": "^3.1.2",
18
+ "eslint-plugin-svelte": "^2.36.0",
19
+ "prettier": "^3.2.5",
20
+ "prettier-plugin-svelte": "^3.2.2",
21
21
  "publint": "^0.2.7",
22
22
  "rimraf": "^5.0.5",
23
- "svelte": "^4.2.9",
24
- "svelte-check": "^3.6.3",
23
+ "svelte": "^5.0.0-next.95",
24
+ "svelte-check": "^3.6.9",
25
25
  "svelte-preprocess": "^5.1.3",
26
- "svelte2tsx": "^0.7.0",
27
- "three": "^0.160.1",
26
+ "svelte2tsx": "^0.7.6",
27
+ "three": "^0.163.0",
28
28
  "tslib": "^2.6.2",
29
- "typescript": "^5.3.3",
30
- "vite": "^5.0.12",
31
- "@threlte/core": "8.0.0-next.0",
32
- "@threlte/extras": "9.0.0-next.0"
29
+ "typescript": "^5.4.5",
30
+ "vite": "^5.2.8",
31
+ "@threlte/core": "8.0.0-next.2",
32
+ "@threlte/extras": "9.0.0-next.2"
33
33
  },
34
34
  "dependencies": {
35
35
  "mitt": "^3.0.1",
36
36
  "yoga-layout": "^2.0.1"
37
37
  },
38
38
  "peerDependencies": {
39
- "svelte": ">=4",
39
+ "svelte": ">=5",
40
40
  "three": ">=0.152"
41
41
  },
42
42
  "type": "module",
@@ -1,39 +0,0 @@
1
- import type { CurrentWritable } from '@threlte/core';
2
- import { type Emitter } from 'mitt';
3
- import type { Group } from 'three';
4
- import type { Node, Yoga } from 'yoga-layout';
5
- import type { Axis, ClassParser, NodeProps } from '../lib/props';
6
- type FlexContextEvents = {
7
- 'reflow:before': void;
8
- 'reflow:after': void;
9
- };
10
- type FlexContextNode = {
11
- node: Node;
12
- group: THREE.Group;
13
- props: NodeProps;
14
- };
15
- export type FlexContextData = {
16
- yoga: Yoga;
17
- nodes: Map<Node, FlexContextNode>;
18
- addNode: (node: Node, group: Group, props: NodeProps) => void;
19
- updateNodeProps: (node: Node, props: NodeProps, force?: boolean) => void;
20
- removeNode: (node: Node) => void;
21
- scaleFactor: CurrentWritable<number>;
22
- mainAxis: CurrentWritable<Axis>;
23
- crossAxis: CurrentWritable<Axis>;
24
- depthAxis: CurrentWritable<Axis>;
25
- rootGroup: Group;
26
- rootWidth: CurrentWritable<number>;
27
- rootHeight: CurrentWritable<number>;
28
- reflow: () => void;
29
- classParser?: ClassParser;
30
- };
31
- export type FlexContext = FlexContextData & Emitter<FlexContextEvents> & {
32
- onEvent: <Type extends keyof FlexContextEvents>(type: Type, callback: (payload: FlexContextEvents[Type]) => void) => void;
33
- };
34
- export declare const flexContextName = "__threlte-flex";
35
- export declare const createFlexContext: (data: FlexContextData) => FlexContextData & Emitter<FlexContextEvents> & {
36
- onEvent: <Type extends keyof FlexContextEvents>(type: Type, callback: (payload: FlexContextEvents[Type]) => void) => void;
37
- };
38
- export declare const useFlex: () => FlexContext;
39
- export {};