@things-factory/figure-ui 10.1.75 → 10.1.77

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.
Files changed (282) hide show
  1. package/client/figure-assistant.ts +3 -3
  2. package/client/graphql/{v3-store.ts → store.ts} +6 -6
  3. package/client/modeller/{v3-ai-proposal.ts → ai-proposal.ts} +8 -8
  4. package/client/modeller/{v3-align.ts → align.ts} +14 -14
  5. package/client/modeller/{v3-canvas.ts → canvas.ts} +13 -13
  6. package/client/modeller/{v3-clips.ts → clips.ts} +5 -5
  7. package/client/modeller/{v3-controls.ts → controls.ts} +2 -2
  8. package/client/modeller/{v3-editor.ts → editor.ts} +117 -117
  9. package/client/modeller/{figure-v3-capability.ts → figure-capability-panel.ts} +7 -7
  10. package/client/modeller/{figure-v3-clips.ts → figure-clips.ts} +10 -10
  11. package/client/modeller/{figure-v3-controls.ts → figure-controls.ts} +9 -9
  12. package/client/modeller/{v3-figure-facts.ts → figure-facts.ts} +11 -11
  13. package/client/modeller/{figure-v3-first-save.ts → figure-first-save.ts} +3 -3
  14. package/client/modeller/figure-history-panel.ts +1 -1
  15. package/client/modeller/{figure-v3-links.ts → figure-links.ts} +35 -35
  16. package/client/modeller/{figure-v3-material.ts → figure-material-panel.ts} +20 -20
  17. package/client/modeller/{figure-v3-parts.ts → figure-parts.ts} +15 -15
  18. package/client/modeller/{figure-v3-preview.ts → figure-preview.ts} +14 -14
  19. package/client/modeller/{figure-v3-properties.ts → figure-properties.ts} +25 -25
  20. package/client/modeller/{figure-v3-recipe-catalog.ts → figure-recipe-catalog.ts} +10 -10
  21. package/client/modeller/{figure-v3-verdict.ts → figure-verdict.ts} +24 -24
  22. package/client/modeller/gate-findings.ts +2 -2
  23. package/client/modeller/{v3-gizmo.ts → gizmo.ts} +11 -11
  24. package/client/modeller/{v3-joint-drag.ts → joint-drag.ts} +11 -11
  25. package/client/modeller/{v3-joint-fan.ts → joint-fan.ts} +13 -13
  26. package/client/modeller/{v3-links.ts → links.ts} +59 -59
  27. package/client/modeller/{v3-live.ts → live.ts} +9 -9
  28. package/client/modeller/{v3-maturity.ts → maturity.ts} +65 -65
  29. package/client/modeller/modeller-route.ts +1 -1
  30. package/client/modeller/{v3-occupancy.ts → occupancy.ts} +6 -6
  31. package/client/modeller/{v3-palette.ts → palette.ts} +3 -3
  32. package/client/modeller/{v3-preview-model.ts → preview-model.ts} +8 -8
  33. package/client/modeller/{v3-product-session.ts → product-session.ts} +25 -25
  34. package/client/modeller/{v3-recipe-source.ts → recipe-source.ts} +2 -2
  35. package/client/modeller/{v3-recipes.ts → recipes.ts} +9 -9
  36. package/client/modeller/{v3-renderer.ts → renderer.ts} +16 -16
  37. package/client/modeller/{v3-stage-model.ts → stage-model.ts} +15 -15
  38. package/client/modeller/{v3-thumbnail.ts → thumbnail.ts} +8 -8
  39. package/client/pages/figure-list-page.ts +4 -4
  40. package/client/pages/{figure-v3-modeller-page.ts → figure-modeller-page.ts} +37 -37
  41. package/client/route.ts +1 -5
  42. package/dist-client/figure-assistant.js +3 -3
  43. package/dist-client/figure-assistant.js.map +1 -1
  44. package/dist-client/graphql/store.d.ts +3 -0
  45. package/dist-client/graphql/{v3-store.js → store.js} +6 -6
  46. package/dist-client/graphql/store.js.map +1 -0
  47. package/dist-client/modeller/{v3-ai-proposal.d.ts → ai-proposal.d.ts} +7 -7
  48. package/dist-client/modeller/{v3-ai-proposal.js → ai-proposal.js} +1 -1
  49. package/dist-client/modeller/ai-proposal.js.map +1 -0
  50. package/dist-client/modeller/{v3-align.d.ts → align.d.ts} +8 -8
  51. package/dist-client/modeller/{v3-align.js → align.js} +6 -6
  52. package/dist-client/modeller/align.js.map +1 -0
  53. package/dist-client/modeller/{v3-canvas.d.ts → canvas.d.ts} +7 -7
  54. package/dist-client/modeller/{v3-canvas.js → canvas.js} +20 -20
  55. package/dist-client/modeller/canvas.js.map +1 -0
  56. package/dist-client/modeller/{v3-clips.d.ts → clips.d.ts} +4 -4
  57. package/dist-client/modeller/{v3-clips.js → clips.js} +1 -1
  58. package/dist-client/modeller/clips.js.map +1 -0
  59. package/dist-client/modeller/{v3-controls.d.ts → controls.d.ts} +2 -2
  60. package/dist-client/modeller/{v3-controls.js → controls.js} +1 -1
  61. package/dist-client/modeller/controls.js.map +1 -0
  62. package/dist-client/modeller/{v3-editor.d.ts → editor.d.ts} +19 -19
  63. package/dist-client/modeller/{v3-editor.js → editor.js} +103 -103
  64. package/dist-client/modeller/editor.js.map +1 -0
  65. package/dist-client/modeller/{v3-fields.js → fields.js} +1 -1
  66. package/dist-client/modeller/fields.js.map +1 -0
  67. package/dist-client/modeller/{figure-v3-capability.d.ts → figure-capability-panel.d.ts} +4 -4
  68. package/dist-client/modeller/{figure-v3-capability.js → figure-capability-panel.js} +12 -12
  69. package/dist-client/modeller/figure-capability-panel.js.map +1 -0
  70. package/dist-client/modeller/{figure-v3-clips.d.ts → figure-clips.d.ts} +4 -4
  71. package/dist-client/modeller/{figure-v3-clips.js → figure-clips.js} +16 -16
  72. package/dist-client/modeller/figure-clips.js.map +1 -0
  73. package/dist-client/modeller/{figure-v3-controls.d.ts → figure-controls.d.ts} +5 -5
  74. package/dist-client/modeller/{figure-v3-controls.js → figure-controls.js} +16 -16
  75. package/dist-client/modeller/figure-controls.js.map +1 -0
  76. package/dist-client/modeller/{v3-figure-facts.d.ts → figure-facts.d.ts} +5 -5
  77. package/dist-client/modeller/{v3-figure-facts.js → figure-facts.js} +5 -5
  78. package/dist-client/modeller/figure-facts.js.map +1 -0
  79. package/dist-client/modeller/{figure-v3-first-save.d.ts → figure-first-save.d.ts} +1 -1
  80. package/dist-client/modeller/{figure-v3-first-save.js → figure-first-save.js} +11 -11
  81. package/dist-client/modeller/figure-first-save.js.map +1 -0
  82. package/dist-client/modeller/figure-history-panel.d.ts +1 -1
  83. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  84. package/dist-client/modeller/{figure-v3-links.d.ts → figure-links.d.ts} +5 -5
  85. package/dist-client/modeller/{figure-v3-links.js → figure-links.js} +24 -24
  86. package/dist-client/modeller/figure-links.js.map +1 -0
  87. package/dist-client/modeller/{figure-v3-material.d.ts → figure-material-panel.d.ts} +9 -9
  88. package/dist-client/modeller/{figure-v3-material.js → figure-material-panel.js} +19 -19
  89. package/dist-client/modeller/figure-material-panel.js.map +1 -0
  90. package/dist-client/modeller/{figure-v3-parts.d.ts → figure-parts.d.ts} +12 -12
  91. package/dist-client/modeller/{figure-v3-parts.js → figure-parts.js} +14 -14
  92. package/dist-client/modeller/figure-parts.js.map +1 -0
  93. package/dist-client/modeller/{figure-v3-preview.d.ts → figure-preview.d.ts} +4 -4
  94. package/dist-client/modeller/{figure-v3-preview.js → figure-preview.js} +21 -21
  95. package/dist-client/modeller/figure-preview.js.map +1 -0
  96. package/dist-client/modeller/{figure-v3-properties.d.ts → figure-properties.d.ts} +8 -8
  97. package/dist-client/modeller/{figure-v3-properties.js → figure-properties.js} +25 -25
  98. package/dist-client/modeller/figure-properties.js.map +1 -0
  99. package/dist-client/modeller/{figure-v3-recipe-catalog.d.ts → figure-recipe-catalog.d.ts} +4 -4
  100. package/dist-client/modeller/{figure-v3-recipe-catalog.js → figure-recipe-catalog.js} +21 -21
  101. package/dist-client/modeller/figure-recipe-catalog.js.map +1 -0
  102. package/dist-client/modeller/{figure-v3-verdict.d.ts → figure-verdict.d.ts} +2 -2
  103. package/dist-client/modeller/{figure-v3-verdict.js → figure-verdict.js} +26 -26
  104. package/dist-client/modeller/figure-verdict.js.map +1 -0
  105. package/dist-client/modeller/{v3-first-save.js → first-save.js} +1 -1
  106. package/dist-client/modeller/first-save.js.map +1 -0
  107. package/dist-client/modeller/gate-findings.d.ts +2 -2
  108. package/dist-client/modeller/gate-findings.js +2 -2
  109. package/dist-client/modeller/gate-findings.js.map +1 -1
  110. package/dist-client/modeller/{v3-gizmo.d.ts → gizmo.d.ts} +5 -5
  111. package/dist-client/modeller/{v3-gizmo.js → gizmo.js} +3 -3
  112. package/dist-client/modeller/gizmo.js.map +1 -0
  113. package/dist-client/modeller/{v3-help.js → help.js} +1 -1
  114. package/dist-client/modeller/help.js.map +1 -0
  115. package/dist-client/modeller/joint-drag.d.ts +19 -0
  116. package/dist-client/modeller/{v3-joint-drag.js → joint-drag.js} +4 -4
  117. package/dist-client/modeller/joint-drag.js.map +1 -0
  118. package/dist-client/modeller/{v3-joint-fan.d.ts → joint-fan.d.ts} +3 -3
  119. package/dist-client/modeller/{v3-joint-fan.js → joint-fan.js} +6 -6
  120. package/dist-client/modeller/joint-fan.js.map +1 -0
  121. package/dist-client/modeller/{v3-keys.js → keys.js} +1 -1
  122. package/dist-client/modeller/keys.js.map +1 -0
  123. package/dist-client/modeller/{v3-links.d.ts → links.d.ts} +48 -48
  124. package/dist-client/modeller/{v3-links.js → links.js} +15 -15
  125. package/dist-client/modeller/links.js.map +1 -0
  126. package/dist-client/modeller/{v3-live.d.ts → live.d.ts} +6 -6
  127. package/dist-client/modeller/{v3-live.js → live.js} +5 -5
  128. package/dist-client/modeller/live.js.map +1 -0
  129. package/dist-client/modeller/{v3-maturity.d.ts → maturity.d.ts} +26 -26
  130. package/dist-client/modeller/{v3-maturity.js → maturity.js} +28 -28
  131. package/dist-client/modeller/maturity.js.map +1 -0
  132. package/dist-client/modeller/modeller-route.d.ts +1 -1
  133. package/dist-client/modeller/modeller-route.js +1 -1
  134. package/dist-client/modeller/modeller-route.js.map +1 -1
  135. package/dist-client/modeller/{v3-occupancy.d.ts → occupancy.d.ts} +4 -4
  136. package/dist-client/modeller/{v3-occupancy.js → occupancy.js} +6 -6
  137. package/dist-client/modeller/occupancy.js.map +1 -0
  138. package/dist-client/modeller/palette.d.ts +7 -0
  139. package/dist-client/modeller/{v3-palette.js → palette.js} +1 -1
  140. package/dist-client/modeller/palette.js.map +1 -0
  141. package/dist-client/modeller/{v3-preview-model.d.ts → preview-model.d.ts} +3 -3
  142. package/dist-client/modeller/{v3-preview-model.js → preview-model.js} +6 -6
  143. package/dist-client/modeller/preview-model.js.map +1 -0
  144. package/dist-client/modeller/{v3-product-session.d.ts → product-session.d.ts} +56 -56
  145. package/dist-client/modeller/{v3-product-session.js → product-session.js} +7 -7
  146. package/dist-client/modeller/product-session.js.map +1 -0
  147. package/dist-client/modeller/{v3-recipe-source.d.ts → recipe-source.d.ts} +2 -2
  148. package/dist-client/modeller/{v3-recipe-source.js → recipe-source.js} +3 -3
  149. package/dist-client/modeller/recipe-source.js.map +1 -0
  150. package/dist-client/modeller/{v3-recipes.d.ts → recipes.d.ts} +7 -7
  151. package/dist-client/modeller/{v3-recipes.js → recipes.js} +4 -4
  152. package/dist-client/modeller/recipes.js.map +1 -0
  153. package/dist-client/modeller/{v3-refusals.js → refusals.js} +1 -1
  154. package/dist-client/modeller/refusals.js.map +1 -0
  155. package/dist-client/modeller/{v3-renderer.d.ts → renderer.d.ts} +6 -6
  156. package/dist-client/modeller/{v3-renderer.js → renderer.js} +13 -13
  157. package/dist-client/modeller/renderer.js.map +1 -0
  158. package/dist-client/modeller/{v3-stage-model.d.ts → stage-model.d.ts} +7 -7
  159. package/dist-client/modeller/{v3-stage-model.js → stage-model.js} +5 -5
  160. package/dist-client/modeller/stage-model.js.map +1 -0
  161. package/dist-client/modeller/thumbnail.d.ts +3 -0
  162. package/dist-client/modeller/{v3-thumbnail.js → thumbnail.js} +6 -6
  163. package/dist-client/modeller/thumbnail.js.map +1 -0
  164. package/dist-client/pages/figure-list-page.d.ts +1 -1
  165. package/dist-client/pages/figure-list-page.js +4 -4
  166. package/dist-client/pages/figure-list-page.js.map +1 -1
  167. package/dist-client/pages/{figure-v3-modeller-page.d.ts → figure-modeller-page.d.ts} +10 -10
  168. package/dist-client/pages/{figure-v3-modeller-page.js → figure-modeller-page.js} +42 -42
  169. package/dist-client/pages/figure-modeller-page.js.map +1 -0
  170. package/dist-client/route.d.ts +1 -1
  171. package/dist-client/route.js +1 -5
  172. package/dist-client/route.js.map +1 -1
  173. package/dist-client/tsconfig.tsbuildinfo +1 -1
  174. package/docs/product-cutover.md +25 -0
  175. package/package.json +5 -5
  176. package/test/{v3-ai-proposal.test.ts → ai-proposal.test.ts} +6 -6
  177. package/test/{v3-align.test.ts → align.test.ts} +8 -8
  178. package/test/browser/modeller-page.js +30 -30
  179. package/test/browser/modeller.check.mjs +14 -14
  180. package/test/browser/serve.mjs +1 -1
  181. package/test/browser/thumbnail-page.js +6 -6
  182. package/test/{v3-clips.test.ts → clips.test.ts} +18 -18
  183. package/test/{v3-controls.test.ts → controls.test.ts} +15 -15
  184. package/test/{v3-fields.test.ts → fields.test.ts} +13 -13
  185. package/test/figure-assistant-surface.test.ts +3 -3
  186. package/test/{v3-first-save.test.ts → first-save.test.ts} +10 -10
  187. package/test/fixtures/joint-column.json +2 -2
  188. package/test/fixtures/joint-roller.json +2 -2
  189. package/test/fixtures/robot-arm-6dof.json +2 -2
  190. package/test/{v3-gizmo.test.ts → gizmo.test.ts} +33 -33
  191. package/test/{v3-joint-drag.test.ts → joint-drag.test.ts} +17 -17
  192. package/test/{v3-joint-fan.test.ts → joint-fan.test.ts} +18 -18
  193. package/test/joints.ts +6 -6
  194. package/test/{v3-keys.test.ts → keys.test.ts} +2 -2
  195. package/test/{v3-layout.test.ts → layout.test.ts} +8 -8
  196. package/test/{v3-links.test.ts → links.test.ts} +201 -201
  197. package/test/{v3-live.test.ts → live.test.ts} +18 -18
  198. package/test/{v3-material.test.ts → material.test.ts} +12 -12
  199. package/test/{v3-maturity.test.ts → maturity.test.ts} +74 -74
  200. package/test/modeller-route.test.ts +5 -6
  201. package/test/{v3-palette-icons.test.ts → palette-icons.test.ts} +1 -1
  202. package/test/{v3-parts-wiring.test.ts → parts-wiring.test.ts} +5 -5
  203. package/test/{v3-preview.test.ts → preview.test.ts} +12 -12
  204. package/test/{v3-product-session.test.ts → product-session.test.ts} +17 -17
  205. package/test/{v3-product-write.test.ts → product-write.test.ts} +20 -20
  206. package/test/{v3-properties.test.ts → properties.test.ts} +24 -24
  207. package/test/{v3-recipes.test.ts → recipes.test.ts} +9 -9
  208. package/test/{v3-refusals.test.ts → refusals.test.ts} +43 -43
  209. package/test/{v3-release-panel.test.ts → release-panel.test.ts} +21 -21
  210. package/test/renderer.test.ts +24 -0
  211. package/test/resolve-ts-siblings.mjs +1 -1
  212. package/test/{v3-scene-canvas.test.ts → scene-canvas.test.ts} +6 -6
  213. package/test/{v3-stage-model.test.ts → stage-model.test.ts} +5 -5
  214. package/test/{v3-theme.test.ts → theme.test.ts} +4 -4
  215. package/test/{v3-thumbnail.test.ts → thumbnail.test.ts} +4 -4
  216. package/test/{v3-verdict.test.ts → verdict.test.ts} +17 -17
  217. package/test/{v3-view.test.ts → view.test.ts} +2 -2
  218. package/things-factory.config.js +2 -3
  219. package/translations/en.json +2 -2
  220. package/translations/ja.json +2 -2
  221. package/translations/ko.json +2 -2
  222. package/translations/ms.json +2 -2
  223. package/translations/zh.json +2 -2
  224. package/dist-client/graphql/v3-store.d.ts +0 -3
  225. package/dist-client/graphql/v3-store.js.map +0 -1
  226. package/dist-client/modeller/figure-v3-capability.js.map +0 -1
  227. package/dist-client/modeller/figure-v3-clips.js.map +0 -1
  228. package/dist-client/modeller/figure-v3-controls.js.map +0 -1
  229. package/dist-client/modeller/figure-v3-first-save.js.map +0 -1
  230. package/dist-client/modeller/figure-v3-links.js.map +0 -1
  231. package/dist-client/modeller/figure-v3-material.js.map +0 -1
  232. package/dist-client/modeller/figure-v3-parts.js.map +0 -1
  233. package/dist-client/modeller/figure-v3-preview.js.map +0 -1
  234. package/dist-client/modeller/figure-v3-properties.js.map +0 -1
  235. package/dist-client/modeller/figure-v3-recipe-catalog.js.map +0 -1
  236. package/dist-client/modeller/figure-v3-verdict.js.map +0 -1
  237. package/dist-client/modeller/v3-ai-proposal.js.map +0 -1
  238. package/dist-client/modeller/v3-align.js.map +0 -1
  239. package/dist-client/modeller/v3-canvas.js.map +0 -1
  240. package/dist-client/modeller/v3-clips.js.map +0 -1
  241. package/dist-client/modeller/v3-controls.js.map +0 -1
  242. package/dist-client/modeller/v3-editor.js.map +0 -1
  243. package/dist-client/modeller/v3-fields.js.map +0 -1
  244. package/dist-client/modeller/v3-figure-facts.js.map +0 -1
  245. package/dist-client/modeller/v3-first-save.js.map +0 -1
  246. package/dist-client/modeller/v3-gizmo.js.map +0 -1
  247. package/dist-client/modeller/v3-help.js.map +0 -1
  248. package/dist-client/modeller/v3-joint-drag.d.ts +0 -19
  249. package/dist-client/modeller/v3-joint-drag.js.map +0 -1
  250. package/dist-client/modeller/v3-joint-fan.js.map +0 -1
  251. package/dist-client/modeller/v3-keys.js.map +0 -1
  252. package/dist-client/modeller/v3-links.js.map +0 -1
  253. package/dist-client/modeller/v3-live.js.map +0 -1
  254. package/dist-client/modeller/v3-maturity.js.map +0 -1
  255. package/dist-client/modeller/v3-occupancy.js.map +0 -1
  256. package/dist-client/modeller/v3-palette.d.ts +0 -7
  257. package/dist-client/modeller/v3-palette.js.map +0 -1
  258. package/dist-client/modeller/v3-preview-model.js.map +0 -1
  259. package/dist-client/modeller/v3-product-session.js.map +0 -1
  260. package/dist-client/modeller/v3-recipe-source.js.map +0 -1
  261. package/dist-client/modeller/v3-recipes.js.map +0 -1
  262. package/dist-client/modeller/v3-refusals.js.map +0 -1
  263. package/dist-client/modeller/v3-renderer.js.map +0 -1
  264. package/dist-client/modeller/v3-stage-model.js.map +0 -1
  265. package/dist-client/modeller/v3-thumbnail.d.ts +0 -3
  266. package/dist-client/modeller/v3-thumbnail.js.map +0 -1
  267. package/dist-client/pages/figure-v3-modeller-page.js.map +0 -1
  268. package/dist-client/tsconfig.chk.tsbuildinfo +0 -1
  269. package/dist-client/tsconfig.fui.tsbuildinfo +0 -1
  270. package/dist-client/tsconfig.scratch-fm.tsbuildinfo +0 -1
  271. package/docs/v3-product-cutover.md +0 -25
  272. package/test/v3-renderer.test.ts +0 -24
  273. /package/client/modeller/{v3-fields.ts → fields.ts} +0 -0
  274. /package/client/modeller/{v3-first-save.ts → first-save.ts} +0 -0
  275. /package/client/modeller/{v3-help.ts → help.ts} +0 -0
  276. /package/client/modeller/{v3-keys.ts → keys.ts} +0 -0
  277. /package/client/modeller/{v3-refusals.ts → refusals.ts} +0 -0
  278. /package/dist-client/modeller/{v3-fields.d.ts → fields.d.ts} +0 -0
  279. /package/dist-client/modeller/{v3-first-save.d.ts → first-save.d.ts} +0 -0
  280. /package/dist-client/modeller/{v3-help.d.ts → help.d.ts} +0 -0
  281. /package/dist-client/modeller/{v3-keys.d.ts → keys.d.ts} +0 -0
  282. /package/dist-client/modeller/{v3-refusals.d.ts → refusals.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-ai-proposal.js","sourceRoot":"","sources":["../../client/modeller/v3-ai-proposal.ts"],"names":[],"mappings":"AA6CA,gHAAgH;AAChH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,CAAA;AAEhE,SAAS,OAAO,CAAC,IAAwB,EAAE,KAAyB,EAAE,GAAQ;IAC5E,MAAM,IAAI,GACR,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QACrB,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;QACnC,CAAC,CAAC,IAAI,KAAK,oBAAoB;YAC7B,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACf,CAAC,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC,CAAA;IACpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,EAAE,CAAA;AACnE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAwB,EAAE,MAA4B,EAAE,GAAQ;IACtG,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,CAAA;IACzB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,M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,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAC7C,CAAC;AAED;;;;EAIE;AACF,IAAI,OAA+H,CAAA;AAEnI,MAAM,UAAU,aAAa,CAAC,KAAuB,EAAE,EAAE,GAAG,MAAM;IAChE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;IACvD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,MAAM,IAAI,GAAG;YACX,KAAK;YACL,MAAM,EAAE,CAAC,MAA2D,EAAE,EAAE;gBACtE,YAAY,CAAC,KAAK,CAAC,CAAA;gBACnB,IAAI,OAAO,KAAK,IAAI;oBAAE,OAAO,GAAG,SAAS,CAAA;gBACzC,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;SACF,CAAA;QACD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;QACvF,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,OAAO,CAAA;IACrB,OAAO,GAAG,SAAS,CAAA;IACnB,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["/*\n * An AI proposal reaching the modeller (ADR-0094). The dock's card carries the modeller's own commands; running it\n * applies them as one step of the modeller's history, undone whole, on the version the model saw. Nothing half made\n * is applied, and every outcome is said: applied, refused with the reason, or not possible here.\n *\n * Kept free of Lit, i18n and the shell so node tests read it directly; the handler and the page pass in what they own.\n */\nimport type { V3ProposalStep } from '@hatiolab/figure-model'\n\n/** What the card carries, as `proposeFigureCandidate` returned it. */\nexport interface FigureProposalCard {\n steps?: V3ProposalStep[]\n create?: boolean\n figureId?: string\n context?: string\n revision?: number\n}\n\n/** The `figure-v3-apply` event's detail. The page that takes it sets `applied`, and `error` when refused. */\nexport interface FigureApplyDetail {\n steps: V3ProposalStep[]\n create: boolean\n context?: string\n revision?: number\n applied?: boolean\n error?: string\n code?: string\n}\n\nexport type Say = (key: string, params?: Record<string, string>) => string\n\nexport interface FigureProposalTarget {\n /** Offers the proposal to a modeller on screen. It comes back untouched when none took it. */\n offer(detail: FigureApplyDetail): FigureApplyDetail\n /** Opens a new figure in the modeller and applies the steps there; resolves once the page has, or has not. */\n openNew(steps: V3ProposalStep[]): Promise<{ applied: boolean; error?: string; code?: string }>\n}\n\nexport interface FigureProposalOutcome {\n verdict: 'accepted' | 'refused' | 'unavailable'\n errorCode?: string\n applied?: number\n note?: string\n}\n\n/** The workspace refuses a request made on another version; said as what happened, not as the kernel's code. */\nconst STALE = new Set(['REVISION_CONFLICT', 'CONTEXT_CONFLICT'])\n\nfunction refused(code: string | undefined, error: string | undefined, say: Say): FigureProposalOutcome {\n const note =\n code && STALE.has(code)\n ? say('figure.text.proposal-stale')\n : code === 'NEW_FIGURE_UNSAVED'\n ? (error ?? '')\n : say('figure.text.proposal-refused', { reason: error ?? '' })\n return { verdict: 'refused', errorCode: code ?? 'refused', note }\n}\n\nexport async function runFigureProposal(card: FigureProposalCard, target: FigureProposalTarget, say: Say): Promise<FigureProposalOutcome> {\n const steps = card?.steps\n if (!Array.isArray(steps) || !steps.length) return { verdict: 'unavailable', errorCode: 'no-steps' }\n const create = card.create === true\n const accepted = (): FigureProposalOutcome => ({\n verdict: 'accepted',\n applied: steps.length,\n note: say('figure.text.proposal-applied', { n: String(steps.length) })\n })\n\n const detail = target.offer({ steps, create, context: card.context, revision: card.revision })\n if (detail.applied) return accepted()\n if (detail.applied === false) return refused(detail.code, detail.error, say)\n\n /* A revision belongs to the figure the model saw; with that modeller gone there is nowhere true to apply it. */\n if (!create) return { verdict: 'unavailable', errorCode: 'modeller-not-open', note: say('figure.text.proposal-needs-modeller') }\n\n const opened = await target.openNew(steps)\n if (opened.applied) return accepted()\n return opened.code === 'not-opened'\n ? { verdict: 'unavailable', errorCode: 'not-opened', note: say('figure.text.proposal-not-opened') }\n : refused(opened.code, opened.error, say)\n}\n\n/*\n A new figure's proposal handed to the modeller page across a navigation: the handler leaves it here and opens the\n modeller on a new figure; the page takes it once it has started that figure. Left untaken, it lapses -- a later new\n figure must not receive steps nobody is waiting for.\n*/\nlet pending: { steps: V3ProposalStep[]; settle: (result: { applied: boolean; error?: string; code?: string }) => void } | undefined\n\nexport function pendNewFigure(steps: V3ProposalStep[], ms = 10_000): Promise<{ applied: boolean; error?: string; code?: string }> {\n pending?.settle({ applied: false, code: 'not-opened' })\n return new Promise(resolve => {\n const mine = {\n steps,\n settle: (result: { applied: boolean; error?: string; code?: string }) => {\n clearTimeout(timer)\n if (pending === mine) pending = undefined\n resolve(result)\n }\n }\n const timer = setTimeout(() => mine.settle({ applied: false, code: 'not-opened' }), ms)\n pending = mine\n })\n}\n\n/** For the page, on a new figure it has just started: the steps waiting for it, and where to say how it went. */\nexport function takePendingNewFigure(): { steps: V3ProposalStep[]; settle: (result: { applied: boolean; error?: string; code?: string }) => void } | undefined {\n const taken = pending\n pending = undefined\n return taken\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-align.js","sourceRoot":"","sources":["../../client/modeller/v3-align.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAkBvF,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAA;AAErC,MAAM,UAAU,KAAK,CAAC,KAAc,EAAE,IAAY;IAChD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAA;IAC1D,OAAO,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,CAA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AM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC5D,OAAO,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAA;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC3D,MAAM,CAAC,GAAG,GAAG,GAAG,SAAS,CAAA;IACzB,MAAM,QAAQ,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["import { compileV3Asset, v3OccupiedBoxesOf, v3WritersOf } from '@hatiolab/figure-model'\nimport type { V3Asset, V3InputChange, V3WorldBox } from '@hatiolab/figure-model'\n\nimport type { GizmoReach } from './v3-gizmo.js'\n\n/**\n * 맞추기 — the align tools on a part: centre on X, centre on Z, stand on the floor,\n * mirror on X or Z, snap to the grid.\n *\n * The asset's frame has the floor at y 0 and X and Z centred on 0, so centring puts the part's box centre on 0 and the floor puts its lowest point on\n * y 0. The part's box is its evaluated, rotated extent (`v3OccupiedBoxesOf`), so a turned part lands by what it\n * actually covers, not by its unturned size.\n *\n * Every tool writes the part's own position (and, for snap, size) inputs — the same ones the gizmo writes, and only\n * where the gizmo could (`GizmoReach`).\n */\nexport type AlignTool = 'centre-x' | 'centre-z' | 'floor' | 'snap'\n\nconst AXES = ['x', 'y', 'z'] as const\n\nexport function boxOf(asset: V3Asset, part: string): V3WorldBox | undefined {\n const geometry = compileV3Asset(asset).evaluate().geometry\n return v3OccupiedBoxesOf(geometry, v3WritersOf(asset)).find(box => box.part === part)\n}\n\n/** The snapping grid: about five steps across the figure, on 1 · 2 · 5 multiples. */\nexport function gridStepOf(asset: V3Asset): number {\n const geometry = compileV3Asset(asset).evaluate().geometry\n const boxes = v3OccupiedBoxesOf(geometry, v3WritersOf(asset))\n if (!boxes.length) return 1\n const span = Math.max(\n ...AXES.map(axis => {\n const lo = Math.min(...boxes.map(b => b.centre[axis] - b.extent[axis] / 2))\n const hi = Math.max(...boxes.map(b => b.centre[axis] + b.extent[axis] / 2))\n return hi - lo\n })\n )\n return niceStep(span)\n}\n\nexport function alignChanges(asset: V3Asset, part: string, reach: GizmoReach, tool: AlignTool): V3InputChange[] {\n if (!reach.translate) return []\n const box = boxOf(asset, part)\n if (!box) return []\n const value = (id: string) => asset.designInputs[id] ?? 0\n const set = (input: string, next: number): V3InputChange => ({ kind: 'set-design', input, unit: 'mm', value: Math.round(next) })\n const at = (axis: 'x' | 'y' | 'z') => `${part}.position.${axis}`\n switch (tool) {\n case 'centre-x':\n return [set(at('x'), value(at('x')) - box.centre.x)]\n case 'centre-z':\n return [set(at('z'), value(at('z')) - box.centre.z)]\n case 'floor':\n return [set(at('y'), value(at('y')) - (box.centre.y - box.extent.y / 2))]\n case 'snap': {\n const step = gridStepOf(asset)\n const round = (n: number) => Math.round(n / step) * step\n const changes = AXES.map(axis => set(at(axis), round(value(at(axis)))))\n /* A size never snaps to 0 — the part would look gone. */\n if (reach.scale && reach.sizes)\n for (const id of reach.sizes) changes.push(set(id, Math.max(step, round(value(id)))))\n return changes\n }\n }\n}\n\n/**\n * Where a mirrored copy goes: the same distance on the other side of the centre plane. The copy is made by\n * `duplicate-part` first; this is the position the copy is then given.\n */\nexport function mirrorChanges(asset: V3Asset, part: string, copy: string, axis: 'x' | 'z'): V3InputChange[] {\n const box = boxOf(asset, part)\n if (!box) return []\n const id = `${part}.position.${axis}`\n return [{ kind: 'set-design', input: `${copy}.position.${axis}`, unit: 'mm', value: Math.round((asset.designInputs[id] ?? 0) - 2 * box.centre[axis]) }]\n}\n\n/** Mirroring a part that already sits on the centre plane would put the copy inside it, so it is refused. */\nexport function canMirror(asset: V3Asset, part: string, axis: 'x' | 'z', reach: GizmoReach): boolean {\n const box = reach.translate ? boxOf(asset, part) : undefined\n return !!box && Math.abs(box.centre[axis]) >= 0.5\n}\n\n/**\n * A **readable** grid step for a length: about five cells, rounded up to a 1, 2 or 5 multiple as rulers and charts do.\n * Divided plainly it gives 27 or 33, and coordinates snapped to that read as 54 and 81. Never 0.\n */\nexport function niceStep(span: number): number {\n const raw = Math.max(span, 1) / 5\n const magnitude = Math.pow(10, Math.floor(Math.log10(raw)))\n const n = raw / magnitude\n const multiple = n < 1.5 ? 1 : n < 3.5 ? 2 : n < 7.5 ? 5 : 10\n return Math.max(1, multiple * magnitude)\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-canvas.js","sourceRoot":"","sources":["../../client/modeller/v3-canvas.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAuB,MAAM,KAAK,CAAA;AACpF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAIpE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAA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A1CxC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4T1B","sourcesContent":["import { LitElement, html, css, nothing, unsafeCSS, type PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { create, Model, niceGridStep } from '@hatiolab/things-scene'\n\nimport type { GizmoReach } from './v3-gizmo.js'\nimport type { V3RenderPart } from './v3-renderer.js'\nimport { DEFAULT_VIEW, sceneLook, WORKBENCH, type ViewSettings } from './figure-view.js'\nimport { boardFor, changedKeys, componentOf, gizmoResultOf, type Board } from './v3-stage-model.js'\nimport { JOINT_FAN } from './v3-joint-fan.js'\nimport { ownerOf } from './v3-fields.js'\n\n/*\n * The modeller's canvas -- a things-scene board in editing mode.\n *\n * Each body figure-model evaluates stands on the board as a `figure-v3-part` component, so everything the canvas\n * has comes from the scene, not from code of our own: picking and the orange outline, the gizmo with its snapping and\n * live readout, box and shift selection, the camera (damping, zoom toward the cursor, double-click to fit, the six\n * view presets and their keys), the studio environment, the coordinate ground, lights and shadows, supersampling.\n * An earlier canvas drew the bodies with three.js directly and lost all of that (user, 2026-09-24: \"why nerf it?\").\n *\n * What the gizmo writes back to a component comes out as `part-transformed` in the inputs' terms (`v3-stage-model`),\n * and the editor turns it into one step of the history; the next evaluation puts the component where the inputs say,\n * so a change a part cannot take (a fastened part moved) springs back.\n */\n\ninterface SceneComponent {\n state: Record<string, unknown>\n set: (props: Record<string, unknown>) => void\n dispose?: () => void\n}\ninterface SceneLayer extends SceneComponent {\n components?: SceneComponent[]\n root?: { on?: (event: string, handler: (...args: unknown[]) => void) => void; selected?: SceneComponent[] }\n on?: (event: string, handler: (...args: unknown[]) => void) => void\n addComponent?: (component: SceneComponent) => void\n removeComponent?: (component: SceneComponent) => void\n invalidate?: () => void\n fitCameraToModel?: () => void\n setGizmoMode?: (mode: 'translate' | 'rotate' | 'scale') => void\n app?: unknown\n}\ninterface SceneHandle {\n dispose?: () => void\n resize?: () => void\n fit?: (type?: string) => void\n root?: SceneLayer\n}\n\n/* The fan's colour when the figure's palette names no accent. */\nconst FAN_COLOUR = '#ff8a00'\n\n/* The 2D side of the board, which the author never sees on this page but the scene paints. */\nconst PAPER = '#ffffff'\n\n@customElement('figure-v3-canvas')\nexport class FigureV3Canvas extends LitElement {\n static styles = css`\n :host {\n position: relative;\n display: flex;\n min-height: 0;\n overflow: hidden;\n background-color: ${unsafeCSS(WORKBENCH)};\n }\n /* The scene sets position: relative inline on its target; the size is given so it still fills the host. */\n div[stage] {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n }\n p {\n position: absolute;\n inset: 45% 1rem auto;\n margin: 0;\n text-align: center;\n pointer-events: none;\n color: #f4f4f4;\n }\n `\n @property({ attribute: false }) parts: V3RenderPart[] = []\n @property({ attribute: false }) palette: Record<string, string> = {}\n /** Which figure is open. Another one stands the board up again. */\n @property() context = ''\n @property() selected = ''\n /** What the gizmo may write for the selected part; a change beyond it is not applied and the part springs back. */\n @property({ attribute: false }) reach: GizmoReach = { translate: false, rotate: false, scale: false }\n @property({ attribute: false }) view: ViewSettings = DEFAULT_VIEW\n /**\n * View only: nothing that happens on the board is told out. The card's picture is taken from a second canvas stood up\n * off screen (`v3-thumbnail.ts`); the scene settles its components as it builds them, and a change told from there\n * would reach the editor as an edit.\n */\n @property({ type: Boolean }) viewOnly = false\n /** Where the selected part turns and how far (`v3-joint-fan`): shown, never picked, never saved. */\n @property({ attribute: false }) fan: V3RenderPart | null = null\n\n @query('div[stage]') private stage!: HTMLDivElement\n\n private scene?: SceneHandle\n private board?: Board & { depth: number }\n private standingFor?: string\n private watcher?: ResizeObserver\n /** Set while this canvas writes to components, so the scene's echo of it is not taken for a drag. */\n private writing = false\n\n render() {\n return html`<div stage></div>${this.parts.length ? nothing : html`<p>${i18next.t('figure.text.add-a-shape-to-start')}</p>`}`\n }\n\n firstUpdated() {\n this.standUp()\n this.watcher = new ResizeObserver(() => this.scene?.resize?.())\n this.watcher.observe(this)\n }\n\n protected updated(changed: PropertyValues) {\n if (!this.hasUpdated) return\n if (changed.has('parts') || changed.has('palette') || changed.has('context') || changed.has('fan')) this.standUp()\n if (changed.has('view')) this.applyView()\n if (changed.has('selected')) this.showSelected()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.watcher?.disconnect()\n this.watcher = undefined\n this.teardown()\n }\n\n /**\n * The board as a picture, for the card: the 3D view at this size, or nothing when it cannot be taken. The scene's\n * `toDataURL` renders the 2D board (a white sheet), and the 3D renderer keeps no drawing buffer, so the\n * scene's own `snapshot3d` draws and reads in one task. A picture that cannot be taken is not an error and is not\n * faked (user, 2026-09-24: no card had a picture after this canvas moved onto the scene).\n */\n async snapshot(width = 480, height = 360): Promise<string | undefined> {\n const layer = this.scene?.root as (SceneLayer & { snapshot3d?: (w?: number, h?: number, type?: string, quality?: number) => Promise<string | undefined> }) | undefined\n if (!layer?.snapshot3d) return undefined\n try {\n /* webp: a card needs no alpha, and png is three or four times heavier in every list response. */\n const url = await layer.snapshot3d(width, height, 'image/webp', 0.85)\n return typeof url === 'string' && url.startsWith('data:') ? url : undefined\n } catch (e) {\n console.warn(`[thumbnail] could not take the picture -- ${(e as Error).message}`)\n return undefined\n }\n }\n\n /** The whole figure in view: the board's fit, then the 3D camera's own. */\n fit() {\n this.scene?.fit?.('ratio')\n this.scene?.root?.fitCameraToModel?.()\n }\n\n /** The gizmo in a mode on the selected part, as W, E and R do with the canvas focused -- the scene's toggle. */\n gizmo(mode: 'translate' | 'rotate' | 'scale') {\n this.scene?.root?.setGizmoMode?.(mode)\n }\n\n /**\n * Stand the board up for this figure, or bring the one standing up to date. A new board only for another figure or\n * one that has outgrown it -- standing up again loses the selection and the camera.\n */\n private standUp() {\n if (!this.stage) return\n const needed = boardFor(this.parts, this.board)\n const outgrown = !this.board || needed.width > this.board.width || needed.height > this.board.height || needed.depth > this.board.depth\n if (this.scene && this.standingFor === this.context) {\n /*\n A part dragged past the board's edge grows the board where it stands. Standing it up again lost the selection,\n the gizmo and the camera after every such drag -- the gizmo seemed not to work at all (user, 2026-09-24).\n */\n if (outgrown) this.grow(needed)\n this.sync()\n return\n }\n this.teardown()\n if (!this.parts.length) return\n this.board = needed\n try {\n this.scene = create({\n target: this.stage,\n model: {\n type: 'model-layer',\n width: needed.width,\n height: needed.height,\n depth: needed.depth,\n threed: true,\n /* Two samples a pixel: MSAA alone leaves steps on the silhouettes of one asset shown large. */\n pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),\n ...sceneLook(this.view ?? DEFAULT_VIEW),\n gridStep: niceGridStep(Math.max(needed.width, needed.height)),\n sky: 'color',\n fillStyle: PAPER,\n components: this.components()\n },\n /* Editing mode: the camera view buttons, gizmo modes, help and keys. */\n mode: 1\n }) as SceneHandle\n this.standingFor = this.context\n this.watchScene()\n this.scene.resize?.()\n this.fit()\n this.showSelected()\n } catch (error) {\n this.dispatchEvent(new CustomEvent('render-error', { detail: error, bubbles: true, composed: true }))\n }\n }\n\n private components(): Record<string, unknown>[] {\n const parts = this.parts.map(part => componentOf(part, this.palette, this.board!)).filter((c): c is Record<string, unknown> => !!c)\n /* The fan in the accent colour, translucent; `capturable: false` keeps clicks, the marquee and the gizmo off it. */\n const fan = this.fan ? componentOf(this.fan, { ...this.palette, [JOINT_FAN]: this.palette['palette.accent'] ?? FAN_COLOUR }, this.board!) : null\n return fan ? [...parts, { ...fan, capturable: false, locked: true }] : parts\n }\n\n /** The components standing now, by name. Not held between calls: the scene stands its board up again at times. */\n private standing(): Map<string, SceneComponent> {\n const found = new Map<string, SceneComponent>()\n for (const component of this.scene?.root?.components ?? []) {\n const name = component.state?.name\n if (typeof name === 'string') found.set(name, component)\n }\n return found\n }\n\n /** A larger board under the same scene: its size, and the grid that suits it. Components are re-placed by `sync`. */\n private grow(needed: Board & { depth: number }) {\n const layer = this.scene?.root\n this.board = needed\n if (!layer) return\n this.writing = true\n try {\n layer.set({ width: needed.width, height: needed.height, depth: needed.depth, gridStep: niceGridStep(Math.max(needed.width, needed.height)) })\n } finally {\n this.writing = false\n }\n }\n\n /** Bring the components to the evaluation: remove the gone, write only what differs, add the new. */\n private sync() {\n const layer = this.scene?.root\n if (!layer || !this.board) return\n const wanted = new Map(this.components().map(c => [c.name as string, c]))\n const standing = this.standing()\n this.writing = true\n try {\n for (const [name, component] of standing) {\n if (wanted.has(name)) continue\n layer.removeComponent?.(component)\n component.dispose?.()\n }\n for (const [name, state] of wanted) {\n const found = standing.get(name)\n if (found) {\n const diff = changedKeys(found.state, state)\n if (diff) found.set(diff)\n continue\n }\n const made = Model.compile({ ...state }, layer.app as never) as SceneComponent | null\n if (made) layer.addComponent?.(made)\n }\n } finally {\n this.writing = false\n }\n layer.invalidate?.()\n }\n\n /** Selection and drags, told out by the part's name -- never by its place in the list, which may change meanwhile. */\n private watchScene() {\n const layer = this.scene?.root\n const root = layer?.root\n if (!layer || !root?.on || this.viewOnly) return\n root.on('selected', (after: unknown) => {\n const name = (after as SceneComponent[] | undefined)?.[0]?.state?.name\n const id = typeof name === 'string' ? name : ''\n if (ownerOf(id) !== this.selected) this.dispatchEvent(new CustomEvent('part-selected', { detail: id, bubbles: true, composed: true }))\n })\n /*\n A change comes up to the board with the component in the last argument's `origin` (the scene appends\n { origin, name, deliverer } as it bubbles). Reading the first argument as the component does nothing.\n */\n /*\n A drag is written once, when it ends. The scene's gizmo writes the component on every move -- a size anchored on\n the opposite face, from the scale it captured when the drag began -- and writing each move back through the\n editor (and the evaluation back onto the component) fought it: the scale gizmo did not work (user, 2026-09-24).\n While a pointer is down the changes are only kept; on release the last one is told, and the board is brought to\n the evaluation. A change with no pointer down (the arrow keys) is told after a short pause.\n */\n layer.on?.('change', (...args: unknown[]) => {\n if (this.writing) return\n const origin = (args[args.length - 1] as { origin?: SceneComponent } | undefined)?.origin\n const name = origin?.state?.name\n if (typeof name !== 'string' || !this.parts.some(p => p.id === name)) return\n this.pending.set(name, origin!)\n if (!this.pointerDown) this.commitSoon(80)\n })\n this.stage.addEventListener('pointerdown', this.onPointerDown, true)\n window.addEventListener('pointerup', this.onPointerUp, true)\n window.addEventListener('pointercancel', this.onPointerUp, true)\n }\n\n /** Components the gizmo changed since the last commit, by part name. */\n private pending = new Map<string, SceneComponent>()\n private pointerDown = false\n private commitTimer?: ReturnType<typeof setTimeout>\n private onPointerDown = () => {\n this.pointerDown = true\n }\n private onPointerUp = () => {\n if (!this.pointerDown) return\n this.pointerDown = false\n /* After the scene's own drag end (it settles the depth and rebuilds the geometry on release). */\n this.commitSoon(0)\n }\n private commitSoon(delay: number) {\n clearTimeout(this.commitTimer)\n this.commitTimer = setTimeout(() => this.commit(), delay)\n }\n /** Tell each changed part once, in the inputs' terms; then put the board where the inputs say (a refusal springs back). */\n private commit() {\n /*\n Not while a pointer is down: a pause set by a change just before the press (the arrow keys, the scene settling\n the pick) fired in the middle of the drag and wrote where the part was then -- a drag on a part placed by a rule\n became two steps, the first one a few millimetres in (browser check, 2026-09-25). What is pending waits for the release.\n */\n if (this.pointerDown || !this.board || !this.pending.size) return\n const changed = [...this.pending]\n this.pending.clear()\n for (const [name, component] of changed) {\n const part = this.parts.find(p => p.id === name)\n if (!part) continue\n const result = gizmoResultOf(part, component.state, this.board)\n if (!result.position && !result.rotation && !result.scale) continue\n this.dispatchEvent(new CustomEvent('part-transformed', { detail: { id: part.id, result }, bubbles: true, composed: true }))\n }\n setTimeout(() => this.sync())\n }\n\n private showSelected() {\n const layer = this.scene?.root\n const root = layer?.root\n if (!layer || !root) return\n /* A repeat is selected whole: every copy of it (the editor selects the part the author made). */\n const wanted = this.selected ? [...this.standing()].filter(([name]) => ownerOf(name) === this.selected).map(([, component]) => component) : []\n const now = root.selected ?? []\n if (now.length === wanted.length && wanted.every((one, i) => now[i] === one)) return\n root.selected = wanted\n layer.invalidate?.()\n }\n\n /** View settings go into the scene as they are: they are the board's own state names. Nothing is stood up again. */\n private applyView() {\n const layer = this.scene?.root\n if (!layer) return\n layer.set(sceneLook(this.view ?? DEFAULT_VIEW))\n layer.invalidate?.()\n }\n\n private teardown() {\n clearTimeout(this.commitTimer)\n this.pending.clear()\n this.stage?.removeEventListener('pointerdown', this.onPointerDown, true)\n window.removeEventListener('pointerup', this.onPointerUp, true)\n window.removeEventListener('pointercancel', this.onPointerUp, true)\n this.scene?.dispose?.()\n this.scene = undefined\n this.standingFor = undefined\n this.board = undefined\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-clips.js","sourceRoot":"","sources":["../../client/modeller/v3-clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AA4BpD,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;AAExD,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAA;IACrC,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACjC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;QACzF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,KAAK,EAAE,KAAK,CAAC,WA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CAAC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAChD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAU,EAAE,KAAgB,EAAE,QAAqE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnI,IAAI,EAAE,YAAqB;IAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;IAClB,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI;IAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI;IAC9B,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa;CAC1D,CAAC,CAAA","sourcesContent":["import { driverValue } from '@hatiolab/figure-model'\nimport type { V3Asset, V3Driver, V3InputChange } from '@hatiolab/figure-model'\n\n/*\n * The figure's clips: controls played by keys over time, grouped into clips that each run on one\n * clock. Kept apart from the element so the reading is tested without a browser.\n */\nexport interface ClipKey {\n seconds: number\n value: number\n}\nexport interface ClipTrack {\n state: string\n label: string\n unit: string\n min: number\n max: number\n keys: ClipKey[]\n interpolation: 'linear' | 'step'\n loop: 'wrap' | 'hold'\n accumulates: boolean\n}\nexport interface Clip {\n name: string\n duration: number\n tracks: ClipTrack[]\n}\n\nconst round = (n: number) => Math.round(n * 1000) / 1000\n\nexport function clipsOf(asset: V3Asset): Clip[] {\n const inputs = new Map(asset.document.model.inputs.map(i => [i.id, i]))\n const clips = new Map<string, Clip>()\n for (const d of asset.drivers ?? []) {\n const input = inputs.get(d.state)\n const clip = clips.get(d.clip) ?? { name: d.clip, duration: d.time.duration, tracks: [] }\n clip.tracks.push({\n state: d.state,\n label: asset.stateInputs?.[d.state]?.label ?? d.state,\n unit: input?.unit ?? '',\n min: input?.min ?? 0,\n max: input?.max ?? 0,\n keys: d.keys.map(k => ({ seconds: round(k.at * d.time.duration), value: k.value })),\n interpolation: d.interpolation,\n loop: d.loop,\n accumulates: d.accumulates\n })\n clips.set(d.clip, clip)\n }\n return [...clips.values()]\n}\n\n/** The controls no clip plays yet -- the ones a new track can take. One driver per control. */\nexport function undrivenOf(asset: V3Asset): string[] {\n const driven = new Set((asset.drivers ?? []).map(d => d.state))\n return asset.document.model.inputs.filter(i => i.role === 'state' && !driven.has(i.id)).map(i => i.id)\n}\n\n/** The pose a clip gives at a moment, as one batch of state changes -- one step of the history. */\nexport function poseAt(asset: V3Asset, clip: string, seconds: number): V3InputChange[] {\n const units = new Map(asset.document.model.inputs.map(i => [i.id, i.unit]))\n return (asset.drivers ?? [])\n .filter((d: V3Driver) => d.clip === clip)\n .map(d => {\n const unit = units.get(d.state)!\n return { kind: 'set-state' as const, input: d.state, unit, value: driverValue(d, seconds, unit === 'deg' || unit === 'rad' ? unit : 'other') }\n })\n}\n\n/** A key added at a moment, replacing one already there; the keys stay in time order. */\nexport function withKey(keys: readonly ClipKey[], key: ClipKey): ClipKey[] {\n return [...keys.filter(k => k.seconds !== key.seconds), key].sort((a, b) => a.seconds - b.seconds)\n}\n\n/** A track's keys without one; a track keeps at least its two ends, as the format asks. */\nexport function withoutKey(keys: readonly ClipKey[], index: number): ClipKey[] | null {\n if (keys.length <= 2 || index === 0) return null\n return keys.filter((_, i) => i !== index)\n}\n\n/** The edit that writes a track back. */\nexport const trackEdit = (clip: Clip, track: ClipTrack, patch: Partial<Pick<ClipTrack, 'keys' | 'loop' | 'interpolation'>> = {}) => ({\n kind: 'set-driver' as const,\n state: track.state,\n clip: clip.name,\n keys: patch.keys ?? track.keys,\n loop: patch.loop ?? track.loop,\n interpolation: patch.interpolation ?? track.interpolation\n})\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-controls.js","sourceRoot":"","sources":["../../client/modeller/v3-controls.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M,CAAC,MAAM,aAAa,GAAG,CAAC,QAA4B,EAAE,EAAE,CAAC,CAAC;IAC9D,IAAI,EAAE,oBAA6B;IACnC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC/D,CAAC,CAAA","sourcesContent":["import type { V3Asset } from '@hatiolab/figure-model'\n\n/*\n * The figure's controls -- its state inputs: the values a board or a connector sets to pose\n * the figure (a lift height, a joint angle, a gripper opening). Kept apart from the element so the reading is tested\n * without a browser.\n */\nexport interface Control {\n id: string\n /** The name a person reads, or the id when none is given. */\n label: string\n named: boolean\n unit: string\n min: number\n max: number\n /** Where it stands in the editor now -- the pose being looked at, not yet the default. */\n value: number\n /** Where it starts when the figure is placed: the default pose. */\n start: number\n /** Seconds to travel the whole range, 0 when it moves at once. */\n sweep: number\n /** A slider step: one degree for an angle, else a hundredth of the range. */\n step: number\n}\n\nexport function controlsOf(asset: V3Asset, values: Record<string, number> = {}): Control[] {\n return asset.document.model.inputs\n .filter(input => input.role === 'state')\n .map(input => {\n const policy = asset.stateInputs?.[input.id]\n const start = asset.stateDefaults[input.id] ?? input.min\n return {\n id: input.id,\n label: policy?.label ?? input.id,\n named: !!policy?.label,\n unit: input.unit,\n min: input.min,\n max: input.max,\n value: values[input.id] ?? start,\n start,\n sweep: policy?.sweep ?? 0,\n step: input.unit === 'deg' ? 1 : (input.max - input.min) / 100\n }\n })\n}\n\n/** Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. */\nexport const poseDiffers = (controls: readonly Control[]) => controls.some(c => c.value !== c.start)\n\n/** The current pose as the defaults: one `set-state-defaults` edit. */\nexport const poseAsDefault = (controls: readonly Control[]) => ({\n kind: 'set-state-defaults' as const,\n values: Object.fromEntries(controls.map(c => [c.id, c.value]))\n})\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":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;AAEhC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CAA4C;AAC3C;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;mDAAuC;AAErD;IAAhB,KAAK,EAAE;;kDAA+E;AACtE;IAAhB,KAAK,EAAE;;mDAA4B;AAEnB;IAAhB,KAAK,EAAE;;mDAAyB;AACL;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAAmB;AAEd;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;8CAAsB;AAKrB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAA6D;AAC3E;IAAhB,KAAK,EAAE;;gDAAsB;AACb;IAAhB,KAAK,EAAE;;6CAAmB;AAEV;IAAhB,KAAK,EAAE;;6CAAgF;AACvE;IAAhB,KAAK,EAAE;;2CAAoC;AAE3B;IAAhB,KAAK,EAAE;;6CAA4B;AAEnB;IAAhB,KAAK,EAAE;;8CAA4C;AAEnC;IAAhB,KAAK,EAAE;;iDAAqD;AAE5C;IAAhB,KAAK,EAAE;;8CAAoB;AAKX;IAAhB,KAAK,EAAE;;4CAAyD;AAqBhD;IAAhB,KAAK,EAAE;;mDAAwC;AAE/B;IAAhB,KAAK,EAAE;;4CAAwC;AAnRrC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAg2C1B","sourcesContent":["import { LitElement, html, css, nothing, type PropertyValues } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport type { OxThreePane } from '@operato/layout'\nimport '@operato/layout'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\nimport { PART_LIMIT, parseV3Recipe, resolveV3Recipe, v3PartCountOf, v3RecipeIdFor } from '@hatiolab/figure-model'\nimport type { RecipeTemplate } from './v3-recipes.js'\nimport './figure-v3-recipe-catalog.js'\nimport type { V3Asset, V3AuthoringAction, V3InputChange, V3PartEdit, V3PrimitiveCreation, V3ProposalStep, V3Recipe, V3RecipeValue } from '@hatiolab/figure-model'\nimport type { V3ProductSession } from './v3-product-session.js'\nimport { captureV3Thumbnail } from './v3-thumbnail.js'\nimport { drawableV3Parts } from './v3-renderer.js'\nimport './v3-canvas.js'\nimport './figure-v3-parts.js'\nimport './figure-v3-material.js'\nimport './figure-v3-links.js'\nimport './figure-v3-controls.js'\nimport './figure-v3-clips.js'\nimport './figure-v3-preview.js'\nimport './figure-settings.js'\nimport { DEFAULT_VIEW, type ViewSettings } from './figure-view.js'\nimport './figure-v3-capability.js'\nimport { gizmoChanges, gizmoReachOf, keepBottomChanges, type GizmoReach, type GizmoResult } from './v3-gizmo.js'\nimport { keyActionOf } from './v3-keys.js'\nimport { groupFields, ownerOf, partLabelOf, repeatOf, type FieldLike, type FieldGroup } from './v3-fields.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { alignChanges, boxOf, canMirror, mirrorChanges, type AlignTool } from './v3-align.js'\nimport type { V3PaletteKind, V3PartRow } from './figure-v3-parts.js'\nimport { paletteRecipe } from './v3-palette.js'\nimport type { FigureV3Canvas } from './v3-canvas.js'\nimport { nudgeOf } from './v3-stage-model.js'\nimport { editRefusalOf, inDeclaredRoom, inputRangeRefusalOf, narrowingRetryOf, partRefusalOf, placementRefusalOf, recipeRefusalOf, removalNoticeOf, sizeRangeRefusalOf } from './v3-refusals.js'\nimport type { V3RenderPart } from './v3-renderer.js'\nimport type { V3BudgetLine } from './v3-maturity.js'\nimport { instanceRangeOf, instanceRangeToDeclare, proportionToFollow, rangeDiffers, rangeWith, turnsAboutAJoint, valueNow } from './v3-links.js'\nimport { jointFanOf } from './v3-joint-fan.js'\nimport { jointDragOf } from './v3-joint-drag.js'\nimport type { FirstSave } from './v3-first-save.js'\nimport { isLive, livePartsOf, liveOverSession, NOTHING_LIVE, scrubbed, scrubStep, type LiveValues } from './v3-live.js'\n\n\n/**\n * The side's tabs: properties, what it does (places), motion, the verdict, the view, the release history. A figure-level tab (verdict, history) gives way to properties when a part is chosen; a tab about\n * parts keeps showing the newly chosen part.\n */\ntype SideTab = 'properties' | 'capability' | 'motion' | 'verdict' | 'view' | 'history'\n\n/** Product editor surface. The injected session is shared by page persistence and AI commands. */\n@customElement('figure-v3-editor')\nexport class FigureV3Editor extends LitElement {\n /* The operato scrollbar, as every scrolling panel of the app has it -- the side panel scrolled with the browser's own. */\n static styles = [ScrollbarStyles, SidePanelStyles, css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n /* The editor folds by the width it is given, not the window's (UX ruling, 2026-09-24). */\n container-type: inline-size;\n font: 13px sans-serif;\n color: var(--md-sys-color-on-surface);\n }\n /* The bar over the work is ox-canvas-bar (ADR-0060 decision 8): the folds at its edges, undo, redo and\n fit in the suite's places. What the editor puts in it - the mode switch, the status, save - is styled here. */\n ox-canvas-bar button[mode] {\n height: 28px;\n padding: 0 10px;\n border-radius: 999em;\n border-color: transparent;\n background: none;\n }\n ox-canvas-bar button[mode][aria-pressed='true'] {\n border-color: var(--md-sys-color-primary);\n }\n /* The gizmo's tools, drawn as the bar's own icon buttons (undo, redo, fit). */\n ox-canvas-bar .gizmo-tools {\n display: inline-flex;\n gap: 2px;\n padding-left: 4px;\n border-left: 1px solid var(--md-sys-color-outline-variant);\n }\n ox-canvas-bar button[tool] {\n display: inline-grid;\n place-items: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: var(--md-sys-shape-corner-small, 8px);\n background: transparent;\n color: var(--md-sys-color-on-surface-variant);\n cursor: pointer;\n }\n ox-canvas-bar button[tool]:hover:not(:disabled) {\n background: var(--md-sys-color-surface-container-high);\n color: var(--md-sys-color-on-surface);\n }\n ox-canvas-bar button[tool][aria-pressed='true'] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n ox-canvas-bar button[tool]:disabled {\n opacity: 0.38;\n cursor: default;\n }\n figure-v3-preview {\n min-width: 0;\n min-height: 0;\n }\n ox-canvas-bar .status {\n padding: 0 8px;\n color: var(--md-sys-color-on-surface-variant);\n }\n ox-canvas-bar .status[dirty] {\n color: var(--md-sys-color-primary);\n font-weight: 600;\n }\n ox-canvas-bar button[save] {\n height: 32px;\n padding: 0 14px;\n border: none;\n border-radius: 999em;\n color: var(--md-sys-color-on-primary);\n background: var(--md-sys-color-primary);\n }\n /* The three panes are ox-three-pane's (ADR-0060 decision 8): widths 200 | 1fr | 340, 160 | 300 under\n 860px and one column with the middle first under 560px are the frame's, as are the dividers. */\n ox-three-pane {\n flex: 1;\n min-height: 0;\n }\n figure-v3-parts {\n min-height: 0;\n }\n figure-v3-canvas {\n min-width: 0;\n min-height: 0;\n }\n /* The side: tabs over one panel at a time, each using the whole height. */\n aside {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--md-sys-color-surface-container-lowest);\n }\n div[tabs] {\n display: flex;\n flex: none;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n button[tab] {\n flex: 1;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 38px;\n padding: 0;\n border: none;\n border-radius: 0;\n border-bottom: 2px solid transparent;\n background: none;\n color: var(--md-sys-color-on-surface-variant);\n }\n button[tab]:hover:not([on]) {\n background: var(--md-sys-color-surface-container);\n }\n button[tab][on] {\n color: var(--md-sys-color-primary);\n border-bottom-color: var(--md-sys-color-primary);\n }\n button[tab] md-icon {\n font-size: 20px;\n width: 20px;\n height: 20px;\n }\n span[badge] {\n position: absolute;\n top: 3px;\n right: 2px;\n padding: 0 5px;\n font-size: 0.62rem;\n font-weight: 700;\n line-height: 1.5;\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border-radius: 999em;\n pointer-events: none;\n }\n /* The sections inside carry the margins (side-panel-styles); the panel only scrolls. */\n div[panel] {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 0;\n }\n div[panel][flush] {\n padding: 0;\n }\n /* Hidden, not removed: a panel keeps what it holds (the verdict its last answer) while another tab is open. */\n [off] {\n display: none !important;\n }\n /* Which part the panel speaks of, and the way back to the whole figure. */\n div[subject] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 10px 0;\n }\n div[subject] button[chip] {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n height: 26px;\n padding: 0 10px 0 6px;\n border-radius: 999em;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[subject] md-icon {\n font-size: 16px;\n width: 16px;\n height: 16px;\n }\n button {\n font: inherit;\n box-sizing: border-box;\n height: 32px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n background: var(--md-sys-color-surface);\n color: inherit;\n padding: 0 8px;\n min-width: 0;\n }\n button {\n cursor: pointer;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n button[aria-pressed='true'] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n border-color: var(--md-sys-color-primary);\n }\n .error {\n padding: 10px;\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n white-space: pre-wrap;\n }\n .notice {\n padding: 8px 10px;\n background: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n }\n .hint {\n color: var(--md-sys-color-on-surface-variant);\n line-height: 1.5;\n }\n `]\n @property({ attribute: false }) session?: V3ProductSession\n /** The recipe templates (ADR-0095), read by the page from the server. */\n @property({ attribute: false }) templates: RecipeTemplate[] = []\n /** Reads a template's guide; given by the page. */\n @property({ attribute: false }) guideOf?: (name: string) => Promise<string>\n @property({ attribute: false }) thumbnailOf?: (name: string) => string\n /** The 「보드에서 바꿀 수 있음」 form being filled for a row, before it is published (ADR-0096). */\n @state() private publishing?: { part: string; label: string; min: number; max: number }\n @state() private catalogOpen = false\n /** Why the last recipe was refused, in the kernel's words. */\n @state() private recipeError = ''\n @property({ type: Number }) revision = 0\n /** The verdict's count, drawn on its tab so it stays in sight while another tab is open. */\n @property({ type: Number }) instances?: number\n /** The cost line the parts list shows, from the maturity report. */\n @property({ attribute: false }) budget?: V3BudgetLine\n /**\n * Asks the type and name of a figure saved for the first time (the host has the catalogue's names); undefined\n * when the author cancels, and then nothing is saved. Without it a new figure is saved under a temporary type.\n */\n @property({ attribute: false }) firstSave?: (name: string) => Promise<FirstSave | undefined>\n @state() private selected = ''\n @state() private error = ''\n /** The same link offered again with the size range narrowed, after a link the declared range could not hold. */\n @state() private retry?: { label: string; action?: V3AuthoringAction; run?: () => void }\n @state() private tab: SideTab = 'properties'\n /** The frame the bar folds - found after the first render, since the bar is drawn before it. */\n @state() private panes?: OxThreePane\n /** What the middle shows: the parts being edited, or the figure placed on a board at eight sizes. */\n @state() private middle: 'edit' | 'preview' = 'edit'\n /** The gizmo shown on the selected part, as the tools in the bar and W · E · R choose it; none once the part changes. */\n @state() private gizmoMode?: 'translate' | 'rotate' | 'scale'\n /** A line saying what a command did besides what was asked; gone at the next command. */\n @state() private notice = ''\n /**\n * How the workbench shows the figure, in the board's own state names. The viewer's, kept in\n * their browser, never in the figure.\n */\n @state() private view: ViewSettings = FigureV3Editor.storedView()\n private static storedView(): ViewSettings {\n try {\n const stored = JSON.parse(localStorage.getItem('figure-v3-view') ?? 'null')\n return stored && typeof stored === 'object' ? { ...DEFAULT_VIEW, ...stored } : { ...DEFAULT_VIEW }\n } catch {\n return { ...DEFAULT_VIEW }\n }\n }\n private setView(view: ViewSettings) {\n this.view = { ...DEFAULT_VIEW, ...view }\n try {\n localStorage.setItem('figure-v3-view', JSON.stringify(this.view))\n } catch {\n /* A browser that keeps nothing still shows the change for this visit. */\n }\n }\n /**\n * Parts hidden on the workbench — the author's view while working, not the asset's visibility. Not saved: a part\n * hidden here is still in the figure, still checked, still drawn on a board.\n */\n @state() private hiddenParts = new Set<string>()\n /** A value in hand -- typed, held on a spinner, scrubbed, dragged -- drawn at once and recorded on release. */\n @state() private live: LiveValues = NOTHING_LIVE\n private lastContext: string | null = null\n /**\n * Move, turn and size on the canvas, in the bar's tools: the gizmo the W · E · R keys give, found without knowing the\n * keys (2026-09-26 -- a person dragging the part turned the camera). Each is offered only where the part's own\n * numbers can take it (`gizmoReachOf`).\n */\n private renderGizmoTools(editing: boolean) {\n const reach = editing && this.selected ? this.reachOf(this.selected) : undefined\n const tools = [\n { mode: 'translate', icon: 'open_with', key: 'W', can: !!reach?.translate },\n { mode: 'rotate', icon: '3d_rotation', key: 'E', can: !!reach?.rotate },\n { mode: 'scale', icon: 'open_in_full', key: 'R', can: !!reach?.scale }\n ] as const\n return html`<span class=\"gizmo-tools\" role=\"group\" aria-label=${i18next.t('figure.label.gizmo-tools')}>\n ${tools.map(\n tool => html`<button\n tool\n aria-pressed=${String(this.gizmoMode === tool.mode)}\n ?disabled=${!tool.can}\n aria-label=${i18next.t('figure.button.gizmo-' + tool.mode)}\n title=${`${i18next.t('figure.button.gizmo-' + tool.mode)} (${tool.key})${tool.can || !this.selected ? '' : ' · ' + i18next.t('figure.text.gizmo-not-own')}`}\n @click=${() => this.useGizmo(tool.mode)}\n >\n <md-icon>${tool.icon}</md-icon>\n </button>`\n )}\n </span>`\n }\n /** The modeller's keys (`v3-keys.ts`): undo, redo, duplicate, remove, back to the whole figure, the gizmo's modes. */\n private onKey = (e: KeyboardEvent) => {\n const view = this.session?.read()\n if (!view || view.loading || view.saving || !view.context || !this.isConnected) return\n const canvas = this.renderRoot.querySelector<FigureV3Canvas>('figure-v3-canvas')\n const path = e.composedPath()\n const action = keyActionOf(\n { key: e.key, ctrlKey: e.ctrlKey, metaKey: e.metaKey, shiftKey: e.shiftKey, altKey: e.altKey, target: path[0] as HTMLElement, inScene: !!canvas && path.includes(canvas) },\n this.selected\n )\n if (!action) return\n e.preventDefault()\n /*\n The session's history is the only one. With the canvas focused the scene took Ctrl+Z as well, undoing on its own\n board the last value the canvas had written -- which the canvas then told as a drag: an undo of a drag on a\n part placed by a rule wrote the drag again (2026-09-25). Heard first (capture) and kept from the scene.\n */\n e.stopPropagation()\n if (action === 'translate' || action === 'rotate' || action === 'scale') canvas && this.useGizmo(action)\n else if (action === 'undo') view.canUndo && this.run(() => this.session!.undo())\n else if (action === 'redo') view.canRedo && this.run(() => this.session!.redo())\n else if (action === 'duplicate') this.duplicatePart(this.selected)\n else if (action === 'remove') this.removePart(this.selected)\n else this.selected = ''\n }\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('keydown', this.onKey, true)\n }\n disconnectedCallback() {\n window.removeEventListener('keydown', this.onKey, true)\n super.disconnectedCallback()\n }\n protected willUpdate(_changed: PropertyValues) {\n const view = this.session?.read()\n if (view?.context !== this.lastContext) {\n this.lastContext = view?.context ?? null\n this.selected = ''\n this.error = ''\n this.hiddenParts = new Set()\n }\n if (view && !view.geometry.some(g => ownerOf(g.id) === this.selected)) this.selected = ''\n if (_changed.has('selected')) this.gizmoMode = undefined\n }\n /** The scene toggles: the mode already shown takes the gizmo away. */\n private useGizmo(mode: 'translate' | 'rotate' | 'scale') {\n this.renderRoot.querySelector<FigureV3Canvas>('figure-v3-canvas')?.gizmo(mode)\n this.gizmoMode = this.gizmoMode === mode ? undefined : mode\n }\n /**\n * A refusal no particular sentence knows: figure-model's code said as a refusal, never its English; any other error\n * (the network, the server) as it came.\n */\n private said(error: unknown): string {\n return (error as { code?: string })?.code ? editRefusalOf(error, (key, params) => i18next.t(key, params)) : error instanceof Error ? error.message : String(error)\n }\n private run(action: () => unknown) {\n try {\n action()\n this.error = ''\n /* The next step stands on its own: what the last removal let go of is no longer the news. */\n this.notice = ''\n this.changed()\n } catch (error) {\n const say = (key: string, params: Record<string, string>) => i18next.t(key, params)\n this.error = sizeRangeRefusalOf(error, say) ?? inputRangeRefusalOf(error, say) ?? this.said(error)\n } finally {\n /* Committed or refused, the value in hand is gone: the figure as it stands is drawn again. */\n this.live = NOTHING_LIVE\n }\n }\n /** What the canvas draws: the figure with the value in hand when there is one, and without the parts hidden on the workbench. */\n private drawnParts(geometry: Parameters<typeof drawableV3Parts>[0] | undefined, asset: unknown) {\n const parts = (asset ? liveOverSession(asset as V3Asset, this.currentInputs(), this.live) : null) ?? drawableV3Parts(geometry ?? [])\n return parts.filter(body => !this.hiddenParts.has(ownerOf((body as { id: string }).id)))\n }\n /**\n * Where the selected part turns and how far, with the pose as it is drawn now -- a value in hand included, so the\n * fan follows the arm while a control is dragged. Its size comes from what the joint turns (`v3-joint-fan`).\n */\n private fanOf(asset: V3Asset | undefined) {\n if (!asset || !this.selected || this.hiddenParts.has(this.selected)) return null\n try {\n return jointFanOf(asset, this.selected, { ...this.currentInputs(), ...this.live.values })\n } catch {\n return null\n }\n }\n /**\n * Every input as the session holds it now -- the pose the author has set with the controls, and design values. The\n * asset's source carries only the saved defaults, so drawing a value in hand over it put every other joint back to its\n * saved angle while one slider moved, and the arm jumped when released (user, 2026-09-24).\n */\n private currentInputs(): Record<string, number> {\n const view = this.session?.read()\n return view ? Object.fromEntries(view.fields.map(field => [field.id, field.value as number])) : {}\n }\n /** A value in hand: an input's value (design or pose) or a part edit. Nothing is recorded. */\n private hold(values: Record<string, number>, edit?: V3PartEdit) {\n this.live = { values: { ...this.live.values, ...values }, ...(edit ? { edit } : this.live.edit ? { edit: this.live.edit } : {}) }\n }\n private changed() {\n this.requestUpdate()\n this.dispatchEvent(new CustomEvent('v3-changed', { bubbles: true, composed: true }))\n }\n private async save() {\n if (!this.session) return\n try {\n /*\n The card's picture is taken before the save starts, from a canvas of its own at the card's size —\n not from the one on screen, which stands wherever the author left it turned. A picture that cannot\n be taken is not an error: the save goes on without it (see `v3-thumbnail.ts`).\n */\n let type: string | undefined\n if (!this.session.read().id && this.firstSave) {\n const answer = await this.firstSave(this.session.read().name ?? '')\n if (!answer) return\n /* The name is the figure's own, in the asset: one step of the history, like typing it in the properties. */\n if (answer.name !== this.session.read().name) {\n this.session.command({ kind: 'rename', name: answer.name })\n this.changed()\n }\n type = answer.type\n }\n const view = this.session.read()\n const thumbnail = await captureV3Thumbnail(drawableV3Parts(view.geometry ?? []), view.palette ?? {})\n const promise = this.session.save({ thumbnail, type })\n this.changed()\n await promise\n this.error = ''\n } catch (error) {\n this.error = this.said(error)\n } finally {\n this.changed()\n }\n }\n private add(kind: V3PaletteKind) {\n if (!this.session) return\n this.run(() => {\n const ids = new Set(this.session!.read().geometry.map(g => g.id))\n let n = 1\n while (ids.has(`${kind}-${n}`)) n++\n const part = paletteRecipe(kind, `${kind}-${n}`)\n this.session!.add(part)\n this.selected = part.id\n })\n }\n /**\n * The list's own operations, as V3 part edits — each one step of the session's history. The copy and the moved\n * part stay selected.\n */\n private duplicatePart(id: string) {\n this.run(() => {\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n this.selected = this.session!.read().geometry.find(g => !before.has(g.id))?.id ?? id\n })\n }\n private movePart(id: string, to: number) {\n this.run(() => this.session!.edit({ kind: 'move-part', target: id, to }))\n }\n private removePart(id: string, refitRoom = false) {\n this.retry = undefined\n try {\n const view = this.session!.edit({ kind: 'remove-part', target: id, ...(refitRoom ? { refitRoom: true } : {}) }) as { removal?: Parameters<typeof removalNoticeOf>[0] }\n this.error = ''\n /* What else the removal let go of, named (chief architect, 2026-09-27); undo brings it back. */\n this.notice = removalNoticeOf(view.removal, (key, params) => i18next.t(key, params)) ?? ''\n if (this.selected === id) this.selected = ''\n this.changed()\n } catch (error) {\n /* The refusal a person meets most: another part stands on this one or follows its size. Said in their words. */\n this.error = partRefusalOf(error, id, (key, params) => i18next.t(key, params)) ?? this.said(error)\n /* In the declared room only: the way on is to delete it and fit the room to the parts left, in one step. */\n if (!refitRoom && inDeclaredRoom(error)) this.retry = { label: i18next.t('figure.button.remove-and-refit-room', { part: id }), run: () => this.removePart(id, true) }\n }\n }\n private toggleHiddenPart(id: string) {\n const next = new Set(this.hiddenParts)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n this.hiddenParts = next\n }\n /** Whether the figure declares its size (the three size inputs). */\n private hasSize(): boolean {\n const values = this.designValues()\n return ['x', 'y', 'z'].every(axis => typeof values[`size.${axis}`] === 'number')\n }\n /**\n * A recipe put in (ADR-0095): resolved on the figure as it stands -- its parts take the next free name, onto the part\n * chosen -- and applied as one step. Refused, the kernel's sentence goes to the form as it is (condition 3).\n */\n private insertRecipe(recipe: V3Recipe, values: Record<string, V3RecipeValue>) {\n try {\n const asset = JSON.parse(this.session!.source()) as V3Asset\n const checked = parseV3Recipe(recipe)\n const id = v3RecipeIdFor(asset, checked)\n const steps = resolveV3Recipe(checked, { id, ...(checked.target === 'part' ? { target: this.selected } : {}), values })\n this.session!.applyRecipe(steps)\n this.recipeError = ''\n this.catalogOpen = false\n this.error = ''\n this.changed()\n } catch (error) {\n this.recipeError = recipeRefusalOf(error, (key, params) => i18next.t(key, params)) ?? this.said(error)\n }\n }\n /** The design values of the asset being edited. */\n private designValues(): Record<string, number> {\n try {\n return this.session ? (JSON.parse(this.session.source()).designInputs ?? {}) : {}\n } catch {\n return {}\n }\n }\n /** What the gizmo may write for the selected part — read off the asset being edited. */\n private reachOf(id: string): GizmoReach {\n const none = { translate: false, rotate: false, scale: false }\n /* A repeat is moved and sized through its row, not by a gizmo on one copy. */\n if (!id || !this.session || !this.session.read().geometry.some(g => g.id === id)) return none\n try {\n return gizmoReachOf(JSON.parse(this.session.source()), id)\n } catch {\n return none\n }\n }\n /** A drag, written back as the part's own inputs — one step of the history, like typing the numbers. */\n private transformed(id: string, result: GizmoResult) {\n const view = this.session!.read()\n /* A part hanging from a joint: the drag edits the joint -- its value, or where it sits (ADR-0093). */\n const asset = JSON.parse(this.session!.source()) as V3Asset\n const drawn = view.geometry.find(g => g.id === id) as unknown as V3RenderPart | undefined\n const drag = drawn ? jointDragOf(asset, ownerOf(id), drawn, result, this.currentInputs()) : null\n if (drag) {\n if (drag.kind === 'value') this.run(() => this.session!.apply([{ kind: 'set-state', input: drag.input, unit: drag.unit, value: drag.value }]))\n else if (drag.kind === 'joint') this.run(() => this.session!.command({ kind: 'set-joint', joint: drag.joint }))\n else {\n this.error = i18next.t(`figure.text.gizmo-joint-${drag.reason}`, { joint: drag.joint, leader: drag.leader ?? '', axis: drag.axis ?? '' })\n this.requestUpdate()\n }\n return\n }\n const sizes = Object.fromEntries(view.fields.map(field => [field.id, field.value as number]))\n /*\n A part a joint places, scaled: only its measures change. The shift of its centre that an anchored scale makes is\n the joint's to give -- the face on the joint stays there by itself (user, 2026-09-25: 「'R'모드에서 크기가 변하지 않는다」;\n the shift had been taken for a move of the joint, and the size was dropped).\n */\n const jointed = !!asset.joints?.some(j => j.body1.part === ownerOf(id))\n const changes = gizmoChanges(id, this.reachOf(id), jointed && result.scale ? { scale: result.scale } : result, sizes)\n if (changes.length) {\n this.run(() => this.session!.apply(changes))\n return\n }\n if (jointed && result.scale) {\n /* Only measures that follow another were pulled: the relation says their size, and it is not broken here. */\n const axes = (['x', 'y', 'z'] as const).filter((_, i) => Math.abs(result.scale![i]! - 1) > 1e-4)\n this.error = i18next.t('figure.text.gizmo-size-follows', { part: partLabelOf(id), axis: axes.join(', ').toUpperCase() })\n return this.requestUpdate()\n }\n /*\n A part whose place is worked out has no numbers for the gizmo to write: the drag is added beside\n its rule (`nudge-part`). A part a joint or a fastening places, or a size that is worked out, is refused -- said in\n words, not by the part silently springing back (user, 2026-09-24: 「기즈모 컨트롤도 전혀 작동이 안되는군」).\n */\n const body = view.geometry.find(g => g.id === id) as unknown as V3RenderPart | undefined\n if (!body) return this.requestUpdate()\n const { by, turn } = nudgeOf(body, result)\n /* A size worked out from the figure's: the drag's factor beside its rule, so it still follows. */\n const grow: Partial<Record<'x' | 'y' | 'z', number>> = {}\n if (result.scale) (['x', 'y', 'z'] as const).forEach((axis, i) => Math.abs(result.scale![i]! - 1) > 1e-6 && (grow[axis] = Math.round(result.scale![i]! * 1e6) / 1e6))\n if (!Object.keys(by).length && !Object.keys(turn).length && !Object.keys(grow).length) return this.requestUpdate()\n try {\n this.session!.command({\n kind: 'nudge-part',\n part: id,\n ...(Object.keys(by).length ? { by } : {}),\n ...(Object.keys(turn).length ? { turn } : {}),\n ...(Object.keys(grow).length ? { grow } : {})\n })\n this.error = ''\n this.changed()\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n this.error = /carried by a joint/.test(message)\n ? i18next.t('figure.text.gizmo-joint-places', { part: partLabelOf(id) })\n : /is fastened to/.test(message)\n ? i18next.t('figure.text.gizmo-fastening-places', { part: partLabelOf(id) })\n : this.said(error)\n this.requestUpdate()\n }\n }\n /** 맞추기 — one tool, one step of the history, through the same inputs as the gizmo. */\n private align(tool: AlignTool) {\n this.run(() => {\n const asset = JSON.parse(this.session!.source())\n const changes = alignChanges(asset, this.selected, this.reachOf(this.selected), tool)\n if (changes.length) this.session!.apply(changes)\n })\n }\n /** A mirrored copy: duplicate, then place the copy on the other side — two steps. */\n private mirror(axis: 'x' | 'z') {\n this.run(() => {\n const id = this.selected\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n const copy = this.session!.read().geometry.find(g => !before.has(g.id))?.id\n if (!copy) return\n this.session!.apply(mirrorChanges(JSON.parse(this.session!.source()), id, copy, axis))\n this.selected = copy\n })\n }\n private renderTools(unavailable: boolean) {\n const reach = this.reachOf(this.selected)\n if (!this.selected || !reach.translate) return null\n let asset: unknown\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const tool = (name: AlignTool, icon: string, label: string, title: string) =>\n html`<button ?disabled=${unavailable} aria-label=${i18next.t(label)} title=${i18next.t(title)} @click=${() => this.align(name)}>\n <md-icon>${icon}</md-icon>\n </button>`\n return html`<div tools title=${i18next.t('figure.text.tools-explained')}>\n ${tool('centre-x', 'horizontal_distribute', 'figure.button.center-x', 'figure.text.center-on-x')}\n ${tool('centre-z', 'vertical_align_center', 'figure.button.center-z', 'figure.text.center-on-z')}\n ${tool('floor', 'vertical_align_bottom', 'figure.button.to-floor', 'figure.text.put-on-floor')}\n ${(['x', 'z'] as const).map(axis => {\n const able = canMirror(asset as never, this.selected, axis, reach)\n return html`<button\n ?disabled=${unavailable || !able}\n aria-label=${i18next.t('figure.button.mirror-' + axis)}\n title=${i18next.t(able ? 'figure.text.mirror-explained' : 'figure.text.mirror-would-overlap')}\n @click=${() => this.mirror(axis)}\n >\n <md-icon>${axis === 'x' ? 'flip' : 'flip_camera_android'}</md-icon>\n </button>`\n })}\n ${tool('snap', 'grid_on', 'figure.button.snap', 'figure.text.snap-explained')}\n </div>`\n }\n /**\n * A part's name. It renames every value the part owns, and what refers to them follows\n * (figure-model's rename-part), as one step of the history.\n */\n /**\n * A repeated body is one of its repeat's copies and is named after it -- the list and this field read `roller 15`, not\n * its path through the repeat (user, 2026-09-24: 「부품 이름 ???」). A copy has no name of its own to change.\n */\n private renderRepeatNote(geometry: readonly unknown[] | undefined) {\n const repeat = repeatOf(this.selected, geometry)\n return repeat?.index ? html`<p hint>${i18next.t('figure.text.repeat-member', { name: repeat.name, count: repeat.count, index: repeat.index })}</p>` : nothing\n }\n private renamePart(input: HTMLInputElement) {\n const name = input.value.trim()\n const from = this.selected\n if (!name || name === from) {\n input.value = from\n return\n }\n try {\n this.session!.edit({ kind: 'rename-part', target: from, name })\n this.selected = name\n this.error = ''\n this.changed()\n } catch (error) {\n input.value = from\n const code = (error as { code?: string })?.code\n this.error =\n code === 'PART_ID'\n ? i18next.t(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? 'figure.text.part-name-taken' : 'figure.text.part-name-invalid', { name })\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n /** Size response, fastening and motion for the selected part, as authoring commands. */\n private renderLinks(unavailable: boolean, section: 'shape' | 'places' | 'motion') {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n let dims: [number, number, number] | undefined\n try {\n dims = boxOf(asset, this.selected)?.dims\n } catch {\n dims = undefined\n }\n return html`<figure-v3-links\n .asset=${asset}\n .section=${section}\n .partId=${this.selected}\n .dims=${dims}\n ?locked=${unavailable}\n @v3-command=${(e: CustomEvent) => this.linkCommand(e.detail.action)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-links>`\n }\n /** The figure's controls: try a value, name it, set its range and travel time, keep the pose. */\n private renderControls(view: { fields: Array<{ id: string; role?: string; value: number }> }, unavailable: boolean) {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const values = Object.fromEntries(view.fields.filter(f => f.role === 'state').map(f => [f.id, f.value]))\n return html`<figure-v3-controls\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-state=${(e: CustomEvent) => this.run(() => this.session!.apply([{ kind: 'set-state', input: e.detail.input, unit: e.detail.unit, value: e.detail.value }]))}\n @v3-state-live=${(e: CustomEvent) => this.hold({ [e.detail.input]: e.detail.value })}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-controls>\n <figure-v3-clips\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-states=${(e: CustomEvent) => this.run(() => this.session!.apply(e.detail.changes))}\n @v3-states-live=${(e: CustomEvent) => this.hold(e.detail.values)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-clips>`\n }\n /** One command, one step of the history. A refusal a person can meet here is said in their words. */\n private linkCommand(action: V3AuthoringAction) {\n this.retry = undefined\n this.notice = ''\n const hadSize = this.hasSize()\n try {\n this.session!.command(action)\n this.error = ''\n /* What the command did besides what was asked, in one line: the figure's size declared to follow (ADR ruling Q1). */\n if (action.kind === 'follow-size' && !hadSize) {\n const size = this.designValues()\n this.notice = i18next.t('figure.text.size-declared-to-follow', {\n x: Math.round(size['size.x'] ?? 0).toLocaleString(),\n y: Math.round(size['size.y'] ?? 0).toLocaleString(),\n z: Math.round(size['size.z'] ?? 0).toLocaleString()\n })\n }\n this.changed()\n } catch (error) {\n const code = (error as { code?: string })?.code\n const narrowing = narrowingRetryOf(action, error, (key, params) => i18next.t(key, params))\n if (narrowing) {\n this.error = narrowing.message\n this.retry = { label: narrowing.label, action: narrowing.retry as V3AuthoringAction }\n return\n }\n this.error =\n code === 'DIMENSION_CYCLE'\n ? i18next.t('figure.text.follow-would-loop')\n : code === 'FASTEN_CYCLE' || code === 'ATTACH_CYCLE'\n ? i18next.t('figure.text.fasten-would-loop')\n : sizeRangeRefusalOf(error, (key, params) => i18next.t(key, params)) ??\n placementRefusalOf(error, (key, params) => i18next.t(key, params)) ??\n this.said(error)\n }\n }\n private changeField(field: { id: string; unit: V3InputChange['unit']; role?: string }, event: Event) {\n const input = event.target as HTMLInputElement,\n value = input.valueAsNumber\n /* A height typed in keeps the part's bottom where it is, as the scale gizmo does. */\n const part = this.selected\n const kept = field.role !== 'state' && part ? keepBottomChanges(part, this.reachOf(part), field.id, value, this.designValues()) : []\n this.run(() =>\n this.session!.apply([\n { kind: field.role === 'state' ? 'set-state' : 'set-design', input: field.id, unit: field.unit, value },\n ...kept\n ])\n )\n // Rejected edits must also restore the displayed numeric value.\n input.value = String(this.session!.read().fields.find(i => i.id === field.id)!.value)\n }\n /** Typing or a held spinner: each number on the way is drawn; the field's change records it. */\n private typing(field: { id: string }, event: Event) {\n const value = (event.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(value)) this.hold({ [field.id]: value })\n }\n /**\n * Drag a field's label (or an axis letter) sideways to scrub its value, as vector tools do: the figure follows the\n * pointer, and the release records one step. The field's number follows too, so the value in hand is always read.\n */\n private scrub(field: { id: string; unit: V3InputChange['unit']; role?: string; value: number }, down: PointerEvent, unavailable: boolean) {\n if (unavailable || down.button !== 0) return\n const label = down.currentTarget as HTMLElement\n const input = (label.closest('div[cell]')?.querySelector('input') ?? label.nextElementSibling) as HTMLInputElement | null\n if (!input) return\n down.preventDefault()\n label.setPointerCapture(down.pointerId)\n const start = field.value\n let value = start\n const move = (e: PointerEvent) => {\n value = scrubbed(start, e.clientX - down.clientX, scrubStep(field.unit, start, e.shiftKey))\n input.value = String(value)\n this.hold({ [field.id]: value })\n }\n const up = (e: PointerEvent) => {\n label.removeEventListener('pointermove', move)\n label.removeEventListener('pointerup', up)\n label.removeEventListener('pointercancel', up)\n /* A drag the system took away is not the author's value: the field goes back to where it was. */\n if (e.type === 'pointercancel') value = start\n if (value === start) {\n input.value = String(start)\n this.live = NOTHING_LIVE\n return\n }\n input.value = String(value)\n this.changeField(field, { target: input } as unknown as Event)\n }\n label.addEventListener('pointermove', move)\n label.addEventListener('pointerup', up)\n label.addEventListener('pointercancel', up)\n }\n /** The measured range, kept for the revision it was measured at: measuring evaluates the figure at its edges. */\n private range?: { at: string; of: ReturnType<typeof instanceRangeOf>; toDeclare?: ReturnType<typeof instanceRangeToDeclare> }\n /** The sizes a board may give the figure, and the way to measure them again after its parts changed. */\n private renderInstanceRange(asset: V3Asset | undefined, unavailable: boolean) {\n if (!asset) return nothing\n /* Another figure, or another step of this one, is measured again. */\n const at = `${this.session?.read().context ?? ''}:${this.revision}`\n if (this.range?.at !== at) {\n let of: ReturnType<typeof instanceRangeOf>\n let toDeclare: ReturnType<typeof instanceRangeToDeclare>\n try {\n of = instanceRangeOf(asset)\n } catch {\n of = undefined\n }\n try {\n toDeclare = of ? undefined : instanceRangeToDeclare(asset)\n } catch {\n toDeclare = undefined\n }\n this.range = { at, of, toDeclare }\n }\n const range = this.range.of\n /* No size yet: the figure is declared its size from its parts, so a board can resize it and parts can follow it. */\n const toDeclare = this.range.toDeclare\n if (!range && toDeclare)\n return html`<section>\n <h3>${i18next.t('figure.label.instance-range')}</h3>\n <p hint>${i18next.t('figure.text.instance-size-undeclared')}</p>\n <button act ?disabled=${unavailable} @click=${() => this.linkCommand({ kind: 'declare-instance-size', range: toDeclare.range, at: toDeclare.at })}>\n <md-icon>straighten</md-icon>${i18next.t('figure.button.declare-instance-size')}\n </button>\n </section>`\n if (!range) return nothing\n const mm = (v: number) => Math.round(v).toLocaleString()\n const differs = rangeDiffers(range.declared, range.measured)\n return html`<section>\n <h3>${i18next.t('figure.label.instance-range')}</h3>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div inline-field>\n <label>${axis.toUpperCase()} <span unit>mm</span></label>\n <div pair>\n ${(['min', 'max'] as const).map(\n bound => html`<input\n aria-label=${`size.${axis}.${bound}`}\n type=\"number\"\n step=\"any\"\n .value=${live(String(Math.round(range.declared[axis][bound])))}\n ?disabled=${unavailable}\n @change=${(e: Event) => {\n const next = rangeWith(range.declared, axis, bound, (e.target as HTMLInputElement).valueAsNumber)\n if (next) this.linkCommand({ kind: 'declare-instance-size', range: next, replace: true })\n }}\n />`\n )}\n </div>\n </div>`\n )}\n ${differs\n ? html`<p hint>\n ${i18next.t('figure.text.instance-range-can-widen', {\n ranges: (['x', 'y', 'z'] as const)\n .filter(axis => rangeDiffers(range.declared, { ...range.declared, [axis]: range.measured[axis] }))\n .map(axis => `${axis.toUpperCase()} ${mm(range.measured[axis].min)} – ${mm(range.measured[axis].max)}`)\n .join(' · ')\n })}\n </p>\n <button act ?disabled=${unavailable} @click=${() => this.linkCommand({ kind: 'declare-instance-size', range: range.measured, replace: true })}>\n <md-icon>straighten</md-icon>${i18next.t('figure.button.remeasure-range')}\n </button>`\n : nothing}\n ${this.renderSizingRule(asset, unavailable)}\n </section>`\n }\n /**\n * How the figure grows. One ratio (`sizing: 'uniform'`) is said as it is; a figure with joints that has not declared\n * it is offered it -- a mechanism does not shear -- and the author decides (chief architect's ruling 2026-09-24).\n */\n private renderSizingRule(asset: V3Asset, unavailable: boolean) {\n if (asset.sizing === 'uniform') {\n /* One ratio reaches only what reads the size: every other length is offered to follow it, in one step. */\n const follow = proportionToFollow(asset)\n return html`<div inline-field><label>${i18next.t('figure.label.sizing-rule')}</label><span>${i18next.t('figure.label.sizing-uniform')}</span></div>\n ${follow?.count\n ? html`<p hint>${i18next.t('figure.text.proportion-to-follow', { count: follow.count })}</p>\n <button act ?disabled=${unavailable} @click=${() => this.linkCommand({ kind: 'follow-size-in-proportion' })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.follow-size-in-proportion')}\n </button>`\n : nothing}\n ${follow?.kept.length ? html`<p hint>${i18next.t('figure.text.proportion-kept', { what: follow.kept.join(', ') })}</p>` : nothing}`\n }\n return html`${turnsAboutAJoint(asset) ? html`<p hint>${i18next.t('figure.text.sizing-uniform-proposed')}</p>` : nothing}\n <button act ?disabled=${unavailable} title=${i18next.t('figure.text.sizing-uniform-explained')} @click=${() => this.linkCommand({ kind: 'scale-uniformly' })}>\n <md-icon>aspect_ratio</md-icon>${i18next.t('figure.button.scale-uniformly')}\n </button>`\n }\n /**\n * The parts list, one row per part the author made: a repeat is one row with how many copies it makes now\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\n private partRows(geometry: readonly { id: string }[]): V3PartRow[] {\n const rows = new Map<string, V3PartRow>()\n for (const g of geometry) {\n const id = ownerOf(g.id)\n const row = rows.get(id)\n if (row) {\n row.copies = (row.copies ?? 1) + 1\n continue\n }\n rows.set(id, {\n id,\n provider: (g as { shape?: { provider?: string } }).shape?.provider ?? '',\n hidden: this.hiddenParts.has(id),\n invisible: (g as { visible?: boolean }).visible === false,\n ...(id !== g.id ? { copies: 1 } : {})\n })\n }\n return [...rows.values()]\n }\n /** The detail level's part budget for the list's head, from figure-model's count (a repeat once). */\n private partBudgetOf(asset: V3Asset | undefined) {\n if (!asset) return undefined\n try {\n return { level: asset.detailLevel ?? null, used: v3PartCountOf(asset), limit: asset.detailLevel ? PART_LIMIT[asset.detailLevel] : null }\n } catch {\n return undefined\n }\n }\n /**\n * A repeat: which way its copies run, how many there are now, and how far apart.\n * The pitch of a row that fills its length is edited as a number (`set-repeat` makes it the part's own the first\n * time); a row of a fixed count says its pitch cannot be set yet (figure-model refuses it the same way).\n */\n private renderRepeat(asset: V3Asset | undefined, geometry: readonly { id: string }[], unavailable: boolean) {\n const repeat = repeatOf(this.selected, geometry)\n if (!asset || !repeat || repeat.index) return nothing\n /* The row is set on its part; what hangs from that part is copied with it and has no row of its own. */\n if (!asset.document.model.nodes.some(n => n.id === `${this.selected}.repeat`)) return nothing\n const model = asset.document.model as unknown as {\n nodes: { id: string; op: string; args: string[]; params?: Record<string, string> }[]\n constants: { id: string; value: number }[]\n inputs: { id: string; max?: number }[]\n }\n const layout = model.nodes.find(n => n.id === `${this.selected}.layout`)\n const axis = model.nodes.find(n => n.id === `${this.selected}.repeat`)?.params?.axis ?? '?'\n const own = `${this.selected}.repeat.pitch`\n /* The pitch as it stands: the part's own number, a constant, or what a pitch that follows a length comes to. */\n const pitch = asset.designInputs[own] ?? model.constants.find(c => c.id === layout?.args[4])?.value ?? valueNow(asset, layout?.args[4])\n const fits = layout?.op === 'fit-pitch@1'\n /* What the pitch gives, in numbers: this many copies at the length it is authored, and how long it may be placed. */\n const lengthRef = layout?.args[0] ?? ''\n const length = asset.designInputs[lengthRef]\n const longest = model.inputs.find(i => i.id === lengthRef)?.max\n const limit = model.constants.find(c => c.id === layout?.args[6])?.value\n const field = { id: own, unit: 'mm' as const, role: 'design', value: pitch ?? 0 }\n return html`<section>\n <h3>${i18next.t('figure.label.repeat')}</h3>\n <div inline-field><label>${i18next.t('figure.label.repeat-axis')}</label><span value>${axis.toUpperCase()}</span></div>\n <div inline-field><label>${i18next.t('figure.label.repeat-count')}</label><span value>${repeat.count}</span></div>\n <div inline-field>\n <label>${i18next.t('figure.label.repeat-gap')} <span unit>mm</span></label>\n <input\n type=\"number\"\n step=\"any\"\n aria-label=${own}\n .value=${String(pitch ?? '')}\n ?disabled=${unavailable || !fits}\n @change=${(e: Event) => this.setPitch(field, e)}\n />\n </div>\n <p hint>\n ${fits && length !== undefined && longest !== undefined && limit !== undefined\n ? i18next.t('figure.text.repeat-what-pitch-gives', {\n length: length.toLocaleString(),\n count: repeat.count,\n longest: longest.toLocaleString(),\n limit\n })\n : i18next.t(fits ? 'figure.text.repeat-fits-length' : 'figure.text.repeat-fixed-count')}\n </p>\n ${this.renderPublicPitch(asset, pitch ?? 0, unavailable)}\n ${asset.joints?.some(j => j.body1.part === this.selected && j.repeat)\n ? html`<button act ?disabled=${unavailable} @click=${() => this.run(() => this.session!.command({ kind: 'remove-repeat', part: this.selected }))}>\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-repeat')}\n </button>`\n : nothing}\n </section>`\n }\n /** The design input a row's pitch is read from, when it is read from one (ADR-0096). */\n private pitchInputOf(asset: V3Asset, part: string): string | undefined {\n const pitch = asset.joints?.find(j => j.body1.part === part && j.repeat)?.repeat?.pitch as { from?: { of?: string; input?: string } } | number | undefined\n return typeof pitch === 'object' && pitch?.from?.of === 'input' ? pitch.from.input : undefined\n }\n /**\n * 「보드에서 바꿀 수 있음」 (ADR-0096): the row's pitch made a design input the figure publishes -- a name on the board and\n * a range the board's value is held to -- in one step; changed or withdrawn the same way. Only a row with a record.\n */\n private renderPublicPitch(asset: V3Asset, pitch: number, unavailable: boolean) {\n const part = this.selected\n if (!asset.joints?.some(j => j.body1.part === part && j.repeat)) return nothing\n const from = this.pitchInputOf(asset, part)\n const listed = from ? asset.publicInputs?.find(p => p.input === from) : undefined\n const input = from ? asset.document.model.inputs.find(i => i.id === from) : undefined\n const form =\n this.publishing?.part === part\n ? this.publishing\n : listed && input\n ? { part, label: listed.label, min: input.min, max: input.max }\n : undefined\n const open = !!form\n const edit = (key: 'label' | 'min' | 'max') => (e: Event) => {\n const target = e.target as HTMLInputElement\n const base = form ?? { part, label: '', min: 0, max: 0 }\n this.publishing = { ...base, [key]: key === 'label' ? target.value : target.valueAsNumber }\n }\n const steps = (): V3ProposalStep[] => {\n const f = form!\n const id = from ?? `${part}.pitch`\n if (listed) return [{ kind: 'set-input-range', input: id, min: f.min, max: f.max }, { kind: 'publish-input', input: id, label: f.label }] as V3ProposalStep[]\n const exists = asset.document.model.inputs.some(i => i.id === id)\n return [\n ...(exists ? [{ kind: 'set-input-range', input: id, min: f.min, max: f.max }] : [{ kind: 'add-design-input', id, unit: 'mm', min: f.min, max: f.max, value: pitch }]),\n ...(from ? [] : [{ kind: 'set-repeat', part, pitch: { from: { of: 'input', input: id } } }]),\n { kind: 'publish-input', input: id, label: f.label }\n ] as V3ProposalStep[]\n }\n const run = (list: V3ProposalStep[]) => {\n try {\n this.session!.applyRecipe(list)\n this.publishing = undefined\n this.error = ''\n this.changed()\n } catch (error) {\n this.error = this.said(error)\n }\n }\n return html`<div public-pitch>\n <label toggle>\n <input\n type=\"checkbox\"\n aria-label=\"figure.label.board-sets\"\n .checked=${open}\n ?disabled=${unavailable}\n @change=${(e: Event) =>\n (e.target as HTMLInputElement).checked\n ? (this.publishing = { part, label: i18next.t('figure.label.repeat-gap'), min: Math.max(1, Math.round(pitch / 2)), max: Math.round(pitch * 2) })\n : listed\n ? run([{ kind: 'unpublish-input', input: from }, { kind: 'set-repeat', part, pitch }] as V3ProposalStep[])\n : (this.publishing = undefined)}\n />\n ${i18next.t('figure.label.board-sets')}\n </label>\n ${open\n ? html`<div inline-field><label>${i18next.t('figure.label.board-name')}</label><input aria-label=\"figure.label.board-name\" .value=${form!.label} @change=${edit('label')} /></div>\n <div inline-field><label>${i18next.t('figure.label.least')} <span unit>mm</span></label><input type=\"number\" step=\"any\" aria-label=\"figure.label.least\" .value=${String(form!.min)} @change=${edit('min')} /></div>\n <div inline-field><label>${i18next.t('figure.label.most')} <span unit>mm</span></label><input type=\"number\" step=\"any\" aria-label=\"figure.label.most\" .value=${String(form!.max)} @change=${edit('max')} /></div>\n <button act publish-pitch ?disabled=${unavailable || !form!.label.trim()} @click=${() => run(steps())}>\n <md-icon>${listed ? 'check' : 'ios_share'}</md-icon>${i18next.t(listed ? 'figure.button.apply' : 'figure.button.publish-input')}\n </button>`\n : nothing}\n </div>`\n }\n /**\n * A pitch always goes through `set-repeat`: the command moves the longest length with it (at most `limit` copies),\n * which a plain input edit would not. Refused only when the authored length would already hold more copies than\n * that -- said with the numbers.\n */\n private setPitch(field: { id: string; value: number }, event: Event) {\n const input = event.target as HTMLInputElement\n const pitch = input.valueAsNumber\n if (!Number.isFinite(pitch) || pitch === field.value) return\n /* Read from a design input the board may set: the input's value changes, the row keeps reading it (ADR-0096). */\n const from = this.pitchInputOf(JSON.parse(this.session!.source()) as V3Asset, this.selected)\n if (from) {\n this.run(() => this.session!.apply([{ kind: 'set-design', input: from, unit: 'mm', value: pitch }]))\n input.value = String(this.session!.read().fields.find(i => i.id === from)?.value ?? field.value)\n return\n }\n try {\n this.session!.command({ kind: 'set-repeat', part: this.selected, pitch })\n this.error = ''\n this.changed()\n } catch (error) {\n input.value = String(field.value)\n const code = (error as { code?: string })?.code\n const message = error instanceof Error ? error.message : String(error)\n const found = /\\((\\d[\\d.]*) mm\\) a pitch under ([\\d.]+) mm makes more than (\\d+)/.exec(message)\n this.error =\n code === 'INPUT_RANGE' && found\n ? i18next.t('figure.text.repeat-pitch-too-small', { length: Number(found[1]).toLocaleString(), min: found[2], limit: found[3] })\n : this.said(error)\n }\n }\n /** Choose a part, from the list, the canvas or a place row. A figure-level tab gives way to the part's properties. */\n private choose(id: string) {\n /* A copy on the canvas selects its repeat: the part the author made. */\n this.selected = id ? ownerOf(id) : id\n if (id && (this.tab === 'verdict' || this.tab === 'view' || this.tab === 'history')) this.tab = 'properties'\n }\n private asset(): unknown {\n try {\n return JSON.parse(this.session!.source())\n } catch {\n return undefined\n }\n }\n private renderTab(tab: SideTab, icon: string, label: string, badge?: number) {\n return html`<button tab ?on=${this.tab === tab} title=${label} aria-label=${label} @click=${() => (this.tab = tab)}>\n <md-icon>${icon}</md-icon>${badge == null ? '' : html`<span badge>${badge.toLocaleString()}</span>`}\n </button>`\n }\n updated(changed: PropertyValues<this>) {\n super.updated?.(changed)\n const panes = this.renderRoot.querySelector<OxThreePane>('ox-three-pane') ?? undefined\n if (panes !== this.panes) this.panes = panes\n }\n /** Which part the panel speaks of, with the way back to the whole figure. */\n private renderSubject() {\n if (!this.selected) return null\n return html`<div subject>\n <button chip title=${i18next.t('figure.button.whole-figure')} @click=${() => (this.selected = '')}>\n <md-icon>arrow_back</md-icon>${i18next.t('figure.button.whole-figure')}\n </button>\n </div>`\n }\n render() {\n const view = this.session?.read()\n if (!view) return html`<p>${i18next.t('figure.text.opening-model')}</p>`\n const unavailable = view.loading || !!view.error || view.saving || !view.context\n const part = view.geometry.find(g => ownerOf(g.id) === this.selected)\n /* The controls (state inputs) have their own place in the motion tab; these are the design values. */\n const design = view.fields.filter(i => i.role !== 'state')\n /* A repeat's own row values (its pitch) have their own section, not the shape's. */\n const own = design.filter(i => this.selected && i.id.startsWith(this.selected + '.') && !i.id.startsWith(this.selected + '.repeat.'))\n const common = design.filter(i => !view.geometry.some(g => i.id.startsWith(ownerOf(g.id) + '.')))\n const status = view.loading\n ? 'figure.text.loading-figure'\n : view.saving\n ? 'figure.text.saving-figure'\n : view.dirty || !view.id\n ? 'figure.text.unsaved-changes'\n : 'figure.text.saved'\n const asset = this.asset()\n const tab = this.tab\n return html`<ox-canvas-bar\n history\n fit\n undo-shortcut=\"Ctrl+Z\"\n redo-shortcut=\"Ctrl+Y\"\n ?can-undo=${!unavailable && view.canUndo}\n ?can-redo=${!unavailable && view.canRedo}\n .pane=${this.panes}\n @canvas-undo=${() => this.run(() => this.session!.undo())}\n @canvas-redo=${() => this.run(() => this.session!.redo())}\n @canvas-fit=${() => this.renderRoot.querySelector<FigureV3Canvas>('figure-v3-canvas')?.fit()}\n >\n ${this.renderGizmoTools(!unavailable && this.middle === 'edit')}\n ${(['edit', 'preview'] as const).map(\n mode => html`<button slot=\"mode\" mode aria-pressed=${String(this.middle === mode)} title=${i18next.t('figure.text.mode-' + mode + '-explained')} @click=${() => (this.middle = mode)}>\n ${i18next.t('figure.label.mode-' + mode)}\n </button>`\n )}\n <span slot=\"status\" class=\"status\" role=\"status\" ?dirty=${status === 'figure.text.unsaved-changes'}>${i18next.t(status)}</span>\n <button slot=\"commit\" save ?disabled=${unavailable || (!view.dirty && !!view.id)} @click=${this.save}>${i18next.t('figure.button.save')}</button>\n </ox-canvas-bar>\n ${this.error || view.error\n ? html`<div role=\"alert\" class=\"error\">\n ${this.error || view.error}\n ${this.retry && this.error\n ? html`<button act @click=${() => (this.retry!.run ? this.retry!.run() : this.linkCommand(this.retry!.action!))}><md-icon>straighten</md-icon>${this.retry.label}</button>`\n : null}\n </div>`\n : null}\n ${this.notice ? html`<div role=\"status\" class=\"notice\">${this.notice}</div>` : null}\n ${this.catalogOpen\n ? html`<figure-v3-recipe-catalog\n .templates=${this.templates}\n .selected=${this.selected}\n .error=${this.recipeError}\n .guideOf=${this.guideOf}\n .thumbnailOf=${this.thumbnailOf}\n ?locked=${unavailable}\n @insert-recipe=${(e: CustomEvent) => this.insertRecipe(e.detail.recipe, e.detail.values)}\n @close-catalog=${() => (this.catalogOpen = false)}\n ></figure-v3-recipe-catalog>`\n : null}\n <ox-three-pane>\n <figure-v3-parts\n slot=\"start\"\n .budget=${this.budget}\n @show-maturity=${() => (this.tab = 'verdict')}\n .parts=${this.partRows(view.geometry)}\n .partBudget=${this.partBudgetOf(asset as V3Asset | undefined)}\n @set-detail-level=${(e: CustomEvent) => this.linkCommand({ kind: 'set-detail-level', level: e.detail.level })}\n .selected=${this.selected}\n ?locked=${unavailable}\n @add-part=${(e: CustomEvent) => this.add(e.detail.kind)}\n .recipeCount=${this.templates.length}\n @open-recipe-catalog=${() => ((this.catalogOpen = true), (this.recipeError = ''))}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @toggle-part-hidden=${(e: CustomEvent) => this.toggleHiddenPart(e.detail.id)}\n @set-all-parts-hidden=${(e: CustomEvent) =>\n (this.hiddenParts = e.detail.hidden ? new Set(view.geometry.map(g => ownerOf(g.id))) : new Set())}\n @move-part-up=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @move-part-down=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @duplicate-part=${(e: CustomEvent) => this.duplicatePart(e.detail.id)}\n @remove-part=${(e: CustomEvent) => this.removePart(e.detail.id)}\n ></figure-v3-parts>\n ${this.middle === 'preview'\n ? html`<figure-v3-preview\n .asset=${asset}\n .context=${view.context ?? ''}\n .view=${this.view}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-preview>`\n : html`<figure-v3-canvas\n .view=${this.view}\n .parts=${this.drawnParts(view.geometry, asset)}\n .fan=${this.fanOf(asset as V3Asset | undefined)}\n .palette=${view.palette ?? {}}\n .context=${view.context ?? ''}\n .selected=${this.selected}\n .reach=${unavailable ? { translate: false, rotate: false, scale: false } : this.reachOf(this.selected)}\n @part-transformed=${(e: CustomEvent) => this.transformed(e.detail.id, e.detail.result)}\n @part-selected=${(e: CustomEvent<string>) => this.choose(e.detail)}\n @render-error=${(e: CustomEvent<Error>) => {\n this.error = e.detail.message\n }}\n ></figure-v3-canvas>`}\n <aside slot=\"end\">\n <div tabs>\n ${this.renderTab('properties', 'tune', i18next.t('figure.label.properties'))}\n ${this.renderTab('capability', 'conveyor_belt', i18next.t('figure.label.tab-capability'))}\n ${this.renderTab('motion', 'animation', i18next.t('figure.label.motion'))}\n ${this.renderTab('verdict', 'insights', i18next.t('figure.label.maturity'), this.instances)}\n ${this.renderTab('view', 'wb_sunny', i18next.t('figure.label.tab-environment'))}\n ${this.renderTab('history', 'history', i18next.t('figure.label.history'))}\n </div>\n <slot name=\"notice\"></slot>\n <div panel ?off=${tab !== 'properties'}>\n ${this.selected && part\n ? html`${this.renderSubject()}\n <section>\n <h3>${i18next.t('figure.label.group-part')}</h3>\n <div inline-field>\n <label>${i18next.t('figure.label.name')}</label>\n <input\n name-field\n aria-label=${i18next.t('figure.label.name')}\n .value=${partLabelOf(this.selected)}\n ?disabled=${unavailable || !!repeatOf(this.selected, view.geometry)?.index}\n @change=${(e: Event) => this.renamePart(e.target as HTMLInputElement)}\n />\n </div>\n ${this.renderRepeatNote(view.geometry)}\n </section>\n ${this.renderRepeat(asset as V3Asset | undefined, view.geometry, unavailable)}\n ${this.renderGroups(groupFields(own, this.selected), 'figure.label.group-placement-size', 'figure.label.group-shape', unavailable, this.renderTools(unavailable))}\n ${this.renderLinks(unavailable, 'shape')}\n <figure-v3-material\n .body=${{ ...part, id: this.selected }}\n .palette=${view.palette ?? {}}\n ?locked=${unavailable}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n @v3-part-live=${(e: CustomEvent) => this.hold({}, e.detail.edit)}\n ></figure-v3-material>`\n : html`<slot name=\"figure\"></slot>\n ${this.renderGroups(groupFields(common), 'figure.label.group-figure-size', 'figure.label.design-inputs', unavailable)}\n ${this.renderInstanceRange(asset as V3Asset | undefined, unavailable)}`}\n </div>\n <div panel ?off=${tab !== 'capability'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'places') : null}\n <figure-v3-capability\n .asset=${asset}\n .selected=${this.selected}\n ?locked=${unavailable}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-capability>\n </div>\n <div panel ?off=${tab !== 'motion'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'motion') : html`<section><p hint>${i18next.t('figure.text.choose-a-part-to-move')}</p></section>`}\n ${this.renderControls(view, unavailable)}\n </div>\n <div panel flush ?off=${tab !== 'verdict'}><slot name=\"verdict\"></slot></div>\n <div panel flush ?off=${tab !== 'view'}>\n <figure-settings .view=${this.view} @update-view=${(e: CustomEvent) => this.setView(e.detail.view)}></figure-settings>\n </div>\n <div panel flush ?off=${tab !== 'history'}><slot name=\"history\"></slot></div>\n </aside>\n </ox-three-pane>`\n }\n /** Position, rotation and size as rows of three cells; the shape's own measures one to a line, under their title. */\n private renderGroups(\n groups: { vectors: FieldGroup[]; singles: FieldGroup[] },\n vectorTitle: string,\n singleTitle: string,\n unavailable: boolean,\n tools: unknown = null\n ) {\n return html`${groups.vectors.length || tools\n ? html`<section>\n <h3>${i18next.t(vectorTitle)}</h3>\n ${groups.vectors.map(g => this.renderVector(g, unavailable))}\n ${tools ? html`<div vector-row><label>${i18next.t('figure.label.tools')}</label>${tools}</div>` : nothing}\n </section>`\n : nothing}\n ${groups.singles.length\n ? html`<section>\n <h3>${i18next.t(singleTitle)}</h3>\n <div form>${groups.singles.map(g => (g.kind === 'single' ? this.renderSingle(g.name, g.field, unavailable) : nothing))}</div>\n </section>`\n : nothing}`\n }\n private renderVector(group: FieldGroup, unavailable: boolean) {\n if (group.kind !== 'vector') return nothing\n const unit = group.cells.x.unit === 'deg' ? '°' : group.cells.x.unit\n return html`<div vector-row>\n <label>${i18next.t('figure.label.group-' + group.name)}${group.name === 'rotation' ? '' : html` <span unit>${unit}</span>`}</label>\n <div triple>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div cell>\n <span axis ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(group.cells[axis] as never, e, unavailable)}>${axis.toUpperCase()}</span>\n <input\n aria-label=${group.cells[axis].id}\n type=\"number\"\n step=\"any\"\n .value=${String(group.cells[axis].value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(group.cells[axis] as never, e)}\n @change=${(e: Event) => this.changeField(group.cells[axis] as never, e)}\n />\n </div>`\n )}\n </div>\n </div>`\n }\n private renderSingle(name: string, field: FieldLike, unavailable: boolean) {\n const words = name.split('.').map(part => i18next.t('figure.label.field-' + part, { defaultValue: part }))\n return html`<span ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(field as never, e, unavailable)}>${words.join(' · ')} (${field.unit})</span\n ><input\n aria-label=${field.id}\n type=\"number\"\n step=\"any\"\n .value=${String(field.value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(field as never, e)}\n @change=${(e: Event) => this.changeField(field as never, e)}\n />`\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version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,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,CAAA;IAChF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAA;IAC3E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAA;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,EAAU;IACxB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IACvB,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped: position, rotation and size\n * as one row of three cells each (X · Y · Z read together), and the shape's own measures one to a line under their\n * own title. Kept apart from the editor so the grouping is tested without a browser.\n */\nexport interface FieldLike {\n id: string\n unit: string\n role?: string\n value: number\n}\n\nexport type Axis3 = 'x' | 'y' | 'z'\nconst AXES: readonly Axis3[] = ['x', 'y', 'z']\n\nexport type FieldGroup =\n | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: Record<Axis3, FieldLike> }\n | { kind: 'single'; name: string; field: FieldLike }\n\n/** The name a single value goes by: its id without the part, `dimension.` and corner numbers read as words. */\nfunction nameOf(rest: string): string {\n return rest.replace(/^dimension\\./, '')\n}\n\n/**\n * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come\n * first, each only when all three of its axes are there; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\n const prefix = part ? `${part}.` : ''\n const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\\.[xyz]$/.test(f.id)))\n const byId = new Map(own.map(f => [f.id, f]))\n const used = new Set<string>()\n const vectors: FieldGroup[] = []\n for (const name of ['position', 'rotation', 'size'] as const) {\n const ids = AXES.map(axis => `${prefix}${name}.${axis}`)\n if (!ids.every(id => byId.has(id))) continue\n ids.forEach(id => used.add(id))\n vectors.push({ kind: 'vector', name, cells: { x: byId.get(ids[0]!)!, y: byId.get(ids[1]!)!, z: byId.get(ids[2]!)! } })\n }\n const singles: FieldGroup[] = own.filter(f => !used.has(f.id)).map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }))\n return { vectors, singles }\n}\n\n/**\n * The part a copy copies: the member at the end of its path. A row repeats its part and what is fastened to it\n * (ADR-0093, 2026-09-26), so the copies of one row are of several parts -- a roller's and the mark on it.\n */\nconst memberOf = (path: unknown[]): string => {\n const last = [...path].reverse().find((step): step is string => typeof step === 'string')!\n return last.replace(/\\.(placed|value)$/, '').replace(/\\.repeat$/, '')\n}\n\n/**\n * The name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.placed\"]`), which the list showed as it was; it reads as the part it copies and its place counted from 1 --\n * `roller 1`, and `mark 1` for the mark the first roller carries. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n const path = pathOf(id)\n if (!path) return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${memberOf(path)} ${places.join('·')}` : id\n}\n\n/**\n * The repeat a body is a copy of: its name, how many copies it makes, and which copy this is (counted from 1). Nothing\n * for a body that is not a copy.\n */\nexport function repeatOf(id: string, geometry: readonly unknown[] | undefined): { name: string; count: number; index: number } | null {\n const path = pathOf(id)\n const paths = (geometry ?? []).map(g => pathOf((g as { id?: string }).id ?? '')).filter((p): p is unknown[] => !!p)\n if (!path) {\n /* The part itself, by its name: how many copies of it the row makes now. */\n const copies = paths.filter(p => memberOf(p) === id).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const name = memberOf(path)\n const count = paths.filter(p => p[0] === path[0] && memberOf(p) === name).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name, count, index: (index ?? 0) + 1 }\n}\n\nfunction pathOf(id: string): unknown[] | null {\n if (!id.startsWith('[')) return null\n try {\n const path = JSON.parse(id)\n return Array.isArray(path) && typeof path[0] === 'string' ? path : null\n } catch {\n return null\n }\n}\n\n/**\n * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The\n * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\nexport function ownerOf(id: string): string {\n const path = pathOf(id)\n return path ? memberOf(path) : id\n}\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-figure-facts.js","sourceRoot":"","sources":["../../client/modeller/v3-figure-facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAwBrG;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IA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,EAAE,CAAC;aAChD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CACjC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { compileV3Asset, parseV3Asset, v3OccupiedBoxesOf, v3WritersOf } from '@hatiolab/figure-model'\nimport type { V3Asset, V3Face } from '@hatiolab/figure-model'\n\n/*\n * What the V3 properties tab reads, kept apart from the element so it can be tested without a browser.\n */\n\nexport type Placement = 'floor' | 'ceiling' | 'center' | 'wall'\n\n/** What the properties tab reads off the asset. Absent parts of the asset read as absent, never as a default. */\nexport interface V3FigureFacts {\n name: string\n parts: string[]\n declared: boolean\n placement?: Placement\n mounting?: { part: string; face: V3Face }\n /**\n * Where the figure meets its plane, as its parts stand: the part whose bottom is lowest for a floor, whose top is\n * highest for a ceiling, whose back is furthest back for a wall. What the mounting face is offered as before one is\n * chosen -- the first part in the list offered a conveyor's bed, 700 mm up on its legs (walk 1, 2026-09-26).\n */\n suggested?: { part: string; face: V3Face }\n}\n\n/**\n * The asset's own facts, as the properties tab shows them.\n *\n * The mounting face is read back from the feature `set-mounting-face` writes (`<part>.mount.<face>`): the asset\n * records the face only as that node, so this is where the screen learns which one is chosen. Parts are the placed\n * bodies (`place@1`), in the order the model lists them.\n */\nexport function v3FigureFacts(source: string): V3FigureFacts {\n const asset = parseV3Asset(source) as V3Asset & { document: { model: { nodes: Array<{ id: string; op: string }> } } }\n const parts = asset.document.model.nodes.filter(node => node.op === 'place@1').map(node => node.id)\n const feature = (asset.occupancy?.contact as { surface?: { feature?: string } } | undefined)?.surface?.feature\n const found = feature?.match(/^(.+)\\.mount\\.(left|right|bottom|top|back|front)\\.value$/)\n return {\n name: asset.name,\n parts,\n declared: !!asset.occupancy,\n placement: asset.occupancy?.placement as Placement | undefined,\n mounting: found ? { part: found[1], face: found[2] as V3Face } : undefined,\n suggested: suggestedMountOf(asset, parts)\n }\n}\n\nfunction suggestedMountOf(asset: V3Asset, parts: string[]): { part: string; face: V3Face } | undefined {\n const placement = (asset.occupancy?.placement ?? 'floor') as Placement\n if (placement === 'center' || !parts.length) return undefined\n let boxes\n try {\n boxes = v3OccupiedBoxesOf(compileV3Asset(asset).evaluate().geometry, v3WritersOf(asset)).filter(b => parts.includes(b.part))\n } catch {\n return undefined\n }\n const [axis, face, sign] = placement === 'wall' ? (['z', 'back', -1] as const) : placement === 'ceiling' ? (['y', 'top', 1] as const) : (['y', 'bottom', -1] as const)\n /* The side of each box that faces the plane; the one furthest toward it, the first in the list among equals. */\n const reach = (b: (typeof boxes)[number]) => sign * (b.centre[axis] + (sign * b.extent[axis]) / 2)\n let best: (typeof boxes)[number] | undefined\n for (const b of boxes) if (!best || reach(b) > reach(best) + 1e-6) best = b\n return best ? { part: best.part, face } : undefined\n}\n\n/**\n * A tag line as a list: split on commas, drop a leading `#`, keep each once. An empty\n * line is an empty list, so an author can clear every tag.\n */\nexport function tagsOf(raw: string): string[] {\n return [\n ...new Set(\n raw\n .split(',')\n .map(one => one.trim().replace(/^#+/, '').trim())\n .filter(one => one.length > 0)\n )\n ]\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-first-save.js","sourceRoot":"","sources":["../../client/modeller/v3-first-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErF;;;;GAIG;AAEH,oGAAoG;AACpG,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,GAAG,CAAA;AAChI,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,KAAwB;IACvE,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAA;IAC1D,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,qCAAqC,EAAE,IAAI,EAAE,CAAA;IACrF,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { isPlaceholderType, TYPE_LENGTH, TYPE_PATTERN } from '@hatiolab/figure-model'\n\n/*\n * The first save of a new figure asks for its type and name. The type is the name a board places\n * the figure by; it freezes when the figure is released (ADR-0063 decision 4). The modeller once saved a new figure\n * under a temporary machine name and asked nothing -- the author had to find the field afterwards (user, 2026-09-25).\n */\n\n/** A type as typed, made into the shape a type has: letters, digits and underscores, upper case. */\nexport function typeOf(raw: string): string {\n return raw.trim().replace(/[^A-Za-z0-9_]/g, '_').toUpperCase()\n}\n\n/**\n * Whether this name could be released, by the format's own rules (`type-not-identifier`, `type-is-placeholder`).\n * Saving under it is not blocked -- it can still change before release -- but the author hears it now.\n */\nexport function releasableType(type: string): boolean {\n return !isPlaceholderType(type) && TYPE_PATTERN.test(type) && type.length >= TYPE_LENGTH.min && type.length <= TYPE_LENGTH.max\n}\n\n/** Why the first save cannot go on with this type, as an i18n key, or null when it can. */\nexport function firstSaveRefusalOf(type: string, taken: readonly string[]): { key: string; type?: string } | null {\n if (!type) return { key: 'figure.text.enter-a-type-name' }\n if (taken.includes(type)) return { key: 'figure.text.type-name-already-taken', type }\n return null\n}\n\n/** What the first save asks for. */\nexport interface FirstSave {\n type: string\n name: string\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-gizmo.js","sourceRoot":"","sources":["../../client/modeller/v3-gizmo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,M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AU,iBAAiB,CAAC,IAAY,EAAE,KAAiB,EAAE,KAAa,EAAE,KAAa,EAAE,MAA8B;IAC7H,IAAI,CAAC,KAAK,CAAC,SAAS;QAAE,OAAO,EAAE,CAAA;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;IAC/E,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,EAAE,CAAA;IAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,aAAa,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACvF,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAC1B,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,aAAa,CAAC,CAAA;IAClC,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IACjF,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAmB,CAAC,CAAA;AACpJ,CAAC","sourcesContent":["import { v3AttachmentsOf } from '@hatiolab/figure-model'\nimport type { V3Asset, V3InputChange } from '@hatiolab/figure-model'\n\n/**\n * What the gizmo may write for a part: move · turn · size, on a V3 asset.\n *\n * A drag can only be written back where the part is placed by its own numbers. A part the create commands made is:\n * its pose is `rigid@1` into the asset frame from `<part>.position.*` and `<part>.rotation.*`, and a box's shape\n * (`box-shape@1` or `rounded-box@1`) takes its width, height and depth from inputs of its own — `<part>.size.*` from\n * `addV3Box`, `<part>.dimension.*` from the editor's shape palette. A part fastened to another, following an instance size or placed by\n * expressions has no such numbers; the gizmo does not offer what it could not write back, rather\n * than move something the next evaluation would put back.\n */\nexport interface GizmoReach {\n translate: boolean\n rotate: boolean\n scale: boolean\n /** The inputs sizing the part along X, Y and Z, when it can be sized. */\n sizes?: [string, string, string]\n /**\n * Per axis, the part's own measure, or null where the measure follows another (a square section's depth following\n * its width): a scale drag writes the own ones and leaves a followed one to what it follows.\n */\n ownSizes?: (string | null)[]\n /**\n * A round part keeps its section round: the radii across (X and Z) take the one factor\n * the drag gave most; the length along Y takes its own. A sphere's three radii take one factor together.\n */\n round?: { across: string[]; along: string[] }\n}\n\n/** Shapes whose first three arguments are the extent along X, Y and Z: a door frame's too (its width, height, depth). */\nconst BOXES = new Set(['box-shape@1', 'rounded-box@1', 'portal-profile@2', 'hollow-box@2'])\n\ninterface Node {\n id: string\n op: string\n args: string[]\n outputs?: Record<string, string>\n params?: Record<string, unknown>\n}\ninterface AssetLike {\n document: { model: { nodes: Node[]; inputs: Array<{ id: string; role?: string }>; constants?: Array<{ id: string; value: number }> } }\n}\n\nconst AXES = ['x', 'y', 'z'] as const\n\nexport function gizmoReachOf(asset: AssetLike, part: string): GizmoReach {\n const { nodes, inputs } = asset.document.model\n const design = new Set(inputs.filter(input => input.role === 'design').map(input => input.id))\n const own = (name: string) => AXES.map(axis => `${part}.${name}.${axis}`)\n const allDesign = (ids: string[]) => ids.every(id => design.has(id))\n const pose = nodes.find(node => node.id === `${part}.pose`)\n const placed = nodes.find(node => node.id === part && node.op === 'place@1')\n const direct = !!pose && pose.op === 'rigid@1' && pose.params?.to === 'asset' && placed?.args[1] === `${part}.poseValue`\n /*\n A part taken off another (detach) stands on a seat into the asset frame with its own position numbers back. It\n can be moved like a part never fastened — unless it moves by itself, when where it is drawn is not its position.\n */\n const reseated =\n !!pose &&\n pose.op === 'rigid@1' &&\n !nodes.some(node => node.id === `${part}.motion`) &&\n v3AttachmentsOf(asset as unknown as V3Asset)[part] === null\n const posed = direct || reseated\n const shape = nodes.find(node => node.id === `${part}.shape`)\n const mine = (ids: string[]) => ids.every(id => id.startsWith(`${part}.`) && design.has(id))\n const round =\n shape?.op === 'cylinder-shape@1' && mine(shape.args.slice(0, 2))\n ? { across: [shape.args[0]!], along: [shape.args[1]!] }\n : shape?.op === 'frustum-shape@1' && mine(shape.args.slice(0, 3))\n ? { across: shape.args.slice(0, 2), along: [shape.args[2]!] }\n : shape?.op === 'sphere-shape@1' && mine(shape.args.slice(0, 3))\n ? { across: shape.args.slice(0, 3), along: [] }\n : undefined\n const extent = shape && BOXES.has(shape.op) ? shape.args.slice(0, 3) : []\n const sizes =\n extent.length === 3 && extent.every(id => id.startsWith(`${part}.`) && design.has(id)) ? (extent as [string, string, string]) : undefined\n /*\n The part's own measure, also when another reads it: a measure some other part follows is read through a node of its\n own times 1 (`link-dimension`), and it is still the author's number -- the upper arm's width, which the forearm\n follows, is the upper arm's to drag.\n */\n const constants = asset.document.model.constants ?? []\n const ownMeasure = (id: string): string | null => {\n if (id.startsWith(`${part}.`) && design.has(id)) return id\n const writer = nodes.find(node => Object.values(node.outputs ?? {}).includes(id))\n const one = writer?.op === 'mul@1' && writer.args.length === 2 && constants.find(c => c.id === writer.args[1])?.value === 1\n return one && writer!.args[0]!.startsWith(`${part}.`) && design.has(writer!.args[0]!) ? writer!.args[0]! : null\n }\n const ownSizes = extent.length === 3 && !sizes ? extent.map(ownMeasure) : undefined\n const someOwn = !!ownSizes?.some(Boolean)\n return {\n translate: posed && allDesign(own('position')) && own('position').every((id, i) => pose!.args[i] === id),\n rotate: posed && allDesign(own('rotation')) && own('rotation').every((id, i) => pose!.args[3 + i] === id),\n scale: !!sizes || !!round || someOwn,\n ...(sizes ? { sizes } : {}),\n ...(someOwn ? { ownSizes } : {}),\n ...(round ? { round } : {})\n }\n}\n\n/** Where a drag left the part, in the asset frame: millimetres, degrees and per-axis scale. */\nexport interface GizmoResult {\n position?: [number, number, number]\n rotation?: [number, number, number]\n scale?: [number, number, number]\n}\n\n/**\n * The input changes a drag makes — one list, applied as one step. Millimetres to the millimetre and degrees to a\n * tenth (a drag otherwise stores 722.4180046035418 mm). A size never goes below 1 mm.\n */\nexport function gizmoChanges(part: string, reach: GizmoReach, result: GizmoResult, sizes: Record<string, number>): V3InputChange[] {\n const changes: V3InputChange[] = []\n const put = (input: string, unit: V3InputChange['unit'], value: number) =>\n changes.push({ kind: 'set-design', input, unit, value } as V3InputChange)\n if (result.position && reach.translate)\n AXES.forEach((axis, i) => put(`${part}.position.${axis}`, 'mm', Math.round(result.position![i]!)))\n if (result.rotation && reach.rotate)\n AXES.forEach((axis, i) => put(`${part}.rotation.${axis}`, 'deg', Math.round(result.rotation![i]! * 10) / 10))\n if (result.scale && reach.scale && reach.sizes)\n reach.sizes.forEach((id, i) => {\n if (sizes[id] !== undefined) put(id, 'mm', Math.max(1, Math.round(sizes[id]! * result.scale![i]!)))\n })\n if (result.scale && reach.scale && reach.ownSizes)\n reach.ownSizes.forEach((id, i) => {\n if (id && sizes[id] !== undefined && Math.abs(result.scale![i]! - 1) > 1e-4) put(id, 'mm', Math.max(1, Math.round(sizes[id]! * result.scale![i]!)))\n })\n if (result.scale && reach.scale && reach.round) {\n const [sx, sy, sz] = result.scale\n /* The factor the drag moved most: across for a cylinder (X or Z), any axis for a sphere. */\n const most = (factors: number[]) => factors.reduce((a, b) => (Math.abs(b - 1) > Math.abs(a - 1) ? b : a), 1)\n const sphere = reach.round.along.length === 0\n const across = sphere ? most([sx!, sy!, sz!]) : most([sx!, sz!])\n for (const id of reach.round.across) if (sizes[id] !== undefined) put(id, 'mm', Math.max(1, Math.round(sizes[id]! * across)))\n for (const id of reach.round.along) if (sizes[id] !== undefined) put(id, 'mm', Math.max(1, Math.round(sizes[id]! * sy!)))\n }\n return changes\n}\n\n/**\n * A height typed into its field keeps the part's bottom where it is, as the scale gizmo does (it anchors the opposite\n * face): the part's own Y position moves by half the change. A post typed 2200 tall sank 933 mm under the floor\n * (2026-09-26). Only for a part placed by its own numbers and standing unturned; otherwise its height is not up and down.\n */\nexport function keepBottomChanges(part: string, reach: GizmoReach, input: string, value: number, values: Record<string, number>): V3InputChange[] {\n if (!reach.translate) return []\n const height = reach.sizes?.[1] ?? reach.ownSizes?.[1] ?? reach.round?.along[0]\n if (!height || height !== input) return []\n if (AXES.some(axis => (values[`${part}.rotation.${axis}`] ?? 0) % 360 !== 0)) return []\n const before = values[input],\n y = values[`${part}.position.y`]\n if (before === undefined || y === undefined || !Number.isFinite(value)) return []\n return [{ kind: 'set-design', input: `${part}.position.y`, unit: 'mm', value: Math.round((y + (value - before) / 2) * 10) / 10 } as V3InputChange]\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3-help.js","sourceRoot":"","sources":["../../client/modeller/v3-help.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAwD,MAAM,KAAK,CAAA;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAGtB,YAA6B,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;QAFjD,WAAM,GAAG,IAAI,GAAG,EAAU,CAAA;QAGhC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,aAAa,KAAI,CAAC;IAElB,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC7B,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;;YAC5C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA;IAC3B,CAAC;IAED,gFAAgF;IAChF,MAAM,CAAC,GAAW;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClC,OAAO,IAAI,CAAA,2BAA2B,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,kBAAkB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;iBAClI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc;cAClC,CAAA;IACZ,CAAC;IAED,IAAI,CAAC,GAAW;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,WAAW,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;IAC7E,CAAC;CACF","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { html, nothing, type ReactiveController, type ReactiveControllerHost } from 'lit'\nimport { i18next } from '@operato/i18n'\n\n/**\n * Help toggles: a small 「?」 beside a title opens the longer explanation under it. Explanations left open on every\n * section made the side read as clutter (user, 2026-09-24); the author opens the one they want. What was opened stays\n * open while the author moves between parts.\n */\nexport class HelpToggles implements ReactiveController {\n private opened = new Set<string>()\n\n constructor(private readonly host: ReactiveControllerHost) {\n host.addController(this)\n }\n\n hostConnected() {}\n\n isOpen(key: string) {\n return this.opened.has(key)\n }\n\n toggle(key: string) {\n if (this.opened.has(key)) this.opened.delete(key)\n else this.opened.add(key)\n this.host.requestUpdate()\n }\n\n /** The 「?」: it takes no line of its own, it sits in the title's spare width. */\n button(key: string) {\n const shown = this.opened.has(key)\n return html`<button help aria-label=${i18next.t('figure.label.help')} aria-expanded=${shown ? 'true' : 'false'} @click=${() => this.toggle(key)}>\n <md-icon>${shown ? 'help' : 'help_outline'}</md-icon>\n </button>`\n }\n\n hint(key: string) {\n return this.opened.has(key) ? html`<p hint>${i18next.t(key)}</p>` : nothing\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- import type { V3Asset, V3Joint } from '@hatiolab/figure-model';
2
- import type { GizmoResult } from './v3-gizmo.js';
3
- import type { V3RenderPart } from './v3-renderer.js';
4
- export type JointDrag = {
5
- kind: 'value';
6
- input: string;
7
- unit: 'deg' | 'mm' | 'ratio';
8
- value: number;
9
- } | {
10
- kind: 'joint';
11
- joint: V3Joint;
12
- } | {
13
- kind: 'refused';
14
- reason: 'mimic' | 'fixed-turn' | 'origin-follows' | 'turned-slide' | 'off-axis';
15
- joint: string;
16
- leader?: string;
17
- axis?: string;
18
- };
19
- export declare function jointDragOf(asset: V3Asset, id: string, part: V3RenderPart, result: GizmoResult, values: Record<string, number>): JointDrag | null;