@snaptrude/plugin-core 0.9.14 → 0.9.16
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 +28 -0
- package/api-manifest.json +527 -26
- package/dist/api/core/camera/index.d.ts +418 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +12 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +3 -3
- package/dist/api/design/create/bulk-items.d.ts +44 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +31 -3
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +2 -2
- package/dist/api/design/update/index.d.ts +73 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +13 -13
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +14 -0
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1 -1
- package/dist/api/presentation/views.d.ts +3 -1
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +1350 -0
- package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
- package/dist/index.cjs +3162 -2553
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3077 -2550
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +400 -1
- package/src/api/core/index.ts +4 -4
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +14 -0
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/design/create/bulk-items.ts +68 -0
- package/src/api/design/create/index.ts +30 -4
- package/src/api/design/update/index.ts +80 -1
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/index.ts +14 -0
- package/src/api/presentation/views.ts +3 -1
- package/src/api/presentation/walkthroughs.ts +1201 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
import { PluginPresentationImageFormat } from "./views";
|
|
4
|
+
/**
|
|
5
|
+
* The Present-mode canvas camera — the Present-mode twin of
|
|
6
|
+
* {@linkcode PluginCameraApi} (`core.camera`).
|
|
7
|
+
*
|
|
8
|
+
* Present mode lays sheets out on an infinite 2D canvas; its camera is a pan
|
|
9
|
+
* (`x`, `y`) and a `zoom`. A plugin can screenshot what that canvas currently
|
|
10
|
+
* shows, read the camera, pan/zoom it, or frame all sheets or one shape.
|
|
11
|
+
*
|
|
12
|
+
* These are transient VIEW-STATE changes: not model edits, so they are not
|
|
13
|
+
* write-gated and not undoable. Every method requires **Present mode to be
|
|
14
|
+
* open** (the documentation editor) and throws `PRECONDITION_FAILED` when it is
|
|
15
|
+
* closed. `capture` is the Present-mode counterpart of
|
|
16
|
+
* {@linkcode PluginPresentationViewsApi.capture}, which shoots the Design
|
|
17
|
+
* (3D) canvas; for whole sheets at their own size use
|
|
18
|
+
* {@linkcode PluginPresentationApi.export}.
|
|
19
|
+
*
|
|
20
|
+
* Coordinates are Present canvas page units (pixels at 100% zoom), the same
|
|
21
|
+
* space `sheets`, `placedViews` and `shapes` report positions in. `zoom` is a
|
|
22
|
+
* factor: `1` = 100%, `0.5` = zoomed out to half size.
|
|
23
|
+
*
|
|
24
|
+
* Accessed via `snaptrude.presentation.camera`.
|
|
25
|
+
*/
|
|
26
|
+
export declare abstract class PluginPresentationCameraApi {
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Screenshot what the Present canvas currently shows.
|
|
30
|
+
*
|
|
31
|
+
* Captures exactly the visible area — the canvas as clipped by the window,
|
|
32
|
+
* minus the strip under the floating left sidebar — at the current pan and
|
|
33
|
+
* zoom, rendered
|
|
34
|
+
* through the same pipeline as the Present-mode Export dialog, so sheets,
|
|
35
|
+
* placed views, text, annotations and imported images look as they do on
|
|
36
|
+
* screen. Selection handles, cursors and the UI itself are not part of the
|
|
37
|
+
* image. Nothing on screen still yields an image (the export backdrop).
|
|
38
|
+
* Export-pipeline details, as in the Export dialog: sheet frames themselves
|
|
39
|
+
* are not drawn (no paper, margin guides or name label — editor chrome), the
|
|
40
|
+
* backdrop is tldraw's near-white export backdrop rather than the on-screen
|
|
41
|
+
* canvas grey, and with exactly one sheet in view it is white. Only the left
|
|
42
|
+
* sidebar is subtracted from the view; floating right-hand panels are not.
|
|
43
|
+
*
|
|
44
|
+
* @param options - All optional: `format` (`"png"` default, or `"jpeg"`),
|
|
45
|
+
* `pixelRatio` (output pixels per screen pixel, `1`–`4`, default `1`;
|
|
46
|
+
* `2` for a retina-sharp image).
|
|
47
|
+
* @returns A {@linkcode PluginPresentationCameraCaptureResult}: the base64
|
|
48
|
+
* data URL and its pixel size.
|
|
49
|
+
* @throws If Present mode is not open.
|
|
50
|
+
*
|
|
51
|
+
* @examplePrompt Take a screenshot of the Present canvas
|
|
52
|
+
* @examplePrompt Capture what I am looking at in Present mode
|
|
53
|
+
* @examplePrompt Screenshot the presentation canvas as a JPEG
|
|
54
|
+
* @examplePrompt Grab a high-res image of the current sheet view
|
|
55
|
+
*
|
|
56
|
+
* # Example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const { image, width, height } = await snaptrude.presentation.camera.capture({
|
|
59
|
+
* format: "png",
|
|
60
|
+
* pixelRatio: 2,
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
abstract capture(options?: {
|
|
65
|
+
format?: PluginPresentationImageFormat;
|
|
66
|
+
pixelRatio?: number;
|
|
67
|
+
}): PluginApiReturn<PluginPresentationCameraCaptureResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Read the Present camera: pan, zoom, the visible page-space rectangle and
|
|
70
|
+
* the sheet under the centre of the view.
|
|
71
|
+
*
|
|
72
|
+
* @returns The current {@linkcode PluginPresentationCameraState}.
|
|
73
|
+
* @throws If Present mode is not open.
|
|
74
|
+
*
|
|
75
|
+
* @examplePrompt Where is the Present canvas camera?
|
|
76
|
+
* @examplePrompt What zoom level is Present mode at?
|
|
77
|
+
* @examplePrompt Which sheet is on screen right now?
|
|
78
|
+
* @examplePrompt Read the visible area of the presentation canvas
|
|
79
|
+
*
|
|
80
|
+
* # Example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const { zoom, sheetId } = await snaptrude.presentation.camera.get()
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
abstract get(): PluginApiReturn<PluginPresentationCameraState>;
|
|
86
|
+
/**
|
|
87
|
+
* Pan and/or zoom the Present canvas. Fields left out keep their current
|
|
88
|
+
* value, so `{ zoom: 2 }` changes only the zoom (the page point at the
|
|
89
|
+
* viewport's top-left corner stays put) and `{ x, y }` pans at the current
|
|
90
|
+
* zoom. `zoom` is clamped to the editor's range (1% to 1000%); the requested
|
|
91
|
+
* `x`/`y` are always honoured. Immediate (no animation). View-state only —
|
|
92
|
+
* not undoable.
|
|
93
|
+
*
|
|
94
|
+
* `x`/`y` are the camera offset in page units: the page point that lands at
|
|
95
|
+
* the viewport's top-left corner is `(-x, -y)`. Read them back from
|
|
96
|
+
* {@linkcode PluginPresentationCameraApi.get} to reproduce a framing later.
|
|
97
|
+
*
|
|
98
|
+
* @param camera - Any of `x`, `y`, `zoom` ({@linkcode PluginPresentationCameraSetArgs}); at least one.
|
|
99
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
100
|
+
* @throws If Present mode is not open, or another Present-mode control has
|
|
101
|
+
* locked the camera (an open style dropdown, AI Inspiration's layout mode).
|
|
102
|
+
*
|
|
103
|
+
* @examplePrompt Zoom the Present canvas to 50%
|
|
104
|
+
* @examplePrompt Pan the presentation canvas to the right
|
|
105
|
+
* @examplePrompt Restore the Present camera I saved earlier
|
|
106
|
+
* @examplePrompt Set the Present zoom to 200% without moving
|
|
107
|
+
*
|
|
108
|
+
* # Example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const saved = await snaptrude.presentation.camera.get()
|
|
111
|
+
* await snaptrude.presentation.camera.set({ zoom: 0.5 })
|
|
112
|
+
* // …later, restore the exact framing
|
|
113
|
+
* await snaptrude.presentation.camera.set({ x: saved.x, y: saved.y, zoom: saved.zoom })
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
abstract set(camera: {
|
|
117
|
+
x?: number;
|
|
118
|
+
y?: number;
|
|
119
|
+
zoom?: number;
|
|
120
|
+
}): PluginApiReturn<PluginPresentationCameraState>;
|
|
121
|
+
/**
|
|
122
|
+
* Frame everything on the Present canvas — every sheet and loose shape — the
|
|
123
|
+
* Present-mode "zoom to fit". View-state only — not undoable.
|
|
124
|
+
*
|
|
125
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
126
|
+
* @throws If Present mode is not open, or the camera is locked.
|
|
127
|
+
*
|
|
128
|
+
* @examplePrompt Zoom out to see all the sheets
|
|
129
|
+
* @examplePrompt Fit the whole presentation in the Present view
|
|
130
|
+
* @examplePrompt Zoom to fit in Present mode
|
|
131
|
+
*
|
|
132
|
+
* # Example
|
|
133
|
+
* ```ts
|
|
134
|
+
* await snaptrude.presentation.camera.zoomToFit()
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
abstract zoomToFit(): PluginApiReturn<PluginPresentationCameraState>;
|
|
138
|
+
/**
|
|
139
|
+
* Frame one shape on the Present canvas: a sheet, a placed view, a keyed
|
|
140
|
+
* shape or an annotation — any id the other `presentation` namespaces hand
|
|
141
|
+
* out. Pair with {@linkcode PluginPresentationCameraApi.capture} to
|
|
142
|
+
* screenshot a single sheet or placed view as it appears on screen.
|
|
143
|
+
* Immediate, unlike `sheets.setActive`, which animates its move over half a
|
|
144
|
+
* second. View-state only — not undoable.
|
|
145
|
+
*
|
|
146
|
+
* @param shapeId - The id of the sheet or shape to frame.
|
|
147
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
148
|
+
* @throws If Present mode is not open, the id is unknown, or the camera is locked.
|
|
149
|
+
*
|
|
150
|
+
* @examplePrompt Zoom in on sheet 2 in Present mode
|
|
151
|
+
* @examplePrompt Frame this placed view on the Present canvas
|
|
152
|
+
* @examplePrompt Go to the cover sheet and screenshot it
|
|
153
|
+
* @examplePrompt Centre the presentation view on that table
|
|
154
|
+
*
|
|
155
|
+
* # Example
|
|
156
|
+
* ```ts
|
|
157
|
+
* const { sheets } = await snaptrude.presentation.sheets.list()
|
|
158
|
+
* await snaptrude.presentation.camera.zoomTo(sheets[1].id)
|
|
159
|
+
* const { image } = await snaptrude.presentation.camera.capture()
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
abstract zoomTo(shapeId: string): PluginApiReturn<PluginPresentationCameraState>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The visible area of the Present canvas in page units — the canvas as
|
|
166
|
+
* clipped by the window, minus the strip under the floating left sidebar.
|
|
167
|
+
*
|
|
168
|
+
* | Property | Type | Description |
|
|
169
|
+
* |---|---|---|
|
|
170
|
+
* | `x` | `number` | Left edge (page units) |
|
|
171
|
+
* | `y` | `number` | Top edge (page units) |
|
|
172
|
+
* | `width` | `number` | Width (page units) |
|
|
173
|
+
* | `height` | `number` | Height (page units) |
|
|
174
|
+
*/
|
|
175
|
+
export declare const PluginPresentationCameraViewport: z.ZodObject<{
|
|
176
|
+
x: z.ZodNumber;
|
|
177
|
+
y: z.ZodNumber;
|
|
178
|
+
width: z.ZodNumber;
|
|
179
|
+
height: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export type PluginPresentationCameraViewport = z.infer<typeof PluginPresentationCameraViewport>;
|
|
182
|
+
/**
|
|
183
|
+
* The Present canvas camera as returned by every
|
|
184
|
+
* {@linkcode PluginPresentationCameraApi} method.
|
|
185
|
+
*
|
|
186
|
+
* | Property | Type | Description |
|
|
187
|
+
* |---|---|---|
|
|
188
|
+
* | `x` | `number` | Camera pan offset (page units): the page point at the tldraw viewport's top-left corner (under the sidebar) is `(-x, -y)` |
|
|
189
|
+
* | `y` | `number` | Camera pan offset (page units) |
|
|
190
|
+
* | `zoom` | `number` | Zoom factor, `1` = 100% |
|
|
191
|
+
* | `viewport` | {@linkcode PluginPresentationCameraViewport} | The visible page-space rectangle |
|
|
192
|
+
* | `sheetId` | `string \| null` | The sheet under the centre of the view, or `null` when none |
|
|
193
|
+
*/
|
|
194
|
+
export declare const PluginPresentationCameraState: z.ZodObject<{
|
|
195
|
+
x: z.ZodNumber;
|
|
196
|
+
y: z.ZodNumber;
|
|
197
|
+
zoom: z.ZodNumber;
|
|
198
|
+
viewport: z.ZodObject<{
|
|
199
|
+
x: z.ZodNumber;
|
|
200
|
+
y: z.ZodNumber;
|
|
201
|
+
width: z.ZodNumber;
|
|
202
|
+
height: z.ZodNumber;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
sheetId: z.ZodNullable<z.ZodString>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type PluginPresentationCameraState = z.infer<typeof PluginPresentationCameraState>;
|
|
207
|
+
/**
|
|
208
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.set}. All optional, at
|
|
209
|
+
* least one required; omitted fields keep their current value.
|
|
210
|
+
*
|
|
211
|
+
* | Property | Type | Description |
|
|
212
|
+
* |---|---|---|
|
|
213
|
+
* | `x` | `number \| undefined` | Camera pan offset (page units) |
|
|
214
|
+
* | `y` | `number \| undefined` | Camera pan offset (page units) |
|
|
215
|
+
* | `zoom` | `number \| undefined` | Zoom factor, `> 0` (`1` = 100%); clamped to the editor's range (`0.01`–`10`), `x`/`y` still honoured |
|
|
216
|
+
*/
|
|
217
|
+
export declare const PluginPresentationCameraSetArgs: z.ZodObject<{
|
|
218
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
zoom: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
export type PluginPresentationCameraSetArgs = z.infer<typeof PluginPresentationCameraSetArgs>;
|
|
223
|
+
/**
|
|
224
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.zoomTo}.
|
|
225
|
+
*
|
|
226
|
+
* | Property | Type | Description |
|
|
227
|
+
* |---|---|---|
|
|
228
|
+
* | `shapeId` | `string` | The sheet or shape to frame |
|
|
229
|
+
*/
|
|
230
|
+
export declare const PluginPresentationCameraZoomToArgs: z.ZodObject<{
|
|
231
|
+
shapeId: z.ZodString;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type PluginPresentationCameraZoomToArgs = z.infer<typeof PluginPresentationCameraZoomToArgs>;
|
|
234
|
+
/**
|
|
235
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.capture}. All optional.
|
|
236
|
+
*
|
|
237
|
+
* | Property | Type | Description |
|
|
238
|
+
* |---|---|---|
|
|
239
|
+
* | `format` | `"png" \| "jpeg" \| undefined` | Output image format (default `"png"`) |
|
|
240
|
+
* | `pixelRatio` | `number \| undefined` | Output pixels per screen pixel, `1`–`4` (default `1`) |
|
|
241
|
+
*/
|
|
242
|
+
export declare const PluginPresentationCameraCaptureArgs: z.ZodObject<{
|
|
243
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
png: "png";
|
|
245
|
+
jpeg: "jpeg";
|
|
246
|
+
}>>;
|
|
247
|
+
pixelRatio: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export type PluginPresentationCameraCaptureArgs = z.infer<typeof PluginPresentationCameraCaptureArgs>;
|
|
250
|
+
/**
|
|
251
|
+
* Result of {@linkcode PluginPresentationCameraApi.capture}.
|
|
252
|
+
*
|
|
253
|
+
* | Property | Type | Description |
|
|
254
|
+
* |---|---|---|
|
|
255
|
+
* | `image` | `string` | The screenshot as a base64 data URL (`data:image/png;base64,…`) |
|
|
256
|
+
* | `width` | `number` | Image width in pixels |
|
|
257
|
+
* | `height` | `number` | Image height in pixels |
|
|
258
|
+
*/
|
|
259
|
+
export declare const PluginPresentationCameraCaptureResult: z.ZodObject<{
|
|
260
|
+
image: z.ZodString;
|
|
261
|
+
width: z.ZodNumber;
|
|
262
|
+
height: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export type PluginPresentationCameraCaptureResult = z.infer<typeof PluginPresentationCameraCaptureResult>;
|
|
265
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/camera.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,2BAA2B;;IAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;aACa,OAAO,CAAC,OAAO,CAAC,EAAE;QAChC,MAAM,CAAC,EAAE,6BAA6B,CAAA;QACtC,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,GAAG,eAAe,CAAC,qCAAqC,CAAC;IAE1D;;;;;;;;;;;;;;;;OAgBG;aACa,GAAG,IAAI,eAAe,CAAC,6BAA6B,CAAC;IAErE;;;;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CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginApiReturn } from "../../types";
|
|
2
2
|
import { PluginPresentationViewsApi } from "./views";
|
|
3
|
+
import { PluginPresentationCameraApi } from "./camera";
|
|
3
4
|
import { PluginPresentationAIInspirationApi } from "./aiInspiration";
|
|
4
5
|
import { PluginPresentationSheetsApi } from "./sheets";
|
|
5
6
|
import { PluginPresentationPlacedViewsApi } from "./placedViews";
|
|
@@ -9,6 +10,7 @@ import { PluginPresentationShapesApi } from "./shapes";
|
|
|
9
10
|
import { PluginPresentationTablesApi } from "./tables";
|
|
10
11
|
import { PluginPresentationSlideshowApi } from "./slideshow";
|
|
11
12
|
import { PluginPresentationImportApi } from "./import";
|
|
13
|
+
import { PluginPresentationWalkthroughsApi } from "./walkthroughs";
|
|
12
14
|
import { PluginPresentationExportResult, type PluginPresentationExportFormat, type PluginPresentationExportResolution } from "./export";
|
|
13
15
|
/**
|
|
14
16
|
* Presentation APIs — prepare and assemble presentations.
|
|
@@ -21,6 +23,7 @@ import { PluginPresentationExportResult, type PluginPresentationExportFormat, ty
|
|
|
21
23
|
* sheets, diagram placement, and import.
|
|
22
24
|
*
|
|
23
25
|
* - {@linkcode PluginPresentationApi.views} — Saved 2D/3D views (list, get, capture, activate, create)
|
|
26
|
+
* - {@linkcode PluginPresentationApi.camera} — The Present canvas camera (screenshot, pan/zoom, frame sheets)
|
|
24
27
|
* - {@linkcode PluginPresentationApi.sheets} — Layout sheets (list, get, create, place views)
|
|
25
28
|
* - {@linkcode PluginPresentationApi.placedViews} — Views already placed on the canvas (move, scale, crop)
|
|
26
29
|
* - {@linkcode PluginPresentationApi.diagrams} — Generate program/site diagram sheets, place diagram images
|
|
@@ -28,12 +31,15 @@ import { PluginPresentationExportResult, type PluginPresentationExportFormat, ty
|
|
|
28
31
|
* - {@linkcode PluginPresentationApi.slideshow} — Run the Present-mode slideshow
|
|
29
32
|
* - {@linkcode PluginPresentationApi.import} — Import reference images/PDFs onto the canvas
|
|
30
33
|
* - {@linkcode PluginPresentationApi.aiInspiration} — Present-mode AI image/video generation
|
|
34
|
+
* - {@linkcode PluginPresentationApi.walkthroughs} — Camera paths through the model: create, play, capture, export as video
|
|
31
35
|
*
|
|
32
36
|
* Accessed via `snaptrude.presentation`.
|
|
33
37
|
*/
|
|
34
38
|
export declare abstract class PluginPresentationApi {
|
|
35
39
|
/** Saved 2D/3D views. See {@linkcode PluginPresentationViewsApi}. */
|
|
36
40
|
abstract views: PluginPresentationViewsApi;
|
|
41
|
+
/** The Present canvas camera — screenshot what is on screen, read/pan/zoom it, frame sheets (Present mode). See {@linkcode PluginPresentationCameraApi}. */
|
|
42
|
+
abstract camera: PluginPresentationCameraApi;
|
|
37
43
|
/** Layout sheets — list/get/create and place views (Present mode). See {@linkcode PluginPresentationSheetsApi}. */
|
|
38
44
|
abstract sheets: PluginPresentationSheetsApi;
|
|
39
45
|
/** Placed views — layout of the view shapes on the canvas: move/scale/setScale/setCrop (Present mode). See {@linkcode PluginPresentationPlacedViewsApi}. */
|
|
@@ -55,6 +61,12 @@ export declare abstract class PluginPresentationApi {
|
|
|
55
61
|
* {@linkcode PluginPresentationAIInspirationApi}.
|
|
56
62
|
*/
|
|
57
63
|
abstract aiInspiration: PluginPresentationAIInspirationApi;
|
|
64
|
+
/**
|
|
65
|
+
* Walkthroughs — camera paths through the model: create (keyframes, floor
|
|
66
|
+
* points, camera-move presets), play, capture and export as video onto the
|
|
67
|
+
* Present canvas. See {@linkcode PluginPresentationWalkthroughsApi}.
|
|
68
|
+
*/
|
|
69
|
+
abstract walkthroughs: PluginPresentationWalkthroughsApi;
|
|
58
70
|
/**
|
|
59
71
|
* Export the presentation's layout sheets to a downloadable file (PDF / PNG /
|
|
60
72
|
* JPG) and return the encoded bytes as base64. Wraps the Present-mode Export
|
|
@@ -89,6 +101,7 @@ export declare abstract class PluginPresentationApi {
|
|
|
89
101
|
constructor();
|
|
90
102
|
}
|
|
91
103
|
export * from "./views";
|
|
104
|
+
export * from "./camera";
|
|
92
105
|
export * from "./sheets";
|
|
93
106
|
export * from "./placedViews";
|
|
94
107
|
export * from "./diagrams";
|
|
@@ -98,5 +111,6 @@ export * from "./tables";
|
|
|
98
111
|
export * from "./slideshow";
|
|
99
112
|
export * from "./import";
|
|
100
113
|
export * from "./aiInspiration";
|
|
114
|
+
export * from "./walkthroughs";
|
|
101
115
|
export * from "./export";
|
|
102
116
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,8BAA8B,EAC9B,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACxC,MAAM,UAAU,CAAA;AAEjB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EA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E,8BAA8B,CAAA;IACzD,yGAAyG;IACzG,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD;;;OAGG;IACH,SAAgB,aAAa,EAAE,kCAAkC,CAAA;IACjE;;;;OAIG;IACH,SAAgB,YAAY,EAAE,iCAAiC,CAAA;IAE/D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,MAAM,CACpB,MAAM,EAAE,8BAA8B,EACtC,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,UAAU,CAAC,EAAE,kCAAkC,CAAA;QAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,GACA,eAAe,CAAC,8BAA8B,CAAC;;CAGnD;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA"}
|
|
@@ -1053,8 +1053,8 @@ export type PluginPlacedViewsSetLabelHiddenArgs = z.infer<typeof PluginPlacedVie
|
|
|
1053
1053
|
* user annotation, a plain image, or other.
|
|
1054
1054
|
*/
|
|
1055
1055
|
export declare const PluginCanvasShapeOrigin: z.ZodEnum<{
|
|
1056
|
-
image: "image";
|
|
1057
1056
|
view: "view";
|
|
1057
|
+
image: "image";
|
|
1058
1058
|
aiOutput: "aiOutput";
|
|
1059
1059
|
diagram: "diagram";
|
|
1060
1060
|
pluginShape: "pluginShape";
|
|
@@ -76,7 +76,9 @@ export declare abstract class PluginPresentationViewsApi {
|
|
|
76
76
|
*
|
|
77
77
|
* Captures the **current** viewport by default; pass `viewId` to capture a
|
|
78
78
|
* specific saved view (which briefly applies that view to the scene). Use
|
|
79
|
-
* `format`/`resolution` to control the output.
|
|
79
|
+
* `format`/`resolution` to control the output. This shoots the Design (3D)
|
|
80
|
+
* canvas; to screenshot the Present canvas use
|
|
81
|
+
* {@linkcode PluginPresentationCameraApi.capture}.
|
|
80
82
|
*
|
|
81
83
|
* @param options - All optional: `viewId` (capture this saved view; omit for the
|
|
82
84
|
* current viewport), `format` (default `"png"`), `resolution` (e.g. `"1280x720"`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;OAkBG;aACa,IAAI,IAAI,eAAe,CAAC,iCAAiC,CAAC;IAE1E;;;;;;;;;;;;;;;OAeG;aACa,GAAG,CACjB,MAAM,EAAE,MAAM,GACb,eAAe,CAAC,gCAAgC,CAAC;IAEpD;;;;;;;;;;;;;;OAcG;aACa,SAAS,IAAI,eAAe,CAAC,gCAAgC,CAAC;IAE9E
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;OAkBG;aACa,IAAI,IAAI,eAAe,CAAC,iCAAiC,CAAC;IAE1E;;;;;;;;;;;;;;;OAeG;aACa,GAAG,CACjB,MAAM,EAAE,MAAM,GACb,eAAe,CAAC,gCAAgC,CAAC;IAEpD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