@archilogic/extension-sdk 0.12.0 → 0.13.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @archilogic/extension-sdk
2
2
 
3
+ ## 0.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5b9044b: Update `@archilogic` engine and SDK dependencies to their latest releases: `floor-plan-core`/`floor-plan-webgl` `5.8.0`, `floor-plan-io` `5.21.1`, `space-graph-core`/`space-graph-io` `0.25.6`, `spaceapi-sdk` `4.2.0`, `taxonomy` `1.5.0`, and `types` `4.12.0`.
8
+
9
+ ## 0.13.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b13c0d8: feat: add support for exportSvg
14
+
3
15
  ## 0.12.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -711,8 +711,21 @@ declare type EntityResult = {
711
711
  declare interface ExportPdfOptions {
712
712
  orientation: 'landscape' | 'portrait';
713
713
  format: 'a4' | 'a3' | 'letter';
714
+ skipDownload?: boolean;
714
715
  }
715
716
 
717
+ declare type ExportPdfResult = {
718
+ data: ArrayBuffer;
719
+ };
720
+
721
+ declare interface ExportSvgOptions {
722
+ skipDownload?: boolean;
723
+ }
724
+
725
+ declare type ExportSvgResult = {
726
+ data: string;
727
+ };
728
+
716
729
  export declare type ExtensionApi = {
717
730
  onConnect(parameters?: Record<string, unknown>): Promise<unknown> | void;
718
731
  onDestroy(): void;
@@ -1168,7 +1181,8 @@ export declare type HostApi = {
1168
1181
  nodeIds: string[];
1169
1182
  }) => Promise<NodeResult[]>;
1170
1183
  getSpaceGraphJson: () => Promise<SpaceGraphJson>;
1171
- exportPdf: (args?: ExportPdfOptions) => Promise<void>;
1184
+ exportPdf: (args?: ExportPdfOptions) => Promise<void | ExportPdfResult>;
1185
+ exportSvg: (args?: ExportSvgOptions) => Promise<void | ExportSvgResult>;
1172
1186
  getPath: (args: {
1173
1187
  start: Vector2;
1174
1188
  end: Vector2;
@@ -2030,6 +2044,7 @@ declare class LayoutSpace extends LayoutBoundingBoxNode {
2030
2044
  get isExternal(): boolean;
2031
2045
  calculateArea(): number;
2032
2046
  getArea(): number;
2047
+ setPolygons(polygons: Vector2[][]): void;
2033
2048
  getAdjacentSpaces(graph: Graph, { connectivity }?: {
2034
2049
  connectivity?: number;
2035
2050
  }): LayoutSpace[];
@@ -2277,6 +2292,8 @@ declare class LayoutWall extends LayoutEdgeElementBase {
2277
2292
  constructor(id: string, edges: SpatialGraphEdge[]);
2278
2293
  copyForClone(wall: LayoutWall): void;
2279
2294
  setParameters(parameters: RecursivePartial<LayoutWallParameters>): void;
2295
+ insertElement(element: LayoutElement): void;
2296
+ removeElement(element: LayoutElement): void;
2280
2297
  calculateBoundingBox(): BoundingBox3d;
2281
2298
  }
2282
2299
 
@@ -2433,14 +2450,14 @@ declare type NodeLabel = {
2433
2450
  text?: Rgb;
2434
2451
  textOutline?: boolean;
2435
2452
  /** Only render the label when zoom is within [min, max]. */
2436
- visible?: [number, number];
2453
+ visible?: ZoomRange;
2437
2454
  /**
2438
2455
  * Controls fixed screen size (1/zoom) scaling:
2439
2456
  * - `false`: render at world scale
2440
2457
  * - `true` or omitted: always apply 1/zoom scaling
2441
2458
  * - `[min, max]`: apply 1/zoom scaling within the zoom range; outside it, clamp to the scale at the boundary (1/min or 1/max) to avoid jumps
2442
2459
  */
2443
- fixedScreenSize?: boolean | [number, number];
2460
+ fixedScreenSize?: boolean | ZoomRange;
2444
2461
  };
2445
2462
 
2446
2463
  declare type NodeResult = {
@@ -3282,7 +3299,7 @@ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
3282
3299
  spacesById: Record<string, LayoutSpace>;
3283
3300
  elements: LayoutElement[];
3284
3301
  elementsById: Record<string, LayoutElement>;
3285
- elementsByType: NodesByType< {
3302
+ elementsByType: NodesByType<{
3286
3303
  readonly 'element:ceiling': typeof LayoutBoundarySlab;
3287
3304
  readonly 'element:floor': typeof LayoutBoundarySlab;
3288
3305
  readonly 'element:boundaryWall': typeof LayoutBoundaryWall;
@@ -3307,13 +3324,13 @@ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
3307
3324
  }>;
3308
3325
  annotations: LayoutAnnotation[];
3309
3326
  annotationsById: Record<string, LayoutAnnotation>;
3310
- annotationsByType: NodesByType< {
3327
+ annotationsByType: NodesByType<{
3311
3328
  readonly 'annotation:floorPlanDxf': LayoutFloorPlanDxfAnnotation;
3312
3329
  readonly 'annotation:floorPlanImage': LayoutFloorPlanImageAnnotation;
3313
3330
  }>;
3314
3331
  views: LayoutView[];
3315
3332
  viewsById: Record<string, LayoutView>;
3316
- viewsByType: NodesByType< {
3333
+ viewsByType: NodesByType<{
3317
3334
  readonly 'view:2d': Layout2dView;
3318
3335
  readonly 'view:3d': Layout3dView;
3319
3336
  }>;
@@ -3690,7 +3707,14 @@ declare const SpatialGraphVertexTypeValue = "spatialGraph:vertex";
3690
3707
  * ```
3691
3708
  */
3692
3709
  declare class SpatialIndex extends default_2<IndexedNodeReference> {
3693
- nodeIds: Set<string>;
3710
+ /**
3711
+ * Maps a node id to the bounding box reference that was actually inserted into
3712
+ * the tree. We need the exact inserted reference (with its original
3713
+ * coordinates) to remove it again: RBush navigates the tree using the item's
3714
+ * bounding box, so removing with a node's *current* (moved) bounding box can
3715
+ * fail to locate the stale entry, leaving duplicates behind.
3716
+ */
3717
+ indexedNodesById: Map<string, IndexedNodeReference>;
3694
3718
  layout: SpaceGraphLayout;
3695
3719
  constructor(layout: SpaceGraphLayout);
3696
3720
  /**
@@ -4043,4 +4067,7 @@ declare type ViewUpdateValue = Partial<LayoutViewJson> & {
4043
4067
  parameters?: Partial<LayoutViewJson['parameters']>;
4044
4068
  };
4045
4069
 
4070
+ /** A `[min, max]` zoom range (inclusive bounds) used for zoom-dependent rendering. */
4071
+ declare type ZoomRange = [min: number, max: number];
4072
+
4046
4073
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@archilogic/extension-sdk",
3
3
  "description": "",
4
- "version": "0.12.0",
4
+ "version": "0.13.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -28,9 +28,9 @@
28
28
  }
29
29
  },
30
30
  "devDependencies": {
31
- "@archilogic/floor-plan-core": "^5.5.0",
31
+ "@archilogic/floor-plan-core": "^5.8.0",
32
32
  "@archilogic/space-graph-sdk": "^0.9.0",
33
- "vite-plugin-static-copy": "^3.1.4"
33
+ "vite-plugin-static-copy": "^4.1.1"
34
34
  },
35
35
  "nx": {}
36
- }
36
+ }