pixi-fusion 2.2.0 → 2.2.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.
- package/dist/src/assets-manager/AssetsManager.js +1 -1
- package/dist/src/assets-manager/index.d.ts +3 -3
- package/dist/src/assets-manager/index.js +3 -3
- package/dist/src/assets-manager/useAssetManager.d.ts +1 -1
- package/dist/src/assets-manager/useAssetManager.js +1 -1
- package/dist/src/camera/Camera.js +5 -4
- package/dist/src/camera/index.d.ts +2 -2
- package/dist/src/camera/index.js +2 -2
- package/dist/src/game-context/Game.context.d.ts +1 -1
- package/dist/src/game-context/Game.context.js +1 -1
- package/dist/src/game-context/index.d.ts +1 -1
- package/dist/src/game-context/index.js +1 -1
- package/dist/src/game-objects/index.d.ts +2 -2
- package/dist/src/game-objects/index.js +2 -2
- package/dist/src/game-objects/usePhysicalObject.d.ts +1 -1
- package/dist/src/game-objects/usePhysicalObject.js +1 -1
- package/dist/src/game-objects/usePhysicalObjectFromConfig.d.ts +2 -2
- package/dist/src/game-objects/usePhysicalObjectFromConfig.js +1 -1
- package/dist/src/game-objects/useWalls.js +1 -1
- package/dist/src/hooks/index.d.ts +12 -12
- package/dist/src/hooks/index.js +12 -12
- package/dist/src/hooks/useAnimatedSprite.js +2 -2
- package/dist/src/hooks/useCamera.d.ts +1 -1
- package/dist/src/hooks/useCamera.js +1 -1
- package/dist/src/hooks/useCollisionDetection.js +1 -1
- package/dist/src/hooks/useGame.d.ts +1 -1
- package/dist/src/hooks/useGame.js +1 -1
- package/dist/src/hooks/useLayerContext.d.ts +1 -1
- package/dist/src/hooks/useLayerContext.js +1 -1
- package/dist/src/hooks/useObject.js +1 -1
- package/dist/src/hooks/useSprite.js +2 -2
- package/dist/src/hooks/useStage.d.ts +1 -1
- package/dist/src/hooks/useStage.js +1 -1
- package/dist/src/hooks/useTexture.js +1 -1
- package/dist/src/hooks/useTickerCallback.js +1 -1
- package/dist/src/hooks/useTilingSprite.js +2 -2
- package/dist/src/hooks/useWorld.d.ts +1 -1
- package/dist/src/hooks/useWorld.js +1 -1
- package/dist/src/index.d.ts +9 -9
- package/dist/src/index.js +9 -9
- package/dist/src/layer/Layer.js +2 -2
- package/dist/src/layer/index.d.ts +1 -1
- package/dist/src/layer/index.js +1 -1
- package/dist/src/physics/MatterPhysics.context.d.ts +1 -1
- package/dist/src/physics/index.d.ts +4 -4
- package/dist/src/physics/index.js +4 -4
- package/dist/src/physics/useCollisionEventHandler.js +1 -1
- package/dist/src/physics/usePhysicsEngineEventHandler.js +1 -1
- package/dist/src/physics/usePhysicsTickerCallback.js +1 -1
- package/dist/src/stage/Stage.js +3 -3
- package/dist/src/stage/index.d.ts +1 -1
- package/dist/src/stage/index.js +1 -1
- package/dist/src/world/World.js +3 -3
- package/dist/src/world/index.d.ts +2 -2
- package/dist/src/world/index.js +2 -2
- package/package.json +8 -8
- package/src/assets-manager/AssetsManager.tsx +1 -1
- package/src/assets-manager/index.ts +3 -3
- package/src/assets-manager/useAssetManager.ts +1 -1
- package/src/camera/Camera.tsx +6 -5
- package/src/camera/index.ts +2 -2
- package/src/game-context/Game.context.tsx +1 -1
- package/src/game-context/index.ts +1 -1
- package/src/game-objects/index.ts +2 -2
- package/src/game-objects/usePhysicalObject.ts +2 -2
- package/src/game-objects/usePhysicalObjectFromConfig.ts +3 -3
- package/src/game-objects/useWalls.ts +1 -1
- package/src/hooks/index.ts +12 -12
- package/src/hooks/useAnimatedSprite.ts +2 -2
- package/src/hooks/useCamera.ts +1 -1
- package/src/hooks/useCollisionDetection.ts +1 -1
- package/src/hooks/useGame.ts +1 -1
- package/src/hooks/useLayerContext.ts +1 -1
- package/src/hooks/useObject.ts +1 -1
- package/src/hooks/useSprite.ts +2 -2
- package/src/hooks/useStage.ts +1 -1
- package/src/hooks/useTexture.ts +1 -1
- package/src/hooks/useTickerCallback.ts +1 -1
- package/src/hooks/useTilingSprite.ts +2 -2
- package/src/hooks/useWorld.ts +1 -1
- package/src/index.ts +9 -9
- package/src/layer/Layer.tsx +2 -2
- package/src/layer/index.ts +1 -1
- package/src/physics/MatterPhysics.context.tsx +1 -1
- package/src/physics/index.ts +4 -4
- package/src/physics/useCollisionEventHandler.ts +1 -1
- package/src/physics/usePhysicsEngineEventHandler.ts +1 -1
- package/src/physics/usePhysicsTickerCallback.ts +1 -1
- package/src/stage/Stage.tsx +3 -3
- package/src/stage/index.ts +1 -1
- package/src/world/World.tsx +3 -3
- package/src/world/index.ts +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Assets } from "pixi.js";
|
|
3
|
-
import { AssetsManagerContext } from "./AssetsManager.context";
|
|
3
|
+
import { AssetsManagerContext } from "./AssetsManager.context.js";
|
|
4
4
|
export const AssetsManager = ({ children }) => {
|
|
5
5
|
const [isFetching, setIsFetching] = useState(false);
|
|
6
6
|
const [isFetched, setIsFetched] = useState(false);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./AssetsManager";
|
|
2
|
-
export * from "./AssetsManager.context";
|
|
3
|
-
export * from "./useAssetManager";
|
|
1
|
+
export * from "./AssetsManager.js";
|
|
2
|
+
export * from "./AssetsManager.context.js";
|
|
3
|
+
export * from "./useAssetManager.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./AssetsManager";
|
|
2
|
-
export * from "./AssetsManager.context";
|
|
3
|
-
export * from "./useAssetManager";
|
|
1
|
+
export * from "./AssetsManager.js";
|
|
2
|
+
export * from "./AssetsManager.context.js";
|
|
3
|
+
export * from "./useAssetManager.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useAssetManager: () => import("./AssetsManager.context").AssetsManagerContextValue;
|
|
1
|
+
export declare const useAssetManager: () => import("./AssetsManager.context.js").AssetsManagerContextValue;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Viewport as ViewportContainer } from "pixi-viewport";
|
|
3
|
-
import { Layer } from "../layer";
|
|
4
|
-
import { useStage
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { Layer } from "../layer/Layer.js";
|
|
4
|
+
import { useStage } from "../hooks/useStage.js";
|
|
5
|
+
import { useWorld } from "../hooks/useWorld.js";
|
|
6
|
+
import { LayerContext } from "../layer/Layer.context.js";
|
|
7
|
+
import { CameraContext } from "./Camera.context.js";
|
|
7
8
|
export const Camera = ({ children, clampZoom }) => {
|
|
8
9
|
const [isReady, setIsReady] = useState(false);
|
|
9
10
|
const [followContainer, setFollowContainer] = useState(null);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Camera";
|
|
2
|
-
export * from "./Camera.context";
|
|
1
|
+
export * from "./Camera.js";
|
|
2
|
+
export * from "./Camera.context.js";
|
package/dist/src/camera/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Camera";
|
|
2
|
-
export * from "./Camera.context";
|
|
1
|
+
export * from "./Camera.js";
|
|
2
|
+
export * from "./Camera.context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { GameStatus, GameStatusChangeEvent } from "../types";
|
|
2
|
+
import { GameStatus, GameStatusChangeEvent } from "../types.js";
|
|
3
3
|
export type GameContextValue = {
|
|
4
4
|
readonly reset: () => void;
|
|
5
5
|
readonly start: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Game.context";
|
|
1
|
+
export * from "./Game.context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Game.context";
|
|
1
|
+
export * from "./Game.context.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./usePhysicalObject";
|
|
2
|
-
export * from "./useWalls";
|
|
1
|
+
export * from "./usePhysicalObject.js";
|
|
2
|
+
export * from "./useWalls.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./usePhysicalObject";
|
|
2
|
-
export * from "./useWalls";
|
|
1
|
+
export * from "./usePhysicalObject.js";
|
|
2
|
+
export * from "./useWalls.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useEffect } from "react";
|
|
2
|
-
import { MatterPhysicsContext } from "../physics";
|
|
2
|
+
import { MatterPhysicsContext } from "../physics/MatterPhysics.context.js";
|
|
3
3
|
export const usePhysicalObject = ({ physicalObject }) => {
|
|
4
4
|
const { addBody, removeBody } = useContext(MatterPhysicsContext);
|
|
5
5
|
useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Body } from "matter-js";
|
|
2
|
-
import { Nullable } from "../types";
|
|
3
|
-
import { GameObjectPhysicalObjectConfig } from "./GameObjectPhysicalObjectConfig";
|
|
2
|
+
import { Nullable } from "../types.js";
|
|
3
|
+
import { GameObjectPhysicalObjectConfig } from "./GameObjectPhysicalObjectConfig.js";
|
|
4
4
|
export declare const usePhysicalObjectFromConfig: <PhysicalObjectType extends Nullable<Body> = Body>({ position, ...physicalObjectConfig }: GameObjectPhysicalObjectConfig) => {
|
|
5
5
|
physicalObject: PhysicalObjectType;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Body } from "matter-js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { usePhysicalObject } from "./usePhysicalObject";
|
|
3
|
+
import { usePhysicalObject } from "./usePhysicalObject.js";
|
|
4
4
|
export const usePhysicalObjectFromConfig = ({ position = { x: 0, y: 0 }, ...physicalObjectConfig }) => {
|
|
5
5
|
const physicalObject = useMemo(() => {
|
|
6
6
|
if (physicalObjectConfig) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { Bodies, Composite } from "matter-js";
|
|
3
|
-
import { MatterPhysicsContext } from "../physics/MatterPhysics.context";
|
|
3
|
+
import { MatterPhysicsContext } from "../physics/MatterPhysics.context.js";
|
|
4
4
|
const DEFAULT_WALL_CONFIG = {
|
|
5
5
|
thikness: 10
|
|
6
6
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./useGlobalEventHandler";
|
|
2
|
-
export * from "./useStage";
|
|
3
|
-
export * from "./useTickerCallback";
|
|
4
|
-
export * from "./useWorld";
|
|
5
|
-
export * from "./useLayerContext";
|
|
6
|
-
export * from "./useSprite";
|
|
7
|
-
export * from "./useAnimatedSprite";
|
|
8
|
-
export * from "./useTexture";
|
|
9
|
-
export * from "./useGame";
|
|
10
|
-
export * from "./useTilingSprite";
|
|
11
|
-
export * from "./useCamera";
|
|
12
|
-
export * from "./useCollisionDetection";
|
|
1
|
+
export * from "./useGlobalEventHandler.js";
|
|
2
|
+
export * from "./useStage.js";
|
|
3
|
+
export * from "./useTickerCallback.js";
|
|
4
|
+
export * from "./useWorld.js";
|
|
5
|
+
export * from "./useLayerContext.js";
|
|
6
|
+
export * from "./useSprite.js";
|
|
7
|
+
export * from "./useAnimatedSprite.js";
|
|
8
|
+
export * from "./useTexture.js";
|
|
9
|
+
export * from "./useGame.js";
|
|
10
|
+
export * from "./useTilingSprite.js";
|
|
11
|
+
export * from "./useCamera.js";
|
|
12
|
+
export * from "./useCollisionDetection.js";
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./useGlobalEventHandler";
|
|
2
|
-
export * from "./useStage";
|
|
3
|
-
export * from "./useTickerCallback";
|
|
4
|
-
export * from "./useWorld";
|
|
5
|
-
export * from "./useLayerContext";
|
|
6
|
-
export * from "./useSprite";
|
|
7
|
-
export * from "./useAnimatedSprite";
|
|
8
|
-
export * from "./useTexture";
|
|
9
|
-
export * from "./useGame";
|
|
10
|
-
export * from "./useTilingSprite";
|
|
11
|
-
export * from "./useCamera";
|
|
12
|
-
export * from "./useCollisionDetection";
|
|
1
|
+
export * from "./useGlobalEventHandler.js";
|
|
2
|
+
export * from "./useStage.js";
|
|
3
|
+
export * from "./useTickerCallback.js";
|
|
4
|
+
export * from "./useWorld.js";
|
|
5
|
+
export * from "./useLayerContext.js";
|
|
6
|
+
export * from "./useSprite.js";
|
|
7
|
+
export * from "./useAnimatedSprite.js";
|
|
8
|
+
export * from "./useTexture.js";
|
|
9
|
+
export * from "./useGame.js";
|
|
10
|
+
export * from "./useTilingSprite.js";
|
|
11
|
+
export * from "./useCamera.js";
|
|
12
|
+
export * from "./useCollisionDetection.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
|
2
2
|
import { AnimatedSprite, Spritesheet } from "pixi.js";
|
|
3
|
-
import { useTextures } from "./useTexture";
|
|
4
|
-
import { useObject } from "./useObject";
|
|
3
|
+
import { useTextures } from "./useTexture.js";
|
|
4
|
+
import { useObject } from "./useObject.js";
|
|
5
5
|
export const useAnimatedSprite = ({ texture, spritesheet: spritesheetJSON, animation, animationSpeed = 1, isPlaying, ...options }) => {
|
|
6
6
|
const textureKeys = useMemo(() => {
|
|
7
7
|
return [...(texture ? [texture] : [])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useCamera: () => import("
|
|
1
|
+
export declare const useCamera: () => import("../index.js").CameraContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
-
import { useTickerCallback } from "./useTickerCallback";
|
|
2
|
+
import { useTickerCallback } from "./useTickerCallback.js";
|
|
3
3
|
export const useCollisionDetection = ({ objectA, objectB, onCollide, isEnabled }) => {
|
|
4
4
|
const testForAABB = useCallback(() => {
|
|
5
5
|
if (!objectA || !objectB) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useGame: () => import("
|
|
1
|
+
export declare const useGame: () => import("../index.js").GameContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useLayerContext: () => import("../layer/Layer.context").LayerContextValue;
|
|
1
|
+
export declare const useLayerContext: () => import("../layer/Layer.context.js").LayerContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import { useLayerContext } from "./useLayerContext";
|
|
2
|
+
import { useLayerContext } from "./useLayerContext.js";
|
|
3
3
|
export const useObject = ({ object, anchor, position, skew, scale, width, angle, alpha, visible = true }) => {
|
|
4
4
|
const { addObject, removeObject } = useLayerContext();
|
|
5
5
|
useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { Sprite } from "pixi.js";
|
|
3
|
-
import { useTextures } from "./useTexture";
|
|
4
|
-
import { useObject } from "./useObject";
|
|
3
|
+
import { useTextures } from "./useTexture.js";
|
|
4
|
+
import { useObject } from "./useObject.js";
|
|
5
5
|
export const useSprite = ({ texture = "", ...options }) => {
|
|
6
6
|
const textureKeys = useMemo(() => {
|
|
7
7
|
return [...(texture ? [texture] : [])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStage: () => import("../stage/Stage.context").StageContextValue;
|
|
1
|
+
export declare const useStage: () => import("../stage/Stage.context.js").StageContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { useAssetManager } from "../assets-manager";
|
|
2
|
+
import { useAssetManager } from "../assets-manager/useAssetManager.js";
|
|
3
3
|
export const useTextures = ({ keys = [] }) => {
|
|
4
4
|
const { getAsset, isFetched, isFetching, isError } = useAssetManager();
|
|
5
5
|
const textures = useMemo(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
|
2
2
|
import { TilingSprite } from "pixi.js";
|
|
3
|
-
import { useTextures } from "./useTexture";
|
|
4
|
-
import { useObject } from "./useObject";
|
|
3
|
+
import { useTextures } from "./useTexture.js";
|
|
4
|
+
import { useObject } from "./useObject.js";
|
|
5
5
|
export const useTilingSprite = ({ texture = "", tilePosition, ...options }) => {
|
|
6
6
|
const textureKeys = useMemo(() => {
|
|
7
7
|
return [...(texture ? [texture] : [])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useWorld: () => import("
|
|
1
|
+
export declare const useWorld: () => import("../index.js").WorldContextValue;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./game-context";
|
|
2
|
-
export * from "./world";
|
|
3
|
-
export * from "./camera";
|
|
4
|
-
export * from "./layer";
|
|
5
|
-
export * from "./assets-manager";
|
|
6
|
-
export * from "./game-objects";
|
|
7
|
-
export * from "./physics";
|
|
8
|
-
export * from "./types";
|
|
9
|
-
export * from "./hooks";
|
|
1
|
+
export * from "./game-context/index.js";
|
|
2
|
+
export * from "./world/index.js";
|
|
3
|
+
export * from "./camera/index.js";
|
|
4
|
+
export * from "./layer/index.js";
|
|
5
|
+
export * from "./assets-manager/index.js";
|
|
6
|
+
export * from "./game-objects/index.js";
|
|
7
|
+
export * from "./physics/index.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./hooks/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./game-context";
|
|
2
|
-
export * from "./world";
|
|
3
|
-
export * from "./camera";
|
|
4
|
-
export * from "./layer";
|
|
5
|
-
export * from "./assets-manager";
|
|
6
|
-
export * from "./game-objects";
|
|
7
|
-
export * from "./physics";
|
|
8
|
-
export * from "./types";
|
|
9
|
-
export * from "./hooks";
|
|
1
|
+
export * from "./game-context/index.js";
|
|
2
|
+
export * from "./world/index.js";
|
|
3
|
+
export * from "./camera/index.js";
|
|
4
|
+
export * from "./layer/index.js";
|
|
5
|
+
export * from "./assets-manager/index.js";
|
|
6
|
+
export * from "./game-objects/index.js";
|
|
7
|
+
export * from "./physics/index.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./hooks/index.js";
|
package/dist/src/layer/Layer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
|
-
import { StageContext } from "../stage/Stage.context";
|
|
4
|
-
import { LayerContext } from "./Layer.context";
|
|
3
|
+
import { StageContext } from "../stage/Stage.context.js";
|
|
4
|
+
import { LayerContext } from "./Layer.context.js";
|
|
5
5
|
export const Layer = ({ options, children }) => {
|
|
6
6
|
const { addObject: addObjectIntoStage, removeObject: removeObjectFromStaeg } = useContext(StageContext);
|
|
7
7
|
const { addObject: addObjectIntoParent, removeObject: removeObjectFromParent } = useContext(LayerContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Layer";
|
|
1
|
+
export * from "./Layer.js";
|
package/dist/src/layer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Layer";
|
|
1
|
+
export * from "./Layer.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { MatterPhysicsConfig, MatterPhysics } from "./types";
|
|
2
|
+
import { MatterPhysicsConfig, MatterPhysics } from "./types.js";
|
|
3
3
|
export type MatterPhysicsContextProviderOptions = {
|
|
4
4
|
isRunning?: boolean;
|
|
5
5
|
config: MatterPhysicsConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./MatterPhysics.context";
|
|
2
|
-
export * from "./useCollisionEventHandler";
|
|
3
|
-
export * from "./usePhysicsTickerCallback";
|
|
4
|
-
export * from "./usePhysicsEngineEventHandler";
|
|
1
|
+
export * from "./MatterPhysics.context.js";
|
|
2
|
+
export * from "./useCollisionEventHandler.js";
|
|
3
|
+
export * from "./usePhysicsTickerCallback.js";
|
|
4
|
+
export * from "./usePhysicsEngineEventHandler.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./MatterPhysics.context";
|
|
2
|
-
export * from "./useCollisionEventHandler";
|
|
3
|
-
export * from "./usePhysicsTickerCallback";
|
|
4
|
-
export * from "./usePhysicsEngineEventHandler";
|
|
1
|
+
export * from "./MatterPhysics.context.js";
|
|
2
|
+
export * from "./useCollisionEventHandler.js";
|
|
3
|
+
export * from "./usePhysicsTickerCallback.js";
|
|
4
|
+
export * from "./usePhysicsEngineEventHandler.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
import { Events } from "matter-js";
|
|
3
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
3
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
4
4
|
export const useCollisionEventHandler = ({ isEnabled = true, event, callback }) => {
|
|
5
5
|
const { engine } = useContext(MatterPhysicsContext);
|
|
6
6
|
useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
import { Events } from "matter-js";
|
|
3
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
3
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
4
4
|
export const usePhysicsEngineEventHandler = ({ isEnabled = true, event, callback }) => {
|
|
5
5
|
const { engine } = useContext(MatterPhysicsContext);
|
|
6
6
|
useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
import { Events } from "matter-js";
|
|
3
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
3
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
4
4
|
export const usePhysicsTickerCallback = ({ isEnabled = true, callback }) => {
|
|
5
5
|
const { runner } = useContext(MatterPhysicsContext);
|
|
6
6
|
useEffect(() => {
|
package/dist/src/stage/Stage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
|
-
import { useWorld } from "../hooks";
|
|
3
|
-
import { Layer } from "../layer";
|
|
4
|
-
import { StageContext } from "./Stage.context";
|
|
2
|
+
import { useWorld } from "../hooks/useWorld.js";
|
|
3
|
+
import { Layer } from "../layer/Layer.js";
|
|
4
|
+
import { StageContext } from "./Stage.context.js";
|
|
5
5
|
export const Stage = ({ children }) => {
|
|
6
6
|
const { application } = useWorld();
|
|
7
7
|
const [things, setThings] = useState([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Stage";
|
|
1
|
+
export * from "./Stage.js";
|
package/dist/src/stage/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Stage";
|
|
1
|
+
export * from "./Stage.js";
|
package/dist/src/world/World.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { createRef, useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Application } from "pixi.js";
|
|
3
|
-
import { Stage } from "../stage";
|
|
4
|
-
import { AssetsManager } from "../assets-manager";
|
|
5
|
-
import { WorldContext } from "./World.context";
|
|
3
|
+
import { Stage } from "../stage/Stage.js";
|
|
4
|
+
import { AssetsManager } from "../assets-manager/AssetsManager.js";
|
|
5
|
+
import { WorldContext } from "./World.context.js";
|
|
6
6
|
export const World = ({ children, eventMode, size }) => {
|
|
7
7
|
const canvasRef = createRef();
|
|
8
8
|
const [applicationRef, setApplicationRef] = useState(null);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./World.context";
|
|
2
|
-
export * from "./World";
|
|
1
|
+
export * from "./World.context.js";
|
|
2
|
+
export * from "./World.js";
|
package/dist/src/world/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./World.context";
|
|
2
|
-
export * from "./World";
|
|
1
|
+
export * from "./World.context.js";
|
|
2
|
+
export * from "./World.js";
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@types/matter-js": "^0.20.2",
|
|
9
9
|
"matter-js": "^0.20.0",
|
|
10
10
|
"pixi-viewport": "^6.0.3",
|
|
11
|
-
"pixi.js": "^8.14.
|
|
11
|
+
"pixi.js": "^8.14.3"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"react": "^19.x.x"
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
18
18
|
"@eslint/js": "9.39.1",
|
|
19
|
-
"@types/react": "^19.2.
|
|
20
|
-
"eslint": "^9.39.
|
|
19
|
+
"@types/react": "^19.2.7",
|
|
20
|
+
"eslint": "^9.39.2",
|
|
21
21
|
"eslint-config-prettier": "^10.1.8",
|
|
22
22
|
"eslint-plugin-import": "^2.32.0",
|
|
23
|
-
"eslint-plugin-jest": "^29.
|
|
23
|
+
"eslint-plugin-jest": "^29.10.1",
|
|
24
24
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
25
25
|
"eslint-plugin-prettier": "^5.5.4",
|
|
26
26
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"husky": "^9.1.7",
|
|
29
29
|
"jest": "^30.2.0",
|
|
30
30
|
"jest-watch-typeahead": "^3.0.1",
|
|
31
|
-
"lint-staged": "^16.2.
|
|
31
|
+
"lint-staged": "^16.2.7",
|
|
32
32
|
"react-app-polyfill": "^3.0.0",
|
|
33
|
-
"ts-jest": "^29.4.
|
|
33
|
+
"ts-jest": "^29.4.6",
|
|
34
34
|
"ts-node": "^10.9.2",
|
|
35
35
|
"typescript": "^5.9.3",
|
|
36
|
-
"typescript-eslint": "^8.
|
|
36
|
+
"typescript-eslint": "^8.50.1"
|
|
37
37
|
},
|
|
38
38
|
"description": "This module offers a set of common components needed for playing games.",
|
|
39
39
|
"keywords": [
|
|
@@ -71,6 +71,6 @@
|
|
|
71
71
|
"build": "tsc",
|
|
72
72
|
"build:dev": "tsc -w"
|
|
73
73
|
},
|
|
74
|
-
"version": "2.2.
|
|
74
|
+
"version": "2.2.1",
|
|
75
75
|
"webpack": "./src/index.ts"
|
|
76
76
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Assets } from "pixi.js";
|
|
3
|
-
import { Asset, AssetsManagerContext, AssetsManagerContextValue } from "./AssetsManager.context";
|
|
3
|
+
import { Asset, AssetsManagerContext, AssetsManagerContextValue } from "./AssetsManager.context.js";
|
|
4
4
|
|
|
5
5
|
export const AssetsManager: React.FC<PropsWithChildren> = ({ children }) => {
|
|
6
6
|
const [isFetching, setIsFetching] = useState(false);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./AssetsManager";
|
|
2
|
-
export * from "./AssetsManager.context";
|
|
3
|
-
export * from "./useAssetManager";
|
|
1
|
+
export * from "./AssetsManager.js";
|
|
2
|
+
export * from "./AssetsManager.context.js";
|
|
3
|
+
export * from "./useAssetManager.js";
|
package/src/camera/Camera.tsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
3
|
import { Viewport as ViewportContainer } from "pixi-viewport";
|
|
4
|
-
import { StageContextValue } from "../stage/Stage.context";
|
|
5
|
-
import { Layer } from "../layer";
|
|
6
|
-
import { useStage
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { StageContextValue } from "../stage/Stage.context.js";
|
|
5
|
+
import { Layer } from "../layer/Layer.js";
|
|
6
|
+
import { useStage } from "../hooks/useStage.js";
|
|
7
|
+
import { useWorld } from "../hooks/useWorld.js";
|
|
8
|
+
import { LayerContext } from "../layer/Layer.context.js";
|
|
9
|
+
import { CameraContext, EnsureVisibleOptions } from "./Camera.context.js";
|
|
9
10
|
|
|
10
11
|
type CameraProps = {
|
|
11
12
|
clampZoom?: Parameters<ViewportContainer["clampZoom"]>[0];
|
package/src/camera/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Camera";
|
|
2
|
-
export * from "./Camera.context";
|
|
1
|
+
export * from "./Camera.js";
|
|
2
|
+
export * from "./Camera.context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren, createContext, useCallback, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { GameStatus, GameStatusChangeEvent } from "../types";
|
|
2
|
+
import { GameStatus, GameStatusChangeEvent } from "../types.js";
|
|
3
3
|
|
|
4
4
|
export type GameContextValue = {
|
|
5
5
|
readonly reset: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Game.context";
|
|
1
|
+
export * from "./Game.context.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./usePhysicalObject";
|
|
2
|
-
export * from "./useWalls";
|
|
1
|
+
export * from "./usePhysicalObject.js";
|
|
2
|
+
export * from "./useWalls.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body, Composite } from "matter-js";
|
|
2
2
|
import { useContext, useEffect } from "react";
|
|
3
|
-
import { MatterPhysicsContext } from "../physics";
|
|
4
|
-
import { Nullable } from "../types";
|
|
3
|
+
import { MatterPhysicsContext } from "../physics/MatterPhysics.context.js";
|
|
4
|
+
import { Nullable } from "../types.js";
|
|
5
5
|
|
|
6
6
|
export const usePhysicalObject = ({ physicalObject }: { physicalObject: Nullable<Body | Composite> }) => {
|
|
7
7
|
const { addBody, removeBody } = useContext(MatterPhysicsContext);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Body } from "matter-js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { Nullable } from "../types";
|
|
4
|
-
import { GameObjectPhysicalObjectConfig } from "./GameObjectPhysicalObjectConfig";
|
|
5
|
-
import { usePhysicalObject } from "./usePhysicalObject";
|
|
3
|
+
import { Nullable } from "../types.js";
|
|
4
|
+
import { GameObjectPhysicalObjectConfig } from "./GameObjectPhysicalObjectConfig.js";
|
|
5
|
+
import { usePhysicalObject } from "./usePhysicalObject.js";
|
|
6
6
|
|
|
7
7
|
export const usePhysicalObjectFromConfig = <PhysicalObjectType extends Nullable<Body> = Body>({
|
|
8
8
|
position = { x: 0, y: 0 },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { Bodies, Body, Composite } from "matter-js";
|
|
3
|
-
import { MatterPhysicsContext } from "../physics/MatterPhysics.context";
|
|
3
|
+
import { MatterPhysicsContext } from "../physics/MatterPhysics.context.js";
|
|
4
4
|
|
|
5
5
|
type WallOptions = {
|
|
6
6
|
thikness: number;
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./useGlobalEventHandler";
|
|
2
|
-
export * from "./useStage";
|
|
3
|
-
export * from "./useTickerCallback";
|
|
4
|
-
export * from "./useWorld";
|
|
5
|
-
export * from "./useLayerContext";
|
|
6
|
-
export * from "./useSprite";
|
|
7
|
-
export * from "./useAnimatedSprite";
|
|
8
|
-
export * from "./useTexture";
|
|
9
|
-
export * from "./useGame";
|
|
10
|
-
export * from "./useTilingSprite";
|
|
11
|
-
export * from "./useCamera";
|
|
12
|
-
export * from "./useCollisionDetection";
|
|
1
|
+
export * from "./useGlobalEventHandler.js";
|
|
2
|
+
export * from "./useStage.js";
|
|
3
|
+
export * from "./useTickerCallback.js";
|
|
4
|
+
export * from "./useWorld.js";
|
|
5
|
+
export * from "./useLayerContext.js";
|
|
6
|
+
export * from "./useSprite.js";
|
|
7
|
+
export * from "./useAnimatedSprite.js";
|
|
8
|
+
export * from "./useTexture.js";
|
|
9
|
+
export * from "./useGame.js";
|
|
10
|
+
export * from "./useTilingSprite.js";
|
|
11
|
+
export * from "./useCamera.js";
|
|
12
|
+
export * from "./useCollisionDetection.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { AnimatedSprite, AnimatedSpriteOptions, Spritesheet, SpritesheetData } from "pixi.js";
|
|
4
|
-
import { useTextures } from "./useTexture";
|
|
5
|
-
import { useObject } from "./useObject";
|
|
4
|
+
import { useTextures } from "./useTexture.js";
|
|
5
|
+
import { useObject } from "./useObject.js";
|
|
6
6
|
|
|
7
7
|
type UseAnimatedSpriteOptions = Omit<AnimatedSpriteOptions, "textures" | "texture"> & {
|
|
8
8
|
texture: string;
|
package/src/hooks/useCamera.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import { useTickerCallback } from "./useTickerCallback";
|
|
3
|
+
import { useTickerCallback } from "./useTickerCallback.js";
|
|
4
4
|
|
|
5
5
|
type UseCollisionDetectionOptions = {
|
|
6
6
|
objectA?: Container | null;
|
package/src/hooks/useGame.ts
CHANGED
package/src/hooks/useObject.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sprite, SpriteOptions, TilingSprite } from "pixi.js";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import { useLayerContext } from "./useLayerContext";
|
|
3
|
+
import { useLayerContext } from "./useLayerContext.js";
|
|
4
4
|
|
|
5
5
|
type UseObjectOptions = Omit<SpriteOptions, "texture"> & {
|
|
6
6
|
object: Sprite | TilingSprite | null;
|
package/src/hooks/useSprite.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { Sprite, SpriteOptions } from "pixi.js";
|
|
4
|
-
import { useTextures } from "./useTexture";
|
|
5
|
-
import { useObject } from "./useObject";
|
|
4
|
+
import { useTextures } from "./useTexture.js";
|
|
5
|
+
import { useObject } from "./useObject.js";
|
|
6
6
|
|
|
7
7
|
type UseSpriteOptions = Omit<SpriteOptions, "texture"> & {
|
|
8
8
|
texture: string;
|
package/src/hooks/useStage.ts
CHANGED
package/src/hooks/useTexture.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { Texture } from "pixi.js";
|
|
4
|
-
import { useAssetManager } from "../assets-manager";
|
|
4
|
+
import { useAssetManager } from "../assets-manager/useAssetManager.js";
|
|
5
5
|
|
|
6
6
|
export const useTextures = ({ keys = [] }: { keys?: string[] }) => {
|
|
7
7
|
const { getAsset, isFetched, isFetching, isError } = useAssetManager();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { TilingSpriteOptions, TilingSprite } from "pixi.js";
|
|
4
|
-
import { useTextures } from "./useTexture";
|
|
5
|
-
import { useObject } from "./useObject";
|
|
4
|
+
import { useTextures } from "./useTexture.js";
|
|
5
|
+
import { useObject } from "./useObject.js";
|
|
6
6
|
|
|
7
7
|
type UseTilingSpriteOptions = Omit<TilingSpriteOptions, "texture"> & {
|
|
8
8
|
texture: string;
|
package/src/hooks/useWorld.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./game-context";
|
|
2
|
-
export * from "./world";
|
|
3
|
-
export * from "./camera";
|
|
4
|
-
export * from "./layer";
|
|
5
|
-
export * from "./assets-manager";
|
|
6
|
-
export * from "./game-objects";
|
|
7
|
-
export * from "./physics";
|
|
8
|
-
export * from "./types";
|
|
9
|
-
export * from "./hooks";
|
|
1
|
+
export * from "./game-context/index.js";
|
|
2
|
+
export * from "./world/index.js";
|
|
3
|
+
export * from "./camera/index.js";
|
|
4
|
+
export * from "./layer/index.js";
|
|
5
|
+
export * from "./assets-manager/index.js";
|
|
6
|
+
export * from "./game-objects/index.js";
|
|
7
|
+
export * from "./physics/index.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./hooks/index.js";
|
package/src/layer/Layer.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { Container, ContainerOptions } from "pixi.js";
|
|
3
|
-
import { StageContext } from "../stage/Stage.context";
|
|
4
|
-
import { LayerContext, LayerContextValue } from "./Layer.context";
|
|
3
|
+
import { StageContext } from "../stage/Stage.context.js";
|
|
4
|
+
import { LayerContext, LayerContextValue } from "./Layer.context.js";
|
|
5
5
|
|
|
6
6
|
export type LayerOptions = {
|
|
7
7
|
options?: Omit<ContainerOptions, "parent">;
|
package/src/layer/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Layer";
|
|
1
|
+
export * from "./Layer.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, createContext, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import Matter, { Engine, Runner, World } from "matter-js";
|
|
3
|
-
import { MatterPhysicsConfig, MatterPhysics } from "./types";
|
|
3
|
+
import { MatterPhysicsConfig, MatterPhysics } from "./types.js";
|
|
4
4
|
|
|
5
5
|
export type MatterPhysicsContextProviderOptions = {
|
|
6
6
|
isRunning?: boolean;
|
package/src/physics/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./MatterPhysics.context";
|
|
2
|
-
export * from "./useCollisionEventHandler";
|
|
3
|
-
export * from "./usePhysicsTickerCallback";
|
|
4
|
-
export * from "./usePhysicsEngineEventHandler";
|
|
1
|
+
export * from "./MatterPhysics.context.js";
|
|
2
|
+
export * from "./useCollisionEventHandler.js";
|
|
3
|
+
export * from "./usePhysicsTickerCallback.js";
|
|
4
|
+
export * from "./usePhysicsEngineEventHandler.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { Engine, Events, ICollisionCallback, IEvent } from "matter-js";
|
|
4
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
4
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
5
5
|
|
|
6
6
|
export type UseCollisionEventHandlerOptions = {
|
|
7
7
|
isEnabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { Events, IEngineCallback, IEvent, Engine } from "matter-js";
|
|
4
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
4
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
5
5
|
|
|
6
6
|
type UsePhysicsEngineEventHandlerOptions = {
|
|
7
7
|
isEnabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { Events, IRunnerCallback, IEvent, Runner } from "matter-js";
|
|
4
|
-
import { MatterPhysicsContext } from "./MatterPhysics.context";
|
|
4
|
+
import { MatterPhysicsContext } from "./MatterPhysics.context.js";
|
|
5
5
|
|
|
6
6
|
type UsePhysicsTickerCallbackOptions = {
|
|
7
7
|
isEnabled?: boolean;
|
package/src/stage/Stage.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
|
-
import { useWorld } from "../hooks";
|
|
4
|
-
import { Layer } from "../layer";
|
|
5
|
-
import { StageContext, StageContextValue } from "./Stage.context";
|
|
3
|
+
import { useWorld } from "../hooks/useWorld.js";
|
|
4
|
+
import { Layer } from "../layer/Layer.js";
|
|
5
|
+
import { StageContext, StageContextValue } from "./Stage.context.js";
|
|
6
6
|
|
|
7
7
|
export const Stage: React.FC<PropsWithChildren> = ({ children }) => {
|
|
8
8
|
const { application } = useWorld();
|
package/src/stage/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Stage";
|
|
1
|
+
export * from "./Stage.js";
|
package/src/world/World.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren, createRef, useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Application, EventMode } from "pixi.js";
|
|
3
|
-
import { Stage } from "../stage";
|
|
4
|
-
import { AssetsManager } from "../assets-manager";
|
|
5
|
-
import { WorldContextValue, WorldContext } from "./World.context";
|
|
3
|
+
import { Stage } from "../stage/Stage.js";
|
|
4
|
+
import { AssetsManager } from "../assets-manager/AssetsManager.js";
|
|
5
|
+
import { WorldContextValue, WorldContext } from "./World.context.js";
|
|
6
6
|
|
|
7
7
|
type WorldProps = {
|
|
8
8
|
eventMode?: EventMode;
|
package/src/world/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./World.context";
|
|
2
|
-
export * from "./World";
|
|
1
|
+
export * from "./World.context.js";
|
|
2
|
+
export * from "./World.js";
|