@archilogic/extension-sdk 0.6.2 → 0.7.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 +18 -0
- package/dist/index.d.ts +200 -141
- package/dist/manifest-schema.json +4 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @archilogic/extension-sdk
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9b06638: feat: add description to extension manifest
|
|
8
|
+
|
|
9
|
+
## 0.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- ee852f2: feat(extension-sdk): support floor plan theme filters via floor-plan-core update
|
|
14
|
+
- 8b067d4: feat(extension-sdk): add hostApi.prompt and hostApi.confirm methods
|
|
15
|
+
- f3ea834: feat(extension-sdk): upgrade to space-graph-sdk 0.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0d96245: fix(extension-sdk): used mapped type instead of fragile type generation
|
|
20
|
+
|
|
3
21
|
## 0.6.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -85,21 +85,25 @@ declare interface BaseData {
|
|
|
85
85
|
height: number;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* axis alignend bounding box in root space
|
|
89
89
|
* @example
|
|
90
90
|
* {
|
|
91
91
|
* min: [0, 0, 0],
|
|
92
|
-
* max: [1, 2, 1]
|
|
93
|
-
* transform: {
|
|
94
|
-
* position: [0, 0, 0],
|
|
95
|
-
* rotation: 0,
|
|
96
|
-
* rotationAxis: [0, 1, 0]
|
|
97
|
-
* }
|
|
92
|
+
* max: [1, 2, 1]
|
|
98
93
|
* }
|
|
99
94
|
* */
|
|
100
|
-
boundingBox:
|
|
101
|
-
/**
|
|
102
|
-
boundingBoxContour:
|
|
95
|
+
boundingBox: BoundingBox3d;
|
|
96
|
+
/** contour of the object aligned bounding box in root space */
|
|
97
|
+
boundingBoxContour: Polygon;
|
|
98
|
+
labelPoint: Vector2;
|
|
99
|
+
contour: PolygonWithHoles;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare interface BaseField {
|
|
103
|
+
label?: string;
|
|
104
|
+
type: FieldType;
|
|
105
|
+
default?: FieldValueType;
|
|
106
|
+
required?: boolean;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
declare interface BaseFilter {
|
|
@@ -128,6 +132,8 @@ declare interface BaseSelect {
|
|
|
128
132
|
};
|
|
129
133
|
boundingBox?: boolean;
|
|
130
134
|
boundingBoxContour?: boolean;
|
|
135
|
+
labelPoint?: boolean;
|
|
136
|
+
contour?: boolean;
|
|
131
137
|
}
|
|
132
138
|
|
|
133
139
|
declare interface BaseShape {
|
|
@@ -137,7 +143,7 @@ declare interface BaseShape {
|
|
|
137
143
|
|
|
138
144
|
declare interface BezierCurve extends BaseShape {
|
|
139
145
|
type: 'curve:quadraticBezier';
|
|
140
|
-
points:
|
|
146
|
+
points: Polygon_2;
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
declare type BooleanComparator = boolean | {
|
|
@@ -146,6 +152,11 @@ declare type BooleanComparator = boolean | {
|
|
|
146
152
|
neq: boolean;
|
|
147
153
|
};
|
|
148
154
|
|
|
155
|
+
declare interface BooleanField extends BaseField {
|
|
156
|
+
type: 'boolean';
|
|
157
|
+
default?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
149
160
|
declare type BoundingBox3d = {
|
|
150
161
|
min: Vector3;
|
|
151
162
|
max: Vector3;
|
|
@@ -251,6 +262,13 @@ declare type CompositeCurveType = typeof CompositeCurveTypeValue;
|
|
|
251
262
|
|
|
252
263
|
declare const CompositeCurveTypeValue = "curve:composite";
|
|
253
264
|
|
|
265
|
+
export declare interface ConfirmArgs {
|
|
266
|
+
title: string;
|
|
267
|
+
message?: string;
|
|
268
|
+
confirmLabel?: string;
|
|
269
|
+
cancelLabel?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
254
272
|
/**
|
|
255
273
|
* An object representing the connection as a result of calling connect().
|
|
256
274
|
*/
|
|
@@ -399,7 +417,7 @@ declare type CustomStairsParametersJson = Partial<CustomStairsParameters>;
|
|
|
399
417
|
|
|
400
418
|
declare type CustomStairsType = 'custom';
|
|
401
419
|
|
|
402
|
-
declare type DefaultSelect = {
|
|
420
|
+
export declare type DefaultSelect = {
|
|
403
421
|
id: true;
|
|
404
422
|
type: true;
|
|
405
423
|
};
|
|
@@ -616,9 +634,14 @@ export declare interface ElementData extends BaseData {
|
|
|
616
634
|
isExternal: boolean;
|
|
617
635
|
parameters: LayoutElementJson['parameters'];
|
|
618
636
|
product: ProductData;
|
|
619
|
-
|
|
620
|
-
|
|
637
|
+
/** local transform for nested elements like openings, windows */
|
|
638
|
+
localTransform: SimpleTransform3d;
|
|
639
|
+
/** transform in root space */
|
|
640
|
+
transform: SimpleTransform3d;
|
|
641
|
+
/** local object aligned bounding box */
|
|
642
|
+
localBoundingBox: BoundingBox3d;
|
|
621
643
|
elements: ElementData[];
|
|
644
|
+
parent: ElementData;
|
|
622
645
|
}
|
|
623
646
|
|
|
624
647
|
export declare interface ElementFilter extends BaseFilter {
|
|
@@ -648,8 +671,11 @@ declare const ElementRemoveTypeValue: "operation:elementRemove";
|
|
|
648
671
|
export declare interface ElementSelect extends BaseSelect {
|
|
649
672
|
product?: ProductSelect | boolean;
|
|
650
673
|
isExternal?: boolean;
|
|
651
|
-
|
|
652
|
-
|
|
674
|
+
localBoundingBox?: boolean;
|
|
675
|
+
localTransform?: boolean;
|
|
676
|
+
transform?: boolean;
|
|
677
|
+
parent?: ElementSelect | boolean;
|
|
678
|
+
elements?: ElementQuery | boolean;
|
|
653
679
|
}
|
|
654
680
|
|
|
655
681
|
declare class ElementUpdate extends OperationBase {
|
|
@@ -724,10 +750,14 @@ declare type ExtrusionGeometryType = typeof ExtrusionGeometryTypeValue;
|
|
|
724
750
|
|
|
725
751
|
declare const ExtrusionGeometryTypeValue = "geometry:extrusion";
|
|
726
752
|
|
|
753
|
+
declare type FieldType = 'text' | 'number' | 'boolean' | 'select';
|
|
754
|
+
|
|
755
|
+
declare type FieldValueType = string | number | boolean;
|
|
756
|
+
|
|
727
757
|
/**
|
|
728
758
|
* This is the place to give the floor plan your own style
|
|
729
759
|
*/
|
|
730
|
-
declare type FloorPlanTheme = {
|
|
760
|
+
export declare type FloorPlanTheme = {
|
|
731
761
|
/** define the background */
|
|
732
762
|
background?: BackgroundOptions;
|
|
733
763
|
/** wall contours are merged to one continuous outline, needed if you want white walls */
|
|
@@ -735,43 +765,19 @@ declare type FloorPlanTheme = {
|
|
|
735
765
|
/** render assets with textures rather than solid colors */
|
|
736
766
|
showAssetTextures?: boolean;
|
|
737
767
|
fontFamily?: string;
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
text?: Rgb;
|
|
748
|
-
/** whether the room stamp text should have an outline to assist with contrast issues */
|
|
749
|
-
textOutline?: boolean;
|
|
750
|
-
};
|
|
751
|
-
'element:asset'?: ShapeStyle;
|
|
752
|
-
'element:beam'?: ShapeStyle;
|
|
753
|
-
'element:boundaryWall'?: ShapeStyle;
|
|
754
|
-
'element:casework'?: ShapeStyle;
|
|
755
|
-
'element:ceiling'?: ShapeStyle;
|
|
756
|
-
'element:column'?: ShapeStyle;
|
|
757
|
-
'element:curtainWall'?: ShapeStyle;
|
|
758
|
-
'element:door'?: ShapeStyle;
|
|
759
|
-
'element:floor'?: ShapeStyle;
|
|
760
|
-
'element:generic'?: ShapeStyle;
|
|
761
|
-
'element:kitchen'?: ShapeStyle;
|
|
762
|
-
'element:opening'?: ShapeStyle;
|
|
763
|
-
'element:railing'?: ShapeStyle;
|
|
764
|
-
'element:ramp'?: ShapeStyle;
|
|
765
|
-
'element:roof'?: ShapeStyle;
|
|
766
|
-
'element:slab'?: ShapeStyle;
|
|
767
|
-
'element:spaceDivider'?: ShapeStyle;
|
|
768
|
-
'element:stairFlight'?: ShapeStyle;
|
|
769
|
-
'element:stairs'?: ShapeStyle;
|
|
770
|
-
'element:wall'?: ShapeStyle;
|
|
771
|
-
'element:window'?: ShapeStyle;
|
|
772
|
-
'layout:space'?: SpaceShapeStyle;
|
|
773
|
-
'spatialGraph:edge'?: ShapeStyle;
|
|
768
|
+
roomStamps?: {
|
|
769
|
+
/** show the area information in room stamps */
|
|
770
|
+
roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id' | ['customAttribute', string])[];
|
|
771
|
+
/** text color for room stamps */
|
|
772
|
+
text?: Rgb;
|
|
773
|
+
/** whether the room stamp text should have an outline to assist with contrast issues */
|
|
774
|
+
textOutline?: boolean;
|
|
775
|
+
/** if set room stamps have a fixed size - otherwise they adapt to the zoom level */
|
|
776
|
+
fontSize?: number;
|
|
774
777
|
};
|
|
778
|
+
byId?: StyleByKey;
|
|
779
|
+
byFilter?: ThemeStyles['byFilter'];
|
|
780
|
+
byType?: ThemeStyles['byType'];
|
|
775
781
|
};
|
|
776
782
|
|
|
777
783
|
declare class GeometryBase extends SpaceGraphNodeBase {
|
|
@@ -986,7 +992,12 @@ declare type HingeSide = 'left' | 'right';
|
|
|
986
992
|
export declare type HostApi = {
|
|
987
993
|
/**
|
|
988
994
|
* @example
|
|
989
|
-
*
|
|
995
|
+
* ```ts
|
|
996
|
+
* const element = await hostApi.getElementsById({
|
|
997
|
+
* id,
|
|
998
|
+
* select: { type: true, dimensions: { length: true }}
|
|
999
|
+
* })
|
|
1000
|
+
* ```
|
|
990
1001
|
*/
|
|
991
1002
|
getElementById: <S extends ElementSelect = DefaultSelect>(args: {
|
|
992
1003
|
id: string;
|
|
@@ -994,7 +1005,13 @@ export declare type HostApi = {
|
|
|
994
1005
|
}) => Promise<QueryPick<ElementData, S> | null>;
|
|
995
1006
|
/**
|
|
996
1007
|
* @example
|
|
997
|
-
*
|
|
1008
|
+
* ```ts
|
|
1009
|
+
* const elements = await hostApi.getElements({
|
|
1010
|
+
* where: {
|
|
1011
|
+
* customAttributes: { broken: true }
|
|
1012
|
+
* }
|
|
1013
|
+
* })
|
|
1014
|
+
* ```
|
|
998
1015
|
*/
|
|
999
1016
|
getElements: <S extends ElementSelect = DefaultSelect>(args?: {
|
|
1000
1017
|
select?: S;
|
|
@@ -1016,6 +1033,9 @@ export declare type HostApi = {
|
|
|
1016
1033
|
select?: S;
|
|
1017
1034
|
where?: ProductFilter;
|
|
1018
1035
|
}) => Promise<QueryPick<ProductData, S>[]>;
|
|
1036
|
+
getLayout: <S extends LayoutSelect = DefaultSelect>(args?: {
|
|
1037
|
+
select?: S;
|
|
1038
|
+
}) => Promise<QueryPick<LayoutData, S>>;
|
|
1019
1039
|
runOperations: (args: {
|
|
1020
1040
|
operations: OperationJson[];
|
|
1021
1041
|
}) => Promise<OperationsResult>;
|
|
@@ -1049,77 +1069,27 @@ export declare type HostApi = {
|
|
|
1049
1069
|
selectNodes: (args: {
|
|
1050
1070
|
nodeIds: string[];
|
|
1051
1071
|
}) => Promise<NodeResult[]>;
|
|
1072
|
+
/**
|
|
1073
|
+
* @example
|
|
1074
|
+
* ```ts
|
|
1075
|
+
* const layoutConfig = await hostApi.prompt({
|
|
1076
|
+
* title: 'Specify layout configuration',
|
|
1077
|
+
* fields: {
|
|
1078
|
+
* chairCount: { type: 'number', label: 'Chair count', min: 3, max: 20, step: 1, default: 5 },
|
|
1079
|
+
* radius: { type: 'number', min: 1, max: 10, step: 0.1 }
|
|
1080
|
+
* }
|
|
1081
|
+
* })
|
|
1082
|
+
* ```
|
|
1083
|
+
*/
|
|
1084
|
+
prompt: (args: PromptArgs) => Promise<Record<string, FieldValueType> | false>;
|
|
1085
|
+
confirm: (args: ConfirmArgs) => Promise<boolean>;
|
|
1052
1086
|
on: <K extends ExtensionEventKey>(event: K, listener: ExtensionEventListener<K>, ctx?: unknown) => void;
|
|
1053
1087
|
once: <K extends ExtensionEventKey>(event: K, listener: ExtensionEventListener<K>, ctx?: unknown) => void;
|
|
1054
1088
|
off: <K extends ExtensionEventKey>(event: K, listener?: ExtensionEventListener<K>) => void;
|
|
1055
1089
|
};
|
|
1056
1090
|
|
|
1057
1091
|
export declare type HostApiSync = {
|
|
1058
|
-
|
|
1059
|
-
* @example
|
|
1060
|
-
* const element = await hostApi.getElementsById({ id, select: { type: true, dimensions: { length: true }}})
|
|
1061
|
-
*/
|
|
1062
|
-
getElementById: <S extends ElementSelect = DefaultSelect>(args: {
|
|
1063
|
-
id: string;
|
|
1064
|
-
select?: S;
|
|
1065
|
-
}) => QueryPick<ElementData, S> | null;
|
|
1066
|
-
/**
|
|
1067
|
-
* @example
|
|
1068
|
-
* const elements = await hostApi.getElements({ where: { customAttributes: { broken: true }}})
|
|
1069
|
-
*/
|
|
1070
|
-
getElements: <S extends ElementSelect = DefaultSelect>(args?: {
|
|
1071
|
-
select?: S;
|
|
1072
|
-
where?: ElementFilter;
|
|
1073
|
-
}) => QueryPick<ElementData, S>[];
|
|
1074
|
-
getSpaceById: <S extends SpaceSelect = DefaultSelect>(args: {
|
|
1075
|
-
id: string;
|
|
1076
|
-
select?: S;
|
|
1077
|
-
}) => QueryPick<SpaceData, S> | null;
|
|
1078
|
-
getSpaces: <S extends SpaceSelect = DefaultSelect>(args?: {
|
|
1079
|
-
select?: S;
|
|
1080
|
-
where?: SpaceFilter;
|
|
1081
|
-
}) => QueryPick<SpaceData, S>[];
|
|
1082
|
-
getProductById: <S extends ProductSelect = DefaultSelect>(args: {
|
|
1083
|
-
id: string;
|
|
1084
|
-
select?: S;
|
|
1085
|
-
}) => QueryPick<ProductData, S> | null;
|
|
1086
|
-
getProducts: <S extends ProductSelect = DefaultSelect>(args?: {
|
|
1087
|
-
select?: S;
|
|
1088
|
-
where?: ProductFilter;
|
|
1089
|
-
}) => QueryPick<ProductData, S>[];
|
|
1090
|
-
runOperations: (args: {
|
|
1091
|
-
operations: OperationJson[];
|
|
1092
|
-
}) => OperationsResult;
|
|
1093
|
-
setPlanConfig: (config: {
|
|
1094
|
-
theme: FloorPlanTheme;
|
|
1095
|
-
}) => boolean;
|
|
1096
|
-
addPlanLayer: (args: {
|
|
1097
|
-
id?: string;
|
|
1098
|
-
baseLayer?: string;
|
|
1099
|
-
}) => EntityResult;
|
|
1100
|
-
addPlanGraphic: (args: {
|
|
1101
|
-
shapes: Shape[];
|
|
1102
|
-
isHandler?: boolean;
|
|
1103
|
-
layerId?: string;
|
|
1104
|
-
id?: string;
|
|
1105
|
-
clearLayer?: boolean;
|
|
1106
|
-
}) => EntityResult;
|
|
1107
|
-
zoomToNode: (args: {
|
|
1108
|
-
nodeId: string;
|
|
1109
|
-
margin?: number;
|
|
1110
|
-
animate?: number | boolean;
|
|
1111
|
-
}) => boolean;
|
|
1112
|
-
zoomExtents: (args?: {
|
|
1113
|
-
margin?: number;
|
|
1114
|
-
animate?: number | boolean;
|
|
1115
|
-
}) => boolean;
|
|
1116
|
-
drawNodeUpdate: (args: {
|
|
1117
|
-
nodeId: string;
|
|
1118
|
-
style: 'selected' | ShapeStyle | false;
|
|
1119
|
-
}) => boolean;
|
|
1120
|
-
selectNodes: (args: {
|
|
1121
|
-
nodeIds: string[];
|
|
1122
|
-
}) => NodeResult[];
|
|
1092
|
+
[K in Exclude<keyof HostApi, OmitKeys>]: K extends KeepAsync ? HostApi[K] : Sync<HostApi[K]>;
|
|
1123
1093
|
};
|
|
1124
1094
|
|
|
1125
1095
|
declare type IndexedNodeReference = {
|
|
@@ -1137,6 +1107,8 @@ declare type IndexRange = {
|
|
|
1137
1107
|
end: number;
|
|
1138
1108
|
};
|
|
1139
1109
|
|
|
1110
|
+
declare type KeepAsync = 'prompt' | 'confirm';
|
|
1111
|
+
|
|
1140
1112
|
declare class Layout2dView extends LayoutViewBase {
|
|
1141
1113
|
type: Layout2dViewType;
|
|
1142
1114
|
parameters: Layout2dViewParameters;
|
|
@@ -1521,6 +1493,10 @@ declare type LayoutCurtainWallType = typeof LayoutCurtainWallTypeValue;
|
|
|
1521
1493
|
|
|
1522
1494
|
declare const LayoutCurtainWallTypeValue = "element:curtainWall";
|
|
1523
1495
|
|
|
1496
|
+
declare interface LayoutData extends BaseData {
|
|
1497
|
+
type: SpaceGraphLayout['type'];
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1524
1500
|
declare class LayoutDoor extends LayoutTransformElementBase {
|
|
1525
1501
|
type: LayoutDoorType;
|
|
1526
1502
|
parameters: LayoutDoorParameters;
|
|
@@ -1891,6 +1867,11 @@ declare type LayoutRoofType = typeof LayoutRoofTypeValue;
|
|
|
1891
1867
|
|
|
1892
1868
|
declare const LayoutRoofTypeValue = "element:roof";
|
|
1893
1869
|
|
|
1870
|
+
declare interface LayoutSelect extends BaseSelect {
|
|
1871
|
+
spaces?: SpaceQuery;
|
|
1872
|
+
elements?: ElementQuery;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1894
1875
|
declare class LayoutSlab extends LayoutTransformElementBase {
|
|
1895
1876
|
type: LayoutSlabType;
|
|
1896
1877
|
parameters: LayoutSlabParameters;
|
|
@@ -2369,6 +2350,14 @@ declare type NumberComparator = number | {
|
|
|
2369
2350
|
lte: number;
|
|
2370
2351
|
};
|
|
2371
2352
|
|
|
2353
|
+
declare interface NumberField extends BaseField {
|
|
2354
|
+
type: 'number';
|
|
2355
|
+
min: number;
|
|
2356
|
+
max: number;
|
|
2357
|
+
step: number;
|
|
2358
|
+
default?: number;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2372
2361
|
declare interface NumberList extends SpaceGraphTypedValueJson {
|
|
2373
2362
|
type: 'number:list';
|
|
2374
2363
|
list: number[];
|
|
@@ -2383,6 +2372,8 @@ declare interface NumberRange extends SpaceGraphTypedValueJson {
|
|
|
2383
2372
|
};
|
|
2384
2373
|
}
|
|
2385
2374
|
|
|
2375
|
+
declare type OmitKeys = 'on' | 'off' | 'once';
|
|
2376
|
+
|
|
2386
2377
|
declare type OpenCurve = LineCurve | PolylineCurve | ArcCurve;
|
|
2387
2378
|
|
|
2388
2379
|
declare type OpenCurves = LineCurve_2 | ArcCurve_2 | PolylineCurve_2 | BezierCurve;
|
|
@@ -2470,7 +2461,9 @@ declare type PlaneGeometryType = typeof PlaneGeometryTypeValue;
|
|
|
2470
2461
|
|
|
2471
2462
|
declare const PlaneGeometryTypeValue = "geometry:plane";
|
|
2472
2463
|
|
|
2473
|
-
declare type Polygon =
|
|
2464
|
+
declare type Polygon = Vector2[];
|
|
2465
|
+
|
|
2466
|
+
declare type Polygon_2 = Vector2_2[];
|
|
2474
2467
|
|
|
2475
2468
|
declare interface PolygonCurve extends CurveBase {
|
|
2476
2469
|
type: PolygonCurveType;
|
|
@@ -2479,15 +2472,17 @@ declare interface PolygonCurve extends CurveBase {
|
|
|
2479
2472
|
|
|
2480
2473
|
declare interface PolygonCurve_2 extends BaseShape {
|
|
2481
2474
|
type: 'curve:polygon';
|
|
2482
|
-
points:
|
|
2475
|
+
points: Polygon_2;
|
|
2483
2476
|
}
|
|
2484
2477
|
|
|
2485
2478
|
declare type PolygonCurveType = typeof PolygonCurveTypeValue;
|
|
2486
2479
|
|
|
2487
2480
|
declare const PolygonCurveTypeValue = "curve:polygon";
|
|
2488
2481
|
|
|
2482
|
+
declare type PolygonWithHoles = Vector2[][];
|
|
2483
|
+
|
|
2489
2484
|
/** outer ring counter clockwise, inner rings ( holes ) clockwise */
|
|
2490
|
-
declare type
|
|
2485
|
+
declare type PolygonWithHoles_2 = Polygon_2[];
|
|
2491
2486
|
|
|
2492
2487
|
declare interface PolygonWithHolesCurve extends CurveBase {
|
|
2493
2488
|
type: PolygonWithHolesCurveType;
|
|
@@ -2496,7 +2491,7 @@ declare interface PolygonWithHolesCurve extends CurveBase {
|
|
|
2496
2491
|
|
|
2497
2492
|
declare interface PolygonWithHolesCurve_2 extends BaseShape {
|
|
2498
2493
|
type: 'curve:polygonWithHoles';
|
|
2499
|
-
polygons:
|
|
2494
|
+
polygons: PolygonWithHoles_2;
|
|
2500
2495
|
}
|
|
2501
2496
|
|
|
2502
2497
|
declare type PolygonWithHolesCurveType = typeof PolygonWithHolesCurveTypeValue;
|
|
@@ -2510,7 +2505,7 @@ declare interface PolylineCurve extends CurveBase {
|
|
|
2510
2505
|
|
|
2511
2506
|
declare interface PolylineCurve_2 extends BaseShape {
|
|
2512
2507
|
type: 'curve:polyline';
|
|
2513
|
-
points:
|
|
2508
|
+
points: Polygon_2;
|
|
2514
2509
|
}
|
|
2515
2510
|
|
|
2516
2511
|
declare type PolylineCurveType = typeof PolylineCurveTypeValue;
|
|
@@ -2586,7 +2581,15 @@ declare const ProductUpdateTypeValue: "operation:productUpdate";
|
|
|
2586
2581
|
|
|
2587
2582
|
declare type ProductUpdateValue = Partial<SpaceGraphProductJson>;
|
|
2588
2583
|
|
|
2589
|
-
declare
|
|
2584
|
+
export declare interface PromptArgs extends ConfirmArgs {
|
|
2585
|
+
fields: PromptFieldSet;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
export declare type PromptField = TextField | BooleanField | SelectField | NumberField;
|
|
2589
|
+
|
|
2590
|
+
export declare type PromptFieldSet = Record<string, PromptField>;
|
|
2591
|
+
|
|
2592
|
+
export declare type QueryPick<T, S> = {
|
|
2590
2593
|
[K in keyof S as S[K] extends false | undefined ? never : K]: K extends keyof T ? S[K] extends true ? T[K] : S[K] extends ElementQuery ? QueryPick<ElementData, S[K]['select'] extends undefined ? DefaultSelect : NonNullable<S[K]['select']>>[] : S[K] extends object ? T[K] extends any[] ? QueryPick<T[K][number], S[K]>[] : QueryPick<T[K], S[K]> : never : never;
|
|
2591
2594
|
};
|
|
2592
2595
|
|
|
@@ -2703,7 +2706,17 @@ declare type RgbA = [number, number, number, number];
|
|
|
2703
2706
|
|
|
2704
2707
|
declare type RotationEntry = number | NumberList | NumberRange;
|
|
2705
2708
|
|
|
2706
|
-
declare
|
|
2709
|
+
declare interface SelectField extends BaseField {
|
|
2710
|
+
type: 'select';
|
|
2711
|
+
options?: SelectOption[] | string[];
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
declare interface SelectOption {
|
|
2715
|
+
value: string;
|
|
2716
|
+
label: string;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
export declare type Shape = PolygonCurve_2 | PolygonWithHolesCurve_2 | PolylineCurve_2 | RectangleCurve_2 | CircleCurve_2 | LineCurve_2 | GroupShape | TextShape | ArcCurve_2 | BezierCurve | CompositeCurve_2;
|
|
2707
2720
|
|
|
2708
2721
|
declare interface ShapeStyle {
|
|
2709
2722
|
stroke?: string | number | number[];
|
|
@@ -2715,6 +2728,11 @@ declare interface ShapeStyle {
|
|
|
2715
2728
|
alignment?: 0 | 0.5 | 1;
|
|
2716
2729
|
}
|
|
2717
2730
|
|
|
2731
|
+
declare type SimpleTransform3d = {
|
|
2732
|
+
position: Vector3;
|
|
2733
|
+
rotation: number;
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2718
2736
|
declare class SpaceCreate extends OperationBase {
|
|
2719
2737
|
type: typeof SpaceCreateTypeValue;
|
|
2720
2738
|
value: SpaceCreateValue;
|
|
@@ -2736,8 +2754,6 @@ export declare interface SpaceData extends BaseData {
|
|
|
2736
2754
|
subCategory: string;
|
|
2737
2755
|
seatCapacity: number;
|
|
2738
2756
|
area: number;
|
|
2739
|
-
labelPoint: Vector2;
|
|
2740
|
-
polygons: PolygonWithHoles;
|
|
2741
2757
|
elements: ElementData[];
|
|
2742
2758
|
}
|
|
2743
2759
|
|
|
@@ -3380,6 +3396,11 @@ declare interface SpaceGraphTypedValueJson {
|
|
|
3380
3396
|
type: string;
|
|
3381
3397
|
}
|
|
3382
3398
|
|
|
3399
|
+
declare type SpaceQuery = {
|
|
3400
|
+
select?: SpaceSelect;
|
|
3401
|
+
where?: SpaceFilter;
|
|
3402
|
+
};
|
|
3403
|
+
|
|
3383
3404
|
declare class SpaceRemove extends OperationBase {
|
|
3384
3405
|
type: typeof SpaceRemoveTypeValue;
|
|
3385
3406
|
previousValue: SpaceRemoveValue;
|
|
@@ -3399,19 +3420,8 @@ export declare interface SpaceSelect extends BaseSelect {
|
|
|
3399
3420
|
subCategory?: boolean;
|
|
3400
3421
|
isExternal?: boolean;
|
|
3401
3422
|
area?: boolean;
|
|
3402
|
-
labelPoint?: boolean;
|
|
3403
3423
|
seatCapacity?: boolean;
|
|
3404
|
-
|
|
3405
|
-
elements?: ElementQuery;
|
|
3406
|
-
}
|
|
3407
|
-
|
|
3408
|
-
declare interface SpaceShapeStyle extends ShapeStyle {
|
|
3409
|
-
usage?: {
|
|
3410
|
-
[key: string]: ShapeStyle;
|
|
3411
|
-
};
|
|
3412
|
-
program?: {
|
|
3413
|
-
[key: string]: ShapeStyle;
|
|
3414
|
-
};
|
|
3424
|
+
elements?: ElementQuery | boolean;
|
|
3415
3425
|
}
|
|
3416
3426
|
|
|
3417
3427
|
declare class SpaceUpdate extends OperationBase {
|
|
@@ -3599,6 +3609,15 @@ declare type StringComparator = string | {
|
|
|
3599
3609
|
in: string[];
|
|
3600
3610
|
};
|
|
3601
3611
|
|
|
3612
|
+
declare type StyleByKey = Record<string, ShapeStyle>;
|
|
3613
|
+
|
|
3614
|
+
declare type StyledFilter = {
|
|
3615
|
+
where: ElementFilter | SpaceFilter;
|
|
3616
|
+
style: ShapeStyle;
|
|
3617
|
+
};
|
|
3618
|
+
|
|
3619
|
+
declare type StyleFilter = StyledFilter;
|
|
3620
|
+
|
|
3602
3621
|
declare interface SurfaceMaterials {
|
|
3603
3622
|
[surface: string]: SpaceGraphMaterial;
|
|
3604
3623
|
}
|
|
@@ -3611,6 +3630,13 @@ declare interface Surfaces {
|
|
|
3611
3630
|
[surface: string]: GeometryFaceIndices;
|
|
3612
3631
|
}
|
|
3613
3632
|
|
|
3633
|
+
declare type Sync<T> = T extends (...args: infer A) => Promise<infer R> ? (...args: A) => R : T;
|
|
3634
|
+
|
|
3635
|
+
declare interface TextField extends BaseField {
|
|
3636
|
+
type: 'text';
|
|
3637
|
+
default?: string;
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3614
3640
|
declare interface TextShape extends BaseShape {
|
|
3615
3641
|
type: 'text';
|
|
3616
3642
|
position: Vector2_2;
|
|
@@ -3621,6 +3647,39 @@ declare interface TextShape extends BaseShape {
|
|
|
3621
3647
|
fontSize?: number;
|
|
3622
3648
|
}
|
|
3623
3649
|
|
|
3650
|
+
declare type ThemeStyles = {
|
|
3651
|
+
byId?: StyleByKey;
|
|
3652
|
+
byType?: {
|
|
3653
|
+
'element:asset'?: ShapeStyle;
|
|
3654
|
+
'element:beam'?: ShapeStyle;
|
|
3655
|
+
'element:boundaryWall'?: ShapeStyle;
|
|
3656
|
+
'element:casework'?: ShapeStyle;
|
|
3657
|
+
'element:ceiling'?: ShapeStyle;
|
|
3658
|
+
'element:column'?: ShapeStyle;
|
|
3659
|
+
'element:curtainWall'?: ShapeStyle;
|
|
3660
|
+
'element:door'?: ShapeStyle;
|
|
3661
|
+
'element:floor'?: ShapeStyle;
|
|
3662
|
+
'element:generic'?: ShapeStyle;
|
|
3663
|
+
'element:kitchen'?: ShapeStyle;
|
|
3664
|
+
'element:opening'?: ShapeStyle;
|
|
3665
|
+
'element:railing'?: ShapeStyle;
|
|
3666
|
+
'element:ramp'?: ShapeStyle;
|
|
3667
|
+
'element:roof'?: ShapeStyle;
|
|
3668
|
+
'element:slab'?: ShapeStyle;
|
|
3669
|
+
'element:spaceDivider'?: ShapeStyle;
|
|
3670
|
+
'element:stairFlight'?: ShapeStyle;
|
|
3671
|
+
'element:stairs'?: ShapeStyle;
|
|
3672
|
+
'element:wall'?: ShapeStyle;
|
|
3673
|
+
'element:window'?: ShapeStyle;
|
|
3674
|
+
'layout:space'?: ShapeStyle;
|
|
3675
|
+
'spatialGraph:edge'?: ShapeStyle;
|
|
3676
|
+
'annotation:floorPlanImage'?: ShapeStyle & {
|
|
3677
|
+
grayscale?: boolean;
|
|
3678
|
+
};
|
|
3679
|
+
};
|
|
3680
|
+
byFilter?: StyleFilter[];
|
|
3681
|
+
};
|
|
3682
|
+
|
|
3624
3683
|
declare type Transform3d = {
|
|
3625
3684
|
position: Vector3;
|
|
3626
3685
|
rotation: number;
|
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.7.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "vite",
|
|
14
|
-
"build": "
|
|
14
|
+
"build": "vite build",
|
|
15
15
|
"lint": "eslint --ext .ts,.js,.vue --fix src",
|
|
16
16
|
"serve": "vite preview",
|
|
17
17
|
"test": "vitest --run",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
19
|
"format": "prettier . -w -u --log-level silent",
|
|
20
|
-
"codecheck": "npm run typecheck && npm run lint && npm run format"
|
|
21
|
-
"generate-types": "npx vite-node ./tasks/generate-types.ts"
|
|
20
|
+
"codecheck": "npm run typecheck && npm run lint && npm run format"
|
|
22
21
|
},
|
|
23
22
|
"type": "module",
|
|
24
23
|
"main": "./dist/extension-sdk.cjs",
|
|
@@ -36,7 +35,8 @@
|
|
|
36
35
|
"tiny-emitter": "^2.1.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@archilogic/
|
|
38
|
+
"@archilogic/floor-plan-core": "^5.3.1",
|
|
39
|
+
"@archilogic/space-graph-sdk": "^0.3.1",
|
|
40
40
|
"vite-plugin-static-copy": "^3.1.4"
|
|
41
41
|
},
|
|
42
42
|
"nx": {}
|