@osamash/floor-planner 1.1.7 → 1.1.9
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/floor-planner.es.js +9282 -8986
- package/dist/floor-planner.umd.js +156 -156
- package/dist/types/index.d.ts +2 -2
- package/dist/types/react-planner/catalog/catalog.d.ts +1 -1
- package/dist/types/react-planner/catalog/factories/SurfaceFactory.d.ts +9 -0
- package/dist/types/react-planner/catalog/factories/WallFactory.d.ts +1 -1
- package/dist/types/react-planner/catalog/factories/index.d.ts +5 -3
- package/dist/types/react-planner/catalog/factories/surface-factory-3d.d.ts +17 -0
- package/dist/types/react-planner/class/area.d.ts +2 -0
- package/dist/types/react-planner/class/index.d.ts +3 -1
- package/dist/types/react-planner/class/item.d.ts +1 -1
- package/dist/types/react-planner/class/line.d.ts +1 -1
- package/dist/types/react-planner/class/surface-old.d.ts +15 -0
- package/dist/types/react-planner/class/surface.d.ts +15 -0
- package/dist/types/react-planner/constants.d.ts +2 -0
- package/dist/types/react-planner/models.d.ts +1 -0
- package/dist/types/react-planner/viewer2d/Layer.d.ts +3 -1
- package/dist/types/react-planner/viewer2d/Line.d.ts +3 -1
- package/dist/types/react-planner/viewer2d/Scene.d.ts +3 -1
- package/dist/types/store/ReactPlannerStore.d.ts +7 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ReactPlanner from "./react-planner/ReactPlanner";
|
|
2
2
|
import ReactPlannerLoader from "./react-planner/ReactPlannerLoader";
|
|
3
3
|
import convertUnits, { type Unit } from "./react-planner/utils/convert-units";
|
|
4
|
-
import Catalog, { AreaFactory, WallFactory } from "./react-planner/catalog";
|
|
5
|
-
export { Catalog, AreaFactory, WallFactory, convertUnits, type Unit, ReactPlannerLoader, };
|
|
4
|
+
import Catalog, { AreaFactory, WallFactory, SurfaceFactory } from "./react-planner/catalog";
|
|
5
|
+
export { Catalog, AreaFactory, WallFactory, SurfaceFactory, convertUnits, type Unit, ReactPlannerLoader, };
|
|
6
6
|
export default ReactPlanner;
|
|
@@ -20,7 +20,7 @@ interface ItemInfo {
|
|
|
20
20
|
visibility: Record<string, boolean>;
|
|
21
21
|
}
|
|
22
22
|
interface Render2DFunction {
|
|
23
|
-
(element: any, layer: any, scene?: any): React.ReactElement;
|
|
23
|
+
(element: any, layer: any, scene?: any, mode?: string): React.ReactElement;
|
|
24
24
|
}
|
|
25
25
|
interface Render3DFunction {
|
|
26
26
|
(element: any, layer: any, scene: any): Promise<Three.Object3D>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default function SurfaceFactory(name: string, info: any, textures: any): {
|
|
2
|
+
name: string;
|
|
3
|
+
prototype: string;
|
|
4
|
+
info: any;
|
|
5
|
+
properties: {};
|
|
6
|
+
render2D: (element: any, layer: any, scene: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
render3D: (element: any, layer: any, scene: any) => Promise<import("three").Group<import("three").Object3DEventMap>>;
|
|
8
|
+
updateRender3D: (element: any, layer: any, scene: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any) => Promise<any>;
|
|
9
|
+
};
|
|
@@ -20,7 +20,7 @@ export default function WallFactory(name: string, info: any, textures: any): {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
render2D: (element: any, layer: any, scene: any) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
render2D: (element: any, layer: any, scene: any, mode: string) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
render3D: (element: any, layer: any, scene: any) => Promise<import("three").Group<import("three").Object3DEventMap>>;
|
|
25
25
|
updateRender3D: (element: any, layer: any, scene: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any) => any;
|
|
26
26
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import WallFactory from "./WallFactory";
|
|
2
1
|
import AreaFactory from "./AreaFactory";
|
|
3
|
-
|
|
2
|
+
import WallFactory from "./WallFactory";
|
|
3
|
+
import SurfaceFactory from "./SurfaceFactory";
|
|
4
|
+
export { AreaFactory, WallFactory, SurfaceFactory };
|
|
4
5
|
declare const _default: {
|
|
5
|
-
WallFactory: typeof WallFactory;
|
|
6
6
|
AreaFactory: typeof AreaFactory;
|
|
7
|
+
WallFactory: typeof WallFactory;
|
|
8
|
+
SurfaceFactory: typeof SurfaceFactory;
|
|
7
9
|
};
|
|
8
10
|
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Group } from "three";
|
|
2
|
+
import type { Layer, Scene } from "../../models";
|
|
3
|
+
type TextureInfo = {
|
|
4
|
+
uri: string;
|
|
5
|
+
lengthRepeatScale?: number;
|
|
6
|
+
heightRepeatScale?: number;
|
|
7
|
+
normal?: {
|
|
8
|
+
uri: string;
|
|
9
|
+
normalScaleX?: number;
|
|
10
|
+
normalScaleY?: number;
|
|
11
|
+
lengthRepeatScale?: number;
|
|
12
|
+
heightRepeatScale?: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function buildSurface(element: any, layer: Layer, scene: Scene, textures: Record<string, TextureInfo>): Promise<Group>;
|
|
16
|
+
export declare function updatedSurface(element: any, layer: any, scene: any, textures: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any): Promise<any>;
|
|
17
|
+
export {};
|
|
@@ -6,8 +6,9 @@ import Hole from "./hole";
|
|
|
6
6
|
import Vertex from "./vertex";
|
|
7
7
|
import Area from "./area";
|
|
8
8
|
import Item from "./item";
|
|
9
|
+
import Surface from "./surface";
|
|
9
10
|
import { HorizontalGuide, VerticalGuide } from "./guide";
|
|
10
|
-
export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide, };
|
|
11
|
+
export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide, Surface, };
|
|
11
12
|
declare const _default: {
|
|
12
13
|
Project: typeof Project;
|
|
13
14
|
Group: typeof Group;
|
|
@@ -17,6 +18,7 @@ declare const _default: {
|
|
|
17
18
|
Vertex: typeof Vertex;
|
|
18
19
|
Area: typeof Area;
|
|
19
20
|
Item: typeof Item;
|
|
21
|
+
Surface: typeof Surface;
|
|
20
22
|
HorizontalGuide: typeof HorizontalGuide;
|
|
21
23
|
VerticalGuide: typeof VerticalGuide;
|
|
22
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare class Item {
|
|
2
|
-
static create(state: any, layerID: any, type: any, x: any, y: any, width: any, height: any, rotation: any): {
|
|
2
|
+
static create(state: any, layerID: any, type: any, x: any, y: any, width: any, height: any, rotation: any, altitude: any): {
|
|
3
3
|
updatedState: any;
|
|
4
4
|
item: any;
|
|
5
5
|
};
|
|
@@ -4,7 +4,7 @@ declare class Line {
|
|
|
4
4
|
updatedState: any;
|
|
5
5
|
line: any;
|
|
6
6
|
};
|
|
7
|
-
static select(state: any, layerID: string, lineID: string): {
|
|
7
|
+
static select(state: any, layerID: string, lineID: string, layerSelected?: boolean): {
|
|
8
8
|
updatedState: any;
|
|
9
9
|
};
|
|
10
10
|
static remove(state: any, layerID: string, lineID: string): {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare class Surface {
|
|
2
|
+
static selectToolDrawingSurface(state: any, sceneComponentType: string): {
|
|
3
|
+
updatedState: any;
|
|
4
|
+
};
|
|
5
|
+
static beginDrawingSurface(state: any, layerID: string, x: number, y: number): {
|
|
6
|
+
updatedState: any;
|
|
7
|
+
};
|
|
8
|
+
static updateDrawingSurface(state: any, x: number, y: number): {
|
|
9
|
+
updatedState: any;
|
|
10
|
+
};
|
|
11
|
+
static endDrawingSurface(state: any, x: number, y: number): {
|
|
12
|
+
updatedState: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default Surface;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare class Surface {
|
|
2
|
+
static selectToolDrawingSurface(state: any, sceneComponentType: string): {
|
|
3
|
+
updatedState: any;
|
|
4
|
+
};
|
|
5
|
+
static beginDrawingSurface(state: any, layerID: string, x: number, y: number): {
|
|
6
|
+
updatedState: any;
|
|
7
|
+
};
|
|
8
|
+
static updateDrawingSurface(state: any, x: number, y: number): {
|
|
9
|
+
updatedState: any;
|
|
10
|
+
};
|
|
11
|
+
static endDrawingSurface(state: any, x: number, y: number): {
|
|
12
|
+
updatedState: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default Surface;
|
|
@@ -202,6 +202,7 @@ export declare const MODE_2D_PAN = "MODE_2D_PAN";
|
|
|
202
202
|
export declare const MODE_3D_VIEW = "MODE_3D_VIEW";
|
|
203
203
|
export declare const MODE_3D_FIRST_PERSON = "MODE_3D_FIRST_PERSON";
|
|
204
204
|
export declare const MODE_WAITING_DRAWING_LINE = "MODE_WAITING_DRAWING_LINE";
|
|
205
|
+
export declare const MODE_WAITING_DRAWING_SURFACE = "MODE_WAITING_DRAWING_SURFACE";
|
|
205
206
|
export declare const MODE_DRAGGING_LINE = "MODE_DRAGGING_LINE";
|
|
206
207
|
export declare const MODE_DRAGGING_VERTEX = "MODE_DRAGGING_VERTEX";
|
|
207
208
|
export declare const MODE_DRAGGING_ITEM = "MODE_DRAGGING_ITEM";
|
|
@@ -209,6 +210,7 @@ export declare const MODE_DRAGGING_HOLE = "MODE_DRAGGING_HOLE";
|
|
|
209
210
|
export declare const MODE_DRAWING_LINE = "MODE_DRAWING_LINE";
|
|
210
211
|
export declare const MODE_DRAWING_HOLE = "MODE_DRAWING_HOLE";
|
|
211
212
|
export declare const MODE_DRAWING_ITEM = "MODE_DRAWING_ITEM";
|
|
213
|
+
export declare const MODE_DRAWING_SURFACE = "MODE_DRAWING_SURFACE";
|
|
212
214
|
export declare const MODE_ROTATING_ITEM = "MODE_ROTATING_ITEM";
|
|
213
215
|
export declare const MODE_UPLOADING_IMAGE = "MODE_UPLOADING_IMAGE";
|
|
214
216
|
export declare const MODE_FITTING_IMAGE = "MODE_FITTING_IMAGE";
|
|
@@ -2,8 +2,10 @@ import type Catalog from "../catalog/catalog";
|
|
|
2
2
|
import type { Scene } from "../models";
|
|
3
3
|
interface LayerProps {
|
|
4
4
|
layer: any;
|
|
5
|
+
mode: string;
|
|
5
6
|
scene: Scene;
|
|
7
|
+
showDimensions: boolean;
|
|
6
8
|
catalog: Catalog;
|
|
7
9
|
}
|
|
8
|
-
declare function Layer({ layer, scene, catalog }: LayerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Layer({ layer, scene, catalog, mode, showDimensions }: LayerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export default Layer;
|
|
@@ -3,8 +3,10 @@ import type { Scene } from "../models";
|
|
|
3
3
|
interface LineProps {
|
|
4
4
|
line: any;
|
|
5
5
|
layer: any;
|
|
6
|
+
mode: string;
|
|
6
7
|
scene: Scene;
|
|
8
|
+
showDimensions: boolean;
|
|
7
9
|
catalog: Catalog;
|
|
8
10
|
}
|
|
9
|
-
declare const Line: ({ line, layer, scene, catalog }: LineProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
declare const Line: ({ line, layer, scene, catalog, mode, showDimensions, }: LineProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
12
|
export default Line;
|
|
@@ -4,6 +4,8 @@ import type { Scene as SceneType } from "../models";
|
|
|
4
4
|
interface SceneProps {
|
|
5
5
|
scene: SceneType;
|
|
6
6
|
catalog: Catalog;
|
|
7
|
+
mode: string;
|
|
8
|
+
showDimensions: boolean;
|
|
7
9
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ scene, catalog }: SceneProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ scene, catalog, mode, showDimensions }: SceneProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
11
|
export default _default;
|
|
@@ -24,12 +24,15 @@ export interface ReactPlannerStore {
|
|
|
24
24
|
} | null;
|
|
25
25
|
rollback: () => void;
|
|
26
26
|
remove: () => void;
|
|
27
|
+
showDimensions: boolean;
|
|
28
|
+
setShowDimensions: (showDimensions: boolean) => void;
|
|
27
29
|
setToast: (toast: {
|
|
28
30
|
text: string;
|
|
29
31
|
} | null) => void;
|
|
30
32
|
setPlan: (plan: Plan) => void;
|
|
31
33
|
setAlterateState: () => void;
|
|
32
34
|
selectToolDrawingLine: (sceneComponentType: any) => void;
|
|
35
|
+
selectToolDrawingSurface: (sceneComponentType: any) => void;
|
|
33
36
|
selectToolDrawingItem: (sceneComponentType: any) => void;
|
|
34
37
|
selectToolDrawingHole: (sceneComponentType: any) => void;
|
|
35
38
|
pushLastSelectedCatalogElementToHistory: (element: any) => void;
|
|
@@ -48,8 +51,10 @@ export interface ReactPlannerStore {
|
|
|
48
51
|
endDrawingItem: (layerID: string, x: number, y: number) => void;
|
|
49
52
|
endDrawingHole: (layerID: string, x: number, y: number) => void;
|
|
50
53
|
beginDrawingLine: (layerID: string, x: number, y: number, snapMask: any) => void;
|
|
51
|
-
changeCatalogPage: (newPage: any, oldPage: any) => void;
|
|
52
54
|
endDrawingLine: (x: number, y: number, snapMask: any) => void;
|
|
55
|
+
beginDrawingSurface: (layerID: string, x: number, y: number, snapMask: any) => void;
|
|
56
|
+
endDrawingSurface: (x: number, y: number, snapMask: any) => void;
|
|
57
|
+
changeCatalogPage: (newPage: any, oldPage: any) => void;
|
|
53
58
|
endDraggingHole: (x: number, y: number) => void;
|
|
54
59
|
selectArea: (layerID: string, areaID: string) => void;
|
|
55
60
|
updateRotatingItem: (x: number, y: number) => void;
|
|
@@ -61,6 +66,7 @@ export interface ReactPlannerStore {
|
|
|
61
66
|
updateDrawingItem: (layerID: string, x: number, y: number) => void;
|
|
62
67
|
selectToolEdit: () => void;
|
|
63
68
|
updateDrawingLine: (x: number, y: number, snapMask: any) => void;
|
|
69
|
+
updateDrawingSurface: (x: number, y: number, snapMask: any) => void;
|
|
64
70
|
updateMouseCoord: (coords: {
|
|
65
71
|
x: number;
|
|
66
72
|
y: number;
|