@things-factory/figure-ui 10.1.59 → 10.1.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-ui",
3
- "version": "10.1.59",
3
+ "version": "10.1.61",
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.1.69",
31
- "@hatiolab/things-scene": "^10.1.46",
30
+ "@hatiolab/figure-model": "^0.1.72",
31
+ "@hatiolab/things-scene": "^10.1.48",
32
32
  "@material/web": "^2.0.0",
33
33
  "@operato/data-grist": "^10.0.0",
34
34
  "@operato/graphql": "^10.0.0",
@@ -40,8 +40,8 @@
40
40
  "@operato/styles": "^10.0.0",
41
41
  "@operato/utils": "^10.0.0",
42
42
  "@things-factory/ai-assistant": "^10.1.58",
43
- "@things-factory/figure-service": "^10.1.59",
43
+ "@things-factory/figure-service": "^10.1.61",
44
44
  "three": "^0.185.1"
45
45
  },
46
- "gitHead": "d3306f7f30f7824b9febbc51d6f8f05266fd22e3"
46
+ "gitHead": "7060d1067505e4436d4b0d423f0f6e7f160e0669"
47
47
  }
@@ -25,7 +25,7 @@ test('패널이 내는 사건마다 편집기에 받는 자리가 있다', () =>
25
25
  test('복제 · 순서 · 삭제는 figure-model 의 부품 편집으로, 세션을 지난다', () => {
26
26
  assert.match(editor, /this\.session!\.edit\(\{ kind: 'duplicate-part', target: id \}\)/)
27
27
  assert.match(editor, /this\.session!\.edit\(\{ kind: 'move-part', target: id, to \}\)/)
28
- assert.match(editor, /this\.session!\.edit\(\{ kind: 'remove-part', target: id \}\)/)
28
+ assert.match(editor, /this\.session!\.edit\(\{ kind: 'remove-part', target: id, \.\.\.\(refitRoom \? \{ refitRoom: true \} : \{\}\) \}\)/)
29
29
  })
30
30
 
31
31
  test('작업대에서 가린 부품은 캔버스에서 빠지고, 다른 도형을 열면 풀린다', () => {
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url'
9
9
 
10
10
  import { addV3Box, createV3Asset } from '@hatiolab/figure-model'
11
11
 
12
- import { authoredSizeOf, PREVIEW_WAYS, previewInstances } from '../client/modeller/v3-preview-model.ts'
12
+ import { authoredSizeOf, PREVIEW_WAYS, previewClampsOf, previewInstances } from '../client/modeller/v3-preview-model.ts'
13
13
 
14
14
  const read = (path: string) => readFileSync(fileURLToPath(new URL(path, import.meta.url)), 'utf8')
15
15
 
@@ -40,3 +40,17 @@ test('편집 | 미리보기 — 띠에서 오가고, 미리보기는 도면처
40
40
  assert.ok(preview.includes("kind: 'set-state-defaults'"), '이 자세를 기본으로')
41
41
  assert.ok(preview.includes('dialShape('), '각도는 다이얼로')
42
42
  })
43
+
44
+ test('미리보기 — 선언하지 않은 크기를 묻는 변형은 그려지는 크기를 말한다(높이만 따르는 조명탑, 아키텍트 판정 09-25)', async () => {
45
+ const fm = await import('@hatiolab/figure-model')
46
+ let a = fm.addV3Box(fm.createV3Asset('Tower'), { id: 'mast', size: { x: 200, y: 2000, z: 300 }, position: { x: 0, y: 0, z: 0 } })
47
+ a = fm.applyV3Authoring(a, { kind: 'attach', part: 'mast', face: 'bottom', to: { plane: 'mounting-plane' } })
48
+ a = fm.applyV3Authoring(a, { kind: 'declare-instance-size', range: { x: { min: 200, max: 200 }, y: { min: 1000, max: 3000 }, z: { min: 300, max: 300 } } })
49
+ const clamps = previewClampsOf(a, authoredSizeOf(a))
50
+ assert.deepEqual(clamps['base'], [], '기준은 그대로')
51
+ assert.deepEqual(clamps['x'], [{ axis: 'x', asked: 400, used: 200 }])
52
+ assert.deepEqual(clamps['y'], [{ axis: 'y', asked: 4000, used: 3000 }], '높이도 선언 최대까지')
53
+ assert.deepEqual(clamps['x·y·z'].map(c => c.axis), ['x', 'y', 'z'])
54
+ const view = readFileSync(fileURLToPath(new URL('../client/modeller/figure-v3-preview.ts', import.meta.url)), 'utf8')
55
+ assert.ok(view.includes("i18next.t('figure.text.preview-clamped'"), '범례에 적는다')
56
+ })
@@ -77,3 +77,27 @@ test('부품을 못 지우는 까닭을 넷으로 가려 말한다 — 매단
77
77
  const declared = fm.applyV3Authoring(a, { kind: 'declare-occupancy', proposal: fm.proposeV3Occupancy(a), placement: 'floor' })
78
78
  assert.match(why(declared, 'shade')!, /part-in-declared-space .*"part":"shade"/, '잎인데 공간 선언에 들어 있다')
79
79
  })
80
+
81
+ test('공간 선언에 든 부품 — 지우고 공간을 남은 부품에 맞추는 길을 한 번에 권한다(차단기의 떠도는 상자, 09-25)', async () => {
82
+ const { inDeclaredRoom } = await import('../client/modeller/v3-refusals.ts')
83
+ const fm = await import('@hatiolab/figure-model')
84
+ let a = fm.addV3Box(fm.createV3Asset('Gate'), { id: 'housing', size: { x: 300, y: 1000, z: 300 }, position: { x: 0, y: 0, z: 0 } })
85
+ a = fm.addV3Box(a, { id: 'stray', size: { x: 100, y: 100, z: 100 }, position: { x: 0, y: 50, z: 0 } })
86
+ a = fm.applyV3Authoring(a, { kind: 'attach', part: 'housing', face: 'bottom', to: { plane: 'mounting-plane' } })
87
+ a = fm.applyV3Authoring(a, { kind: 'attach', part: 'stray', face: 'bottom', to: { plane: 'mounting-plane' } })
88
+ a = fm.applyV3Authoring(a, { kind: 'declare-occupancy', proposal: fm.proposeV3Occupancy(a), placement: 'floor' })
89
+ let refused: unknown
90
+ try {
91
+ fm.editV3Part(a, { kind: 'remove-part', target: 'stray' })
92
+ } catch (e) {
93
+ refused = e
94
+ }
95
+ assert.equal(inDeclaredRoom(refused), true)
96
+ assert.equal(inDeclaredRoom(Object.assign(new Error('PART_REFERENCED: top: top holds leg; take it off first'), { code: 'PART_REFERENCED' })), false, '매단 것은 이 길이 아니다')
97
+ const after = fm.editV3Part(a, { kind: 'remove-part', target: 'stray', refitRoom: true })
98
+ assert.equal(after.document.model.nodes.some(n => n.id === 'stray'), false)
99
+ assert.ok(after.occupancy?.bounds, '공간은 남은 부품으로 다시 선언된다')
100
+ const editor = readFileSync(fileURLToPath(new URL('../client/modeller/v3-editor.ts', import.meta.url)), 'utf8')
101
+ assert.ok(editor.includes("if (!refitRoom && inDeclaredRoom(error)) this.retry = { label: i18next.t('figure.button.remove-and-refit-room', { part: id }), run: () => this.removePart(id, true) }"))
102
+ assert.ok(ko['figure.button.remove-and-refit-room'].includes('{part}'))
103
+ })
@@ -731,5 +731,7 @@
731
731
  "figure.label.mounting-plane": "the mounting plane",
732
732
  "figure.text.proportion-to-follow": "{count} lengths still have their own number. made to follow, they grow by the figure's ratio.",
733
733
  "figure.button.follow-size-in-proportion": "make every part follow",
734
- "figure.text.proportion-kept": "keeps its own number: {what}"
734
+ "figure.text.proportion-kept": "keeps its own number: {what}",
735
+ "figure.button.remove-and-refit-room": "delete {part} and fit the space to the parts left",
736
+ "figure.text.preview-clamped": "{axis} {asked} → {used}"
735
737
  }
@@ -731,5 +731,7 @@
731
731
  "figure.label.mounting-plane": "取付面",
732
732
  "figure.text.proportion-to-follow": "長さ {count} 個がまだ固有の数値です。追従させると図形と同じ比率で大きくなります。",
733
733
  "figure.button.follow-size-in-proportion": "すべての部品を追従させる",
734
- "figure.text.proportion-kept": "固有の数値のまま: {what}"
734
+ "figure.text.proportion-kept": "固有の数値のまま: {what}",
735
+ "figure.button.remove-and-refit-room": "「{part}」を削除し、空間を残りの部品に合わせる",
736
+ "figure.text.preview-clamped": "{axis} {asked} → {used}"
735
737
  }
@@ -731,5 +731,7 @@
731
731
  "figure.label.mounting-plane": "장착 평면",
732
732
  "figure.text.proportion-to-follow": "길이 {count}개가 아직 자기 숫자입니다. 따라가게 하면 도형과 같은 비율로 커집니다.",
733
733
  "figure.button.follow-size-in-proportion": "모든 부품이 따라가게",
734
- "figure.text.proportion-kept": "자기 숫자로 남는 것: {what}"
734
+ "figure.text.proportion-kept": "자기 숫자로 남는 것: {what}",
735
+ "figure.button.remove-and-refit-room": "'{part}' 지우고 공간을 남은 부품에 맞추기",
736
+ "figure.text.preview-clamped": "{axis} {asked} → {used}"
735
737
  }
@@ -731,5 +731,7 @@
731
731
  "figure.label.mounting-plane": "satah pemasangan",
732
732
  "figure.text.proportion-to-follow": "{count} panjang masih mempunyai nombor sendiri. apabila dijadikan mengikut, ia membesar mengikut nisbah rajah.",
733
733
  "figure.button.follow-size-in-proportion": "jadikan semua bahagian mengikut",
734
- "figure.text.proportion-kept": "kekal dengan nombor sendiri: {what}"
734
+ "figure.text.proportion-kept": "kekal dengan nombor sendiri: {what}",
735
+ "figure.button.remove-and-refit-room": "padam '{part}' dan muatkan ruang pada bahagian yang tinggal",
736
+ "figure.text.preview-clamped": "{axis} {asked} → {used}"
735
737
  }
@@ -731,5 +731,7 @@
731
731
  "figure.label.mounting-plane": "安装平面",
732
732
  "figure.text.proportion-to-follow": "还有 {count} 个长度是自身数值。设为跟随后,将按图形的同一比例变大。",
733
733
  "figure.button.follow-size-in-proportion": "让所有部件跟随",
734
- "figure.text.proportion-kept": "保留自身数值: {what}"
734
+ "figure.text.proportion-kept": "保留自身数值: {what}",
735
+ "figure.button.remove-and-refit-room": "删除 '{part}' 并使空间适配剩余部件",
736
+ "figure.text.preview-clamped": "{axis} {asked} → {used}"
735
737
  }