@things-factory/figure-ui 10.1.13 → 10.1.14
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/figure-canvas.ts +10 -4
- package/client/pages/figure-modeller-page.ts +198 -115
- package/dist-client/modeller/figure-canvas.d.ts +1 -0
- package/dist-client/modeller/figure-canvas.js +10 -4
- package/dist-client/modeller/figure-canvas.js.map +1 -1
- package/dist-client/pages/figure-modeller-page.d.ts +9 -0
- package/dist-client/pages/figure-modeller-page.js +197 -117
- package/dist-client/pages/figure-modeller-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/ai-proposal-contract.test.ts +19 -0
- package/test/modeller-undo-redo.test.ts +33 -0
- package/translations/en.json +2 -0
- package/translations/ja.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
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.14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"@things-factory:registry": "https://registry.npmjs.org"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@things-factory/figure-service": "^10.1.13",
|
|
41
41
|
"three": "^0.185.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "34a0d0f5dcde279317d62f51336e866105c51998"
|
|
44
44
|
}
|
|
@@ -203,3 +203,22 @@ test('빈 새 Figure는 캔버스의 직전 씬을 폐기하고 안내 상태로
|
|
|
203
203
|
assert.match(standUp, /if \(!board\) \{[\s\S]*this\.teardown\(\)/)
|
|
204
204
|
assert.match(standUp, /if \(this\.parts\.length === 0\) \{[\s\S]*this\.teardown\(\)[\s\S]*canvas-appears-once-a-part-exists/)
|
|
205
205
|
})
|
|
206
|
+
|
|
207
|
+
test('캔버스는 figureId를 판별에 포함하고 없어진 부품을 씬에서 완전 제거한다', () => {
|
|
208
|
+
const canvasPath = fileURLToPath(new URL('../client/modeller/figure-canvas.ts', import.meta.url))
|
|
209
|
+
const canvasSource = readFileSync(canvasPath, 'utf8')
|
|
210
|
+
const modellerPath = fileURLToPath(new URL('../client/pages/figure-modeller-page.ts', import.meta.url))
|
|
211
|
+
const modellerSource = readFileSync(modellerPath, 'utf8')
|
|
212
|
+
|
|
213
|
+
// figureId 변경 시 새 씬을 세우도록 signature에 figureId가 포함된다
|
|
214
|
+
assert.match(canvasSource, /@property\(\{ type: String \}\) figureId\?: string/)
|
|
215
|
+
assert.match(canvasSource, /signature = `\$\{this\.figureId \?\? ''\}:\$\{board\.width\}x\$\{board\.height\}x\$\{board\.depth\}`/)
|
|
216
|
+
|
|
217
|
+
// 없어진 부품은 root.removeComponent와 component.dispose로 제거된다
|
|
218
|
+
assert.match(canvasSource, /root\.removeComponent\?\.\(component\)/)
|
|
219
|
+
assert.match(canvasSource, /component\.dispose\?\.\(\)/)
|
|
220
|
+
|
|
221
|
+
// 모델러 페이지는 figure-canvas에 figureId를 전달한다
|
|
222
|
+
assert.match(modellerSource, /\.figureId=\$\{this\.figure\?\.id \|\| this\.figure\?\.type\}/)
|
|
223
|
+
})
|
|
224
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
import { test } from 'node:test'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
|
|
6
|
+
test('상단 별도 헤더를 없애고 모드 툴바(div[modes])에 저장 및 실행 취소/다시 실행을 배치한다', () => {
|
|
7
|
+
const path = fileURLToPath(new URL('../client/pages/figure-modeller-page.ts', import.meta.url))
|
|
8
|
+
const source = readFileSync(path, 'utf8')
|
|
9
|
+
|
|
10
|
+
// 상단 <div header> 제거 검증
|
|
11
|
+
assert.equal(source.includes('<div header>'), false)
|
|
12
|
+
assert.equal(source.includes('button ai-support'), false)
|
|
13
|
+
|
|
14
|
+
// 모드 툴바(div[modes])에 실행 취소(undo), 다시 실행(redo) 버튼 배치 및 편집 모드 조건 검증
|
|
15
|
+
assert.match(source, /this\.mode === 'edit' && !this\.proposalSession/)
|
|
16
|
+
assert.match(source, /button\s+history[\s\S]*figure\.button\.undo[\s\S]*this\.undo\(\)/)
|
|
17
|
+
assert.match(source, /button\s+history[\s\S]*figure\.button\.redo[\s\S]*this\.redo\(\)/)
|
|
18
|
+
|
|
19
|
+
// 저장 버튼 및 미저장 표시(dirty)가 모드 툴바에 위치하는지 검증
|
|
20
|
+
assert.match(source, /<div modes>[\s\S]*button save[\s\S]*this\.save\(\)[\s\S]*<\/div>/)
|
|
21
|
+
assert.match(source, /<div modes>[\s\S]*span dirty[\s\S]*figure\.text\.unsaved-changes[\s\S]*<\/div>/)
|
|
22
|
+
|
|
23
|
+
// 실행 취소/다시 실행 메서드 및 상태 검증
|
|
24
|
+
assert.match(source, /private undoStack:/)
|
|
25
|
+
assert.match(source, /private redoStack:/)
|
|
26
|
+
assert.match(source, /private undo\(\)/)
|
|
27
|
+
assert.match(source, /private redo\(\)/)
|
|
28
|
+
assert.match(source, /private recordHistory\(/)
|
|
29
|
+
|
|
30
|
+
// 키보드 단축키(Cmd/Ctrl+Z, Cmd+Shift+Z / Ctrl+Y) 핸들러 검증
|
|
31
|
+
assert.match(source, /handleKeyDown = \(e: KeyboardEvent\)/)
|
|
32
|
+
assert.match(source, /e\.key === 'z' && !e\.shiftKey[\s\S]*this\.undo\(\)/)
|
|
33
|
+
})
|
package/translations/en.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"figure.button.reset-view": "reset",
|
|
29
29
|
"figure.button.revert": "revert",
|
|
30
30
|
"figure.button.save": "save",
|
|
31
|
+
"figure.button.undo": "undo",
|
|
32
|
+
"figure.button.redo": "redo",
|
|
31
33
|
"figure.button.see-the-trend-chart": "see the trend chart",
|
|
32
34
|
"figure.button.snap": "snap",
|
|
33
35
|
"figure.button.take-n-changes": "apply {n}",
|
package/translations/ja.json
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"figure.button.reset-view": "reset",
|
|
23
23
|
"figure.button.revert": "戻す",
|
|
24
24
|
"figure.button.save": "save",
|
|
25
|
+
"figure.button.undo": "元に戻す",
|
|
26
|
+
"figure.button.redo": "やり直す",
|
|
25
27
|
"figure.button.see-the-trend-chart": "see the trend chart",
|
|
26
28
|
"figure.button.snap": "snap",
|
|
27
29
|
"figure.button.take-n-changes": "apply {n}",
|
package/translations/ko.json
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"figure.button.reset-view": "처음으로",
|
|
29
29
|
"figure.button.revert": "되돌리기",
|
|
30
30
|
"figure.button.save": "저장",
|
|
31
|
+
"figure.button.undo": "실행 취소",
|
|
32
|
+
"figure.button.redo": "다시 실행",
|
|
31
33
|
"figure.button.see-the-trend-chart": "추이 그래프 보기",
|
|
32
34
|
"figure.button.snap": "눈금에",
|
|
33
35
|
"figure.button.take-n-changes": "{n}개 적용",
|
package/translations/ms.json
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"figure.button.reset-view": "reset",
|
|
23
23
|
"figure.button.revert": "kembalikan",
|
|
24
24
|
"figure.button.save": "save",
|
|
25
|
+
"figure.button.undo": "Nyahbuat",
|
|
26
|
+
"figure.button.redo": "Buat semula",
|
|
25
27
|
"figure.button.see-the-trend-chart": "see the trend chart",
|
|
26
28
|
"figure.button.snap": "snap",
|
|
27
29
|
"figure.button.take-n-changes": "apply {n}",
|
package/translations/zh.json
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"figure.button.reset-view": "reset",
|
|
23
23
|
"figure.button.revert": "回退",
|
|
24
24
|
"figure.button.save": "save",
|
|
25
|
+
"figure.button.undo": "撤销",
|
|
26
|
+
"figure.button.redo": "重做",
|
|
25
27
|
"figure.button.see-the-trend-chart": "see the trend chart",
|
|
26
28
|
"figure.button.snap": "snap",
|
|
27
29
|
"figure.button.take-n-changes": "apply {n}",
|