@hello-terrain/react 0.0.0-alpha.13 → 0.0.0-alpha.14
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/index.cjs +29 -22
- package/dist/index.d.cts +15 -5
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.mjs +29 -22
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -547,37 +547,44 @@ function InternalTerrain(props) {
|
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
|
-
function Terrain({
|
|
551
|
-
terrain: providedTerrain,
|
|
552
|
-
children,
|
|
553
|
-
rootSize,
|
|
554
|
-
origin,
|
|
555
|
-
maxLevel,
|
|
556
|
-
innerTileSegments,
|
|
557
|
-
skirtScale,
|
|
558
|
-
elevationScale,
|
|
559
|
-
radius,
|
|
560
|
-
elevation,
|
|
561
|
-
topology,
|
|
562
|
-
terrainFieldFilter,
|
|
563
|
-
getCameraOrigin,
|
|
564
|
-
cameraHysteresis,
|
|
565
|
-
tasks,
|
|
566
|
-
maxNodes,
|
|
567
|
-
...primitiveProps
|
|
568
|
-
}) {
|
|
550
|
+
function Terrain(props) {
|
|
551
|
+
const { terrain: providedTerrain, children } = props;
|
|
569
552
|
if (providedTerrain) {
|
|
553
|
+
const {
|
|
554
|
+
terrain: _terrain,
|
|
555
|
+
children: _children,
|
|
556
|
+
innerTileSegments: innerTileSegments2,
|
|
557
|
+
maxNodes: maxNodes2,
|
|
558
|
+
...primitiveProps2
|
|
559
|
+
} = props;
|
|
570
560
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
571
561
|
TerrainWithHandle,
|
|
572
562
|
{
|
|
573
563
|
terrain: providedTerrain,
|
|
574
|
-
innerTileSegments,
|
|
575
|
-
maxNodes,
|
|
576
|
-
...
|
|
564
|
+
innerTileSegments: innerTileSegments2,
|
|
565
|
+
maxNodes: maxNodes2,
|
|
566
|
+
...primitiveProps2,
|
|
577
567
|
children
|
|
578
568
|
}
|
|
579
569
|
);
|
|
580
570
|
}
|
|
571
|
+
const {
|
|
572
|
+
rootSize,
|
|
573
|
+
origin,
|
|
574
|
+
maxLevel,
|
|
575
|
+
innerTileSegments,
|
|
576
|
+
skirtScale,
|
|
577
|
+
elevationScale,
|
|
578
|
+
radius,
|
|
579
|
+
elevation,
|
|
580
|
+
topology,
|
|
581
|
+
terrainFieldFilter,
|
|
582
|
+
getCameraOrigin,
|
|
583
|
+
cameraHysteresis,
|
|
584
|
+
tasks,
|
|
585
|
+
maxNodes,
|
|
586
|
+
...primitiveProps
|
|
587
|
+
} = props;
|
|
581
588
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
582
589
|
InternalTerrain,
|
|
583
590
|
{
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { TerrainGraph, TerrainTasks, TerrainQuery, TerrainSurfaceQuery, TerrainSphereQuery, TerrainRaycast, Topology, ElevationCallback } from '@hello-terrain/three';
|
|
3
3
|
export { TerrainQuery, TerrainRaycast, TerrainRaycastResult, TerrainSample, TerrainSphereQuery, TerrainSurfaceSample, TerrainSurfaceSampleBatch, TerrainTile } from '@hello-terrain/three';
|
|
4
4
|
import { Task } from '@hello-terrain/work';
|
|
5
5
|
import { ThreeElements, RootState } from '@react-three/fiber';
|
|
@@ -50,12 +50,22 @@ interface TerrainOptions {
|
|
|
50
50
|
tasks?: readonly TerrainTask[];
|
|
51
51
|
}
|
|
52
52
|
type TerrainPrimitiveProps = Omit<ThreeElements["primitive"], "object" | "children">;
|
|
53
|
-
|
|
54
|
-
terrain?: TerrainHandle;
|
|
53
|
+
type TerrainRenderProps = {
|
|
55
54
|
children: (nodes: TerrainNodes) => ReactNode;
|
|
56
|
-
}
|
|
55
|
+
};
|
|
56
|
+
/** Props when a pre-built terrain handle is supplied via `useTerrain`. */
|
|
57
|
+
type TerrainPropsWithHandle = TerrainPrimitiveProps & TerrainRenderProps & {
|
|
58
|
+
terrain: TerrainHandle;
|
|
59
|
+
innerTileSegments?: number;
|
|
60
|
+
maxNodes?: number;
|
|
61
|
+
};
|
|
62
|
+
/** Props when `<Terrain>` should construct the handle internally. */
|
|
63
|
+
type TerrainPropsWithoutHandle = TerrainPrimitiveProps & TerrainOptions & TerrainRenderProps & {
|
|
64
|
+
terrain?: undefined;
|
|
65
|
+
};
|
|
66
|
+
type TerrainProps = TerrainPropsWithHandle | TerrainPropsWithoutHandle;
|
|
57
67
|
|
|
58
|
-
declare function Terrain(
|
|
68
|
+
declare function Terrain(props: TerrainProps): react_jsx_runtime.JSX.Element;
|
|
59
69
|
|
|
60
70
|
interface TerrainProviderProps {
|
|
61
71
|
value: TerrainHandle;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { TerrainGraph, TerrainTasks, TerrainQuery, TerrainSurfaceQuery, TerrainSphereQuery, TerrainRaycast, Topology, ElevationCallback } from '@hello-terrain/three';
|
|
3
3
|
export { TerrainQuery, TerrainRaycast, TerrainRaycastResult, TerrainSample, TerrainSphereQuery, TerrainSurfaceSample, TerrainSurfaceSampleBatch, TerrainTile } from '@hello-terrain/three';
|
|
4
4
|
import { Task } from '@hello-terrain/work';
|
|
5
5
|
import { ThreeElements, RootState } from '@react-three/fiber';
|
|
@@ -50,12 +50,22 @@ interface TerrainOptions {
|
|
|
50
50
|
tasks?: readonly TerrainTask[];
|
|
51
51
|
}
|
|
52
52
|
type TerrainPrimitiveProps = Omit<ThreeElements["primitive"], "object" | "children">;
|
|
53
|
-
|
|
54
|
-
terrain?: TerrainHandle;
|
|
53
|
+
type TerrainRenderProps = {
|
|
55
54
|
children: (nodes: TerrainNodes) => ReactNode;
|
|
56
|
-
}
|
|
55
|
+
};
|
|
56
|
+
/** Props when a pre-built terrain handle is supplied via `useTerrain`. */
|
|
57
|
+
type TerrainPropsWithHandle = TerrainPrimitiveProps & TerrainRenderProps & {
|
|
58
|
+
terrain: TerrainHandle;
|
|
59
|
+
innerTileSegments?: number;
|
|
60
|
+
maxNodes?: number;
|
|
61
|
+
};
|
|
62
|
+
/** Props when `<Terrain>` should construct the handle internally. */
|
|
63
|
+
type TerrainPropsWithoutHandle = TerrainPrimitiveProps & TerrainOptions & TerrainRenderProps & {
|
|
64
|
+
terrain?: undefined;
|
|
65
|
+
};
|
|
66
|
+
type TerrainProps = TerrainPropsWithHandle | TerrainPropsWithoutHandle;
|
|
57
67
|
|
|
58
|
-
declare function Terrain(
|
|
68
|
+
declare function Terrain(props: TerrainProps): react_jsx_runtime.JSX.Element;
|
|
59
69
|
|
|
60
70
|
interface TerrainProviderProps {
|
|
61
71
|
value: TerrainHandle;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { TerrainGraph, TerrainTasks, TerrainQuery, TerrainSurfaceQuery, TerrainSphereQuery, TerrainRaycast, Topology, ElevationCallback } from '@hello-terrain/three';
|
|
3
3
|
export { TerrainQuery, TerrainRaycast, TerrainRaycastResult, TerrainSample, TerrainSphereQuery, TerrainSurfaceSample, TerrainSurfaceSampleBatch, TerrainTile } from '@hello-terrain/three';
|
|
4
4
|
import { Task } from '@hello-terrain/work';
|
|
5
5
|
import { ThreeElements, RootState } from '@react-three/fiber';
|
|
@@ -50,12 +50,22 @@ interface TerrainOptions {
|
|
|
50
50
|
tasks?: readonly TerrainTask[];
|
|
51
51
|
}
|
|
52
52
|
type TerrainPrimitiveProps = Omit<ThreeElements["primitive"], "object" | "children">;
|
|
53
|
-
|
|
54
|
-
terrain?: TerrainHandle;
|
|
53
|
+
type TerrainRenderProps = {
|
|
55
54
|
children: (nodes: TerrainNodes) => ReactNode;
|
|
56
|
-
}
|
|
55
|
+
};
|
|
56
|
+
/** Props when a pre-built terrain handle is supplied via `useTerrain`. */
|
|
57
|
+
type TerrainPropsWithHandle = TerrainPrimitiveProps & TerrainRenderProps & {
|
|
58
|
+
terrain: TerrainHandle;
|
|
59
|
+
innerTileSegments?: number;
|
|
60
|
+
maxNodes?: number;
|
|
61
|
+
};
|
|
62
|
+
/** Props when `<Terrain>` should construct the handle internally. */
|
|
63
|
+
type TerrainPropsWithoutHandle = TerrainPrimitiveProps & TerrainOptions & TerrainRenderProps & {
|
|
64
|
+
terrain?: undefined;
|
|
65
|
+
};
|
|
66
|
+
type TerrainProps = TerrainPropsWithHandle | TerrainPropsWithoutHandle;
|
|
57
67
|
|
|
58
|
-
declare function Terrain(
|
|
68
|
+
declare function Terrain(props: TerrainProps): react_jsx_runtime.JSX.Element;
|
|
59
69
|
|
|
60
70
|
interface TerrainProviderProps {
|
|
61
71
|
value: TerrainHandle;
|
package/dist/index.mjs
CHANGED
|
@@ -545,37 +545,44 @@ function InternalTerrain(props) {
|
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
|
-
function Terrain({
|
|
549
|
-
terrain: providedTerrain,
|
|
550
|
-
children,
|
|
551
|
-
rootSize,
|
|
552
|
-
origin,
|
|
553
|
-
maxLevel,
|
|
554
|
-
innerTileSegments,
|
|
555
|
-
skirtScale,
|
|
556
|
-
elevationScale,
|
|
557
|
-
radius,
|
|
558
|
-
elevation,
|
|
559
|
-
topology,
|
|
560
|
-
terrainFieldFilter,
|
|
561
|
-
getCameraOrigin,
|
|
562
|
-
cameraHysteresis,
|
|
563
|
-
tasks,
|
|
564
|
-
maxNodes,
|
|
565
|
-
...primitiveProps
|
|
566
|
-
}) {
|
|
548
|
+
function Terrain(props) {
|
|
549
|
+
const { terrain: providedTerrain, children } = props;
|
|
567
550
|
if (providedTerrain) {
|
|
551
|
+
const {
|
|
552
|
+
terrain: _terrain,
|
|
553
|
+
children: _children,
|
|
554
|
+
innerTileSegments: innerTileSegments2,
|
|
555
|
+
maxNodes: maxNodes2,
|
|
556
|
+
...primitiveProps2
|
|
557
|
+
} = props;
|
|
568
558
|
return /* @__PURE__ */ jsx(
|
|
569
559
|
TerrainWithHandle,
|
|
570
560
|
{
|
|
571
561
|
terrain: providedTerrain,
|
|
572
|
-
innerTileSegments,
|
|
573
|
-
maxNodes,
|
|
574
|
-
...
|
|
562
|
+
innerTileSegments: innerTileSegments2,
|
|
563
|
+
maxNodes: maxNodes2,
|
|
564
|
+
...primitiveProps2,
|
|
575
565
|
children
|
|
576
566
|
}
|
|
577
567
|
);
|
|
578
568
|
}
|
|
569
|
+
const {
|
|
570
|
+
rootSize,
|
|
571
|
+
origin,
|
|
572
|
+
maxLevel,
|
|
573
|
+
innerTileSegments,
|
|
574
|
+
skirtScale,
|
|
575
|
+
elevationScale,
|
|
576
|
+
radius,
|
|
577
|
+
elevation,
|
|
578
|
+
topology,
|
|
579
|
+
terrainFieldFilter,
|
|
580
|
+
getCameraOrigin,
|
|
581
|
+
cameraHysteresis,
|
|
582
|
+
tasks,
|
|
583
|
+
maxNodes,
|
|
584
|
+
...primitiveProps
|
|
585
|
+
} = props;
|
|
579
586
|
return /* @__PURE__ */ jsx(
|
|
580
587
|
InternalTerrain,
|
|
581
588
|
{
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/kenjinp/hello-terrain.git"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.0.0-alpha.
|
|
9
|
+
"version": "0.0.0-alpha.14",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "./dist/index.mjs",
|
|
12
12
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@hello-terrain/three": "0.0.0-alpha.
|
|
25
|
+
"@hello-terrain/three": "0.0.0-alpha.14",
|
|
26
26
|
"@hello-terrain/work": "0.3.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|