@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.
- package/dist/floor-planner.css +1 -1
- package/dist/floor-planner.es.js +44841 -38060
- package/dist/floor-planner.umd.js +65 -51
- package/dist/types/index.d.ts +3 -1
- package/dist/types/react-planner/ReactPlanner.d.ts +3 -1
- package/dist/types/react-planner/ReactPlannerLoader.d.ts +20 -1
- package/dist/types/react-planner/ai-chat/AIChatBubble.d.ts +6 -0
- package/dist/types/react-planner/ai-chat/AIChatPanel.d.ts +8 -0
- package/dist/types/react-planner/ai-chat/SelectionChips.d.ts +2 -0
- package/dist/types/react-planner/ai-chat/ThinkingIndicator.d.ts +5 -0
- package/dist/types/react-planner/ai-chat/aiService.d.ts +340 -0
- package/dist/types/react-planner/ai-chat/imageUpload.d.ts +6 -0
- package/dist/types/react-planner/ai-chat/plannerActions.d.ts +20 -0
- package/dist/types/react-planner/ai-chat/streamingClient.d.ts +31 -0
- package/dist/types/react-planner/ai-chat/useTypewriter.d.ts +19 -0
- package/dist/types/react-planner/catalog/catalog.d.ts +24 -0
- package/dist/types/react-planner/catalog/factories/AreaFactory.d.ts +1 -24
- package/dist/types/react-planner/catalog/factories/ItemFactory.d.ts +2 -0
- package/dist/types/react-planner/catalog/factories/WallFactory.d.ts +1 -26
- package/dist/types/react-planner/catalog/factories/area-factory-3d.d.ts +2 -2
- package/dist/types/react-planner/catalog/factories/area-patterns.d.ts +42 -0
- package/dist/types/react-planner/catalog/factories/room-types.d.ts +22 -0
- package/dist/types/react-planner/catalog/factories/wall-factory-3d.d.ts +1 -1
- package/dist/types/react-planner/catalog/unknown-element.d.ts +10 -0
- package/dist/types/react-planner/class/area.d.ts +28 -1
- package/dist/types/react-planner/class/hole.d.ts +13 -0
- package/dist/types/react-planner/class/index.d.ts +3 -1
- package/dist/types/react-planner/class/item.d.ts +22 -0
- package/dist/types/react-planner/class/line.d.ts +12 -3
- package/dist/types/react-planner/class/room.d.ts +18 -0
- package/dist/types/react-planner/class/surface.d.ts +34 -0
- package/dist/types/react-planner/class/vertex.d.ts +6 -1
- package/dist/types/react-planner/components/ErrorBoundary.d.ts +19 -0
- package/dist/types/react-planner/components/SearchInput.d.ts +2 -1
- package/dist/types/react-planner/constants.d.ts +3 -0
- package/dist/types/react-planner/footer-bar/Footerbar.d.ts +1 -1
- package/dist/types/react-planner/hooks/usePlanThumbnail.d.ts +13 -0
- package/dist/types/react-planner/models.d.ts +19 -0
- package/dist/types/react-planner/plugins/autosave.d.ts +1 -1
- package/dist/types/react-planner/plugins/keyboard.d.ts +1 -1
- package/dist/types/react-planner/sidebar/Panel.d.ts +2 -1
- package/dist/types/react-planner/sidebar/panel-element-editor/AreaAttributesEditor.d.ts +8 -0
- package/dist/types/react-planner/sidebar/panel-element-editor/AttributesEditor.d.ts +4 -1
- package/dist/types/react-planner/sidebar/panel-element-editor/HoleAttributesEditor.d.ts +3 -4
- package/dist/types/react-planner/sidebar/panel-element-editor/ItemAttributesEditor.d.ts +3 -4
- package/dist/types/react-planner/sidebar/panel-element-editor/SimilarElements.d.ts +15 -0
- package/dist/types/react-planner/sidebar/panel-element-editor/WallAttributesEditor.d.ts +8 -0
- package/dist/types/react-planner/sidebar/panel-element-editor/editor-ui.d.ts +93 -0
- package/dist/types/react-planner/sidebar/panel-element-editor/paint-palette.d.ts +6 -0
- package/dist/types/react-planner/toolbar/CatalogPicker.d.ts +8 -0
- package/dist/types/react-planner/toolbar/NumberStepper.d.ts +11 -0
- package/dist/types/react-planner/toolbar/ProjectMiniMap.d.ts +11 -0
- package/dist/types/react-planner/toolbar/ProjectPanel.d.ts +2 -0
- package/dist/types/react-planner/toolbar/ToolbarRail.d.ts +15 -0
- package/dist/types/react-planner/toolbar/ToolbarSubPanel.d.ts +23 -0
- package/dist/types/react-planner/toolbar/ZoomControls.d.ts +5 -0
- package/dist/types/react-planner/utils/angle.d.ts +9 -0
- package/dist/types/react-planner/utils/geometry.d.ts +15 -0
- package/dist/types/react-planner/utils/image-trim.d.ts +25 -0
- package/dist/types/react-planner/utils/index.d.ts +3 -1
- package/dist/types/react-planner/utils/item-footprint.d.ts +23 -0
- package/dist/types/react-planner/utils/item-snap.d.ts +56 -0
- package/dist/types/react-planner/utils/item-transform.d.ts +9 -0
- package/dist/types/react-planner/utils/line-family.d.ts +29 -0
- package/dist/types/react-planner/utils/name-generator.d.ts +1 -1
- package/dist/types/react-planner/utils/screenshot.d.ts +22 -1
- package/dist/types/react-planner/utils/three-cache.d.ts +17 -0
- package/dist/types/react-planner/utils/three-materials.d.ts +33 -0
- package/dist/types/react-planner/utils/threeCSG.es6.d.ts +1 -1
- package/dist/types/react-planner/utils/wall-miter.d.ts +53 -0
- package/dist/types/react-planner/utils/zoom.d.ts +2 -2
- package/dist/types/react-planner/viewer2d/Area.d.ts +7 -1
- package/dist/types/react-planner/viewer2d/Grids.d.ts +1 -1
- package/dist/types/react-planner/viewer2d/Ruler.d.ts +6 -1
- package/dist/types/react-planner/viewer2d/SelectionToolbar.d.ts +12 -0
- package/dist/types/react-planner/viewer2d/WallHoverHandles.d.ts +13 -0
- package/dist/types/react-planner/viewer3d/selection-gizmo.d.ts +57 -0
- package/dist/types/react-planner/viewer3d/viewer3d.d.ts +71 -0
- package/dist/types/shared-style.d.ts +6 -0
- package/dist/types/store/ReactPlannerStore.d.ts +102 -1
- package/package.json +1 -1
- package/dist/types/react-planner/components/PropertyString.d.ts +0 -10
- package/dist/types/react-planner/hooks/useScreenshotBeforeUnload.d.ts +0 -4
- package/dist/types/react-planner/toolbar/Popup.d.ts +0 -11
- package/dist/types/react-planner/viewer2d/GridHorizontalStreak.d.ts +0 -7
- package/dist/types/react-planner/viewer2d/GridVerticalStreak.d.ts +0 -7
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { State } from "../react-planner/models";
|
|
2
2
|
import { ReactSVGPanZoom } from "react-svg-pan-zoom";
|
|
3
|
+
export type PlannerSelectionKind = "item" | "hole" | "surface" | "wall";
|
|
4
|
+
export interface PlannerSelection {
|
|
5
|
+
layerID: string;
|
|
6
|
+
kind: PlannerSelectionKind;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
/** The camera moves the toolbar can ask the 3D viewer to make. Structural on
|
|
10
|
+
* purpose — the store stays free of three.js. */
|
|
11
|
+
export interface Viewer3DHandle {
|
|
12
|
+
/** > 1 moves the camera closer to what it is orbiting, < 1 pulls it back. */
|
|
13
|
+
zoomBy: (factor: number) => void;
|
|
14
|
+
fitToScene: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** What the pointer is currently over in the 2D viewer while idle. */
|
|
17
|
+
export interface HoveredElement {
|
|
18
|
+
layerID: string;
|
|
19
|
+
/** "lines" | "vertices" | "items" | "holes" */
|
|
20
|
+
prototype: string;
|
|
21
|
+
id: string;
|
|
22
|
+
/** Sub-part of the element (rotation-anchor, resize-anchor…). */
|
|
23
|
+
part?: string;
|
|
24
|
+
/** The wall this node belongs to. Set both for the wall itself and for the
|
|
25
|
+
* endpoint handles it draws, so the wall keeps its highlight while the
|
|
26
|
+
* pointer sits on one of its handles. */
|
|
27
|
+
lineID?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const getSelectedElement: (planner: any) => PlannerSelection | null;
|
|
3
30
|
interface Floor {
|
|
4
31
|
floorID: number;
|
|
5
32
|
floorTitle: string;
|
|
@@ -26,12 +53,55 @@ export interface ReactPlannerStore {
|
|
|
26
53
|
remove: () => void;
|
|
27
54
|
showDimensions: boolean;
|
|
28
55
|
setShowDimensions: (showDimensions: boolean) => void;
|
|
56
|
+
showGrid: boolean;
|
|
57
|
+
setShowGrid: (showGrid: boolean) => void;
|
|
58
|
+
theme: "light" | "dark";
|
|
59
|
+
setTheme: (theme: "light" | "dark") => void;
|
|
60
|
+
/** Returns the new wall's line ID (or undefined if nothing got created). */
|
|
61
|
+
addWallByCoords: (x0: number, y0: number, x1: number, y1: number) => string | undefined;
|
|
62
|
+
addSurfaceByPoints: (points: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
}[], surfaceType?: string) => void;
|
|
66
|
+
addRoom: (x0: number, y0: number, x1: number, y1: number, options?: {
|
|
67
|
+
thickness?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
}) => void;
|
|
70
|
+
selectToolDrawingRoom: (options?: {
|
|
71
|
+
thickness?: number;
|
|
72
|
+
height?: number;
|
|
73
|
+
}) => void;
|
|
74
|
+
updateRoomDrawingProperties: (options: {
|
|
75
|
+
thickness?: number;
|
|
76
|
+
height?: number;
|
|
77
|
+
}) => void;
|
|
78
|
+
beginDrawingRoom: (layerID: string, x: number, y: number) => void;
|
|
79
|
+
updateDrawingRoom: (x: number, y: number) => void;
|
|
80
|
+
endDrawingRoom: (x: number, y: number) => void;
|
|
81
|
+
/** Returns the new item's ID (or undefined if nothing got created). */
|
|
82
|
+
addItemByCoords: (itemType: string, x: number, y: number, width?: number, height?: number, rotation?: number) => string | undefined;
|
|
83
|
+
/** Returns the new hole's ID (or undefined if nothing got created). */
|
|
84
|
+
addHoleOnLine: (lineID: string, holeType: string, offset: number) => string | undefined;
|
|
85
|
+
setAreaProperties: (areaID: string, properties: any) => void;
|
|
86
|
+
setLineProperties: (lineID: string, properties: any) => void;
|
|
87
|
+
moveVertex: (vertexID: string, x: number, y: number) => void;
|
|
88
|
+
removeLine: (lineID: string) => void;
|
|
89
|
+
removeArea: (areaID: string) => void;
|
|
90
|
+
removeItem: (itemID: string) => void;
|
|
91
|
+
removeHole: (holeID: string) => void;
|
|
92
|
+
fitViewerToScene: (options?: {
|
|
93
|
+
animate?: boolean;
|
|
94
|
+
}) => void;
|
|
95
|
+
focusOnArea: (layerID: string, areaID: string) => void;
|
|
29
96
|
setToast: (toast: {
|
|
30
97
|
text: string;
|
|
31
98
|
} | null) => void;
|
|
32
99
|
setPlan: (plan: Plan) => void;
|
|
33
100
|
setAlterateState: () => void;
|
|
34
|
-
selectToolDrawingLine: (sceneComponentType: any
|
|
101
|
+
selectToolDrawingLine: (sceneComponentType: any, options?: {
|
|
102
|
+
thickness?: number;
|
|
103
|
+
height?: number;
|
|
104
|
+
}) => void;
|
|
35
105
|
selectToolDrawingSurface: (sceneComponentType: any) => void;
|
|
36
106
|
selectToolDrawingItem: (sceneComponentType: any) => void;
|
|
37
107
|
selectToolDrawingHole: (sceneComponentType: any) => void;
|
|
@@ -43,6 +113,33 @@ export interface ReactPlannerStore {
|
|
|
43
113
|
unselectAll: () => void;
|
|
44
114
|
beginDraggingVertex: (layerID: string, vertexID: string, x: number, y: number, snapMask: any) => void;
|
|
45
115
|
endDraggingVertex: (x: number, y: number, snapMask: any) => void;
|
|
116
|
+
duplicateSelected: () => void;
|
|
117
|
+
duplicateItem: (itemID: string) => void;
|
|
118
|
+
duplicateHole: (holeID: string) => void;
|
|
119
|
+
duplicateSurface: (areaID: string) => void;
|
|
120
|
+
/** Positive turns counter-clockwise as seen in the 2D view. */
|
|
121
|
+
rotateSelected: (degrees: number) => void;
|
|
122
|
+
flipSelected: (axis: "x" | "y") => void;
|
|
123
|
+
/** Rotate one surface polygon about its own center, addressed by ID rather
|
|
124
|
+
* than via the selection. Same sign convention as `rotateSelected`. */
|
|
125
|
+
rotateArea: (areaID: string, degrees: number) => void;
|
|
126
|
+
/** Mirror one surface polygon about its own center — "x" flips it
|
|
127
|
+
* left-right, "y" top-bottom. */
|
|
128
|
+
mirrorArea: (areaID: string, axis: "x" | "y") => void;
|
|
129
|
+
setItemAttributes: (itemID: string, attributes: Record<string, any>) => void;
|
|
130
|
+
setHoleProperties: (holeID: string, properties: Record<string, any>) => void;
|
|
131
|
+
setHoleAttributes: (holeID: string, attributes: Record<string, any>) => void;
|
|
132
|
+
moveHole: (holeID: string, offset: number) => void;
|
|
133
|
+
resizeHandlesFor: string | null;
|
|
134
|
+
setResizeHandlesFor: (itemID: string | null) => void;
|
|
135
|
+
/** Drives the hover affordances in the 2D viewer (wall highlight + endpoint
|
|
136
|
+
* handles) so elements can be dragged/resized without selecting them
|
|
137
|
+
* first. Only ever set while the planner is idle. */
|
|
138
|
+
hoveredElement: HoveredElement | null;
|
|
139
|
+
setHoveredElement: (hovered: HoveredElement | null) => void;
|
|
140
|
+
beginResizingItem: (layerID: string, itemID: string, x: number, y: number) => void;
|
|
141
|
+
updateResizingItem: (x: number, y: number) => void;
|
|
142
|
+
endResizingItem: (x: number, y: number) => void;
|
|
46
143
|
beginRotatingItem: (layerID: string, itemID: string, x: number, y: number) => void;
|
|
47
144
|
endRotatingItem: (x: number, y: number) => void;
|
|
48
145
|
beginDraggingItem: (layerID: string, itemID: string, x: number, y: number) => void;
|
|
@@ -117,6 +214,10 @@ export interface ReactPlannerStore {
|
|
|
117
214
|
undo: () => void;
|
|
118
215
|
viewer: ReactSVGPanZoom | null;
|
|
119
216
|
setViewer: (viewer: ReactSVGPanZoom) => void;
|
|
217
|
+
/** The mounted 3D viewer, or null when the 3D view isn't on screen. Lets
|
|
218
|
+
* the toolbar drive the camera without knowing anything about three.js. */
|
|
219
|
+
viewer3D: Viewer3DHandle | null;
|
|
220
|
+
setViewer3D: (viewer: Viewer3DHandle | null) => void;
|
|
120
221
|
plan: Plan | null;
|
|
121
222
|
initCatalog: (catalog: any) => void;
|
|
122
223
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface PropertyStringProps {
|
|
2
|
-
value: any;
|
|
3
|
-
onUpdate: (v: any) => void;
|
|
4
|
-
onValid?: (event: Event) => void;
|
|
5
|
-
configs: Record<string, any>;
|
|
6
|
-
sourceElement?: any;
|
|
7
|
-
internalState?: any;
|
|
8
|
-
}
|
|
9
|
-
declare const PropertyString: ({ value, onUpdate, configs, sourceElement, internalState, }: PropertyStringProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default PropertyString;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Catalog from "../catalog/catalog";
|
|
2
|
-
interface PopupProps {
|
|
3
|
-
onClose: () => void;
|
|
4
|
-
catalog: Catalog;
|
|
5
|
-
popupEvent: {
|
|
6
|
-
rect: DOMRect;
|
|
7
|
-
page: string;
|
|
8
|
-
} | null;
|
|
9
|
-
}
|
|
10
|
-
declare const Popup: ({ catalog, popupEvent, onClose: handleClose }: PopupProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default Popup;
|