@things-factory/figure-ui 10.1.20 → 10.1.22

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.20",
3
+ "version": "10.1.22",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "clean": "npm run clean:server && npm run clean:client"
27
27
  },
28
28
  "dependencies": {
29
- "@hatiolab/figure-model": "^0.1.20",
29
+ "@hatiolab/figure-model": "^0.1.21",
30
30
  "@hatiolab/things-scene": "^10.1.14",
31
31
  "@material/web": "^2.0.0",
32
32
  "@operato/data-grist": "^10.0.0",
@@ -37,8 +37,8 @@
37
37
  "@operato/shell": "^10.0.0",
38
38
  "@operato/styles": "^10.0.0",
39
39
  "@operato/utils": "^10.0.0",
40
- "@things-factory/figure-service": "^10.1.20",
40
+ "@things-factory/figure-service": "^10.1.22",
41
41
  "three": "^0.185.1"
42
42
  },
43
- "gitHead": "6bd01660a4b28554bbe6ae4ee58f3ff844c5af69"
43
+ "gitHead": "6e0480b40df00c4c4d22e5ce78e57dc436bcc23f"
44
44
  }
@@ -309,6 +309,61 @@ describe('왕복해도 같다', () => {
309
309
  expect(toFigureSource(draft, parts).parameters).toEqual(FULL.parameters)
310
310
  })
311
311
 
312
+ /*
313
+ 옛 원본은 값이 만드는 자세를 애니메이션 안에 `drive: 'hold'` 로 담았다. 형식이 그것을
314
+ `parameters` 로 옮겼고 `compile()` 이 청사진을 만들 때 같은 이전을 한다 — 그래서 **씬은
315
+ 맞게 세우는데 저작 화면만 어긋났다.**
316
+
317
+ 카탈로그의 리프터에서 그대로 났다. `lift-height` 가 애니메이션 목록에 앉고 미리보기가
318
+ 거기에 배속 손잡이를 붙였는데, 끝까지 밀어도 아무 일도 안 났다 — 청사진에는 그 이름의
319
+ clip 이 없다. 저작자가 보는 것은 「움직이지 않는 리프터」다.
320
+ */
321
+ it('옛 hold clip 은 여는 순간 파라미터가 된다 — 애니메이션 칸에 남지 않는다', () => {
322
+ const legacy = {
323
+ ...FULL,
324
+ animations: [{ name: 'lift-height', drive: 'hold', channels: FULL.animations![0]!.channels }],
325
+ parameters: undefined
326
+ } as unknown as typeof FULL
327
+
328
+ const { draft } = fromFigureSource(legacy)
329
+
330
+ expect(draft.animations).toBeUndefined()
331
+ expect(draft.parameters).toHaveLength(1)
332
+ expect(draft.parameters![0]!.name).toBe('lift-height')
333
+ })
334
+
335
+ it('옮긴 파라미터에 범위가 붙는다 — 없으면 값을 줄 자리가 없다', () => {
336
+ const legacy = {
337
+ ...FULL,
338
+ animations: [{ name: 'lift-height', drive: 'hold', channels: FULL.animations![0]!.channels }],
339
+ parameters: undefined
340
+ } as unknown as typeof FULL
341
+
342
+ /* 옛 clip 은 제 수가 무엇인지 말한 적이 없다. % 는 지어낸 것이 아니라 「아직 안 정했다」다. */
343
+ expect(fromFigureSource(legacy).draft.parameters![0]!.range).toEqual({ unit: '%', min: 0, max: 100 })
344
+ })
345
+
346
+ it('시각이 흐르는 clip 은 그대로 애니메이션에 남는다', () => {
347
+ const { draft } = fromFigureSource(FULL)
348
+
349
+ expect(draft.animations).toHaveLength(1)
350
+ expect(draft.animations![0]!.name).toBe('spin')
351
+ })
352
+
353
+ it('옮긴 뒤 저장하면 drive 가 따라가지 않는다 — 없어진 칸이다', () => {
354
+ const legacy = {
355
+ ...FULL,
356
+ animations: [{ name: 'lift-height', drive: 'hold', channels: FULL.animations![0]!.channels }],
357
+ parameters: undefined
358
+ } as unknown as typeof FULL
359
+
360
+ const { draft, parts } = fromFigureSource(legacy)
361
+ const written = JSON.stringify(toFigureSource(draft, parts))
362
+
363
+ assert.ok(!written.includes('"drive"'), '없어진 칸이 저장 형식에 실렸다')
364
+ assert.ok(written.includes('lift-height'), '옮긴 것이 이름째로 사라졌다')
365
+ })
366
+
312
367
  it('안 쓰이는 필드도 살아남는다 — 조용히 사라지면 저작자가 알 길이 없다', () => {
313
368
  const { draft, parts } = fromFigureSource(FULL)
314
369
  const panel = toFigureSource(draft, parts).parts.find(part => part.name === 'panel')!