@things-factory/figure-ui 10.1.75 → 10.1.76

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 (235) 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/store.js +39 -0
  46. package/dist-client/graphql/store.js.map +1 -0
  47. package/dist-client/modeller/ai-proposal.d.ts +51 -0
  48. package/dist-client/modeller/ai-proposal.js +64 -0
  49. package/dist-client/modeller/ai-proposal.js.map +1 -0
  50. package/dist-client/modeller/align.d.ts +30 -0
  51. package/dist-client/modeller/align.js +75 -0
  52. package/dist-client/modeller/align.js.map +1 -0
  53. package/dist-client/modeller/canvas.d.ts +72 -0
  54. package/dist-client/modeller/canvas.js +379 -0
  55. package/dist-client/modeller/canvas.js.map +1 -0
  56. package/dist-client/modeller/clips.d.ts +39 -0
  57. package/dist-client/modeller/clips.js +58 -0
  58. package/dist-client/modeller/clips.js.map +1 -0
  59. package/dist-client/modeller/controls.d.ts +28 -0
  60. package/dist-client/modeller/controls.js +28 -0
  61. package/dist-client/modeller/controls.js.map +1 -0
  62. package/dist-client/modeller/editor.d.ts +203 -0
  63. package/dist-client/modeller/editor.js +1526 -0
  64. package/dist-client/modeller/editor.js.map +1 -0
  65. package/dist-client/modeller/fields.d.ts +45 -0
  66. package/dist-client/modeller/fields.js +83 -0
  67. package/dist-client/modeller/fields.js.map +1 -0
  68. package/dist-client/modeller/figure-capability-panel.d.ts +22 -0
  69. package/dist-client/modeller/figure-capability-panel.js +141 -0
  70. package/dist-client/modeller/figure-capability-panel.js.map +1 -0
  71. package/dist-client/modeller/figure-clips.d.ts +31 -0
  72. package/dist-client/modeller/figure-clips.js +268 -0
  73. package/dist-client/modeller/figure-clips.js.map +1 -0
  74. package/dist-client/modeller/figure-controls.d.ts +36 -0
  75. package/dist-client/modeller/figure-controls.js +226 -0
  76. package/dist-client/modeller/figure-controls.js.map +1 -0
  77. package/dist-client/modeller/figure-facts.d.ts +35 -0
  78. package/dist-client/modeller/figure-facts.js +55 -0
  79. package/dist-client/modeller/figure-facts.js.map +1 -0
  80. package/dist-client/modeller/figure-first-save.d.ts +20 -0
  81. package/dist-client/modeller/figure-first-save.js +118 -0
  82. package/dist-client/modeller/figure-first-save.js.map +1 -0
  83. package/dist-client/modeller/figure-history-panel.d.ts +1 -1
  84. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  85. package/dist-client/modeller/figure-links.d.ts +77 -0
  86. package/dist-client/modeller/figure-links.js +649 -0
  87. package/dist-client/modeller/figure-links.js.map +1 -0
  88. package/dist-client/modeller/figure-material-panel.d.ts +39 -0
  89. package/dist-client/modeller/figure-material-panel.js +323 -0
  90. package/dist-client/modeller/figure-material-panel.js.map +1 -0
  91. package/dist-client/modeller/figure-parts.d.ts +69 -0
  92. package/dist-client/modeller/figure-parts.js +559 -0
  93. package/dist-client/modeller/figure-parts.js.map +1 -0
  94. package/dist-client/modeller/figure-preview.d.ts +34 -0
  95. package/dist-client/modeller/figure-preview.js +346 -0
  96. package/dist-client/modeller/figure-preview.js.map +1 -0
  97. package/dist-client/modeller/figure-properties.d.ts +45 -0
  98. package/dist-client/modeller/figure-properties.js +239 -0
  99. package/dist-client/modeller/figure-properties.js.map +1 -0
  100. package/dist-client/modeller/figure-recipe-catalog.d.ts +38 -0
  101. package/dist-client/modeller/figure-recipe-catalog.js +399 -0
  102. package/dist-client/modeller/figure-recipe-catalog.js.map +1 -0
  103. package/dist-client/modeller/figure-verdict.d.ts +64 -0
  104. package/dist-client/modeller/figure-verdict.js +787 -0
  105. package/dist-client/modeller/figure-verdict.js.map +1 -0
  106. package/dist-client/modeller/first-save.d.ts +17 -0
  107. package/dist-client/modeller/first-save.js +26 -0
  108. package/dist-client/modeller/first-save.js.map +1 -0
  109. package/dist-client/modeller/gate-findings.d.ts +2 -2
  110. package/dist-client/modeller/gate-findings.js +2 -2
  111. package/dist-client/modeller/gate-findings.js.map +1 -1
  112. package/dist-client/modeller/gizmo.d.ts +72 -0
  113. package/dist-client/modeller/gizmo.js +111 -0
  114. package/dist-client/modeller/gizmo.js.map +1 -0
  115. package/dist-client/modeller/help.d.ts +18 -0
  116. package/dist-client/modeller/help.js +37 -0
  117. package/dist-client/modeller/help.js.map +1 -0
  118. package/dist-client/modeller/joint-drag.d.ts +19 -0
  119. package/dist-client/modeller/joint-drag.js +97 -0
  120. package/dist-client/modeller/joint-drag.js.map +1 -0
  121. package/dist-client/modeller/joint-fan.d.ts +9 -0
  122. package/dist-client/modeller/joint-fan.js +276 -0
  123. package/dist-client/modeller/joint-fan.js.map +1 -0
  124. package/dist-client/modeller/keys.d.ts +22 -0
  125. package/dist-client/modeller/keys.js +26 -0
  126. package/dist-client/modeller/keys.js.map +1 -0
  127. package/dist-client/modeller/links.d.ts +267 -0
  128. package/dist-client/modeller/links.js +480 -0
  129. package/dist-client/modeller/links.js.map +1 -0
  130. package/dist-client/modeller/live.d.ts +37 -0
  131. package/dist-client/modeller/live.js +68 -0
  132. package/dist-client/modeller/live.js.map +1 -0
  133. package/dist-client/modeller/maturity.d.ts +120 -0
  134. package/dist-client/modeller/maturity.js +313 -0
  135. package/dist-client/modeller/maturity.js.map +1 -0
  136. package/dist-client/modeller/modeller-route.d.ts +1 -1
  137. package/dist-client/modeller/modeller-route.js +1 -1
  138. package/dist-client/modeller/modeller-route.js.map +1 -1
  139. package/dist-client/modeller/occupancy.d.ts +18 -0
  140. package/dist-client/modeller/occupancy.js +24 -0
  141. package/dist-client/modeller/occupancy.js.map +1 -0
  142. package/dist-client/modeller/palette.d.ts +7 -0
  143. package/dist-client/modeller/palette.js +46 -0
  144. package/dist-client/modeller/palette.js.map +1 -0
  145. package/dist-client/modeller/preview-model.d.ts +47 -0
  146. package/dist-client/modeller/preview-model.js +68 -0
  147. package/dist-client/modeller/preview-model.js.map +1 -0
  148. package/dist-client/modeller/product-session.d.ts +510 -0
  149. package/dist-client/modeller/product-session.js +157 -0
  150. package/dist-client/modeller/product-session.js.map +1 -0
  151. package/dist-client/modeller/recipe-source.d.ts +8 -0
  152. package/dist-client/modeller/recipe-source.js +14 -0
  153. package/dist-client/modeller/recipe-source.js.map +1 -0
  154. package/dist-client/modeller/recipes.d.ts +37 -0
  155. package/dist-client/modeller/recipes.js +103 -0
  156. package/dist-client/modeller/recipes.js.map +1 -0
  157. package/dist-client/modeller/refusals.d.ts +68 -0
  158. package/dist-client/modeller/refusals.js +142 -0
  159. package/dist-client/modeller/refusals.js.map +1 -0
  160. package/dist-client/modeller/renderer.d.ts +40 -0
  161. package/dist-client/modeller/renderer.js +73 -0
  162. package/dist-client/modeller/renderer.js.map +1 -0
  163. package/dist-client/modeller/stage-model.d.ts +39 -0
  164. package/dist-client/modeller/stage-model.js +147 -0
  165. package/dist-client/modeller/stage-model.js.map +1 -0
  166. package/dist-client/modeller/thumbnail.d.ts +3 -0
  167. package/dist-client/modeller/thumbnail.js +75 -0
  168. package/dist-client/modeller/thumbnail.js.map +1 -0
  169. package/dist-client/pages/figure-list-page.d.ts +1 -1
  170. package/dist-client/pages/figure-list-page.js +4 -4
  171. package/dist-client/pages/figure-list-page.js.map +1 -1
  172. package/dist-client/pages/figure-modeller-page.d.ts +102 -0
  173. package/dist-client/pages/figure-modeller-page.js +548 -0
  174. package/dist-client/pages/figure-modeller-page.js.map +1 -0
  175. package/dist-client/route.d.ts +1 -1
  176. package/dist-client/route.js +1 -5
  177. package/dist-client/route.js.map +1 -1
  178. package/dist-client/tsconfig.tsbuildinfo +1 -1
  179. package/docs/product-cutover.md +25 -0
  180. package/package.json +5 -5
  181. package/test/{v3-ai-proposal.test.ts → ai-proposal.test.ts} +6 -6
  182. package/test/{v3-align.test.ts → align.test.ts} +8 -8
  183. package/test/browser/modeller-page.js +30 -30
  184. package/test/browser/modeller.check.mjs +14 -14
  185. package/test/browser/serve.mjs +1 -1
  186. package/test/browser/thumbnail-page.js +6 -6
  187. package/test/{v3-clips.test.ts → clips.test.ts} +18 -18
  188. package/test/{v3-controls.test.ts → controls.test.ts} +15 -15
  189. package/test/{v3-fields.test.ts → fields.test.ts} +13 -13
  190. package/test/figure-assistant-surface.test.ts +3 -3
  191. package/test/{v3-first-save.test.ts → first-save.test.ts} +10 -10
  192. package/test/fixtures/joint-column.json +2 -2
  193. package/test/fixtures/joint-roller.json +2 -2
  194. package/test/fixtures/robot-arm-6dof.json +2 -2
  195. package/test/{v3-gizmo.test.ts → gizmo.test.ts} +33 -33
  196. package/test/{v3-joint-drag.test.ts → joint-drag.test.ts} +17 -17
  197. package/test/{v3-joint-fan.test.ts → joint-fan.test.ts} +18 -18
  198. package/test/joints.ts +6 -6
  199. package/test/{v3-keys.test.ts → keys.test.ts} +2 -2
  200. package/test/{v3-layout.test.ts → layout.test.ts} +8 -8
  201. package/test/{v3-links.test.ts → links.test.ts} +201 -201
  202. package/test/{v3-live.test.ts → live.test.ts} +18 -18
  203. package/test/{v3-material.test.ts → material.test.ts} +12 -12
  204. package/test/{v3-maturity.test.ts → maturity.test.ts} +74 -74
  205. package/test/modeller-route.test.ts +5 -6
  206. package/test/{v3-palette-icons.test.ts → palette-icons.test.ts} +1 -1
  207. package/test/{v3-parts-wiring.test.ts → parts-wiring.test.ts} +5 -5
  208. package/test/{v3-preview.test.ts → preview.test.ts} +12 -12
  209. package/test/{v3-product-session.test.ts → product-session.test.ts} +17 -17
  210. package/test/{v3-product-write.test.ts → product-write.test.ts} +20 -20
  211. package/test/{v3-properties.test.ts → properties.test.ts} +24 -24
  212. package/test/{v3-recipes.test.ts → recipes.test.ts} +9 -9
  213. package/test/{v3-refusals.test.ts → refusals.test.ts} +43 -43
  214. package/test/{v3-release-panel.test.ts → release-panel.test.ts} +21 -21
  215. package/test/renderer.test.ts +24 -0
  216. package/test/resolve-ts-siblings.mjs +1 -1
  217. package/test/{v3-scene-canvas.test.ts → scene-canvas.test.ts} +6 -6
  218. package/test/{v3-stage-model.test.ts → stage-model.test.ts} +5 -5
  219. package/test/{v3-theme.test.ts → theme.test.ts} +4 -4
  220. package/test/{v3-thumbnail.test.ts → thumbnail.test.ts} +4 -4
  221. package/test/{v3-verdict.test.ts → verdict.test.ts} +17 -17
  222. package/test/{v3-view.test.ts → view.test.ts} +2 -2
  223. package/things-factory.config.js +2 -3
  224. package/translations/en.json +2 -2
  225. package/translations/ja.json +2 -2
  226. package/translations/ko.json +2 -2
  227. package/translations/ms.json +2 -2
  228. package/translations/zh.json +2 -2
  229. package/docs/v3-product-cutover.md +0 -25
  230. package/test/v3-renderer.test.ts +0 -24
  231. /package/client/modeller/{v3-fields.ts → fields.ts} +0 -0
  232. /package/client/modeller/{v3-first-save.ts → first-save.ts} +0 -0
  233. /package/client/modeller/{v3-help.ts → help.ts} +0 -0
  234. /package/client/modeller/{v3-keys.ts → keys.ts} +0 -0
  235. /package/client/modeller/{v3-refusals.ts → refusals.ts} +0 -0
@@ -0,0 +1,69 @@
1
+ import '@material/web/icon/icon.js';
2
+ import { LitElement } from 'lit';
3
+ import type { FigurePrimitiveCreation } from '@hatiolab/figure-model';
4
+ import type { FigureBudgetLine } from './maturity.js';
5
+ /**
6
+ * 도형 팔레트와 부품 목록 — 자산의 것.
7
+ *
8
+ * 팔레트는 목록 위에, 눈 단추는 늘 자리를 차지하고, 조작은 고른 줄에서만 보인다.
9
+ *
10
+ * 부품의 도형은 평가가 준 `provider` 로 읽는다. 「숨김」은 여기서도 **작업대의 것**이다 — 저장되지 않고, 자산의 `visibility`(상태에 따라
11
+ * 보이고 안 보이는 것)와는 다른 것이다. 그것은 속성 패널의 몫이다.
12
+ *
13
+ * 이 컴포넌트는 정본을 만지지 않는다. 무엇을 하겠다는 것만 알린다.
14
+ */
15
+ /** 한 줄 — 평가에서 이 패널이 읽는 것만. */
16
+ export interface FigurePartRow {
17
+ id: string;
18
+ provider: string;
19
+ /** 작업대에서 잠깐 가린 것. 저장되지 않는다. */
20
+ hidden?: boolean;
21
+ /** 자산이 지금 상태에서 보이지 않는다고 한 것. 저장되는 것이고, 여기서는 표시만 한다. */
22
+ invisible?: boolean;
23
+ /** 되풀이한 부품이면 지금 몇 개로 그려지나. 되풀이는 한 부품이다 — 한 줄로 보인다. */
24
+ copies?: number;
25
+ }
26
+ /** 팔레트 — 저작 API 가 만들 수 있는 것만 보인다. */
27
+ export type FigurePaletteKind = FigurePrimitiveCreation['kind'] | 'plate' | 'wall';
28
+ declare const FigureParts_base: (new (...args: any[]) => LitElement) & typeof LitElement;
29
+ export declare class FigureParts extends FigureParts_base {
30
+ static styles: import("lit").CSSResult[];
31
+ parts: FigurePartRow[];
32
+ /** 고른 부품의 id. 자리(index)가 아니다 — 부품은 id 로 안정하게 가리킨다. */
33
+ selected: string;
34
+ /** 편집할 수 없을 때(불러오는 중 · 저장 중) 팔레트와 조작을 잠근다. */
35
+ locked: boolean;
36
+ /**
37
+ * 이 도형이 치르는 값 — 삼각형 · 묶음 · 한 화면에 몇 대 · 등급. 부품을 더하는 바로 그 자리에서 보여야 로우폴리의
38
+ * 기준이 저작을 이끈다. 등급이 D 면 무엇이 넘쳤는지를 적는다. 누르면 성숙도 탭이 열린다.
39
+ */
40
+ budget?: FigureBudgetLine;
41
+ /**
42
+ * 디테일 등급(S/M/L)의 부품 한도(사용자 2026-09-24). 부품을 넣기 **전에** 몇 개 남았는지 보이고, 다 차면 팔레트가
43
+ * 잠긴다. 되풀이는 한 부품으로 센다. 등급을 안 정했으면 한도는 없다.
44
+ */
45
+ partBudget?: {
46
+ level: 'S' | 'M' | 'L' | null;
47
+ used: number;
48
+ limit: number | null;
49
+ };
50
+ /** How many recipe templates the catalog holds; none, and the section is not drawn. */
51
+ recipeCount: number;
52
+ render(): import("lit-html").TemplateResult<1>;
53
+ /** 디테일 등급 — 고르면 한도가 바뀐다. 목록 머리 아래. */
54
+ private renderLevel;
55
+ private renderBudget;
56
+ /** 한꺼번에 감추고 한꺼번에 되돌린다 — 하나라도 감춰져 있으면 다 되돌리고, 다 보이면 다 감춘다. */
57
+ private renderShowAll;
58
+ private renderRow;
59
+ /** 고른 줄의 조작. 못 하는 것은 빼지 않고 흐리게 둔다 — 자리가 밀리면 연달아 지우다 엉뚱한 것을 누른다. */
60
+ private renderOps;
61
+ /**
62
+ * Recipes (ADR-0095): the catalog of templates -- a door, a roller row -- opened over the modeller, put onto the chosen
63
+ * part in one step.
64
+ */
65
+ private renderRecipes;
66
+ /** 정본을 고치지 않는다 — 무엇을 하겠다는 것만 알린다. */
67
+ private ask;
68
+ }
69
+ export {};
@@ -0,0 +1,559 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import { css, html, LitElement, nothing } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { i18next, localize } from '@operato/i18n';
6
+ import { ScrollbarStyles } from '@operato/styles';
7
+ import { PART_LIMIT } from '@hatiolab/figure-model';
8
+ import { partLabelOf } from './fields.js';
9
+ /** 제공자마다의 아이콘. Material Symbols 이름이다. */
10
+ const PROVIDER_ICON = {
11
+ box: 'deployed_code',
12
+ cylinder: 'database',
13
+ ellipticCylinder: 'database',
14
+ frustum: 'change_history',
15
+ sphere: 'circle',
16
+ roundedBox: 'crop_square',
17
+ roundedBoxXZ: 'crop_square',
18
+ hollowBox: 'check_box_outline_blank',
19
+ hollowBoxXZ: 'check_box_outline_blank',
20
+ polygon: 'pentagon',
21
+ portal: 'door_front'
22
+ };
23
+ const RECIPES = [
24
+ { kind: 'box', icon: 'deployed_code', label: 'figure.label.primitive-cube' },
25
+ { kind: 'cylinder', icon: 'database', label: 'figure.label.primitive-cylinder' },
26
+ { kind: 'rounded-box', icon: 'crop_square', label: 'figure.label.primitive-rounded-box' },
27
+ { kind: 'sphere', icon: 'circle', label: 'figure.label.primitive-sphere' },
28
+ { kind: 'frustum', icon: 'change_history', label: 'figure.label.primitive-frustum' },
29
+ { kind: 'polygon', icon: 'hexagon', label: 'figure.label.primitive-polygon' },
30
+ { kind: 'plate', icon: 'check_box_outline_blank', label: 'figure.label.primitive-plate' },
31
+ { kind: 'wall', icon: 'crop_portrait', label: 'figure.label.primitive-wall' },
32
+ { kind: 'portal', icon: 'door_front', label: 'figure.label.primitive-portal' },
33
+ { kind: 'hollow-box', icon: 'inventory_2', label: 'figure.label.primitive-hollow-box' }
34
+ ];
35
+ let FigureParts = class FigureParts extends localize(i18next)(LitElement) {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.parts = [];
39
+ /** 고른 부품의 id. 자리(index)가 아니다 — 부품은 id 로 안정하게 가리킨다. */
40
+ this.selected = '';
41
+ /** 편집할 수 없을 때(불러오는 중 · 저장 중) 팔레트와 조작을 잠근다. */
42
+ this.locked = false;
43
+ /** How many recipe templates the catalog holds; none, and the section is not drawn. */
44
+ this.recipeCount = 0;
45
+ }
46
+ static { this.styles = [
47
+ ScrollbarStyles,
48
+ css `
49
+ :host {
50
+ display: flex;
51
+ flex-direction: column;
52
+ min-height: 0;
53
+ overflow: hidden;
54
+ background-color: var(--md-sys-color-surface-container-lowest);
55
+ /* The divider beside it is the editor's frame's (ox-three-pane). */
56
+ color: var(--md-sys-color-on-surface);
57
+ font: var(--label-font, inherit);
58
+ font-size: 0.76rem;
59
+ /* Folds by its own width: the editor gives this column 140 px when it has two columns (UX, 2026-09-24). */
60
+ container-type: inline-size;
61
+ }
62
+ section {
63
+ padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);
64
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
65
+ }
66
+ section[list] {
67
+ flex: 1;
68
+ min-height: 0;
69
+ overflow-y: auto;
70
+ }
71
+ h3 {
72
+ display: flex;
73
+ align-items: baseline;
74
+ justify-content: space-between;
75
+ gap: 6px;
76
+ margin: 0 0 6px 0;
77
+ font-size: var(--ui-t-micro, 11px);
78
+ font-weight: 700;
79
+ letter-spacing: 0.04em;
80
+ text-transform: uppercase;
81
+ color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));
82
+ }
83
+ /* The cost line: the grade's letter in its colour, then what the figure costs. */
84
+ button[budget] {
85
+ display: flex;
86
+ align-items: flex-start;
87
+ gap: 6px;
88
+ width: 100%;
89
+ margin: 0 0 6px;
90
+ padding: 4px 6px;
91
+ font: inherit;
92
+ font-size: 0.68rem;
93
+ line-height: 1.5;
94
+ text-align: left;
95
+ color: var(--md-sys-color-on-surface-variant);
96
+ background: none;
97
+ border: 1px solid var(--md-sys-color-outline-variant);
98
+ border-radius: 6px;
99
+ cursor: pointer;
100
+ }
101
+ button[budget]:hover {
102
+ background: var(--md-sys-color-surface-container);
103
+ }
104
+ button[budget] b {
105
+ flex: none;
106
+ min-width: 16px;
107
+ text-align: center;
108
+ border-radius: 4px;
109
+ color: var(--md-sys-color-on-primary-container);
110
+ background: var(--md-sys-color-primary-container);
111
+ }
112
+ button[budget][grade='C'] b {
113
+ color: var(--md-sys-color-on-tertiary-container);
114
+ background: var(--md-sys-color-tertiary-container);
115
+ }
116
+ button[budget][grade='D'] {
117
+ border-color: var(--md-sys-color-error);
118
+ }
119
+ button[budget][grade='D'] b {
120
+ color: var(--md-sys-color-on-error);
121
+ background: var(--md-sys-color-error);
122
+ }
123
+ button[budget] em {
124
+ display: block;
125
+ font-style: normal;
126
+ color: var(--md-sys-color-error);
127
+ }
128
+ span[room][full] {
129
+ color: var(--md-sys-color-error);
130
+ font-weight: 600;
131
+ }
132
+ p[full] {
133
+ margin: 4px 0 0;
134
+ font-size: 0.68rem;
135
+ color: var(--md-sys-color-error);
136
+ }
137
+ div[level] {
138
+ display: grid;
139
+ grid-template-columns: auto minmax(0, 1fr);
140
+ align-items: center;
141
+ gap: 6px;
142
+ margin: 0 0 6px;
143
+ font-size: 0.68rem;
144
+ color: var(--md-sys-color-on-surface-variant);
145
+ }
146
+ div[level] select {
147
+ min-width: 0;
148
+ padding: 2px 4px;
149
+ font: inherit;
150
+ font-size: 0.7rem;
151
+ color: var(--md-sys-color-on-surface);
152
+ background: var(--md-sys-color-surface-container-lowest);
153
+ border: 1px solid var(--md-sys-color-outline-variant);
154
+ border-radius: 6px;
155
+ }
156
+ small[copies] {
157
+ color: var(--md-sys-color-on-surface-variant);
158
+ }
159
+ span[room] {
160
+ font-size: 0.7rem;
161
+ font-weight: 400;
162
+ letter-spacing: 0;
163
+ text-transform: none;
164
+ }
165
+ /* Three to a row, small (user, 2026-09-24): the palette is reached for, not read -- the list below is what grows. */
166
+ div[palette] {
167
+ display: grid;
168
+ grid-template-columns: repeat(3, minmax(0, 1fr));
169
+ gap: 3px;
170
+ }
171
+ button[shape] {
172
+ display: flex;
173
+ flex-direction: column;
174
+ align-items: center;
175
+ gap: 1px;
176
+ min-width: 0;
177
+ padding: 5px 1px 4px;
178
+ font: var(--label-font, inherit);
179
+ font-size: 0.6rem;
180
+ line-height: 1.2;
181
+ text-align: center;
182
+ overflow-wrap: anywhere;
183
+ color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));
184
+ background: none;
185
+ border: 1px solid var(--md-sys-color-outline-variant);
186
+ border-radius: 6px;
187
+ cursor: pointer;
188
+ }
189
+ button[recipe-catalog] {
190
+ display: inline-flex;
191
+ align-items: center;
192
+ gap: 4px;
193
+ padding: 4px 10px;
194
+ font: inherit;
195
+ font-size: 0.75rem;
196
+ color: var(--md-sys-color-on-surface);
197
+ background: none;
198
+ border: 1px solid var(--md-sys-color-outline-variant);
199
+ border-radius: 999em;
200
+ cursor: pointer;
201
+ }
202
+ button[shape]:hover:not([disabled]) {
203
+ color: var(--md-sys-color-on-primary-container);
204
+ background-color: var(--md-sys-color-primary-container);
205
+ border-color: transparent;
206
+ }
207
+ button[shape][disabled] {
208
+ opacity: 0.35;
209
+ cursor: default;
210
+ }
211
+ button[shape] md-icon {
212
+ --md-icon-size: 18px;
213
+ }
214
+ ol {
215
+ margin: 0;
216
+ padding: 0;
217
+ list-style: none;
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: 2px;
221
+ }
222
+ li {
223
+ display: flex;
224
+ align-items: center;
225
+ gap: 6px;
226
+ padding: 4px 6px;
227
+ border-radius: 6px;
228
+ cursor: pointer;
229
+ }
230
+ li:hover {
231
+ background-color: var(--md-sys-color-surface-container);
232
+ }
233
+ li[selected] {
234
+ color: var(--md-sys-color-on-primary-container);
235
+ background-color: var(--md-sys-color-primary-container);
236
+ }
237
+ li md-icon {
238
+ --md-icon-size: 16px;
239
+ flex: none;
240
+ color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));
241
+ }
242
+ button[eye][all] {
243
+ margin-left: auto;
244
+ opacity: 0.75;
245
+ }
246
+ button[eye][all]:hover {
247
+ opacity: 1;
248
+ }
249
+ button[eye] {
250
+ display: flex;
251
+ flex: none;
252
+ padding: 1px;
253
+ color: inherit;
254
+ background: none;
255
+ border: none;
256
+ border-radius: 4px;
257
+ cursor: pointer;
258
+ opacity: 0;
259
+ }
260
+ li:hover button[eye],
261
+ li[selected] button[eye],
262
+ button[eye][off] {
263
+ opacity: 1;
264
+ }
265
+ button[eye][off] {
266
+ color: var(--md-sys-color-tertiary);
267
+ }
268
+ button[eye] md-icon {
269
+ --md-icon-size: 15px;
270
+ color: inherit;
271
+ }
272
+ li[off] span[label],
273
+ li[off] > md-icon,
274
+ li[invisible] span[label],
275
+ li[invisible] > md-icon {
276
+ opacity: 0.45;
277
+ }
278
+ li[selected] md-icon {
279
+ color: inherit;
280
+ }
281
+ span[label] {
282
+ flex: 1;
283
+ min-width: 0;
284
+ overflow: hidden;
285
+ text-overflow: ellipsis;
286
+ white-space: nowrap;
287
+ font-size: 0.78rem;
288
+ }
289
+ span[label] small {
290
+ margin-left: 4px;
291
+ font-size: 0.66rem;
292
+ color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));
293
+ }
294
+ div[ops] {
295
+ display: none;
296
+ gap: 1px;
297
+ }
298
+ li[selected] div[ops] {
299
+ display: flex;
300
+ }
301
+ div[ops] button {
302
+ display: flex;
303
+ padding: 2px;
304
+ color: inherit;
305
+ background: none;
306
+ border: none;
307
+ border-radius: 4px;
308
+ cursor: pointer;
309
+ }
310
+ div[ops] button:hover:not([disabled]) {
311
+ background-color: var(--md-sys-color-surface-container-lowest);
312
+ }
313
+ div[ops] button[disabled] {
314
+ opacity: 0.3;
315
+ cursor: default;
316
+ }
317
+ div[ops] md-icon {
318
+ --md-icon-size: 15px;
319
+ color: inherit;
320
+ }
321
+ /*
322
+ Under 200 px the selected row's four buttons pushed its name out and the last one past the edge (seen at 140,
323
+ 2026-09-24). They go to a line of their own under the name.
324
+ */
325
+ @container (max-width: 199px) {
326
+ li[selected] {
327
+ flex-wrap: wrap;
328
+ }
329
+ li[selected] div[ops] {
330
+ flex-basis: 100%;
331
+ justify-content: flex-end;
332
+ }
333
+ }
334
+ p[quiet] {
335
+ margin: 0;
336
+ font-size: 0.76rem;
337
+ line-height: 1.6;
338
+ color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));
339
+ }
340
+ `
341
+ ]; }
342
+ render() {
343
+ const b = this.partBudget;
344
+ const full = !!b && b.limit !== null && b.used >= b.limit;
345
+ return html `
346
+ <section>
347
+ <h3>${i18next.t('figure.label.shapes')}</h3>
348
+ <div palette>
349
+ ${RECIPES.map(recipe => html `
350
+ <button
351
+ shape
352
+ ?disabled=${this.locked || full}
353
+ title=${full ? i18next.t('figure.text.part-limit-reached') : i18next.t(recipe.label)}
354
+ @click=${() => this.ask('add-part', { kind: recipe.kind })}
355
+ >
356
+ <md-icon>${recipe.icon}</md-icon>
357
+ <span>${i18next.t(recipe.label)}</span>
358
+ </button>
359
+ `)}
360
+ </div>
361
+ ${full ? html `<p full>${i18next.t('figure.text.part-limit-reached-short', { level: b.level, limit: b.limit })}</p>` : nothing}
362
+ </section>
363
+ ${this.renderRecipes(full)}
364
+
365
+ <section list>
366
+ <h3>
367
+ <span>${i18next.t('figure.label.parts')}</span>
368
+ <span room ?full=${full} title=${i18next.t('figure.text.limit-comes-from-level')}
369
+ >${b && b.limit !== null ? i18next.t('figure.text.n-of-limit', { used: b.used, limit: b.limit }) : (b?.used ?? this.parts.length)}</span
370
+ >
371
+ ${this.renderShowAll()}
372
+ </h3>
373
+ ${this.renderLevel()}
374
+ ${this.renderBudget()}
375
+ ${this.parts.length === 0
376
+ ? html `<p quiet>${i18next.t('figure.text.no-parts-yet')}</p>`
377
+ : html `<ol>
378
+ ${this.parts.map((part, index) => this.renderRow(part, index))}
379
+ </ol>`}
380
+ </section>
381
+ `;
382
+ }
383
+ /** 디테일 등급 — 고르면 한도가 바뀐다. 목록 머리 아래. */
384
+ renderLevel() {
385
+ const b = this.partBudget;
386
+ if (!b)
387
+ return nothing;
388
+ return html `<div level>
389
+ <label for="detail-level">${i18next.t('figure.label.detail-level')}</label>
390
+ <select
391
+ id="detail-level"
392
+ title=${i18next.t('figure.text.detail-level-explained')}
393
+ .value=${b.level ?? ''}
394
+ ?disabled=${this.locked}
395
+ @change=${(e) => {
396
+ const value = e.target.value;
397
+ this.dispatchEvent(new CustomEvent('set-detail-level', { detail: { level: value || null }, bubbles: true, composed: true }));
398
+ }}
399
+ >
400
+ <option value="" ?selected=${!b.level}>${i18next.t('figure.label.detail-none')}</option>
401
+ ${['S', 'M', 'L'].map(one => html `<option value=${one} ?selected=${one === b.level}>
402
+ ${one} ${i18next.t('figure.label.detail-' + one)} · ${i18next.t('figure.text.n-parts-at-most', { limit: PART_LIMIT[one] })}
403
+ </option>`)}
404
+ </select>
405
+ </div>`;
406
+ }
407
+ renderBudget() {
408
+ const b = this.budget;
409
+ if (!b || !this.parts.length)
410
+ return nothing;
411
+ const over = b.grade === 'D';
412
+ return html `<button
413
+ budget
414
+ grade=${b.grade}
415
+ title=${i18next.t('figure.text.parts-budget-open')}
416
+ @click=${() => this.dispatchEvent(new CustomEvent('show-maturity', { bubbles: true, composed: true }))}
417
+ >
418
+ <b>${b.grade}</b>
419
+ <span>
420
+ <strong performance-cost>${i18next.t('figure.label.performance-cost')}</strong>
421
+ ${i18next.t('figure.text.parts-budget', {
422
+ triangles: b.triangles.toLocaleString(),
423
+ groups: b.groups.toLocaleString(),
424
+ instances: b.instances.toLocaleString()
425
+ })}
426
+ ${over
427
+ ? html `<em
428
+ >${i18next.t('figure.text.parts-budget-over', {
429
+ budget: i18next.t('figure.label.budget-' + b.tightest.key),
430
+ used: b.tightest.used.toLocaleString(),
431
+ limit: b.tightest.limit.toLocaleString()
432
+ })}</em
433
+ >`
434
+ : nothing}
435
+ </span>
436
+ </button>`;
437
+ }
438
+ /** 한꺼번에 감추고 한꺼번에 되돌린다 — 하나라도 감춰져 있으면 다 되돌리고, 다 보이면 다 감춘다. */
439
+ renderShowAll() {
440
+ if (this.parts.length === 0)
441
+ return nothing;
442
+ const anyHidden = this.parts.some(part => part.hidden);
443
+ return html `
444
+ <button
445
+ eye
446
+ all
447
+ ?off=${!anyHidden}
448
+ title=${i18next.t(anyHidden ? 'figure.text.show-all-parts' : 'figure.text.hide-all-parts')}
449
+ @click=${(e) => {
450
+ e.stopPropagation();
451
+ this.ask('set-all-parts-hidden', { hidden: !anyHidden });
452
+ }}
453
+ >
454
+ <md-icon>${anyHidden ? 'visibility' : 'visibility_off'}</md-icon>
455
+ </button>
456
+ `;
457
+ }
458
+ renderRow(part, index) {
459
+ const selected = part.id === this.selected;
460
+ const off = !!part.hidden;
461
+ return html `
462
+ <li
463
+ ?selected=${selected}
464
+ ?off=${off}
465
+ ?invisible=${!!part.invisible}
466
+ @click=${() => this.ask('select-part', { id: part.id })}
467
+ >
468
+ <button
469
+ eye
470
+ ?off=${off}
471
+ title=${i18next.t(off ? 'figure.text.show-this-part' : 'figure.text.hide-this-part')}
472
+ @click=${(e) => {
473
+ e.stopPropagation();
474
+ this.ask('toggle-part-hidden', { id: part.id });
475
+ }}
476
+ >
477
+ <md-icon>${off ? 'visibility_off' : 'visibility'}</md-icon>
478
+ </button>
479
+ <md-icon>${PROVIDER_ICON[part.provider] ?? 'deployed_code'}</md-icon>
480
+ <span label title=${part.id}
481
+ >${partLabelOf(part.id)}${part.copies ? html ` <small copies>× ${part.copies}</small>` : nothing}${part.invisible ? html `<small>${i18next.t('figure.label.state-hidden')}</small>` : nothing}</span
482
+ >
483
+ ${selected ? this.renderOps(part.id, index) : nothing}
484
+ </li>
485
+ `;
486
+ }
487
+ /** 고른 줄의 조작. 못 하는 것은 빼지 않고 흐리게 둔다 — 자리가 밀리면 연달아 지우다 엉뚱한 것을 누른다. */
488
+ renderOps(id, index) {
489
+ const count = this.parts.length;
490
+ const op = (name, icon, detail, enabled = true) => html `
491
+ <button
492
+ op=${name}
493
+ ?disabled=${!enabled || this.locked}
494
+ title=${i18next.t('figure.button.' + name)}
495
+ @click=${(e) => {
496
+ e.stopPropagation();
497
+ if (enabled && !this.locked)
498
+ this.ask(name, detail);
499
+ }}
500
+ >
501
+ <md-icon>${icon}</md-icon>
502
+ </button>
503
+ `;
504
+ return html `
505
+ <div ops>
506
+ ${op('move-part-up', 'arrow_upward', { id, to: index - 1 }, index > 0)}
507
+ ${op('move-part-down', 'arrow_downward', { id, to: index + 1 }, index < count - 1)}
508
+ ${op('duplicate-part', 'content_copy', { id })} ${op('remove-part', 'delete', { id })}
509
+ </div>
510
+ `;
511
+ }
512
+ /**
513
+ * Recipes (ADR-0095): the catalog of templates -- a door, a roller row -- opened over the modeller, put onto the chosen
514
+ * part in one step.
515
+ */
516
+ renderRecipes(full) {
517
+ if (!this.recipeCount)
518
+ return nothing;
519
+ return html `<section recipes>
520
+ <h3>${i18next.t('figure.label.recipes')}</h3>
521
+ <button recipe-catalog ?disabled=${this.locked || full} @click=${() => this.ask('open-recipe-catalog', {})}>
522
+ <md-icon>widgets</md-icon>${i18next.t('figure.button.open-recipe-catalog', { count: this.recipeCount })}
523
+ </button>
524
+ </section>`;
525
+ }
526
+ /** 정본을 고치지 않는다 — 무엇을 하겠다는 것만 알린다. */
527
+ ask(what, detail) {
528
+ this.dispatchEvent(new CustomEvent(what, { detail, bubbles: true, composed: true }));
529
+ }
530
+ };
531
+ __decorate([
532
+ property({ type: Array }),
533
+ __metadata("design:type", Array)
534
+ ], FigureParts.prototype, "parts", void 0);
535
+ __decorate([
536
+ property({ type: String }),
537
+ __metadata("design:type", Object)
538
+ ], FigureParts.prototype, "selected", void 0);
539
+ __decorate([
540
+ property({ type: Boolean }),
541
+ __metadata("design:type", Object)
542
+ ], FigureParts.prototype, "locked", void 0);
543
+ __decorate([
544
+ property({ attribute: false }),
545
+ __metadata("design:type", Object)
546
+ ], FigureParts.prototype, "budget", void 0);
547
+ __decorate([
548
+ property({ attribute: false }),
549
+ __metadata("design:type", Object)
550
+ ], FigureParts.prototype, "partBudget", void 0);
551
+ __decorate([
552
+ property({ type: Number }),
553
+ __metadata("design:type", Object)
554
+ ], FigureParts.prototype, "recipeCount", void 0);
555
+ FigureParts = __decorate([
556
+ customElement('figure-parts')
557
+ ], FigureParts);
558
+ export { FigureParts };
559
+ //# sourceMappingURL=figure-parts.js.map