@snaptrude/plugin-core 0.5.0 → 0.7.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/CHANGELOG.md +73 -0
- package/api-manifest.full.json +2644 -542
- package/api-manifest.json +2606 -424
- package/dist/api/analysis/heatmaps.d.ts +234 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +44 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +10 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +392 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +35 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +206 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +286 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/proposals/index.d.ts +475 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +218 -0
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +159 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/furniture/index.d.ts +34 -5
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +83 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +159 -2
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +115 -5
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +3 -3
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +83 -2
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +168 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +2 -2
- package/dist/api/entity/story.d.ts +101 -7
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/import.d.ts +49 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +210 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +42 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +3 -11
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +186 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +84 -0
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +33 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +1942 -998
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1810 -994
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/heatmaps.ts +256 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +46 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/core/index.ts +10 -0
- package/src/api/core/io/import/index.ts +432 -0
- package/src/api/core/io/index.ts +37 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +214 -0
- package/src/api/core/io/underlay/index.ts +295 -0
- package/src/api/core/proposals/index.ts +509 -0
- package/src/api/design/create/index.ts +258 -0
- package/src/api/design/doors/index.ts +168 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/furniture/index.ts +36 -5
- package/src/api/design/index.ts +87 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +182 -2
- package/src/api/design/query/index.ts +81 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +74 -2
- package/src/api/design/update/index.ts +167 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/story.ts +105 -7
- package/src/api/index.ts +5 -0
- package/src/api/presentation/import.ts +45 -4
- package/src/api/presentation/views.ts +221 -5
- package/src/api/program/areas.ts +34 -12
- package/src/api/program/index.ts +3 -11
- package/src/api/program/layout.ts +195 -11
- package/src/api/program/site.ts +93 -0
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/handles.ts +46 -0
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../types";
|
|
3
|
+
import { ComponentHandle } from "../../handles";
|
|
3
4
|
/**
|
|
4
5
|
* Story (floor/storey) management.
|
|
5
6
|
*
|
|
@@ -90,17 +91,25 @@ export declare abstract class PluginStoryApi {
|
|
|
90
91
|
*/
|
|
91
92
|
abstract create(storyValue: number, height?: number): PluginApiReturn<PluginStoryCreateResult>;
|
|
92
93
|
/**
|
|
93
|
-
* Update a story's height.
|
|
94
|
+
* Update a story's floor-to-floor height, cascading the full geometry change.
|
|
94
95
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
96
|
+
* This is the same operation as editing the height in the Stories panel: the
|
|
97
|
+
* walls, columns, and masses on the story are **stretched** to the new height,
|
|
98
|
+
* every story **above shifts up/down** by the delta so the stack stays
|
|
99
|
+
* contiguous, and coupled elements (staircases, parametric curtain walls,
|
|
100
|
+
* furniture offsets) are re-fitted. The whole cascade is committed as **one
|
|
101
|
+
* undo step**. Height-locked elements are left untouched.
|
|
97
102
|
*
|
|
98
103
|
* @param storyValue - Integer storey number
|
|
99
104
|
* identifying the story to update
|
|
100
|
-
* @param height - New height
|
|
101
|
-
* units
|
|
105
|
+
* @param height - New floor-to-floor height in
|
|
106
|
+
* Babylon units
|
|
102
107
|
* @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`
|
|
103
|
-
* @throws
|
|
108
|
+
* @throws `PRECONDITION_FAILED` if no story has the given value;
|
|
109
|
+
* `STORY_HEIGHT_REJECTED` if the engine rejects the height (e.g. out of
|
|
110
|
+
* range — the change silently reverts host-side and is surfaced as this
|
|
111
|
+
* error); `STORY_UPDATE_FAILED` if the story cannot be re-read after the
|
|
112
|
+
* update
|
|
104
113
|
*
|
|
105
114
|
* @examplePrompt Change the ground floor height to 3.5 metres
|
|
106
115
|
* @examplePrompt Make the second storey taller
|
|
@@ -109,11 +118,59 @@ export declare abstract class PluginStoryApi {
|
|
|
109
118
|
*
|
|
110
119
|
* # Example
|
|
111
120
|
* ```ts
|
|
112
|
-
* // Set ground floor height to 5 Babylon units
|
|
121
|
+
* // Set ground floor height to 5 Babylon units — walls stretch and the
|
|
122
|
+
* // floors above move up to match, all in a single undo step.
|
|
113
123
|
* const result = await snaptrude.entity.story.update(1, 5)
|
|
114
124
|
* ```
|
|
115
125
|
*/
|
|
116
126
|
abstract update(storyValue: number, height: number): PluginApiReturn<PluginStoryUpdateResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Duplicate a story into the adjacent level, up or down.
|
|
129
|
+
*
|
|
130
|
+
* By default the **whole story** is duplicated: every eligible element on the
|
|
131
|
+
* active story (walls, floors, roofs, masses, columns, beams, staircases,
|
|
132
|
+
* ceilings, parametric curtain walls, and furniture) is copied into the story
|
|
133
|
+
* one level `"up"` or `"down"`. Pass `options.components` to duplicate only a
|
|
134
|
+
* subset instead. The target story is **created automatically** if it does not
|
|
135
|
+
* yet exist, inheriting the source story's height.
|
|
136
|
+
*
|
|
137
|
+
* Copies are **instanced** by default (`unique: false`) — they share geometry
|
|
138
|
+
* with the source, so later edits propagate. Set `unique: true` for independent
|
|
139
|
+
* geometry. Doors and windows are never duplicated on their own; they ride along
|
|
140
|
+
* with their host wall. Locked, throw-away, and unsupported elements are skipped
|
|
141
|
+
* and counted in `skipped`. The whole operation is a single undo step.
|
|
142
|
+
*
|
|
143
|
+
* @param direction - `"up"` to duplicate into the story above, `"down"` for below
|
|
144
|
+
* @param options - `components` (restrict to a subset of the story's elements;
|
|
145
|
+
* omit for the whole story) and `unique` (default `false` = instanced copies;
|
|
146
|
+
* `true` = independent geometry)
|
|
147
|
+
* @returns A {@linkcode PluginStoryDuplicateResult} with the `sourceStory`, the
|
|
148
|
+
* `targetStories` the copies landed on, the `created` component handles, the
|
|
149
|
+
* `createdStoryValues` for any stories generated to receive them, and the
|
|
150
|
+
* `skipped` count of ineligible elements
|
|
151
|
+
* @throws `NO_ACTIVE_STRUCTURE` if there is no active structure to duplicate
|
|
152
|
+
* into; `NO_ELIGIBLE_ELEMENTS` if nothing on the source story (or in
|
|
153
|
+
* `options.components`) is duplicable; `HANDLE_INVALID` for a stale or
|
|
154
|
+
* foreign supplied handle; or if plugin writes are disabled
|
|
155
|
+
*
|
|
156
|
+
* @examplePrompt Duplicate this floor to the storey above
|
|
157
|
+
* @examplePrompt Copy the ground floor down into a new basement
|
|
158
|
+
* @examplePrompt Repeat this level upwards with its own independent geometry
|
|
159
|
+
* @examplePrompt Duplicate just the selected walls onto the next floor up
|
|
160
|
+
*
|
|
161
|
+
* # Example
|
|
162
|
+
* ```ts
|
|
163
|
+
* // Duplicate the whole active story one level up (instanced copies).
|
|
164
|
+
* const { targetStories, created, skipped } =
|
|
165
|
+
* await snaptrude.entity.story.duplicate("up")
|
|
166
|
+
* console.log(`Copied ${created.length} elements onto story ${targetStories}`)
|
|
167
|
+
* if (skipped) console.log(`${skipped} elements were skipped`)
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
abstract duplicate(direction: "up" | "down", options?: {
|
|
171
|
+
components?: ComponentHandle[];
|
|
172
|
+
unique?: boolean;
|
|
173
|
+
}): PluginApiReturn<PluginStoryDuplicateResult>;
|
|
117
174
|
}
|
|
118
175
|
/**
|
|
119
176
|
* Available properties that can be queried on a story.
|
|
@@ -246,4 +303,41 @@ export declare const PluginStoryUpdateResult: z.ZodObject<{
|
|
|
246
303
|
height: z.ZodNumber;
|
|
247
304
|
}, z.core.$strip>;
|
|
248
305
|
export type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>;
|
|
306
|
+
/**
|
|
307
|
+
* Arguments for {@linkcode PluginStoryApi.duplicate} (options flattened).
|
|
308
|
+
*
|
|
309
|
+
* | Property | Type | Description |
|
|
310
|
+
* |---|---|---|
|
|
311
|
+
* | `direction` | `'up' \| 'down'` | Which adjacent story to duplicate into |
|
|
312
|
+
* | `components` | {@linkcode ComponentHandle}`[]?` | Restrict to a subset; omit for the whole story |
|
|
313
|
+
* | `unique` | `boolean?` | `false` (default) = instanced copies; `true` = independent geometry |
|
|
314
|
+
*/
|
|
315
|
+
export declare const PluginStoryDuplicateArgs: z.ZodObject<{
|
|
316
|
+
direction: z.ZodEnum<{
|
|
317
|
+
up: "up";
|
|
318
|
+
down: "down";
|
|
319
|
+
}>;
|
|
320
|
+
components: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
|
|
321
|
+
unique: z.ZodOptional<z.ZodBoolean>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
export type PluginStoryDuplicateArgs = z.infer<typeof PluginStoryDuplicateArgs>;
|
|
324
|
+
/**
|
|
325
|
+
* Result of {@linkcode PluginStoryApi.duplicate}.
|
|
326
|
+
*
|
|
327
|
+
* | Property | Type | Description |
|
|
328
|
+
* |---|---|---|
|
|
329
|
+
* | `sourceStory` | `number` | Storey value the copies were duplicated from |
|
|
330
|
+
* | `targetStories` | `number[]` | Storey values the copies landed on |
|
|
331
|
+
* | `created` | {@linkcode ComponentHandle}`[]` | Handles of the newly created components |
|
|
332
|
+
* | `createdStoryValues` | `number[]` | Storey values that were generated to receive the copies |
|
|
333
|
+
* | `skipped` | `number` | Count of ineligible elements that were skipped |
|
|
334
|
+
*/
|
|
335
|
+
export declare const PluginStoryDuplicateResult: z.ZodObject<{
|
|
336
|
+
sourceStory: z.ZodNumber;
|
|
337
|
+
targetStories: z.ZodArray<z.ZodNumber>;
|
|
338
|
+
created: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
339
|
+
createdStoryValues: z.ZodArray<z.ZodNumber>;
|
|
340
|
+
skipped: z.ZodNumber;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export type PluginStoryDuplicateResult = z.infer<typeof PluginStoryDuplicateResult>;
|
|
249
343
|
//# sourceMappingURL=story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../src/api/entity/story.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../src/api/entity/story.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,8BAAsB,cAAc;;IAGlC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,GAAG,CACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,sBAAsB,EAAE,GACnC,eAAe,CAAC,oBAAoB,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,MAAM,IAAI,eAAe,CAAC,uBAAuB,CAAC;IAElE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,MAAM,CACpB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,eAAe,CAAC,uBAAuB,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;aACa,MAAM,CACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,eAAe,CAAC,uBAAuB,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;aACa,SAAS,CACvB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,OAAO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;;iBAGlC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;;;iBAInC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B;;;;;;iBAMrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PluginDesignApi } from "./design";
|
|
|
3
3
|
import { PluginEntityApi } from "./entity";
|
|
4
4
|
import { PluginProgramApi } from "./program";
|
|
5
5
|
import { PluginPresentationApi } from "./presentation";
|
|
6
|
+
import { PluginAnalysisApi } from "./analysis";
|
|
6
7
|
/**
|
|
7
8
|
* Root API surface for Snaptrude plugins.
|
|
8
9
|
*
|
|
@@ -13,6 +14,7 @@ import { PluginPresentationApi } from "./presentation";
|
|
|
13
14
|
* - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)
|
|
14
15
|
* - {@linkcode PluginApi.program} — Program-mode planning reads (departments, metrics)
|
|
15
16
|
* - {@linkcode PluginApi.presentation} — Presentation preparation (views, AI Inspiration)
|
|
17
|
+
* - {@linkcode PluginApi.analysis} — Sustainability analysis (sunpath, shadows, sunlight/illuminance heatmaps)
|
|
16
18
|
*/
|
|
17
19
|
export declare abstract class PluginApi {
|
|
18
20
|
/** Core math, geometry, history, and units primitives. See {@linkcode PluginCoreApi}. */
|
|
@@ -25,6 +27,8 @@ export declare abstract class PluginApi {
|
|
|
25
27
|
abstract program: PluginProgramApi;
|
|
26
28
|
/** Presentation preparation reads — saved views. See {@linkcode PluginPresentationApi}. */
|
|
27
29
|
abstract presentation: PluginPresentationApi;
|
|
30
|
+
/** Sustainability analysis — sun & daylight studies. See {@linkcode PluginAnalysisApi}. */
|
|
31
|
+
abstract analysis: PluginAnalysisApi;
|
|
28
32
|
constructor();
|
|
29
33
|
}
|
|
30
34
|
export * from "./core";
|
|
@@ -32,4 +36,5 @@ export * from "./design";
|
|
|
32
36
|
export * from "./entity";
|
|
33
37
|
export * from "./program";
|
|
34
38
|
export * from "./presentation";
|
|
39
|
+
export * from "./analysis";
|
|
35
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,8BAAsB,SAAS;IAC7B,yFAAyF;IACzF,SAAgB,IAAI,EAAE,aAAa,CAAA;IACnC,0EAA0E;IAC1E,SAAgB,MAAM,EAAE,eAAe,CAAA;IACvC,8EAA8E;IAC9E,SAAgB,MAAM,EAAE,eAAe,CAAA;IACvC,oGAAoG;IACpG,SAAgB,OAAO,EAAE,gBAAgB,CAAA;IACzC,2FAA2F;IAC3F,SAAgB,YAAY,EAAE,qBAAqB,CAAA;IACnD,2FAA2F;IAC3F,SAAgB,QAAQ,EAAE,iBAAiB,CAAA;;CAG5C;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
@@ -3,9 +3,10 @@ import { PluginApiReturn } from "../../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Presentation import — bring external reference assets onto the Present canvas.
|
|
5
5
|
*
|
|
6
|
-
* `import.image` places a reference image
|
|
7
|
-
* page vectorized to SVG)
|
|
8
|
-
*
|
|
6
|
+
* `import.image` places a reference image, `import.pdf` places a PDF (each
|
|
7
|
+
* page vectorized to SVG), and `import.svg` places a validated SVG onto
|
|
8
|
+
* the current Present sheet, returning the created canvas shape ids. Requires
|
|
9
|
+
* Present mode to be open.
|
|
9
10
|
*
|
|
10
11
|
* The host engine takes a browser `File`, which a plugin worker cannot supply,
|
|
11
12
|
* so these accept a `url`/`dataUrl` that the host adapts into a `File`.
|
|
@@ -79,10 +80,54 @@ export declare abstract class PluginPresentationImportApi {
|
|
|
79
80
|
y: number;
|
|
80
81
|
};
|
|
81
82
|
}): PluginApiReturn<PluginPresentationImportResult>;
|
|
83
|
+
/**
|
|
84
|
+
* Import an SVG onto the current Present sheet as a vector asset.
|
|
85
|
+
*
|
|
86
|
+
* An SVG-validating variant of {@linkcode PluginPresentationImportApi.image}:
|
|
87
|
+
* `import.image` already passes SVG sources through, but this method first
|
|
88
|
+
* validates that the source really is an SVG and forces the vector mime
|
|
89
|
+
* type. Throws if the source is not an SVG.
|
|
90
|
+
*
|
|
91
|
+
* **Rendering is vector up to a complexity cap.** Simple SVGs (up to ~1500
|
|
92
|
+
* SVG element nodes and ~2 MB) render true-vector and stay crisp at every
|
|
93
|
+
* zoom. Beyond that cap the shared canvas renderer **intentionally falls
|
|
94
|
+
* back to a 1920px raster** to protect canvas performance, so very complex
|
|
95
|
+
* SVGs can look rasterized when zoomed in. The stored asset is the original
|
|
96
|
+
* SVG either way; only the on-canvas rendering falls back.
|
|
97
|
+
*
|
|
98
|
+
* @param source - The SVG to import: exactly one of `url` or `dataUrl`.
|
|
99
|
+
* @param options - Optional `position` — where to place the SVG on the sheet.
|
|
100
|
+
* @returns A {@linkcode PluginPresentationImportResult} with the created
|
|
101
|
+
* `shapeIds`.
|
|
102
|
+
* @throws If Present mode is not open, the source is not an SVG, or it cannot
|
|
103
|
+
* be loaded.
|
|
104
|
+
*
|
|
105
|
+
* @examplePrompt Import this SVG diagram onto the present canvas
|
|
106
|
+
* @examplePrompt Add a vector logo to my presentation board
|
|
107
|
+
* @examplePrompt Place this SVG floor plan on the current sheet as vectors
|
|
108
|
+
* @examplePrompt Bring a crisp vector graphic into Present mode
|
|
109
|
+
*
|
|
110
|
+
* # Example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const { shapeIds } = await snaptrude.presentation.import.svg({
|
|
113
|
+
* url: "https://example.com/diagram.svg",
|
|
114
|
+
* })
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
abstract svg(source: {
|
|
118
|
+
url?: string;
|
|
119
|
+
dataUrl?: string;
|
|
120
|
+
}, options?: {
|
|
121
|
+
position?: {
|
|
122
|
+
x: number;
|
|
123
|
+
y: number;
|
|
124
|
+
};
|
|
125
|
+
}): PluginApiReturn<PluginPresentationImportResult>;
|
|
82
126
|
}
|
|
83
127
|
/**
|
|
84
128
|
* Arguments for {@linkcode PluginPresentationImportApi.image} /
|
|
85
|
-
* {@linkcode PluginPresentationImportApi.pdf}
|
|
129
|
+
* {@linkcode PluginPresentationImportApi.pdf} /
|
|
130
|
+
* {@linkcode PluginPresentationImportApi.svg}. Provide exactly one source.
|
|
86
131
|
*
|
|
87
132
|
* | Property | Type | Description |
|
|
88
133
|
* |---|---|---|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;GAYG;AACH,8BAAsB,2BAA2B;;IAG/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,KAAK,CACnB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,GAAG,CACjB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;aACa,GAAG,CACjB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;CACnD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;;;iBAQrC,CAAA;AACJ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA"}
|
|
@@ -5,12 +5,12 @@ import { PluginApiReturn } from "../../types";
|
|
|
5
5
|
*
|
|
6
6
|
* A **view** is a saved camera/plan: a sheet-ready 2D plan or a saved 3D view.
|
|
7
7
|
* A plugin can list and read views, capture them to images, activate one (move
|
|
8
|
-
* the camera to it),
|
|
8
|
+
* the camera to it), save the current camera as a new view, and read/update a
|
|
9
|
+
* view's display settings (background, color mode, axis, edges, labels).
|
|
9
10
|
*
|
|
10
|
-
* `list`/`get`/`getActive`/`capture` are reads;
|
|
11
|
-
* (a view is a camera bookmark
|
|
12
|
-
*
|
|
13
|
-
* live discovery surface until the host lands them.
|
|
11
|
+
* `list`/`get`/`getActive`/`capture`/`getSettings` are reads;
|
|
12
|
+
* `setActive`/`create`/`updateSettings` are writes (a view is a camera bookmark
|
|
13
|
+
* — not geometry).
|
|
14
14
|
*
|
|
15
15
|
* Accessed via `snaptrude.presentation.views`.
|
|
16
16
|
*/
|
|
@@ -141,6 +141,78 @@ export declare abstract class PluginPresentationViewsApi {
|
|
|
141
141
|
abstract create(name?: string, options?: {
|
|
142
142
|
kind?: "view" | "sitePlan";
|
|
143
143
|
}): PluginApiReturn<PluginPresentationViewsCreateResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Read a saved view's display settings (background, color mode, axis, edges,
|
|
146
|
+
* labels).
|
|
147
|
+
*
|
|
148
|
+
* @param viewId - The id of the view to read settings for.
|
|
149
|
+
* @returns The view's {@linkcode PluginPresentationViewSettings}, or `null` if
|
|
150
|
+
* no view has that id.
|
|
151
|
+
*
|
|
152
|
+
* @examplePrompt What color mode is the Ground Floor view using?
|
|
153
|
+
* @examplePrompt Get the display settings for this view
|
|
154
|
+
* @examplePrompt Does the site plan view show axes and labels?
|
|
155
|
+
* @examplePrompt Read the background color of the active view
|
|
156
|
+
*
|
|
157
|
+
* # Example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const settings = await snaptrude.presentation.views.getSettings("view_123")
|
|
160
|
+
* if (settings) console.log(settings.colorMode, settings.backgroundColor)
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
abstract getSettings(viewId: string): PluginApiReturn<PluginPresentationViewsGetSettingsResult>;
|
|
164
|
+
/**
|
|
165
|
+
* Update a saved view's display settings (partial patch — only the fields you
|
|
166
|
+
* pass change).
|
|
167
|
+
*
|
|
168
|
+
* Persists and broadcasts the change; if the view is currently active, the
|
|
169
|
+
* scene updates live. **Not Ctrl+Z-undoable** — view-metadata edits publish
|
|
170
|
+
* directly and do not land on the local undo stack; this matches how the
|
|
171
|
+
* product's own view-settings UI behaves.
|
|
172
|
+
*
|
|
173
|
+
* Label patch semantics (mirroring the product, which stores no label
|
|
174
|
+
* selection while labels are off):
|
|
175
|
+
*
|
|
176
|
+
* - `{ showLabels: true }` alone turns labels on; if the view has no stored
|
|
177
|
+
* selection, the product defaults (`objectLabels`, `areas`) are applied —
|
|
178
|
+
* labels are never "on" with an empty selection (the product has no such
|
|
179
|
+
* state; labels render only while the selection is non-empty).
|
|
180
|
+
* - `{ labels: [...] }` alone sets the selection **and turns labels on**.
|
|
181
|
+
* - `{ showLabels: false }` turns labels off and **clears the stored
|
|
182
|
+
* selection** — a later read returns `labels: []`.
|
|
183
|
+
* - `{ showLabels: false, labels: [...] }` with a non-empty list is
|
|
184
|
+
* contradictory and **rejected** (nothing is silently discarded).
|
|
185
|
+
* - `{ showLabels: true, labels: [] }` is likewise contradictory and
|
|
186
|
+
* **rejected** — pass a non-empty list, or omit `labels` to get the
|
|
187
|
+
* defaults.
|
|
188
|
+
*
|
|
189
|
+
* `colorMode` accepts the `tag:<categoryId>` scheme strings returned by
|
|
190
|
+
* {@linkcode PluginPresentationViewsApi.getSettings}, so read-then-write
|
|
191
|
+
* round-trips a tag-based color scheme unchanged.
|
|
192
|
+
*
|
|
193
|
+
* @param viewId - The id of the view to update.
|
|
194
|
+
* @param settings - A partial {@linkcode PluginPresentationViewSettings}; any
|
|
195
|
+
* omitted field is left unchanged.
|
|
196
|
+
* @returns The updated view's `id`.
|
|
197
|
+
* @throws If writes are disabled, no view has the given id, or the patch is
|
|
198
|
+
* contradictory (`showLabels: false` with a non-empty `labels`, or
|
|
199
|
+
* `showLabels: true` with an explicitly empty `labels` list).
|
|
200
|
+
*
|
|
201
|
+
* @examplePrompt Switch this view to monochrome color mode
|
|
202
|
+
* @examplePrompt Turn off the axis in the Ground Floor view
|
|
203
|
+
* @examplePrompt Set the background of the active view to white
|
|
204
|
+
* @examplePrompt Show area labels on this view
|
|
205
|
+
* @examplePrompt Enable hidden-line mode for the section view
|
|
206
|
+
*
|
|
207
|
+
* # Example
|
|
208
|
+
* ```ts
|
|
209
|
+
* await snaptrude.presentation.views.updateSettings("view_123", {
|
|
210
|
+
* colorMode: "monochrome",
|
|
211
|
+
* showAxis: false,
|
|
212
|
+
* })
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
abstract updateSettings(viewId: string, settings: Partial<PluginPresentationViewSettings>): PluginApiReturn<PluginPresentationViewsUpdateSettingsResult>;
|
|
144
216
|
}
|
|
145
217
|
/**
|
|
146
218
|
* The kind of a saved view: a 2D plan view or a 3D view.
|
|
@@ -293,4 +365,137 @@ export declare const PluginPresentationViewsCreateResult: z.ZodObject<{
|
|
|
293
365
|
isActive: z.ZodBoolean;
|
|
294
366
|
}, z.core.$strip>;
|
|
295
367
|
export type PluginPresentationViewsCreateResult = z.infer<typeof PluginPresentationViewsCreateResult>;
|
|
368
|
+
/**
|
|
369
|
+
* How the scene is colored in a view.
|
|
370
|
+
*
|
|
371
|
+
* | Value | Meaning |
|
|
372
|
+
* |---|---|
|
|
373
|
+
* | `monochrome` | Flat single-tone shading |
|
|
374
|
+
* | `texture` | Material textures/colors |
|
|
375
|
+
* | `department` | Colored by department |
|
|
376
|
+
* | `tag:<categoryId>` | Colored by a project tag category (e.g. `tag:ZONE`) |
|
|
377
|
+
*
|
|
378
|
+
* The `tag:<categoryId>` form carries the product's tag-based color schemes
|
|
379
|
+
* losslessly — reading a view that uses one returns the `tag:` string as-is,
|
|
380
|
+
* and writing it back preserves the scheme (read-then-write is safe).
|
|
381
|
+
*/
|
|
382
|
+
export declare const PluginPresentationViewColorMode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
383
|
+
department: "department";
|
|
384
|
+
monochrome: "monochrome";
|
|
385
|
+
texture: "texture";
|
|
386
|
+
}>, z.ZodTemplateLiteral<`tag:${string}`>]>;
|
|
387
|
+
export type PluginPresentationViewColorMode = z.infer<typeof PluginPresentationViewColorMode>;
|
|
388
|
+
/**
|
|
389
|
+
* A category of on-canvas labels a view can show.
|
|
390
|
+
*
|
|
391
|
+
* | Value | Meaning |
|
|
392
|
+
* |---|---|
|
|
393
|
+
* | `objectLabels` | Per-object name labels |
|
|
394
|
+
* | `areas` | Area/room labels |
|
|
395
|
+
* | `department` | Department labels |
|
|
396
|
+
*/
|
|
397
|
+
export declare const PluginPresentationViewLabel: z.ZodEnum<{
|
|
398
|
+
department: "department";
|
|
399
|
+
objectLabels: "objectLabels";
|
|
400
|
+
areas: "areas";
|
|
401
|
+
}>;
|
|
402
|
+
export type PluginPresentationViewLabel = z.infer<typeof PluginPresentationViewLabel>;
|
|
403
|
+
/**
|
|
404
|
+
* A view's display settings.
|
|
405
|
+
*
|
|
406
|
+
* | Property | Type | Description |
|
|
407
|
+
* |---|---|---|
|
|
408
|
+
* | `backgroundColor` | `string` | Canvas background as a hex color (e.g. `#ffffff`) |
|
|
409
|
+
* | `colorMode` | {@linkcode PluginPresentationViewColorMode} | How the scene is colored (including `tag:<categoryId>` schemes) |
|
|
410
|
+
* | `showAxis` | `boolean` | Whether the X/Y/Z axes are shown |
|
|
411
|
+
* | `showEdges` | `boolean` | Whether edges are shown; `false` = hidden-line rendering |
|
|
412
|
+
* | `showLabels` | `boolean` | Master label switch — whether on-canvas labels are shown at all. `true` always pairs with a non-empty `labels` selection (labels render only while the selection is non-empty; there is no labels-on-with-empty-selection state) |
|
|
413
|
+
* | `labels` | {@linkcode PluginPresentationViewLabel}`[]` | Which label categories are selected. When `showLabels` is `false` the view stores no selection and this reads `[]` |
|
|
414
|
+
*/
|
|
415
|
+
export declare const PluginPresentationViewSettings: z.ZodObject<{
|
|
416
|
+
backgroundColor: z.ZodString;
|
|
417
|
+
colorMode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
418
|
+
department: "department";
|
|
419
|
+
monochrome: "monochrome";
|
|
420
|
+
texture: "texture";
|
|
421
|
+
}>, z.ZodTemplateLiteral<`tag:${string}`>]>;
|
|
422
|
+
showAxis: z.ZodBoolean;
|
|
423
|
+
showEdges: z.ZodBoolean;
|
|
424
|
+
showLabels: z.ZodBoolean;
|
|
425
|
+
labels: z.ZodArray<z.ZodEnum<{
|
|
426
|
+
department: "department";
|
|
427
|
+
objectLabels: "objectLabels";
|
|
428
|
+
areas: "areas";
|
|
429
|
+
}>>;
|
|
430
|
+
}, z.core.$strip>;
|
|
431
|
+
export type PluginPresentationViewSettings = z.infer<typeof PluginPresentationViewSettings>;
|
|
432
|
+
/**
|
|
433
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.getSettings}.
|
|
434
|
+
*
|
|
435
|
+
* | Property | Type | Description |
|
|
436
|
+
* |---|---|---|
|
|
437
|
+
* | `id` | `string` | The id of the view to read settings for |
|
|
438
|
+
*/
|
|
439
|
+
export declare const PluginPresentationViewsGetSettingsArgs: z.ZodObject<{
|
|
440
|
+
id: z.ZodString;
|
|
441
|
+
}, z.core.$strip>;
|
|
442
|
+
export type PluginPresentationViewsGetSettingsArgs = z.infer<typeof PluginPresentationViewsGetSettingsArgs>;
|
|
443
|
+
/**
|
|
444
|
+
* Result of {@linkcode PluginPresentationViewsApi.getSettings} — the settings,
|
|
445
|
+
* or `null` when no view has that id.
|
|
446
|
+
*/
|
|
447
|
+
export declare const PluginPresentationViewsGetSettingsResult: z.ZodNullable<z.ZodObject<{
|
|
448
|
+
backgroundColor: z.ZodString;
|
|
449
|
+
colorMode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
450
|
+
department: "department";
|
|
451
|
+
monochrome: "monochrome";
|
|
452
|
+
texture: "texture";
|
|
453
|
+
}>, z.ZodTemplateLiteral<`tag:${string}`>]>;
|
|
454
|
+
showAxis: z.ZodBoolean;
|
|
455
|
+
showEdges: z.ZodBoolean;
|
|
456
|
+
showLabels: z.ZodBoolean;
|
|
457
|
+
labels: z.ZodArray<z.ZodEnum<{
|
|
458
|
+
department: "department";
|
|
459
|
+
objectLabels: "objectLabels";
|
|
460
|
+
areas: "areas";
|
|
461
|
+
}>>;
|
|
462
|
+
}, z.core.$strip>>;
|
|
463
|
+
export type PluginPresentationViewsGetSettingsResult = z.infer<typeof PluginPresentationViewsGetSettingsResult>;
|
|
464
|
+
/**
|
|
465
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.updateSettings}. The
|
|
466
|
+
* `settings` patch is partial — any omitted field is left unchanged. A patch
|
|
467
|
+
* pairing `showLabels: false` with a non-empty `labels` list, or
|
|
468
|
+
* `showLabels: true` with an explicitly empty `labels` list, is rejected as
|
|
469
|
+
* contradictory (see the method JSDoc for the full label patch semantics).
|
|
470
|
+
*
|
|
471
|
+
* | Property | Type | Description |
|
|
472
|
+
* |---|---|---|
|
|
473
|
+
* | `id` | `string` | The id of the view to update |
|
|
474
|
+
* | `settings` | `Partial<`{@linkcode PluginPresentationViewSettings}`>` | The fields to change |
|
|
475
|
+
*/
|
|
476
|
+
export declare const PluginPresentationViewsUpdateSettingsArgs: z.ZodObject<{
|
|
477
|
+
id: z.ZodString;
|
|
478
|
+
settings: z.ZodObject<{
|
|
479
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
480
|
+
colorMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
481
|
+
department: "department";
|
|
482
|
+
monochrome: "monochrome";
|
|
483
|
+
texture: "texture";
|
|
484
|
+
}>, z.ZodTemplateLiteral<`tag:${string}`>]>>;
|
|
485
|
+
showAxis: z.ZodOptional<z.ZodBoolean>;
|
|
486
|
+
showEdges: z.ZodOptional<z.ZodBoolean>;
|
|
487
|
+
showLabels: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
489
|
+
department: "department";
|
|
490
|
+
objectLabels: "objectLabels";
|
|
491
|
+
areas: "areas";
|
|
492
|
+
}>>>;
|
|
493
|
+
}, z.core.$strip>;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
export type PluginPresentationViewsUpdateSettingsArgs = z.infer<typeof PluginPresentationViewsUpdateSettingsArgs>;
|
|
496
|
+
/** Result of {@linkcode PluginPresentationViewsApi.updateSettings} — the updated view's id. */
|
|
497
|
+
export declare const PluginPresentationViewsUpdateSettingsResult: z.ZodObject<{
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
export type PluginPresentationViewsUpdateSettingsResult = z.infer<typeof PluginPresentationViewsUpdateSettingsResult>;
|
|
296
501
|
//# sourceMappingURL=views.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/views.ts"],"names":[],"mappings":"AA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C,KAAK,CAC/D,OAAO,2CAA2C,CACnD,CAAA"}
|
|
@@ -10,15 +10,25 @@ import { ComponentHandle } from "../../handles";
|
|
|
10
10
|
* department-allocation lens (targets vs allocated area per department); this
|
|
11
11
|
* namespace is the whole-program area/FAR summary and its groupings.
|
|
12
12
|
*
|
|
13
|
+
* **Net vs gross:** the `carpet` / `builtUp` / `excluded` figures are the three
|
|
14
|
+
* area *classes* — every space's whole footprint lands in exactly one, chosen
|
|
15
|
+
* by its `areaClass` (see {@linkcode PluginProgramAreaMember.areaClass}). In UI
|
|
16
|
+
* terms `carpet` is the **Net Internal Area** (Σ of `NET`-classed spaces), and
|
|
17
|
+
* `builtUp` is the **Gross External Area** (Σ of `GROSS`-classed spaces) — so
|
|
18
|
+
* "net" and "gross" are the plain-English synonyms for `carpet` and `builtUp`.
|
|
19
|
+
* These are not wall-thickness carpet-vs-super-built-up; there is no common-area
|
|
20
|
+
* math. Note the summary also folds in non-mass elements (floors count as NET,
|
|
21
|
+
* slabs as GROSS), so **summing `listMembers` spaces does not reconcile to the
|
|
22
|
+
* summary totals**.
|
|
23
|
+
*
|
|
13
24
|
* `achievedFar` is **derived and read-only** — computed from built-up area and
|
|
14
25
|
* site area. `targetFar` is the goal you set (via {@linkcode
|
|
15
26
|
* PluginProgramAreasApi.update}); the two are the same ratio, one measured and
|
|
16
27
|
* one intended. The surface speaks **FAR only** — there is no FSI alias.
|
|
17
28
|
*
|
|
18
|
-
* Reads return plain records and never throw. The write
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* (at which point it is promoted to a required `abstract` member).
|
|
29
|
+
* Reads return plain records and never throw. The only write —
|
|
30
|
+
* {@linkcode PluginProgramAreasApi.update} — is a non-undoable settings write
|
|
31
|
+
* for the FAR inputs.
|
|
22
32
|
*
|
|
23
33
|
* Accessed via `snaptrude.program.areas`.
|
|
24
34
|
*/
|
|
@@ -35,6 +45,8 @@ export declare abstract class PluginProgramAreasApi {
|
|
|
35
45
|
*
|
|
36
46
|
* @examplePrompt What's my FAR right now?
|
|
37
47
|
* @examplePrompt Give me the program area summary
|
|
48
|
+
* @examplePrompt What is my net internal area vs gross external area?
|
|
49
|
+
* @examplePrompt How much net and gross area do I have?
|
|
38
50
|
* @examplePrompt How much built-up area have I used against the site area?
|
|
39
51
|
* @examplePrompt Am I within my FAR target?
|
|
40
52
|
*
|
|
@@ -58,6 +70,7 @@ export declare abstract class PluginProgramAreasApi {
|
|
|
58
70
|
* (empty when the program has no spaces).
|
|
59
71
|
*
|
|
60
72
|
* @examplePrompt Break down the area by storey
|
|
73
|
+
* @examplePrompt Break down net vs gross area by storey
|
|
61
74
|
* @examplePrompt Show the area rollup per department
|
|
62
75
|
* @examplePrompt Group the built-up area by building
|
|
63
76
|
*
|
|
@@ -84,6 +97,7 @@ export declare abstract class PluginProgramAreasApi {
|
|
|
84
97
|
* array (empty when the group is missing or empty).
|
|
85
98
|
*
|
|
86
99
|
* @examplePrompt List the spaces on this storey with their areas
|
|
100
|
+
* @examplePrompt Which spaces are net and which are gross on this storey?
|
|
87
101
|
* @examplePrompt What rooms are in the Bedrooms department bucket?
|
|
88
102
|
* @examplePrompt Break the storey area down into individual spaces
|
|
89
103
|
*
|
|
@@ -130,9 +144,9 @@ export declare abstract class PluginProgramAreasApi {
|
|
|
130
144
|
* |---|---|---|
|
|
131
145
|
* | `count` | `number` | Number of spaces in the program (a count, not an area) |
|
|
132
146
|
* | `hiddenCount` | `number` | Number of those spaces that are currently hidden |
|
|
133
|
-
* | `carpet` | `number` | Total
|
|
134
|
-
* | `builtUp` | `number` | Total
|
|
135
|
-
* | `excluded` | `number` | Total
|
|
147
|
+
* | `carpet` | `number` | Total **Net Internal Area** ("net") — Σ `NET`-classed spaces + floors — in `areaUnit` |
|
|
148
|
+
* | `builtUp` | `number` | Total **Gross External Area** ("gross") — Σ `GROSS`-classed spaces + slabs — in `areaUnit` |
|
|
149
|
+
* | `excluded` | `number` | Total **Excluded Area** — Σ `EXCLUDED`-classed spaces — in `areaUnit` |
|
|
136
150
|
* | `farBuiltUp` | `number` | Built-up area that counts toward FAR, in `areaUnit` |
|
|
137
151
|
* | `siteArea` | `number` | Site/plot area in `areaUnit` |
|
|
138
152
|
* | `achievedFar` | `number \| null` | Derived FAR (`farBuiltUp / siteArea`); `null` when site area or target FAR is unset |
|
|
@@ -167,8 +181,8 @@ export type PluginProgramAreaSummary = z.infer<typeof PluginProgramAreaSummary>;
|
|
|
167
181
|
* | `groupId` | `string` | Stable id of the group (e.g. storey id, department id) |
|
|
168
182
|
* | `name` | `string` | Display name of the group |
|
|
169
183
|
* | `color` | `string` | CSS hex color string for the group |
|
|
170
|
-
* | `carpet` | `number` |
|
|
171
|
-
* | `builtUp` | `number` |
|
|
184
|
+
* | `carpet` | `number` | Net Internal Area ("net") for this group |
|
|
185
|
+
* | `builtUp` | `number` | Gross External Area ("gross") for this group |
|
|
172
186
|
* | `excluded` | `number` | Excluded area for this group |
|
|
173
187
|
* | `count` | `number` | Number of spaces in this group |
|
|
174
188
|
* | `targetArea` | `number` | Target area for this group, in `targetUnit` |
|
|
@@ -193,18 +207,29 @@ export type PluginProgramAreaGroup = z.infer<typeof PluginProgramAreaGroup>;
|
|
|
193
207
|
* A single space within an area group. Area figures are in the program's area
|
|
194
208
|
* unit (see {@linkcode PluginProgramAreaSummary.areaUnit}).
|
|
195
209
|
*
|
|
210
|
+
* `areaClass` is the space's effective classification — it decides which of the
|
|
211
|
+
* three buckets the space's whole footprint lands in: `NET` → `carpet` ("net"),
|
|
212
|
+
* `GROSS` → `builtUp` ("gross"), `EXCLUDED` → `excluded`. So for any one member
|
|
213
|
+
* exactly one of `carpet` / `builtUp` / `excluded` is non-zero.
|
|
214
|
+
*
|
|
196
215
|
* | Property | Type | Description |
|
|
197
216
|
* |---|---|---|
|
|
198
217
|
* | `id` | `ComponentHandle` | `Component.id` of the space (never a mesh handle) |
|
|
199
218
|
* | `label` | `string` | Display label of the space |
|
|
200
|
-
* | `
|
|
201
|
-
* | `
|
|
202
|
-
* | `
|
|
219
|
+
* | `areaClass` | {@linkcode PluginAreaClass} | Effective area class — `"NET"` (→ `carpet`), `"GROSS"` (→ `builtUp`), or `"EXCLUDED"` |
|
|
220
|
+
* | `carpet` | `number` | Net area of the space (non-zero when `areaClass` is `"NET"`) |
|
|
221
|
+
* | `builtUp` | `number` | Gross area of the space (non-zero when `areaClass` is `"GROSS"`) |
|
|
222
|
+
* | `excluded` | `number` | Excluded area of the space (non-zero when `areaClass` is `"EXCLUDED"`) |
|
|
203
223
|
* | `isVisible` | `boolean` | Whether the space is currently visible |
|
|
204
224
|
*/
|
|
205
225
|
export declare const PluginProgramAreaMember: z.ZodObject<{
|
|
206
226
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
207
227
|
label: z.ZodString;
|
|
228
|
+
areaClass: z.ZodEnum<{
|
|
229
|
+
NET: "NET";
|
|
230
|
+
GROSS: "GROSS";
|
|
231
|
+
EXCLUDED: "EXCLUDED";
|
|
232
|
+
}>;
|
|
208
233
|
carpet: z.ZodNumber;
|
|
209
234
|
builtUp: z.ZodNumber;
|
|
210
235
|
excluded: z.ZodNumber;
|
|
@@ -313,6 +338,11 @@ export declare const PluginProgramAreasListMembersResult: z.ZodObject<{
|
|
|
313
338
|
members: z.ZodArray<z.ZodObject<{
|
|
314
339
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
315
340
|
label: z.ZodString;
|
|
341
|
+
areaClass: z.ZodEnum<{
|
|
342
|
+
NET: "NET";
|
|
343
|
+
GROSS: "GROSS";
|
|
344
|
+
EXCLUDED: "EXCLUDED";
|
|
345
|
+
}>;
|
|
316
346
|
carpet: z.ZodNumber;
|
|
317
347
|
builtUp: z.ZodNumber;
|
|
318
348
|
excluded: z.ZodNumber;
|