@ubuilder-ai/floorplan-contract 0.1.0-alpha.3 → 0.2.0

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # @ubuilder-ai/floorplan-contract
2
-
3
- Pure floor-plan presentation metadata and context shared by Nodes, Workspace, and Editor.
4
-
5
- The package has no dependency on Core, Viewer, Workspace, Editor, React, Three.js, or browser APIs. Core supplies only opaque `GeometryContext.extensions` and geometry `metadata`; presentation owners interpret those opaque records through this contract.
1
+ # @ubuilder-ai/floorplan-contract
2
+
3
+ Pure floor-plan presentation metadata and context shared by Nodes, Workspace, and Editor.
4
+
5
+ The package has no dependency on Core, Viewer, Workspace, Editor, React, Three.js, or browser APIs. Core supplies only opaque `GeometryContext.extensions` and geometry `metadata`; presentation owners interpret those opaque records through this contract.
package/dist/index.d.ts CHANGED
@@ -6,6 +6,10 @@ export type FloorplanWallDimensionReference = 'finished-faces' | 'centerline' |
6
6
  export declare const DEFAULT_FLOORPLAN_WALL_DIMENSION_REFERENCE = "finished-faces";
7
7
  export type FloorplanAnnotationRole = 'automatic-dimension' | 'manual-dimension' | 'measurement' | 'opening-mark' | 'structural-grid' | 'column-center' | 'room-label' | 'stair-annotation';
8
8
  export type FloorplanGeometryFillRole = 'detected-space';
9
+ export type FloorplanUnitFocus = {
10
+ focusedUnitId: string;
11
+ focusedUnitMemberIds: readonly string[];
12
+ };
9
13
  export type FloorplanSchedule = {
10
14
  id: string;
11
15
  title: string;
@@ -29,6 +33,7 @@ export type FloorplanPresentationContext = {
29
33
  purpose: FloorplanRenderPurpose;
30
34
  metricNotation: FloorplanMetricNotation;
31
35
  wallDimensionReference: FloorplanWallDimensionReference;
36
+ unitFocus?: FloorplanUnitFocus;
32
37
  };
33
38
  export type FloorplanContextExtension = FloorplanPresentationContext & {
34
39
  runtimeState?: unknown;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var A="pascal:workspace/floorplan",B="pascal:workspace/floorplan",C="finished-faces";function k(b){return b==="centerline"||b==="stud-faces"?b:"finished-faces"}function q(b){return{["pascal:workspace/floorplan"]:b}}function E(b,h){if(!b)return b;let j=w(b);return{...b,metadata:q({...j,...h})}}function w(b){let j=b?.metadata?.["pascal:workspace/floorplan"];return j&&typeof j==="object"&&!Array.isArray(j)?j:{}}function H(b){return{["pascal:workspace/floorplan"]:{purpose:b.purpose==="document"?"document":"edit",metricNotation:b.metricNotation==="millimeters"?"millimeters":"meters",wallDimensionReference:k(b.wallDimensionReference),runtimeState:b.runtimeState}}}function I(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(h&&typeof h==="object"&&!Array.isArray(h)){let j=h;return{purpose:j.purpose==="document"?"document":"edit",metricNotation:j.metricNotation==="millimeters"?"millimeters":"meters",wallDimensionReference:k(j.wallDimensionReference)}}return{purpose:"edit",metricNotation:"meters",wallDimensionReference:"finished-faces"}}function J(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(!h||typeof h!=="object"||Array.isArray(h))return;return h.runtimeState}function K(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(!h||typeof h!=="object"||Array.isArray(h))return;let j=h.metricNotation;return j==="meters"||j==="millimeters"?j:void 0}export{E as withFloorplanGeometryMetadata,J as readFloorplanRuntimeState,K as readFloorplanMetricNotationOverride,w as readFloorplanGeometryMetadata,I as readFloorplanContext,k as normalizeFloorplanWallDimensionReference,q as floorplanGeometryMetadata,H as createFloorplanContextExtensions,A as FLOORPLAN_GEOMETRY_METADATA_KEY,B as FLOORPLAN_CONTEXT_EXTENSION_KEY,C as DEFAULT_FLOORPLAN_WALL_DIMENSION_REFERENCE};
1
+ var A="pascal:workspace/floorplan",B="pascal:workspace/floorplan",C="finished-faces";function k(b){return b==="centerline"||b==="stud-faces"?b:"finished-faces"}function q(b){return{["pascal:workspace/floorplan"]:b}}function E(b,h){if(!b)return b;let j=w(b);return{...b,metadata:q({...j,...h})}}function w(b){let j=b?.metadata?.["pascal:workspace/floorplan"];return j&&typeof j==="object"&&!Array.isArray(j)?j:{}}function H(b){return{["pascal:workspace/floorplan"]:{purpose:b.purpose==="document"?"document":"edit",metricNotation:b.metricNotation==="millimeters"?"millimeters":"meters",wallDimensionReference:k(b.wallDimensionReference),runtimeState:b.runtimeState,...b.purpose!=="document"&&b.unitFocus?{unitFocus:b.unitFocus}:{}}}}function I(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(h&&typeof h==="object"&&!Array.isArray(h)){let j=h;return{purpose:j.purpose==="document"?"document":"edit",metricNotation:j.metricNotation==="millimeters"?"millimeters":"meters",wallDimensionReference:k(j.wallDimensionReference),...j.purpose!=="document"&&j.unitFocus?{unitFocus:j.unitFocus}:{}}}return{purpose:"edit",metricNotation:"meters",wallDimensionReference:"finished-faces"}}function J(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(!h||typeof h!=="object"||Array.isArray(h))return;return h.runtimeState}function K(b){let h=b.extensions?.["pascal:workspace/floorplan"];if(!h||typeof h!=="object"||Array.isArray(h))return;let j=h.metricNotation;return j==="meters"||j==="millimeters"?j:void 0}export{E as withFloorplanGeometryMetadata,J as readFloorplanRuntimeState,K as readFloorplanMetricNotationOverride,w as readFloorplanGeometryMetadata,I as readFloorplanContext,k as normalizeFloorplanWallDimensionReference,q as floorplanGeometryMetadata,H as createFloorplanContextExtensions,A as FLOORPLAN_GEOMETRY_METADATA_KEY,B as FLOORPLAN_CONTEXT_EXTENSION_KEY,C as DEFAULT_FLOORPLAN_WALL_DIMENSION_REFERENCE};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubuilder-ai/floorplan-contract",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.2.0",
4
4
  "description": "Pure floor-plan presentation metadata and context contract for uBuilder hosts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",