@snaptrude/plugin-core 0.9.17 → 0.9.18-voids-20261016.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/api-manifest.full.json +10406 -0
- package/api-manifest.json +737 -54
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +29 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +7 -1
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +8 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +209 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +65 -25
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +272 -99
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +13 -12
- package/dist/api/design/create/opening-fields.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +1 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +18 -24
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +797 -27
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +16 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +42 -32
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +10 -10
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +43 -3
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +10 -10
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +32 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +106 -6
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +103 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +6 -6
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/index.cjs +3693 -2383
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3573 -2383
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.mjs +5 -0
- package/src/api/core/camera/index.ts +29 -0
- package/src/api/core/geom/create/index.ts +7 -1
- package/src/api/core/geom/update/contour.ts +8 -2
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +121 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +57 -17
- package/src/api/design/create/index.ts +288 -120
- package/src/api/design/create/opening-fields.ts +15 -12
- package/src/api/design/delete/index.ts +1 -0
- package/src/api/design/doors/index.ts +58 -42
- package/src/api/design/family.ts +662 -32
- package/src/api/design/index.ts +34 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/index.ts +12 -2
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +44 -3
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/index.ts +39 -14
- package/src/api/presentation/placedViews.ts +119 -28
- package/src/api/presentation/sheets.ts +181 -20
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +46 -6
- package/src/errors/codes.ts +7 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -0
|
@@ -9,9 +9,16 @@ import { PluginApiReturn } from "../../types";
|
|
|
9
9
|
*
|
|
10
10
|
* `list`/`get` are reads; the rest mutate and require Present mode to be open:
|
|
11
11
|
* `create` adds a sheet, `place` drops a saved view onto a sheet as a live
|
|
12
|
-
* linked view shape
|
|
13
|
-
*
|
|
14
|
-
* `
|
|
12
|
+
* linked view shape (fitted to that sheet), `placeDrawing` moves an existing
|
|
13
|
+
* drawing onto a sheet (scaled down to fit by default), `rename` relabels a
|
|
14
|
+
* sheet, `delete` removes one, `reorder` moves one in the sheet order,
|
|
15
|
+
* `setActive` navigates to one, and `updatePlacedView` re-renders placed views
|
|
16
|
+
* to the current model.
|
|
17
|
+
*
|
|
18
|
+
* `presentation.drawings.create` never puts a drawing on a sheet: it makes the
|
|
19
|
+
* drawing beside its source view on the canvas. To put a view on a sheet, call
|
|
20
|
+
* `place(sheetId, viewId)`; to move a drawing you already made, call
|
|
21
|
+
* `placeDrawing(sheetId, drawingId)`.
|
|
15
22
|
*
|
|
16
23
|
* Accessed via `snaptrude.presentation.sheets`.
|
|
17
24
|
*/
|
|
@@ -139,37 +146,75 @@ export declare abstract class PluginPresentationSheetsApi {
|
|
|
139
146
|
*/
|
|
140
147
|
abstract setMargin(sheetId: string, margin: PluginSheetMargin): PluginApiReturn<PluginPresentationSheet>;
|
|
141
148
|
/**
|
|
142
|
-
* Place a saved view onto a sheet.
|
|
149
|
+
* Place a saved view onto a sheet. This is the call that puts a view on a
|
|
150
|
+
* sheet (`presentation.drawings.create` makes a drawing beside its source
|
|
151
|
+
* view, not on a sheet). When `scale` is omitted the view is fitted to the
|
|
152
|
+
* target sheet: a 2D or site-plan view is placed at the largest
|
|
153
|
+
* standard scale at which it fits inside the target sheet's margin, and
|
|
154
|
+
* never at a larger scale than the normal view drop would pick; a 3D view
|
|
155
|
+
* has no scale, so it is shrunk evenly to fit instead. This is the same fit
|
|
156
|
+
* as `placeDrawing`. Omit `position` unless the user asked for a specific
|
|
157
|
+
* place.
|
|
158
|
+
* Without a `position` the drawing goes to the sheet centre when that is
|
|
159
|
+
* free, otherwise to the nearest free spot to the centre inside the margin,
|
|
160
|
+
* beside the drawings already there; when there is no free spot it is
|
|
161
|
+
* centred anyway and the result has `overlaps: true`. With a `position` it
|
|
162
|
+
* is placed as given, and the result has `overlaps: true` when it covers
|
|
163
|
+
* another drawing, but it is not moved. In both cases only other drawings
|
|
164
|
+
* count (placed views and their title blocks and labels): text, images and
|
|
165
|
+
* other shapes on the sheet are ignored. Each call fits one view to the
|
|
166
|
+
* whole sheet, so a second fitted view often has no free spot: when several
|
|
167
|
+
* views should share a sheet, pass a `scale` small enough for all of them;
|
|
168
|
+
* otherwise use `sheets.create` per view. When the result's `overlaps` is
|
|
169
|
+
* true, move the drawing or put it on its own sheet.
|
|
170
|
+
* An explicit `scale` is always kept, even when the drawing (title block
|
|
171
|
+
* included) does not fit inside the sheet's margin at that scale; the result
|
|
172
|
+
* then has `overflows: true`. When it is true, pass a smaller scale (larger
|
|
173
|
+
* denominator), omit `scale` to fit, or use a larger sheet.
|
|
174
|
+
* `scale` must be a standard architectural scale denominator (100 means 1:100)
|
|
175
|
+
* in the project's unit system; any other value is rejected. Metric: 10, 20, 50,
|
|
176
|
+
* 100, 150, 200, 250, 500, 1000. Imperial detail: 12, 16, 24, 32, 48, 64, 96, 128,
|
|
177
|
+
* 192, 384, 768, 1536 (1" = 1' to 1/128" = 1'; 48 is 1/4" = 1', 96 is 1/8" = 1').
|
|
178
|
+
* Imperial site: 120, 240, 360, 480, 600, 1200, 2400, 3600, 4800 (1" = 10' to
|
|
179
|
+
* 1" = 400'). Pick the LARGEST standard scale (smallest denominator) at which the
|
|
180
|
+
* view still fits its frame or sheet and its room labels stay readable: for a
|
|
181
|
+
* building floor plan that is usually 1:50 to 1:200 (1/4" = 1' to 1/16" = 1').
|
|
182
|
+
* Never use a site-sized scale (1:500 and up, 1/64" = 1' (768) and smaller,
|
|
183
|
+
* 1" = 20' (240) and up) for a single building plan unless the user asked for it.
|
|
143
184
|
*
|
|
144
185
|
* Drops the given view onto the sheet through the **native view drop** — the
|
|
145
186
|
* placed shape is a live linked view (the same shape the Present views panel's
|
|
146
187
|
* drag-drop creates), re-rendered from the current model, so
|
|
147
188
|
* {@linkcode PluginPresentationSheetsApi.updatePlacedView} refreshes it later.
|
|
148
|
-
* 2D and site-plan views are placed at an architectural scale: the
|
|
149
|
-
* standard scale by default
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* 250, 500, 1000`; imperial e.g. `48` for 1/4″ = 1′, `96` for 1/8″ = 1′,
|
|
153
|
-
* `120` for 1″ = 10′). 3D views have no scale — passing `scale` for one
|
|
154
|
-
* throws. Requires Present mode to be open.
|
|
189
|
+
* 2D and site-plan views are placed at an architectural scale: the fitted
|
|
190
|
+
* standard scale described above by default, or the explicit `scale` when
|
|
191
|
+
* given (one of the standard values above). 3D views have no scale; passing
|
|
192
|
+
* `scale` for one throws. Requires Present mode to be open.
|
|
155
193
|
*
|
|
156
194
|
* @param sheetId - The id of the sheet to place onto.
|
|
157
195
|
* @param viewId - The id of the saved view to place.
|
|
158
196
|
* @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
|
|
159
|
-
* where to place it (
|
|
160
|
-
* scale value for the project's unit system (2D/site-plan views only;
|
|
161
|
-
*
|
|
197
|
+
* where to place it (when omitted, the sheet centre or the nearest free
|
|
198
|
+
* spot) — and `scale` — a standard scale value for the project's unit system (2D/site-plan views only;
|
|
199
|
+
* fitted to the target sheet when omitted).
|
|
162
200
|
* @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
|
|
163
|
-
* `shapeId
|
|
201
|
+
* `shapeId`, the `scale` used (`null` for a 3D view), whether the fit
|
|
202
|
+
* `rescaled` it, whether it `overlaps` another drawing on the sheet, and
|
|
203
|
+
* whether it `overflows` the sheet's margin at an explicit `scale`.
|
|
204
|
+
* (Hosts older than the fit return only `shapeId`.)
|
|
164
205
|
* @throws If Present mode is not open, the sheet/view id is invalid, `scale`
|
|
165
206
|
* is not a standard value for the project's unit system, or `scale` is
|
|
166
|
-
* passed for a 3D view.
|
|
207
|
+
* passed for a 3D view. `PRECONDITION_FAILED` when the view does not fit
|
|
208
|
+
* the sheet even at the smallest standard scale, or the title block alone
|
|
209
|
+
* is larger than the sheet's drawable area (use a larger sheet); no
|
|
210
|
+
* drawing is left on the sheet.
|
|
167
211
|
*
|
|
168
212
|
* @examplePrompt Place the floor plan on Sheet 1
|
|
169
213
|
* @examplePrompt Add this 3D view to the cover sheet
|
|
170
214
|
* @examplePrompt Drop the site plan onto the layout sheet at 100, 200
|
|
171
215
|
* @examplePrompt Put the Ground Floor view on sheet_1 at 1:100 scale
|
|
172
216
|
* @examplePrompt Place the plan on the cover sheet at quarter-inch scale
|
|
217
|
+
* @examplePrompt Add a floor plan drawing of each storey to this sheet
|
|
173
218
|
*
|
|
174
219
|
* # Example
|
|
175
220
|
* ```ts
|
|
@@ -182,6 +227,70 @@ export declare abstract class PluginPresentationSheetsApi {
|
|
|
182
227
|
position?: PluginSheetPosition;
|
|
183
228
|
scale?: number;
|
|
184
229
|
}): PluginApiReturn<PluginPresentationSheetsPlaceResult>;
|
|
230
|
+
/**
|
|
231
|
+
* Move an existing drawing onto a sheet without copying or regenerating it,
|
|
232
|
+
* scaled down to fit the sheet when it is too big. `presentation.drawings.create`
|
|
233
|
+
* leaves a drawing beside its source view, not on a sheet; this is the call
|
|
234
|
+
* that puts it on one. To place a saved view on a sheet in one call, use
|
|
235
|
+
* `sheets.place(sheetId, viewId)`, which fits it the same way.
|
|
236
|
+
* By default (`fit` true or omitted) a drawing larger than the sheet's
|
|
237
|
+
* drawable area (the sheet inside its margin) is moved to the LARGEST standard
|
|
238
|
+
* architectural scale at which it fits; a drawing that already fits keeps its
|
|
239
|
+
* scale, and a drawing is never scaled up. A 3D drawing has no architectural
|
|
240
|
+
* scale, so it is shrunk uniformly to fit instead. With `fit: false` the scale
|
|
241
|
+
* is kept and a drawing that does not fit is rejected with an error naming the
|
|
242
|
+
* drawing, the sheet and the scale, and saying to call `placeDrawing` without
|
|
243
|
+
* `fit: false` to fit it, or use a larger sheet. When even
|
|
244
|
+
* the smallest standard scale does not fit, the call is rejected with an error
|
|
245
|
+
* suggesting a larger sheet size.
|
|
246
|
+
* Without a `position` the drawing goes to the sheet centre when that is
|
|
247
|
+
* free, otherwise to the nearest free spot to the centre inside the margin,
|
|
248
|
+
* beside the drawings already there; when there is no free spot it is
|
|
249
|
+
* centred anyway and the result has `overlaps: true`. With a `position` it
|
|
250
|
+
* is placed as given, and the result has `overlaps: true` when it covers
|
|
251
|
+
* another drawing, but it is not moved. In both cases only other drawings
|
|
252
|
+
* count (placed views and their title blocks and labels): text, images and
|
|
253
|
+
* other shapes on the sheet are ignored. Each call fits one drawing to the
|
|
254
|
+
* whole sheet, so a second fitted drawing often has no free spot: when
|
|
255
|
+
* several drawings should share a sheet, give them scales small enough for
|
|
256
|
+
* all of them; otherwise use `sheets.create` per drawing.
|
|
257
|
+
* The position is sheet-local. The drawing's
|
|
258
|
+
* stable id remains unchanged; `shapeId` therefore identifies the moved
|
|
259
|
+
* drawing. The result reports the architectural scale the drawing has on the
|
|
260
|
+
* sheet and whether this call changed it; a host that reports it also says
|
|
261
|
+
* whether the drawing `overlaps` another drawing on the sheet (move it or
|
|
262
|
+
* put it on its own sheet when true).
|
|
263
|
+
*
|
|
264
|
+
* @param sheetId - The id of the destination sheet.
|
|
265
|
+
* @param drawingId - The id of an existing drawing deliverable.
|
|
266
|
+
* @param options - Optional sheet-local `position` (when omitted, the sheet centre or the nearest free spot)
|
|
267
|
+
* and `fit` (default `true`: scale a drawing that does not fit down to fit;
|
|
268
|
+
* `false`: keep its scale and reject a drawing that does not fit).
|
|
269
|
+
* @returns A {@linkcode PluginPresentationSheetsPlaceDrawingResult} with the
|
|
270
|
+
* drawing's `shapeId`, the `scale` used (`null` for a 3D drawing),
|
|
271
|
+
* `rescaled`, and optionally `overlaps`.
|
|
272
|
+
* @throws `PRECONDITION_FAILED` if Present mode is closed, the sheet is locked,
|
|
273
|
+
* the drawing does not fit with `fit: false`, or it does not fit even at the
|
|
274
|
+
* smallest standard scale; `HANDLE_INVALID` if either id is invalid or the
|
|
275
|
+
* shape is not a drawing.
|
|
276
|
+
*
|
|
277
|
+
* @examplePrompt Move this drawing onto the cover sheet
|
|
278
|
+
* @examplePrompt Place drawing_1 at the center of sheet_2
|
|
279
|
+
* @examplePrompt Put the level 2 plan drawing on the Level 2 Plan sheet
|
|
280
|
+
* @examplePrompt Add the floor plan drawings to this sheet
|
|
281
|
+
*
|
|
282
|
+
* # Example
|
|
283
|
+
* ```ts
|
|
284
|
+
* const { scale, rescaled } = await snaptrude.presentation.sheets.placeDrawing(
|
|
285
|
+
* sheet.id,
|
|
286
|
+
* drawing.id,
|
|
287
|
+
* )
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
abstract placeDrawing(sheetId: string, drawingId: string, options?: {
|
|
291
|
+
position?: PluginSheetPosition;
|
|
292
|
+
fit?: boolean;
|
|
293
|
+
}): PluginApiReturn<PluginPresentationSheetsPlaceDrawingResult>;
|
|
185
294
|
/**
|
|
186
295
|
* Rename a layout sheet.
|
|
187
296
|
*
|
|
@@ -519,8 +628,8 @@ export type PluginPresentationSheetsSetMarginArgs = z.infer<typeof PluginPresent
|
|
|
519
628
|
* |---|---|---|
|
|
520
629
|
* | `sheetId` | `string` | The sheet to place onto |
|
|
521
630
|
* | `viewId` | `string` | The saved view to place |
|
|
522
|
-
* | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (sheet centre
|
|
523
|
-
* | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only;
|
|
631
|
+
* | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (when omitted, the sheet centre or the nearest free spot) |
|
|
632
|
+
* | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; when omitted, the largest standard scale that fits inside the target sheet's margin, never larger than the normal view drop's) |
|
|
524
633
|
*/
|
|
525
634
|
export declare const PluginPresentationSheetsPlaceArgs: z.ZodObject<{
|
|
526
635
|
sheetId: z.ZodString;
|
|
@@ -533,16 +642,63 @@ export declare const PluginPresentationSheetsPlaceArgs: z.ZodObject<{
|
|
|
533
642
|
}, z.core.$strip>;
|
|
534
643
|
export type PluginPresentationSheetsPlaceArgs = z.infer<typeof PluginPresentationSheetsPlaceArgs>;
|
|
535
644
|
/**
|
|
536
|
-
*
|
|
645
|
+
* Arguments for {@linkcode PluginPresentationSheetsApi.placeDrawing}.
|
|
646
|
+
*
|
|
647
|
+
* | Property | Type | Description |
|
|
648
|
+
* |---|---|---|
|
|
649
|
+
* | `sheetId` | `string` | The destination sheet |
|
|
650
|
+
* | `drawingId` | `string` | The existing drawing to move |
|
|
651
|
+
* | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Sheet-local position (when omitted, the sheet centre or the nearest free spot) |
|
|
652
|
+
* | `fit` | `boolean \| undefined` | `true` (default) scales a drawing that does not fit down to fit; `false` keeps its scale and rejects a drawing that does not fit |
|
|
653
|
+
*/
|
|
654
|
+
export declare const PluginPresentationSheetsPlaceDrawingArgs: z.ZodObject<{
|
|
655
|
+
sheetId: z.ZodString;
|
|
656
|
+
drawingId: z.ZodString;
|
|
657
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
658
|
+
x: z.ZodNumber;
|
|
659
|
+
y: z.ZodNumber;
|
|
660
|
+
}, z.core.$strip>>;
|
|
661
|
+
fit: z.ZodOptional<z.ZodBoolean>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
export type PluginPresentationSheetsPlaceDrawingArgs = z.infer<typeof PluginPresentationSheetsPlaceDrawingArgs>;
|
|
664
|
+
/**
|
|
665
|
+
* Result of {@linkcode PluginPresentationSheetsApi.place}. The host returns
|
|
666
|
+
* `scale` and `rescaled` (and `overlaps`, `overflows`); they are optional only
|
|
667
|
+
* because hosts that predate the fit report `shapeId` alone.
|
|
537
668
|
*
|
|
538
669
|
* | Property | Type | Description |
|
|
539
670
|
* |---|---|---|
|
|
540
671
|
* | `shapeId` | `string` | Id of the created canvas shape |
|
|
672
|
+
* | `scale` | `number \| null \| undefined` | Architectural scale denominator the view has on the sheet (`null` for a 3D view) |
|
|
673
|
+
* | `rescaled` | `boolean \| undefined` | Whether the fit changed the view's size from the normal view drop's |
|
|
674
|
+
* | `overlaps` | `boolean \| undefined` | Whether the placed drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
|
|
675
|
+
* | `overflows` | `boolean \| undefined` | `true` when the drawing, title block included, does not fit inside the sheet's margin at the explicit `scale` passed (the scale is kept); absent otherwise |
|
|
541
676
|
*/
|
|
542
677
|
export declare const PluginPresentationSheetsPlaceResult: z.ZodObject<{
|
|
543
678
|
shapeId: z.ZodString;
|
|
679
|
+
scale: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
680
|
+
rescaled: z.ZodOptional<z.ZodBoolean>;
|
|
681
|
+
overlaps: z.ZodOptional<z.ZodBoolean>;
|
|
682
|
+
overflows: z.ZodOptional<z.ZodBoolean>;
|
|
544
683
|
}, z.core.$strip>;
|
|
545
684
|
export type PluginPresentationSheetsPlaceResult = z.infer<typeof PluginPresentationSheetsPlaceResult>;
|
|
685
|
+
/**
|
|
686
|
+
* Result of {@linkcode PluginPresentationSheetsApi.placeDrawing}.
|
|
687
|
+
*
|
|
688
|
+
* | Property | Type | Description |
|
|
689
|
+
* |---|---|---|
|
|
690
|
+
* | `shapeId` | `string` | Id of the moved drawing (the drawing id, unchanged) |
|
|
691
|
+
* | `scale` | `number \| null` | Architectural scale denominator the drawing has on the sheet (`null` for a 3D drawing) |
|
|
692
|
+
* | `rescaled` | `boolean` | Whether this call changed the drawing's size to fit the sheet |
|
|
693
|
+
* | `overlaps` | `boolean \| undefined` | Whether the drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
|
|
694
|
+
*/
|
|
695
|
+
export declare const PluginPresentationSheetsPlaceDrawingResult: z.ZodObject<{
|
|
696
|
+
overlaps: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
+
shapeId: z.ZodString;
|
|
698
|
+
scale: z.ZodNullable<z.ZodNumber>;
|
|
699
|
+
rescaled: z.ZodBoolean;
|
|
700
|
+
}, z.core.$strip>;
|
|
701
|
+
export type PluginPresentationSheetsPlaceDrawingResult = z.infer<typeof PluginPresentationSheetsPlaceDrawingResult>;
|
|
546
702
|
/**
|
|
547
703
|
* Arguments for {@linkcode PluginPresentationSheetsApi.rename}.
|
|
548
704
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheets.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/sheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"sheets.d.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vD,OAAO,mCAAmC,CAC3C,CAAA;AAED,uEAAuE;AACvE,eAAO,MAAM,qCAAqC;;iBAEhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4CAA4C;;iBAEvD,CAAA;AACF,MAAM,MAAM,4CAA4C,GAAG,CAAC,CAAC,KAAK,CAChE,OAAO,4CAA4C,CACpD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C;;iBAEzD,CAAA;AACF,MAAM,MAAM,8CAA8C,GAAG,CAAC,CAAC,KAAK,CAClE,OAAO,8CAA8C,CACtD,CAAA"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import type { PluginApiReturn } from "../../types";
|
|
3
|
+
/** Presets are document-local. Their ids are stable across reload; built-ins are immutable. */
|
|
4
|
+
export declare const PluginViewPreset: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
builtIn: z.ZodBoolean;
|
|
8
|
+
revision: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type PluginViewPreset = z.infer<typeof PluginViewPreset>;
|
|
11
|
+
export declare const PluginViewPresetIdArgs: z.ZodObject<{
|
|
12
|
+
presetId: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type PluginViewPresetIdArgs = z.infer<typeof PluginViewPresetIdArgs>;
|
|
15
|
+
export declare const PluginViewPresetCreateArgs: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
fromDrawingId: z.ZodString;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type PluginViewPresetCreateArgs = z.infer<typeof PluginViewPresetCreateArgs>;
|
|
20
|
+
export declare const PluginViewPresetRenameArgs: z.ZodObject<{
|
|
21
|
+
presetId: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type PluginViewPresetRenameArgs = z.infer<typeof PluginViewPresetRenameArgs>;
|
|
25
|
+
export declare const PluginViewPresetUpdateArgs: z.ZodObject<{
|
|
26
|
+
presetId: z.ZodString;
|
|
27
|
+
fromDrawingId: z.ZodString;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type PluginViewPresetUpdateArgs = z.infer<typeof PluginViewPresetUpdateArgs>;
|
|
30
|
+
export declare const PluginViewPresetDeleteArgs: z.ZodObject<{
|
|
31
|
+
presetId: z.ZodString;
|
|
32
|
+
replacementId: z.ZodString;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type PluginViewPresetDeleteArgs = z.infer<typeof PluginViewPresetDeleteArgs>;
|
|
35
|
+
/**
|
|
36
|
+
* Reusable styles for kernel-plan drawings, stored in the Present document.
|
|
37
|
+
*
|
|
38
|
+
* A preset holds every style category of a native kernel plan. A drawing is
|
|
39
|
+
* bound to one with {@linkcode PluginPresentationDrawingsApi.applyPreset}; its
|
|
40
|
+
* own style changes are overrides on top, dropped by
|
|
41
|
+
* {@linkcode PluginPresentationDrawingsApi.resetOverrides}. Presets apply only
|
|
42
|
+
* to drawings whose `drawings.getCapabilities(drawingId).presets` is `true`.
|
|
43
|
+
* Local title text is excluded from preset values.
|
|
44
|
+
*
|
|
45
|
+
* Presets are document-local; their ids survive reload. Built-in presets are
|
|
46
|
+
* immutable. Catalog writes (`create`, `copy`, `rename`, `update`, `delete`)
|
|
47
|
+
* are native document metadata and are **not undoable**; binding a drawing or
|
|
48
|
+
* changing its overrides uses Present undo. Every method requires **Present
|
|
49
|
+
* mode to be open** and throws `PRECONDITION_FAILED` ("Present mode is not
|
|
50
|
+
* open") when it is closed; no method switches tabs.
|
|
51
|
+
*
|
|
52
|
+
* Accessed via `snaptrude.presentation.viewPresets`.
|
|
53
|
+
*/
|
|
54
|
+
export declare abstract class PluginPresentationViewPresetsApi {
|
|
55
|
+
/**
|
|
56
|
+
* List the preset catalog: built-ins first, then custom presets by name.
|
|
57
|
+
*
|
|
58
|
+
* @returns Every {@linkcode PluginViewPreset}.
|
|
59
|
+
* @throws `PRECONDITION_FAILED` if Present mode is not open.
|
|
60
|
+
*
|
|
61
|
+
* @examplePrompt List the available drawing style presets
|
|
62
|
+
* @examplePrompt Which custom presets does this presentation have?
|
|
63
|
+
* @examplePrompt Is there a Planning Issue preset?
|
|
64
|
+
*
|
|
65
|
+
* # Example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const presets = await snaptrude.presentation.viewPresets.list()
|
|
68
|
+
* const custom = presets.filter((preset) => !preset.builtIn)
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
abstract list(): PluginApiReturn<PluginViewPreset[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Read one preset by id.
|
|
74
|
+
*
|
|
75
|
+
* @param presetId - The preset to read.
|
|
76
|
+
* @returns The {@linkcode PluginViewPreset}, or `null` if no preset has that id.
|
|
77
|
+
* @throws `PRECONDITION_FAILED` if Present mode is not open.
|
|
78
|
+
*
|
|
79
|
+
* @examplePrompt Which preset is this drawing using?
|
|
80
|
+
* @examplePrompt Is this preset a built-in one?
|
|
81
|
+
* @examplePrompt Read the preset bound to the ground floor plan
|
|
82
|
+
*
|
|
83
|
+
* # Example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const drawing = await snaptrude.presentation.drawings.get(drawingId)
|
|
86
|
+
* const preset = drawing?.presetId
|
|
87
|
+
* ? await snaptrude.presentation.viewPresets.get(drawing.presetId)
|
|
88
|
+
* : null
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
abstract get(presetId: string): PluginApiReturn<PluginViewPreset | null>;
|
|
92
|
+
/**
|
|
93
|
+
* Save a kernel-plan drawing's effective styles as a new custom preset and
|
|
94
|
+
* bind that drawing to it. Not undoable (catalog write).
|
|
95
|
+
*
|
|
96
|
+
* @param name - A unique preset name (non-empty after trimming).
|
|
97
|
+
* @param options - `fromDrawingId`: the kernel-plan drawing to take styles from.
|
|
98
|
+
* @returns The new {@linkcode PluginViewPreset}.
|
|
99
|
+
* @throws `VALIDATION` for an empty or duplicate name (with a hint);
|
|
100
|
+
* `PRECONDITION_FAILED` if Present mode is not open, the document is
|
|
101
|
+
* read-only, or the drawing is not a kernel vector plan (each with a
|
|
102
|
+
* hint); `HANDLE_INVALID` if `fromDrawingId` is not a drawing.
|
|
103
|
+
*
|
|
104
|
+
* @examplePrompt Save this drawing's styles as a new preset
|
|
105
|
+
* @examplePrompt Make a preset called Planning Issue from this plan
|
|
106
|
+
* @examplePrompt Turn my restyled drawing into a reusable style
|
|
107
|
+
*
|
|
108
|
+
* # Example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const capabilities = await snaptrude.presentation.drawings.getCapabilities(drawing.id)
|
|
111
|
+
* if (capabilities.presets) {
|
|
112
|
+
* const preset = await snaptrude.presentation.viewPresets.create("Planning Issue", {
|
|
113
|
+
* fromDrawingId: drawing.id,
|
|
114
|
+
* })
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
abstract create(name: string, options: {
|
|
119
|
+
fromDrawingId: string;
|
|
120
|
+
}): PluginApiReturn<PluginViewPreset>;
|
|
121
|
+
/**
|
|
122
|
+
* Duplicate a preset under a native-generated unique name. Drawing bindings
|
|
123
|
+
* do not change. Not undoable (catalog write). Built-ins can be copied.
|
|
124
|
+
*
|
|
125
|
+
* @param presetId - The preset to copy.
|
|
126
|
+
* @returns The new custom {@linkcode PluginViewPreset}.
|
|
127
|
+
* @throws `PRECONDITION_FAILED` if Present mode is not open or the document
|
|
128
|
+
* is read-only (each with a hint); `HANDLE_INVALID` if `presetId` does not
|
|
129
|
+
* exist.
|
|
130
|
+
*
|
|
131
|
+
* @examplePrompt Duplicate this preset
|
|
132
|
+
* @examplePrompt Make an editable copy of the built-in preset
|
|
133
|
+
* @examplePrompt Copy the Planning Issue preset so I can change it
|
|
134
|
+
*
|
|
135
|
+
* # Example
|
|
136
|
+
* ```ts
|
|
137
|
+
* const copy = await snaptrude.presentation.viewPresets.copy(preset.id)
|
|
138
|
+
* await snaptrude.presentation.viewPresets.rename(copy.id, "Planning Issue B")
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
abstract copy(presetId: string): PluginApiReturn<PluginViewPreset>;
|
|
142
|
+
/**
|
|
143
|
+
* Rename a custom preset. Names must stay unique; built-ins cannot be
|
|
144
|
+
* renamed. Not undoable (catalog write).
|
|
145
|
+
*
|
|
146
|
+
* @param presetId - The custom preset to rename.
|
|
147
|
+
* @param name - The new unique name (non-empty after trimming).
|
|
148
|
+
* @returns The renamed {@linkcode PluginViewPreset}.
|
|
149
|
+
* @throws `VALIDATION` when the catalog refuses: an empty or duplicate name,
|
|
150
|
+
* a built-in preset, or an unknown `presetId` (with a hint);
|
|
151
|
+
* `PRECONDITION_FAILED` if Present mode is not open or the document is
|
|
152
|
+
* read-only (each with a hint).
|
|
153
|
+
*
|
|
154
|
+
* @examplePrompt Rename this preset to Client Review
|
|
155
|
+
* @examplePrompt Call the copied preset Planning Issue B
|
|
156
|
+
* @examplePrompt Change the name of my custom drawing style
|
|
157
|
+
*
|
|
158
|
+
* # Example
|
|
159
|
+
* ```ts
|
|
160
|
+
* await snaptrude.presentation.viewPresets.rename(preset.id, "Client Review")
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
abstract rename(presetId: string, name: string): PluginApiReturn<PluginViewPreset>;
|
|
164
|
+
/**
|
|
165
|
+
* Replace a custom preset's values with the effective styles of a drawing
|
|
166
|
+
* already bound to it, then refresh every bound drawing. Built-ins cannot
|
|
167
|
+
* be updated. Not undoable (catalog write).
|
|
168
|
+
*
|
|
169
|
+
* @param presetId - The custom preset to update.
|
|
170
|
+
* @param options - `fromDrawingId`: a kernel-plan drawing bound to this preset.
|
|
171
|
+
* @returns The updated {@linkcode PluginViewPreset} (its `revision` grows).
|
|
172
|
+
* @throws `VALIDATION` when the catalog refuses: a built-in preset (with a
|
|
173
|
+
* hint); `PRECONDITION_FAILED` if Present mode is not open, the document
|
|
174
|
+
* is read-only, or the drawing is not a kernel vector plan bound to this
|
|
175
|
+
* preset (each with a hint); `HANDLE_INVALID` if `fromDrawingId` is not a
|
|
176
|
+
* drawing.
|
|
177
|
+
*
|
|
178
|
+
* @examplePrompt Update this preset from the current drawing styles
|
|
179
|
+
* @examplePrompt Push my style changes to every drawing using this preset
|
|
180
|
+
* @examplePrompt Save these overrides into the Planning Issue preset
|
|
181
|
+
*
|
|
182
|
+
* # Example
|
|
183
|
+
* ```ts
|
|
184
|
+
* await snaptrude.presentation.viewPresets.update(drawing.presetId!, {
|
|
185
|
+
* fromDrawingId: drawing.id,
|
|
186
|
+
* })
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
abstract update(presetId: string, options: {
|
|
190
|
+
fromDrawingId: string;
|
|
191
|
+
}): PluginApiReturn<PluginViewPreset>;
|
|
192
|
+
/**
|
|
193
|
+
* Delete a custom preset and rebind its drawings to another existing
|
|
194
|
+
* preset. Built-ins cannot be deleted. Not undoable (catalog write).
|
|
195
|
+
*
|
|
196
|
+
* @param presetId - The custom preset to delete.
|
|
197
|
+
* @param options - `replacementId`: the existing preset its drawings move to
|
|
198
|
+
* (not the deleted one).
|
|
199
|
+
* @returns Nothing.
|
|
200
|
+
* @throws `VALIDATION` when the catalog refuses: a built-in or unknown
|
|
201
|
+
* `presetId`, or an unknown `replacementId` (with a hint);
|
|
202
|
+
* `PRECONDITION_FAILED` if Present mode is not open or the document is
|
|
203
|
+
* read-only (each with a hint).
|
|
204
|
+
*
|
|
205
|
+
* @examplePrompt Delete this preset
|
|
206
|
+
* @examplePrompt Remove the old style preset and switch its drawings to the default
|
|
207
|
+
* @examplePrompt Get rid of the Planning Issue B preset
|
|
208
|
+
*
|
|
209
|
+
* # Example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const presets = await snaptrude.presentation.viewPresets.list()
|
|
212
|
+
* const replacement = presets.find((each) => each.builtIn)!
|
|
213
|
+
* await snaptrude.presentation.viewPresets.delete(customPreset.id, {
|
|
214
|
+
* replacementId: replacement.id,
|
|
215
|
+
* })
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
abstract delete(presetId: string, options: {
|
|
219
|
+
replacementId: string;
|
|
220
|
+
}): PluginApiReturn<void>;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=viewPresets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewPresets.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/viewPresets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB;;;;;iBAK3B,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAC/D,eAAO,MAAM,sBAAsB;;kBAExB,CAAA;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,eAAO,MAAM,0BAA0B;;;kBAE5B,CAAA;AACX,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AACD,eAAO,MAAM,0BAA0B;;;kBAErC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AACD,eAAO,MAAM,0BAA0B;;;kBAErC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AACD,eAAO,MAAM,0BAA0B;;;kBAErC,CAAA;AACF,MAAM,MAAM,0BAA0B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