@osamash/floor-planner 1.0.6 → 1.0.7

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.
Files changed (23) hide show
  1. package/dist/floor-planner.es.js +38346 -22992
  2. package/dist/floor-planner.umd.js +3879 -23
  3. package/dist/types/react-planner/ReactPlanner.d.ts +2 -1
  4. package/dist/types/react-planner/catalog/catalog.d.ts +4 -0
  5. package/dist/types/react-planner/catalog/factories/AreaFactory.d.ts +1 -1
  6. package/dist/types/react-planner/catalog/factories/area-factory-3d.d.ts +17 -2
  7. package/dist/types/react-planner/catalog/factories/wall-factory-3d.d.ts +15 -1
  8. package/dist/types/react-planner/hooks/useScreenshotBeforeUnload.d.ts +1 -1
  9. package/dist/types/react-planner/toolbar/Toolbar.d.ts +2 -1
  10. package/dist/types/react-planner/utils/immutablediff/diff.d.ts +24 -0
  11. package/dist/types/react-planner/utils/immutablediff/index.d.ts +2 -0
  12. package/dist/types/react-planner/utils/immutablediff/lcs.d.ts +48 -0
  13. package/dist/types/react-planner/utils/immutablediff/path.d.ts +14 -0
  14. package/dist/types/react-planner/utils/immutablediff/utils.d.ts +10 -0
  15. package/dist/types/react-planner/viewer3d/grid-creator.d.ts +3 -0
  16. package/dist/types/react-planner/viewer3d/grids/grid-horizontal-streak.d.ts +2 -0
  17. package/dist/types/react-planner/viewer3d/grids/grid-vertical-streak.d.ts +2 -0
  18. package/dist/types/react-planner/viewer3d/libs/first-person-controls.d.ts +11 -0
  19. package/dist/types/react-planner/viewer3d/libs/helvetiker_regular.typeface.d.ts +1281 -0
  20. package/dist/types/react-planner/viewer3d/scene-creator.d.ts +15 -0
  21. package/dist/types/react-planner/viewer3d/three-memory-cleaner.d.ts +3 -0
  22. package/dist/types/react-planner/viewer3d/viewer3d.d.ts +32 -0
  23. package/package.json +1 -1
@@ -3,8 +3,9 @@ import "./react-planner.css";
3
3
  interface ReactPlannerProps {
4
4
  catalog: any;
5
5
  plan: PlanType;
6
+ has3dView?: boolean;
6
7
  onBack?: () => void;
7
8
  onSave?: (data: any) => void;
8
9
  }
9
- declare const ReactPlanner: ({ plan, catalog, onSave, onBack }: ReactPlannerProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const ReactPlanner: ({ plan, catalog, onSave, onBack, has3dView, }: ReactPlannerProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export default ReactPlanner;
@@ -24,6 +24,9 @@ interface Render2DFunction {
24
24
  interface Render3DFunction {
25
25
  (element: any, layer: any, scene: any): Promise<Three.Object3D>;
26
26
  }
27
+ interface UpdateRender3DFunction {
28
+ (element: any, layer: any, scene: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any): Promise<Three.Object3D>;
29
+ }
27
30
  export interface CatalogElement {
28
31
  name: string;
29
32
  prototype: string;
@@ -31,6 +34,7 @@ export interface CatalogElement {
31
34
  properties: ItemProperties;
32
35
  render2D: Render2DFunction;
33
36
  render3D: Render3DFunction;
37
+ updateRender3D: UpdateRender3DFunction;
34
38
  }
35
39
  export interface CatalogCategory {
36
40
  name: string;
@@ -20,5 +20,5 @@ export default function AreaFactory(name: string, info: any, textures: any): {
20
20
  };
21
21
  render2D: (element: any, layer: any, scene: any) => import("react/jsx-runtime").JSX.Element;
22
22
  render3D: (element: any, layer: any, scene: any) => Promise<import("three").Mesh<import("three").ShapeGeometry, import("three").MeshPhongMaterial, import("three").Object3DEventMap>>;
23
- updateRender3D: (element: any, layer: any, scene: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any) => any;
23
+ updateRender3D: (element: any, layer: any, scene: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any) => Promise<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>>;
24
24
  };
@@ -1,3 +1,18 @@
1
1
  import { MeshPhongMaterial, ShapeGeometry, Mesh } from "three";
2
- export declare function createArea(element: any, layer: any, scene: any, textures: any): Promise<Mesh<ShapeGeometry, MeshPhongMaterial, import("three").Object3DEventMap>>;
3
- export declare function updatedArea(element: any, layer: any, scene: any, textures: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any): any;
2
+ import * as THREE from "three";
3
+ import type { Layer, Scene } from "../../models";
4
+ type TextureData = {
5
+ uri: string;
6
+ lengthRepeatScale: number;
7
+ heightRepeatScale: number;
8
+ normal?: {
9
+ uri: string;
10
+ normalScaleX: number;
11
+ normalScaleY: number;
12
+ lengthRepeatScale: number;
13
+ heightRepeatScale: number;
14
+ };
15
+ };
16
+ export declare function createArea(element: any, layer: Layer, scene: Scene, textures: Record<string, TextureData>): Promise<Mesh<ShapeGeometry, MeshPhongMaterial, THREE.Object3DEventMap>>;
17
+ export declare function updatedArea(element: any, layer: Layer, scene: Scene, textures: Record<string, TextureData>, mesh: Mesh, oldElement: any, differences: string[], selfDestroy: () => void, selfBuild: () => Promise<Mesh>): Promise<Mesh>;
18
+ export {};
@@ -1,3 +1,17 @@
1
1
  import { Group } from "three";
2
- export declare function buildWall(element: any, layer: any, scene: any, textures: any): Promise<Group<import("three").Object3DEventMap>>;
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 buildWall(element: any, layer: Layer, scene: Scene, textures: Record<string, TextureInfo>): Promise<Group>;
3
16
  export declare function updatedWall(element: any, layer: any, scene: any, textures: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any): any;
17
+ export {};
@@ -1,4 +1,4 @@
1
1
  export declare function useScreenshotBeforeUnload(onReady?: (img: string) => void): {
2
2
  ensureScreenshot: () => Promise<void>;
3
- screenshotDone: import("react").RefObject<boolean>;
3
+ screenshotDone: import("react").MutableRefObject<boolean>;
4
4
  };
@@ -1,6 +1,7 @@
1
1
  import type Catalog from "../catalog/catalog";
2
2
  interface ToolbarProps {
3
3
  catalog: Catalog;
4
+ has3dView?: boolean;
4
5
  }
5
- declare function Toolbar({ catalog }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function Toolbar({ catalog, has3dView }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
6
7
  export default Toolbar;
@@ -0,0 +1,24 @@
1
+ import { List, Collection, Record } from "immutable";
2
+ import { op } from "./utils";
3
+ /**
4
+ * Compute the diff between two Immutable.Map-like objects.
5
+ */
6
+ export declare const mapDiff: (a: any, b: any, p?: string) => ReturnType<typeof op>[];
7
+ /**
8
+ * Compute diff between two Immutable.Record instances.
9
+ * Returns JSON-patch-like operations (add, remove, replace).
10
+ */
11
+ export declare const recordDiff: (a: Record<any>, b: Record<any>, p?: string) => ReturnType<typeof op>[];
12
+ /**
13
+ * Compute the diff between two Immutable.List-like sequences.
14
+ */
15
+ export declare const sequenceDiff: (a: Collection.Indexed<any>, b: Collection.Indexed<any>, p?: string) => ReturnType<typeof op>[];
16
+ /**
17
+ * Diff for primitive types (non-collections)
18
+ */
19
+ export declare const primitiveTypeDiff: (a: any, b: any, p?: string) => ReturnType<typeof op>[];
20
+ /**
21
+ * Main diff entry point — handles maps, lists, and primitives.
22
+ */
23
+ export declare const diff: (a: any, b: any, p?: string) => List<ReturnType<typeof op>> | any;
24
+ export default diff;
@@ -0,0 +1,2 @@
1
+ import diff from "./diff";
2
+ export default diff;
@@ -0,0 +1,48 @@
1
+ import { Record, Collection } from "immutable";
2
+ /**
3
+ * Returns a two-dimensional array (an array of arrays) with dimensions n by m.
4
+ * All the elements of this new matrix are initially equal to x.
5
+ */
6
+ export declare const makeMatrix: <T>(n: number, m: number, x?: T) => T[][];
7
+ /**
8
+ * Record types for diff operations.
9
+ */
10
+ export declare const DiffResult: Record.Factory<{
11
+ op: "=" | "+" | "-" | "!=";
12
+ val: unknown;
13
+ }>;
14
+ export declare const ReplaceResult: Record.Factory<{
15
+ op: "=" | "+" | "-" | "!=";
16
+ val: unknown;
17
+ newVal: unknown;
18
+ }>;
19
+ export type DiffRecord = ReturnType<typeof DiffResult>;
20
+ export type ReplaceRecord = ReturnType<typeof ReplaceResult>;
21
+ /**
22
+ * Computes Longest Common Subsequence between two Immutable.js Indexed Iterables
23
+ * Based on Dynamic Programming http://rosettacode.org/wiki/Longest_common_subsequence#Java
24
+ */
25
+ export declare const lcs: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => T[];
26
+ /**
27
+ * Computes the diff between two Indexed Sequences
28
+ * @returns Array of DiffResult | ReplaceResult
29
+ */
30
+ export declare const diff: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => (DiffRecord | ReplaceRecord)[];
31
+ /**
32
+ * Computes the Longest Common Subsequence (LCS) matrix
33
+ */
34
+ export declare const computeLcsMatrix: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => number[][];
35
+ /**
36
+ * Extracts the LCS from matrix M
37
+ */
38
+ export declare const backtrackLcs: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>, matrix: number[][]) => T[];
39
+ /**
40
+ * Prints the diff result array
41
+ */
42
+ export declare const printDiff: <T>(matrix: number[][], xs: Collection.Indexed<T>, ys: Collection.Indexed<T>, xSize: number, ySize: number) => (DiffRecord | ReplaceRecord)[];
43
+ declare const _default: {
44
+ lcs: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => T[];
45
+ diff: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => (DiffRecord | ReplaceRecord)[];
46
+ computeLcsMatrix: <T>(xs: Collection.Indexed<T>, ys: Collection.Indexed<T>) => number[][];
47
+ };
48
+ export default _default;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Escapes a string or number for use in a JSON Pointer path segment.
3
+ * Replaces '~' with '~0' and '/' with '~1'
4
+ */
5
+ export declare const escape: (str: string | number) => string;
6
+ /**
7
+ * Unescapes a JSON Pointer path segment.
8
+ * Replaces '~1' with '/' and '~0' with '~'
9
+ */
10
+ export declare const unescape: (str: unknown) => string | unknown;
11
+ /**
12
+ * Concatenates two JSON Pointer path segments.
13
+ */
14
+ export declare const concat: (path: string, key: string | number) => string;
@@ -0,0 +1,10 @@
1
+ import { Collection, Record } from "immutable";
2
+ export declare const isMap: <K = unknown, V = unknown>(obj: unknown) => obj is Collection.Keyed<K, V>;
3
+ export declare const isIndexedCollection: <T = unknown>(obj: unknown) => obj is Collection.Indexed<T>;
4
+ export declare const isRecord: (obj: unknown) => obj is Record<any>;
5
+ export interface Operation {
6
+ op: "add" | "replace" | "remove";
7
+ path: string;
8
+ value?: unknown;
9
+ }
10
+ export declare const op: (operation: "add" | "replace" | "remove", path: string, value?: unknown) => Operation;
@@ -0,0 +1,3 @@
1
+ import * as THREE from "three";
2
+ import type { Scene } from "../models";
3
+ export default function createGrid(scene: Scene): THREE.Object3D;
@@ -0,0 +1,2 @@
1
+ import * as THREE from "three";
2
+ export default function (width: number, height: number, grid: any, font: any): THREE.Object3D<THREE.Object3DEventMap>;
@@ -0,0 +1,2 @@
1
+ import * as THREE from "three";
2
+ export default function (width: number, height: number, grid: any, font: any): THREE.Object3D;
@@ -0,0 +1,11 @@
1
+ import * as THREE from "three";
2
+ export interface MovementState {
3
+ moveForward: boolean;
4
+ moveLeft: boolean;
5
+ moveBackward: boolean;
6
+ moveRight: boolean;
7
+ canJump: boolean;
8
+ velocity: THREE.Vector3;
9
+ }
10
+ export declare function firstPersonOnKeyDown(event: KeyboardEvent, moveForward: boolean, moveLeft: boolean, moveBackward: boolean, moveRight: boolean, canJump: boolean, velocity: THREE.Vector3): Omit<MovementState, "velocity">;
11
+ export declare function firstPersonOnKeyUp(event: KeyboardEvent, moveForward: boolean, moveLeft: boolean, moveBackward: boolean, moveRight: boolean, canJump: boolean): Omit<MovementState, "velocity">;