@osamash/floor-planner 1.2.3 → 1.2.5

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 (86) hide show
  1. package/dist/floor-planner.css +1 -1
  2. package/dist/floor-planner.es.js +44841 -38060
  3. package/dist/floor-planner.umd.js +65 -51
  4. package/dist/types/index.d.ts +3 -1
  5. package/dist/types/react-planner/ReactPlanner.d.ts +3 -1
  6. package/dist/types/react-planner/ReactPlannerLoader.d.ts +20 -1
  7. package/dist/types/react-planner/ai-chat/AIChatBubble.d.ts +6 -0
  8. package/dist/types/react-planner/ai-chat/AIChatPanel.d.ts +8 -0
  9. package/dist/types/react-planner/ai-chat/SelectionChips.d.ts +2 -0
  10. package/dist/types/react-planner/ai-chat/ThinkingIndicator.d.ts +5 -0
  11. package/dist/types/react-planner/ai-chat/aiService.d.ts +340 -0
  12. package/dist/types/react-planner/ai-chat/imageUpload.d.ts +6 -0
  13. package/dist/types/react-planner/ai-chat/plannerActions.d.ts +20 -0
  14. package/dist/types/react-planner/ai-chat/streamingClient.d.ts +31 -0
  15. package/dist/types/react-planner/ai-chat/useTypewriter.d.ts +19 -0
  16. package/dist/types/react-planner/catalog/catalog.d.ts +24 -0
  17. package/dist/types/react-planner/catalog/factories/AreaFactory.d.ts +1 -24
  18. package/dist/types/react-planner/catalog/factories/ItemFactory.d.ts +2 -0
  19. package/dist/types/react-planner/catalog/factories/WallFactory.d.ts +1 -26
  20. package/dist/types/react-planner/catalog/factories/area-factory-3d.d.ts +2 -2
  21. package/dist/types/react-planner/catalog/factories/area-patterns.d.ts +42 -0
  22. package/dist/types/react-planner/catalog/factories/room-types.d.ts +22 -0
  23. package/dist/types/react-planner/catalog/factories/wall-factory-3d.d.ts +1 -1
  24. package/dist/types/react-planner/catalog/unknown-element.d.ts +10 -0
  25. package/dist/types/react-planner/class/area.d.ts +28 -1
  26. package/dist/types/react-planner/class/hole.d.ts +13 -0
  27. package/dist/types/react-planner/class/index.d.ts +3 -1
  28. package/dist/types/react-planner/class/item.d.ts +22 -0
  29. package/dist/types/react-planner/class/line.d.ts +12 -3
  30. package/dist/types/react-planner/class/room.d.ts +18 -0
  31. package/dist/types/react-planner/class/surface.d.ts +34 -0
  32. package/dist/types/react-planner/class/vertex.d.ts +6 -1
  33. package/dist/types/react-planner/components/ErrorBoundary.d.ts +19 -0
  34. package/dist/types/react-planner/components/SearchInput.d.ts +2 -1
  35. package/dist/types/react-planner/constants.d.ts +3 -0
  36. package/dist/types/react-planner/footer-bar/Footerbar.d.ts +1 -1
  37. package/dist/types/react-planner/hooks/usePlanThumbnail.d.ts +13 -0
  38. package/dist/types/react-planner/models.d.ts +19 -0
  39. package/dist/types/react-planner/plugins/autosave.d.ts +1 -1
  40. package/dist/types/react-planner/plugins/keyboard.d.ts +1 -1
  41. package/dist/types/react-planner/sidebar/Panel.d.ts +2 -1
  42. package/dist/types/react-planner/sidebar/panel-element-editor/AreaAttributesEditor.d.ts +8 -0
  43. package/dist/types/react-planner/sidebar/panel-element-editor/AttributesEditor.d.ts +4 -1
  44. package/dist/types/react-planner/sidebar/panel-element-editor/HoleAttributesEditor.d.ts +3 -4
  45. package/dist/types/react-planner/sidebar/panel-element-editor/ItemAttributesEditor.d.ts +3 -4
  46. package/dist/types/react-planner/sidebar/panel-element-editor/SimilarElements.d.ts +15 -0
  47. package/dist/types/react-planner/sidebar/panel-element-editor/WallAttributesEditor.d.ts +8 -0
  48. package/dist/types/react-planner/sidebar/panel-element-editor/editor-ui.d.ts +93 -0
  49. package/dist/types/react-planner/sidebar/panel-element-editor/paint-palette.d.ts +6 -0
  50. package/dist/types/react-planner/toolbar/CatalogPicker.d.ts +8 -0
  51. package/dist/types/react-planner/toolbar/NumberStepper.d.ts +11 -0
  52. package/dist/types/react-planner/toolbar/ProjectMiniMap.d.ts +11 -0
  53. package/dist/types/react-planner/toolbar/ProjectPanel.d.ts +2 -0
  54. package/dist/types/react-planner/toolbar/ToolbarRail.d.ts +15 -0
  55. package/dist/types/react-planner/toolbar/ToolbarSubPanel.d.ts +23 -0
  56. package/dist/types/react-planner/toolbar/ZoomControls.d.ts +5 -0
  57. package/dist/types/react-planner/utils/angle.d.ts +9 -0
  58. package/dist/types/react-planner/utils/geometry.d.ts +15 -0
  59. package/dist/types/react-planner/utils/image-trim.d.ts +25 -0
  60. package/dist/types/react-planner/utils/index.d.ts +3 -1
  61. package/dist/types/react-planner/utils/item-footprint.d.ts +23 -0
  62. package/dist/types/react-planner/utils/item-snap.d.ts +56 -0
  63. package/dist/types/react-planner/utils/item-transform.d.ts +9 -0
  64. package/dist/types/react-planner/utils/line-family.d.ts +29 -0
  65. package/dist/types/react-planner/utils/name-generator.d.ts +1 -1
  66. package/dist/types/react-planner/utils/screenshot.d.ts +22 -1
  67. package/dist/types/react-planner/utils/three-cache.d.ts +17 -0
  68. package/dist/types/react-planner/utils/three-materials.d.ts +33 -0
  69. package/dist/types/react-planner/utils/threeCSG.es6.d.ts +1 -1
  70. package/dist/types/react-planner/utils/wall-miter.d.ts +53 -0
  71. package/dist/types/react-planner/utils/zoom.d.ts +2 -2
  72. package/dist/types/react-planner/viewer2d/Area.d.ts +7 -1
  73. package/dist/types/react-planner/viewer2d/Grids.d.ts +1 -1
  74. package/dist/types/react-planner/viewer2d/Ruler.d.ts +6 -1
  75. package/dist/types/react-planner/viewer2d/SelectionToolbar.d.ts +12 -0
  76. package/dist/types/react-planner/viewer2d/WallHoverHandles.d.ts +13 -0
  77. package/dist/types/react-planner/viewer3d/selection-gizmo.d.ts +57 -0
  78. package/dist/types/react-planner/viewer3d/viewer3d.d.ts +71 -0
  79. package/dist/types/shared-style.d.ts +6 -0
  80. package/dist/types/store/ReactPlannerStore.d.ts +102 -1
  81. package/package.json +1 -1
  82. package/dist/types/react-planner/components/PropertyString.d.ts +0 -10
  83. package/dist/types/react-planner/hooks/useScreenshotBeforeUnload.d.ts +0 -4
  84. package/dist/types/react-planner/toolbar/Popup.d.ts +0 -11
  85. package/dist/types/react-planner/viewer2d/GridHorizontalStreak.d.ts +0 -7
  86. package/dist/types/react-planner/viewer2d/GridVerticalStreak.d.ts +0 -7
@@ -0,0 +1,22 @@
1
+ export interface RoomType {
2
+ value: string;
3
+ label: string;
4
+ color: string;
5
+ }
6
+ export interface RoomCategory {
7
+ value: string;
8
+ label: string;
9
+ types: RoomType[];
10
+ }
11
+ export declare const ROOM_CATEGORIES: RoomCategory[];
12
+ export declare function getCategory(value: string | undefined): RoomCategory | undefined;
13
+ export declare function getRoomType(categoryValue: string | undefined, typeValue: string | undefined): RoomType | undefined;
14
+ export declare function getRoomTypeLabel(categoryValue: string | undefined, typeValue: string | undefined): string;
15
+ export declare function getRoomTypeColor(categoryValue: string | undefined, typeValue: string | undefined): string | undefined;
16
+ export declare const DEFAULT_ROOM_CATEGORY = "";
17
+ export declare const DEFAULT_ROOM_TYPE = "";
18
+ export type AreaKind = "Room" | "Surface" | "Area";
19
+ export declare function getAreaKind(area: any, layer: any): AreaKind;
20
+ export declare function deriveAreaLabel(area: any, layer: any, opts?: {
21
+ defaultLabel?: string;
22
+ }): string;
@@ -13,5 +13,5 @@ type TextureInfo = {
13
13
  };
14
14
  };
15
15
  export declare function buildWall(element: any, layer: Layer, scene: Scene, textures: Record<string, TextureInfo>): Promise<Group>;
16
- export declare function updatedWall(element: any, layer: any, scene: any, textures: any, mesh: any, oldElement: any, differences: any, selfDestroy: any, selfBuild: any): any;
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
17
  export {};
@@ -0,0 +1,10 @@
1
+ import type { CatalogElement } from "./catalog";
2
+ /**
3
+ * Build the stand-in for `type`.
4
+ *
5
+ * `prototype` is left empty on purpose: the element's own record already
6
+ * carries the right one, and claiming one here would file the placeholder among
7
+ * real elements — `getElementsOfPrototype` backs the "similar elements" list,
8
+ * which should never offer a missing type as something to place.
9
+ */
10
+ export default function unknownElement(type: string): CatalogElement;
@@ -1,7 +1,34 @@
1
1
  import { Set } from "immutable";
2
+ import { type LineFamily } from "../utils/line-family";
2
3
  declare class Area {
3
4
  static getSurfaceLines(state: any, layerID: string, areaID: string): Set<string>;
4
- static add(state: any, layerID: any, type: any, verticesCoords: any, catalog: any): {
5
+ static center(state: any, layerID: string, areaID: string): {
6
+ x: number;
7
+ y: number;
8
+ } | null;
9
+ static transform(state: any, layerID: string, areaID: string, transform: (point: {
10
+ x: number;
11
+ y: number;
12
+ }) => {
13
+ x: number;
14
+ y: number;
15
+ }): {
16
+ updatedState: any;
17
+ };
18
+ /** Rotate about the area's center. Maths convention: in these y-up scene
19
+ * coords a positive angle turns counter-clockwise, which reads *clockwise*
20
+ * in the y-flipped 2D view. */
21
+ static rotate(state: any, layerID: string, areaID: string, degrees: number): {
22
+ updatedState: any;
23
+ };
24
+ /** Mirror about the area's center — "x" flips it left-right, "y" top-bottom. */
25
+ static mirror(state: any, layerID: string, areaID: string, axis: "x" | "y"): {
26
+ updatedState: any;
27
+ };
28
+ /** `family` says which graph the boundary belongs to. Walls and surfaces can
29
+ * now have distinct vertices at identical coordinates, so without it the
30
+ * lookup below could bind a surface polygon to a wall's corner. */
31
+ static add(state: any, layerID: any, type: any, verticesCoords: any, catalog: any, family?: LineFamily): {
5
32
  updatedState: any;
6
33
  area: undefined;
7
34
  };
@@ -28,6 +28,16 @@ declare class Hole {
28
28
  static endDraggingHole(state: any, x: any, y: any): {
29
29
  updatedState: any;
30
30
  };
31
+ static flip(state: any, layerID: any, holeID: any, axis?: "x" | "y"): {
32
+ updatedState: any;
33
+ };
34
+ static duplicate(state: any, layerID: any, holeID: any): {
35
+ updatedState: any;
36
+ hole?: undefined;
37
+ } | {
38
+ updatedState: any;
39
+ hole: any;
40
+ };
31
41
  static setProperties(state: any, layerID: any, holeID: any, properties: any): {
32
42
  updatedState: any;
33
43
  };
@@ -40,6 +50,9 @@ declare class Hole {
40
50
  static updateJsProperties(state: any, layerID: any, holeID: any, properties: any): {
41
51
  updatedState: any;
42
52
  };
53
+ static mergeAttributes(state: any, layerID: any, holeID: any, attributes: any): {
54
+ updatedState: any;
55
+ };
43
56
  static setAttributes(state: any, layerID: any, holeID: any, holesAttributes: any): {
44
57
  updatedState: any;
45
58
  };
@@ -7,8 +7,9 @@ import Vertex from "./vertex";
7
7
  import Area from "./area";
8
8
  import Item from "./item";
9
9
  import Surface from "./surface";
10
+ import Room from "./room";
10
11
  import { HorizontalGuide, VerticalGuide } from "./guide";
11
- export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide, Surface, };
12
+ export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide, Surface, Room, };
12
13
  declare const _default: {
13
14
  Project: typeof Project;
14
15
  Group: typeof Group;
@@ -19,6 +20,7 @@ declare const _default: {
19
20
  Area: typeof Area;
20
21
  Item: typeof Item;
21
22
  Surface: typeof Surface;
23
+ Room: typeof Room;
22
24
  HorizontalGuide: typeof HorizontalGuide;
23
25
  VerticalGuide: typeof VerticalGuide;
24
26
  };
@@ -39,6 +39,28 @@ declare class Item {
39
39
  static endRotatingItem(state: any, x: any, y: any): {
40
40
  updatedState: any;
41
41
  };
42
+ static beginResizingItem(state: any, layerID: any, itemID: any, x: number, y: number): {
43
+ updatedState: any;
44
+ };
45
+ static updateResizingItem(state: any, x: number, y: number): {
46
+ updatedState: any;
47
+ };
48
+ static endResizingItem(state: any, x: number, y: number): {
49
+ updatedState: any;
50
+ };
51
+ static rotate(state: any, layerID: any, itemID: any, delta: number): {
52
+ updatedState: any;
53
+ };
54
+ static flip(state: any, layerID: any, itemID: any, axis: "x" | "y"): {
55
+ updatedState: any;
56
+ };
57
+ static duplicate(state: any, layerID: any, itemID: any): {
58
+ updatedState: any;
59
+ item?: undefined;
60
+ } | {
61
+ updatedState: any;
62
+ item: any;
63
+ };
42
64
  static setProperties(state: any, layerID: any, itemID: any, properties: any): {
43
65
  updatedState: any;
44
66
  };
@@ -33,9 +33,18 @@ declare class Line {
33
33
  line: any;
34
34
  vertex: any;
35
35
  };
36
- static selectToolDrawingLine(state: any, sceneComponentType: string): {
37
- updatedState: any;
38
- };
36
+ static selectToolDrawingLine(state: any, sceneComponentType: string, options?: {
37
+ thickness?: number;
38
+ height?: number;
39
+ }): {
40
+ updatedState: any;
41
+ };
42
+ /** Thickness/height the toolbar's steppers are currently set to, kept on
43
+ * `drawingSupport` for as long as the tool is active (same place
44
+ * `Room.selectToolDrawingRoom` keeps them). Returns undefined when the tool
45
+ * was selected without them — e.g. picking a line element straight out of
46
+ * the catalog — so the catalog element's own defaults apply. */
47
+ static drawingProperties(drawingSupport: any): any;
39
48
  static beginDrawingLine(state: any, layerID: string, x: number, y: number): {
40
49
  updatedState: any;
41
50
  };
@@ -0,0 +1,18 @@
1
+ declare class Room {
2
+ static selectToolDrawingRoom(state: any, options?: {
3
+ thickness?: number;
4
+ height?: number;
5
+ }): {
6
+ updatedState: any;
7
+ };
8
+ static beginDrawingRoom(state: any, layerID: string, x: number, y: number): {
9
+ updatedState: any;
10
+ };
11
+ static updateDrawingRoom(state: any, x: number, y: number): {
12
+ updatedState: any;
13
+ };
14
+ static endDrawingRoom(state: any, x: number, y: number): {
15
+ updatedState: any;
16
+ };
17
+ }
18
+ export default Room;
@@ -1,7 +1,27 @@
1
+ /** Free-standing polygons — patios, lawns, decking. Drawn corner by corner
2
+ * with the same lines/vertices as walls, but kept out of the wall graph by
3
+ * `utils/line-family`, so laying one over a room neither welds it to the
4
+ * walls it crosses nor takes the room's floor over.
5
+ *
6
+ * Snapping is the deliberate exception: a surface *should* be able to land
7
+ * exactly on a wall corner or run flush along a wall — it just must not
8
+ * become attached to it. So the whole scene is offered as snap targets, the
9
+ * same set the wall tool uses.
10
+ *
11
+ * Drawing: click each corner. Click back on the first corner to close the
12
+ * polygon, or leave the tool (Esc, double-click) once three corners are down
13
+ * and `finishDrawingSurface` closes it for you.
14
+ */
1
15
  declare class Surface {
2
16
  static selectToolDrawingSurface(state: any, sceneComponentType: string): {
3
17
  updatedState: any;
4
18
  };
19
+ /** Snap targets for the whole scene, plus the horizontal/vertical guides
20
+ * through `(x, y)` — exactly what `Line.beginDrawingLine` builds. This was
21
+ * simply missing before: `snapElements` stayed empty for the surface tool,
22
+ * so every `nearestSnap` downstream had nothing to find and the tool
23
+ * behaved as if snapping were off. */
24
+ private static anchorSnaps;
5
25
  static beginDrawingSurface(state: any, layerID: string, x: number, y: number): {
6
26
  updatedState: any;
7
27
  };
@@ -11,5 +31,19 @@ declare class Surface {
11
31
  static endDrawingSurface(state: any, x: number, y: number): {
12
32
  updatedState: any;
13
33
  };
34
+ /** Leave the tool keeping what has been drawn, by committing the edge from
35
+ * the last clicked corner back to the first.
36
+ *
37
+ * This is what Esc and the double-click go through. The outline on screen
38
+ * is already drawn closed while the tool is live, so throwing it away is
39
+ * never what leaving the tool means — but only clicked corners count, not
40
+ * wherever the cursor happens to be resting.
41
+ *
42
+ * Under three corners there is no polygon to keep; `finished: false` says
43
+ * so, and the caller falls back to a real rollback. */
44
+ static finishDrawingSurface(state: any): {
45
+ updatedState: any;
46
+ finished: boolean;
47
+ };
14
48
  }
15
49
  export default Surface;
@@ -1,5 +1,10 @@
1
+ import { type LineFamily } from "../utils/line-family";
1
2
  declare class Vertex {
2
- static add(state: any, layerID: any, x: any, y: any, relatedPrototype: any, relatedID: any): {
3
+ /** `family` is what the caller is about to attach here. A coincident vertex
4
+ * is only reused when it belongs to the same family, so a surface corner
5
+ * dropped on a wall corner gets its own vertex and the two graphs stay
6
+ * separate. Omit it to reuse any coincident vertex (the old behaviour). */
7
+ static add(state: any, layerID: any, x: any, y: any, relatedPrototype: any, relatedID: any, family?: LineFamily): {
3
8
  updatedState: any;
4
9
  vertex: any;
5
10
  };
@@ -0,0 +1,19 @@
1
+ import { Component, type ReactNode } from "react";
2
+ interface ErrorBoundaryProps {
3
+ children: ReactNode;
4
+ onReset?: () => void;
5
+ }
6
+ interface ErrorBoundaryState {
7
+ error: Error | null;
8
+ }
9
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
10
+ state: ErrorBoundaryState;
11
+ static getDerivedStateFromError(error: Error): {
12
+ error: Error;
13
+ };
14
+ componentDidCatch(error: Error, info: {
15
+ componentStack?: string | null;
16
+ }): void;
17
+ render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
18
+ }
19
+ export default ErrorBoundary;
@@ -6,8 +6,9 @@ interface SearchFieldInterface {
6
6
  onClick?: () => false;
7
7
  isStatic?: boolean;
8
8
  className?: string;
9
+ inputClassName?: string;
9
10
  hasDropDown?: boolean;
10
11
  onSearch: (term: string, event: React.ChangeEvent<HTMLInputElement>) => void;
11
12
  }
12
- declare const SearchInput: ({ term, placeholder, noSpacing, onClick, isStatic, hasDropDown, onSearch, className, value, }: SearchFieldInterface) => import("react/jsx-runtime").JSX.Element;
13
+ declare const SearchInput: ({ term, placeholder, noSpacing, onClick, isStatic, hasDropDown, onSearch, className, value, inputClassName, }: SearchFieldInterface) => import("react/jsx-runtime").JSX.Element;
13
14
  export default SearchInput;
@@ -203,6 +203,8 @@ 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
205
  export declare const MODE_WAITING_DRAWING_SURFACE = "MODE_WAITING_DRAWING_SURFACE";
206
+ export declare const MODE_WAITING_DRAWING_ROOM = "MODE_WAITING_DRAWING_ROOM";
207
+ export declare const MODE_DRAWING_ROOM = "MODE_DRAWING_ROOM";
206
208
  export declare const MODE_DRAGGING_LINE = "MODE_DRAGGING_LINE";
207
209
  export declare const MODE_DRAGGING_VERTEX = "MODE_DRAGGING_VERTEX";
208
210
  export declare const MODE_DRAGGING_ITEM = "MODE_DRAGGING_ITEM";
@@ -212,6 +214,7 @@ export declare const MODE_DRAWING_HOLE = "MODE_DRAWING_HOLE";
212
214
  export declare const MODE_DRAWING_ITEM = "MODE_DRAWING_ITEM";
213
215
  export declare const MODE_DRAWING_SURFACE = "MODE_DRAWING_SURFACE";
214
216
  export declare const MODE_ROTATING_ITEM = "MODE_ROTATING_ITEM";
217
+ export declare const MODE_RESIZING_ITEM = "MODE_RESIZING_ITEM";
215
218
  export declare const MODE_UPLOADING_IMAGE = "MODE_UPLOADING_IMAGE";
216
219
  export declare const MODE_FITTING_IMAGE = "MODE_FITTING_IMAGE";
217
220
  export declare const MODE_VIEWING_CATALOG = "MODE_VIEWING_CATALOG";
@@ -1,2 +1,2 @@
1
- declare const Footerbar: () => import("react/jsx-runtime").JSX.Element | undefined;
1
+ declare const Footerbar: () => null;
2
2
  export default Footerbar;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Keeps a plan thumbnail up to date, handing each new one to `onReady`.
3
+ *
4
+ * Capture is deliberately *ahead* of unload, not during it. `beforeunload`
5
+ * can't await anything, and a multi-hundred-KB data URI is far past what
6
+ * sendBeacon or fetch({ keepalive: true }) will carry (~64KB), so there is no
7
+ * way to both build and ship an image once the page is going away. Instead we
8
+ * capture on an idle timer and again when the page is hidden — by the time the
9
+ * tab actually closes, the server already has a current image.
10
+ */
11
+ export declare function usePlanThumbnail(onReady?: (img: string) => void): {
12
+ ensureScreenshot: (force?: boolean) => Promise<void>;
13
+ };
@@ -57,6 +57,7 @@ declare const Hole_base: Record.Factory<{
57
57
  prototype: string;
58
58
  offset: number;
59
59
  line: string;
60
+ flipAlongWall: boolean;
60
61
  id: string;
61
62
  type: string;
62
63
  name: string;
@@ -89,6 +90,9 @@ declare const Item_base: Record.Factory<{
89
90
  y: number;
90
91
  rotation: number;
91
92
  altitude: number;
93
+ scale: number;
94
+ flipHorizontal: boolean;
95
+ flipVertical: boolean;
92
96
  id: string;
93
97
  type: string;
94
98
  name: string;
@@ -156,6 +160,7 @@ declare const CatalogElement_base: Record.Factory<{
156
160
  prototype: string;
157
161
  info: Map<unknown, unknown>;
158
162
  properties: Map<unknown, unknown>;
163
+ textures: Map<unknown, unknown>;
159
164
  }>;
160
165
  export declare class CatalogElement extends CatalogElement_base {
161
166
  constructor(json?: any);
@@ -168,6 +173,18 @@ declare const Catalog_base: Record.Factory<{
168
173
  }>;
169
174
  export declare class Catalog extends Catalog_base {
170
175
  constructor(json?: any);
176
+ /**
177
+ * Build a record of `type` with its catalog defaults filled in.
178
+ *
179
+ * A type the catalog doesn't have is normally a caller's mistake, but not
180
+ * always: duplicating something already in the plan goes through here, and a
181
+ * plan can outlive the catalog it was drawn with (see
182
+ * `catalog/unknown-element.tsx`). So when `options.prototype` says which kind
183
+ * of record to build, one gets built — carrying whatever properties came in,
184
+ * since there are no defaults to merge — rather than taking the planner down
185
+ * over a copy of something already on screen. Without that hint there is
186
+ * nothing to construct, and it still throws.
187
+ */
171
188
  factoryElement(type: string, options: any, initialProperties?: Map<string, any>): Line | Hole | Area | Item;
172
189
  }
173
190
  declare const HistoryStructure_base: Record.Factory<{
@@ -202,6 +219,8 @@ declare const State_base: Record.Factory<{
202
219
  drawingSupport: Map<unknown, unknown>;
203
220
  draggingSupport: Map<unknown, unknown>;
204
221
  rotatingSupport: Map<unknown, unknown>;
222
+ resizingSupport: Map<unknown, unknown>;
223
+ itemSnapGuides: null;
205
224
  errors: List<unknown>;
206
225
  warnings: List<unknown>;
207
226
  clipboardProperties: Map<unknown, unknown>;
@@ -1,2 +1,2 @@
1
1
  import { type Plan, type ReactPlannerStore } from "../../store/ReactPlannerStore";
2
- export default function autosave(autosaveKey: string, delay?: number): (store: ReactPlannerStore, plan: Plan, onSave?: (data: any) => void) => void;
2
+ export default function autosave(autosaveKey: string, delay?: number): (store: ReactPlannerStore, plan: Plan, onSave?: (data: any) => void) => (() => void) | undefined;
@@ -1,2 +1,2 @@
1
1
  import type { ReactPlannerStore } from "../../store/ReactPlannerStore";
2
- export default function keyboard(): (store: ReactPlannerStore) => void;
2
+ export default function keyboard(): (store: ReactPlannerStore) => () => void;
@@ -2,7 +2,8 @@ import React from "react";
2
2
  interface PanelProps {
3
3
  opened?: boolean;
4
4
  name: string;
5
+ subtitle?: string;
5
6
  children: React.ReactNode;
6
7
  }
7
- declare const Panel: ({ children, name, ...props }: PanelProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const Panel: ({ children, name, subtitle, ...props }: PanelProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export default Panel;
@@ -0,0 +1,8 @@
1
+ import type Catalog from "../../catalog/catalog";
2
+ interface AreaAttributesEditorProps {
3
+ element: any;
4
+ layer: any;
5
+ catalog: Catalog;
6
+ }
7
+ declare const AreaAttributesEditor: ({ element, layer, catalog, }: AreaAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default AreaAttributesEditor;
@@ -1,8 +1,11 @@
1
+ import type Catalog from "../../catalog/catalog";
1
2
  interface AttributesEditorProps {
2
3
  element: any;
4
+ layer: any;
5
+ catalog: Catalog;
3
6
  onUpdate: (k: string, v: any) => void;
4
7
  onValid: () => void;
5
8
  attributeFormData: any;
6
9
  }
7
- declare const AttributesEditor: ({ element, onUpdate, onValid, attributeFormData, ...props }: AttributesEditorProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ declare const AttributesEditor: ({ element, layer, catalog, onUpdate, onValid, attributeFormData, ...props }: AttributesEditorProps) => import("react/jsx-runtime").JSX.Element | null;
8
11
  export default AttributesEditor;
@@ -1,8 +1,7 @@
1
+ import type Catalog from "../../catalog/catalog";
1
2
  interface HoleAttributesEditorProps {
2
3
  element: any;
3
- onUpdate: (k: string, v: any) => void;
4
- attributeFormData: any;
5
- onValid?: (event: Event) => void;
4
+ catalog: Catalog;
6
5
  }
7
- declare const HoleAttributesEditor: ({ element, attributeFormData, onUpdate, ...props }: HoleAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const HoleAttributesEditor: ({ element, catalog, }: HoleAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export default HoleAttributesEditor;
@@ -1,8 +1,7 @@
1
+ import type Catalog from "../../catalog/catalog";
1
2
  interface ItemAttributesEditorProps {
2
3
  element: any;
3
- onUpdate: (k: string, v: any) => void;
4
- attributeFormData: any;
5
- onValid?: (event: Event) => void;
4
+ catalog: Catalog;
6
5
  }
7
- declare const ItemAttributesEditor: ({ element, onUpdate, attributeFormData, ...props }: ItemAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const ItemAttributesEditor: ({ element, catalog, }: ItemAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export default ItemAttributesEditor;
@@ -0,0 +1,15 @@
1
+ import type Catalog from "../../catalog/catalog";
2
+ import type { CatalogElement } from "../../catalog/catalog";
3
+ export declare function findSimilarElements(catalog: Catalog, element: any): CatalogElement[];
4
+ interface SimilarElementsGridProps {
5
+ elements: CatalogElement[];
6
+ /** Panel the pointer has to leave for the drag to become a placement. */
7
+ containerSelector?: string;
8
+ }
9
+ /**
10
+ * A browse-and-place list: press an entry and drag it out of the sidebar to
11
+ * start placing one, exactly like the catalog picker in the toolbar. Nothing
12
+ * here touches the selected element — these are additions, not swaps.
13
+ */
14
+ export declare const SimilarElementsGrid: ({ elements, containerSelector, }: SimilarElementsGridProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import type Catalog from "../../catalog/catalog";
2
+ interface WallAttributesEditorProps {
3
+ element: any;
4
+ layer: any;
5
+ catalog: Catalog;
6
+ }
7
+ declare const WallAttributesEditor: ({ element, layer, catalog, }: WallAttributesEditorProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default WallAttributesEditor;
@@ -0,0 +1,93 @@
1
+ import type React from "react";
2
+ export declare const BackHeader: ({ title, subtitle, onBack, }: {
3
+ title: string;
4
+ subtitle?: string;
5
+ onBack: () => void;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ interface RowButtonProps {
8
+ swatchColor?: string;
9
+ textureUri?: string;
10
+ icon?: React.ReactNode;
11
+ label: string;
12
+ value?: string;
13
+ onClick: () => void;
14
+ }
15
+ export declare const RowButton: ({ swatchColor, textureUri, icon, label, value, onClick, }: RowButtonProps) => import("react/jsx-runtime").JSX.Element;
16
+ interface MeasureStepperProps {
17
+ value: number;
18
+ onChange: (next: number) => void;
19
+ step?: number;
20
+ min?: number;
21
+ max?: number;
22
+ /** Suffix shown inside the field. Lengths are stored in cm throughout. */
23
+ unit?: string;
24
+ }
25
+ export declare const MeasureStepper: ({ value, onChange, step, min, max, unit, }: MeasureStepperProps) => import("react/jsx-runtime").JSX.Element;
26
+ export interface EditorAction {
27
+ key: string;
28
+ label: string;
29
+ icon: React.ReactNode;
30
+ danger?: boolean;
31
+ onClick: () => void;
32
+ }
33
+ /** Round icon buttons under the preview — duplicate, rotate, flip, delete. */
34
+ export declare const ActionRow: ({ actions }: {
35
+ actions: EditorAction[];
36
+ }) => import("react/jsx-runtime").JSX.Element;
37
+ /**
38
+ * One entry of a catalog element's `textures` map, as far as the picker cares.
39
+ * Structural on purpose — the repeat scales matter to the renderers, not here.
40
+ */
41
+ export interface MaterialTexture {
42
+ name: string;
43
+ uri: string;
44
+ tag?: string[];
45
+ }
46
+ interface MaterialPickerProps {
47
+ textures: Record<string, MaterialTexture>;
48
+ /** Currently applied key, or `"none"`. */
49
+ value: string;
50
+ onChange: (key: string) => void;
51
+ /** Heading, rendered only alongside the picker so it can't be left stranded
52
+ * above nothing when the element has no materials. */
53
+ label?: string;
54
+ }
55
+ /**
56
+ * Browse a catalog element's materials.
57
+ *
58
+ * Shared by the wall and area editors because they browse the same library —
59
+ * the catalog hands floors and walls one `textures` map, so whatever makes it
60
+ * navigable for one has to be there for the other. Categories come from the
61
+ * materials' own tags in the order the catalog lists them, so no vocabulary is
62
+ * baked in here.
63
+ */
64
+ export declare const MaterialPicker: ({ textures, value, onChange, label, }: MaterialPickerProps) => import("react/jsx-runtime").JSX.Element | null;
65
+ interface FinishPickerProps {
66
+ /** Paint colour, as `#RRGGBB`. */
67
+ color: string;
68
+ onColorChange: (color: string) => void;
69
+ textures: Record<string, MaterialTexture>;
70
+ /** Currently applied texture key, or `"none"`. */
71
+ texture: string;
72
+ onTextureChange: (key: string) => void;
73
+ /**
74
+ * Rendered under the palette on the Colors tab. Areas put their hatch
75
+ * patterns here; walls have none, and pass nothing.
76
+ */
77
+ patterns?: React.ReactNode;
78
+ }
79
+ /**
80
+ * How a surface's finish is chosen: paint on one tab, materials on the other.
81
+ *
82
+ * Walls and areas both answer the same question here — what is this surface
83
+ * covered in — so they get the same two tabs over the same palette and the same
84
+ * material library. What differs is what else lives under the palette, which
85
+ * comes in as `patterns`.
86
+ */
87
+ export declare const FinishPicker: ({ color, onColorChange, textures, texture, onTextureChange, patterns, }: FinishPickerProps) => import("react/jsx-runtime").JSX.Element;
88
+ /** Catalog thumbnail, falling back to a neutral tile when there is no image. */
89
+ export declare const ElementPreview: ({ imageUri, alt, }: {
90
+ imageUri?: string;
91
+ alt: string;
92
+ }) => import("react/jsx-runtime").JSX.Element;
93
+ export {};
@@ -0,0 +1,6 @@
1
+ interface PaintPaletteProps {
2
+ value: string;
3
+ onChange: (color: string) => void;
4
+ }
5
+ export declare const PaintPalette: ({ value, onChange }: PaintPaletteProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default PaintPalette;
@@ -0,0 +1,8 @@
1
+ import Catalog from "../catalog/catalog";
2
+ interface CatalogPickerProps {
3
+ catalog: Catalog;
4
+ page: string;
5
+ containerSelector?: string;
6
+ }
7
+ declare const CatalogPicker: ({ catalog, page, containerSelector, }: CatalogPickerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default CatalogPicker;
@@ -0,0 +1,11 @@
1
+ interface NumberStepperProps {
2
+ label: string;
3
+ value: number;
4
+ unit?: string;
5
+ step?: number;
6
+ min?: number;
7
+ max?: number;
8
+ onChange: (value: number) => void;
9
+ }
10
+ declare const NumberStepper: ({ label, value, unit, step, min, max, onChange, }: NumberStepperProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default NumberStepper;
@@ -0,0 +1,11 @@
1
+ export interface HoveredArea {
2
+ layerID: string;
3
+ areaID: string;
4
+ label: string;
5
+ area: number;
6
+ }
7
+ interface ProjectMiniMapProps {
8
+ onHoverChange?: (info: HoveredArea | null) => void;
9
+ }
10
+ declare const ProjectMiniMap: ({ onHoverChange }: ProjectMiniMapProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default ProjectMiniMap;
@@ -0,0 +1,2 @@
1
+ declare const ProjectPanel: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ProjectPanel;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ export type RailSection = "project" | "build" | "info" | "objects" | "styleboards" | "finishes" | "help";
3
+ export interface RailItem {
4
+ key: RailSection;
5
+ label: string;
6
+ icon: ReactNode;
7
+ disabled?: boolean;
8
+ }
9
+ interface ToolbarRailProps {
10
+ items: RailItem[];
11
+ active: RailSection | null;
12
+ onChange: (section: RailSection) => void;
13
+ }
14
+ declare const ToolbarRail: ({ items, active, onChange }: ToolbarRailProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default ToolbarRail;