@things-factory/figure-viewer 10.1.205 → 10.1.206
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/client/detail-facts.ts +4 -5
- package/client/figure-asset-viewer.ts +6 -6
- package/client/preview-model.ts +28 -8
- package/dist-client/detail-facts.js +4 -5
- package/dist-client/detail-facts.js.map +1 -1
- package/dist-client/figure-asset-viewer.js +6 -6
- package/dist-client/figure-asset-viewer.js.map +1 -1
- package/dist-client/preview-model.d.ts +11 -2
- package/dist-client/preview-model.js +28 -8
- package/dist-client/preview-model.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/test/detail-facts.test.ts +6 -0
- package/test/preview.test.ts +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-viewer",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.206",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"test": "FIGURE_FREEZE_COMPILED=1 node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hatiolab/figure-model": "^0.9.
|
|
30
|
+
"@hatiolab/figure-model": "^0.9.6",
|
|
31
31
|
"@hatiolab/things-scene": "^10.1.95",
|
|
32
32
|
"@material/web": "^2.0.0",
|
|
33
33
|
"@operato/i18n": "^10.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"@things-factory/styles": "^10.1.123",
|
|
36
36
|
"lit": "^3.1.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "18588a058a4a6cb21c379b2da5517e077c6442ba"
|
|
39
39
|
}
|
|
@@ -51,6 +51,12 @@ test('a declared size reads as its range on each axis; the row gives category, t
|
|
|
51
51
|
assert.match(valueOf(facts, 'updated')!, / · 관리자$/)
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
+
test('an open end reads as what the parts allow: from 0 and up to ∞ where nothing limits it (ADR-0087 decision 6)', () => {
|
|
55
|
+
const asset = applyFigureAuthoring(box(), { kind: 'declare-instance-size', range: { y: { min: 50, max: 400 } }, at: { x: 100, y: 100, z: 100 } })
|
|
56
|
+
const facts = detailFactsOf(asset, { id: '1', type: 'box', name: '상자' } as never, say)
|
|
57
|
+
assert.equal(valueOf(facts, 'size'), 'X 0–∞ · Y 50–400 · Z 0–∞ mm')
|
|
58
|
+
})
|
|
59
|
+
|
|
54
60
|
test('what it does follows its capability names; a set that is no rung is shown as the names', () => {
|
|
55
61
|
const holds = editFigurePart(box(), { kind: 'set-capabilities', names: ['Capacity', 'Holdable'] })
|
|
56
62
|
assert.equal(valueOf(detailFactsOf(holds, { id: '1', type: 'box', name: '상자' } as never, say), 'does'), ko['figure.label.rung-hold'])
|
package/test/preview.test.ts
CHANGED
|
@@ -7,7 +7,7 @@ import assert from 'node:assert/strict'
|
|
|
7
7
|
|
|
8
8
|
import { addFigureBox, applyFigureAuthoring, createFigureAsset, proposeFigureOccupancy } from '@hatiolab/figure-model'
|
|
9
9
|
|
|
10
|
-
import { authoredSizeOf, occupancyAtSize, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeRangeOf, sizeWithinRange } from '../client/preview-model.ts'
|
|
10
|
+
import { authoredSizeOf, occupancyAtSize, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeRangeOf, sizeSpanOf, sizeWithinRange } from '../client/preview-model.ts'
|
|
11
11
|
|
|
12
12
|
test('여덟 — 기준과 일곱 조합, 한 줄에 넷, 늘린 축만 두 배 · 높이는 늘 적는다', () => {
|
|
13
13
|
assert.deepEqual(PREVIEW_WAYS.map(w => w.name), ['base', 'x', 'y', 'z', 'x·y', 'x·z', 'y·z', 'x·y·z'])
|
|
@@ -72,6 +72,20 @@ test('크기 범위 — 선언된 축만 열리고, 바라는 크기는 그 범
|
|
|
72
72
|
assert.equal(sizeWithinRange(asset, 'x', Number.NaN), undefined)
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
+
/* ADR-0087 결정 6: 좁히지 않은 끝은 부품에서 계산한다 — 막는 것이 없으면 끝이 없고, 끌개는 그린 크기의 두 배 · 반까지 간다. */
|
|
76
|
+
test('크기 범위 — 좁히지 않은 끝은 부품이 허락하는 만큼, 끌개는 열린 끝에서 두 배 · 반까지', () => {
|
|
77
|
+
let asset = addFigureBox(createFigureAsset('Panel'), { id: 'panel', size: { x: 1000, y: 200, z: 400 }, position: { x: 0, y: 100, z: 0 } })
|
|
78
|
+
asset = applyFigureAuthoring(asset, { kind: 'declare-instance-size', at: { x: 1000, y: 200, z: 400 } })
|
|
79
|
+
assert.deepEqual(sizeRangeOf(asset, 'x'), { min: 0, max: Infinity }, '막는 부품이 없다')
|
|
80
|
+
assert.deepEqual(sizeSpanOf(asset, 'x'), { min: 500, max: 2000 })
|
|
81
|
+
assert.equal(sizeWithinRange(asset, 'x', 9000), 9000, '보드처럼 붙들지 않는다')
|
|
82
|
+
asset = applyFigureAuthoring(asset, { kind: 'link-dimension', part: 'panel', axis: 'x', source: { of: 'instance', axis: 'x' }, plus: -400 })
|
|
83
|
+
const x = sizeRangeOf(asset, 'x')!
|
|
84
|
+
assert.ok(x.min > 400 && x.min < 400.001 && x.max === Infinity, `${x.min}`)
|
|
85
|
+
assert.deepEqual(sizeSpanOf(asset, 'x'), { min: x.min, max: 2000 }, '부품이 정한 끝은 그대로')
|
|
86
|
+
assert.equal(sizeWithinRange(asset, 'x', 100), x.min)
|
|
87
|
+
})
|
|
88
|
+
|
|
75
89
|
test('인스턴스의 상자는 그 크기에서의 차지하는 공간이다 — 크기 입력값이 아니다 (첫 15분 재측정, 2026-10-16)', () => {
|
|
76
90
|
let asset = addFigureBox(createFigureAsset('Padded'), { id: 'body', size: { x: 1000, y: 200, z: 400 }, position: { x: 0, y: 100, z: 0 } })
|
|
77
91
|
asset = applyFigureAuthoring(asset, { kind: 'follow-size', part: 'body' })
|