@snaptrude/plugin-core 0.11.0-rc.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/CHANGELOG.md +176 -14
- package/api-manifest.json +872 -49
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +447 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +942 -101
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +10 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/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/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/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/mode/index.d.ts +19 -7
- package/dist/api/core/mode/index.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 +17 -2
- 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 +84 -3
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +299 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +269 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/grids.d.ts +132 -0
- package/dist/api/design/create/grids.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +753 -102
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +38 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +7 -20
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +24 -23
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +1446 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/grids.d.ts +237 -0
- package/dist/api/design/grids.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +30 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +287 -0
- package/dist/api/design/query/grids.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +143 -36
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -66
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +12 -12
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +412 -8
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +84 -2
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +13 -1
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +12 -15
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +24 -24
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/graphics.d.ts +419 -0
- package/dist/api/presentation/graphics.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +66 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +117 -51
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/sections.d.ts +461 -0
- package/dist/api/presentation/sections.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -37
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/standards.d.ts +590 -0
- package/dist/api/presentation/standards.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +144 -9
- 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/api/program/departments.d.ts +58 -2
- package/dist/api/program/departments.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +16 -6
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +267 -4
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +49 -2
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +5 -8
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/handles.d.ts +32 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +6534 -2865
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6118 -2857
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +2 -1
- package/scripts/check-dist-fresh.mjs +22 -0
- package/scripts/generate-manifest.mjs +5 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +429 -1
- package/src/api/core/geom/create/index.ts +1037 -102
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +10 -2
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/core/index.ts +4 -4
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/mode/index.ts +19 -7
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +19 -2
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/core/tags.ts +76 -0
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +210 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +294 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +824 -141
- package/src/api/design/create/opening-fields.ts +40 -0
- package/src/api/design/delete/index.ts +6 -20
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +64 -41
- package/src/api/design/family.ts +1342 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +49 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +105 -5
- package/src/api/design/query/spaces.ts +0 -68
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +398 -4
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/entity/buildableEnvelope.ts +77 -2
- package/src/api/entity/referenceLine.ts +25 -12
- package/src/api/entity/space.ts +0 -2
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/graphics.ts +324 -0
- package/src/api/presentation/index.ts +73 -14
- package/src/api/presentation/placedViews.ts +120 -57
- package/src/api/presentation/sections.ts +420 -0
- package/src/api/presentation/sheets.ts +182 -37
- package/src/api/presentation/standards.ts +445 -0
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +81 -10
- package/src/api/presentation/walkthroughs.ts +1201 -0
- package/src/api/program/departments.ts +54 -2
- package/src/api/program/index.ts +16 -6
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/spreadsheet.ts +282 -0
- package/src/api/workspace/index.ts +51 -2
- package/src/errors/codes.ts +9 -30
- package/src/handles.ts +42 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -4
- package/test/massParameters.test.mjs +952 -0
- package/test/paperPensContract.test.mjs +75 -0
- package/test/presentationViewSettings.test.mjs +85 -0
- package/api-manifest.full.json +0 -6928
- package/snaptrude-plugin-core-0.11.0.tgz +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { test } from "node:test"
|
|
2
|
+
import assert from "node:assert/strict"
|
|
3
|
+
import {
|
|
4
|
+
PluginGraphicStandardPatch,
|
|
5
|
+
PluginGraphicsOverrides,
|
|
6
|
+
PluginGraphicsSetScaleArgs,
|
|
7
|
+
PluginDesignCreateReferenceLinesArgs,
|
|
8
|
+
PluginReferenceLineOptions,
|
|
9
|
+
} from "../dist/index.js"
|
|
10
|
+
|
|
11
|
+
test("Paper Pens rejects ambiguous, ineffective and stock-writing edits before transport", () => {
|
|
12
|
+
for (const input of [
|
|
13
|
+
{ stockId: "metric-standard@1" },
|
|
14
|
+
{ lineWeights: { model: { "100.0": { "03": 0.5 } } } },
|
|
15
|
+
{ lineWeights: { columns: { add: [100], delete: [100] } } },
|
|
16
|
+
{ objectStyles: { Grids: { cut: 3 } } },
|
|
17
|
+
{ annotationText: { Dimension: { textMm: 0 } } },
|
|
18
|
+
])
|
|
19
|
+
assert.equal(PluginGraphicStandardPatch.safeParse(input).success, false)
|
|
20
|
+
assert.equal(
|
|
21
|
+
PluginGraphicsOverrides.safeParse({ Lines: { cut: 2 } }).success,
|
|
22
|
+
false,
|
|
23
|
+
)
|
|
24
|
+
assert.equal(
|
|
25
|
+
PluginGraphicsOverrides.safeParse({ Grids: { cut: 2 } }).success,
|
|
26
|
+
false,
|
|
27
|
+
)
|
|
28
|
+
assert.equal(
|
|
29
|
+
PluginGraphicsSetScaleArgs.safeParse({ scale: 50.5 }).success,
|
|
30
|
+
false,
|
|
31
|
+
)
|
|
32
|
+
const patch = {
|
|
33
|
+
lineWeights: { model: { 100: { 3: null } } },
|
|
34
|
+
objectStyles: { Walls: { cut: 6 } },
|
|
35
|
+
}
|
|
36
|
+
assert.deepEqual(PluginGraphicStandardPatch.parse(patch), patch)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test("explicit reference styles cannot conflict with legacy fields or mixed call forms", () => {
|
|
40
|
+
assert.equal(
|
|
41
|
+
PluginReferenceLineOptions.safeParse({ styleId: "wide", thickness: 3 })
|
|
42
|
+
.success,
|
|
43
|
+
false,
|
|
44
|
+
)
|
|
45
|
+
assert.equal(
|
|
46
|
+
PluginReferenceLineOptions.safeParse({ styleId: "wide", style: "DASHED" })
|
|
47
|
+
.success,
|
|
48
|
+
false,
|
|
49
|
+
)
|
|
50
|
+
const profile = "profile_contract"
|
|
51
|
+
assert.equal(
|
|
52
|
+
PluginDesignCreateReferenceLinesArgs.safeParse({
|
|
53
|
+
profile,
|
|
54
|
+
options: { styleId: "wide" },
|
|
55
|
+
gridTag: "A",
|
|
56
|
+
}).success,
|
|
57
|
+
false,
|
|
58
|
+
)
|
|
59
|
+
assert.equal(
|
|
60
|
+
PluginDesignCreateReferenceLinesArgs.safeParse({
|
|
61
|
+
profile,
|
|
62
|
+
options: { styleId: "wide" },
|
|
63
|
+
}).success,
|
|
64
|
+
true,
|
|
65
|
+
)
|
|
66
|
+
assert.equal(
|
|
67
|
+
PluginDesignCreateReferenceLinesArgs.safeParse({
|
|
68
|
+
profile,
|
|
69
|
+
color: "#121212",
|
|
70
|
+
thickness: 3,
|
|
71
|
+
style: "DASHED",
|
|
72
|
+
}).success,
|
|
73
|
+
true,
|
|
74
|
+
)
|
|
75
|
+
})
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Node built-in test runner suite for the presentation view settings schemas.
|
|
2
|
+
// Run: node --test test/
|
|
3
|
+
// Imports the BUILT package (dist) — run `pnpm build` first.
|
|
4
|
+
import test from "node:test"
|
|
5
|
+
import assert from "node:assert/strict"
|
|
6
|
+
import {
|
|
7
|
+
PluginPresentationViewSettings,
|
|
8
|
+
PluginPresentationViewsGetSettingsResult,
|
|
9
|
+
PluginPresentationViewsUpdateSettingsArgs,
|
|
10
|
+
} from "../dist/index.js"
|
|
11
|
+
|
|
12
|
+
const base = {
|
|
13
|
+
backgroundColor: "#ffffff",
|
|
14
|
+
colorMode: "monochrome",
|
|
15
|
+
viewMode: "isometric",
|
|
16
|
+
showAxis: true,
|
|
17
|
+
showEdges: true,
|
|
18
|
+
showLabels: false,
|
|
19
|
+
labels: [],
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test("a plan's settings read back its cut range", () => {
|
|
23
|
+
const range = { cutPlaneHeight: 5.9055, viewDepthStorey: -1, showOverheadObjects: false }
|
|
24
|
+
assert.deepEqual(PluginPresentationViewsGetSettingsResult.parse({ ...base, ...range }), {
|
|
25
|
+
...base,
|
|
26
|
+
...range,
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test("a view that is not a plan omits the range, and legacy callers still parse", () => {
|
|
31
|
+
const parsed = PluginPresentationViewSettings.parse(base)
|
|
32
|
+
for (const key of ["cutPlaneHeight", "viewDepthStorey", "showOverheadObjects"])
|
|
33
|
+
assert.equal(key in parsed, false)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test("a range patch survives the update args instead of being stripped", () => {
|
|
37
|
+
const parsed = PluginPresentationViewsUpdateSettingsArgs.parse({
|
|
38
|
+
id: "plan_1",
|
|
39
|
+
settings: { cutPlaneHeight: 4.72, viewDepthStorey: 0, showOverheadObjects: false },
|
|
40
|
+
})
|
|
41
|
+
assert.deepEqual(parsed.settings, {
|
|
42
|
+
cutPlaneHeight: 4.72,
|
|
43
|
+
viewDepthStorey: 0,
|
|
44
|
+
showOverheadObjects: false,
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test("depth 0 is a real storey; depth null is rejected", () => {
|
|
49
|
+
const ground = PluginPresentationViewsUpdateSettingsArgs.parse({
|
|
50
|
+
id: "plan_1",
|
|
51
|
+
settings: { viewDepthStorey: 0 },
|
|
52
|
+
})
|
|
53
|
+
assert.equal(ground.settings.viewDepthStorey, 0)
|
|
54
|
+
assert.throws(() =>
|
|
55
|
+
PluginPresentationViewsUpdateSettingsArgs.parse({
|
|
56
|
+
id: "plan_1",
|
|
57
|
+
settings: { viewDepthStorey: null },
|
|
58
|
+
}),
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
test("a range patch rejects values no plan could use", () => {
|
|
63
|
+
for (const settings of [
|
|
64
|
+
{ cutPlaneHeight: 0 },
|
|
65
|
+
{ cutPlaneHeight: -3 },
|
|
66
|
+
{ cutPlaneHeight: Number.POSITIVE_INFINITY },
|
|
67
|
+
{ cutPlaneHeight: Number.NaN },
|
|
68
|
+
{ viewDepthStorey: 1.5 },
|
|
69
|
+
{ showOverheadObjects: "no" },
|
|
70
|
+
])
|
|
71
|
+
assert.throws(
|
|
72
|
+
() => PluginPresentationViewsUpdateSettingsArgs.parse({ id: "plan_1", settings }),
|
|
73
|
+
undefined,
|
|
74
|
+
JSON.stringify(settings),
|
|
75
|
+
)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test("the existing label contradiction checks still apply beside a range patch", () => {
|
|
79
|
+
assert.throws(() =>
|
|
80
|
+
PluginPresentationViewsUpdateSettingsArgs.parse({
|
|
81
|
+
id: "plan_1",
|
|
82
|
+
settings: { showLabels: false, labels: ["areas"], cutPlaneHeight: 10 },
|
|
83
|
+
}),
|
|
84
|
+
)
|
|
85
|
+
})
|