@osamash/floor-planner 1.2.5 → 1.2.6
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 +161 -114
- package/dist/floor-planner.umd.js +4 -4
- package/dist/types/react-planner/constants.d.ts +13 -0
- package/dist/types/react-planner/hooks/usePlanThumbnail.d.ts +12 -3
- package/dist/types/react-planner/plugins/keyboard.d.ts +1 -1
- package/dist/types/react-planner/utils/visual-change.d.ts +12 -0
- package/package.json +1 -1
|
@@ -220,6 +220,19 @@ export declare const MODE_FITTING_IMAGE = "MODE_FITTING_IMAGE";
|
|
|
220
220
|
export declare const MODE_VIEWING_CATALOG = "MODE_VIEWING_CATALOG";
|
|
221
221
|
export declare const MODE_CONFIGURING_PROJECT = "MODE_CONFIGURING_PROJECT";
|
|
222
222
|
export declare const MODE_SNAPPING: string[];
|
|
223
|
+
/**
|
|
224
|
+
* The modes in which `Content` mounts the 2D viewer — i.e. the plan `<svg>` is
|
|
225
|
+
* in the DOM. Every other mode shows the 3D viewer, the catalog list or
|
|
226
|
+
* nothing, so there is no plan to screenshot.
|
|
227
|
+
*/
|
|
228
|
+
export declare const MODE_2D_VIEWER: string[];
|
|
229
|
+
/**
|
|
230
|
+
* The subset of `MODE_2D_VIEWER` where a gesture is mid-flight. The scene
|
|
231
|
+
* legitimately holds preview geometry in these — a wall that follows the
|
|
232
|
+
* cursor, an unfinished surface polygon, an item being dragged — so they're
|
|
233
|
+
* states to let settle rather than to capture as finished work.
|
|
234
|
+
*/
|
|
235
|
+
export declare const MODE_IN_PROGRESS: string[];
|
|
223
236
|
export declare const UNIT_MILLIMETER = "mm";
|
|
224
237
|
export declare const UNIT_CENTIMETER = "cm";
|
|
225
238
|
export declare const UNIT_METER = "m";
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Keeps a plan thumbnail up to date, handing each new one to `onReady`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Every visual change to the 2D view schedules a capture — adding or removing a
|
|
5
|
+
* room, an item, a wall, a hole, toggling dimensions or the grid. A capture is
|
|
6
|
+
* only *taken* once the view is in a state worth keeping: not while the 3D
|
|
7
|
+
* viewer or the catalog is up (there's no plan SVG mounted at all then), and
|
|
8
|
+
* not mid-gesture, when the scene still holds preview geometry. When the moment
|
|
9
|
+
* is wrong the change stays pending and the mode change that makes it right
|
|
10
|
+
* re-arms it, so a room added and then admired in 3D still gets its screenshot.
|
|
11
|
+
*
|
|
12
|
+
* Capture is also deliberately *ahead* of unload, not during it. `beforeunload`
|
|
5
13
|
* can't await anything, and a multi-hundred-KB data URI is far past what
|
|
6
14
|
* sendBeacon or fetch({ keepalive: true }) will carry (~64KB), so there is no
|
|
7
15
|
* way to both build and ship an image once the page is going away. Instead we
|
|
8
|
-
* capture on
|
|
9
|
-
*
|
|
16
|
+
* capture on a short settle timer, and flush anything still pending when the
|
|
17
|
+
* page is hidden or the planner unmounts — by the time the tab actually closes,
|
|
18
|
+
* the consumer already has a current image.
|
|
10
19
|
*/
|
|
11
20
|
export declare function usePlanThumbnail(onReady?: (img: string) => void): {
|
|
12
21
|
ensureScreenshot: (force?: boolean) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactPlannerStore } from "../../store/ReactPlannerStore";
|
|
2
2
|
export default function keyboard(): (store: ReactPlannerStore) => () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactPlannerStore } from "../../store/ReactPlannerStore";
|
|
2
|
+
/**
|
|
3
|
+
* Did anything the 2D viewer paints change — and nothing that doesn't?
|
|
4
|
+
*
|
|
5
|
+
* Scene identity is too blunt to drive this. Selection is drawn, so it changes
|
|
6
|
+
* the pixels and the byte-comparison downstream won't filter it either: left
|
|
7
|
+
* alone, idly clicking around a finished plan re-uploads a thumbnail per click,
|
|
8
|
+
* each with a different element highlighted. Geometry, layer visibility, the
|
|
9
|
+
* viewport box and the view options that live outside the planner record are
|
|
10
|
+
* what count.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasVisualChange(next: ReactPlannerStore, prev: ReactPlannerStore): boolean;
|