@snaptrude/plugin-core 0.9.0 → 0.9.2
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 +25 -0
- package/api-manifest.full.json +411 -2
- package/api-manifest.json +411 -2
- package/dist/api/core/geom/create/index.d.ts +406 -11
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +44 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/io/terrain/index.d.ts +135 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -1
- package/dist/api/presentation/annotate.d.ts +23 -4
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/diagrams.d.ts +64 -2
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +11 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +772 -3
- 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 +42 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +166 -2
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +46 -1
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/index.cjs +890 -554
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +850 -554
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/geom/create/index.ts +445 -10
- package/src/api/core/geom/query/brep.ts +45 -0
- package/src/api/core/io/terrain/index.ts +146 -0
- package/src/api/presentation/annotate.ts +27 -2
- package/src/api/presentation/diagrams.ts +67 -2
- package/src/api/presentation/index.ts +11 -1
- package/src/api/presentation/placedViews.ts +760 -3
- package/src/api/presentation/sheets.ts +54 -0
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/program/site.ts +110 -2
- package/src/api/workspace/index.ts +48 -1
|
@@ -8,8 +8,8 @@ import { PluginSheetPosition } from "./sheets";
|
|
|
8
8
|
* (or the open canvas) — the live linked view shape
|
|
9
9
|
* {@linkcode PluginPresentationSheetsApi.place} and the Present views panel's
|
|
10
10
|
* drag-drop create. These methods read and edit the **layout** of those
|
|
11
|
-
* shapes: where they sit, how big they are, their
|
|
12
|
-
* their crop. To refresh a placed view's **content** from the current model,
|
|
11
|
+
* shapes: where they sit, how big they are, their rotation, their
|
|
12
|
+
* architectural scale, and their crop. To refresh a placed view's **content** from the current model,
|
|
13
13
|
* use `sheets.updatePlacedView` — content refresh lives on `sheets`,
|
|
14
14
|
* layout lives here.
|
|
15
15
|
*
|
|
@@ -192,6 +192,346 @@ export declare abstract class PluginPresentationPlacedViewsApi {
|
|
|
192
192
|
* ```
|
|
193
193
|
*/
|
|
194
194
|
abstract setCrop(shapeId: string, crop: PluginPlacedViewCrop | null): PluginApiReturn<PluginPlacedView>;
|
|
195
|
+
/**
|
|
196
|
+
* Set a placed view's rotation.
|
|
197
|
+
*
|
|
198
|
+
* `rotation` is the **absolute** angle in radians (tldraw convention) — the
|
|
199
|
+
* value the record's `rotation` field reads back. Values are canonicalized
|
|
200
|
+
* into `[0, 2π)`, so pass values in that range for an exact round-trip
|
|
201
|
+
* (`setRotation(-0.1)` reads back as `2π − 0.1`). The view rotates about
|
|
202
|
+
* its bounds center (the same pivot as the UI rotation handle). One undo
|
|
203
|
+
* step. Joins the absolute-setter family
|
|
204
|
+
* `setScale`/`setCrop`/`setOpacity`/`setMask`.
|
|
205
|
+
*
|
|
206
|
+
* **3D placed views only.** 2D and site-plan views cannot rotate — the
|
|
207
|
+
* canvas hides their rotate handle and reverts any rotation applied to
|
|
208
|
+
* them — so calling this on one is refused with a typed
|
|
209
|
+
* `PRECONDITION_FAILED` instead of silently no-opping. Requires Present
|
|
210
|
+
* mode to be open.
|
|
211
|
+
*
|
|
212
|
+
* @param shapeId - The placed view shape to rotate.
|
|
213
|
+
* @param rotation - Absolute rotation in radians.
|
|
214
|
+
* @returns The updated {@linkcode PluginPlacedView}.
|
|
215
|
+
* @throws If Present mode is not open, `shapeId` is unknown or is not a
|
|
216
|
+
* placed view, `rotation` is not a finite number, or the placed view is
|
|
217
|
+
* a 2D/site-plan view (`PRECONDITION_FAILED` — only 3D views rotate).
|
|
218
|
+
*
|
|
219
|
+
* @examplePrompt Rotate the placed plan 90 degrees
|
|
220
|
+
* @examplePrompt Set this view's rotation to 45 degrees
|
|
221
|
+
* @examplePrompt Straighten the placed view back to zero rotation
|
|
222
|
+
*
|
|
223
|
+
* # Example
|
|
224
|
+
* ```ts
|
|
225
|
+
* await snaptrude.presentation.placedViews.setRotation(shapeId, Math.PI / 2)
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
abstract setRotation(shapeId: string, rotation: number): PluginApiReturn<PluginPlacedView>;
|
|
229
|
+
/**
|
|
230
|
+
* Read a placed view's (or sheet's) per-category presentation styles.
|
|
231
|
+
*
|
|
232
|
+
* Returns one entry per style category (Site, Topography, Space, Department,
|
|
233
|
+
* Envelope, Facade/Mass, Dimension, Reference Line, Adjacency Line,
|
|
234
|
+
* Landscape elements — sheets/auto-diagrams use their 3-category subset)
|
|
235
|
+
* with the **fully-resolved** setting values (defaults merged with this
|
|
236
|
+
* shape's overrides), which setting ids the category supports, whether the
|
|
237
|
+
* category is currently disabled (not visible in the view), and — where the
|
|
238
|
+
* category has a Text tab — its label font styles. Styles are stored **per
|
|
239
|
+
* placed shape instance**: the same saved view placed twice can read
|
|
240
|
+
* differently. Requires Present mode to be open.
|
|
241
|
+
*
|
|
242
|
+
* @param shapeId - The placed view (or sheet) shape to read.
|
|
243
|
+
* @throws If Present mode is not open or `shapeId` is not a styleable shape.
|
|
244
|
+
*
|
|
245
|
+
* @examplePrompt What line weights is this placed plan using?
|
|
246
|
+
* @examplePrompt Read the styling of the placed view
|
|
247
|
+
* @examplePrompt Which categories can I restyle on this sheet?
|
|
248
|
+
*
|
|
249
|
+
* # Example
|
|
250
|
+
* ```ts
|
|
251
|
+
* const styles = await snaptrude.presentation.placedViews.getStyles(shapeId)
|
|
252
|
+
* const space = styles.categories.find((c) => c.category === "Space")
|
|
253
|
+
* console.log(space?.settings.cutWidth, space?.settings.lineStyle)
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
abstract getStyles(shapeId: string): PluginApiReturn<PluginPlacedViewStylesResult>;
|
|
257
|
+
/**
|
|
258
|
+
* Update one style category on a placed view (or sheet) — the same writes
|
|
259
|
+
* the Present sidebar's per-category configure panel performs.
|
|
260
|
+
*
|
|
261
|
+
* The patch may set any subset of the category's settings: line style (7
|
|
262
|
+
* dash patterns), line color, dash-length multiplier, line weights in mm
|
|
263
|
+
* (`cutWidth` vs `projectionWidth` — Revit-style cut/projection distinction;
|
|
264
|
+
* `lineWidth` where the category has a single weight; `treeLineWidth` /
|
|
265
|
+
* `parkingLineWidth` for Landscape), fill `colorMode` (`department`,
|
|
266
|
+
* `texture`, `monochrome`, or `tag:<tagCategoryId>`), per-category fill
|
|
267
|
+
* `opacity` (0–100), category `hide` (cascades to that category's labels),
|
|
268
|
+
* the shape restyle `viewStyle` (`NONE` block / `FILLET` rounded with
|
|
269
|
+
* `radius` / `BUBBLE`) with `radius` and `inset`, and Topography's
|
|
270
|
+
* map/building sub-controls. Settings a category does not support are
|
|
271
|
+
* rejected. Writes are validated, undoable (one history stop per call), and
|
|
272
|
+
* re-render immediately; on an auto-diagram sheet the write fans out to
|
|
273
|
+
* every sheet in its diagram set. Requires Present mode to be open.
|
|
274
|
+
*
|
|
275
|
+
* @param shapeId - The placed view (or sheet) shape to restyle.
|
|
276
|
+
* @param category - The style category to update.
|
|
277
|
+
* @param patch - The settings to change (at least one).
|
|
278
|
+
* @returns The category's resolved styles after the update.
|
|
279
|
+
* @throws If Present mode is not open, `shapeId` is not a styleable shape,
|
|
280
|
+
* the category does not apply to this shape, or a patched setting is not
|
|
281
|
+
* supported by the category or fails validation.
|
|
282
|
+
*
|
|
283
|
+
* @examplePrompt Set the Space cut line weight to 0.5 mm
|
|
284
|
+
* @examplePrompt Make the Department lines dashed
|
|
285
|
+
* @examplePrompt Color the plan by department
|
|
286
|
+
* @examplePrompt Hide the dimension lines on this view
|
|
287
|
+
* @examplePrompt Round the space corners with a 2 ft radius
|
|
288
|
+
*
|
|
289
|
+
* # Example
|
|
290
|
+
* ```ts
|
|
291
|
+
* await snaptrude.presentation.placedViews.updateStyles(shapeId, "Space", {
|
|
292
|
+
* cutWidth: 0.5,
|
|
293
|
+
* projectionWidth: 0.18,
|
|
294
|
+
* lineStyle: "dashed",
|
|
295
|
+
* colorMode: "department",
|
|
296
|
+
* })
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
abstract updateStyles(shapeId: string, category: PluginViewSettingCategory, patch: PluginPlacedViewStylePatch): PluginApiReturn<PluginPlacedViewCategoryStyles>;
|
|
300
|
+
/**
|
|
301
|
+
* Reset a placed view's styling to defaults — the sidebar's Reset button:
|
|
302
|
+
* clears every per-category override and view-style restyle, resets font
|
|
303
|
+
* styles, and un-hides labels hidden by styling. Undoable. Requires Present
|
|
304
|
+
* mode to be open.
|
|
305
|
+
*
|
|
306
|
+
* @param shapeId - The placed view (or sheet) shape to reset.
|
|
307
|
+
* @throws If Present mode is not open or `shapeId` is not a styleable shape.
|
|
308
|
+
*
|
|
309
|
+
* @examplePrompt Reset this view's styling
|
|
310
|
+
* @examplePrompt Clear all the style overrides on the placed plan
|
|
311
|
+
* @examplePrompt Put the sheet styles back to default
|
|
312
|
+
*/
|
|
313
|
+
abstract resetStyles(shapeId: string): PluginApiReturn<void>;
|
|
314
|
+
/**
|
|
315
|
+
* Update a category's label typography on a placed view (or sheet) — the
|
|
316
|
+
* configure panel's Text tab.
|
|
317
|
+
*
|
|
318
|
+
* Each category carries font styles per label type — `objectLabels` (the
|
|
319
|
+
* name), `department`, and `areas` — with `fontFamily` (system families or
|
|
320
|
+
* any Google Font; the font is loaded automatically and the weight is
|
|
321
|
+
* coerced to an available variant), `fontWeight` (numeric string, e.g.
|
|
322
|
+
* `"700"`), `fontStyle` (`normal`/`italic`), and `fontSize` in px.
|
|
323
|
+
* `visibleTypes` controls which label types render (an empty array hides
|
|
324
|
+
* all). Not every category has a Text tab — Topography, Facade/Mass,
|
|
325
|
+
* Reference Line and Adjacency Line reject font writes. Undoable. Requires
|
|
326
|
+
* Present mode to be open.
|
|
327
|
+
*
|
|
328
|
+
* @param shapeId - The placed view (or sheet) shape.
|
|
329
|
+
* @param category - The style category whose labels to restyle.
|
|
330
|
+
* @param patch - The font styles to change (at least one field).
|
|
331
|
+
* @throws If Present mode is not open, `shapeId` is not a styleable shape,
|
|
332
|
+
* or the category has no Text tab.
|
|
333
|
+
*
|
|
334
|
+
* @examplePrompt Set the space labels to Roboto 24px bold
|
|
335
|
+
* @examplePrompt Hide the area values on this plan
|
|
336
|
+
* @examplePrompt Make the department labels italic
|
|
337
|
+
*
|
|
338
|
+
* # Example
|
|
339
|
+
* ```ts
|
|
340
|
+
* await snaptrude.presentation.placedViews.updateFontStyles(shapeId, "Space", {
|
|
341
|
+
* objectLabels: { fontFamily: "Roboto", fontWeight: "700", fontSize: 24 },
|
|
342
|
+
* visibleTypes: ["objectLabels", "areas"],
|
|
343
|
+
* })
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
abstract updateFontStyles(shapeId: string, category: PluginViewSettingCategory, patch: PluginPlacedViewFontStylesPatch): PluginApiReturn<void>;
|
|
347
|
+
/**
|
|
348
|
+
* List a placed view's labels — the text children generated from the view's
|
|
349
|
+
* content (space names, departments, areas, dimension texts). Each label is
|
|
350
|
+
* individually addressable: it can be moved and hidden. Returns `[]` when
|
|
351
|
+
* the view has no labels. Requires Present mode to be open.
|
|
352
|
+
*
|
|
353
|
+
* @param shapeId - The placed view shape whose labels to list.
|
|
354
|
+
* @throws If Present mode is not open or `shapeId` is not a placed view.
|
|
355
|
+
*
|
|
356
|
+
* @examplePrompt List the labels on this placed plan
|
|
357
|
+
* @examplePrompt Where are the space labels on this view?
|
|
358
|
+
* @examplePrompt Show every label with its position
|
|
359
|
+
*
|
|
360
|
+
* # Example
|
|
361
|
+
* ```ts
|
|
362
|
+
* const { labels } = await snaptrude.presentation.placedViews.listLabels(shapeId)
|
|
363
|
+
* for (const l of labels) console.log(l.text, l.position, l.hidden)
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
abstract listLabels(shapeId: string): PluginApiReturn<PluginPlacedViewLabelsResult>;
|
|
367
|
+
/**
|
|
368
|
+
* Move a label to a new position (coordinates relative to its placed view,
|
|
369
|
+
* the same space `listLabels` reports). The manual position survives style
|
|
370
|
+
* changes. Undoable. Requires Present mode to be open.
|
|
371
|
+
*
|
|
372
|
+
* @param labelId - The label to move (from `listLabels`).
|
|
373
|
+
* @param position - New position, parent-view-relative.
|
|
374
|
+
* @throws If Present mode is not open or `labelId` is not a view label.
|
|
375
|
+
*
|
|
376
|
+
* @examplePrompt Move the kitchen label out of the hatched area
|
|
377
|
+
* @examplePrompt Nudge this label 20 units right
|
|
378
|
+
* @examplePrompt Reposition the area text
|
|
379
|
+
*/
|
|
380
|
+
abstract moveLabel(labelId: string, position: PluginSheetPosition): PluginApiReturn<PluginPlacedViewLabel>;
|
|
381
|
+
/**
|
|
382
|
+
* Hide or show a single label (independent of the category-level label
|
|
383
|
+
* visibility). Undoable. Requires Present mode to be open.
|
|
384
|
+
*
|
|
385
|
+
* @param labelId - The label to hide/show (from `listLabels`).
|
|
386
|
+
* @param hidden - `true` to hide, `false` to show.
|
|
387
|
+
* @throws If Present mode is not open or `labelId` is not a view label.
|
|
388
|
+
*
|
|
389
|
+
* @examplePrompt Hide the corridor label
|
|
390
|
+
* @examplePrompt Show that label again
|
|
391
|
+
*/
|
|
392
|
+
abstract setLabelHidden(labelId: string, hidden: boolean): PluginApiReturn<PluginPlacedViewLabel>;
|
|
393
|
+
/**
|
|
394
|
+
* List the top-level shapes on the Present canvas — not just placed views:
|
|
395
|
+
* AI-generated outputs, placed diagram images, plugin-created shapes, and
|
|
396
|
+
* annotations, each with an `origin` classification. Sheets (frames) are
|
|
397
|
+
* not listed — use `sheets.list`. Pass `sheetId` to list only shapes on
|
|
398
|
+
* that sheet. Returns `[]` when Present mode is closed.
|
|
399
|
+
*
|
|
400
|
+
* @param sheetId - Optional sheet id to filter by.
|
|
401
|
+
*
|
|
402
|
+
* @examplePrompt List everything on the Present canvas
|
|
403
|
+
* @examplePrompt What AI outputs are on this sheet?
|
|
404
|
+
* @examplePrompt Show all the shapes with their positions
|
|
405
|
+
*
|
|
406
|
+
* # Example
|
|
407
|
+
* ```ts
|
|
408
|
+
* const { shapes } = await snaptrude.presentation.placedViews.listShapes()
|
|
409
|
+
* const aiOutputs = shapes.filter((s) => s.origin === "aiOutput")
|
|
410
|
+
* ```
|
|
411
|
+
*/
|
|
412
|
+
abstract listShapes(sheetId?: string): PluginApiReturn<PluginCanvasShapesListResult>;
|
|
413
|
+
/**
|
|
414
|
+
* Get one Present-canvas shape by id — works for any top-level shape
|
|
415
|
+
* (placed view, AI output, diagram image, plugin shape, annotation), unlike
|
|
416
|
+
* `get` which requires a placed view. Requires Present mode to be open.
|
|
417
|
+
*
|
|
418
|
+
* @param shapeId - The shape to read.
|
|
419
|
+
* @throws If Present mode is not open or `shapeId` is unknown or a sheet.
|
|
420
|
+
*
|
|
421
|
+
* @examplePrompt Inspect the AI render I just generated
|
|
422
|
+
* @examplePrompt Get the bounds of that diagram image
|
|
423
|
+
*/
|
|
424
|
+
abstract getShape(shapeId: string): PluginApiReturn<PluginCanvasShape>;
|
|
425
|
+
/**
|
|
426
|
+
* Move any Present-canvas shape (AI outputs, diagram images, plugin shapes,
|
|
427
|
+
* annotations — placed views too). Same coordinate semantics as `move`:
|
|
428
|
+
* sheet-local when on a sheet, page coordinates otherwise; pass
|
|
429
|
+
* `options.sheetId` to reparent onto a sheet. Undoable. Requires Present
|
|
430
|
+
* mode to be open.
|
|
431
|
+
*
|
|
432
|
+
* @param shapeId - The shape to move.
|
|
433
|
+
* @param position - New top-left position.
|
|
434
|
+
* @param options - Optional `sheetId` to move the shape onto that sheet.
|
|
435
|
+
* @throws If Present mode is not open, `shapeId` is unknown or a sheet, or
|
|
436
|
+
* `options.sheetId` is not a sheet.
|
|
437
|
+
*
|
|
438
|
+
* @examplePrompt Move the AI render to the top of the sheet
|
|
439
|
+
* @examplePrompt Put the diagram image at 100, 200
|
|
440
|
+
*/
|
|
441
|
+
abstract moveShape(shapeId: string, position: PluginSheetPosition, options?: {
|
|
442
|
+
sheetId?: string;
|
|
443
|
+
}): PluginApiReturn<PluginCanvasShape>;
|
|
444
|
+
/**
|
|
445
|
+
* Resize any Present-canvas shape by a uniform factor about its top-left
|
|
446
|
+
* corner (aspect ratio held) — the generic counterpart of `scale`, which
|
|
447
|
+
* requires a placed view. Undoable. Requires Present mode to be open.
|
|
448
|
+
*
|
|
449
|
+
* @param shapeId - The shape to resize.
|
|
450
|
+
* @param factor - Uniform scale factor, between `0.01` and `100`.
|
|
451
|
+
* @throws If Present mode is not open, `shapeId` is unknown or a sheet, or
|
|
452
|
+
* `factor` is out of range.
|
|
453
|
+
*
|
|
454
|
+
* @examplePrompt Make the AI output half its size
|
|
455
|
+
* @examplePrompt Double the size of that image
|
|
456
|
+
*/
|
|
457
|
+
abstract resizeShape(shapeId: string, factor: number): PluginApiReturn<PluginCanvasShape>;
|
|
458
|
+
/**
|
|
459
|
+
* Rotate any Present-canvas shape (AI outputs, diagram images, plugin
|
|
460
|
+
* shapes, annotations — placed views too) — the generic counterpart of
|
|
461
|
+
* `setRotation`, same target rules as `moveShape`. Same semantics:
|
|
462
|
+
* **absolute** angle in radians (tldraw convention) about the shape's
|
|
463
|
+
* bounds center, canonicalized into `[0, 2π)` (pass values in that range
|
|
464
|
+
* for an exact round-trip via `getShape`), one undo step. A placed view
|
|
465
|
+
* passed here falls under the same 3D-only rule as `setRotation`: 2D and
|
|
466
|
+
* site-plan views cannot rotate and are refused with a typed
|
|
467
|
+
* `PRECONDITION_FAILED`. Requires Present mode to be open.
|
|
468
|
+
*
|
|
469
|
+
* @param shapeId - The shape to rotate.
|
|
470
|
+
* @param rotation - Absolute rotation in radians.
|
|
471
|
+
* @throws If Present mode is not open, `shapeId` is unknown or a sheet,
|
|
472
|
+
* `rotation` is not a finite number, or the target is a 2D/site-plan
|
|
473
|
+
* placed view (`PRECONDITION_FAILED` — only 3D views rotate).
|
|
474
|
+
*
|
|
475
|
+
* @examplePrompt Rotate the AI render 15 degrees
|
|
476
|
+
* @examplePrompt Turn that image sideways
|
|
477
|
+
* @examplePrompt Reset the diagram image's rotation
|
|
478
|
+
*/
|
|
479
|
+
abstract rotateShape(shapeId: string, rotation: number): PluginApiReturn<PluginCanvasShape>;
|
|
480
|
+
/**
|
|
481
|
+
* Delete Present-canvas shapes. One undoable step for the whole batch, and
|
|
482
|
+
* the batch is atomic — if any id is rejected, nothing is deleted.
|
|
483
|
+
*
|
|
484
|
+
* Deletable: placed views, AI-generated outputs, placed diagram images, and
|
|
485
|
+
* shapes created by plugins. **Not deletable here:** sheets (use
|
|
486
|
+
* `sheets.delete`) and user-drawn annotations (draw, geo, arrow, note,
|
|
487
|
+
* text, highlight, line shapes without a plugin ownership stamp) — those
|
|
488
|
+
* reject with a validation error. Requires Present mode to be open.
|
|
489
|
+
*
|
|
490
|
+
* @param shapeIds - The shapes to delete (at least one).
|
|
491
|
+
* @returns The deleted shape ids.
|
|
492
|
+
* @throws If Present mode is not open, or any id is unknown, a sheet, or a
|
|
493
|
+
* protected user annotation.
|
|
494
|
+
*
|
|
495
|
+
* @examplePrompt Delete the old AI renders from the sheet
|
|
496
|
+
* @examplePrompt Remove that placed view
|
|
497
|
+
* @examplePrompt Clear the diagram images I placed
|
|
498
|
+
*
|
|
499
|
+
* # Example
|
|
500
|
+
* ```ts
|
|
501
|
+
* const { deleted } = await snaptrude.presentation.placedViews.deleteShapes([
|
|
502
|
+
* out1.shapeId,
|
|
503
|
+
* out2.shapeId,
|
|
504
|
+
* ])
|
|
505
|
+
* ```
|
|
506
|
+
*/
|
|
507
|
+
abstract deleteShapes(shapeIds: string[]): PluginApiReturn<PluginCanvasShapesDeleteResult>;
|
|
508
|
+
/**
|
|
509
|
+
* Set a Present-canvas shape's opacity (`0` transparent .. `1` opaque) —
|
|
510
|
+
* the sidebar's whole-shape opacity slider (distinct from the per-category
|
|
511
|
+
* fill opacity in `updateStyles`). Works for any top-level shape. Undoable.
|
|
512
|
+
* Requires Present mode to be open.
|
|
513
|
+
*
|
|
514
|
+
* @param shapeId - The shape to change.
|
|
515
|
+
* @param opacity - Target opacity, `0`..`1`.
|
|
516
|
+
* @throws If Present mode is not open or `shapeId` is unknown or a sheet.
|
|
517
|
+
*
|
|
518
|
+
* @examplePrompt Fade the placed view to 50%
|
|
519
|
+
* @examplePrompt Make the AI render semi-transparent
|
|
520
|
+
*/
|
|
521
|
+
abstract setOpacity(shapeId: string, opacity: number): PluginApiReturn<void>;
|
|
522
|
+
/**
|
|
523
|
+
* Toggle "mask context buildings" on a placed view — mutes the inactive
|
|
524
|
+
* proposal buildings in the view (the sidebar checkbox). Views only.
|
|
525
|
+
* Undoable. Requires Present mode to be open.
|
|
526
|
+
*
|
|
527
|
+
* @param shapeId - The placed view shape.
|
|
528
|
+
* @param enabled - `true` to mask context buildings.
|
|
529
|
+
* @throws If Present mode is not open or `shapeId` is not a placed view.
|
|
530
|
+
*
|
|
531
|
+
* @examplePrompt Mask the context buildings in this view
|
|
532
|
+
* @examplePrompt Show the neighboring proposals again in the placed view
|
|
533
|
+
*/
|
|
534
|
+
abstract setMask(shapeId: string, enabled: boolean): PluginApiReturn<void>;
|
|
195
535
|
}
|
|
196
536
|
/**
|
|
197
537
|
* A crop window on a placed view, as fractions (0–1) of the **uncropped**
|
|
@@ -226,7 +566,7 @@ export type PluginPlacedViewCrop = z.infer<typeof PluginPlacedViewCrop>;
|
|
|
226
566
|
* | `size` | `{ width: number, height: number }` | Displayed size on the canvas |
|
|
227
567
|
* | `scale` | `number \| null` | Architectural scale (e.g. `100` = 1:100); `null` for 3D views |
|
|
228
568
|
* | `is3d` | `boolean` | Whether it is a 3D view (no architectural scale) |
|
|
229
|
-
* | `rotation` | `number` | Rotation in radians (nonzero only for 3D views) |
|
|
569
|
+
* | `rotation` | `number` | Rotation in radians, `[0, 2π)` (nonzero only for 3D views — 2D views cannot rotate; set with `setRotation`) |
|
|
230
570
|
* | `crop` | {@linkcode PluginPlacedViewCrop}` \| null` | Crop window (`null` when uncropped) |
|
|
231
571
|
* | `isUnlinked` | `boolean` | Whether the source proposal was removed (an unlinked view no longer refreshes) |
|
|
232
572
|
*/
|
|
@@ -367,4 +707,433 @@ export declare const PluginPresentationPlacedViewsSetCropArgs: z.ZodObject<{
|
|
|
367
707
|
}, z.core.$strip>>;
|
|
368
708
|
}, z.core.$strip>;
|
|
369
709
|
export type PluginPresentationPlacedViewsSetCropArgs = z.infer<typeof PluginPresentationPlacedViewsSetCropArgs>;
|
|
710
|
+
/**
|
|
711
|
+
* Arguments for {@linkcode PluginPresentationPlacedViewsApi.setRotation}.
|
|
712
|
+
*
|
|
713
|
+
* | Property | Type | Description |
|
|
714
|
+
* |---|---|---|
|
|
715
|
+
* | `shapeId` | `string` | The placed view shape to rotate |
|
|
716
|
+
* | `rotation` | `number` | Absolute rotation in radians (tldraw convention) |
|
|
717
|
+
*/
|
|
718
|
+
export declare const PluginPresentationPlacedViewsSetRotationArgs: z.ZodObject<{
|
|
719
|
+
shapeId: z.ZodString;
|
|
720
|
+
rotation: z.ZodNumber;
|
|
721
|
+
}, z.core.$strip>;
|
|
722
|
+
export type PluginPresentationPlacedViewsSetRotationArgs = z.infer<typeof PluginPresentationPlacedViewsSetRotationArgs>;
|
|
723
|
+
/**
|
|
724
|
+
* A Present-mode style category — mirrors the host's view-settings CATEGORIES
|
|
725
|
+
* exactly. Sheets/auto-diagrams use the subset Space / Department /
|
|
726
|
+
* Adjacency Line.
|
|
727
|
+
*/
|
|
728
|
+
export declare const PluginViewSettingCategory: z.ZodEnum<{
|
|
729
|
+
Envelope: "Envelope";
|
|
730
|
+
Department: "Department";
|
|
731
|
+
Site: "Site";
|
|
732
|
+
Topography: "Topography";
|
|
733
|
+
Space: "Space";
|
|
734
|
+
"Facade/Mass": "Facade/Mass";
|
|
735
|
+
Dimension: "Dimension";
|
|
736
|
+
"Reference Line": "Reference Line";
|
|
737
|
+
"Adjacency Line": "Adjacency Line";
|
|
738
|
+
"Landscape elements": "Landscape elements";
|
|
739
|
+
}>;
|
|
740
|
+
export type PluginViewSettingCategory = z.infer<typeof PluginViewSettingCategory>;
|
|
741
|
+
/** The 7 line dash styles (mirrors the host's LINE_STYLES). */
|
|
742
|
+
export declare const PluginViewLineStyle: z.ZodEnum<{
|
|
743
|
+
center: "center";
|
|
744
|
+
hidden: "hidden";
|
|
745
|
+
solid: "solid";
|
|
746
|
+
dashed: "dashed";
|
|
747
|
+
dashdot: "dashdot";
|
|
748
|
+
phantom: "phantom";
|
|
749
|
+
propertyLine: "propertyLine";
|
|
750
|
+
}>;
|
|
751
|
+
export type PluginViewLineStyle = z.infer<typeof PluginViewLineStyle>;
|
|
752
|
+
/**
|
|
753
|
+
* A style patch for one category — any subset of the category's settings.
|
|
754
|
+
* Line weights are in **mm** (the printed weight); `opacity` values are 0–100;
|
|
755
|
+
* `colorMode` is `department` / `texture` / `monochrome` or `tag:<tagCategoryId>`
|
|
756
|
+
* (color by a project tag category).
|
|
757
|
+
*
|
|
758
|
+
* | Property | Type | Description |
|
|
759
|
+
* |---|---|---|
|
|
760
|
+
* | `hide` | `boolean`? | Hide the category (cascades to its labels) |
|
|
761
|
+
* | `lineStyle` | {@linkcode PluginViewLineStyle}? | Dash pattern |
|
|
762
|
+
* | `lineColor` | `string`? | Line color, 6-digit hex (`#` optional) |
|
|
763
|
+
* | `dashLength` | `number`? | Dash-length multiplier (> 0; `1` = default) |
|
|
764
|
+
* | `lineWidth` | `number`? | Single line weight in mm (categories without cut/projection) |
|
|
765
|
+
* | `cutWidth` | `number`? | Cut-line weight in mm |
|
|
766
|
+
* | `projectionWidth` | `number`? | Projection-line weight in mm |
|
|
767
|
+
* | `treeLineWidth` | `number`? | Tree line weight in mm (Landscape) |
|
|
768
|
+
* | `parkingLineWidth` | `number`? | Parking line weight in mm (Landscape) |
|
|
769
|
+
* | `colorMode` | `string`? | `department` \| `texture` \| `monochrome` \| `tag:<id>` |
|
|
770
|
+
* | `opacity` | `number`? | Category fill opacity, 0–100 |
|
|
771
|
+
* | `mapOpacity` | `number`? | Topography: map image opacity, 0–100 |
|
|
772
|
+
* | `buildingOpacity` | `number`? | Topography: context-building opacity, 0–100 |
|
|
773
|
+
* | `mapHide` | `boolean`? | Topography: hide the map image |
|
|
774
|
+
* | `buildingHide` | `boolean`? | Topography: hide context buildings |
|
|
775
|
+
* | `noBuilding` | `boolean`? | Topography: suppress buildings entirely |
|
|
776
|
+
* | `viewStyle` | `"NONE" \| "FILLET" \| "BUBBLE"`? | Shape restyle: block / rounded corner / bubble |
|
|
777
|
+
* | `radius` | `number`? | Corner radius for `FILLET` (feet) |
|
|
778
|
+
* | `inset` | `number`? | Shape inset/offset |
|
|
779
|
+
*/
|
|
780
|
+
export declare const PluginPlacedViewStylePatch: z.ZodObject<{
|
|
781
|
+
hide: z.ZodOptional<z.ZodBoolean>;
|
|
782
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
783
|
+
center: "center";
|
|
784
|
+
hidden: "hidden";
|
|
785
|
+
solid: "solid";
|
|
786
|
+
dashed: "dashed";
|
|
787
|
+
dashdot: "dashdot";
|
|
788
|
+
phantom: "phantom";
|
|
789
|
+
propertyLine: "propertyLine";
|
|
790
|
+
}>>;
|
|
791
|
+
lineColor: z.ZodOptional<z.ZodString>;
|
|
792
|
+
dashLength: z.ZodOptional<z.ZodNumber>;
|
|
793
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
794
|
+
cutWidth: z.ZodOptional<z.ZodNumber>;
|
|
795
|
+
projectionWidth: z.ZodOptional<z.ZodNumber>;
|
|
796
|
+
treeLineWidth: z.ZodOptional<z.ZodNumber>;
|
|
797
|
+
parkingLineWidth: z.ZodOptional<z.ZodNumber>;
|
|
798
|
+
colorMode: z.ZodOptional<z.ZodString>;
|
|
799
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
800
|
+
mapOpacity: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
buildingOpacity: z.ZodOptional<z.ZodNumber>;
|
|
802
|
+
mapHide: z.ZodOptional<z.ZodBoolean>;
|
|
803
|
+
buildingHide: z.ZodOptional<z.ZodBoolean>;
|
|
804
|
+
noBuilding: z.ZodOptional<z.ZodBoolean>;
|
|
805
|
+
viewStyle: z.ZodOptional<z.ZodEnum<{
|
|
806
|
+
NONE: "NONE";
|
|
807
|
+
FILLET: "FILLET";
|
|
808
|
+
BUBBLE: "BUBBLE";
|
|
809
|
+
}>>;
|
|
810
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
811
|
+
inset: z.ZodOptional<z.ZodNumber>;
|
|
812
|
+
}, z.core.$strict>;
|
|
813
|
+
export type PluginPlacedViewStylePatch = z.infer<typeof PluginPlacedViewStylePatch>;
|
|
814
|
+
/** Label types that carry typography in a category's Text tab. */
|
|
815
|
+
export declare const PluginViewLabelType: z.ZodEnum<{
|
|
816
|
+
department: "department";
|
|
817
|
+
objectLabels: "objectLabels";
|
|
818
|
+
areas: "areas";
|
|
819
|
+
}>;
|
|
820
|
+
export type PluginViewLabelType = z.infer<typeof PluginViewLabelType>;
|
|
821
|
+
/**
|
|
822
|
+
* Font-styles patch for one category's Text tab.
|
|
823
|
+
*
|
|
824
|
+
* | Property | Type | Description |
|
|
825
|
+
* |---|---|---|
|
|
826
|
+
* | `visibleTypes` | {@linkcode PluginViewLabelType}`[]`? | Which label types render (`[]` hides all) |
|
|
827
|
+
* | `objectLabels` | variant? | Typography for the name label |
|
|
828
|
+
* | `department` | variant? | Typography for the department label |
|
|
829
|
+
* | `areas` | variant? | Typography for the area/tag values |
|
|
830
|
+
*/
|
|
831
|
+
export declare const PluginPlacedViewFontStylesPatch: z.ZodObject<{
|
|
832
|
+
visibleTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
833
|
+
department: "department";
|
|
834
|
+
objectLabels: "objectLabels";
|
|
835
|
+
areas: "areas";
|
|
836
|
+
}>>>;
|
|
837
|
+
objectLabels: z.ZodOptional<z.ZodObject<{
|
|
838
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
839
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
840
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
841
|
+
normal: "normal";
|
|
842
|
+
italic: "italic";
|
|
843
|
+
}>>;
|
|
844
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
845
|
+
}, z.core.$strict>>;
|
|
846
|
+
department: z.ZodOptional<z.ZodObject<{
|
|
847
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
848
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
849
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
850
|
+
normal: "normal";
|
|
851
|
+
italic: "italic";
|
|
852
|
+
}>>;
|
|
853
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
854
|
+
}, z.core.$strict>>;
|
|
855
|
+
areas: z.ZodOptional<z.ZodObject<{
|
|
856
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
857
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
858
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
859
|
+
normal: "normal";
|
|
860
|
+
italic: "italic";
|
|
861
|
+
}>>;
|
|
862
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
863
|
+
}, z.core.$strict>>;
|
|
864
|
+
}, z.core.$strict>;
|
|
865
|
+
export type PluginPlacedViewFontStylesPatch = z.infer<typeof PluginPlacedViewFontStylesPatch>;
|
|
866
|
+
/** Resolved font styles for one label type (fontSize in px). */
|
|
867
|
+
export type PluginViewFontVariant = {
|
|
868
|
+
fontFamily?: string;
|
|
869
|
+
fontWeight?: string;
|
|
870
|
+
fontStyle?: "normal" | "italic";
|
|
871
|
+
fontSize?: number;
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* One category's resolved styles on a placed view or sheet.
|
|
875
|
+
*
|
|
876
|
+
* | Property | Type | Description |
|
|
877
|
+
* |---|---|---|
|
|
878
|
+
* | `category` | {@linkcode PluginViewSettingCategory} | The category |
|
|
879
|
+
* | `disabled` | `boolean` | Not visible in this view — settings are inert |
|
|
880
|
+
* | `supported` | `string[]` | Setting ids this category accepts in `updateStyles` |
|
|
881
|
+
* | `settings` | {@linkcode PluginPlacedViewStylePatch} | Fully-resolved values (defaults + overrides) |
|
|
882
|
+
* | `fontStyles` | object? | Resolved Text-tab typography (absent when the category has no Text tab) |
|
|
883
|
+
*/
|
|
884
|
+
export type PluginPlacedViewCategoryStyles = {
|
|
885
|
+
category: PluginViewSettingCategory;
|
|
886
|
+
disabled: boolean;
|
|
887
|
+
supported: string[];
|
|
888
|
+
settings: PluginPlacedViewStylePatch;
|
|
889
|
+
fontStyles?: {
|
|
890
|
+
visibleTypes: PluginViewLabelType[];
|
|
891
|
+
objectLabels?: PluginViewFontVariant;
|
|
892
|
+
department?: PluginViewFontVariant;
|
|
893
|
+
areas?: PluginViewFontVariant;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
/**
|
|
897
|
+
* Result of {@link PluginPresentationPlacedViewsApi.getStyles}.
|
|
898
|
+
*
|
|
899
|
+
* | Property | Type | Description |
|
|
900
|
+
* |---|---|---|
|
|
901
|
+
* | `shapeId` | `string` | The styleable shape read |
|
|
902
|
+
* | `kind` | `"view" \| "sheet"` | Placed view or auto-diagram sheet |
|
|
903
|
+
* | `categories` | {@linkcode PluginPlacedViewCategoryStyles}`[]` | One entry per applicable category |
|
|
904
|
+
*/
|
|
905
|
+
export type PluginPlacedViewStylesResult = {
|
|
906
|
+
shapeId: string;
|
|
907
|
+
kind: "view" | "sheet";
|
|
908
|
+
categories: PluginPlacedViewCategoryStyles[];
|
|
909
|
+
};
|
|
910
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.updateStyles}. */
|
|
911
|
+
export declare const PluginPlacedViewsUpdateStylesArgs: z.ZodObject<{
|
|
912
|
+
shapeId: z.ZodString;
|
|
913
|
+
category: z.ZodEnum<{
|
|
914
|
+
Envelope: "Envelope";
|
|
915
|
+
Department: "Department";
|
|
916
|
+
Site: "Site";
|
|
917
|
+
Topography: "Topography";
|
|
918
|
+
Space: "Space";
|
|
919
|
+
"Facade/Mass": "Facade/Mass";
|
|
920
|
+
Dimension: "Dimension";
|
|
921
|
+
"Reference Line": "Reference Line";
|
|
922
|
+
"Adjacency Line": "Adjacency Line";
|
|
923
|
+
"Landscape elements": "Landscape elements";
|
|
924
|
+
}>;
|
|
925
|
+
patch: z.ZodObject<{
|
|
926
|
+
hide: z.ZodOptional<z.ZodBoolean>;
|
|
927
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
928
|
+
center: "center";
|
|
929
|
+
hidden: "hidden";
|
|
930
|
+
solid: "solid";
|
|
931
|
+
dashed: "dashed";
|
|
932
|
+
dashdot: "dashdot";
|
|
933
|
+
phantom: "phantom";
|
|
934
|
+
propertyLine: "propertyLine";
|
|
935
|
+
}>>;
|
|
936
|
+
lineColor: z.ZodOptional<z.ZodString>;
|
|
937
|
+
dashLength: z.ZodOptional<z.ZodNumber>;
|
|
938
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
939
|
+
cutWidth: z.ZodOptional<z.ZodNumber>;
|
|
940
|
+
projectionWidth: z.ZodOptional<z.ZodNumber>;
|
|
941
|
+
treeLineWidth: z.ZodOptional<z.ZodNumber>;
|
|
942
|
+
parkingLineWidth: z.ZodOptional<z.ZodNumber>;
|
|
943
|
+
colorMode: z.ZodOptional<z.ZodString>;
|
|
944
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
945
|
+
mapOpacity: z.ZodOptional<z.ZodNumber>;
|
|
946
|
+
buildingOpacity: z.ZodOptional<z.ZodNumber>;
|
|
947
|
+
mapHide: z.ZodOptional<z.ZodBoolean>;
|
|
948
|
+
buildingHide: z.ZodOptional<z.ZodBoolean>;
|
|
949
|
+
noBuilding: z.ZodOptional<z.ZodBoolean>;
|
|
950
|
+
viewStyle: z.ZodOptional<z.ZodEnum<{
|
|
951
|
+
NONE: "NONE";
|
|
952
|
+
FILLET: "FILLET";
|
|
953
|
+
BUBBLE: "BUBBLE";
|
|
954
|
+
}>>;
|
|
955
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
956
|
+
inset: z.ZodOptional<z.ZodNumber>;
|
|
957
|
+
}, z.core.$strict>;
|
|
958
|
+
}, z.core.$strip>;
|
|
959
|
+
export type PluginPlacedViewsUpdateStylesArgs = z.infer<typeof PluginPlacedViewsUpdateStylesArgs>;
|
|
960
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.updateFontStyles}. */
|
|
961
|
+
export declare const PluginPlacedViewsUpdateFontStylesArgs: z.ZodObject<{
|
|
962
|
+
shapeId: z.ZodString;
|
|
963
|
+
category: z.ZodEnum<{
|
|
964
|
+
Envelope: "Envelope";
|
|
965
|
+
Department: "Department";
|
|
966
|
+
Site: "Site";
|
|
967
|
+
Topography: "Topography";
|
|
968
|
+
Space: "Space";
|
|
969
|
+
"Facade/Mass": "Facade/Mass";
|
|
970
|
+
Dimension: "Dimension";
|
|
971
|
+
"Reference Line": "Reference Line";
|
|
972
|
+
"Adjacency Line": "Adjacency Line";
|
|
973
|
+
"Landscape elements": "Landscape elements";
|
|
974
|
+
}>;
|
|
975
|
+
patch: z.ZodObject<{
|
|
976
|
+
visibleTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
977
|
+
department: "department";
|
|
978
|
+
objectLabels: "objectLabels";
|
|
979
|
+
areas: "areas";
|
|
980
|
+
}>>>;
|
|
981
|
+
objectLabels: z.ZodOptional<z.ZodObject<{
|
|
982
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
983
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
984
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
985
|
+
normal: "normal";
|
|
986
|
+
italic: "italic";
|
|
987
|
+
}>>;
|
|
988
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
989
|
+
}, z.core.$strict>>;
|
|
990
|
+
department: z.ZodOptional<z.ZodObject<{
|
|
991
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
992
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
993
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
994
|
+
normal: "normal";
|
|
995
|
+
italic: "italic";
|
|
996
|
+
}>>;
|
|
997
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
998
|
+
}, z.core.$strict>>;
|
|
999
|
+
areas: z.ZodOptional<z.ZodObject<{
|
|
1000
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1001
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
1002
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
1003
|
+
normal: "normal";
|
|
1004
|
+
italic: "italic";
|
|
1005
|
+
}>>;
|
|
1006
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
1007
|
+
}, z.core.$strict>>;
|
|
1008
|
+
}, z.core.$strict>;
|
|
1009
|
+
}, z.core.$strip>;
|
|
1010
|
+
export type PluginPlacedViewsUpdateFontStylesArgs = z.infer<typeof PluginPlacedViewsUpdateFontStylesArgs>;
|
|
1011
|
+
/**
|
|
1012
|
+
* A label on a placed view — a text child generated from the view content.
|
|
1013
|
+
*
|
|
1014
|
+
* | Property | Type | Description |
|
|
1015
|
+
* |---|---|---|
|
|
1016
|
+
* | `labelId` | `string` | The label's shape id (addressable in `moveLabel`/`setLabelHidden`) |
|
|
1017
|
+
* | `category` | `string \| null` | The style category it belongs to (`null` when untagged) |
|
|
1018
|
+
* | `text` | `string` | The rendered text |
|
|
1019
|
+
* | `position` | {@linkcode PluginSheetPosition} | Position relative to the placed view |
|
|
1020
|
+
* | `scale` | `number` | The label's scale factor |
|
|
1021
|
+
* | `hidden` | `boolean` | Whether it is currently hidden |
|
|
1022
|
+
*/
|
|
1023
|
+
export type PluginPlacedViewLabel = {
|
|
1024
|
+
labelId: string;
|
|
1025
|
+
category: string | null;
|
|
1026
|
+
text: string;
|
|
1027
|
+
position: PluginSheetPosition;
|
|
1028
|
+
scale: number;
|
|
1029
|
+
hidden: boolean;
|
|
1030
|
+
};
|
|
1031
|
+
/** Result of {@link PluginPresentationPlacedViewsApi.listLabels}. */
|
|
1032
|
+
export type PluginPlacedViewLabelsResult = {
|
|
1033
|
+
labels: PluginPlacedViewLabel[];
|
|
1034
|
+
};
|
|
1035
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.moveLabel}. */
|
|
1036
|
+
export declare const PluginPlacedViewsMoveLabelArgs: z.ZodObject<{
|
|
1037
|
+
labelId: z.ZodString;
|
|
1038
|
+
position: z.ZodObject<{
|
|
1039
|
+
x: z.ZodNumber;
|
|
1040
|
+
y: z.ZodNumber;
|
|
1041
|
+
}, z.core.$strip>;
|
|
1042
|
+
}, z.core.$strip>;
|
|
1043
|
+
export type PluginPlacedViewsMoveLabelArgs = z.infer<typeof PluginPlacedViewsMoveLabelArgs>;
|
|
1044
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.setLabelHidden}. */
|
|
1045
|
+
export declare const PluginPlacedViewsSetLabelHiddenArgs: z.ZodObject<{
|
|
1046
|
+
labelId: z.ZodString;
|
|
1047
|
+
hidden: z.ZodBoolean;
|
|
1048
|
+
}, z.core.$strip>;
|
|
1049
|
+
export type PluginPlacedViewsSetLabelHiddenArgs = z.infer<typeof PluginPlacedViewsSetLabelHiddenArgs>;
|
|
1050
|
+
/**
|
|
1051
|
+
* Origin classification of a Present-canvas shape: a placed view, an
|
|
1052
|
+
* AI-generated output, a placed diagram image, a plugin-created shape, a
|
|
1053
|
+
* user annotation, a plain image, or other.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare const PluginCanvasShapeOrigin: z.ZodEnum<{
|
|
1056
|
+
image: "image";
|
|
1057
|
+
view: "view";
|
|
1058
|
+
aiOutput: "aiOutput";
|
|
1059
|
+
diagram: "diagram";
|
|
1060
|
+
pluginShape: "pluginShape";
|
|
1061
|
+
annotation: "annotation";
|
|
1062
|
+
other: "other";
|
|
1063
|
+
}>;
|
|
1064
|
+
export type PluginCanvasShapeOrigin = z.infer<typeof PluginCanvasShapeOrigin>;
|
|
1065
|
+
/**
|
|
1066
|
+
* A top-level shape on the Present canvas.
|
|
1067
|
+
*
|
|
1068
|
+
* | Property | Type | Description |
|
|
1069
|
+
* |---|---|---|
|
|
1070
|
+
* | `shapeId` | `string` | The shape id |
|
|
1071
|
+
* | `type` | `string` | The canvas shape type (`view`, `image`, `geo`, `text`, …) |
|
|
1072
|
+
* | `origin` | {@linkcode PluginCanvasShapeOrigin} | What created it |
|
|
1073
|
+
* | `sheetId` | `string \| null` | The sheet it sits on (`null` when loose on the canvas) |
|
|
1074
|
+
* | `position` | {@linkcode PluginSheetPosition} | Top-left position (sheet-local; page coordinates off-sheet) |
|
|
1075
|
+
* | `size` | `{ width: number, height: number }` | Displayed size |
|
|
1076
|
+
* | `rotation` | `number` | Rotation in radians |
|
|
1077
|
+
* | `opacity` | `number` | Whole-shape opacity, 0–1 |
|
|
1078
|
+
*/
|
|
1079
|
+
export type PluginCanvasShape = {
|
|
1080
|
+
shapeId: string;
|
|
1081
|
+
type: string;
|
|
1082
|
+
origin: PluginCanvasShapeOrigin;
|
|
1083
|
+
sheetId: string | null;
|
|
1084
|
+
position: PluginSheetPosition;
|
|
1085
|
+
size: {
|
|
1086
|
+
width: number;
|
|
1087
|
+
height: number;
|
|
1088
|
+
};
|
|
1089
|
+
rotation: number;
|
|
1090
|
+
opacity: number;
|
|
1091
|
+
};
|
|
1092
|
+
/** Result of {@link PluginPresentationPlacedViewsApi.listShapes}. */
|
|
1093
|
+
export type PluginCanvasShapesListResult = {
|
|
1094
|
+
shapes: PluginCanvasShape[];
|
|
1095
|
+
};
|
|
1096
|
+
/** Result of {@link PluginPresentationPlacedViewsApi.deleteShapes}. */
|
|
1097
|
+
export type PluginCanvasShapesDeleteResult = {
|
|
1098
|
+
deleted: string[];
|
|
1099
|
+
};
|
|
1100
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.moveShape}. */
|
|
1101
|
+
export declare const PluginPlacedViewsMoveShapeArgs: z.ZodObject<{
|
|
1102
|
+
shapeId: z.ZodString;
|
|
1103
|
+
position: z.ZodObject<{
|
|
1104
|
+
x: z.ZodNumber;
|
|
1105
|
+
y: z.ZodNumber;
|
|
1106
|
+
}, z.core.$strip>;
|
|
1107
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
1108
|
+
}, z.core.$strip>;
|
|
1109
|
+
export type PluginPlacedViewsMoveShapeArgs = z.infer<typeof PluginPlacedViewsMoveShapeArgs>;
|
|
1110
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.resizeShape}. */
|
|
1111
|
+
export declare const PluginPlacedViewsResizeShapeArgs: z.ZodObject<{
|
|
1112
|
+
shapeId: z.ZodString;
|
|
1113
|
+
factor: z.ZodNumber;
|
|
1114
|
+
}, z.core.$strip>;
|
|
1115
|
+
export type PluginPlacedViewsResizeShapeArgs = z.infer<typeof PluginPlacedViewsResizeShapeArgs>;
|
|
1116
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.rotateShape}. */
|
|
1117
|
+
export declare const PluginPresentationPlacedViewsRotateShapeArgs: z.ZodObject<{
|
|
1118
|
+
shapeId: z.ZodString;
|
|
1119
|
+
rotation: z.ZodNumber;
|
|
1120
|
+
}, z.core.$strip>;
|
|
1121
|
+
export type PluginPresentationPlacedViewsRotateShapeArgs = z.infer<typeof PluginPresentationPlacedViewsRotateShapeArgs>;
|
|
1122
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.deleteShapes}. */
|
|
1123
|
+
export declare const PluginPlacedViewsDeleteShapesArgs: z.ZodObject<{
|
|
1124
|
+
shapeIds: z.ZodArray<z.ZodString>;
|
|
1125
|
+
}, z.core.$strip>;
|
|
1126
|
+
export type PluginPlacedViewsDeleteShapesArgs = z.infer<typeof PluginPlacedViewsDeleteShapesArgs>;
|
|
1127
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.setOpacity}. */
|
|
1128
|
+
export declare const PluginPlacedViewsSetOpacityArgs: z.ZodObject<{
|
|
1129
|
+
shapeId: z.ZodString;
|
|
1130
|
+
opacity: z.ZodNumber;
|
|
1131
|
+
}, z.core.$strip>;
|
|
1132
|
+
export type PluginPlacedViewsSetOpacityArgs = z.infer<typeof PluginPlacedViewsSetOpacityArgs>;
|
|
1133
|
+
/** Arguments for {@link PluginPresentationPlacedViewsApi.setMask}. */
|
|
1134
|
+
export declare const PluginPlacedViewsSetMaskArgs: z.ZodObject<{
|
|
1135
|
+
shapeId: z.ZodString;
|
|
1136
|
+
enabled: z.ZodBoolean;
|
|
1137
|
+
}, z.core.$strip>;
|
|
1138
|
+
export type PluginPlacedViewsSetMaskArgs = z.infer<typeof PluginPlacedViewsSetMaskArgs>;
|
|
370
1139
|
//# sourceMappingURL=placedViews.d.ts.map
|