@osamash/floor-planner 1.2.4 → 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.css +1 -1
- package/dist/floor-planner.es.js +7941 -7285
- package/dist/floor-planner.umd.js +44 -40
- package/dist/types/react-planner/ReactPlannerLoader.d.ts +20 -1
- package/dist/types/react-planner/ai-chat/aiService.d.ts +147 -134
- package/dist/types/react-planner/ai-chat/plannerActions.d.ts +18 -1
- package/dist/types/react-planner/ai-chat/streamingClient.d.ts +0 -1
- package/dist/types/react-planner/catalog/catalog.d.ts +20 -0
- package/dist/types/react-planner/catalog/factories/ItemFactory.d.ts +2 -0
- package/dist/types/react-planner/catalog/unknown-element.d.ts +10 -0
- package/dist/types/react-planner/class/area.d.ts +5 -1
- 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/constants.d.ts +13 -0
- package/dist/types/react-planner/hooks/usePlanThumbnail.d.ts +22 -0
- package/dist/types/react-planner/models.d.ts +12 -0
- package/dist/types/react-planner/plugins/keyboard.d.ts +1 -1
- package/dist/types/react-planner/sidebar/panel-element-editor/editor-ui.d.ts +51 -0
- package/dist/types/react-planner/sidebar/panel-element-editor/paint-palette.d.ts +6 -0
- package/dist/types/react-planner/utils/index.d.ts +3 -1
- package/dist/types/react-planner/utils/line-family.d.ts +29 -0
- package/dist/types/react-planner/utils/screenshot.d.ts +22 -1
- package/dist/types/react-planner/utils/visual-change.d.ts +12 -0
- package/dist/types/react-planner/viewer2d/Area.d.ts +7 -1
- package/dist/types/react-planner/viewer3d/viewer3d.d.ts +10 -0
- package/package.json +1 -1
- package/dist/types/react-planner/hooks/useScreenshotBeforeUnload.d.ts +0 -4
|
@@ -5,9 +5,10 @@ import * as SnapUtils from "./snap";
|
|
|
5
5
|
import * as SnapSceneUtils from "./snap-scene";
|
|
6
6
|
import * as history from "./history";
|
|
7
7
|
import * as ObjectUtils from "./objects-utils";
|
|
8
|
+
import * as LineFamilyUtils from "./line-family";
|
|
8
9
|
import IDBroker from "./id-broker";
|
|
9
10
|
import NameGenerator from "./name-generator";
|
|
10
|
-
export { GeometryUtils, GraphInnerCycles, MathUtils, SnapUtils, SnapSceneUtils, history, IDBroker, NameGenerator, ObjectUtils, };
|
|
11
|
+
export { GeometryUtils, GraphInnerCycles, MathUtils, SnapUtils, SnapSceneUtils, history, IDBroker, NameGenerator, ObjectUtils, LineFamilyUtils, };
|
|
11
12
|
declare const _default: {
|
|
12
13
|
GeometryUtils: typeof GeometryUtils;
|
|
13
14
|
GraphInnerCycles: typeof GraphInnerCycles;
|
|
@@ -18,5 +19,6 @@ declare const _default: {
|
|
|
18
19
|
IDBroker: typeof IDBroker;
|
|
19
20
|
NameGenerator: typeof NameGenerator;
|
|
20
21
|
ObjectUtils: typeof ObjectUtils;
|
|
22
|
+
LineFamilyUtils: typeof LineFamilyUtils;
|
|
21
23
|
};
|
|
22
24
|
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Surfaces (patios, lawns, decking…) are drawn with the very same `lines` +
|
|
2
|
+
* `vertices` machinery as walls — but they are not structure. A patio laid
|
|
3
|
+
* over a room must not weld itself onto the walls it crosses, must not split
|
|
4
|
+
* them, and must not turn the room's floor into part of the patio.
|
|
5
|
+
*
|
|
6
|
+
* So every graph operation works inside one *family* at a time: two lines
|
|
7
|
+
* only share a vertex, split each other, merge when colinear, or take part in
|
|
8
|
+
* the same area cycle when their families match. Snapping is deliberately
|
|
9
|
+
* exempt — a surface should still be able to land exactly on a wall corner,
|
|
10
|
+
* it just must not become attached to it.
|
|
11
|
+
*/
|
|
12
|
+
export type LineFamily = "surface" | "structure";
|
|
13
|
+
export declare const SURFACE_LINE_TYPE = "surface";
|
|
14
|
+
export declare function lineFamily(type?: string | null): LineFamily;
|
|
15
|
+
export declare function lineFamilyOf(line: any): LineFamily;
|
|
16
|
+
/** Whether a vertex may be shared with a line of `family`.
|
|
17
|
+
*
|
|
18
|
+
* A vertex nothing is hanging off yet takes anything. Otherwise it belongs to
|
|
19
|
+
* the families of the lines already attached — which is normally exactly one,
|
|
20
|
+
* but plans saved before families existed can have vertices where a wall and
|
|
21
|
+
* a surface already meet. Those stay usable by both rather than being split
|
|
22
|
+
* apart underneath a scene that is already drawn.
|
|
23
|
+
*/
|
|
24
|
+
export declare function vertexAcceptsFamily(vertex: any, layer: any, family: LineFamily): boolean;
|
|
25
|
+
/** The family of an area, read off the lines meeting at its corners. Mirrors
|
|
26
|
+
* `getAreaKind`'s rule: an area is a surface only when nothing structural
|
|
27
|
+
* borders it. */
|
|
28
|
+
export declare function areaFamily(area: any, layer: any): LineFamily;
|
|
29
|
+
export declare const LINE_FAMILIES: LineFamily[];
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ScreenshotOptions {
|
|
2
|
+
/** Cap output width in px (height scales to match). Omit for 1:1 with the SVG. */
|
|
3
|
+
maxWidth?: number;
|
|
4
|
+
/** Output MIME type. Default "image/png". */
|
|
5
|
+
type?: string;
|
|
6
|
+
/** Quality 0-1, for lossy types only. Ignored for PNG. */
|
|
7
|
+
quality?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Reject if the largest SVG on the page is narrower than this. The viewer2d
|
|
10
|
+
* SVG is unmounted in 3D mode, and without this the "largest SVG" would be a
|
|
11
|
+
* ~28px toolbar icon, silently producing a thumbnail of an icon.
|
|
12
|
+
*/
|
|
13
|
+
minWidth?: number;
|
|
14
|
+
/** Overall budget in ms. Default 15000. */
|
|
15
|
+
timeout?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Rasterize the plan viewer's SVG to a data URI. Rejects (rather than hanging)
|
|
19
|
+
* when there's nothing capturable on screen, an asset can't be decoded, or the
|
|
20
|
+
* whole thing overruns `timeout`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getSVGScreenshot: (options?: ScreenshotOptions) => Promise<string>;
|
|
@@ -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;
|
|
@@ -3,6 +3,12 @@ interface AreaProps {
|
|
|
3
3
|
area: any;
|
|
4
4
|
layer: any;
|
|
5
5
|
catalog: Catalog;
|
|
6
|
+
/** Which of the two passes this is. Fills and labels are drawn separately
|
|
7
|
+
* so every label lands above every fill — a surface laid over a room is
|
|
8
|
+
* meant to cover the room's floor, but not to swallow its name. Both
|
|
9
|
+
* passes iterate the same ordered list in
|
|
10
|
+
* [Layer.tsx](src/react-planner/viewer2d/Layer.tsx). */
|
|
11
|
+
part?: "fill" | "label";
|
|
6
12
|
}
|
|
7
|
-
export default function Area({ layer, area, catalog }: AreaProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default function Area({ layer, area, catalog, part, }: AreaProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
14
|
export {};
|
|
@@ -69,6 +69,16 @@ export default class Scene3DViewer extends React.Component<Viewer3DProps> {
|
|
|
69
69
|
* shadows for a scene that is still half loaded.
|
|
70
70
|
*/
|
|
71
71
|
private invalidateShadows;
|
|
72
|
+
/**
|
|
73
|
+
* Bound the dolly range to the size of what's being looked at, so you can
|
|
74
|
+
* neither fly halfway to the sun nor end up inside a wall.
|
|
75
|
+
*
|
|
76
|
+
* Re-derived when the extent changes, because the box measured at mount is
|
|
77
|
+
* the grid's — the size of the whole scene rather than of the plan drawn in
|
|
78
|
+
* it — and limits taken from that stop the camera well short of a small
|
|
79
|
+
* plan.
|
|
80
|
+
*/
|
|
81
|
+
private applyZoomLimits;
|
|
72
82
|
/**
|
|
73
83
|
* Dolly toward (factor > 1) or away from (factor < 1) the orbit target.
|
|
74
84
|
* OrbitControls' own min/maxDistance still bound the result, so the buttons
|
package/package.json
CHANGED