@things-factory/figure-ui 10.1.73 → 10.1.74

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.73",
3
+ "version": "10.1.74",
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.89",
31
- "@hatiolab/things-scene": "^10.1.56",
30
+ "@hatiolab/figure-model": "^0.1.90",
31
+ "@hatiolab/things-scene": "^10.1.60",
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.58",
44
- "@things-factory/figure-service": "^10.1.73",
44
+ "@things-factory/figure-service": "^10.1.74",
45
45
  "three": "^0.185.1"
46
46
  },
47
- "gitHead": "5b5ef6baa7709c2fcbd2f08b8f9c6a750393dfa6"
47
+ "gitHead": "59d5114dc91f6dd746f114bc047f07d70313c776"
48
48
  }
@@ -154,6 +154,20 @@ window.probe = {
154
154
  const l = Math.hypot(b.x - a.x, b.y - a.y) || 1
155
155
  return { x: (b.x - a.x) / l, y: (b.y - a.y) / l }
156
156
  },
157
+ /** The page point of an input or checkbox by its aria-label. */
158
+ labelled(label) {
159
+ const input = deep('input').find(i => i.getAttribute('aria-label') === label)
160
+ return input ? centreOf(input) : null
161
+ },
162
+ /** The page point of a button by an attribute it carries. */
163
+ button(attribute) {
164
+ const b = deep(`button[${attribute}]`)[0]
165
+ return b ? { ...centreOf(b), disabled: b.disabled } : null
166
+ },
167
+ /** The figure as the session holds it. */
168
+ source() {
169
+ return JSON.parse(editor().session.source())
170
+ },
157
171
  /** The ids of every body drawn. */
158
172
  ids() {
159
173
  return editor().session.read().geometry.map(g => g.id)
@@ -759,6 +759,43 @@ describe('the recipe catalog: a template chosen, filled in, put onto the chosen
759
759
  })
760
760
  })
761
761
 
762
+ describe('a row\'s pitch made a board\'s to set (ADR-0096)', () => {
763
+ const typeInto = async (label, text) => {
764
+ const at = await read(l => probe.labelled(l), label)
765
+ assert.ok(at, `the field ${label}`)
766
+ await page().mouse.click(at.x, at.y, { clickCount: 3 })
767
+ await page().keyboard.type(text)
768
+ await page().keyboard.press('Tab')
769
+ await sleep(400)
770
+ }
771
+ test('published in one step with a name and a range; the pitch then sets the input; withdrawn, the pitch stays as it is', async () => {
772
+ await mount('rollers')
773
+ await click(await read(() => probe.row('roller')))
774
+ const before = (await read(() => probe.ids())).filter(id => id.includes('"roller.placed"')).length
775
+ await click(await read(() => probe.labelled('figure.label.board-sets')))
776
+ await typeInto('figure.label.board-name', '롤러 간격')
777
+ await typeInto('figure.label.least', '100')
778
+ await typeInto('figure.label.most', '400')
779
+ const start = await state()
780
+ await click(await read(() => probe.button('publish-pitch')))
781
+ assert.equal((await state()).revision, start.revision + 1, 'one step')
782
+ let source = await read(() => probe.source())
783
+ assert.deepEqual(source.publicInputs, [{ input: 'roller.pitch', label: '롤러 간격' }])
784
+ const input = source.document.model.inputs.find(i => i.id === 'roller.pitch')
785
+ assert.deepEqual([input.min, input.max, source.designInputs['roller.pitch']], [100, 400, 200])
786
+ assert.deepEqual(source.joints.find(j => j.body1.part === 'roller').repeat.pitch, { from: { of: 'input', input: 'roller.pitch' } })
787
+ assert.equal((await read(() => probe.ids())).filter(id => id.includes('"roller.placed"')).length, before, 'the row as it was')
788
+ await typeInto('roller.repeat.pitch', '400')
789
+ source = await read(() => probe.source())
790
+ assert.equal(source.designInputs['roller.pitch'], 400, 'the pitch field sets the input')
791
+ assert.ok((await read(() => probe.ids())).filter(id => id.includes('"roller.placed"')).length < before, 'fewer rollers at a wider pitch')
792
+ await click(await read(() => probe.labelled('figure.label.board-sets')))
793
+ source = await read(() => probe.source())
794
+ assert.equal(source.publicInputs, undefined, 'withdrawn')
795
+ assert.equal(source.joints.find(j => j.body1.part === 'roller').repeat.pitch, 400, 'the pitch stays as it is')
796
+ })
797
+ })
798
+
762
799
  describe('a row that carries a part (ADR-0093, 2026-09-26)', () => {
763
800
  test('the list has the roller and its mark, each once; a click on a mark on the canvas picks the mark, and only the roller offers the row', async () => {
764
801
  await mount('rollers')
@@ -649,5 +649,11 @@
649
649
  "figure.text.placement-plane-refused": "{parts} cannot go on a {placement} by the face fastened to the mounting plane. detach it or fasten it by its {faces} first.",
650
650
  "figure.label.face-centre": "centre",
651
651
  "figure.label.budget-moving": "parts recomputed every frame",
652
- "figure.label.performance-cost": "performance cost"
652
+ "figure.label.performance-cost": "performance cost",
653
+ "figure.label.board-sets": "a board may change it",
654
+ "figure.label.board-name": "name on the board",
655
+ "figure.label.least": "least",
656
+ "figure.label.most": "most",
657
+ "figure.button.publish-input": "publish to boards",
658
+ "figure.button.apply": "apply"
653
659
  }
@@ -649,5 +649,11 @@
649
649
  "figure.text.placement-plane-refused": "{parts} は取付平面に付いている面では {placement} に付けられません。外すか {faces} 面で付け直してから変更してください。",
650
650
  "figure.label.face-centre": "中心",
651
651
  "figure.label.budget-moving": "毎フレーム再計算する部品",
652
- "figure.label.performance-cost": "性能コスト"
652
+ "figure.label.performance-cost": "性能コスト",
653
+ "figure.label.board-sets": "ボードで変更可能",
654
+ "figure.label.board-name": "ボードでの名前",
655
+ "figure.label.least": "最小",
656
+ "figure.label.most": "最大",
657
+ "figure.button.publish-input": "ボードに公開",
658
+ "figure.button.apply": "適用"
653
659
  }
@@ -649,5 +649,11 @@
649
649
  "figure.text.placement-plane-refused": "{parts} 가 장착 평면에 붙은 면으로는 {placement} 에 붙일 수 없습니다. 떼거나 {faces} 면으로 다시 붙인 뒤 바꾸세요.",
650
650
  "figure.label.face-centre": "가운데",
651
651
  "figure.label.budget-moving": "매 프레임 다시 계산하는 부품",
652
- "figure.label.performance-cost": "성능 비용"
652
+ "figure.label.performance-cost": "성능 비용",
653
+ "figure.label.board-sets": "보드에서 바꿀 수 있음",
654
+ "figure.label.board-name": "보드에 보이는 이름",
655
+ "figure.label.least": "최소",
656
+ "figure.label.most": "최대",
657
+ "figure.button.publish-input": "보드에 공개",
658
+ "figure.button.apply": "적용"
653
659
  }
@@ -649,5 +649,11 @@
649
649
  "figure.text.placement-plane-refused": "{parts} tidak boleh dipasang pada {placement} dengan muka yang dipasang pada satah pemasangan. tanggalkan atau pasang semula dengan muka {faces} dahulu.",
650
650
  "figure.label.face-centre": "tengah",
651
651
  "figure.label.budget-moving": "bahagian dikira semula setiap bingkai",
652
- "figure.label.performance-cost": "kos prestasi"
652
+ "figure.label.performance-cost": "kos prestasi",
653
+ "figure.label.board-sets": "papan boleh mengubahnya",
654
+ "figure.label.board-name": "nama pada papan",
655
+ "figure.label.least": "terkecil",
656
+ "figure.label.most": "terbesar",
657
+ "figure.button.publish-input": "terbitkan ke papan",
658
+ "figure.button.apply": "guna"
653
659
  }
@@ -649,5 +649,11 @@
649
649
  "figure.text.placement-plane-refused": "{parts} 贴在安装平面上的面不能用于 {placement}。请先拆下或改用 {faces} 面贴合后再更改。",
650
650
  "figure.label.face-centre": "中心",
651
651
  "figure.label.budget-moving": "每帧重新计算的部件",
652
- "figure.label.performance-cost": "性能成本"
652
+ "figure.label.performance-cost": "性能成本",
653
+ "figure.label.board-sets": "可在看板中修改",
654
+ "figure.label.board-name": "看板中显示的名称",
655
+ "figure.label.least": "最小",
656
+ "figure.label.most": "最大",
657
+ "figure.button.publish-input": "公开到看板",
658
+ "figure.button.apply": "应用"
653
659
  }