@archilogic/extension-sdk 0.13.2 → 0.14.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 +14 -0
- package/dist/index.d.ts +75 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @archilogic/extension-sdk
|
|
2
2
|
|
|
3
|
+
## 0.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e93e683: chore: rebuild extensions with space-graph-core 0.27 / floor-plan-io 5.21.4 so that they can load floors whose layouts contain `view:style` nodes
|
|
8
|
+
|
|
9
|
+
## 0.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- b4c58c3: Extensions can track the 2D viewport and frame arbitrary areas. The host may call the new `onCanvasChange` extension API (received as the `canvas-change` event) carrying a tagged `CanvasView2d` (`canvasMode: '2d'`) with the current `viewBox` in meters, `pixelsPerMeter` zoom scale and canvas pixel size — enabling screen-space tooling such as constant-pixel pick tolerances. The `canvasMode` discriminant reserves room for a future 3D canvas without renaming `CanvasChange`. The new `hostApi.zoomToBoundingBox({ min, max, animate })` lets an extension zoom the plan to a custom region, e.g. a drawing it rendered itself.
|
|
14
|
+
- 279ff09: Canvas pointer events now carry the keyboard `modifiers` (shift, alt, ctrl, meta) held at the time of the interaction, on both `onCanvasClick` and `onCanvasMouseMove`. The field is optional, so hosts that predate modifier forwarding keep working.
|
|
15
|
+
- c7bd399: Extensions can subscribe to canvas mousemove: the host may call the new `onCanvasMouseMove` extension API and extensions receive it as the `canvas-mousemove` event, enabling hover-driven tooling on the plan.
|
|
16
|
+
|
|
3
17
|
## 0.13.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -167,6 +167,47 @@ declare type BoundingBox3d = {
|
|
|
167
167
|
max: Vector3;
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
+
/**
|
|
171
|
+
* The canvas viewport as delivered to `onCanvasChange`. Today it is always the 2D view; a future
|
|
172
|
+
* 3D canvas would add a `CanvasView3d` (`canvasMode: '3d'`, camera pose) and widen this to
|
|
173
|
+
* `CanvasView2d | CanvasView3d` — extensions that switch on `canvasMode` stay forward-compatible.
|
|
174
|
+
*/
|
|
175
|
+
export declare type CanvasChange = CanvasView2d;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Keyboard modifier state at the moment of a canvas pointer event. Extensions can't listen to
|
|
179
|
+
* keys on the host document, so the host snapshots the modifiers into each event — e.g. for
|
|
180
|
+
* CAD-style selection where shift-click adds and alt-click removes.
|
|
181
|
+
*/
|
|
182
|
+
export declare type CanvasModifiers = {
|
|
183
|
+
shift: boolean;
|
|
184
|
+
alt: boolean;
|
|
185
|
+
ctrl: boolean;
|
|
186
|
+
meta: boolean;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* State of the 2D canvas viewport, emitted whenever the user pans, zooms or the canvas resizes.
|
|
191
|
+
* Lets an extension work in screen space — e.g. keep a pick tolerance at a constant pixel size
|
|
192
|
+
* (`tolerancePx / pixelsPerMeter` meters) so it tightens as the user zooms in. The `canvasMode`
|
|
193
|
+
* discriminant leaves room for a future 3D canvas without changing the `CanvasChange` name.
|
|
194
|
+
*/
|
|
195
|
+
export declare type CanvasView2d = {
|
|
196
|
+
canvasMode: '2d';
|
|
197
|
+
/** Visible plan area in meters, `[x, y]` corners in layout space. */
|
|
198
|
+
viewBox: {
|
|
199
|
+
min: Vector2;
|
|
200
|
+
max: Vector2;
|
|
201
|
+
};
|
|
202
|
+
/** Screen pixels per plan meter — the zoom scale. */
|
|
203
|
+
pixelsPerMeter: number;
|
|
204
|
+
/** Canvas size in CSS pixels. */
|
|
205
|
+
canvas: {
|
|
206
|
+
width: number;
|
|
207
|
+
height: number;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
|
|
170
211
|
declare interface CircleCurve extends CurveBase {
|
|
171
212
|
type: CircleCurveType;
|
|
172
213
|
position?: Vector2;
|
|
@@ -697,10 +738,19 @@ export declare type ExtensionApi = {
|
|
|
697
738
|
position: [number, number];
|
|
698
739
|
nodeId: string;
|
|
699
740
|
}): void;
|
|
700
|
-
onCanvasClick({ position, nodeId }: {
|
|
741
|
+
onCanvasClick({ position, nodeId, modifiers }: {
|
|
742
|
+
position: [number, number];
|
|
743
|
+
nodeId?: string;
|
|
744
|
+
/** Absent on hosts that predate modifier forwarding. */
|
|
745
|
+
modifiers?: CanvasModifiers;
|
|
746
|
+
}): void;
|
|
747
|
+
onCanvasMouseMove({ position, nodeId, modifiers }: {
|
|
701
748
|
position: [number, number];
|
|
702
749
|
nodeId?: string;
|
|
750
|
+
/** Absent on hosts that predate modifier forwarding. */
|
|
751
|
+
modifiers?: CanvasModifiers;
|
|
703
752
|
}): void;
|
|
753
|
+
onCanvasChange(change: CanvasChange): void;
|
|
704
754
|
};
|
|
705
755
|
|
|
706
756
|
declare type ExtensionEventKey = keyof ExtensionEventMap;
|
|
@@ -712,6 +762,8 @@ declare type ExtensionEventMap = {
|
|
|
712
762
|
'selection-change': Parameters<ExtensionApi['onSelectionChange']>[0];
|
|
713
763
|
'graphic-drag': Parameters<ExtensionApi['onGraphicDrag']>[0];
|
|
714
764
|
'canvas-click': Parameters<ExtensionApi['onCanvasClick']>[0];
|
|
765
|
+
'canvas-mousemove': Parameters<ExtensionApi['onCanvasMouseMove']>[0];
|
|
766
|
+
'canvas-change': Parameters<ExtensionApi['onCanvasChange']>[0];
|
|
715
767
|
};
|
|
716
768
|
|
|
717
769
|
declare class ExtrusionGeometry extends ParametricGeometryBase {
|
|
@@ -1129,6 +1181,15 @@ export declare type HostApi = {
|
|
|
1129
1181
|
margin?: number;
|
|
1130
1182
|
animate?: number | boolean;
|
|
1131
1183
|
}) => Promise<boolean>;
|
|
1184
|
+
/**
|
|
1185
|
+
* Frame an arbitrary area in plan meters — e.g. a custom drawing the extension rendered that
|
|
1186
|
+
* the host floor's own extents don't cover.
|
|
1187
|
+
*/
|
|
1188
|
+
zoomToBoundingBox: (args: {
|
|
1189
|
+
min: Vector2;
|
|
1190
|
+
max: Vector2;
|
|
1191
|
+
animate?: number | boolean;
|
|
1192
|
+
}) => Promise<boolean>;
|
|
1132
1193
|
drawNodeUpdate: (args: {
|
|
1133
1194
|
nodeId: string;
|
|
1134
1195
|
style: 'selected' | ShapeStyle | false;
|
|
@@ -2521,6 +2582,7 @@ declare type NullComparator = {
|
|
|
2521
2582
|
null: boolean;
|
|
2522
2583
|
};
|
|
2523
2584
|
|
|
2585
|
+
/** Operators apply conjunctively, so one lower and one upper bound combine into a bounded range */
|
|
2524
2586
|
declare type NumberComparator = number | {
|
|
2525
2587
|
eq: number;
|
|
2526
2588
|
} | {
|
|
@@ -2537,6 +2599,18 @@ declare type NumberComparator = number | {
|
|
|
2537
2599
|
lt: number;
|
|
2538
2600
|
} | {
|
|
2539
2601
|
lte: number;
|
|
2602
|
+
} | {
|
|
2603
|
+
gt: number;
|
|
2604
|
+
lt: number;
|
|
2605
|
+
} | {
|
|
2606
|
+
gt: number;
|
|
2607
|
+
lte: number;
|
|
2608
|
+
} | {
|
|
2609
|
+
gte: number;
|
|
2610
|
+
lt: number;
|
|
2611
|
+
} | {
|
|
2612
|
+
gte: number;
|
|
2613
|
+
lte: number;
|
|
2540
2614
|
};
|
|
2541
2615
|
|
|
2542
2616
|
declare interface NumberField extends BaseField {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archilogic/extension-sdk",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@archilogic/floor-plan-core": "^5.8.
|
|
32
|
-
"@archilogic/space-graph-sdk": "^0.10.
|
|
31
|
+
"@archilogic/floor-plan-core": "^5.8.4",
|
|
32
|
+
"@archilogic/space-graph-sdk": "^0.10.1",
|
|
33
33
|
"vite-plugin-static-copy": "^4.1.1"
|
|
34
34
|
},
|
|
35
35
|
"nx": {}
|