@things-factory/figure-ui 10.1.105 → 10.1.106

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 (39) hide show
  1. package/client/modeller/canvas.ts +6 -13
  2. package/client/modeller/editor.ts +13 -2
  3. package/client/modeller/figure-cavity-drawing.ts +16 -10
  4. package/client/modeller/figure-links.ts +49 -35
  5. package/client/modeller/figure-parts.ts +3 -3
  6. package/client/modeller/figure-section-editor.ts +106 -11
  7. package/client/modeller/section-drawing.ts +27 -4
  8. package/dist-client/modeller/canvas.d.ts +0 -2
  9. package/dist-client/modeller/canvas.js +6 -17
  10. package/dist-client/modeller/canvas.js.map +1 -1
  11. package/dist-client/modeller/clips.d.ts +1 -1
  12. package/dist-client/modeller/editor.js +15 -2
  13. package/dist-client/modeller/editor.js.map +1 -1
  14. package/dist-client/modeller/figure-cavity-drawing.js +14 -8
  15. package/dist-client/modeller/figure-cavity-drawing.js.map +1 -1
  16. package/dist-client/modeller/figure-links.d.ts +2 -2
  17. package/dist-client/modeller/figure-links.js +49 -34
  18. package/dist-client/modeller/figure-links.js.map +1 -1
  19. package/dist-client/modeller/figure-parts.d.ts +2 -1
  20. package/dist-client/modeller/figure-parts.js +2 -2
  21. package/dist-client/modeller/figure-parts.js.map +1 -1
  22. package/dist-client/modeller/figure-section-editor.d.ts +13 -0
  23. package/dist-client/modeller/figure-section-editor.js +109 -9
  24. package/dist-client/modeller/figure-section-editor.js.map +1 -1
  25. package/dist-client/modeller/section-drawing.d.ts +12 -1
  26. package/dist-client/modeller/section-drawing.js +23 -3
  27. package/dist-client/modeller/section-drawing.js.map +1 -1
  28. package/dist-client/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +6 -6
  30. package/test/cavity-drawing.test.ts +5 -0
  31. package/test/command-preview.test.ts +11 -4
  32. package/test/first-minute.test.ts +6 -2
  33. package/test/layout.test.ts +11 -0
  34. package/test/section-editor.test.ts +29 -2
  35. package/translations/en.json +2 -9
  36. package/translations/ja.json +2 -9
  37. package/translations/ko.json +2 -9
  38. package/translations/ms.json +2 -9
  39. package/translations/zh.json +2 -9
@@ -157,7 +157,8 @@ let FigureCavityDrawing = class FigureCavityDrawing extends localize(i18next)(Li
157
157
  const s = e.section;
158
158
  const across = (a) => (s.kind === 'rectangle' ? s.size[a] : 2 * s.radius[a]);
159
159
  const W = 300, H = 170, pad = 26;
160
- const k = Math.min((W - 2 * pad) / across(h), (H - 2 * pad) / across(v));
160
+ /* Wider room left and right: a wall's number stands outside the section there. */
161
+ const k = Math.min((W - 2 * (pad + 10)) / across(h), (H - 2 * pad) / across(v));
161
162
  const ox = W / 2, oy = H / 2;
162
163
  const inside = figureCavitySectionOf(s, e.axis, w.wall);
163
164
  const bad = !!this.refusal || !('section' in inside);
@@ -173,16 +174,21 @@ let FigureCavityDrawing = class FigureCavityDrawing extends localize(i18next)(Li
173
174
  /* Each wall's handle sits on the inside's edge, half way along it; the value is the wall's own. */
174
175
  const handles = [`${h}-`, `${h}+`, `${v}-`, `${v}+`].map(side => {
175
176
  const a = side[0], low = side[1] === '-';
176
- const edge = (low ? -1 : 1) * (half[a] - w.wall[side] * k);
177
- const x = a === h ? ox + edge : ox, y = a === v ? oy + edge : oy;
178
- /* The number stands in the wall itself, half way through it; a wall too thin for it has it just outside. */
179
- const band = w.wall[side] * k;
180
- const mid = (low ? -1 : 1) * (half[a] - (band < 16 ? -9 : band / 2));
181
- const tx = a === h ? ox + mid : x + 14, ty = a === v ? oy + mid + 4 : y - 10;
177
+ const sign = low ? -1 : 1;
178
+ const edge = sign * (half[a] - w.wall[side] * k);
179
+ /* The two handles across a narrow inside would stand on each other: then each steps aside, the low one first. */
180
+ const room = 2 * half[a] - (w.wall[`${a}-`] + w.wall[`${a}+`]) * k;
181
+ const aside = room < 16 ? sign * 9 : 0;
182
+ const x = a === h ? ox + edge : ox + aside, y = a === v ? oy + edge : oy + aside;
183
+ /*
184
+ The number stands just past the section's outer edge on its own side, so the opposite wall's never meets it
185
+ however thin the walls or shallow the section (2026-10-02: at 70 mm deep the two walls' numbers lay on each other).
186
+ */
187
+ const tx = a === h ? ox + sign * (half[a] + 5) : ox, ty = a === v ? oy + sign * (half[a] + (low ? 5 : 13)) : oy + 4;
182
188
  return svg `<g wall=${side} style=${`cursor:${a === h ? 'ew-resize' : 'ns-resize'}`}
183
189
  @pointerdown=${(ev) => this.grab(ev, { kind: 'wall', side })}>
184
190
  <rect x=${x - 6} y=${y - 6} width="12" height="12" rx="2" style="fill:var(--md-sys-color-surface);stroke:var(--md-sys-color-primary);stroke-width:1.5" />
185
- <text typed x=${tx} y=${ty} font-size="11" text-anchor=${a === h ? 'middle' : 'start'} style="fill:var(--md-sys-color-on-surface)"
191
+ <text typed x=${tx} y=${ty} font-size="11" text-anchor=${a === h ? (low ? 'end' : 'start') : 'middle'} style="fill:var(--md-sys-color-on-surface)"
186
192
  @pointerdown=${(ev) => this.type(ev, { kind: 'wall', side }, 'top', w.wall[side])}>${mm(w.wall[side])}</text>
187
193
  <title>${i18next.t('figure.label.face-' + SIDE_FACE[side])} ${i18next.t('figure.label.section-wall')}</title>
188
194
  </g>`;
@@ -1 +1 @@
1
- {"version":3,"file":"figure-cavity-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-cavity-drawing.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,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,SA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,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACpF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;YACpB,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,GAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,IAAK,CAAC,KAAK,EAAE,IAAI,CAAC,GAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAA;YACtF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/B,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;YAC1D,OAAM;QACR,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;;AA1P+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAY;AACd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;mDAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;oDAAgB;AAG3B;IAAhB,KAAK,EAAE;;oDAAqD;AAC5C;IAAhB,KAAK,EAAE;;oDAAqB;AAGZ;IAAhB,KAAK,EAAE;;mDAA8I;AA3C3I,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA4R/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape, FigureSection } from '@hatiolab/figure-model'\nimport { cavityRefusalOf, cavityWorkingOf, END_FACE, endToggled, mm, SIDE_FACE, sideWallLimitOf, wallDragged } from './section-controls.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** A field opened by a press takes the keys at once. */\nconst focusOnRender = () => ref(el => el && requestAnimationFrame(() => (el as HTMLInputElement).select()))\ntype End = 'start' | 'end'\ntype Body = { id: string; shape: FigureEvaluatedShape }\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/**\n * 속 공간 그림 — the inside of a pushed part drawn, and edited by drawing (user 2026-10-01: 「이해와 편집이 직관적이지 않다」).\n *\n * Seen along the push, the section and its inside: a handle in the middle of each wall is dragged to its thickness,\n * every wall together unless 면마다 벽 is on. Cut along the push, the walls and the two ends: an end pressed opens or\n * closes it, a closed end's inner line is dragged to its thickness. While dragging, the figure behind shows what the\n * inside makes (`command-live`); letting go sends one `set-cavity`. What the kernel would refuse is drawn in the error\n * colour and said, by the kernel's own check, and is not sent.\n */\n@customElement('figure-cavity-drawing')\nexport class FigureCavityDrawing extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n gap: 6px;\n }\n svg {\n width: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n svg text {\n font: inherit;\n }\n small[refusal] {\n color: var(--md-sys-color-error);\n }\n div[pane] {\n position: relative;\n }\n div[pane] input {\n position: absolute;\n width: 64px;\n transform: translate(-50%, -50%);\n font: inherit;\n }\n text[typed] {\n cursor: text;\n text-decoration: underline dotted;\n }\n `\n\n @property({ attribute: false }) body?: Body\n @property({ type: Boolean }) locked = false\n /** Walls one per side: a handle moves its own wall only. */\n @property({ type: Boolean }) perSide = false\n\n /** What is being dragged, and the inside it makes; undefined when nothing is. */\n @state() private working?: ReturnType<typeof cavityWorkingOf>\n @state() private refusal = ''\n private dragging: { kind: 'wall'; side: string } | { kind: 'end'; end: End } | null = null\n /** A number pressed to be typed: which, and where on its picture (percent of the picture's box). */\n @state() private typing?: ({ kind: 'wall'; side: string } | { kind: 'end'; end: End }) & { x: number; y: number; pane: 'top' | 'side'; value: number }\n private pressedAt = 0\n\n private get now() {\n return this.working ?? (this.body ? cavityWorkingOf(this.body.shape) : undefined)\n }\n\n private request(w: NonNullable<ReturnType<typeof cavityWorkingOf>>): FigureCavityRequest {\n return { wall: { ...w.wall }, start: w.start, end: w.end }\n }\n\n private action(w: NonNullable<ReturnType<typeof cavityWorkingOf>>): FigureAuthoringAction {\n return { kind: 'set-cavity', part: this.body!.id, cavity: this.request(w) }\n }\n\n /** What the kernel would refuse, in words; for one side's wall, the most that side can be with the opposite kept. */\n private judge(w: NonNullable<ReturnType<typeof cavityWorkingOf>>, side?: string): string {\n const ask = cavityRefusalOf(this.body!.shape, this.request(w))\n if (!ask) return ''\n if (ask.code === 'wall-too-thick')\n return i18next.t('figure.text.section-wall-over', {\n max: String(this.perSide && side ? mm(sideWallLimitOf(this.body!.shape, w.wall, side)) : ask.max)\n })\n if (ask.code === 'ends-too-thick') return i18next.t('figure.text.section-ends-over', { max: String(ask.max) })\n return i18next.t('figure.text.section-not-positive')\n }\n\n /** The working inside while dragging: drawn, judged, and previewed behind when the kernel would take it. */\n private hold(w: NonNullable<ReturnType<typeof cavityWorkingOf>>, side?: string) {\n this.working = w\n this.refusal = this.judge(w, side)\n this.emit('command-live', this.refusal ? null : this.action(w))\n }\n\n private release() {\n const w = this.working\n this.dragging = null\n this.working = undefined\n if (!w) return\n /* Refused: nothing is sent, and the reason stays said until the next drag -- letting go must not look like taking it. */\n if (this.refusal) {\n this.emit('command-live', null)\n return\n }\n this.emit('command', this.action(w))\n }\n\n private emit(name: 'command' | 'command-live', action: FigureAuthoringAction | null) {\n this.dispatchEvent(new CustomEvent(name, { detail: { action }, bubbles: true, composed: true }))\n }\n\n private point(ev: PointerEvent, el: SVGSVGElement) {\n const pt = el.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n return pt.matrixTransform(el.getScreenCTM()!.inverse())\n }\n\n render() {\n const e = this.body?.shape.extrusion\n const w = this.now\n if (!e || !w || (e.section.kind !== 'rectangle' && e.section.kind !== 'ellipse')) return nothing\n return html`<div pane>${this.top(e, w)}${this.typing?.pane === 'top' ? this.renderTyping() : nothing}</div>\n <div pane>${this.side(e, w)}${this.typing?.pane === 'side' ? this.renderTyping() : nothing}</div>\n ${this.refusal ? html`<small refusal role=\"alert\">${this.refusal}</small>` : nothing}`\n }\n\n /** Press a number, type it, Enter: the same one set-cavity a drag sends; Esc or leaving puts it back. */\n private type(ev: PointerEvent, what: { kind: 'wall'; side: string } | { kind: 'end'; end: End }, pane: 'top' | 'side', value: number) {\n if (this.locked) return\n ev.stopPropagation()\n const svgEl = (ev.target as Element).closest('svg')!\n const box = svgEl.getBoundingClientRect()\n this.refusal = ''\n this.typing = { ...what, pane, value, x: ((ev.clientX - box.left) / box.width) * 100, y: ((ev.clientY - box.top) / box.height) * 100 }\n }\n\n private renderTyping() {\n const t = this.typing!\n return html`<input type=\"number\" step=\"1\" min=\"1\" .value=${String(t.value)} style=${`left:${t.x}%;top:${t.y}%`}\n aria-label=${t.kind === 'wall' ? i18next.t('figure.label.section-wall') : i18next.t('figure.label.face-' + END_FACE(this.body!.shape.extrusion!.axis, t.end))}\n @keydown=${(ev: KeyboardEvent) => {\n ev.stopPropagation()\n if (ev.key === 'Escape') this.typing = undefined\n if (ev.key !== 'Enter') return\n const value = Number((ev.target as HTMLInputElement).value)\n this.typing = undefined\n if (!(Number.isFinite(value) && value > 0)) return\n const now = this.now!\n const next = t.kind === 'wall' ? { ...now, wall: wallDragged(now.wall, t.side, value, this.perSide) } : { ...now, [t.end]: { closed: Math.round(value) } }\n this.refusal = this.judge(next, t.kind === 'wall' ? t.side : undefined)\n if (!this.refusal) this.emit('command', this.action(next))\n }}\n @blur=${() => (this.typing = undefined)}\n ${focusOnRender()} />`\n }\n\n /** Seen along the push: the section, its inside and a handle on each wall. */\n private top(e: NonNullable<FigureEvaluatedShape['extrusion']>, w: NonNullable<ReturnType<typeof cavityWorkingOf>>) {\n const [h, v] = SCREEN[e.axis]\n const s = e.section\n const across = (a: Axis) => (s.kind === 'rectangle' ? s.size[a]! : 2 * (s as { radius: Record<string, number> }).radius[a]!)\n const W = 300,\n H = 170,\n pad = 26\n const k = Math.min((W - 2 * pad) / across(h), (H - 2 * pad) / across(v))\n const ox = W / 2,\n oy = H / 2\n const inside = figureCavitySectionOf(s as FigureSection, e.axis, w.wall)\n const bad = !!this.refusal || !('section' in inside)\n const shape = (sec: FigureSection, c: Partial<Record<Axis, number>>, attrs: string) => {\n const cx = ox + (c[h] ?? 0) * k,\n cy = oy + (c[v] ?? 0) * k\n if (sec.kind === 'ellipse') return svg`<ellipse cx=${cx} cy=${cy} rx=${sec.radius[h]! * k} ry=${sec.radius[v]! * k} style=${attrs} />`\n const r = sec as { size: Record<string, number>; corner?: Record<string, number> }\n return svg`<rect x=${cx - (r.size[h]! * k) / 2} y=${cy - (r.size[v]! * k) / 2} width=${r.size[h]! * k} height=${r.size[v]! * k}\n rx=${(r.corner?.[h] ?? 0) * k} ry=${(r.corner?.[v] ?? 0) * k} style=${attrs} />`\n }\n const half = { [h]: (across(h) * k) / 2, [v]: (across(v) * k) / 2 } as Record<Axis, number>\n /* Each wall's handle sits on the inside's edge, half way along it; the value is the wall's own. */\n const handles = [`${h}-`, `${h}+`, `${v}-`, `${v}+`].map(side => {\n const a = side[0] as Axis,\n low = side[1] === '-'\n const edge = (low ? -1 : 1) * (half[a] - w.wall[side]! * k)\n const x = a === h ? ox + edge : ox,\n y = a === v ? oy + edge : oy\n /* The number stands in the wall itself, half way through it; a wall too thin for it has it just outside. */\n const band = w.wall[side]! * k\n const mid = (low ? -1 : 1) * (half[a] - (band < 16 ? -9 : band / 2))\n const tx = a === h ? ox + mid : x + 14,\n ty = a === v ? oy + mid + 4 : y - 10\n return svg`<g wall=${side} style=${`cursor:${a === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => this.grab(ev, { kind: 'wall', side })}>\n <rect x=${x - 6} y=${y - 6} width=\"12\" height=\"12\" rx=\"2\" style=\"fill:var(--md-sys-color-surface);stroke:var(--md-sys-color-primary);stroke-width:1.5\" />\n <text typed x=${tx} y=${ty} font-size=\"11\" text-anchor=${a === h ? 'middle' : 'start'} style=\"fill:var(--md-sys-color-on-surface)\"\n @pointerdown=${(ev: PointerEvent) => this.type(ev, { kind: 'wall', side }, 'top', w.wall[side]!)}>${mm(w.wall[side]!)}</text>\n <title>${i18next.t('figure.label.face-' + SIDE_FACE[side])} ${i18next.t('figure.label.section-wall')}</title>\n </g>`\n })\n return svg`<svg viewBox=${`0 0 ${W} ${H}`} role=\"img\" aria-label=${i18next.t('figure.label.section-cavity-top')}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, e, k, ox, oy, half)}\n @pointerup=${() => this.release()} @pointercancel=${() => this.release()}>\n ${shape(s as FigureSection, {}, 'fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.5')}\n ${'section' in inside\n ? shape(inside.section, inside.centre, `fill:var(--md-sys-color-surface);stroke:${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'};stroke-width:1.2;stroke-dasharray:4 3`)\n : nothing}\n ${this.locked ? nothing : handles}\n </svg>`\n }\n\n /** Cut along the push: the walls across the first plane axis, and the two ends -- pressed to open or close. */\n private side(e: NonNullable<FigureEvaluatedShape['extrusion']>, w: NonNullable<ReturnType<typeof cavityWorkingOf>>) {\n const [h] = SCREEN[e.axis]\n const s = e.section\n const width = s.kind === 'rectangle' ? s.size[h]! : 2 * (s as { radius: Record<string, number> }).radius[h]!\n const length = e.end - e.start\n const W = 300,\n H = 170,\n padX = 40,\n padY = 26\n const k = Math.min((W - 2 * padX) / width, (H - 2 * padY) / length)\n const x0 = W / 2 - (width * k) / 2,\n x1 = W / 2 + (width * k) / 2,\n yTop = H / 2 - (length * k) / 2,\n yBot = H / 2 + (length * k) / 2\n const wl = w.wall[`${h}-`]! * k,\n wr = w.wall[`${h}+`]! * k\n const thick = (end: End) => (w[end] === 'open' ? 0 : (w[end] as { closed: number }).closed * k)\n /* The push's start is drawn at the bottom: a tote stands on its floor. */\n const floor = thick('start'),\n lid = thick('end')\n const fill = 'fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.2'\n const endZone = (end: End, y: number, t: number) => {\n const open = w[end] === 'open'\n const words = open\n ? i18next.t('figure.label.section-end-open')\n : `${i18next.t('figure.label.section-end-closed')} ${mm((w[end] as { closed: number }).closed)}`\n const label = `${i18next.t('figure.label.face-' + END_FACE(e.axis, end))}: ${words}`\n const inner = end === 'start' ? y - t : y + t\n return svg`<g end=${end} style=${`cursor:${open ? 'pointer' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => this.grab(ev, { kind: 'end', end })}>\n <rect x=${x0 + wl} y=${Math.min(y, inner) - 8} width=${x1 - x0 - wl - wr} height=${Math.abs(t) + 16} style=\"fill:transparent\" />\n ${open ? svg`<line x1=${x0 + wl} y1=${y} x2=${x1 - wr} y2=${y} style=\"stroke:var(--md-sys-color-outline);stroke-dasharray:3 3\" />` : nothing}\n <text ?typed=${!open} x=${W / 2} y=${end === 'start' ? yBot + 16 : yTop - 8} font-size=\"11\" text-anchor=\"middle\" style=\"fill:var(--md-sys-color-primary)\"\n @pointerdown=${(ev: PointerEvent) => !open && this.type(ev, { kind: 'end', end }, 'side', (w[end] as { closed: number }).closed)}>${label}</text>\n <title>${label}</title>\n </g>`\n }\n return svg`<svg viewBox=${`0 0 ${W} ${H + 8}`} role=\"img\" aria-label=${i18next.t('figure.label.section-cavity-side')}\n @pointermove=${(ev: PointerEvent) => this.dragEnd(ev, k, yTop, yBot)}\n @pointerup=${(ev: PointerEvent) => this.releaseEnd(ev)} @pointercancel=${() => this.release()}>\n <rect x=${x0} y=${yTop} width=${wl} height=${yBot - yTop} style=${fill} />\n <rect x=${x1 - wr} y=${yTop} width=${wr} height=${yBot - yTop} style=${fill} />\n ${floor ? svg`<rect x=${x0 + wl} y=${yBot - floor} width=${x1 - x0 - wl - wr} height=${floor} style=${fill} />` : nothing}\n ${lid ? svg`<rect x=${x0 + wl} y=${yTop} width=${x1 - x0 - wl - wr} height=${lid} style=${fill} />` : nothing}\n ${this.locked ? nothing : [endZone('start', yBot, floor), endZone('end', yTop, lid)]}\n </svg>`\n }\n\n private grab(ev: PointerEvent, what: NonNullable<FigureCavityDrawing['dragging']>) {\n if (this.locked) return\n ev.stopPropagation()\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragging = what\n this.pressedAt = ev.clientY\n this.refusal = ''\n }\n\n private drag(ev: PointerEvent, e: NonNullable<FigureEvaluatedShape['extrusion']>, k: number, ox: number, oy: number, half: Record<Axis, number>) {\n const d = this.dragging\n if (d?.kind !== 'wall') return\n const [h] = SCREEN[e.axis]\n const p = this.point(ev, ev.currentTarget as SVGSVGElement)\n const a = d.side[0] as Axis,\n low = d.side[1] === '-'\n const at = a === h ? p.x - ox : p.y - oy\n const value = (half[a] - (low ? -at : at)) / k\n this.hold({ ...this.now!, wall: wallDragged(this.now!.wall, d.side, value, this.perSide) }, d.side)\n }\n\n private dragEnd(ev: PointerEvent, k: number, yTop: number, yBot: number) {\n const d = this.dragging\n if (d?.kind !== 'end' || this.now![d.end] === 'open') return\n if (Math.abs(ev.clientY - this.pressedAt) < 3 && !this.working) return\n const p = this.point(ev, ev.currentTarget as SVGSVGElement)\n const t = d.end === 'start' ? (yBot - p.y) / k : (p.y - yTop) / k\n this.hold({ ...this.now!, [d.end]: { closed: Math.max(1, Math.round(t)) } })\n }\n\n /** A press on an end that did not move is a toggle; a drag was a thickness. */\n private releaseEnd(ev: PointerEvent) {\n const d = this.dragging\n if (d?.kind === 'end' && !this.working && Math.abs(ev.clientY - this.pressedAt) < 3) {\n this.dragging = null\n const next = { ...this.now!, [d.end]: endToggled(this.body!.shape, this.now![d.end]) }\n this.refusal = this.judge(next)\n if (!this.refusal) this.emit('command', this.action(next))\n return\n }\n this.release()\n }\n}\n\n"]}
1
+ {"version":3,"file":"figure-cavity-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-cavity-drawing.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,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI3I,wDAAwD;AACxD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,qBAAqB,CAAC,GAAG,EAAE,CAAE,EAAuB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAI3G,6GAA6G;AAC7G,MAAM,MAAM,GAA+B,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;AAE1F;;;;;;;;GAQG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA/D;;QAkCwB,WAAM,GAAG,KAAK,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I,CAAC,GAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAA;YACtF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/B,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;YAC1D,OAAM;QACR,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;;AAhQ+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAY;AACd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;mDAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;oDAAgB;AAG3B;IAAhB,KAAK,EAAE;;oDAAqD;AAC5C;IAAhB,KAAK,EAAE;;oDAAqB;AAGZ;IAAhB,KAAK,EAAE;;mDAA8I;AA3C3I,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAkS/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape, FigureSection } from '@hatiolab/figure-model'\nimport { cavityRefusalOf, cavityWorkingOf, END_FACE, endToggled, mm, SIDE_FACE, sideWallLimitOf, wallDragged } from './section-controls.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** A field opened by a press takes the keys at once. */\nconst focusOnRender = () => ref(el => el && requestAnimationFrame(() => (el as HTMLInputElement).select()))\ntype End = 'start' | 'end'\ntype Body = { id: string; shape: FigureEvaluatedShape }\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/**\n * 속 공간 그림 — the inside of a pushed part drawn, and edited by drawing (user 2026-10-01: 「이해와 편집이 직관적이지 않다」).\n *\n * Seen along the push, the section and its inside: a handle in the middle of each wall is dragged to its thickness,\n * every wall together unless 면마다 벽 is on. Cut along the push, the walls and the two ends: an end pressed opens or\n * closes it, a closed end's inner line is dragged to its thickness. While dragging, the figure behind shows what the\n * inside makes (`command-live`); letting go sends one `set-cavity`. What the kernel would refuse is drawn in the error\n * colour and said, by the kernel's own check, and is not sent.\n */\n@customElement('figure-cavity-drawing')\nexport class FigureCavityDrawing extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n gap: 6px;\n }\n svg {\n width: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n svg text {\n font: inherit;\n }\n small[refusal] {\n color: var(--md-sys-color-error);\n }\n div[pane] {\n position: relative;\n }\n div[pane] input {\n position: absolute;\n width: 64px;\n transform: translate(-50%, -50%);\n font: inherit;\n }\n text[typed] {\n cursor: text;\n text-decoration: underline dotted;\n }\n `\n\n @property({ attribute: false }) body?: Body\n @property({ type: Boolean }) locked = false\n /** Walls one per side: a handle moves its own wall only. */\n @property({ type: Boolean }) perSide = false\n\n /** What is being dragged, and the inside it makes; undefined when nothing is. */\n @state() private working?: ReturnType<typeof cavityWorkingOf>\n @state() private refusal = ''\n private dragging: { kind: 'wall'; side: string } | { kind: 'end'; end: End } | null = null\n /** A number pressed to be typed: which, and where on its picture (percent of the picture's box). */\n @state() private typing?: ({ kind: 'wall'; side: string } | { kind: 'end'; end: End }) & { x: number; y: number; pane: 'top' | 'side'; value: number }\n private pressedAt = 0\n\n private get now() {\n return this.working ?? (this.body ? cavityWorkingOf(this.body.shape) : undefined)\n }\n\n private request(w: NonNullable<ReturnType<typeof cavityWorkingOf>>): FigureCavityRequest {\n return { wall: { ...w.wall }, start: w.start, end: w.end }\n }\n\n private action(w: NonNullable<ReturnType<typeof cavityWorkingOf>>): FigureAuthoringAction {\n return { kind: 'set-cavity', part: this.body!.id, cavity: this.request(w) }\n }\n\n /** What the kernel would refuse, in words; for one side's wall, the most that side can be with the opposite kept. */\n private judge(w: NonNullable<ReturnType<typeof cavityWorkingOf>>, side?: string): string {\n const ask = cavityRefusalOf(this.body!.shape, this.request(w))\n if (!ask) return ''\n if (ask.code === 'wall-too-thick')\n return i18next.t('figure.text.section-wall-over', {\n max: String(this.perSide && side ? mm(sideWallLimitOf(this.body!.shape, w.wall, side)) : ask.max)\n })\n if (ask.code === 'ends-too-thick') return i18next.t('figure.text.section-ends-over', { max: String(ask.max) })\n return i18next.t('figure.text.section-not-positive')\n }\n\n /** The working inside while dragging: drawn, judged, and previewed behind when the kernel would take it. */\n private hold(w: NonNullable<ReturnType<typeof cavityWorkingOf>>, side?: string) {\n this.working = w\n this.refusal = this.judge(w, side)\n this.emit('command-live', this.refusal ? null : this.action(w))\n }\n\n private release() {\n const w = this.working\n this.dragging = null\n this.working = undefined\n if (!w) return\n /* Refused: nothing is sent, and the reason stays said until the next drag -- letting go must not look like taking it. */\n if (this.refusal) {\n this.emit('command-live', null)\n return\n }\n this.emit('command', this.action(w))\n }\n\n private emit(name: 'command' | 'command-live', action: FigureAuthoringAction | null) {\n this.dispatchEvent(new CustomEvent(name, { detail: { action }, bubbles: true, composed: true }))\n }\n\n private point(ev: PointerEvent, el: SVGSVGElement) {\n const pt = el.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n return pt.matrixTransform(el.getScreenCTM()!.inverse())\n }\n\n render() {\n const e = this.body?.shape.extrusion\n const w = this.now\n if (!e || !w || (e.section.kind !== 'rectangle' && e.section.kind !== 'ellipse')) return nothing\n return html`<div pane>${this.top(e, w)}${this.typing?.pane === 'top' ? this.renderTyping() : nothing}</div>\n <div pane>${this.side(e, w)}${this.typing?.pane === 'side' ? this.renderTyping() : nothing}</div>\n ${this.refusal ? html`<small refusal role=\"alert\">${this.refusal}</small>` : nothing}`\n }\n\n /** Press a number, type it, Enter: the same one set-cavity a drag sends; Esc or leaving puts it back. */\n private type(ev: PointerEvent, what: { kind: 'wall'; side: string } | { kind: 'end'; end: End }, pane: 'top' | 'side', value: number) {\n if (this.locked) return\n ev.stopPropagation()\n const svgEl = (ev.target as Element).closest('svg')!\n const box = svgEl.getBoundingClientRect()\n this.refusal = ''\n this.typing = { ...what, pane, value, x: ((ev.clientX - box.left) / box.width) * 100, y: ((ev.clientY - box.top) / box.height) * 100 }\n }\n\n private renderTyping() {\n const t = this.typing!\n return html`<input type=\"number\" step=\"1\" min=\"1\" .value=${String(t.value)} style=${`left:${t.x}%;top:${t.y}%`}\n aria-label=${t.kind === 'wall' ? i18next.t('figure.label.section-wall') : i18next.t('figure.label.face-' + END_FACE(this.body!.shape.extrusion!.axis, t.end))}\n @keydown=${(ev: KeyboardEvent) => {\n ev.stopPropagation()\n if (ev.key === 'Escape') this.typing = undefined\n if (ev.key !== 'Enter') return\n const value = Number((ev.target as HTMLInputElement).value)\n this.typing = undefined\n if (!(Number.isFinite(value) && value > 0)) return\n const now = this.now!\n const next = t.kind === 'wall' ? { ...now, wall: wallDragged(now.wall, t.side, value, this.perSide) } : { ...now, [t.end]: { closed: Math.round(value) } }\n this.refusal = this.judge(next, t.kind === 'wall' ? t.side : undefined)\n if (!this.refusal) this.emit('command', this.action(next))\n }}\n @blur=${() => (this.typing = undefined)}\n ${focusOnRender()} />`\n }\n\n /** Seen along the push: the section, its inside and a handle on each wall. */\n private top(e: NonNullable<FigureEvaluatedShape['extrusion']>, w: NonNullable<ReturnType<typeof cavityWorkingOf>>) {\n const [h, v] = SCREEN[e.axis]\n const s = e.section\n const across = (a: Axis) => (s.kind === 'rectangle' ? s.size[a]! : 2 * (s as { radius: Record<string, number> }).radius[a]!)\n const W = 300,\n H = 170,\n pad = 26\n /* Wider room left and right: a wall's number stands outside the section there. */\n const k = Math.min((W - 2 * (pad + 10)) / across(h), (H - 2 * pad) / across(v))\n const ox = W / 2,\n oy = H / 2\n const inside = figureCavitySectionOf(s as FigureSection, e.axis, w.wall)\n const bad = !!this.refusal || !('section' in inside)\n const shape = (sec: FigureSection, c: Partial<Record<Axis, number>>, attrs: string) => {\n const cx = ox + (c[h] ?? 0) * k,\n cy = oy + (c[v] ?? 0) * k\n if (sec.kind === 'ellipse') return svg`<ellipse cx=${cx} cy=${cy} rx=${sec.radius[h]! * k} ry=${sec.radius[v]! * k} style=${attrs} />`\n const r = sec as { size: Record<string, number>; corner?: Record<string, number> }\n return svg`<rect x=${cx - (r.size[h]! * k) / 2} y=${cy - (r.size[v]! * k) / 2} width=${r.size[h]! * k} height=${r.size[v]! * k}\n rx=${(r.corner?.[h] ?? 0) * k} ry=${(r.corner?.[v] ?? 0) * k} style=${attrs} />`\n }\n const half = { [h]: (across(h) * k) / 2, [v]: (across(v) * k) / 2 } as Record<Axis, number>\n /* Each wall's handle sits on the inside's edge, half way along it; the value is the wall's own. */\n const handles = [`${h}-`, `${h}+`, `${v}-`, `${v}+`].map(side => {\n const a = side[0] as Axis,\n low = side[1] === '-'\n const sign = low ? -1 : 1\n const edge = sign * (half[a] - w.wall[side]! * k)\n /* The two handles across a narrow inside would stand on each other: then each steps aside, the low one first. */\n const room = 2 * half[a] - (w.wall[`${a}-`]! + w.wall[`${a}+`]!) * k\n const aside = room < 16 ? sign * 9 : 0\n const x = a === h ? ox + edge : ox + aside,\n y = a === v ? oy + edge : oy + aside\n /*\n The number stands just past the section's outer edge on its own side, so the opposite wall's never meets it\n however thin the walls or shallow the section (2026-10-02: at 70 mm deep the two walls' numbers lay on each other).\n */\n const tx = a === h ? ox + sign * (half[a] + 5) : ox,\n ty = a === v ? oy + sign * (half[a] + (low ? 5 : 13)) : oy + 4\n return svg`<g wall=${side} style=${`cursor:${a === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => this.grab(ev, { kind: 'wall', side })}>\n <rect x=${x - 6} y=${y - 6} width=\"12\" height=\"12\" rx=\"2\" style=\"fill:var(--md-sys-color-surface);stroke:var(--md-sys-color-primary);stroke-width:1.5\" />\n <text typed x=${tx} y=${ty} font-size=\"11\" text-anchor=${a === h ? (low ? 'end' : 'start') : 'middle'} style=\"fill:var(--md-sys-color-on-surface)\"\n @pointerdown=${(ev: PointerEvent) => this.type(ev, { kind: 'wall', side }, 'top', w.wall[side]!)}>${mm(w.wall[side]!)}</text>\n <title>${i18next.t('figure.label.face-' + SIDE_FACE[side])} ${i18next.t('figure.label.section-wall')}</title>\n </g>`\n })\n return svg`<svg viewBox=${`0 0 ${W} ${H}`} role=\"img\" aria-label=${i18next.t('figure.label.section-cavity-top')}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, e, k, ox, oy, half)}\n @pointerup=${() => this.release()} @pointercancel=${() => this.release()}>\n ${shape(s as FigureSection, {}, 'fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.5')}\n ${'section' in inside\n ? shape(inside.section, inside.centre, `fill:var(--md-sys-color-surface);stroke:${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'};stroke-width:1.2;stroke-dasharray:4 3`)\n : nothing}\n ${this.locked ? nothing : handles}\n </svg>`\n }\n\n /** Cut along the push: the walls across the first plane axis, and the two ends -- pressed to open or close. */\n private side(e: NonNullable<FigureEvaluatedShape['extrusion']>, w: NonNullable<ReturnType<typeof cavityWorkingOf>>) {\n const [h] = SCREEN[e.axis]\n const s = e.section\n const width = s.kind === 'rectangle' ? s.size[h]! : 2 * (s as { radius: Record<string, number> }).radius[h]!\n const length = e.end - e.start\n const W = 300,\n H = 170,\n padX = 40,\n padY = 26\n const k = Math.min((W - 2 * padX) / width, (H - 2 * padY) / length)\n const x0 = W / 2 - (width * k) / 2,\n x1 = W / 2 + (width * k) / 2,\n yTop = H / 2 - (length * k) / 2,\n yBot = H / 2 + (length * k) / 2\n const wl = w.wall[`${h}-`]! * k,\n wr = w.wall[`${h}+`]! * k\n const thick = (end: End) => (w[end] === 'open' ? 0 : (w[end] as { closed: number }).closed * k)\n /* The push's start is drawn at the bottom: a tote stands on its floor. */\n const floor = thick('start'),\n lid = thick('end')\n const fill = 'fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.2'\n const endZone = (end: End, y: number, t: number) => {\n const open = w[end] === 'open'\n const words = open\n ? i18next.t('figure.label.section-end-open')\n : `${i18next.t('figure.label.section-end-closed')} ${mm((w[end] as { closed: number }).closed)}`\n const label = `${i18next.t('figure.label.face-' + END_FACE(e.axis, end))}: ${words}`\n const inner = end === 'start' ? y - t : y + t\n return svg`<g end=${end} style=${`cursor:${open ? 'pointer' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => this.grab(ev, { kind: 'end', end })}>\n <rect x=${x0 + wl} y=${Math.min(y, inner) - 8} width=${x1 - x0 - wl - wr} height=${Math.abs(t) + 16} style=\"fill:transparent\" />\n ${open ? svg`<line x1=${x0 + wl} y1=${y} x2=${x1 - wr} y2=${y} style=\"stroke:var(--md-sys-color-outline);stroke-dasharray:3 3\" />` : nothing}\n <text ?typed=${!open} x=${W / 2} y=${end === 'start' ? yBot + 16 : yTop - 8} font-size=\"11\" text-anchor=\"middle\" style=\"fill:var(--md-sys-color-primary)\"\n @pointerdown=${(ev: PointerEvent) => !open && this.type(ev, { kind: 'end', end }, 'side', (w[end] as { closed: number }).closed)}>${label}</text>\n <title>${label}</title>\n </g>`\n }\n return svg`<svg viewBox=${`0 0 ${W} ${H + 8}`} role=\"img\" aria-label=${i18next.t('figure.label.section-cavity-side')}\n @pointermove=${(ev: PointerEvent) => this.dragEnd(ev, k, yTop, yBot)}\n @pointerup=${(ev: PointerEvent) => this.releaseEnd(ev)} @pointercancel=${() => this.release()}>\n <rect x=${x0} y=${yTop} width=${wl} height=${yBot - yTop} style=${fill} />\n <rect x=${x1 - wr} y=${yTop} width=${wr} height=${yBot - yTop} style=${fill} />\n ${floor ? svg`<rect x=${x0 + wl} y=${yBot - floor} width=${x1 - x0 - wl - wr} height=${floor} style=${fill} />` : nothing}\n ${lid ? svg`<rect x=${x0 + wl} y=${yTop} width=${x1 - x0 - wl - wr} height=${lid} style=${fill} />` : nothing}\n ${this.locked ? nothing : [endZone('start', yBot, floor), endZone('end', yTop, lid)]}\n </svg>`\n }\n\n private grab(ev: PointerEvent, what: NonNullable<FigureCavityDrawing['dragging']>) {\n if (this.locked) return\n ev.stopPropagation()\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragging = what\n this.pressedAt = ev.clientY\n this.refusal = ''\n }\n\n private drag(ev: PointerEvent, e: NonNullable<FigureEvaluatedShape['extrusion']>, k: number, ox: number, oy: number, half: Record<Axis, number>) {\n const d = this.dragging\n if (d?.kind !== 'wall') return\n const [h] = SCREEN[e.axis]\n const p = this.point(ev, ev.currentTarget as SVGSVGElement)\n const a = d.side[0] as Axis,\n low = d.side[1] === '-'\n const at = a === h ? p.x - ox : p.y - oy\n const value = (half[a] - (low ? -at : at)) / k\n this.hold({ ...this.now!, wall: wallDragged(this.now!.wall, d.side, value, this.perSide) }, d.side)\n }\n\n private dragEnd(ev: PointerEvent, k: number, yTop: number, yBot: number) {\n const d = this.dragging\n if (d?.kind !== 'end' || this.now![d.end] === 'open') return\n if (Math.abs(ev.clientY - this.pressedAt) < 3 && !this.working) return\n const p = this.point(ev, ev.currentTarget as SVGSVGElement)\n const t = d.end === 'start' ? (yBot - p.y) / k : (p.y - yTop) / k\n this.hold({ ...this.now!, [d.end]: { closed: Math.max(1, Math.round(t)) } })\n }\n\n /** A press on an end that did not move is a toggle; a drag was a thickness. */\n private releaseEnd(ev: PointerEvent) {\n const d = this.dragging\n if (d?.kind === 'end' && !this.working && Math.abs(ev.clientY - this.pressedAt) < 3) {\n this.dragging = null\n const next = { ...this.now!, [d.end]: endToggled(this.body!.shape, this.now![d.end]) }\n this.refusal = this.judge(next)\n if (!this.refusal) this.emit('command', this.action(next))\n return\n }\n this.release()\n }\n}\n\n"]}
@@ -74,8 +74,8 @@ export declare class FigureLinks extends FigureLinks_base {
74
74
  * attached" while it was selected, so the form still held what it had before (designer 2026-09-27: it opened the
75
75
  * holding places instead).
76
76
  */
77
- /** The fastening's details open, focus in them: where the gap and the place across the face are changed. */
78
- private openDetail;
77
+ /** The face the part sits on, in view with the focus on it: where the place across the face is dragged or keyed. */
78
+ private showWhere;
79
79
  /** The fastening form, open on this part and in view: for "fasten it first" from elsewhere. */
80
80
  showFastening(): Promise<void>;
81
81
  private openFastening;
@@ -103,6 +103,10 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
103
103
  p[fasten-mode] { margin: 0; font-weight: 600; }
104
104
  section[fastening][spotlit] { outline: 2px solid var(--md-sys-color-primary, #477b9e); outline-offset: 4px; border-radius: 6px; transition: outline-color 0.3s; }
105
105
  details { margin-top: 8px; }
106
+ details[row-fold] { margin: 0; }
107
+ details[row-fold] > summary { padding: 0; color: var(--md-sys-color-on-surface); }
108
+ details[row-fold] > summary h3 { margin: 0; }
109
+ details[row-fold][open] > summary { margin-bottom: 8px; }
106
110
  /* What the command would do, said beside the result drawn on the canvas. */
107
111
  ul[preview-words] { margin: 8px 0; padding: 8px 12px 8px 26px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); display: grid; gap: 4px; }
108
112
  p[preview-words] { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); }
@@ -320,16 +324,15 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
320
324
  * attached" while it was selected, so the form still held what it had before (designer 2026-09-27: it opened the
321
325
  * holding places instead).
322
326
  */
323
- /** The fastening's details open, focus in them: where the gap and the place across the face are changed. */
324
- async openDetail() {
325
- const detail = this.renderRoot.querySelector('details[fasten-detail]');
326
- if (!detail)
327
- return;
328
- detail.open = true;
327
+ /** The face the part sits on, in view with the focus on it: where the place across the face is dragged or keyed. */
328
+ async showWhere() {
329
329
  this.working = 'fasten';
330
330
  await this.updateComplete;
331
- detail.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
332
- detail.querySelector('select, input')?.focus({ preventScroll: true });
331
+ const where = this.renderRoot.querySelector('figure-fasten-drawing')?.shadowRoot?.querySelector('div[where]');
332
+ if (!where)
333
+ return;
334
+ where.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
335
+ where.focus({ preventScroll: true });
333
336
  }
334
337
  /** The fastening form, open on this part and in view: for "fasten it first" from elsewhere. */
335
338
  async showFastening() {
@@ -471,17 +474,20 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
471
474
  : undefined;
472
475
  if (action)
473
476
  this.fastenCandidate = { action, ...(f.toPlane ? {} : { face: { part: f.target, face: targetFace } }) };
474
- /* What the details hold that is not their default, and where on the face it sits: said while they are folded. */
477
+ /*
478
+ What the folded details hold that is not their default, said while folded; the way and the place on the face are
479
+ the drawing's, and said there (user 2026-10-02: the details had selects repeating the drawing). Nothing is said
480
+ for the default.
481
+ */
475
482
  const detail = [
476
- ...(f.facing === 'flush' && !f.toPlane ? [i18next.t('figure.label.facing-flush')] : []),
477
- ...Object.entries(align ?? {}).map(([axis, one]) => one === 'min' || one === 'max'
478
- ? i18next.t(`figure.text.fasten-summary-edge-${one}`, { axis: axis.toUpperCase() })
479
- : typeof one.mm === 'number'
480
- ? i18next.t('figure.text.fasten-summary-off-centre', { axis: axis.toUpperCase(), mm: String(Math.round(one.mm * 10) / 10) })
481
- : i18next.t('figure.text.fasten-summary-follows', { axis: axis.toUpperCase() })),
482
483
  ...(f.gap ? [i18next.t('figure.text.fasten-summary-gap', { mm: String(f.gap) })] : []),
483
484
  ...(f.twist ? [i18next.t('figure.text.fasten-summary-twist', { degrees: String(f.twist) })] : [])
484
485
  ];
486
+ /* Across the face, a row only where the drawing cannot set it: no drawing of the face, or a share or a field to follow. */
487
+ const view = f.toPlane || f.target ? faceViewOf(asset, this.partId, aim) : undefined;
488
+ const alignRows = (f.toPlane || f.target ? alignAxesOf(asset, this.partId, aim, !!f.twist) : []).filter(({ axis }) => !view || !view.axes.includes(axis) || !!f.alignInput?.[axis] || hasInstanceSize(asset, axis));
489
+ /* A fastening the part has is changed as soon as something is chosen, as the drawing does; a new one waits for 붙이기. */
490
+ const settle = () => this.onFastenRelease(!!held);
485
491
  /*
486
492
  Fastening it anew is said, so the form is not taken for the one it has (designer 2026-09-27). The one it has is
487
493
  said once, by the sentence over the drawing -- the panel's head says it too; a third and a fourth line saying the
@@ -504,7 +510,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
504
510
  ? html `<div overhang role="status">
505
511
  ${this.overhangWords.map(line => html `<p>${line}</p>`)}
506
512
  ${current
507
- ? html `<button act @click=${() => this.openDetail()}><md-icon>tune</md-icon>${i18next.t('figure.button.fix-alignment')}</button>`
513
+ ? html `<button act @click=${() => this.showWhere()}><md-icon>tune</md-icon>${i18next.t('figure.button.fix-alignment')}</button>`
508
514
  : nothing}
509
515
  </div>`
510
516
  : nothing}
@@ -521,6 +527,8 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
521
527
  <select @change=${(e) => {
522
528
  const value = e.target.value;
523
529
  this.aimAt(asset, value === PLANE ? { ...f, toPlane: true, target: '' } : { ...f, toPlane: false, target: value });
530
+ if (value)
531
+ settle();
524
532
  }}>
525
533
  <option value="" ?selected=${!f.target && !f.toPlane}>${i18next.t('figure.label.target-part-placeholder')}</option>
526
534
  <option value=${PLANE} ?selected=${f.toPlane}>${planeWord}</option>
@@ -538,7 +546,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
538
546
  .face=${targetFace}
539
547
  .modes=${f.toPlane ? ['meet'] : ([...['meet', 'flush'], ...(turnsInPlace(asset, this.partId) ? ['centre'] : [])])}
540
548
  .mode=${mode}
541
- .view=${faceViewOf(asset, this.partId, aim)}
549
+ .view=${view}
542
550
  .align=${f.align}
543
551
  .alignMm=${f.alignMm}
544
552
  .gap=${f.gap}
@@ -550,19 +558,21 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
550
558
  ></figure-fasten-drawing>`
551
559
  : html `<p hint>${i18next.t('figure.text.fasten-target-first')}</p>`}
552
560
  ${(f.toPlane || f.target) ? html `<details fasten-detail>
553
- <summary>${i18next.t('figure.label.fasten-detail')} · <span fasten-summary>${detail.length ? detail.join(' · ') : i18next.t('figure.text.fasten-summary-default')}</span></summary>
554
- ${this.renderAlignment(f.toPlane || f.target ? alignAxesOf(asset, this.partId, aim, !!f.twist) : [])}
561
+ <summary>${i18next.t('figure.label.fasten-detail')}${detail.length ? html ` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}</summary>
562
+ ${alignRows.length ? this.renderAlignment(alignRows, settle) : nothing}
555
563
  <div form>
556
564
  <span>${i18next.t('figure.label.gap')}</span>
557
- <input type="number" step="any" .value=${String(f.gap)} @change=${(e) => (this.fasten = { ...f, gap: Number(e.target.value) || 0 })} />
565
+ <input type="number" step="any" .value=${String(f.gap)} @change=${(e) => ((this.fasten = { ...f, gap: Number(e.target.value) || 0 }), settle())} />
558
566
  <span>${i18next.t('figure.label.twist')}</span>
559
- <input type="number" step="any" .value=${String(f.twist)} @change=${(e) => (this.fasten = { ...f, twist: Number(e.target.value) || 0 })} />
567
+ <input type="number" step="any" .value=${String(f.twist)} @change=${(e) => ((this.fasten = { ...f, twist: Number(e.target.value) || 0 }), settle())} />
560
568
  </div>
561
569
  </details>
562
- ${action && this.working === 'fasten' ? this.renderPreviewWords() : nothing}
563
- <button act ?disabled=${this.locked || !action} @click=${() => action && this.command(action)}>
564
- <md-icon>link</md-icon>${i18next.t(current ? 'figure.button.fasten-update' : 'figure.button.fasten')}
565
- </button>` : nothing}
570
+ ${ /* What 붙이기 would do; a fastening the part has is changed at once, and the canvas shows it. */action && !held && this.working === 'fasten' ? this.renderPreviewWords() : nothing}
571
+ ${held
572
+ ? nothing
573
+ : html `<button act ?disabled=${this.locked || !action} @click=${() => action && this.command(action)}>
574
+ <md-icon>link</md-icon>${i18next.t('figure.button.fasten')}
575
+ </button>`}` : nothing}
566
576
  `;
567
577
  }
568
578
  /** 「lid 의 아랫면을 bin 의 윗면에 맞닿게」: what the fastening is, in one line, the part's own face said as a result. */
@@ -603,10 +613,10 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
603
613
  * Where on the target face the part sits, on the two axes across it: centred, level with the target's edge on
604
614
  * either side, or a distance off centre. A door hung level with the frame's front edge turns about that edge.
605
615
  */
606
- renderAlignment(axes) {
616
+ renderAlignment(axes, settle) {
607
617
  const f = this.fasten;
608
- const set = (axis, how) => (this.fasten = { ...f, align: { ...f.align, [axis]: how } });
609
- const setMm = (axis, mm) => (this.fasten = { ...f, alignMm: { ...f.alignMm, [axis]: mm } });
618
+ const set = (axis, how) => ((this.fasten = { ...f, align: { ...f.align, [axis]: how } }), settle());
619
+ const setMm = (axis, mm) => ((this.fasten = { ...f, alignMm: { ...f.alignMm, [axis]: mm } }), settle());
610
620
  return html `<div form>
611
621
  ${axes.map(({ axis, edges }) => {
612
622
  const how = f.align[axis] === 'min' || f.align[axis] === 'max' ? (edges ? f.align[axis] : 'centre') : (f.align[axis] ?? 'centre');
@@ -652,14 +662,19 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
652
662
  const blocked = rowBlockOf(asset, this.partId);
653
663
  const axes = rowAxesOf(asset, this.partId);
654
664
  const r = this.row;
665
+ /*
666
+ Folded, open while it is being worked (2026-10-02): a row is made now and then, and most parts stand on the plane,
667
+ where the section said its reason open on every one. Opened, it says why or asks how.
668
+ */
669
+ const head = html `<summary><h3>${i18next.t('figure.label.repeat')}</h3></summary>`;
655
670
  if (blocked || !axes.length)
656
- return html `<section row>
657
- <h3>${i18next.t('figure.label.repeat')}</h3>
671
+ return html `<section row><details row-fold>
672
+ ${head}
658
673
  <p hint row-blocked>${i18next.t(`figure.text.row-blocked-${blocked ?? 'unfastened'}`, { part: this.partId })}</p>
659
674
  ${blocked === 'unfastened'
660
675
  ? html `<button act @click=${() => this.openFastening(asset)}><md-icon>link</md-icon>${i18next.t('figure.button.go-fasten')}</button>`
661
676
  : nothing}
662
- </section>`;
677
+ </details></section>`;
663
678
  const axis = axes.includes(r.axis) ? r.axis : axes[0];
664
679
  const ok = r.fills ? r.pitch > 0 : Number.isSafeInteger(r.count) && r.count >= 1;
665
680
  const action = ok
@@ -667,8 +682,8 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
667
682
  : undefined;
668
683
  this.rowCandidate = action;
669
684
  const set = (next) => ((this.row = next), (this.working = 'row'));
670
- return html `<section row @focusin=${() => (this.working = 'row')}>
671
- <h3>${i18next.t('figure.label.repeat')}</h3>
685
+ return html `<section row @focusin=${() => (this.working = 'row')}><details row-fold ?open=${this.working === 'row'}>
686
+ ${head}
672
687
  <div form>
673
688
  <span>${i18next.t('figure.label.repeat-axis')}</span>
674
689
  <select @change=${(e) => set({ ...r, axis: e.target.value })}>
@@ -693,7 +708,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
693
708
  <button act ?disabled=${this.locked || !action} @click=${() => action && this.command(action)}>
694
709
  <md-icon>view_week</md-icon>${i18next.t('figure.button.make-repeat')}
695
710
  </button>
696
- </section>`;
711
+ </details></section>`;
697
712
  }
698
713
  /**
699
714
  * When the part is drawn: always, or while a control is at least a value -- a lamp lit while the gate is open. One