@things-factory/figure-ui 10.1.114 → 10.1.115
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/modeller/canvas.ts +6 -0
- package/client/modeller/editor.ts +1 -0
- package/client/modeller/figure-preview.ts +34 -10
- package/client/modeller/preview-model.ts +8 -0
- package/client/pages/figure-modeller-page.ts +7 -1
- package/dist-client/modeller/canvas.js +7 -0
- package/dist-client/modeller/canvas.js.map +1 -1
- package/dist-client/modeller/clips.d.ts +1 -1
- package/dist-client/modeller/editor.js +1 -0
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/figure-preview.d.ts +2 -0
- package/dist-client/modeller/figure-preview.js +38 -10
- package/dist-client/modeller/figure-preview.js.map +1 -1
- package/dist-client/modeller/preview-model.d.ts +5 -0
- package/dist-client/modeller/preview-model.js +7 -0
- package/dist-client/modeller/preview-model.js.map +1 -1
- package/dist-client/pages/figure-modeller-page.d.ts +1 -0
- package/dist-client/pages/figure-modeller-page.js +7 -1
- package/dist-client/pages/figure-modeller-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/test/modeller-route.test.ts +8 -0
- package/test/preview.test.ts +39 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-ui",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.115",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"@things-factory:registry": "https://registry.npmjs.org"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"clean": "npm run clean:server && npm run clean:client"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hatiolab/figure-model": "^0.2.
|
|
31
|
-
"@hatiolab/things-scene": "^10.1.
|
|
30
|
+
"@hatiolab/figure-model": "^0.2.15",
|
|
31
|
+
"@hatiolab/things-scene": "^10.1.69",
|
|
32
32
|
"@material/web": "^2.0.0",
|
|
33
33
|
"@operato/data-grist": "^10.0.0",
|
|
34
34
|
"@operato/graphql": "^10.0.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@operato/styles": "^10.0.0",
|
|
42
42
|
"@operato/utils": "^10.0.0",
|
|
43
43
|
"@things-factory/ai-assistant": "^10.1.114",
|
|
44
|
-
"@things-factory/figure-service": "^10.1.
|
|
44
|
+
"@things-factory/figure-service": "^10.1.115",
|
|
45
45
|
"three": "^0.185.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3d1f480028b680a6da3d0ae6a73c3121d644b64a"
|
|
48
48
|
}
|
|
@@ -36,3 +36,11 @@ test('reloading or closing the tab with unsaved work asks first — the shell do
|
|
|
36
36
|
assert.match(page, /addEventListener\('beforeunload', this\.holdUnsaved\)/)
|
|
37
37
|
assert.match(page, /removeEventListener\('beforeunload', this\.holdUnsaved\)/)
|
|
38
38
|
})
|
|
39
|
+
|
|
40
|
+
test('기존 도형을 열면 rail 은 카탈로그를 가리킨다 — 「새 Figure」를 가리키지 않는다(2026-10-03)', async () => {
|
|
41
|
+
const { readFileSync } = await import('node:fs')
|
|
42
|
+
const page = readFileSync(new URL('../client/pages/figure-modeller-page.ts', import.meta.url), 'utf8')
|
|
43
|
+
const context = page.slice(page.indexOf('get context()'), page.indexOf('render()', page.indexOf('get context()')))
|
|
44
|
+
/* The rail's rule (@operato/menu menu-active.ts): a page that names its menu wins over a menu with the same page name. */
|
|
45
|
+
assert.ok(context.includes("menu: view.id ? 'figure-list' : undefined"), 'id 가 있으면 카탈로그, 새 도형이면 이름을 대지 않는다')
|
|
46
|
+
})
|
package/test/preview.test.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
9
9
|
|
|
10
10
|
import { addFigureBox, createFigureAsset } from '@hatiolab/figure-model'
|
|
11
11
|
|
|
12
|
-
import { authoredSizeOf, PREVIEW_WAYS, previewClampsOf, previewInstances } from '../client/modeller/preview-model.ts'
|
|
12
|
+
import { authoredSizeOf, PREVIEW_WAYS, previewClampsOf, previewInstances, setupPartOf } from '../client/modeller/preview-model.ts'
|
|
13
13
|
|
|
14
14
|
const read = (path: string) => readFileSync(fileURLToPath(new URL(path, import.meta.url)), 'utf8')
|
|
15
15
|
|
|
@@ -54,3 +54,41 @@ test('미리보기 — 선언하지 않은 크기를 묻는 변형은 그려지
|
|
|
54
54
|
const view = readFileSync(fileURLToPath(new URL('../client/modeller/figure-preview.ts', import.meta.url)), 'utf8')
|
|
55
55
|
assert.ok(view.includes("i18next.t('figure.text.preview-clamped'"), '범례에 적는다')
|
|
56
56
|
})
|
|
57
|
+
|
|
58
|
+
test('미리보기로 가도 고른 부품이 남는다 — 화면에서 빠진 캔버스는 선택을 알리지 않는다(U03, 2026-10-03)', () => {
|
|
59
|
+
const canvas = read('../client/modeller/canvas.ts')
|
|
60
|
+
const handler = canvas.slice(canvas.indexOf("root.on('selected'"), canvas.indexOf("root.on('selected'") + 900)
|
|
61
|
+
assert.ok(handler.includes('if (!this.isConnected) return'), '장면을 치울 때 비워진 선택을 편집기에 알리지 않는다')
|
|
62
|
+
assert.ok(handler.indexOf('if (!this.isConnected) return') < handler.indexOf("new CustomEvent('part-selected'"), '알리기 전에 거른다')
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
test('미리보기 크기 안내는 편집에서 고른 부품부터 — 안내에서 고른 것이 먼저, 없는 부품은 건너뛴다', () => {
|
|
66
|
+
assert.equal(setupPartOf('', 'roller', ['frame', 'roller']), 'roller', '편집에서 고른 부품')
|
|
67
|
+
assert.equal(setupPartOf('frame', 'roller', ['frame', 'roller']), 'frame', '안내에서 고른 것이 이긴다')
|
|
68
|
+
assert.equal(setupPartOf('', 'leg', ['frame', 'roller']), 'frame', '크기 규칙이 없는 부품이면 첫 부품')
|
|
69
|
+
assert.equal(setupPartOf('gone', '', ['frame']), 'frame', '사라진 부품은 건너뛴다')
|
|
70
|
+
assert.equal(setupPartOf('', '', []), '')
|
|
71
|
+
const editor = read('../client/modeller/editor.ts')
|
|
72
|
+
const tag = editor.slice(editor.indexOf('<figure-preview'), editor.indexOf('</figure-preview>'))
|
|
73
|
+
assert.ok(tag.includes('.selected=${this.selected}'), '편집기가 고른 부품을 넘긴다')
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
test('미리보기 아래의 크기 안내와 조작값은 한 줄에서 줄을 바꾼다 — 좁은 폭에서 겹치지 않는다(1024 폭, 2026-10-03)', () => {
|
|
77
|
+
const preview = read('../client/modeller/figure-preview.ts')
|
|
78
|
+
const style = (sel: string) => preview.slice(preview.indexOf(sel + ' {'), preview.indexOf('}', preview.indexOf(sel + ' {')))
|
|
79
|
+
assert.match(style('div[foot]'), /position: absolute/)
|
|
80
|
+
assert.match(style('div[foot]'), /flex-wrap: wrap-reverse/)
|
|
81
|
+
assert.doesNotMatch(style('div[setup]'), /position: absolute/, '안내가 제 모서리에 따로 서지 않는다')
|
|
82
|
+
assert.doesNotMatch(style('div[clips]'), /position: absolute/, '조작값이 제 모서리에 따로 서지 않는다')
|
|
83
|
+
const foot = preview.slice(preview.indexOf('<div foot>'))
|
|
84
|
+
assert.ok(foot.indexOf('<div setup>') < foot.indexOf('this.renderDrivers('), '둘 다 한 줄 안에')
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
test('미리보기 재생 속도는 실제로 도는 값을 보인다 — 움직이기 전에는 0(멈춤), 1.00 으로 보이며 서 있지 않는다(2026-10-03)', () => {
|
|
88
|
+
const preview = read('../client/modeller/figure-preview.ts')
|
|
89
|
+
const drivers = preview.slice(preview.indexOf('clips.map(clip =>'))
|
|
90
|
+
assert.ok(drivers.includes('this.driving[clip] ?? 0'), '아무것도 보내지 않은 clip 은 0 으로 그린다')
|
|
91
|
+
assert.ok(!drivers.slice(0, 600).includes('this.driving[clip] ?? 1'))
|
|
92
|
+
const drive = preview.slice(preview.indexOf('private drive('), preview.indexOf('private give('))
|
|
93
|
+
assert.ok(drive.includes("this.tellInstances('clips'"), '속도는 drive 에서만 보낸다 — 그래서 보이는 값도 보낸 값뿐이다')
|
|
94
|
+
})
|