@snaptrude/plugin-core 0.9.14 → 0.9.15
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 +22 -0
- package/api-manifest.full.json +8930 -0
- package/api-manifest.json +227 -26
- 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 +5 -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/index.cjs +2761 -2552
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2728 -2549
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.test.mjs +14 -3
- 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 +5 -0
- package/src/api/presentation/views.ts +3 -1
package/api-manifest.json
CHANGED
|
@@ -3249,14 +3249,55 @@
|
|
|
3249
3249
|
"argsType": "UnderlayHandle",
|
|
3250
3250
|
"resultType": "{ scaleFactor: number }"
|
|
3251
3251
|
},
|
|
3252
|
+
{
|
|
3253
|
+
"path": "core.layers.assign",
|
|
3254
|
+
"namespace": "core.layers",
|
|
3255
|
+
"summary": "Move objects onto a layer (picking a layer in the object properties panel).",
|
|
3256
|
+
"examplePrompts": [
|
|
3257
|
+
"Move the selected objects to the BIM layer",
|
|
3258
|
+
"Move the selected objects to the Furniture layer",
|
|
3259
|
+
"Assign the generated walls to the Structure layer",
|
|
3260
|
+
"Put these masses on layer 3f2a…\n\n# Example\n```ts\nconst { assigned, skipped } = await snaptrude.core.layers.assign(ids, layerId)\n```"
|
|
3261
|
+
],
|
|
3262
|
+
"argsType": "ComponentHandle[]",
|
|
3263
|
+
"resultType": "PluginCoreLayersAssignResult"
|
|
3264
|
+
},
|
|
3265
|
+
{
|
|
3266
|
+
"path": "core.layers.create",
|
|
3267
|
+
"namespace": "core.layers",
|
|
3268
|
+
"summary": "Create a new layer in the Layers panel (the panel's \"Add new layer\" button followed by naming it).",
|
|
3269
|
+
"examplePrompts": [
|
|
3270
|
+
"Create a new layer called Furniture",
|
|
3271
|
+
"Add a layer called Landscape",
|
|
3272
|
+
"Add a layer named Landscape to the Layers panel",
|
|
3273
|
+
"Make a new layer for the facade elements",
|
|
3274
|
+
"Create layers named Structure and Services\n\n# Example\n```ts\nconst layer = await snaptrude.core.layers.create(\"Furniture\")\nawait snaptrude.core.layers.setActive(layer.id)\n```"
|
|
3275
|
+
],
|
|
3276
|
+
"argsType": "string",
|
|
3277
|
+
"resultType": "PluginCoreLayersCreateResult"
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
"path": "core.layers.delete",
|
|
3281
|
+
"namespace": "core.layers",
|
|
3282
|
+
"summary": "Delete a layer (the panel row's \"Delete layer\").",
|
|
3283
|
+
"examplePrompts": [
|
|
3284
|
+
"Delete the Furniture layer and everything on it",
|
|
3285
|
+
"Delete the Furniture layer and move its objects to Default",
|
|
3286
|
+
"Remove layer 3f2a… and move its objects to the default layer",
|
|
3287
|
+
"Merge the Services layer into Structure and delete it",
|
|
3288
|
+
"Delete every empty layer\n\n# Example\n```ts\nawait snaptrude.core.layers.delete(layerId, { deleteObjects: true })\nconst { layers } = await snaptrude.core.layers.list()\nconst def = layers.find((l) => l.isDefault)!\nawait snaptrude.core.layers.delete(otherId, { targetLayerId: def.id })\n```"
|
|
3289
|
+
],
|
|
3290
|
+
"argsType": "string",
|
|
3291
|
+
"resultType": "PluginCoreLayersDeleteResult"
|
|
3292
|
+
},
|
|
3252
3293
|
{
|
|
3253
3294
|
"path": "core.layers.get",
|
|
3254
3295
|
"namespace": "core.layers",
|
|
3255
|
-
"summary": "Get
|
|
3296
|
+
"summary": "Get one Layers-panel layer by id, including layers owned by other design options.",
|
|
3256
3297
|
"examplePrompts": [
|
|
3257
|
-
"Get the
|
|
3258
|
-
"Is layer
|
|
3259
|
-
"
|
|
3298
|
+
"Get the Layers-panel layer with id 3f2a…",
|
|
3299
|
+
"Is the Furniture layer locked or hidden?",
|
|
3300
|
+
"How many objects are on layer 3f2a…?\n\n# Example\n```ts\nconst layer = await snaptrude.core.layers.get(layerId)\nif (layer) console.log(layer.name, layer.objectCount)\n```"
|
|
3260
3301
|
],
|
|
3261
3302
|
"argsType": "string",
|
|
3262
3303
|
"resultType": "PluginCoreLayersGetResult"
|
|
@@ -3264,35 +3305,51 @@
|
|
|
3264
3305
|
{
|
|
3265
3306
|
"path": "core.layers.getActive",
|
|
3266
3307
|
"namespace": "core.layers",
|
|
3267
|
-
"summary": "Get the active
|
|
3308
|
+
"summary": "Get the active Layers-panel layer: the one new objects land on.",
|
|
3268
3309
|
"examplePrompts": [
|
|
3269
|
-
"Which
|
|
3270
|
-
"
|
|
3271
|
-
"What layer
|
|
3310
|
+
"Which layer is active?",
|
|
3311
|
+
"Which layer in the Layers panel is active?",
|
|
3312
|
+
"What layer will new objects go on?",
|
|
3313
|
+
"Which layer are new walls and masses being added to?\n\n# Example\n```ts\nconst active = await snaptrude.core.layers.getActive()\nif (active) console.log(active.name)\n```"
|
|
3272
3314
|
],
|
|
3273
|
-
"argsType":
|
|
3315
|
+
"argsType": null,
|
|
3274
3316
|
"resultType": "PluginCoreLayersGetActiveResult"
|
|
3275
3317
|
},
|
|
3276
3318
|
{
|
|
3277
3319
|
"path": "core.layers.list",
|
|
3278
3320
|
"namespace": "core.layers",
|
|
3279
|
-
"summary": "List the
|
|
3321
|
+
"summary": "List the layers in the Layers panel: the active design option's layers, default layer first, then in creation order.",
|
|
3280
3322
|
"examplePrompts": [
|
|
3281
|
-
"List the
|
|
3282
|
-
"Show
|
|
3283
|
-
"What
|
|
3323
|
+
"List all the layers in the Layers panel",
|
|
3324
|
+
"Show me the layers in the left sidebar",
|
|
3325
|
+
"What layers does this project have?",
|
|
3326
|
+
"Show every layer with whether it is locked or hidden",
|
|
3327
|
+
"Which layer is the default layer?",
|
|
3328
|
+
"Which layers are empty?\n\n# Example\n```ts\nconst { layers } = await snaptrude.core.layers.list()\nfor (const l of layers) console.log(l.name, l.objectCount, l.locked, l.hidden)\n```"
|
|
3284
3329
|
],
|
|
3285
|
-
"argsType":
|
|
3330
|
+
"argsType": null,
|
|
3286
3331
|
"resultType": "PluginCoreLayersListResult"
|
|
3287
3332
|
},
|
|
3333
|
+
{
|
|
3334
|
+
"path": "core.layers.rename",
|
|
3335
|
+
"namespace": "core.layers",
|
|
3336
|
+
"summary": "Rename a layer (the panel row's \"Rename layer\").",
|
|
3337
|
+
"examplePrompts": [
|
|
3338
|
+
"Rename the Furniture layer to Loose furniture",
|
|
3339
|
+
"Rename layer 3f2a… to Existing building",
|
|
3340
|
+
"Change the name of the Landscape layer\n\n# Example\n```ts\nawait snaptrude.core.layers.rename(layerId, \"Loose furniture\")\n```"
|
|
3341
|
+
],
|
|
3342
|
+
"argsType": "string",
|
|
3343
|
+
"resultType": "PluginCoreLayersRenameResult"
|
|
3344
|
+
},
|
|
3288
3345
|
{
|
|
3289
3346
|
"path": "core.layers.setActive",
|
|
3290
3347
|
"namespace": "core.layers",
|
|
3291
|
-
"summary": "Make a
|
|
3348
|
+
"summary": "Make a layer the active layer (clicking its row in the Layers panel).",
|
|
3292
3349
|
"examplePrompts": [
|
|
3293
|
-
"
|
|
3294
|
-
"Make
|
|
3295
|
-
"Switch the active layer to
|
|
3350
|
+
"Put new objects on the Furniture layer",
|
|
3351
|
+
"Make the Structure layer the active layer in the Layers panel",
|
|
3352
|
+
"Switch the active layer to Landscape\n\n# Example\n```ts\nawait snaptrude.core.layers.setActive(layerId)\n```"
|
|
3296
3353
|
],
|
|
3297
3354
|
"argsType": "string",
|
|
3298
3355
|
"resultType": "PluginCoreLayersSetActiveResult"
|
|
@@ -3300,11 +3357,12 @@
|
|
|
3300
3357
|
{
|
|
3301
3358
|
"path": "core.layers.update",
|
|
3302
3359
|
"namespace": "core.layers",
|
|
3303
|
-
"summary": "
|
|
3360
|
+
"summary": "Lock/unlock or show/hide a layer (the panel row's padlock and eye).",
|
|
3304
3361
|
"examplePrompts": [
|
|
3305
|
-
"
|
|
3306
|
-
"
|
|
3307
|
-
"Hide
|
|
3362
|
+
"Lock the Default layer",
|
|
3363
|
+
"Lock the Structure layer",
|
|
3364
|
+
"Hide the Landscape layer in the Layers panel",
|
|
3365
|
+
"Unlock layer 3f2a… and show it again\n\n# Example\n```ts\nawait snaptrude.core.layers.update(layerId, { locked: true, hidden: false })\n```"
|
|
3308
3366
|
],
|
|
3309
3367
|
"argsType": "string",
|
|
3310
3368
|
"resultType": "PluginCoreLayersUpdateResult"
|
|
@@ -4034,6 +4092,66 @@
|
|
|
4034
4092
|
"argsType": null,
|
|
4035
4093
|
"resultType": "number"
|
|
4036
4094
|
},
|
|
4095
|
+
{
|
|
4096
|
+
"path": "core.storeys.layers.get",
|
|
4097
|
+
"namespace": "core.storeys.layers",
|
|
4098
|
+
"summary": "Get a single storey layer by id.",
|
|
4099
|
+
"examplePrompts": [
|
|
4100
|
+
"Get the storey drawing layer with id ly_5",
|
|
4101
|
+
"Is storey layer ly_5 hidden?",
|
|
4102
|
+
"Look up a storey underlay layer by id\n\n# Example\n```ts\nconst layer = await snaptrude.core.storeys.layers.get(\"ly_5\")\nif (layer) console.log(layer.name, layer.hidden, layer.locked)\n```"
|
|
4103
|
+
],
|
|
4104
|
+
"argsType": "string",
|
|
4105
|
+
"resultType": "PluginCoreStoreysLayersGetResult"
|
|
4106
|
+
},
|
|
4107
|
+
{
|
|
4108
|
+
"path": "core.storeys.layers.getActive",
|
|
4109
|
+
"namespace": "core.storeys.layers",
|
|
4110
|
+
"summary": "Get the active storey layer of a storey.",
|
|
4111
|
+
"examplePrompts": [
|
|
4112
|
+
"Which sketch surface (Wall/Rough) is active on this storey?",
|
|
4113
|
+
"Get the active storey drawing layer on st_2",
|
|
4114
|
+
"Which storey layer is new sketch geometry drawn onto?\n\n# Example\n```ts\nconst active = await snaptrude.core.storeys.layers.getActive(\"st_2\")\nif (active) console.log(active.name)\n```"
|
|
4115
|
+
],
|
|
4116
|
+
"argsType": "string",
|
|
4117
|
+
"resultType": "PluginCoreStoreysLayersGetActiveResult"
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
"path": "core.storeys.layers.list",
|
|
4121
|
+
"namespace": "core.storeys.layers",
|
|
4122
|
+
"summary": "List the storey layers of a storey.",
|
|
4123
|
+
"examplePrompts": [
|
|
4124
|
+
"List the sketch surfaces and underlays on this storey",
|
|
4125
|
+
"Show all the PDF underlays on storey st_2",
|
|
4126
|
+
"What CAD layers are on the ground floor?\n\n# Example\n```ts\nconst { layers } = await snaptrude.core.storeys.layers.list(\"st_2\")\nfor (const l of layers) console.log(l.name, l.layerType, l.hidden)\n```"
|
|
4127
|
+
],
|
|
4128
|
+
"argsType": "string",
|
|
4129
|
+
"resultType": "PluginCoreStoreysLayersListResult"
|
|
4130
|
+
},
|
|
4131
|
+
{
|
|
4132
|
+
"path": "core.storeys.layers.setActive",
|
|
4133
|
+
"namespace": "core.storeys.layers",
|
|
4134
|
+
"summary": "Make a storey layer the active layer of its storey.",
|
|
4135
|
+
"examplePrompts": [
|
|
4136
|
+
"Switch this storey's sketch surface to the Rough layer",
|
|
4137
|
+
"Make storey layer ly_5 the active sketch surface",
|
|
4138
|
+
"Switch the active storey layer to the CAD underlay\n\n# Example\n```ts\nawait snaptrude.core.storeys.layers.setActive(\"ly_5\")\n```"
|
|
4139
|
+
],
|
|
4140
|
+
"argsType": "string",
|
|
4141
|
+
"resultType": "PluginCoreStoreysLayersSetActiveResult"
|
|
4142
|
+
},
|
|
4143
|
+
{
|
|
4144
|
+
"path": "core.storeys.layers.update",
|
|
4145
|
+
"namespace": "core.storeys.layers",
|
|
4146
|
+
"summary": "Update a storey layer's visibility.",
|
|
4147
|
+
"examplePrompts": [
|
|
4148
|
+
"Hide the PDF underlay layer",
|
|
4149
|
+
"Show the CAD underlay again",
|
|
4150
|
+
"Hide storey layer ly_5\n\n# Example\n```ts\nconst layer = await snaptrude.core.storeys.layers.update(\"ly_5\", true)\n```"
|
|
4151
|
+
],
|
|
4152
|
+
"argsType": "string",
|
|
4153
|
+
"resultType": "PluginCoreStoreysLayersUpdateResult"
|
|
4154
|
+
},
|
|
4037
4155
|
{
|
|
4038
4156
|
"path": "core.storeys.list",
|
|
4039
4157
|
"namespace": "core.storeys",
|
|
@@ -4761,17 +4879,18 @@
|
|
|
4761
4879
|
{
|
|
4762
4880
|
"path": "design.create.wallRuns",
|
|
4763
4881
|
"namespace": "design.create",
|
|
4764
|
-
"summary": "Create **many wall runs** in one undoable operation (bulk plural of {@linkcode walls}). Each item is one full run — a wall per curve in that item's profile chain, mitred at shared endpoints. Junctions resolve within a run, not between runs. Each item carries its own dimensions, `wallType` and `storey`, so a single call can build a whole floor plate or several storeys at once. Validate-all-or-throw; one command.",
|
|
4882
|
+
"summary": "Create **many wall runs** in one undoable operation (bulk plural of {@linkcode walls}). Each item is one full run — a wall per curve in that item's profile chain, mitred at shared endpoints. Junctions resolve within a run, not between runs. Each item carries its own dimensions, `wallType` and `storey`, so a single call can build a whole floor plate or several storeys at once. Per-curve `topProfiles` make raked or gabled walls (see {@linkcode PluginWallTopProfile}). Validate-all-or-throw; one command.",
|
|
4765
4883
|
"examplePrompts": [
|
|
4766
4884
|
"Draw all the walls of this floor plan at once",
|
|
4767
4885
|
"Build every room's perimeter in one operation",
|
|
4768
4886
|
"Bulk create wall runs from these centerlines",
|
|
4769
4887
|
"Create the walls for both storeys in a single undo step",
|
|
4770
|
-
"Turn these polylines into 200mm brick walls together"
|
|
4888
|
+
"Turn these polylines into 200mm brick walls together",
|
|
4889
|
+
"Import these raked walls with their top profiles in one go"
|
|
4771
4890
|
],
|
|
4772
4891
|
"argsType": "PluginCreateWallRunItem[]",
|
|
4773
4892
|
"resultType": "ComponentHandle[][]",
|
|
4774
|
-
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.walls` in a loop: build the full `items[]` array first (all profiles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const ground = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), await v.new(8, 0, 6), ]) const upper = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), ]) const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([ { profile: ground, height: 3, thickness: 0.2 }, { profile: upper, height: 3, storey: 2 }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
|
|
4893
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.walls` in a loop: build the full `items[]` array first (all profiles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const ground = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), await v.new(8, 0, 6), ]) const upper = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), ]) const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([ { profile: ground, height: 3, thickness: 0.2 }, { profile: upper, height: 3, storey: 2 }, // one gable wall: 3m at both ends, 5m ridge in the middle { profile: upper, thickness: 0.2, storey: 3, topProfiles: [[{ along: 0, height: 3 }, { along: 0.5, height: 5 }, { along: 1, height: 3 }]] }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
|
|
4775
4894
|
},
|
|
4776
4895
|
{
|
|
4777
4896
|
"path": "design.create.walls",
|
|
@@ -4784,7 +4903,10 @@
|
|
|
4784
4903
|
"Turn this polyline sketch into walls",
|
|
4785
4904
|
"Add walls with mitred corners along the path",
|
|
4786
4905
|
"Draw brick walls with plaster along this outline",
|
|
4787
|
-
"Build the perimeter in exposed concrete walls
|
|
4906
|
+
"Build the perimeter in exposed concrete walls",
|
|
4907
|
+
"Create a raked wall that slopes from 3m to 5m",
|
|
4908
|
+
"Build a gable end wall with the ridge in the middle",
|
|
4909
|
+
"Draw a wall with a sloped top edge\n\n# Example\n```ts\nconst v = snaptrude.core.math.vec3\nconst centerlines = await snaptrude.core.geom.create.profileFromLinePoints([\nawait v.new(0, 0, 0),\nawait v.new(8, 0, 0),\nawait v.new(8, 0, 6),\n])\nconst walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)\n// …built as a specific wall type (layers/material/thickness from the type):\nconst [brick] = await snaptrude.design.types.list(\"wall\")\nconst brickWalls = await snaptrude.design.create.walls(\ncenterlines, 3, undefined, brick.label,\n)\n// …a raked wall (3m at the start, 5m at the end) on a single centerline:\nconst run = await snaptrude.core.geom.create.profileFromCurves([\nawait snaptrude.core.geom.create.line(await v.new(0, 0, 10), await v.new(8, 0, 10)),\n])\nconst [raked] = await snaptrude.design.create.walls(run, undefined, 0.2, undefined, undefined, [\n[{ along: 0, height: 3 }, { along: 1, height: 5 }],\n])\n```"
|
|
4788
4910
|
],
|
|
4789
4911
|
"argsType": "ProfileHandle",
|
|
4790
4912
|
"resultType": "ComponentHandle[]",
|
|
@@ -6489,6 +6611,21 @@
|
|
|
6489
6611
|
"argsType": "ComponentHandle",
|
|
6490
6612
|
"resultType": "boolean"
|
|
6491
6613
|
},
|
|
6614
|
+
{
|
|
6615
|
+
"path": "design.update.setObjectType",
|
|
6616
|
+
"namespace": "design.update",
|
|
6617
|
+
"summary": "Change the **object type** of one or more masses — turn a mass into a real wall, roof, slab or floor: the properties panel's Object Type dropdown, headless. The geometry is kept exactly as it is (a wedge stays a wedge; nothing is flattened to a default thickness), so a sloped mass built with `design.create.massFromBrep` becomes a sloped roof or a raked wall. The component keeps its handle, label and storey; it gains the target type's construction layers and properties, and the type's default material when the mass still wore the default. One undoable operation for the whole list; undo turns them back into masses.",
|
|
6618
|
+
"examplePrompts": [
|
|
6619
|
+
"Convert this mass into a wall",
|
|
6620
|
+
"Turn the sloped mass into a roof",
|
|
6621
|
+
"Make these masses real slabs",
|
|
6622
|
+
"Change the object type of the selection to wall",
|
|
6623
|
+
"Convert the wedge I built into a raked wall",
|
|
6624
|
+
"Turn this mass into a floor\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromFaces(wedgeFaces)\nconst wedge = await snaptrude.design.create.massFromBrep(brep, \"Gable end\")\nconst { affected } = await snaptrude.design.update.setObjectType([wedge], \"wall\")\nconsole.log(await snaptrude.design.query.getEntityType(affected[0])) // \"wall\"\n```"
|
|
6625
|
+
],
|
|
6626
|
+
"argsType": "ComponentHandle[]",
|
|
6627
|
+
"resultType": "PluginDesignChangeResult"
|
|
6628
|
+
},
|
|
6492
6629
|
{
|
|
6493
6630
|
"path": "design.update.setStorey",
|
|
6494
6631
|
"namespace": "design.update",
|
|
@@ -7198,6 +7335,70 @@
|
|
|
7198
7335
|
"argsType": "string",
|
|
7199
7336
|
"resultType": "PluginPresentationAnnotateTextResult"
|
|
7200
7337
|
},
|
|
7338
|
+
{
|
|
7339
|
+
"path": "presentation.camera.capture",
|
|
7340
|
+
"namespace": "presentation.camera",
|
|
7341
|
+
"summary": "Screenshot what the Present canvas currently shows.",
|
|
7342
|
+
"examplePrompts": [
|
|
7343
|
+
"Take a screenshot of the Present canvas",
|
|
7344
|
+
"Capture what I am looking at in Present mode",
|
|
7345
|
+
"Screenshot the presentation canvas as a JPEG",
|
|
7346
|
+
"Grab a high-res image of the current sheet view\n\n# Example\n```ts\nconst { image, width, height } = await snaptrude.presentation.camera.capture({\nformat: \"png\",\npixelRatio: 2,\n})\n```"
|
|
7347
|
+
],
|
|
7348
|
+
"argsType": "{\n format?: PluginPresentationImageFormat\n pixelRatio?: number\n }",
|
|
7349
|
+
"resultType": "PluginPresentationCameraCaptureResult"
|
|
7350
|
+
},
|
|
7351
|
+
{
|
|
7352
|
+
"path": "presentation.camera.get",
|
|
7353
|
+
"namespace": "presentation.camera",
|
|
7354
|
+
"summary": "Read the Present camera: pan, zoom, the visible page-space rectangle and the sheet under the centre of the view.",
|
|
7355
|
+
"examplePrompts": [
|
|
7356
|
+
"Where is the Present canvas camera?",
|
|
7357
|
+
"What zoom level is Present mode at?",
|
|
7358
|
+
"Which sheet is on screen right now?",
|
|
7359
|
+
"Read the visible area of the presentation canvas\n\n# Example\n```ts\nconst { zoom, sheetId } = await snaptrude.presentation.camera.get()\n```"
|
|
7360
|
+
],
|
|
7361
|
+
"argsType": null,
|
|
7362
|
+
"resultType": "PluginPresentationCameraState"
|
|
7363
|
+
},
|
|
7364
|
+
{
|
|
7365
|
+
"path": "presentation.camera.set",
|
|
7366
|
+
"namespace": "presentation.camera",
|
|
7367
|
+
"summary": "Pan and/or zoom the Present canvas. Fields left out keep their current value, so `{ zoom: 2 }` changes only the zoom (the page point at the viewport's top-left corner stays put) and `{ x, y }` pans at the current zoom. `zoom` is clamped to the editor's range (1% to 1000%); the requested `x`/`y` are always honoured. Immediate (no animation). View-state only — not undoable.",
|
|
7368
|
+
"examplePrompts": [
|
|
7369
|
+
"Zoom the Present canvas to 50%",
|
|
7370
|
+
"Pan the presentation canvas to the right",
|
|
7371
|
+
"Restore the Present camera I saved earlier",
|
|
7372
|
+
"Set the Present zoom to 200% without moving\n\n# Example\n```ts\nconst saved = await snaptrude.presentation.camera.get()\nawait snaptrude.presentation.camera.set({ zoom: 0.5 })\n// …later, restore the exact framing\nawait snaptrude.presentation.camera.set({ x: saved.x, y: saved.y, zoom: saved.zoom })\n```"
|
|
7373
|
+
],
|
|
7374
|
+
"argsType": "{\n x?: number\n y?: number\n zoom?: number\n }",
|
|
7375
|
+
"resultType": "PluginPresentationCameraState"
|
|
7376
|
+
},
|
|
7377
|
+
{
|
|
7378
|
+
"path": "presentation.camera.zoomTo",
|
|
7379
|
+
"namespace": "presentation.camera",
|
|
7380
|
+
"summary": "Frame one shape on the Present canvas: a sheet, a placed view, a keyed shape or an annotation — any id the other `presentation` namespaces hand out. Pair with {@linkcode PluginPresentationCameraApi.capture} to screenshot a single sheet or placed view as it appears on screen. Immediate, unlike `sheets.setActive`, which animates its move over half a second. View-state only — not undoable.",
|
|
7381
|
+
"examplePrompts": [
|
|
7382
|
+
"Zoom in on sheet 2 in Present mode",
|
|
7383
|
+
"Frame this placed view on the Present canvas",
|
|
7384
|
+
"Go to the cover sheet and screenshot it",
|
|
7385
|
+
"Centre the presentation view on that table\n\n# Example\n```ts\nconst { sheets } = await snaptrude.presentation.sheets.list()\nawait snaptrude.presentation.camera.zoomTo(sheets[1].id)\nconst { image } = await snaptrude.presentation.camera.capture()\n```"
|
|
7386
|
+
],
|
|
7387
|
+
"argsType": "string",
|
|
7388
|
+
"resultType": "PluginPresentationCameraState"
|
|
7389
|
+
},
|
|
7390
|
+
{
|
|
7391
|
+
"path": "presentation.camera.zoomToFit",
|
|
7392
|
+
"namespace": "presentation.camera",
|
|
7393
|
+
"summary": "Frame everything on the Present canvas — every sheet and loose shape — the Present-mode \"zoom to fit\". View-state only — not undoable.",
|
|
7394
|
+
"examplePrompts": [
|
|
7395
|
+
"Zoom out to see all the sheets",
|
|
7396
|
+
"Fit the whole presentation in the Present view",
|
|
7397
|
+
"Zoom to fit in Present mode\n\n# Example\n```ts\nawait snaptrude.presentation.camera.zoomToFit()\n```"
|
|
7398
|
+
],
|
|
7399
|
+
"argsType": null,
|
|
7400
|
+
"resultType": "PluginPresentationCameraState"
|
|
7401
|
+
},
|
|
7201
7402
|
{
|
|
7202
7403
|
"path": "presentation.diagrams.generateProgram",
|
|
7203
7404
|
"namespace": "presentation.diagrams",
|
package/dist/api/core/index.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ import { PluginUserApi } from "./user";
|
|
|
30
30
|
* - {@linkcode PluginCoreApi.comment} — Comments: create, edit, resolve, tag, list
|
|
31
31
|
* - {@linkcode PluginCoreApi.groups} — Read & edit the group hierarchy
|
|
32
32
|
* - {@linkcode PluginCoreApi.buildings} — Read & edit buildings and their storeys
|
|
33
|
-
* - {@linkcode PluginCoreApi.storeys} — Create, read & edit storeys (floors)
|
|
34
|
-
* - {@linkcode PluginCoreApi.layers} —
|
|
33
|
+
* - {@linkcode PluginCoreApi.storeys} — Create, read & edit storeys (floors); `storeys.layers` reads & toggles each storey's sketch surfaces and underlays
|
|
34
|
+
* - {@linkcode PluginCoreApi.layers} — The Layers panel in the left sidebar: list, create, rename, lock, hide, activate, delete, move objects between layers
|
|
35
35
|
* - {@linkcode PluginCoreApi.tags} — Tag catalog + assignment
|
|
36
36
|
* - {@linkcode PluginCoreApi.io} — Import files (image/pdf/cad/model/terrain), poll jobs, manage underlays
|
|
37
37
|
* - {@linkcode PluginCoreApi.handles} — Handle lifecycle: release, releaseAll, scopes
|
|
@@ -60,11 +60,11 @@ export declare abstract class PluginCoreApi {
|
|
|
60
60
|
abstract groups: PluginCoreGroupsApi;
|
|
61
61
|
/** Buildings — read & edit buildings and their storeys. See {@linkcode PluginCoreBuildingsApi}. */
|
|
62
62
|
abstract buildings: PluginCoreBuildingsApi;
|
|
63
|
-
/** Storeys — create, read & edit storeys (floors). See {@linkcode PluginCoreStoreysApi}. */
|
|
63
|
+
/** Storeys — create, read & edit storeys (floors), plus each storey's sketch surfaces and underlays (`storeys.layers`). See {@linkcode PluginCoreStoreysApi}. */
|
|
64
64
|
abstract storeys: PluginCoreStoreysApi;
|
|
65
65
|
/** Application mode — read & switch the editor's top-bar mode. See {@linkcode PluginCoreModeApi}. */
|
|
66
66
|
abstract mode: PluginCoreModeApi;
|
|
67
|
-
/** Layers —
|
|
67
|
+
/** Layers — the Layers panel's layers: list, create, rename, lock, hide, activate, delete, assign objects. See {@linkcode PluginCoreLayersApi}. */
|
|
68
68
|
abstract layers: PluginCoreLayersApi;
|
|
69
69
|
/** Tags — tag catalog + assignment. See {@linkcode PluginCoreTagsApi}. */
|
|
70
70
|
abstract tags: PluginCoreTagsApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAA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