@things-factory/figure-viewer 10.1.165 → 10.1.166

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-viewer",
3
- "version": "10.1.165",
3
+ "version": "10.1.166",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -31,8 +31,9 @@
31
31
  "@hatiolab/things-scene": "^10.1.86",
32
32
  "@material/web": "^2.0.0",
33
33
  "@operato/i18n": "^10.0.0",
34
+ "@operato/styles": "^10.0.0",
34
35
  "@things-factory/styles": "^10.1.123",
35
36
  "lit": "^3.1.2"
36
37
  },
37
- "gitHead": "d9e3774d70561b063e4f1d10c387caf721d99b61"
38
+ "gitHead": "cf0137f79472c707edfff3389ffb8890962b7d53"
38
39
  }
@@ -4,7 +4,7 @@ import { readFileSync } from 'node:fs'
4
4
  import { fileURLToPath } from 'node:url'
5
5
  import { addFigureBox, createFigureAsset, editFigurePart, serializeFigureAsset } from '@hatiolab/figure-model'
6
6
  import { moving } from './joints.ts'
7
- import { clipForControl, parametersForClip } from '../client/detail-motion.ts'
7
+ import { clipsDriving, parametersForClip } from '../client/detail-motion.ts'
8
8
 
9
9
  function machine() {
10
10
  let asset = addFigureBox(createFigureAsset('Motion probe'), { id: 'block', size: { x: 100, y: 100, z: 100 }, position: { x: 0, y: 50, z: 0 } })
@@ -19,8 +19,8 @@ test('playing a clip releases manual values that would mask its drivers, retaini
19
19
  assert.deepEqual(parametersForClip(asset, values, 'cycle'), { other: 42 })
20
20
  assert.deepEqual(values, { shift: 75, other: 42 })
21
21
  assert.equal(serializeFigureAsset(asset), source)
22
- assert.equal(clipForControl(asset, 'shift'), 'cycle')
23
- assert.equal(clipForControl(asset, 'other'), undefined)
22
+ assert.deepEqual(clipsDriving(asset, 'shift'), ['cycle'])
23
+ assert.deepEqual(clipsDriving(asset, 'other'), [])
24
24
  })
25
25
 
26
26
  test('choosing a different clip cannot clear another clip’s manual control', () => {
@@ -88,3 +88,18 @@ test('the dock tells the board all three, and a clip it cannot choose is not pre
88
88
  assert.ok(table['figure.text.detail-clip-by-data'], lang)
89
89
  }
90
90
  })
91
+
92
+ /*
93
+ * A clip can move many inputs: the robot dog's walk, run and idle each move all eight leg joints. A play mark on an
94
+ * input's row played the walk and every leg moved (user 2026-10-15), so a clip plays on its own row and an input's row
95
+ * has none.
96
+ */
97
+ test('every clip that moves an input is named, and the motion tab plays clips on their own rows only', () => {
98
+ for (const leg of ['fl', 'fr', 'hl', 'hr']) for (const joint of ['thigh', 'knee']) assert.deepEqual(clipsDriving(DOG, `${leg}-${joint}`), ['walk', 'run', 'idle'])
99
+ assert.deepEqual(clipsDriving(DOG, 'head'), [])
100
+ const viewer = readFileSync(fileURLToPath(new URL('../client/figure-asset-viewer.ts', import.meta.url)), 'utf8')
101
+ const motion = viewer.slice(viewer.indexOf(' private renderMotion('), viewer.indexOf('\n }\n', viewer.indexOf(' private renderMotion(')))
102
+ const inputRows = motion.slice(0, motion.indexOf('</section>'))
103
+ assert.ok(!inputRows.includes('playButton'), 'an input row has no play mark')
104
+ assert.match(motion, /clips\.map\(name => html`<div slide clip><span title=\$\{name\}>\$\{name\}<\/span>\$\{this\.playButton\(name\)\}<\/div>`\)/)
105
+ })
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "tags",
31
31
  "figure.label.what-this-does": "function",
32
32
  "figure.text.detail-no-motion": "No motion is defined.",
33
- "figure.text.detail-paused": "Paused",
34
- "figure.text.detail-playing": "Playing",
35
33
  "figure.text.detail-clip-by-data": "The figure's data chooses the clip {clip}, and no data value turns into it, so it cannot be played here.",
36
34
  "figure.text.detail-thumbnail-failed": "could not save the thumbnail. try again.",
37
35
  "figure.text.detail-thumbnail-saved": "saved as the thumbnail",
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "etiquetas",
31
31
  "figure.label.what-this-does": "función",
32
32
  "figure.text.detail-no-motion": "No hay ningún movimiento definido.",
33
- "figure.text.detail-paused": "En pausa",
34
- "figure.text.detail-playing": "Reproduciendo",
35
33
  "figure.text.detail-clip-by-data": "Los datos de la figura eligen el clip {clip} y ningún valor de datos lleva a él, así que no se puede reproducir aquí.",
36
34
  "figure.text.detail-thumbnail-failed": "no se pudo guardar la miniatura. inténtelo de nuevo.",
37
35
  "figure.text.detail-thumbnail-saved": "guardada como miniatura",
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "タグ",
31
31
  "figure.label.what-this-does": "機能",
32
32
  "figure.text.detail-no-motion": "登録された動きがありません。",
33
- "figure.text.detail-paused": "一時停止",
34
- "figure.text.detail-playing": "再生中",
35
33
  "figure.text.detail-clip-by-data": "{clip} クリップはこのFigureのデータが選びますが、そのクリップになるデータ値がないため、ここでは再生できません。",
36
34
  "figure.text.detail-thumbnail-failed": "サムネイルを保存できませんでした。もう一度お試しください。",
37
35
  "figure.text.detail-thumbnail-saved": "サムネイルに保存しました",
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "태그",
31
31
  "figure.label.what-this-does": "기능",
32
32
  "figure.text.detail-no-motion": "등록된 움직임이 없습니다.",
33
- "figure.text.detail-paused": "일시정지",
34
- "figure.text.detail-playing": "재생 중",
35
33
  "figure.text.detail-clip-by-data": "{clip} 클립은 이 Figure의 데이터가 고르는데, 그 클립이 되는 데이터 값이 없어 여기서 재생할 수 없습니다.",
36
34
  "figure.text.detail-thumbnail-failed": "썸네일을 저장하지 못했습니다. 다시 시도하세요.",
37
35
  "figure.text.detail-thumbnail-saved": "썸네일로 저장했습니다",
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "tag",
31
31
  "figure.label.what-this-does": "fungsi",
32
32
  "figure.text.detail-no-motion": "Tiada gerakan didaftarkan.",
33
- "figure.text.detail-paused": "Dijeda",
34
- "figure.text.detail-playing": "Sedang dimainkan",
35
33
  "figure.text.detail-clip-by-data": "Data figure ini memilih klip {clip}, dan tiada nilai data menjadi klip itu, jadi ia tidak boleh dimainkan di sini.",
36
34
  "figure.text.detail-thumbnail-failed": "lakaran kecil tidak dapat disimpan. cuba lagi.",
37
35
  "figure.text.detail-thumbnail-saved": "disimpan sebagai lakaran kecil",
@@ -30,8 +30,6 @@
30
30
  "figure.label.tags": "标签",
31
31
  "figure.label.what-this-does": "功能",
32
32
  "figure.text.detail-no-motion": "没有已注册的动作。",
33
- "figure.text.detail-paused": "已暂停",
34
- "figure.text.detail-playing": "播放中",
35
33
  "figure.text.detail-clip-by-data": "片段 {clip} 由此 Figure 的数据选择,但没有数据值对应它,因此无法在此播放。",
36
34
  "figure.text.detail-thumbnail-failed": "无法保存缩略图。请重试。",
37
35
  "figure.text.detail-thumbnail-saved": "已保存为缩略图",