@threlte/flex 2.0.6 → 2.1.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/README.md +0 -4
- package/dist/Box/Box.svelte +5 -5
- package/dist/Box/Box.svelte.d.ts +1 -1
- package/dist/Box/types.d.ts +1 -1
- package/dist/Flex/Flex.svelte +1 -1
- package/dist/Flex/Flex.svelte.d.ts +1 -1
- package/dist/Flex/InnerFlex.svelte +9 -9
- package/dist/Flex/InnerFlex.svelte.d.ts +1 -1
- package/dist/Flex/context.d.ts +2 -2
- package/dist/Flex/context.js +4 -1
- package/dist/Flex/types.d.ts +1 -1
- package/dist/hooks/useReflow.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/lib/alignFlexProps.d.ts +1 -1
- package/dist/lib/getDepthAxis.d.ts +1 -1
- package/dist/lib/getFlex2DSize.d.ts +1 -1
- package/dist/lib/getRootShift.js +1 -1
- package/dist/lib/props.js +1 -1
- package/dist/lib/propsChanged.d.ts +1 -1
- package/dist/nodes/context.js +1 -1
- package/dist/parsers/createClassParser.d.ts +1 -1
- package/dist/parsers/tailwindParser.d.ts +1 -1
- package/dist/parsers/tailwindParser.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -50,10 +50,6 @@ Contributions are what make the open source community such an amazing place to l
|
|
|
50
50
|
- **Filing Issues** - if you have feature requestions or you think you spotted a bug, [submit an issue](https://github.com/threlte/threlte/issues/new).
|
|
51
51
|
- **Contributing Code** - if you would like to drop us a PR, read the [contribution guide](https://github.com/threlte/threlte/blob/main/CONTRIBUTING.md) first.
|
|
52
52
|
|
|
53
|
-
## Sponsors
|
|
54
|
-
|
|
55
|
-
[](https://vercel.com/?utm_source=threlte&utm_campaign=oss)
|
|
56
|
-
|
|
57
53
|
---
|
|
58
54
|
|
|
59
55
|
### License
|
package/dist/Box/Box.svelte
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { T } from '@threlte/core'
|
|
3
3
|
import { onDestroy } from 'svelte'
|
|
4
4
|
import { Group, Object3D } from 'three'
|
|
5
|
-
import { useFlex } from '../Flex/context'
|
|
6
|
-
import { createUseDimensionsContext } from '../hooks/useDimensions'
|
|
7
|
-
import type { NodeProps } from '../lib/props'
|
|
8
|
-
import { createNodeContext } from '../nodes/context'
|
|
9
|
-
import type { BoxProps } from './types'
|
|
5
|
+
import { useFlex } from '../Flex/context.js'
|
|
6
|
+
import { createUseDimensionsContext } from '../hooks/useDimensions.js'
|
|
7
|
+
import type { NodeProps } from '../lib/props.js'
|
|
8
|
+
import { createNodeContext } from '../nodes/context.js'
|
|
9
|
+
import type { BoxProps } from './types.js'
|
|
10
10
|
|
|
11
11
|
let { order, class: _class = '', onreflow, children, ...props }: BoxProps = $props()
|
|
12
12
|
|
package/dist/Box/Box.svelte.d.ts
CHANGED
package/dist/Box/types.d.ts
CHANGED
package/dist/Flex/Flex.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { loadYoga, type Yoga } from 'yoga-layout/load'
|
|
3
3
|
import InnerFlex from './InnerFlex.svelte'
|
|
4
|
-
import type { FlexProps } from './types'
|
|
4
|
+
import type { FlexProps } from './types.js'
|
|
5
5
|
|
|
6
6
|
let { children: innerChildren, ref = $bindable(), ...props }: FlexProps = $props()
|
|
7
7
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { onDestroy } from 'svelte'
|
|
4
4
|
import { Box3, Group, Vector3 } from 'three'
|
|
5
5
|
import { Direction } from 'yoga-layout'
|
|
6
|
-
import { createUseDimensionsContext } from '../hooks/useDimensions'
|
|
7
|
-
import { getDepthAxis } from '../lib/getDepthAxis'
|
|
8
|
-
import { getOrientedBoundingBoxSize } from '../lib/getOrientedBoundingBoxSize'
|
|
9
|
-
import { getRootShift } from '../lib/getRootShift'
|
|
10
|
-
import { applyNodeProps, type Axis, type NodeProps } from '../lib/props'
|
|
11
|
-
import { propsChanged } from '../lib/propsChanged'
|
|
12
|
-
import { createNodeContext } from '../nodes/context'
|
|
13
|
-
import { createFlexContext } from './context'
|
|
14
|
-
import type { InnerFlexProps } from './types'
|
|
6
|
+
import { createUseDimensionsContext } from '../hooks/useDimensions.js'
|
|
7
|
+
import { getDepthAxis } from '../lib/getDepthAxis.js'
|
|
8
|
+
import { getOrientedBoundingBoxSize } from '../lib/getOrientedBoundingBoxSize.js'
|
|
9
|
+
import { getRootShift } from '../lib/getRootShift.js'
|
|
10
|
+
import { applyNodeProps, type Axis, type NodeProps } from '../lib/props.js'
|
|
11
|
+
import { propsChanged } from '../lib/propsChanged.js'
|
|
12
|
+
import { createNodeContext } from '../nodes/context.js'
|
|
13
|
+
import { createFlexContext } from './context.js'
|
|
14
|
+
import type { InnerFlexProps } from './types.js'
|
|
15
15
|
|
|
16
16
|
let {
|
|
17
17
|
yoga,
|
package/dist/Flex/context.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CurrentWritable } from '@threlte/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { Emitter } from 'mitt';
|
|
3
3
|
import type { Group } from 'three';
|
|
4
4
|
import type { Node } from 'yoga-layout';
|
|
5
5
|
import type Yoga from 'yoga-layout';
|
|
6
|
-
import type { Axis, ClassParser, NodeProps } from '../lib/props';
|
|
6
|
+
import type { Axis, ClassParser, NodeProps } from '../lib/props.js';
|
|
7
7
|
type FlexContextEvents = {
|
|
8
8
|
'reflow:before': void;
|
|
9
9
|
'reflow:after': void;
|
package/dist/Flex/context.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// We need to cast here because TypeScript with "moduleResolution": "NodeNext"
|
|
2
|
+
// fails to resolve the default export otherwise.
|
|
3
|
+
import mittModule from 'mitt';
|
|
4
|
+
const mitt = mittModule;
|
|
2
5
|
import { getContext, onDestroy, setContext } from 'svelte';
|
|
3
6
|
export const flexContextName = '__threlte-flex';
|
|
4
7
|
export const createFlexContext = (data) => {
|
package/dist/Flex/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Snippet } from 'svelte';
|
|
|
3
3
|
import type { Group } from 'three';
|
|
4
4
|
import type Yoga from 'yoga-layout';
|
|
5
5
|
import type { Direction } from 'yoga-layout';
|
|
6
|
-
import type { ClassParser, FlexPlane, NodeProps } from '../lib/props';
|
|
6
|
+
import type { ClassParser, FlexPlane, NodeProps } from '../lib/props.js';
|
|
7
7
|
export type InnerFlexProps = NodeProps & {
|
|
8
8
|
yoga: typeof Yoga;
|
|
9
9
|
width?: number;
|
package/dist/hooks/useReflow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getContext } from 'svelte';
|
|
2
|
-
import { flexContextName } from '../Flex/context';
|
|
2
|
+
import { flexContextName } from '../Flex/context.js';
|
|
3
3
|
/**
|
|
4
4
|
* The hook useReflow allows you to manually request a [layout
|
|
5
5
|
* reflow](https://threlte.xyz/docs/reference/flex/flex#layout-reflow), for
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Box } from './Box/Box.svelte';
|
|
2
2
|
export { default as Flex } from './Flex/Flex.svelte';
|
|
3
|
-
export type { NodeProps } from './lib/props';
|
|
4
|
-
export { createClassParser } from './parsers/createClassParser';
|
|
5
|
-
export { tailwindParser } from './parsers/tailwindParser';
|
|
6
|
-
export { useReflow } from './hooks/useReflow';
|
|
7
|
-
export { useDimensions } from './hooks/useDimensions';
|
|
3
|
+
export type { NodeProps } from './lib/props.js';
|
|
4
|
+
export { createClassParser } from './parsers/createClassParser.js';
|
|
5
|
+
export { tailwindParser } from './parsers/tailwindParser.js';
|
|
6
|
+
export { useReflow } from './hooks/useReflow.js';
|
|
7
|
+
export { useDimensions } from './hooks/useDimensions.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { default as Box } from './Box/Box.svelte';
|
|
2
2
|
export { default as Flex } from './Flex/Flex.svelte';
|
|
3
3
|
// parsers
|
|
4
|
-
export { createClassParser } from './parsers/createClassParser';
|
|
5
|
-
export { tailwindParser } from './parsers/tailwindParser';
|
|
4
|
+
export { createClassParser } from './parsers/createClassParser.js';
|
|
5
|
+
export { tailwindParser } from './parsers/tailwindParser.js';
|
|
6
6
|
// hooks
|
|
7
|
-
export { useReflow } from './hooks/useReflow';
|
|
8
|
-
export { useDimensions } from './hooks/useDimensions';
|
|
7
|
+
export { useReflow } from './hooks/useReflow.js';
|
|
8
|
+
export { useDimensions } from './hooks/useDimensions.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FlexPlane } from './props';
|
|
1
|
+
import type { FlexPlane } from './props.js';
|
|
2
2
|
export declare function getDepthAxis(plane: FlexPlane): "x" | "y" | "z";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FlexPlane } from './props';
|
|
1
|
+
import type { FlexPlane } from './props.js';
|
|
2
2
|
export declare function getFlex2DSize(sizes: [number, number, number], plane: FlexPlane): number[];
|
package/dist/lib/getRootShift.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isTopLevelChildNode } from './isTopLevelChildNode';
|
|
1
|
+
import { isTopLevelChildNode } from './isTopLevelChildNode.js';
|
|
2
2
|
/** @returns [mainAxisShift, crossAxisShift] */
|
|
3
3
|
export const getRootShift = (rootWidth, rootHeight, node) => {
|
|
4
4
|
if (!isTopLevelChildNode(node)) {
|
package/dist/lib/props.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Node } from 'yoga-layout';
|
|
2
|
-
import type { NodeProps } from './props';
|
|
2
|
+
import type { NodeProps } from './props.js';
|
|
3
3
|
/**
|
|
4
4
|
* Because all NodeProps are primitive types, we can make a simple comparison
|
|
5
5
|
* and only request a reflow when necessary. We do that by checking the length
|
package/dist/nodes/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tailwindParser: import("../lib/props").ClassParser;
|
|
1
|
+
export declare const tailwindParser: import("../lib/props.js").ClassParser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/flex",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Components to easily use the flexbox spec with Threlte",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"typescript": "5.9.2",
|
|
29
29
|
"typescript-eslint": "^8.32.0",
|
|
30
30
|
"vite": "^7.1.4",
|
|
31
|
-
"@threlte/core": "8.
|
|
32
|
-
"@threlte/extras": "9.
|
|
31
|
+
"@threlte/core": "8.3.0",
|
|
32
|
+
"@threlte/extras": "9.7.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"mitt": "^3.0.1",
|