@things-factory/figure-ui 10.1.146 → 10.1.149

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 (209) hide show
  1. package/client/bootstrap.ts +10 -2
  2. package/client/graphql/index.ts +20 -0
  3. package/client/modeller/canvas.ts +6 -2
  4. package/client/modeller/carrier-declaration.ts +63 -0
  5. package/client/modeller/editor.ts +62 -27
  6. package/client/modeller/figure-carrier.ts +117 -0
  7. package/client/modeller/figure-cavity-drawing.ts +3 -9
  8. package/client/modeller/figure-first-save.ts +4 -7
  9. package/client/modeller/figure-history-panel.ts +2 -3
  10. package/client/modeller/figure-links.ts +46 -60
  11. package/client/modeller/figure-material-panel.ts +4 -14
  12. package/client/modeller/figure-mesh-choice.ts +68 -0
  13. package/client/modeller/figure-parts.ts +23 -1
  14. package/client/modeller/figure-preview.ts +2 -2
  15. package/client/modeller/figure-properties.ts +5 -3
  16. package/client/modeller/figure-section-editor.ts +12 -33
  17. package/client/modeller/figure-section-panel.ts +6 -7
  18. package/client/modeller/figure-slot-layout-panel.ts +208 -0
  19. package/client/modeller/figure-verdict.ts +21 -31
  20. package/client/modeller/first-save.ts +23 -0
  21. package/client/modeller/links.ts +52 -1
  22. package/client/modeller/material-edit.ts +38 -0
  23. package/client/modeller/maturity.ts +28 -0
  24. package/client/modeller/mesh-import.ts +77 -0
  25. package/client/modeller/modeller-route.ts +9 -0
  26. package/client/modeller/mounting-part.ts +15 -0
  27. package/client/modeller/newest-answer.ts +21 -0
  28. package/client/modeller/preview-model.ts +5 -0
  29. package/client/modeller/refusals.ts +168 -82
  30. package/client/modeller/section-controls.ts +25 -1
  31. package/client/modeller/section-drawing.ts +43 -1
  32. package/client/modeller/slot-layout-host.ts +140 -0
  33. package/client/pages/figure-modeller-page.ts +6 -5
  34. package/client/viewparts/detail-route.ts +7 -0
  35. package/client/viewparts/figure-detail-dock.ts +1 -3
  36. package/dist-client/bootstrap.d.ts +1 -1
  37. package/dist-client/bootstrap.js +9 -2
  38. package/dist-client/bootstrap.js.map +1 -1
  39. package/dist-client/graphql/index.d.ts +5 -0
  40. package/dist-client/graphql/index.js +19 -0
  41. package/dist-client/graphql/index.js.map +1 -1
  42. package/dist-client/modeller/canvas.d.ts +2 -0
  43. package/dist-client/modeller/canvas.js +10 -2
  44. package/dist-client/modeller/canvas.js.map +1 -1
  45. package/dist-client/modeller/carrier-declaration.d.ts +31 -0
  46. package/dist-client/modeller/carrier-declaration.js +53 -0
  47. package/dist-client/modeller/carrier-declaration.js.map +1 -0
  48. package/dist-client/modeller/editor.d.ts +13 -0
  49. package/dist-client/modeller/editor.js +62 -27
  50. package/dist-client/modeller/editor.js.map +1 -1
  51. package/dist-client/modeller/figure-carrier.d.ts +26 -0
  52. package/dist-client/modeller/figure-carrier.js +123 -0
  53. package/dist-client/modeller/figure-carrier.js.map +1 -0
  54. package/dist-client/modeller/figure-cavity-drawing.js +3 -11
  55. package/dist-client/modeller/figure-cavity-drawing.js.map +1 -1
  56. package/dist-client/modeller/figure-first-save.d.ts +4 -0
  57. package/dist-client/modeller/figure-first-save.js +5 -8
  58. package/dist-client/modeller/figure-first-save.js.map +1 -1
  59. package/dist-client/modeller/figure-history-panel.js +2 -4
  60. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  61. package/dist-client/modeller/figure-links.d.ts +4 -1
  62. package/dist-client/modeller/figure-links.js +47 -57
  63. package/dist-client/modeller/figure-links.js.map +1 -1
  64. package/dist-client/modeller/figure-material-panel.d.ts +0 -1
  65. package/dist-client/modeller/figure-material-panel.js +4 -14
  66. package/dist-client/modeller/figure-material-panel.js.map +1 -1
  67. package/dist-client/modeller/figure-mesh-choice.d.ts +16 -0
  68. package/dist-client/modeller/figure-mesh-choice.js +75 -0
  69. package/dist-client/modeller/figure-mesh-choice.js.map +1 -0
  70. package/dist-client/modeller/figure-parts.d.ts +1 -1
  71. package/dist-client/modeller/figure-parts.js +22 -0
  72. package/dist-client/modeller/figure-parts.js.map +1 -1
  73. package/dist-client/modeller/figure-preview.js +2 -2
  74. package/dist-client/modeller/figure-preview.js.map +1 -1
  75. package/dist-client/modeller/figure-properties.d.ts +2 -1
  76. package/dist-client/modeller/figure-properties.js +5 -3
  77. package/dist-client/modeller/figure-properties.js.map +1 -1
  78. package/dist-client/modeller/figure-section-editor.d.ts +2 -2
  79. package/dist-client/modeller/figure-section-editor.js +12 -33
  80. package/dist-client/modeller/figure-section-editor.js.map +1 -1
  81. package/dist-client/modeller/figure-section-panel.js +6 -7
  82. package/dist-client/modeller/figure-section-panel.js.map +1 -1
  83. package/dist-client/modeller/figure-slot-layout-panel.d.ts +36 -0
  84. package/dist-client/modeller/figure-slot-layout-panel.js +198 -0
  85. package/dist-client/modeller/figure-slot-layout-panel.js.map +1 -0
  86. package/dist-client/modeller/figure-verdict.d.ts +1 -1
  87. package/dist-client/modeller/figure-verdict.js +19 -37
  88. package/dist-client/modeller/figure-verdict.js.map +1 -1
  89. package/dist-client/modeller/first-save.d.ts +10 -0
  90. package/dist-client/modeller/first-save.js +16 -0
  91. package/dist-client/modeller/first-save.js.map +1 -1
  92. package/dist-client/modeller/links.d.ts +26 -1
  93. package/dist-client/modeller/links.js +43 -0
  94. package/dist-client/modeller/links.js.map +1 -1
  95. package/dist-client/modeller/material-edit.d.ts +11 -0
  96. package/dist-client/modeller/material-edit.js +28 -0
  97. package/dist-client/modeller/material-edit.js.map +1 -0
  98. package/dist-client/modeller/maturity.d.ts +15 -0
  99. package/dist-client/modeller/maturity.js +23 -0
  100. package/dist-client/modeller/maturity.js.map +1 -1
  101. package/dist-client/modeller/mesh-import.d.ts +47 -0
  102. package/dist-client/modeller/mesh-import.js +47 -0
  103. package/dist-client/modeller/mesh-import.js.map +1 -0
  104. package/dist-client/modeller/modeller-route.d.ts +5 -0
  105. package/dist-client/modeller/modeller-route.js +9 -0
  106. package/dist-client/modeller/modeller-route.js.map +1 -1
  107. package/dist-client/modeller/mounting-part.d.ts +14 -0
  108. package/dist-client/modeller/mounting-part.js +10 -0
  109. package/dist-client/modeller/mounting-part.js.map +1 -0
  110. package/dist-client/modeller/newest-answer.d.ts +12 -0
  111. package/dist-client/modeller/newest-answer.js +21 -0
  112. package/dist-client/modeller/newest-answer.js.map +1 -0
  113. package/dist-client/modeller/preview-model.d.ts +2 -0
  114. package/dist-client/modeller/preview-model.js +4 -0
  115. package/dist-client/modeller/preview-model.js.map +1 -1
  116. package/dist-client/modeller/refusals.d.ts +26 -5
  117. package/dist-client/modeller/refusals.js +184 -86
  118. package/dist-client/modeller/refusals.js.map +1 -1
  119. package/dist-client/modeller/section-controls.d.ts +17 -1
  120. package/dist-client/modeller/section-controls.js +18 -0
  121. package/dist-client/modeller/section-controls.js.map +1 -1
  122. package/dist-client/modeller/section-drawing.d.ts +24 -1
  123. package/dist-client/modeller/section-drawing.js +42 -0
  124. package/dist-client/modeller/section-drawing.js.map +1 -1
  125. package/dist-client/modeller/slot-layout-host.d.ts +81 -0
  126. package/dist-client/modeller/slot-layout-host.js +105 -0
  127. package/dist-client/modeller/slot-layout-host.js.map +1 -0
  128. package/dist-client/pages/figure-modeller-page.js +5 -4
  129. package/dist-client/pages/figure-modeller-page.js.map +1 -1
  130. package/dist-client/tsconfig.tsbuildinfo +1 -1
  131. package/dist-client/viewparts/detail-route.d.ts +5 -0
  132. package/dist-client/viewparts/detail-route.js +8 -0
  133. package/dist-client/viewparts/detail-route.js.map +1 -0
  134. package/dist-client/viewparts/figure-detail-dock.d.ts +0 -1
  135. package/dist-client/viewparts/figure-detail-dock.js +1 -3
  136. package/dist-client/viewparts/figure-detail-dock.js.map +1 -1
  137. package/package.json +9 -8
  138. package/test/align.test.ts +0 -9
  139. package/test/browser/assistant-stand-in.js +32 -0
  140. package/test/browser/build.mjs +6 -1
  141. package/test/browser/editing-page.js +224 -0
  142. package/test/browser/editing.check.mjs +550 -0
  143. package/test/browser/links-page.js +113 -0
  144. package/test/browser/links.check.mjs +568 -0
  145. package/test/browser/modeller.check.mjs +21 -0
  146. package/test/browser/parts-page.js +120 -0
  147. package/test/browser/parts.check.mjs +328 -0
  148. package/test/browser/places-mesh-page.js +36 -0
  149. package/test/browser/places-mesh.check.mjs +239 -0
  150. package/test/browser/product-page.check.mjs +682 -0
  151. package/test/browser/product-page.js +276 -0
  152. package/test/browser/screen-page.js +112 -0
  153. package/test/browser/screen-product-page.js +62 -0
  154. package/test/browser/screen.check.mjs +1003 -0
  155. package/test/browser/section-page.js +256 -0
  156. package/test/browser/section.check.mjs +719 -0
  157. package/test/browser/serve.mjs +20 -12
  158. package/test/carrier-declaration.test.ts +69 -0
  159. package/test/cavity-drawing.test.ts +2 -18
  160. package/test/clip-ai-proposal.test.ts +1 -5
  161. package/test/clip-consent.test.ts +0 -5
  162. package/test/clips.test.ts +0 -7
  163. package/test/command-preview.test.ts +0 -68
  164. package/test/controls.test.ts +0 -9
  165. package/test/detail-dock.test.ts +6 -25
  166. package/test/face-mapping.test.ts +1 -20
  167. package/test/fasten-drawing.test.ts +0 -23
  168. package/test/fields.test.ts +6 -33
  169. package/test/figure-assistant-surface.test.ts +32 -38
  170. package/test/first-minute.test.ts +3 -55
  171. package/test/first-save-suggest.test.ts +11 -8
  172. package/test/first-save.test.ts +4 -26
  173. package/test/gizmo.test.ts +0 -25
  174. package/test/joint-fan.test.ts +0 -10
  175. package/test/keys.test.ts +0 -7
  176. package/test/layout.test.ts +4 -73
  177. package/test/links.test.ts +48 -67
  178. package/test/live.test.ts +0 -34
  179. package/test/material.test.ts +17 -26
  180. package/test/maturity.test.ts +13 -16
  181. package/test/mesh-import.test.ts +76 -0
  182. package/test/modeller-route.test.ts +3 -19
  183. package/test/package-download.test.ts +6 -7
  184. package/test/parts-wiring.test.ts +9 -51
  185. package/test/preview.test.ts +5 -46
  186. package/test/properties.test.ts +11 -26
  187. package/test/proposal-record.test.ts +2 -19
  188. package/test/recipes.test.ts +0 -15
  189. package/test/refusals.test.ts +257 -151
  190. package/test/release-entry.test.ts +1 -9
  191. package/test/release-panel.test.ts +1 -22
  192. package/test/resize-with-placement.test.ts +0 -32
  193. package/test/revert-choice.test.ts +1 -22
  194. package/test/revert-keeping.test.ts +1 -12
  195. package/test/save-landed.test.ts +16 -14
  196. package/test/scene-canvas.test.ts +2 -13
  197. package/test/section-editor.test.ts +30 -83
  198. package/test/section-panel.test.ts +22 -17
  199. package/test/slot-layout-host.test.ts +117 -0
  200. package/test/theme.test.ts +5 -9
  201. package/test/verdict.test.ts +44 -41
  202. package/test/view.test.ts +5 -12
  203. package/translations/en.json +61 -1
  204. package/translations/es.json +61 -1
  205. package/translations/ja.json +61 -1
  206. package/translations/ko.json +61 -1
  207. package/translations/ms.json +61 -1
  208. package/translations/zh.json +61 -1
  209. package/test/thumbnail.test.ts +0 -29
@@ -5,8 +5,10 @@ import { customElement, property, state } from 'lit/decorators.js';
5
5
  import { live } from 'lit/directives/live.js';
6
6
  import { i18next, localize } from '@operato/i18n';
7
7
  import { FIGURE_FACES } from '@hatiolab/figure-model';
8
+ import './figure-carrier.js';
8
9
  import { occupancyFromParts } from './occupancy.js';
9
10
  import { tagsOf, figureFigureFacts } from './figure-facts.js';
11
+ import { offeredMountingOf } from './mounting-part.js';
10
12
  import { SidePanelStyles } from './side-panel-styles.js';
11
13
  import { ScrollbarStyles } from '@operato/styles';
12
14
  const PLACEMENTS = ['floor', 'ceiling', 'center', 'wall'];
@@ -18,7 +20,7 @@ const FACES = Object.keys(FIGURE_FACES);
18
20
  * catalogue files it.
19
21
  *
20
22
  * Two kinds of change leave this tab, and it does neither itself:
21
- * - `command` carries an authoring command (rename, declare the room, the mounting face). The page runs it
23
+ * - `command` carries an authoring command (rename, declare the room, the mounting face, the carrier). The page runs it
22
24
  * through the session, so it is one step of the same undo history as every other edit, and is saved with it.
23
25
  * - `catalog` carries a change to the row (category, tags). Those are not in the asset; the page writes them
24
26
  * to the saved row at once, so they need a saved figure.
@@ -100,6 +102,7 @@ let FigureProperties = class FigureProperties extends localize(i18next)(LitEleme
100
102
  <h3>${i18next.t('figure.label.group-standing')}</h3>
101
103
  ${this.renderSpace(facts)} ${this.renderMounting(facts)}
102
104
  </section>
105
+ <figure-carrier .carrier=${this.revision?.asset.carrier}></figure-carrier>
103
106
  <section>
104
107
  <h3>${i18next.t('figure.label.group-catalog')}</h3>
105
108
  ${this.renderCatalog()}
@@ -167,8 +170,7 @@ let FigureProperties = class FigureProperties extends localize(i18next)(LitEleme
167
170
  renderMounting(facts) {
168
171
  const mounting = facts.mounting;
169
172
  /* Chosen, or what is set, or where the figure meets its plane -- not the first part listed (walk 1). */
170
- const part = [this.pickedPart, mounting?.part, facts.suggested?.part, facts.parts[0]].find(one => one && facts.parts.includes(one));
171
- const face = this.pickedFace ?? mounting?.face ?? facts.suggested?.face ?? 'bottom';
173
+ const { part, face } = offeredMountingOf(facts, { part: this.pickedPart, face: this.pickedFace });
172
174
  return html `
173
175
  <div field>
174
176
  <label>${i18next.t('figure.label.mounting-face')}</label>
@@ -1 +1 @@
1
- {"version":3,"file":"figure-properties.js","sourceRoot":"","sources":["../../client/modeller/figure-properties.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAA0C,MAAM,mBAAmB,CAAA;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CA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E,CAAC;;oDAAsB;AAE/B;IAAhB,KAAK,EAAE;;oDAA4B;AACnB;IAAhB,KAAK,EAAE;;oDAAgC;AAlC7B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAuO5B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { FIGURE_FACES } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureFace } from '@hatiolab/figure-model'\n\nimport { occupancyFromParts } from './occupancy.js'\nimport { tagsOf, figureFigureFacts, type Placement, type FigureFigureFacts } from './figure-facts.js'\nimport type { FigureRevision } from './revision.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { ScrollbarStyles } from '@operato/styles'\n\nconst PLACEMENTS: Placement[] = ['floor', 'ceiling', 'center', 'wall']\nconst FACES = Object.keys(FIGURE_FACES) as FigureFace[]\n\n/**\n * 속성 — the modeller's figure properties.\n *\n * The tab opens with what the figure is: its name, the face it is placed by, the room it takes up, where the\n * catalogue files it.\n *\n * Two kinds of change leave this tab, and it does neither itself:\n * - `command` carries an authoring command (rename, declare the room, the mounting face). The page runs it\n * through the session, so it is one step of the same undo history as every other edit, and is saved with it.\n * - `catalog` carries a change to the row (category, tags). Those are not in the asset; the page writes them\n * to the saved row at once, so they need a saved figure.\n *\n * Not here yet, because has no place for them: editing the declared room by hand (declares it from the\n * parts, as graph expressions), and the detail level. Both wait on a ruling.\n */\n@customElement('figure-properties')\nexport class FigureProperties extends localize(i18next)(LitElement) {\n static styles = [ScrollbarStyles, SidePanelStyles, css`\n :host {\n display: block;\n /* It stands inside the properties tab's panel, which gives the margin; a second one indented it past the type. */\n padding: 0;\n overflow: auto;\n }\n div[row] {\n display: flex;\n gap: 6px;\n align-items: center;\n }\n div[row] > select {\n flex: 1;\n }\n div[row] > button[act] {\n flex: 1;\n width: auto;\n margin-top: 0;\n }\n div[row] > span {\n flex: 1;\n }\n `]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The saved row, if any. Category and tags live on it. */\n @property({ type: String }) figureId?: string\n @property({ type: String }) figureCategory?: string\n @property({ type: Array }) figureTags?: string[]\n /** The part and face picked for the mounting face, before 「이 면으로」 is pressed. */\n @state() private pickedPart?: string\n @state() private pickedFace?: FigureFace\n\n private facts(): FigureFigureFacts | undefined {\n try {\n return this.revision ? figureFigureFacts(this.revision) : undefined\n } catch {\n /* A source the format refuses has no facts to show; the verdict tab says why. */\n return undefined\n }\n }\n\n /*\n The figure's own settings are shown while no part is picked; with one picked this is out of sight, and working out its\n facts (the figure parsed and compiled) on every edit is for nobody. Out of sight it keeps what it last drew, and it\n draws again when it comes back into view.\n */\n private lastDrawn?: unknown\n private outOfSight = false\n private watch?: ResizeObserver\n connectedCallback() {\n super.connectedCallback()\n this.watch = new ResizeObserver(() => {\n if (this.outOfSight && this.checkVisibility?.() !== false) {\n this.outOfSight = false\n this.requestUpdate()\n }\n })\n this.watch.observe(this)\n }\n disconnectedCallback() {\n this.watch?.disconnect()\n super.disconnectedCallback()\n }\n\n render() {\n if (this.hasUpdated && this.checkVisibility?.() === false) {\n this.outOfSight = true\n return this.lastDrawn ?? nothing\n }\n this.lastDrawn = this.draw()\n return this.lastDrawn\n }\n\n private draw() {\n const facts = this.facts()\n if (!facts) return nothing\n /* The figure's type is the page's (it lives on the row); it is slotted into the first section. */\n return html`<section>\n <h3>${i18next.t('figure.label.group-figure')}</h3>\n <slot name=\"type\"></slot>\n ${this.renderName(facts)} ${this.renderPlacement(facts)}\n </section>\n <section>\n <h3>${i18next.t('figure.label.group-standing')}</h3>\n ${this.renderSpace(facts)} ${this.renderMounting(facts)}\n </section>\n <section>\n <h3>${i18next.t('figure.label.group-catalog')}</h3>\n ${this.renderCatalog()}\n </section>`\n }\n\n private renderName(facts: FigureFigureFacts) {\n return html`\n <div field>\n <label>${i18next.t('figure.label.name')}</label>\n <input\n .value=${facts.name}\n placeholder=${i18next.t('figure.text.figure-display-name')}\n @change=${(event: Event) => {\n const input = event.target as HTMLInputElement\n if (!input.value.trim()) {\n /* The format refuses a blank name; put the old one back rather than send a command that fails. */\n input.value = facts.name\n return\n }\n if (input.value.trim() !== facts.name) this.command({ kind: 'rename', name: input.value })\n }}\n />\n </div>\n `\n }\n\n /**\n * The face the figure is placed by. In it is part of the room declaration, so choosing one declares the room\n * again from the parts — the only way declares it — with the new face. The hint says so.\n */\n private renderPlacement(facts: FigureFigureFacts) {\n const current = facts.placement ?? 'floor'\n return html`\n <div field>\n <label>${i18next.t('figure.label.figure-placement')}</label>\n <select\n .value=${live(current)}\n @change=${(event: Event) => {\n const select = event.target as HTMLSelectElement\n /* The figure's own setting (ADR-0097): chosen with no part too, and the room is left as it is declared. */\n this.command({ kind: 'set-placement', placement: select.value as Placement })\n /* Refused, the figure is placed as it was, and the list says so; taken, the figure drawn again says the new one. */\n select.value = current\n }}\n >\n ${PLACEMENTS.map(\n one => html`<option value=${one} ?selected=${one === current}>${i18next.t('figure.label.placement-' + one)}</option>`\n )}\n </select>\n <small>${i18next.t('figure.text.placement-is-intent')}</small>\n </div>\n `\n }\n\n private renderSpace(facts: FigureFigureFacts) {\n return html`\n <div field>\n <label>${i18next.t('figure.label.declared-space')}</label>\n <div row>\n <span>${i18next.t(facts.declared ? 'figure.text.declared-space-declared' : 'figure.text.declared-space-none')}</span>\n <button act ?disabled=${!facts.parts.length} @click=${() => this.declare(facts.placement ?? 'floor')}>\n <md-icon>fit_screen</md-icon>${i18next.t('figure.button.fit-base-to-parts')}\n </button>\n </div>\n </div>\n `\n }\n\n private renderMounting(facts: FigureFigureFacts) {\n const mounting = facts.mounting\n /* Chosen, or what is set, or where the figure meets its plane -- not the first part listed (walk 1). */\n const part = [this.pickedPart, mounting?.part, facts.suggested?.part, facts.parts[0]].find(one => one && facts.parts.includes(one))\n const face: FigureFace = this.pickedFace ?? mounting?.face ?? facts.suggested?.face ?? 'bottom'\n return html`\n <div field>\n <label>${i18next.t('figure.label.mounting-face')}</label>\n <div row>\n <select ?disabled=${!facts.declared} @change=${(e: Event) => (this.pickedPart = (e.target as HTMLSelectElement).value)}>\n ${facts.parts.map(one => html`<option value=${one} ?selected=${one === part}>${one}</option>`)}\n </select>\n <select ?disabled=${!facts.declared} @change=${(e: Event) => (this.pickedFace = (e.target as HTMLSelectElement).value as FigureFace)}>\n ${FACES.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div row>\n <button act ?disabled=${!facts.declared || !part} @click=${() => this.command({ kind: 'set-mounting-face', part: part!, face })}>\n <md-icon>check</md-icon>${i18next.t('figure.button.set-mounting-face')}\n </button>\n <button act ?disabled=${!mounting} @click=${() => this.command({ kind: 'clear-mounting-face' })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.clear-mounting-face')}\n </button>\n </div>\n <small>\n ${facts.declared\n ? mounting\n ? `${mounting.part} · ${i18next.t('figure.label.face-' + mounting.face)}`\n : i18next.t('figure.label.mounting-face-none')\n : i18next.t('figure.text.mounting-face-needs-space')}\n </small>\n </div>\n `\n }\n\n private renderCatalog() {\n const saved = !!this.figureId\n return html`\n <div field>\n <label>${i18next.t('figure.label.category')}</label>\n <input\n .value=${this.figureCategory ?? ''}\n ?disabled=${!saved}\n placeholder=${i18next.t('figure.text.category-placeholder')}\n @change=${(e: Event) => this.catalog({ category: (e.target as HTMLInputElement).value.trim() })}\n />\n </div>\n <div field>\n <label>${i18next.t('figure.label.tags')}</label>\n <input\n .value=${(this.figureTags ?? []).join(', ')}\n ?disabled=${!saved}\n placeholder=${i18next.t('figure.text.tags-placeholder')}\n @change=${(e: Event) => this.catalog({ tags: tagsOf((e.target as HTMLInputElement).value) })}\n />\n ${saved ? nothing : html`<small>${i18next.t('figure.text.catalog-needs-a-save')}</small>`}\n </div>\n `\n }\n\n private declare(placement: Placement) {\n if (!this.revision) return\n this.command(occupancyFromParts(this.revision.asset, placement))\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\n }\n\n private catalog(patch: { category?: string; tags?: string[] }) {\n this.dispatchEvent(new CustomEvent('catalog', { detail: patch, bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"figure-properties.js","sourceRoot":"","sources":["../../client/modeller/figure-properties.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,qBAAqB,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAA0C,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,UAAU,GAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;AACtE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAiB,CAAA;AAEvD;;;;;;;;;;;;;;GAcG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,C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O,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAA;IAClE,CAAC;IAEO,OAAO,CAAC,MAA6B;QAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACvG,CAAC;IAEO,OAAO,CAAC,KAA6C;QAC3D,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClG,CAAC;;AA3M+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAA0B;AAE7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDAAwB;AACxB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;oDAAsB;AAE/B;IAAhB,KAAK,EAAE;;oDAA4B;AACnB;IAAhB,KAAK,EAAE;;oDAAgC;AAlC7B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAuO5B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { FIGURE_FACES } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureFace } from '@hatiolab/figure-model'\n\nimport './figure-carrier.js'\nimport { occupancyFromParts } from './occupancy.js'\nimport { tagsOf, figureFigureFacts, type Placement, type FigureFigureFacts } from './figure-facts.js'\nimport { offeredMountingOf } from './mounting-part.js'\nimport type { FigureRevision } from './revision.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { ScrollbarStyles } from '@operato/styles'\n\nconst PLACEMENTS: Placement[] = ['floor', 'ceiling', 'center', 'wall']\nconst FACES = Object.keys(FIGURE_FACES) as FigureFace[]\n\n/**\n * 속성 — the modeller's figure properties.\n *\n * The tab opens with what the figure is: its name, the face it is placed by, the room it takes up, where the\n * catalogue files it.\n *\n * Two kinds of change leave this tab, and it does neither itself:\n * - `command` carries an authoring command (rename, declare the room, the mounting face, the carrier). The page runs it\n * through the session, so it is one step of the same undo history as every other edit, and is saved with it.\n * - `catalog` carries a change to the row (category, tags). Those are not in the asset; the page writes them\n * to the saved row at once, so they need a saved figure.\n *\n * Not here yet, because has no place for them: editing the declared room by hand (declares it from the\n * parts, as graph expressions), and the detail level. Both wait on a ruling.\n */\n@customElement('figure-properties')\nexport class FigureProperties extends localize(i18next)(LitElement) {\n static styles = [ScrollbarStyles, SidePanelStyles, css`\n :host {\n display: block;\n /* It stands inside the properties tab's panel, which gives the margin; a second one indented it past the type. */\n padding: 0;\n overflow: auto;\n }\n div[row] {\n display: flex;\n gap: 6px;\n align-items: center;\n }\n div[row] > select {\n flex: 1;\n }\n div[row] > button[act] {\n flex: 1;\n width: auto;\n margin-top: 0;\n }\n div[row] > span {\n flex: 1;\n }\n `]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The saved row, if any. Category and tags live on it. */\n @property({ type: String }) figureId?: string\n @property({ type: String }) figureCategory?: string\n @property({ type: Array }) figureTags?: string[]\n /** The part and face picked for the mounting face, before 「이 면으로」 is pressed. */\n @state() private pickedPart?: string\n @state() private pickedFace?: FigureFace\n\n private facts(): FigureFigureFacts | undefined {\n try {\n return this.revision ? figureFigureFacts(this.revision) : undefined\n } catch {\n /* A source the format refuses has no facts to show; the verdict tab says why. */\n return undefined\n }\n }\n\n /*\n The figure's own settings are shown while no part is picked; with one picked this is out of sight, and working out its\n facts (the figure parsed and compiled) on every edit is for nobody. Out of sight it keeps what it last drew, and it\n draws again when it comes back into view.\n */\n private lastDrawn?: unknown\n private outOfSight = false\n private watch?: ResizeObserver\n connectedCallback() {\n super.connectedCallback()\n this.watch = new ResizeObserver(() => {\n if (this.outOfSight && this.checkVisibility?.() !== false) {\n this.outOfSight = false\n this.requestUpdate()\n }\n })\n this.watch.observe(this)\n }\n disconnectedCallback() {\n this.watch?.disconnect()\n super.disconnectedCallback()\n }\n\n render() {\n if (this.hasUpdated && this.checkVisibility?.() === false) {\n this.outOfSight = true\n return this.lastDrawn ?? nothing\n }\n this.lastDrawn = this.draw()\n return this.lastDrawn\n }\n\n private draw() {\n const facts = this.facts()\n if (!facts) return nothing\n /* The figure's type is the page's (it lives on the row); it is slotted into the first section. */\n return html`<section>\n <h3>${i18next.t('figure.label.group-figure')}</h3>\n <slot name=\"type\"></slot>\n ${this.renderName(facts)} ${this.renderPlacement(facts)}\n </section>\n <section>\n <h3>${i18next.t('figure.label.group-standing')}</h3>\n ${this.renderSpace(facts)} ${this.renderMounting(facts)}\n </section>\n <figure-carrier .carrier=${this.revision?.asset.carrier}></figure-carrier>\n <section>\n <h3>${i18next.t('figure.label.group-catalog')}</h3>\n ${this.renderCatalog()}\n </section>`\n }\n\n private renderName(facts: FigureFigureFacts) {\n return html`\n <div field>\n <label>${i18next.t('figure.label.name')}</label>\n <input\n .value=${facts.name}\n placeholder=${i18next.t('figure.text.figure-display-name')}\n @change=${(event: Event) => {\n const input = event.target as HTMLInputElement\n if (!input.value.trim()) {\n /* The format refuses a blank name; put the old one back rather than send a command that fails. */\n input.value = facts.name\n return\n }\n if (input.value.trim() !== facts.name) this.command({ kind: 'rename', name: input.value })\n }}\n />\n </div>\n `\n }\n\n /**\n * The face the figure is placed by. In it is part of the room declaration, so choosing one declares the room\n * again from the parts — the only way declares it — with the new face. The hint says so.\n */\n private renderPlacement(facts: FigureFigureFacts) {\n const current = facts.placement ?? 'floor'\n return html`\n <div field>\n <label>${i18next.t('figure.label.figure-placement')}</label>\n <select\n .value=${live(current)}\n @change=${(event: Event) => {\n const select = event.target as HTMLSelectElement\n /* The figure's own setting (ADR-0097): chosen with no part too, and the room is left as it is declared. */\n this.command({ kind: 'set-placement', placement: select.value as Placement })\n /* Refused, the figure is placed as it was, and the list says so; taken, the figure drawn again says the new one. */\n select.value = current\n }}\n >\n ${PLACEMENTS.map(\n one => html`<option value=${one} ?selected=${one === current}>${i18next.t('figure.label.placement-' + one)}</option>`\n )}\n </select>\n <small>${i18next.t('figure.text.placement-is-intent')}</small>\n </div>\n `\n }\n\n private renderSpace(facts: FigureFigureFacts) {\n return html`\n <div field>\n <label>${i18next.t('figure.label.declared-space')}</label>\n <div row>\n <span>${i18next.t(facts.declared ? 'figure.text.declared-space-declared' : 'figure.text.declared-space-none')}</span>\n <button act ?disabled=${!facts.parts.length} @click=${() => this.declare(facts.placement ?? 'floor')}>\n <md-icon>fit_screen</md-icon>${i18next.t('figure.button.fit-base-to-parts')}\n </button>\n </div>\n </div>\n `\n }\n\n private renderMounting(facts: FigureFigureFacts) {\n const mounting = facts.mounting\n /* Chosen, or what is set, or where the figure meets its plane -- not the first part listed (walk 1). */\n const { part, face } = offeredMountingOf(facts, { part: this.pickedPart, face: this.pickedFace })\n return html`\n <div field>\n <label>${i18next.t('figure.label.mounting-face')}</label>\n <div row>\n <select ?disabled=${!facts.declared} @change=${(e: Event) => (this.pickedPart = (e.target as HTMLSelectElement).value)}>\n ${facts.parts.map(one => html`<option value=${one} ?selected=${one === part}>${one}</option>`)}\n </select>\n <select ?disabled=${!facts.declared} @change=${(e: Event) => (this.pickedFace = (e.target as HTMLSelectElement).value as FigureFace)}>\n ${FACES.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div row>\n <button act ?disabled=${!facts.declared || !part} @click=${() => this.command({ kind: 'set-mounting-face', part: part!, face })}>\n <md-icon>check</md-icon>${i18next.t('figure.button.set-mounting-face')}\n </button>\n <button act ?disabled=${!mounting} @click=${() => this.command({ kind: 'clear-mounting-face' })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.clear-mounting-face')}\n </button>\n </div>\n <small>\n ${facts.declared\n ? mounting\n ? `${mounting.part} · ${i18next.t('figure.label.face-' + mounting.face)}`\n : i18next.t('figure.label.mounting-face-none')\n : i18next.t('figure.text.mounting-face-needs-space')}\n </small>\n </div>\n `\n }\n\n private renderCatalog() {\n const saved = !!this.figureId\n return html`\n <div field>\n <label>${i18next.t('figure.label.category')}</label>\n <input\n .value=${this.figureCategory ?? ''}\n ?disabled=${!saved}\n placeholder=${i18next.t('figure.text.category-placeholder')}\n @change=${(e: Event) => this.catalog({ category: (e.target as HTMLInputElement).value.trim() })}\n />\n </div>\n <div field>\n <label>${i18next.t('figure.label.tags')}</label>\n <input\n .value=${(this.figureTags ?? []).join(', ')}\n ?disabled=${!saved}\n placeholder=${i18next.t('figure.text.tags-placeholder')}\n @change=${(e: Event) => this.catalog({ tags: tagsOf((e.target as HTMLInputElement).value) })}\n />\n ${saved ? nothing : html`<small>${i18next.t('figure.text.catalog-needs-a-save')}</small>`}\n </div>\n `\n }\n\n private declare(placement: Placement) {\n if (!this.revision) return\n this.command(occupancyFromParts(this.revision.asset, placement))\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\n }\n\n private catalog(patch: { category?: string; tags?: string[] }) {\n this.dispatchEvent(new CustomEvent('catalog', { detail: patch, bubbles: true, composed: true }))\n }\n}\n"]}
@@ -102,8 +102,8 @@ export declare class FigureSectionEditor extends FigureSectionEditor_base {
102
102
  private cancel;
103
103
  private close;
104
104
  private svgPoint;
105
- /** Words for the face a length change keeps, by the part's relations; nothing when they cannot say. */
106
- private keptWords;
105
+ /** What a measure's field says under it: following another value, or for the length the face it keeps. */
106
+ private noteWords;
107
107
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
108
108
  /** A section drawn as the screen lays it: across to the right, then down. */
109
109
  private outline;
@@ -5,16 +5,14 @@ import { live } from 'lit/directives/live.js';
5
5
  import { i18next, localize } from '@operato/i18n';
6
6
  import { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-model';
7
7
  import { SidePanelStyles } from './side-panel-styles.js';
8
- import { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf, workingShapeOf } from './section-drawing.js';
9
- import { cavityDepthOf, cavityRequestOf, cavityResultOf, END_FACE, sameOf, sidesOf } from './section-controls.js';
8
+ import { apexOver, cavityKeyOf, drawnOf, insertAfter, markedBy, measureNoteOf, movePoint, pointLabel, removePoint, sectionActionOf, sectionOf, workingIssuesOf, workingOf, workingShapeOf } from './section-drawing.js';
9
+ import { cavityDepthOf, cavityRequestOf, cavityResultOf, hollowableOf, sameOf, sidesOf } from './section-controls.js';
10
10
  import './figure-cavity-drawing.js';
11
11
  import './figure-face-mapping.js';
12
12
  import { openPopup } from '@operato/layout';
13
13
  import './figure-section-close-choice.js';
14
14
  /** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */
15
15
  const SCREEN = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] };
16
- /** The inside said so two can be compared: its walls by side, its ends. */
17
- const cavityKey = (w) => w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null;
18
16
  /** The editor's width and room for the solid beside it: below this the two take turns. */
19
17
  export const NARROW_BELOW = 900;
20
18
  /**
@@ -319,7 +317,7 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
319
317
  }
320
318
  /** A pushed rectangle or ellipse can have an inside; a drawn section's is a later stage. */
321
319
  get hollowable() {
322
- return !!this.body?.shape.extrusion && (this.kind === 'rectangle' || this.kind === 'ellipse');
320
+ return !!this.body && hollowableOf(this.body.shape);
323
321
  }
324
322
  connectedCallback() {
325
323
  super.connectedCallback();
@@ -373,20 +371,7 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
373
371
  }
374
372
  /** One command for everything changed since the editor opened; a measure not changed is not sent (it may follow another). */
375
373
  action(w) {
376
- const o = this.opened;
377
- const changed = (a, b) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9;
378
- const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, o.across[k])));
379
- const apexMoved = !w.apex !== !o.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, o.apex[k])));
380
- const cavityMoved = JSON.stringify(cavityKey(w)) !== JSON.stringify(cavityKey(o));
381
- return {
382
- kind: 'set-section',
383
- part: this.body.id,
384
- ...(this.kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),
385
- ...(Object.keys(across).length ? { across } : {}),
386
- ...(changed(w.length, o.length) ? { length: w.length } : {}),
387
- ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),
388
- ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})
389
- };
374
+ return sectionActionOf(this.body.id, this.kind, this.opened, w);
390
375
  }
391
376
  removePoint(id) {
392
377
  const next = removePoint(this.working.points, id);
@@ -419,7 +404,7 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
419
404
  Object.entries(w.across).sort(),
420
405
  w.length,
421
406
  w.apex ? Object.entries(w.apex).sort() : null,
422
- cavityKey(w)
407
+ cavityKeyOf(w)
423
408
  ]);
424
409
  return !!this.opened && key(this.working) !== key(this.opened);
425
410
  }
@@ -475,15 +460,10 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
475
460
  const p = pt.matrixTransform(el.getScreenCTM().inverse());
476
461
  return { h: Math.round(p.x), v: Math.round(p.y) };
477
462
  }
478
- /** Words for the face a length change keeps, by the part's relations; nothing when they cannot say. */
479
- keptWords() {
480
- if (this.kept === undefined)
481
- return '';
482
- if (this.kept === 0)
483
- return i18next.t('figure.text.section-editor-keeps-centre');
484
- return i18next.t('figure.text.section-editor-keeps', {
485
- face: i18next.t('figure.label.face-' + END_FACE(this.axis, this.kept === 1 ? 'start' : 'end'))
486
- });
463
+ /** What a measure's field says under it: following another value, or for the length the face it keeps. */
464
+ noteWords(axis, kept) {
465
+ const note = measureNoteOf(this.measures?.measures[axis], kept, axis);
466
+ return note ? i18next.t(note.key, note.face ? { face: i18next.t('figure.label.face-' + note.face) } : {}) : '';
487
467
  }
488
468
  render() {
489
469
  if (!this.body)
@@ -776,15 +756,14 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
776
756
  const [h, v] = SCREEN[this.axis];
777
757
  const marked = markedBy(issues);
778
758
  const m = this.measures?.measures;
779
- const linked = i18next.t('figure.text.section-editor-linked');
780
759
  return html `<div sizes>
781
- ${this.field(i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'), this.working.length, value => this.change({ ...this.working, length: value }), m?.[this.axis] !== 'editable', m?.[this.axis] === 'linked' ? linked : this.keptWords())}
760
+ ${this.field(i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'), this.working.length, value => this.change({ ...this.working, length: value }), m?.[this.axis] !== 'editable', this.noteWords(this.axis, this.kept))}
782
761
  ${this.kind === 'polygon' ? this.apexFields() : nothing}
783
762
  ${this.kind === 'polygon'
784
763
  ? nothing
785
764
  : this.measures?.round
786
- ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', m?.[h] === 'linked' ? linked : '')
787
- : [h, v].map(axis => this.field(i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }), this.working.across[axis] ?? 0, value => this.change(this.across(axis, value)), m?.[axis] !== 'editable', m?.[axis] === 'linked' ? linked : ''))}
765
+ ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', this.noteWords(h))
766
+ : [h, v].map(axis => this.field(i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }), this.working.across[axis] ?? 0, value => this.change(this.across(axis, value)), m?.[axis] !== 'editable', this.noteWords(axis)))}
788
767
  </div>
789
768
  ${this.kind === 'polygon'
790
769
  ? html `<ol points aria-label=${i18next.t('figure.label.section-editor-points')}>
@@ -1 +1 @@
1
- {"version":3,"file":"figure-section-editor.js","sourceRoot":"","sources":["../../client/modeller/figure-section-editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAA;AAC/L,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACjH,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AAKzC,6GAA6G;AAC7G,MAAM,MAAM,GAA+B,EAAE,CAAC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AS,EAAE,KAAK,EAAE,CAAC;;iDAAkB;AAEjB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yDAAkB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAER;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAAoC;AAEtC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAAsC;AAEtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDAAe;AAMzC;IAAhB,KAAK,EAAE;;oDAAkG;AAEzF;IAAhB,KAAK,EAAE;;oDAAwB;AACf;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AAhPf,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA+zB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureEvaluatedShape, FigureFaceMappingNeed, FigureSection, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf, workingShapeOf, type SectionWorking } from './section-drawing.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, END_FACE, sameOf, sidesOf } from './section-controls.js'\nimport './figure-cavity-drawing.js'\nimport './figure-face-mapping.js'\nimport { openPopup } from '@operato/layout'\nimport './figure-section-close-choice.js'\nimport type { SectionCloseChoice } from './figure-section-close-choice.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */\nconst SCREEN: Record<Axis, [Axis, Axis]> = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] }\n\n/** The inside said so two can be compared: its walls by side, its ends. */\nconst cavityKey = (w: SectionWorking) =>\n w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null\n\n/** The editor's width and room for the solid beside it: below this the two take turns. */\nexport const NARROW_BELOW = 900\n\n/**\n * 단면 편집 — a pushed part's section and length in one editor (ADR-0100 §3.2, stage 2).\n *\n * The outline is drawn flat, looking along the push, in millimetres from the part's origin; the figure behind stays in\n * view and shows the solid the working state makes (`command-live`, the same preview the section panel uses), so the 2D\n * and the 3D stand side by side. A drawn section's point is dragged or typed, a side pressed gains a point in its\n * middle, a point is deleted, never below three. A rectangle's width and depth and an ellipse's diameters are dragged by\n * their handles or typed; a circle's two are one. The push's length is typed, and the face it keeps is the one the\n * part's placement or fastening keeps (§4.1: read here, changed elsewhere). A measure that follows another value is\n * shown and not offered.\n *\n * A drawn section's end can be drawn to one point -- a pyramid, a tetrahedron from three points (§4.1.1, A5-1): the\n * apex is dragged or typed like a point, and is not offered while something is fastened to the end it takes away (the\n * kernel's own refusal, `pointBlocked`).\n *\n * A rectangle's or ellipse's inside is made, changed or taken away here too, by the same drawing the section panel has\n * (figure-cavity-drawing), drawn and judged on the widths being typed: walls that fit only a wider section are taken\n * with it, in the same command (figure-model `set-section`'s `cavity`).\n *\n * What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows\n * the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel\n * or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep\n * editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor\n * is open, apply is refused until it is opened again.\n */\n@customElement('figure-section-editor')\nexport class FigureSectionEditor extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n position: absolute;\n left: 12px;\n top: 12px;\n bottom: 12px;\n z-index: 5;\n display: grid;\n grid-template-rows: auto auto minmax(0, 1fr) auto;\n width: min(560px, calc(100% - 24px));\n background: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 18%);\n overflow: hidden;\n }\n /* Each in its own row: the tabs are hidden on a wide screen, and without the rows named the body fell into theirs. */\n header {\n grid-row: 1;\n }\n nav[tabs] {\n grid-row: 2;\n }\n div[body] {\n grid-row: 3;\n }\n footer {\n grid-row: 4;\n }\n header {\n display: flex;\n align-items: baseline;\n gap: 10px;\n padding: 10px 14px 4px;\n }\n header h2 {\n margin: 0;\n font-size: var(--ui-t-body);\n }\n header span {\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n nav[tabs] {\n display: none;\n gap: 4px;\n padding: 0 14px 6px;\n }\n nav[tabs] button,\n footer button,\n li button {\n font: inherit;\n font-size: 0.78rem;\n min-height: 30px;\n padding: 0 12px;\n border-radius: 15px;\n border: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n }\n nav[tabs] button[on] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n div[body] {\n display: grid;\n grid-template-rows: minmax(160px, 1fr) auto;\n min-height: 0;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[outline] {\n position: relative;\n min-height: 0;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n div[caption] {\n position: absolute;\n left: 8px;\n top: 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n pointer-events: none;\n }\n div[caption][last-valid] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n aside {\n max-height: 34vh;\n overflow: auto;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[sizes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 6px;\n margin-bottom: 8px;\n }\n label[mm] {\n display: grid;\n gap: 2px;\n }\n label[mm] input {\n min-width: 0;\n font: inherit;\n }\n label[apex] {\n display: flex;\n align-items: center;\n gap: 6px;\n grid-column: 1 / -1;\n }\n label[apex] small {\n flex-basis: 100%;\n }\n ol[points] {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n gap: 4px;\n }\n ol[points] li {\n display: grid;\n grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) auto;\n gap: 6px;\n align-items: center;\n padding: 2px 4px;\n border-radius: 6px;\n }\n ol[points] li[selected] {\n background: var(--md-sys-color-secondary-container);\n }\n ol[points] li[marked] b {\n color: var(--md-sys-color-error);\n }\n ol[points] input {\n min-width: 0;\n font: inherit;\n }\n div[cavity] {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n /* The panel's width: wider, the drawing pushed the outline out of view. */\n div[cavity] figure-cavity-drawing {\n max-width: 340px;\n }\n label[toggle] {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n }\n label[toggle] small[result] {\n margin-left: auto;\n }\n ul[issues] {\n margin: 8px 0 0;\n padding: 0 0 0 16px;\n color: var(--md-sys-color-error);\n font-size: 0.76rem;\n }\n small {\n color: var(--md-sys-color-on-surface-variant);\n }\n footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n footer span[grow] {\n flex: 1;\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n footer span[grow][stale] {\n color: var(--md-sys-color-error);\n }\n footer button[primary] {\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border-color: transparent;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n /* Too little room beside the editor for the solid: the outline and the solid take turns (§7). */\n :host([narrow]) nav[tabs] {\n display: flex;\n }\n :host([narrow][show='solid']) div[body] {\n display: none;\n }\n :host([narrow][show='solid']) {\n bottom: auto;\n }\n `]\n\n /** The part and its evaluated shape as they stand when the editor opens. */\n @property({ attribute: false }) body?: { id: string; shape: FigureEvaluatedShape }\n /** Which of its measures can be set (figure-model's `figureSectionMeasuresOf`). */\n @property({ attribute: false }) measures?: { measures: Record<Axis, FigureSectionMeasure>; round: boolean }\n /** Along the push, the face a length change keeps: 1 its start, -1 its end, 0 its centre; undefined when it cannot be said. */\n @property({ attribute: false }) kept?: -1 | 0 | 1\n /** Why a push's end cannot be drawn to a point now, in the kernel's words (what is fastened to it); empty when it can. */\n @property({ attribute: false }) pointBlocked = ''\n /** The figure's revision now; the editor remembers the one it opened at. */\n @property({ type: Number }) revision = 0\n /** What stands on the faces the last apply takes away (ADR-0100 A8): asked here, where the edit was made. */\n @property({ attribute: false }) faceMapping?: FigureFaceMappingNeed\n /** Narrow: the outline or the solid behind. */\n @property({ reflect: true }) show: 'outline' | 'solid' = 'outline'\n /** Set when the space the editor stands in leaves too little beside it to see the solid. */\n @property({ type: Boolean, reflect: true }) narrow = false\n private room = new ResizeObserver(([entry]) => {\n this.narrow = (entry?.contentRect.width ?? 0) < NARROW_BELOW\n if (!this.narrow) this.show = 'outline'\n })\n\n @state() private working: SectionWorking = { points: [], across: {}, length: 0, apex: null, cavity: null }\n /** Walls one per side in the inside's drawing; on when they open differing. */\n @state() private perSide = false\n @state() private selected: string | null = null\n @state() private note = ''\n private opened!: SectionWorking\n private history: SectionWorking[] = []\n private lastValid!: SectionWorking\n private openedAt = 0\n private dragging: string | null = null\n /** The state as it was when a drag began: kept once something moves, so a press alone is not a step back. */\n private dragFrom: SectionWorking | null = null\n private extent = 200\n\n private get axis(): Axis {\n return ((this.body && drawnOf(this.body.shape)?.axis) ?? 'y') as Axis\n }\n private get kind() {\n return this.body && drawnOf(this.body.shape)?.section.kind\n }\n /** A pushed rectangle or ellipse can have an inside; a drawn section's is a later stage. */\n private get hollowable() {\n return !!this.body?.shape.extrusion && (this.kind === 'rectangle' || this.kind === 'ellipse')\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.working = workingOf(this.body!.shape)\n this.opened = this.working\n this.lastValid = this.working\n this.openedAt = this.revision\n this.extent = this.extentOf(this.working)\n this.perSide = !!this.working.cavity && sameOf(Object.values(this.working.cavity.wall)) === undefined\n window.addEventListener('keydown', this.keys, true)\n if (this.parentElement) this.room.observe(this.parentElement)\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.keys, true)\n this.room.disconnect()\n super.disconnectedCallback()\n }\n\n /** How far the drawing reaches from the origin: the outline's farthest point with room around, in 50 mm steps. */\n private extentOf(w: SectionWorking): number {\n const [h, v] = SCREEN[this.axis]\n const far = Math.max(\n 1,\n ...w.points.flatMap(p => [Math.abs(p[h] ?? 0), Math.abs(p[v] ?? 0)]),\n ...Object.values(w.across).map(a => (a ?? 0) / 2),\n ...Object.values(w.apex ?? {}).map(a => Math.abs(a ?? 0))\n )\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n }\n\n /*\n * Heard first (capture on the window), and a key the editor takes goes no further: the scene behind listens too, and\n * would take Esc as \"select nothing\" and Delete as \"delete the part\".\n */\n private keys = (e: KeyboardEvent) => {\n const inField = (e.composedPath()[0] as HTMLElement)?.tagName === 'INPUT'\n /* A number being typed in the inside's drawing: Esc there puts the number back, not the editor away. */\n if (inField && e.composedPath().some(el => (el as HTMLElement).tagName === 'FIGURE-CAVITY-DRAWING')) return\n /* While the close is being asked, the question has the keys: Esc there is 계속 편집. */\n if (this.asking) return\n const take = () => (e.preventDefault(), e.stopImmediatePropagation())\n if (e.key === 'Escape') {\n take()\n this.requestClose()\n } else if ((e.key === 'Delete' || e.key === 'Backspace') && !inField && this.selected) {\n /* In a field the key deletes a character; outside, the chosen point. */\n take()\n this.removePoint(this.selected)\n } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'z' && !inField) {\n take()\n this.back()\n }\n }\n\n private get stale() {\n return this.revision !== this.openedAt\n }\n\n private valid(w: SectionWorking) {\n return workingIssuesOf(this.body!.shape, w).words.length === 0\n }\n\n private change(next: SectionWorking) {\n this.history.push(this.working)\n this.working = next\n this.note = ''\n if (this.valid(next)) this.lastValid = next\n this.preview()\n }\n\n private back() {\n const before = this.history.pop()\n if (!before) return\n this.working = before\n if (this.valid(before)) this.lastValid = before\n this.preview()\n }\n\n /** The solid behind shows the working state, or the last valid one while the working one is refused. */\n private preview(w = this.lastValid) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: this.action(w) }, bubbles: true, composed: true }))\n }\n\n /** One command for everything changed since the editor opened; a measure not changed is not sent (it may follow another). */\n private action(w: SectionWorking): FigureAuthoringAction {\n const o = this.opened\n const changed = (a: number | undefined, b: number | undefined) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9\n const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, o.across[k as Axis])))\n const apexMoved = !w.apex !== !o.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, o.apex![k as Axis])))\n const cavityMoved = JSON.stringify(cavityKey(w)) !== JSON.stringify(cavityKey(o))\n return {\n kind: 'set-section',\n part: this.body!.id,\n ...(this.kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),\n ...(Object.keys(across).length ? { across } : {}),\n ...(changed(w.length, o.length) ? { length: w.length } : {}),\n ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),\n ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})\n }\n }\n\n private removePoint(id: string) {\n const next = removePoint(this.working.points, id)\n if ('refused' in next) {\n this.note = i18next.t('figure.text.section-issue-too-few')\n return\n }\n this.selected = null\n this.change({ ...this.working, points: next })\n }\n\n /** A width across set: a circle's two are one. */\n private across(axis: Axis, value: number): SectionWorking {\n const [u, v] = SCREEN[this.axis]\n const both = this.measures?.round ? { [u]: value, [v]: value } : { [axis]: value }\n return { ...this.working, across: { ...this.working.across, ...both } }\n }\n\n private apply() {\n if (this.stale || !this.valid(this.working)) return\n const detail: { action: FigureAuthoringAction; held?: boolean } = { action: this.action(this.working) }\n this.dispatchEvent(new CustomEvent('command', { detail, bubbles: true, composed: true }))\n /* Held for a choice of where what stands on a lost face goes: stays open, the choice shown below. */\n if (!detail.held) this.close()\n }\n\n /** Whether anything was changed since the editor opened. */\n get dirty(): boolean {\n const key = (w: SectionWorking) =>\n JSON.stringify([\n w.points.map(p => [p.id, p.x ?? 0, p.y ?? 0, p.z ?? 0]),\n Object.entries(w.across).sort(),\n w.length,\n w.apex ? Object.entries(w.apex).sort() : null,\n cavityKey(w)\n ])\n return !!this.opened && key(this.working) !== key(this.opened)\n }\n\n private asking = false\n /**\n * Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the\n * editor closed; false when the person keeps editing.\n */\n async requestClose(): Promise<boolean> {\n if (!this.dirty) {\n this.cancel()\n return true\n }\n if (this.asking) return false\n const held = this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : this.valid(this.working)\n ? ''\n : i18next.t('figure.text.section-editor-close-invalid')\n this.asking = true\n try {\n const choice = await openPopup<SectionCloseChoice>(html`<figure-section-close-choice .held=${held}></figure-section-close-choice>`, {\n backdrop: true,\n size: 'small',\n title: i18next.t('figure.label.section-editor')\n }).result\n if (choice === 'apply' && !held) {\n this.apply()\n return true\n }\n if (choice === 'discard') {\n this.cancel()\n return true\n }\n return false\n } finally {\n this.asking = false\n }\n }\n\n private cancel() {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: null }, bubbles: true, composed: true }))\n this.close()\n }\n\n private close() {\n this.dispatchEvent(new CustomEvent('section-editor-close', { bubbles: true, composed: true }))\n }\n\n private svgPoint(e: PointerEvent): { h: number; v: number } {\n const el = this.renderRoot.querySelector('svg')!\n const pt = el.createSVGPoint()\n pt.x = e.clientX\n pt.y = e.clientY\n const p = pt.matrixTransform(el.getScreenCTM()!.inverse())\n return { h: Math.round(p.x), v: Math.round(p.y) }\n }\n\n /** Words for the face a length change keeps, by the part's relations; nothing when they cannot say. */\n private keptWords(): string {\n if (this.kept === undefined) return ''\n if (this.kept === 0) return i18next.t('figure.text.section-editor-keeps-centre')\n return i18next.t('figure.text.section-editor-keeps', {\n face: i18next.t('figure.label.face-' + END_FACE(this.axis, this.kept === 1 ? 'start' : 'end'))\n })\n }\n\n render() {\n if (!this.body) return nothing\n const { issues, words } = workingIssuesOf(this.body.shape, this.working)\n return html`\n <header>\n <h2>${i18next.t('figure.label.section-editor')}</h2>\n <span>${this.body.id}</span>\n </header>\n <nav tabs>\n ${(['outline', 'solid'] as const).map(\n one => html`<button ?on=${this.show === one} @click=${() => (this.show = one)}>${i18next.t(`figure.label.section-editor-${one}`)}</button>`\n )}\n </nav>\n <div body>\n <div outline>${this.drawing(issues, words.length > 0)}</div>\n <aside>\n ${this.faceMapping ? html`<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}\n ${this.list(issues, words)}\n </aside>\n </div>\n <footer>\n <button ?disabled=${!this.history.length} @click=${() => this.back()}>${i18next.t('figure.button.section-editor-back')}</button>\n <span grow ?stale=${this.stale}>\n ${this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : i18next.t(this.kind === 'polygon' ? 'figure.text.section-editor-hint' : 'figure.text.section-editor-hint-sized')}\n </span>\n <button @click=${() => this.requestClose()}>${i18next.t('figure.button.section-editor-cancel')}</button>\n <button primary ?disabled=${this.stale || words.length > 0} @click=${() => this.apply()}>${i18next.t('figure.button.section-editor-apply')}</button>\n </footer>\n `\n }\n\n /** A section drawn as the screen lays it: across to the right, then down. */\n private outline(section: FigureSection, attrs: { fill: string; stroke: string; width: number; dash?: string }, centre: Partial<Record<Axis, number>> = {}) {\n const [h, v] = SCREEN[this.axis]\n const ch = centre[h] ?? 0,\n cv = centre[v] ?? 0\n if (section.kind === 'polygon')\n return svg`<polygon points=${section.points.map(p => `${p[h]},${p[v]}`).join(' ')} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n if (section.kind === 'ellipse')\n return svg`<ellipse cx=${ch} cy=${cv} rx=${section.radius[h]} ry=${section.radius[v]} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n const w = section.size[h]!,\n d = section.size[v]!\n return svg`<rect x=${ch - w / 2} y=${cv - d / 2} width=${w} height=${d} rx=${section.corner?.[h] ?? 0} ry=${section.corner?.[v] ?? 0}\n fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n }\n\n private drawing(issues: ReturnType<typeof workingIssuesOf>['issues'], invalid: boolean) {\n const [h, v] = SCREEN[this.axis]\n const e = this.extent\n const marked = markedBy(issues)\n const w = this.working\n const section = sectionOf(this.body!.shape, w)\n const pts = w.points\n const sides = this.kind === 'polygon' && pts.length >= 2 ? figureSectionSidesOf({ kind: 'polygon', points: pts }, this.axis) : []\n const at = (id: string) => pts.find(p => p.id === id)!\n const grid = Math.max(10, Math.pow(10, Math.floor(Math.log10(e))) / 2)\n const lines: number[] = []\n for (let g = -Math.floor(e / grid) * grid; g <= e; g += grid) lines.push(g)\n const inside = w.cavity && !invalid ? figureCavitySectionOf(section, this.axis, w.cavity.wall) : undefined\n const sized = (axis: Axis) => this.measures?.measures[axis] === 'editable'\n return html`<div caption ?last-valid=${invalid}>\n ${invalid ? i18next.t('figure.text.section-editor-last-valid') : i18next.t('figure.text.section-editor-units', { h: h.toUpperCase(), v: v.toUpperCase() })}\n </div>\n <svg\n viewBox=${`${-e} ${-e} ${2 * e} ${2 * e}`}\n role=\"img\"\n aria-label=${i18next.t('figure.label.section-editor')}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.dragging) return\n if (this.dragFrom) this.history.push(this.dragFrom), (this.dragFrom = null)\n const p = this.svgPoint(ev)\n const handle = /^handle:(.)$/.exec(this.dragging)\n this.working = handle\n ? this.across(handle[1] as Axis, Math.max(1, 2 * Math.abs(handle[1] === h ? p.h : p.v)))\n : this.dragging === 'apex'\n ? { ...this.working, apex: { [h]: p.h, [v]: p.v } }\n : { ...this.working, points: movePoint(this.working.points, this.dragging, { [h]: p.h, [v]: p.v }) }\n if (this.valid(this.working)) this.lastValid = this.working\n this.preview()\n }}\n @pointerup=${() => ((this.dragging = null), (this.dragFrom = null))}\n @pointerleave=${() => ((this.dragging = null), (this.dragFrom = null))}\n >\n ${svg`${lines.map(g => svg`<line x1=${g} y1=${-e} x2=${g} y2=${e} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />\n <line x1=${-e} y1=${g} x2=${e} y2=${g} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />`)}\n <line x1=${-e} y1=\"0\" x2=${e} y2=\"0\" stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <line x1=\"0\" y1=${-e} x2=\"0\" y2=${e} stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <text x=${e * 0.92} y=${-e * 0.02} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${h.toUpperCase()}</text>\n <text x=${e * 0.02} y=${e * 0.95} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${v.toUpperCase()}</text>\n ${invalid ? this.outline(sectionOf(this.body!.shape, this.lastValid), { fill: 'none', stroke: 'var(--md-sys-color-outline)', width: e / 250, dash: `${e / 50} ${e / 70}` }) : nothing}\n ${this.outline(section, {\n fill: invalid ? 'none' : 'color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent)',\n stroke: this.kind === 'polygon' ? 'none' : invalid ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)',\n width: e / 130\n })}\n ${inside && 'section' in inside\n ? this.outline(inside.section, { fill: 'var(--md-sys-color-surface)', stroke: 'var(--md-sys-color-primary)', width: e / 250, dash: `${e / 60} ${e / 90}` }, inside.centre)\n : nothing}\n ${sides.map(s => {\n const a = at(s.from!),\n b = at(s.to!)\n const bad = marked.sides.has(s.id)\n return svg`<line x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / (bad ? 90 : 130)}\n stroke-dasharray=${bad ? `${e / 40} ${e / 80}` : ''} />\n <line side=${s.id} x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]} stroke=\"transparent\" stroke-width=${e / 25} style=\"cursor: copy\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n const made = insertAfter(this.working.points, s.from!, this.axis)\n this.change({ ...this.working, points: made.points })\n this.selected = made.id\n }}><title>${i18next.t('figure.text.section-editor-add-here', { a: pointLabel(s.from!), b: pointLabel(s.to!) })}</title></line>`\n })}\n ${pts.map(p => {\n const bad = marked.points.has(p.id),\n on = this.selected === p.id\n return svg`<g point=${p.id} style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = p.id\n this.dragging = p.id\n }}>\n <circle cx=${p[h]} cy=${p[v]} r=${e / (on ? 28 : 36)} fill=${bad ? 'var(--md-sys-color-error)' : on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-surface)'}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / 250} />\n <text x=${p[h]! + e / 22} y=${p[v]! - e / 22} font-size=${e / 16} font-weight=\"600\"\n fill=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-on-surface)'}>${pointLabel(p.id)}</text>\n </g>`\n })}\n ${w.apex\n ? svg`${pts.map(p => svg`<line x1=${p[h]} y1=${p[v]} x2=${w.apex![h]} y2=${w.apex![v]} stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 300} stroke-dasharray=${`${e / 60} ${e / 90}`} />`)}\n <g apex style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = null\n this.dragging = 'apex'\n }}>\n <rect x=${w.apex[h]! - e / 34} y=${w.apex[v]! - e / 34} width=${e / 17} height=${e / 17}\n transform=${`rotate(45 ${w.apex[h]} ${w.apex[v]})`} fill=\"var(--md-sys-color-tertiary)\" stroke=\"var(--md-sys-color-surface)\" stroke-width=${e / 250} />\n <text x=${w.apex[h]! + e / 22} y=${w.apex[v]! + e / 12} font-size=${e / 16} font-weight=\"600\" fill=\"var(--md-sys-color-on-surface)\">${i18next.t('figure.label.section-editor-apex-mark')}</text>\n <title>${i18next.t('figure.label.section-editor-apex-mark')}</title>\n </g>`\n : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : ([h, v] as const).filter(sized).map(axis => {\n const half = (w.across[axis] ?? 0) / 2\n const cx = axis === h ? half : 0,\n cy = axis === h ? 0 : half\n return svg`<g handle=${axis} style=${`cursor: ${axis === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.dragging = `handle:${axis}`\n }}>\n <rect x=${cx - e / 40} y=${cy - e / 40} width=${e / 20} height=${e / 20} rx=${e / 120}\n fill=\"var(--md-sys-color-surface)\" stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 200} />\n <text x=${cx + e / 28} y=${cy - e / 28} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface)\">${Math.round((w.across[axis] ?? 0) * 10) / 10}</text>\n <title>${i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() })}</title>\n </g>`\n })}`}\n </svg>`\n }\n\n /** A millimetre field: committed to the working state on change, a bad number put back. */\n private field(label: string, now: number, set: (value: number) => void, disabled = false, note = '') {\n return html`<label mm>\n <span>${label}</span>\n <input\n type=\"number\"\n step=\"any\"\n min=\"0\"\n inputmode=\"decimal\"\n aria-label=${label}\n .value=${live(String(Math.round(now * 1000) / 1000))}\n ?disabled=${disabled}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(now)\n return\n }\n set(value)\n }}\n />\n ${note ? html`<small>${note}</small>` : nothing}\n </label>`\n }\n\n /** A drawn section's end: the section again (a push) or one point (a pyramid), and where that point is. */\n private apexFields() {\n const [h, v] = SCREEN[this.axis]\n const apex = this.working.apex\n /* The kernel's refusal holds only for turning a push into a pyramid; a pyramid can always be made a push again. */\n const blocked = !apex && !this.opened?.apex ? this.pointBlocked : ''\n return html`<label apex>\n <input\n type=\"checkbox\"\n .checked=${live(!!apex)}\n ?disabled=${!!blocked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n this.change({ ...this.working, apex: on ? (this.opened.apex ?? apexOver(this.working.points, this.axis)) : null })\n }}\n />\n <span>${i18next.t('figure.label.section-editor-apex')}</span>\n ${blocked ? html`<small>${blocked}</small>` : nothing}\n </label>\n ${apex\n ? ([h, v] as const).map(axis =>\n html`<label mm>\n <span>${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}</span>\n <input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}\n .value=${live(String(apex[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(apex[axis] ?? '')\n return\n }\n this.change({ ...this.working, apex: { ...apex, [axis]: value } })\n }}\n />\n </label>`\n )\n : nothing}`\n }\n\n /** The inside, as the section panel shows it, on the working section: on or off, what it makes, its drawing. */\n private cavityBlock(invalid: boolean) {\n const w = this.working\n const shape = workingShapeOf(this.body!.shape, w)\n return html`<div cavity>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!w.cavity)}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n const ask = cavityRequestOf(shape, {})\n const wall = typeof ask.wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, ask.wall as number])) : (ask.wall as Record<string, number>)\n this.change({ ...w, cavity: on ? { wall, start: ask.start, end: ask.end } : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n ${w.cavity && !invalid\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(shape.cavity!)}`),\n depth: String(cavityDepthOf(shape))\n })}\n </small>`\n : nothing}\n </label>\n ${w.cavity\n ? html`<figure-cavity-drawing\n .body=${{ id: this.body!.id, shape }}\n .perSide=${this.perSide}\n @command-live=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n this.preview(c && this.valid({ ...this.working, cavity: c }) ? { ...this.working, cavity: c } : this.lastValid)\n }}\n @command=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n if (c) this.change({ ...this.working, cavity: c })\n }}\n ></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}\n </div>`\n }\n\n /** The inside a drawing's set-cavity asks for, every wall written out; the drawing's commands stay in the editor. */\n private cavityOf(action: FigureAuthoringAction | null): SectionWorking['cavity'] | undefined {\n if (action?.kind !== 'set-cavity' || !action.cavity) return undefined\n const { wall, start, end } = action.cavity\n return { wall: typeof wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, wall])) : ({ ...wall } as Record<string, number>), start, end }\n }\n\n private list(issues: ReturnType<typeof workingIssuesOf>['issues'], words: ReturnType<typeof workingIssuesOf>['words']) {\n const [h, v] = SCREEN[this.axis]\n const marked = markedBy(issues)\n const m = this.measures?.measures\n const linked = i18next.t('figure.text.section-editor-linked')\n return html`<div sizes>\n ${this.field(\n i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'),\n this.working.length,\n value => this.change({ ...this.working, length: value }),\n m?.[this.axis] !== 'editable',\n m?.[this.axis] === 'linked' ? linked : this.keptWords()\n )}\n ${this.kind === 'polygon' ? this.apexFields() : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : this.measures?.round\n ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', m?.[h] === 'linked' ? linked : '')\n : ([h, v] as const).map(axis =>\n this.field(\n i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }),\n this.working.across[axis] ?? 0,\n value => this.change(this.across(axis, value)),\n m?.[axis] !== 'editable',\n m?.[axis] === 'linked' ? linked : ''\n )\n )}\n </div>\n ${this.kind === 'polygon'\n ? html`<ol points aria-label=${i18next.t('figure.label.section-editor-points')}>\n ${this.working.points.map(\n p => html`<li ?selected=${this.selected === p.id} ?marked=${marked.points.has(p.id)} @focusin=${() => (this.selected = p.id)}>\n <b>${pointLabel(p.id)}</b>\n ${([h, v] as const).map(\n axis => html`<input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-coordinate', { point: pointLabel(p.id), axis: axis.toUpperCase() })}\n .value=${live(String(p[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(p[axis] ?? '')\n return\n }\n this.change({ ...this.working, points: movePoint(this.working.points, p.id, { [axis]: value }) })\n }}\n />`\n )}\n <button\n ?disabled=${this.working.points.length <= 3}\n title=${this.working.points.length <= 3 ? i18next.t('figure.text.section-issue-too-few') : ''}\n aria-label=${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n @click=${() => this.removePoint(p.id)}\n >\n ${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n </button>\n </li>`\n )}\n </ol>`\n : nothing}\n ${this.hollowable ? this.cavityBlock(words.length > 0) : nothing}\n ${this.note ? html`<small role=\"status\">${this.note}</small>` : nothing}\n ${words.length\n ? html`<ul issues role=\"alert\">\n ${words.map(w => html`<li>${i18next.t(w.key, w.params)}</li>`)}\n </ul>`\n : nothing}`\n }\n}\n"]}
1
+ {"version":3,"file":"figure-section-editor.js","sourceRoot":"","sources":["../../client/modeller/figure-section-editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAA;AAC5O,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,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;iDAAmD;AAElD;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;qDAA4E;AAE3E;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAkB;AAEjB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yDAAkB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAER;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAAoC;AAEtC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAAsC;AAEtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDAAe;AAMzC;IAAhB,KAAK,EAAE;;oDAAkG;AAEzF;IAAhB,KAAK,EAAE;;oDAAwB;AACf;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AAhPf,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA8yB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureEvaluatedShape, FigureFaceMappingNeed, FigureSection, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { apexOver, cavityKeyOf, drawnOf, insertAfter, markedBy, measureNoteOf, movePoint, pointLabel, removePoint, sectionActionOf, sectionOf, workingIssuesOf, workingOf, workingShapeOf, type SectionWorking } from './section-drawing.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, hollowableOf, sameOf, sidesOf } from './section-controls.js'\nimport './figure-cavity-drawing.js'\nimport './figure-face-mapping.js'\nimport { openPopup } from '@operato/layout'\nimport './figure-section-close-choice.js'\nimport type { SectionCloseChoice } from './figure-section-close-choice.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */\nconst SCREEN: Record<Axis, [Axis, Axis]> = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] }\n\n/** The editor's width and room for the solid beside it: below this the two take turns. */\nexport const NARROW_BELOW = 900\n\n/**\n * 단면 편집 — a pushed part's section and length in one editor (ADR-0100 §3.2, stage 2).\n *\n * The outline is drawn flat, looking along the push, in millimetres from the part's origin; the figure behind stays in\n * view and shows the solid the working state makes (`command-live`, the same preview the section panel uses), so the 2D\n * and the 3D stand side by side. A drawn section's point is dragged or typed, a side pressed gains a point in its\n * middle, a point is deleted, never below three. A rectangle's width and depth and an ellipse's diameters are dragged by\n * their handles or typed; a circle's two are one. The push's length is typed, and the face it keeps is the one the\n * part's placement or fastening keeps (§4.1: read here, changed elsewhere). A measure that follows another value is\n * shown and not offered.\n *\n * A drawn section's end can be drawn to one point -- a pyramid, a tetrahedron from three points (§4.1.1, A5-1): the\n * apex is dragged or typed like a point, and is not offered while something is fastened to the end it takes away (the\n * kernel's own refusal, `pointBlocked`).\n *\n * A rectangle's or ellipse's inside is made, changed or taken away here too, by the same drawing the section panel has\n * (figure-cavity-drawing), drawn and judged on the widths being typed: walls that fit only a wider section are taken\n * with it, in the same command (figure-model `set-section`'s `cavity`).\n *\n * What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows\n * the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel\n * or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep\n * editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor\n * is open, apply is refused until it is opened again.\n */\n@customElement('figure-section-editor')\nexport class FigureSectionEditor extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n position: absolute;\n left: 12px;\n top: 12px;\n bottom: 12px;\n z-index: 5;\n display: grid;\n grid-template-rows: auto auto minmax(0, 1fr) auto;\n width: min(560px, calc(100% - 24px));\n background: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 18%);\n overflow: hidden;\n }\n /* Each in its own row: the tabs are hidden on a wide screen, and without the rows named the body fell into theirs. */\n header {\n grid-row: 1;\n }\n nav[tabs] {\n grid-row: 2;\n }\n div[body] {\n grid-row: 3;\n }\n footer {\n grid-row: 4;\n }\n header {\n display: flex;\n align-items: baseline;\n gap: 10px;\n padding: 10px 14px 4px;\n }\n header h2 {\n margin: 0;\n font-size: var(--ui-t-body);\n }\n header span {\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n nav[tabs] {\n display: none;\n gap: 4px;\n padding: 0 14px 6px;\n }\n nav[tabs] button,\n footer button,\n li button {\n font: inherit;\n font-size: 0.78rem;\n min-height: 30px;\n padding: 0 12px;\n border-radius: 15px;\n border: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n }\n nav[tabs] button[on] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n div[body] {\n display: grid;\n grid-template-rows: minmax(160px, 1fr) auto;\n min-height: 0;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[outline] {\n position: relative;\n min-height: 0;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n div[caption] {\n position: absolute;\n left: 8px;\n top: 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n pointer-events: none;\n }\n div[caption][last-valid] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n aside {\n max-height: 34vh;\n overflow: auto;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[sizes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 6px;\n margin-bottom: 8px;\n }\n label[mm] {\n display: grid;\n gap: 2px;\n }\n label[mm] input {\n min-width: 0;\n font: inherit;\n }\n label[apex] {\n display: flex;\n align-items: center;\n gap: 6px;\n grid-column: 1 / -1;\n }\n label[apex] small {\n flex-basis: 100%;\n }\n ol[points] {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n gap: 4px;\n }\n ol[points] li {\n display: grid;\n grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) auto;\n gap: 6px;\n align-items: center;\n padding: 2px 4px;\n border-radius: 6px;\n }\n ol[points] li[selected] {\n background: var(--md-sys-color-secondary-container);\n }\n ol[points] li[marked] b {\n color: var(--md-sys-color-error);\n }\n ol[points] input {\n min-width: 0;\n font: inherit;\n }\n div[cavity] {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n /* The panel's width: wider, the drawing pushed the outline out of view. */\n div[cavity] figure-cavity-drawing {\n max-width: 340px;\n }\n label[toggle] {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n }\n label[toggle] small[result] {\n margin-left: auto;\n }\n ul[issues] {\n margin: 8px 0 0;\n padding: 0 0 0 16px;\n color: var(--md-sys-color-error);\n font-size: 0.76rem;\n }\n small {\n color: var(--md-sys-color-on-surface-variant);\n }\n footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n footer span[grow] {\n flex: 1;\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n footer span[grow][stale] {\n color: var(--md-sys-color-error);\n }\n footer button[primary] {\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border-color: transparent;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n /* Too little room beside the editor for the solid: the outline and the solid take turns (§7). */\n :host([narrow]) nav[tabs] {\n display: flex;\n }\n :host([narrow][show='solid']) div[body] {\n display: none;\n }\n :host([narrow][show='solid']) {\n bottom: auto;\n }\n `]\n\n /** The part and its evaluated shape as they stand when the editor opens. */\n @property({ attribute: false }) body?: { id: string; shape: FigureEvaluatedShape }\n /** Which of its measures can be set (figure-model's `figureSectionMeasuresOf`). */\n @property({ attribute: false }) measures?: { measures: Record<Axis, FigureSectionMeasure>; round: boolean }\n /** Along the push, the face a length change keeps: 1 its start, -1 its end, 0 its centre; undefined when it cannot be said. */\n @property({ attribute: false }) kept?: -1 | 0 | 1\n /** Why a push's end cannot be drawn to a point now, in the kernel's words (what is fastened to it); empty when it can. */\n @property({ attribute: false }) pointBlocked = ''\n /** The figure's revision now; the editor remembers the one it opened at. */\n @property({ type: Number }) revision = 0\n /** What stands on the faces the last apply takes away (ADR-0100 A8): asked here, where the edit was made. */\n @property({ attribute: false }) faceMapping?: FigureFaceMappingNeed\n /** Narrow: the outline or the solid behind. */\n @property({ reflect: true }) show: 'outline' | 'solid' = 'outline'\n /** Set when the space the editor stands in leaves too little beside it to see the solid. */\n @property({ type: Boolean, reflect: true }) narrow = false\n private room = new ResizeObserver(([entry]) => {\n this.narrow = (entry?.contentRect.width ?? 0) < NARROW_BELOW\n if (!this.narrow) this.show = 'outline'\n })\n\n @state() private working: SectionWorking = { points: [], across: {}, length: 0, apex: null, cavity: null }\n /** Walls one per side in the inside's drawing; on when they open differing. */\n @state() private perSide = false\n @state() private selected: string | null = null\n @state() private note = ''\n private opened!: SectionWorking\n private history: SectionWorking[] = []\n private lastValid!: SectionWorking\n private openedAt = 0\n private dragging: string | null = null\n /** The state as it was when a drag began: kept once something moves, so a press alone is not a step back. */\n private dragFrom: SectionWorking | null = null\n private extent = 200\n\n private get axis(): Axis {\n return ((this.body && drawnOf(this.body.shape)?.axis) ?? 'y') as Axis\n }\n private get kind() {\n return this.body && drawnOf(this.body.shape)?.section.kind\n }\n /** A pushed rectangle or ellipse can have an inside; a drawn section's is a later stage. */\n private get hollowable() {\n return !!this.body && hollowableOf(this.body.shape)\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.working = workingOf(this.body!.shape)\n this.opened = this.working\n this.lastValid = this.working\n this.openedAt = this.revision\n this.extent = this.extentOf(this.working)\n this.perSide = !!this.working.cavity && sameOf(Object.values(this.working.cavity.wall)) === undefined\n window.addEventListener('keydown', this.keys, true)\n if (this.parentElement) this.room.observe(this.parentElement)\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.keys, true)\n this.room.disconnect()\n super.disconnectedCallback()\n }\n\n /** How far the drawing reaches from the origin: the outline's farthest point with room around, in 50 mm steps. */\n private extentOf(w: SectionWorking): number {\n const [h, v] = SCREEN[this.axis]\n const far = Math.max(\n 1,\n ...w.points.flatMap(p => [Math.abs(p[h] ?? 0), Math.abs(p[v] ?? 0)]),\n ...Object.values(w.across).map(a => (a ?? 0) / 2),\n ...Object.values(w.apex ?? {}).map(a => Math.abs(a ?? 0))\n )\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n }\n\n /*\n * Heard first (capture on the window), and a key the editor takes goes no further: the scene behind listens too, and\n * would take Esc as \"select nothing\" and Delete as \"delete the part\".\n */\n private keys = (e: KeyboardEvent) => {\n const inField = (e.composedPath()[0] as HTMLElement)?.tagName === 'INPUT'\n /* A number being typed in the inside's drawing: Esc there puts the number back, not the editor away. */\n if (inField && e.composedPath().some(el => (el as HTMLElement).tagName === 'FIGURE-CAVITY-DRAWING')) return\n /* While the close is being asked, the question has the keys: Esc there is 계속 편집. */\n if (this.asking) return\n const take = () => (e.preventDefault(), e.stopImmediatePropagation())\n if (e.key === 'Escape') {\n take()\n this.requestClose()\n } else if ((e.key === 'Delete' || e.key === 'Backspace') && !inField && this.selected) {\n /* In a field the key deletes a character; outside, the chosen point. */\n take()\n this.removePoint(this.selected)\n } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'z' && !inField) {\n take()\n this.back()\n }\n }\n\n private get stale() {\n return this.revision !== this.openedAt\n }\n\n private valid(w: SectionWorking) {\n return workingIssuesOf(this.body!.shape, w).words.length === 0\n }\n\n private change(next: SectionWorking) {\n this.history.push(this.working)\n this.working = next\n this.note = ''\n if (this.valid(next)) this.lastValid = next\n this.preview()\n }\n\n private back() {\n const before = this.history.pop()\n if (!before) return\n this.working = before\n if (this.valid(before)) this.lastValid = before\n this.preview()\n }\n\n /** The solid behind shows the working state, or the last valid one while the working one is refused. */\n private preview(w = this.lastValid) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: this.action(w) }, bubbles: true, composed: true }))\n }\n\n /** One command for everything changed since the editor opened; a measure not changed is not sent (it may follow another). */\n private action(w: SectionWorking): FigureAuthoringAction {\n return sectionActionOf(this.body!.id, this.kind, this.opened, w)\n }\n\n private removePoint(id: string) {\n const next = removePoint(this.working.points, id)\n if ('refused' in next) {\n this.note = i18next.t('figure.text.section-issue-too-few')\n return\n }\n this.selected = null\n this.change({ ...this.working, points: next })\n }\n\n /** A width across set: a circle's two are one. */\n private across(axis: Axis, value: number): SectionWorking {\n const [u, v] = SCREEN[this.axis]\n const both = this.measures?.round ? { [u]: value, [v]: value } : { [axis]: value }\n return { ...this.working, across: { ...this.working.across, ...both } }\n }\n\n private apply() {\n if (this.stale || !this.valid(this.working)) return\n const detail: { action: FigureAuthoringAction; held?: boolean } = { action: this.action(this.working) }\n this.dispatchEvent(new CustomEvent('command', { detail, bubbles: true, composed: true }))\n /* Held for a choice of where what stands on a lost face goes: stays open, the choice shown below. */\n if (!detail.held) this.close()\n }\n\n /** Whether anything was changed since the editor opened. */\n get dirty(): boolean {\n const key = (w: SectionWorking) =>\n JSON.stringify([\n w.points.map(p => [p.id, p.x ?? 0, p.y ?? 0, p.z ?? 0]),\n Object.entries(w.across).sort(),\n w.length,\n w.apex ? Object.entries(w.apex).sort() : null,\n cavityKeyOf(w)\n ])\n return !!this.opened && key(this.working) !== key(this.opened)\n }\n\n private asking = false\n /**\n * Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the\n * editor closed; false when the person keeps editing.\n */\n async requestClose(): Promise<boolean> {\n if (!this.dirty) {\n this.cancel()\n return true\n }\n if (this.asking) return false\n const held = this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : this.valid(this.working)\n ? ''\n : i18next.t('figure.text.section-editor-close-invalid')\n this.asking = true\n try {\n const choice = await openPopup<SectionCloseChoice>(html`<figure-section-close-choice .held=${held}></figure-section-close-choice>`, {\n backdrop: true,\n size: 'small',\n title: i18next.t('figure.label.section-editor')\n }).result\n if (choice === 'apply' && !held) {\n this.apply()\n return true\n }\n if (choice === 'discard') {\n this.cancel()\n return true\n }\n return false\n } finally {\n this.asking = false\n }\n }\n\n private cancel() {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: null }, bubbles: true, composed: true }))\n this.close()\n }\n\n private close() {\n this.dispatchEvent(new CustomEvent('section-editor-close', { bubbles: true, composed: true }))\n }\n\n private svgPoint(e: PointerEvent): { h: number; v: number } {\n const el = this.renderRoot.querySelector('svg')!\n const pt = el.createSVGPoint()\n pt.x = e.clientX\n pt.y = e.clientY\n const p = pt.matrixTransform(el.getScreenCTM()!.inverse())\n return { h: Math.round(p.x), v: Math.round(p.y) }\n }\n\n /** What a measure's field says under it: following another value, or for the length the face it keeps. */\n private noteWords(axis: Axis, kept?: -1 | 0 | 1): string {\n const note = measureNoteOf(this.measures?.measures[axis], kept, axis)\n return note ? i18next.t(note.key, note.face ? { face: i18next.t('figure.label.face-' + note.face) } : {}) : ''\n }\n\n render() {\n if (!this.body) return nothing\n const { issues, words } = workingIssuesOf(this.body.shape, this.working)\n return html`\n <header>\n <h2>${i18next.t('figure.label.section-editor')}</h2>\n <span>${this.body.id}</span>\n </header>\n <nav tabs>\n ${(['outline', 'solid'] as const).map(\n one => html`<button ?on=${this.show === one} @click=${() => (this.show = one)}>${i18next.t(`figure.label.section-editor-${one}`)}</button>`\n )}\n </nav>\n <div body>\n <div outline>${this.drawing(issues, words.length > 0)}</div>\n <aside>\n ${this.faceMapping ? html`<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}\n ${this.list(issues, words)}\n </aside>\n </div>\n <footer>\n <button ?disabled=${!this.history.length} @click=${() => this.back()}>${i18next.t('figure.button.section-editor-back')}</button>\n <span grow ?stale=${this.stale}>\n ${this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : i18next.t(this.kind === 'polygon' ? 'figure.text.section-editor-hint' : 'figure.text.section-editor-hint-sized')}\n </span>\n <button @click=${() => this.requestClose()}>${i18next.t('figure.button.section-editor-cancel')}</button>\n <button primary ?disabled=${this.stale || words.length > 0} @click=${() => this.apply()}>${i18next.t('figure.button.section-editor-apply')}</button>\n </footer>\n `\n }\n\n /** A section drawn as the screen lays it: across to the right, then down. */\n private outline(section: FigureSection, attrs: { fill: string; stroke: string; width: number; dash?: string }, centre: Partial<Record<Axis, number>> = {}) {\n const [h, v] = SCREEN[this.axis]\n const ch = centre[h] ?? 0,\n cv = centre[v] ?? 0\n if (section.kind === 'polygon')\n return svg`<polygon points=${section.points.map(p => `${p[h]},${p[v]}`).join(' ')} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n if (section.kind === 'ellipse')\n return svg`<ellipse cx=${ch} cy=${cv} rx=${section.radius[h]} ry=${section.radius[v]} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n const w = section.size[h]!,\n d = section.size[v]!\n return svg`<rect x=${ch - w / 2} y=${cv - d / 2} width=${w} height=${d} rx=${section.corner?.[h] ?? 0} ry=${section.corner?.[v] ?? 0}\n fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n }\n\n private drawing(issues: ReturnType<typeof workingIssuesOf>['issues'], invalid: boolean) {\n const [h, v] = SCREEN[this.axis]\n const e = this.extent\n const marked = markedBy(issues)\n const w = this.working\n const section = sectionOf(this.body!.shape, w)\n const pts = w.points\n const sides = this.kind === 'polygon' && pts.length >= 2 ? figureSectionSidesOf({ kind: 'polygon', points: pts }, this.axis) : []\n const at = (id: string) => pts.find(p => p.id === id)!\n const grid = Math.max(10, Math.pow(10, Math.floor(Math.log10(e))) / 2)\n const lines: number[] = []\n for (let g = -Math.floor(e / grid) * grid; g <= e; g += grid) lines.push(g)\n const inside = w.cavity && !invalid ? figureCavitySectionOf(section, this.axis, w.cavity.wall) : undefined\n const sized = (axis: Axis) => this.measures?.measures[axis] === 'editable'\n return html`<div caption ?last-valid=${invalid}>\n ${invalid ? i18next.t('figure.text.section-editor-last-valid') : i18next.t('figure.text.section-editor-units', { h: h.toUpperCase(), v: v.toUpperCase() })}\n </div>\n <svg\n viewBox=${`${-e} ${-e} ${2 * e} ${2 * e}`}\n role=\"img\"\n aria-label=${i18next.t('figure.label.section-editor')}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.dragging) return\n if (this.dragFrom) this.history.push(this.dragFrom), (this.dragFrom = null)\n const p = this.svgPoint(ev)\n const handle = /^handle:(.)$/.exec(this.dragging)\n this.working = handle\n ? this.across(handle[1] as Axis, Math.max(1, 2 * Math.abs(handle[1] === h ? p.h : p.v)))\n : this.dragging === 'apex'\n ? { ...this.working, apex: { [h]: p.h, [v]: p.v } }\n : { ...this.working, points: movePoint(this.working.points, this.dragging, { [h]: p.h, [v]: p.v }) }\n if (this.valid(this.working)) this.lastValid = this.working\n this.preview()\n }}\n @pointerup=${() => ((this.dragging = null), (this.dragFrom = null))}\n @pointerleave=${() => ((this.dragging = null), (this.dragFrom = null))}\n >\n ${svg`${lines.map(g => svg`<line x1=${g} y1=${-e} x2=${g} y2=${e} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />\n <line x1=${-e} y1=${g} x2=${e} y2=${g} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />`)}\n <line x1=${-e} y1=\"0\" x2=${e} y2=\"0\" stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <line x1=\"0\" y1=${-e} x2=\"0\" y2=${e} stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <text x=${e * 0.92} y=${-e * 0.02} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${h.toUpperCase()}</text>\n <text x=${e * 0.02} y=${e * 0.95} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${v.toUpperCase()}</text>\n ${invalid ? this.outline(sectionOf(this.body!.shape, this.lastValid), { fill: 'none', stroke: 'var(--md-sys-color-outline)', width: e / 250, dash: `${e / 50} ${e / 70}` }) : nothing}\n ${this.outline(section, {\n fill: invalid ? 'none' : 'color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent)',\n stroke: this.kind === 'polygon' ? 'none' : invalid ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)',\n width: e / 130\n })}\n ${inside && 'section' in inside\n ? this.outline(inside.section, { fill: 'var(--md-sys-color-surface)', stroke: 'var(--md-sys-color-primary)', width: e / 250, dash: `${e / 60} ${e / 90}` }, inside.centre)\n : nothing}\n ${sides.map(s => {\n const a = at(s.from!),\n b = at(s.to!)\n const bad = marked.sides.has(s.id)\n return svg`<line x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / (bad ? 90 : 130)}\n stroke-dasharray=${bad ? `${e / 40} ${e / 80}` : ''} />\n <line side=${s.id} x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]} stroke=\"transparent\" stroke-width=${e / 25} style=\"cursor: copy\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n const made = insertAfter(this.working.points, s.from!, this.axis)\n this.change({ ...this.working, points: made.points })\n this.selected = made.id\n }}><title>${i18next.t('figure.text.section-editor-add-here', { a: pointLabel(s.from!), b: pointLabel(s.to!) })}</title></line>`\n })}\n ${pts.map(p => {\n const bad = marked.points.has(p.id),\n on = this.selected === p.id\n return svg`<g point=${p.id} style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = p.id\n this.dragging = p.id\n }}>\n <circle cx=${p[h]} cy=${p[v]} r=${e / (on ? 28 : 36)} fill=${bad ? 'var(--md-sys-color-error)' : on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-surface)'}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / 250} />\n <text x=${p[h]! + e / 22} y=${p[v]! - e / 22} font-size=${e / 16} font-weight=\"600\"\n fill=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-on-surface)'}>${pointLabel(p.id)}</text>\n </g>`\n })}\n ${w.apex\n ? svg`${pts.map(p => svg`<line x1=${p[h]} y1=${p[v]} x2=${w.apex![h]} y2=${w.apex![v]} stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 300} stroke-dasharray=${`${e / 60} ${e / 90}`} />`)}\n <g apex style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = null\n this.dragging = 'apex'\n }}>\n <rect x=${w.apex[h]! - e / 34} y=${w.apex[v]! - e / 34} width=${e / 17} height=${e / 17}\n transform=${`rotate(45 ${w.apex[h]} ${w.apex[v]})`} fill=\"var(--md-sys-color-tertiary)\" stroke=\"var(--md-sys-color-surface)\" stroke-width=${e / 250} />\n <text x=${w.apex[h]! + e / 22} y=${w.apex[v]! + e / 12} font-size=${e / 16} font-weight=\"600\" fill=\"var(--md-sys-color-on-surface)\">${i18next.t('figure.label.section-editor-apex-mark')}</text>\n <title>${i18next.t('figure.label.section-editor-apex-mark')}</title>\n </g>`\n : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : ([h, v] as const).filter(sized).map(axis => {\n const half = (w.across[axis] ?? 0) / 2\n const cx = axis === h ? half : 0,\n cy = axis === h ? 0 : half\n return svg`<g handle=${axis} style=${`cursor: ${axis === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.dragging = `handle:${axis}`\n }}>\n <rect x=${cx - e / 40} y=${cy - e / 40} width=${e / 20} height=${e / 20} rx=${e / 120}\n fill=\"var(--md-sys-color-surface)\" stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 200} />\n <text x=${cx + e / 28} y=${cy - e / 28} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface)\">${Math.round((w.across[axis] ?? 0) * 10) / 10}</text>\n <title>${i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() })}</title>\n </g>`\n })}`}\n </svg>`\n }\n\n /** A millimetre field: committed to the working state on change, a bad number put back. */\n private field(label: string, now: number, set: (value: number) => void, disabled = false, note = '') {\n return html`<label mm>\n <span>${label}</span>\n <input\n type=\"number\"\n step=\"any\"\n min=\"0\"\n inputmode=\"decimal\"\n aria-label=${label}\n .value=${live(String(Math.round(now * 1000) / 1000))}\n ?disabled=${disabled}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(now)\n return\n }\n set(value)\n }}\n />\n ${note ? html`<small>${note}</small>` : nothing}\n </label>`\n }\n\n /** A drawn section's end: the section again (a push) or one point (a pyramid), and where that point is. */\n private apexFields() {\n const [h, v] = SCREEN[this.axis]\n const apex = this.working.apex\n /* The kernel's refusal holds only for turning a push into a pyramid; a pyramid can always be made a push again. */\n const blocked = !apex && !this.opened?.apex ? this.pointBlocked : ''\n return html`<label apex>\n <input\n type=\"checkbox\"\n .checked=${live(!!apex)}\n ?disabled=${!!blocked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n this.change({ ...this.working, apex: on ? (this.opened.apex ?? apexOver(this.working.points, this.axis)) : null })\n }}\n />\n <span>${i18next.t('figure.label.section-editor-apex')}</span>\n ${blocked ? html`<small>${blocked}</small>` : nothing}\n </label>\n ${apex\n ? ([h, v] as const).map(axis =>\n html`<label mm>\n <span>${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}</span>\n <input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}\n .value=${live(String(apex[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(apex[axis] ?? '')\n return\n }\n this.change({ ...this.working, apex: { ...apex, [axis]: value } })\n }}\n />\n </label>`\n )\n : nothing}`\n }\n\n /** The inside, as the section panel shows it, on the working section: on or off, what it makes, its drawing. */\n private cavityBlock(invalid: boolean) {\n const w = this.working\n const shape = workingShapeOf(this.body!.shape, w)\n return html`<div cavity>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!w.cavity)}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n const ask = cavityRequestOf(shape, {})\n const wall = typeof ask.wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, ask.wall as number])) : (ask.wall as Record<string, number>)\n this.change({ ...w, cavity: on ? { wall, start: ask.start, end: ask.end } : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n ${w.cavity && !invalid\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(shape.cavity!)}`),\n depth: String(cavityDepthOf(shape))\n })}\n </small>`\n : nothing}\n </label>\n ${w.cavity\n ? html`<figure-cavity-drawing\n .body=${{ id: this.body!.id, shape }}\n .perSide=${this.perSide}\n @command-live=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n this.preview(c && this.valid({ ...this.working, cavity: c }) ? { ...this.working, cavity: c } : this.lastValid)\n }}\n @command=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n if (c) this.change({ ...this.working, cavity: c })\n }}\n ></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}\n </div>`\n }\n\n /** The inside a drawing's set-cavity asks for, every wall written out; the drawing's commands stay in the editor. */\n private cavityOf(action: FigureAuthoringAction | null): SectionWorking['cavity'] | undefined {\n if (action?.kind !== 'set-cavity' || !action.cavity) return undefined\n const { wall, start, end } = action.cavity\n return { wall: typeof wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, wall])) : ({ ...wall } as Record<string, number>), start, end }\n }\n\n private list(issues: ReturnType<typeof workingIssuesOf>['issues'], words: ReturnType<typeof workingIssuesOf>['words']) {\n const [h, v] = SCREEN[this.axis]\n const marked = markedBy(issues)\n const m = this.measures?.measures\n return html`<div sizes>\n ${this.field(\n i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'),\n this.working.length,\n value => this.change({ ...this.working, length: value }),\n m?.[this.axis] !== 'editable',\n this.noteWords(this.axis, this.kept)\n )}\n ${this.kind === 'polygon' ? this.apexFields() : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : this.measures?.round\n ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', this.noteWords(h))\n : ([h, v] as const).map(axis =>\n this.field(\n i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }),\n this.working.across[axis] ?? 0,\n value => this.change(this.across(axis, value)),\n m?.[axis] !== 'editable',\n this.noteWords(axis)\n )\n )}\n </div>\n ${this.kind === 'polygon'\n ? html`<ol points aria-label=${i18next.t('figure.label.section-editor-points')}>\n ${this.working.points.map(\n p => html`<li ?selected=${this.selected === p.id} ?marked=${marked.points.has(p.id)} @focusin=${() => (this.selected = p.id)}>\n <b>${pointLabel(p.id)}</b>\n ${([h, v] as const).map(\n axis => html`<input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-coordinate', { point: pointLabel(p.id), axis: axis.toUpperCase() })}\n .value=${live(String(p[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(p[axis] ?? '')\n return\n }\n this.change({ ...this.working, points: movePoint(this.working.points, p.id, { [axis]: value }) })\n }}\n />`\n )}\n <button\n ?disabled=${this.working.points.length <= 3}\n title=${this.working.points.length <= 3 ? i18next.t('figure.text.section-issue-too-few') : ''}\n aria-label=${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n @click=${() => this.removePoint(p.id)}\n >\n ${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n </button>\n </li>`\n )}\n </ol>`\n : nothing}\n ${this.hollowable ? this.cavityBlock(words.length > 0) : nothing}\n ${this.note ? html`<small role=\"status\">${this.note}</small>` : nothing}\n ${words.length\n ? html`<ul issues role=\"alert\">\n ${words.map(w => html`<li>${i18next.t(w.key, w.params)}</li>`)}\n </ul>`\n : nothing}`\n }\n}\n"]}