@things-factory/figure-ui 10.1.93 → 10.1.95

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.
@@ -9,6 +9,7 @@ const SEEN = [
9
9
  ['right', 'M160 30 L200 10 L200 80 L160 100 Z']
10
10
  ];
11
11
  /** The faces the drawing cannot show on the box, as tags beside it where they are. */
12
+ /* The box is drawn a little left of its picture's middle, and the viewBox shifts it back to the panel's centre. */
12
13
  const HIDDEN = [
13
14
  ['bottom', 30, 114],
14
15
  ['left', 24, 62],
@@ -68,12 +69,17 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
68
69
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
69
70
  gap: 6px;
70
71
  }
72
+ div[modes] svg {
73
+ width: 64px;
74
+ height: 44px;
75
+ }
71
76
  div[modes] button {
72
77
  display: grid;
73
78
  justify-items: center;
79
+ align-content: center;
80
+ gap: 2px;
74
81
  padding: 2px 4px 4px;
75
82
  font: inherit;
76
- font-size: 0.72rem;
77
83
  color: var(--md-sys-color-on-surface);
78
84
  background: none;
79
85
  border: 1px solid var(--md-sys-color-outline-variant);
@@ -92,7 +98,6 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
92
98
  position: absolute;
93
99
  width: 72px;
94
100
  font: inherit;
95
- font-size: 0.75rem;
96
101
  }
97
102
  small[warn] {
98
103
  color: var(--md-sys-color-tertiary);
@@ -112,11 +117,9 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
112
117
  }
113
118
  /** The target box, its faces pressed; or the plane. */
114
119
  renderTarget() {
120
+ /* The plane is one face, named in the list and on the face drawn below: nothing to pick, so no picture of it. */
115
121
  if (!this.target)
116
- return svg `<svg viewBox="0 0 ${PANEL_W} 90" role="img" aria-label=${this.planeWord}>
117
- <path d="M30 80 L110 30 L270 30 L190 80 Z" style="fill:var(--md-sys-color-primary);fill-opacity:.35;stroke:var(--md-sys-color-primary);stroke-width:1.5" />
118
- <text x="150" y="62" text-anchor="middle" font-size="12" style="fill:var(--md-sys-color-on-primary-container)">${this.planeWord}</text>
119
- </svg>`;
122
+ return nothing;
120
123
  const has = (f) => this.faces.includes(f);
121
124
  /* A press is a whole change, as a drag let go is: the form applies a fastening the part already has. */
122
125
  const pick = (f) => () => {
@@ -128,7 +131,7 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
128
131
  const seen = SEEN.map(([f, d]) => {
129
132
  const on = this.face === f;
130
133
  return svg `<path face=${f} d=${d} @click=${pick(f)}
131
- style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-primary-container)'};fill-opacity:${on ? 0.55 : has(f) ? 1 : 0.35};stroke:var(--md-sys-color-primary);stroke-width:1.5`}>
134
+ style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary-container)' : 'var(--md-sys-color-surface-container)'};fill-opacity:${has(f) ? 1 : 0.4};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-width:${on ? 2 : 1}`}>
132
135
  <title>${i18next.t('figure.label.face-' + f)}</title></path>`;
133
136
  });
134
137
  const hidden = HIDDEN.map(([f, x, y]) => {
@@ -141,9 +144,9 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
141
144
  });
142
145
  /* A shape's faces beyond its six outer ones -- a door frame's opening -- are tags of their own under the box. */
143
146
  const others = this.faces.filter(f => !SEEN.some(([s]) => s === f) && !HIDDEN.some(([h]) => h === f));
144
- return html `${svg `<svg viewBox="0 0 ${PANEL_W} 126" role="img" aria-label=${this.target}>
147
+ return html `${svg `<svg viewBox="-20 0 ${PANEL_W} 126" role="img" aria-label=${this.target}>
145
148
  ${seen}
146
- <text x="110" y="70" text-anchor="middle" font-size="12" pointer-events="none" style="fill:var(--md-sys-color-on-primary-container)">${this.target}</text>
149
+ <text x="110" y="70" text-anchor="middle" font-size="12" pointer-events="none" style="fill:var(--md-sys-color-on-surface)">${this.target}</text>
147
150
  ${hidden}
148
151
  </svg>`}
149
152
  ${others.length
@@ -154,17 +157,20 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
154
157
  }
155
158
  /** How: three side views; the chosen one's gap is dragged. */
156
159
  renderModes() {
160
+ /* One way only (the plane is set on): the sentence says it; a single choice is not offered as a button. */
161
+ if (this.modes.length < 2)
162
+ return nothing;
157
163
  const icon = (m, on) => {
158
164
  const g = on && m !== 'centre' ? Math.min(this.gap / 4, 10) : 0;
159
165
  const base = svg `<rect x="6" y="30" width="52" height="14" style="fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary)" />`;
160
166
  const gapDrag = on && !this.locked ? 'ns-resize' : 'pointer';
161
167
  if (m === 'meet')
162
- return svg `<svg width="64" height="48">${base}<rect gap x="22" y=${18 - g} width="20" height="12" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />
168
+ return svg `<svg viewBox="0 0 64 48">${base}<rect gap x="22" y=${18 - g} width="20" height="12" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />
163
169
  ${g ? svg `<text x="46" y=${26 - g / 2} font-size="10" style="fill:currentColor">${this.gap}</text>` : nothing}</svg>`;
164
170
  if (m === 'flush')
165
- return svg `<svg width="64" height="48">${base}<rect gap x="22" y=${30 - g} width="20" height="10" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />
171
+ return svg `<svg viewBox="0 0 64 48">${base}<rect gap x="22" y=${30 - g} width="20" height="10" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />
166
172
  <line x1="4" y1="30" x2="60" y2="30" style="stroke:currentColor;stroke-dasharray:2 2" /></svg>`;
167
- return svg `<svg width="64" height="48">${base}<circle cx="32" cy="30" r="11" style="fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor" /><circle cx="32" cy="30" r="2" style="fill:currentColor" /></svg>`;
173
+ return svg `<svg viewBox="0 0 64 48">${base}<circle cx="32" cy="30" r="11" style="fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor" /><circle cx="32" cy="30" r="2" style="fill:currentColor" /></svg>`;
168
174
  };
169
175
  return html `<div modes>
170
176
  ${this.modes.map(m => {
@@ -278,8 +284,8 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
278
284
  @pointermove=${(ev) => this.drag(ev, view, cx, cy)}
279
285
  @pointerup=${() => this.drop()} @pointercancel=${() => this.drop()}>
280
286
  ${faceSized
281
- ? svg `<rect x=${fx} y=${fy} width=${fw} height=${fh} rx="2" style="fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.5" />`
282
- : svg `<rect x="4" y="4" width=${W - 8} height=${H - 8} rx="6" style="fill:var(--md-sys-color-primary-container);fill-opacity:.5" />`}
287
+ ? svg `<rect x=${fx} y=${fy} width=${fw} height=${fh} rx="4" style="fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2" />`
288
+ : svg `<rect x="1" y="1" width=${W - 2} height=${H - 2} rx="8" style="fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2" />`}
283
289
  <text x=${faceSized ? fx + 4 : 10} y=${faceSized ? fy + fh - 6 : 18} font-size="11" pointer-events="none" style="fill:var(--md-sys-color-primary)">${faceName}${sizeWords}</text>
284
290
  ${guide(h)}${guide(v)}
285
291
  <g footprint style=${`cursor:${this.locked ? 'default' : 'grab'}`} @pointerdown=${(ev) => this.grab(ev, at, caught)}>
@@ -1 +1 @@
1
- {"version":3,"file":"figure-fasten-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD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A/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA4C;AAC/C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAQ;AAEvB;IAAX,QAAQ,EAAE;;qDAAc;AACI;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;mDAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;iDAAa;AAGxB;IAAhB,KAAK,EAAE;;oDAAsF;AAC7E;IAAhB,KAAK,EAAE;;mDAAsB;AA3EnB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAwW/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureFace } from '@hatiolab/figure-model'\n\nimport { alignmentAt, offsetOf, overhangOf, screenOf, type FaceView, type FastenMode } from './fasten-geometry.js'\nimport type { Alignment } from './links.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** A change the drawing asks of the fastening form. */\nexport type FastenChange =\n | { targetFace: string }\n | { mode: FastenMode }\n | { axis: Axis; how: Alignment; mm?: number }\n | { gap: number }\n\nconst SEEN: Array<[FigureFace, string]> = [\n ['top', 'M60 30 L100 10 L200 10 L160 30 Z'],\n ['front', 'M60 30 L160 30 L160 100 L60 100 Z'],\n ['right', 'M160 30 L200 10 L200 80 L160 100 Z']\n]\n/** The faces the drawing cannot show on the box, as tags beside it where they are. */\nconst HIDDEN: Array<[FigureFace, number, number]> = [\n ['bottom', 30, 114],\n ['left', 24, 62],\n ['back', 236, 14]\n]\nconst PANEL_W = 300\n\n\n/**\n * 붙이기 그림 (user 2026-10-01) — which face of what the part is fastened to, how, and where on it; each of them chosen\n * by pressing or dragging the drawing, none by a list of faces.\n *\n * The target is drawn as a box whose faces are pressed (the three it hides as tags beside it), or as the one plane the\n * figure stands by. How is three small side views -- set on it, flush with it, its centre on it (only for a part that\n * turns about a joint) -- and the chosen one's gap is dragged. Where is the face seen from above with the part's\n * footprint on it: dragged, caught at the centre and at the edges from inside and outside, a guide drawn where it is\n * caught and a dimension where it is not, which is pressed to type the number. It may go past the edges: the part that\n * does is shaded, and a part off the face altogether is said so. Nothing is decided here: every change goes to the form\n * (`fasten-change`), and a press or a drag let go says so (`fasten-release`), for the form to apply a fastening it holds.\n */\n@customElement('figure-fasten-drawing')\nexport class FigureFastenDrawing extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n gap: 8px;\n outline: none;\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 div[modes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));\n gap: 6px;\n }\n div[modes] button {\n display: grid;\n justify-items: center;\n padding: 2px 4px 4px;\n font: inherit;\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 8px;\n cursor: pointer;\n }\n div[modes] button[on] {\n border: 1.5px solid var(--md-sys-color-primary);\n background: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n div[where] {\n position: relative;\n }\n div[where] input {\n position: absolute;\n width: 72px;\n font: inherit;\n font-size: 0.75rem;\n }\n small[warn] {\n color: var(--md-sys-color-tertiary);\n }\n small[off] {\n color: var(--md-sys-color-error);\n }\n `\n\n /** The target's name, or empty for the plane the figure stands by. */\n @property() target = ''\n /** The plane's name by the figure's placement: 바닥 · 천장 · 벽 · 중심. */\n @property() planeWord = ''\n @property({ attribute: false }) faces: string[] = []\n @property() face = ''\n @property({ attribute: false }) modes: FastenMode[] = ['meet', 'flush']\n @property() mode: FastenMode = 'meet'\n @property({ attribute: false }) view?: FaceView\n @property({ attribute: false }) align: Partial<Record<Axis, Alignment>> = {}\n @property({ attribute: false }) alignMm: Partial<Record<Axis, number>> = {}\n @property({ type: Number }) gap = 0\n /** The part being fastened (not `part`: that is every element's own). */\n @property() partName = ''\n @property({ type: Boolean }) locked = false\n /** The form already says how the fastening it has lies on the face: the drawing says it only while dragging. */\n @property({ type: Boolean }) said = false\n\n /** Where the footprint is while dragging, and what it is caught by; undefined when nothing is dragged. */\n @state() private dragged?: { at: Record<Axis, number>; caught: Partial<Record<Axis, string>> }\n @state() private typing?: Axis\n private scale = 1\n private gapFrom?: { y: number; gap: number }\n\n private change(detail: FastenChange) {\n this.dispatchEvent(new CustomEvent('fasten-change', { detail, bubbles: true, composed: true }))\n }\n private released() {\n this.dispatchEvent(new CustomEvent('fasten-release', { bubbles: true, composed: true }))\n }\n\n render() {\n return html`${this.renderTarget()}${this.renderModes()}${this.renderWhere()}`\n }\n\n /** The target box, its faces pressed; or the plane. */\n private renderTarget() {\n if (!this.target)\n return svg`<svg viewBox=\"0 0 ${PANEL_W} 90\" role=\"img\" aria-label=${this.planeWord}>\n <path d=\"M30 80 L110 30 L270 30 L190 80 Z\" style=\"fill:var(--md-sys-color-primary);fill-opacity:.35;stroke:var(--md-sys-color-primary);stroke-width:1.5\" />\n <text x=\"150\" y=\"62\" text-anchor=\"middle\" font-size=\"12\" style=\"fill:var(--md-sys-color-on-primary-container)\">${this.planeWord}</text>\n </svg>`\n const has = (f: string) => this.faces.includes(f)\n /* A press is a whole change, as a drag let go is: the form applies a fastening the part already has. */\n const pick = (f: string) => () => {\n if (this.locked || !has(f) || f === this.face) return\n this.change({ targetFace: f })\n this.released()\n }\n const seen = SEEN.map(([f, d]) => {\n const on = this.face === f\n return svg`<path face=${f} d=${d} @click=${pick(f)}\n style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-primary-container)'};fill-opacity:${on ? 0.55 : has(f) ? 1 : 0.35};stroke:var(--md-sys-color-primary);stroke-width:1.5`}>\n <title>${i18next.t('figure.label.face-' + f)}</title></path>`\n })\n const hidden = HIDDEN.map(([f, x, y]) => {\n const on = this.face === f\n return svg`<g face=${f} @click=${pick(f)} style=${`cursor:${has(f) ? 'pointer' : 'default'};opacity:${has(f) ? 1 : 0.35}`}>\n <rect x=${x - 26} y=${y - 10} width=\"52\" height=\"20\" rx=\"10\"\n style=${`fill:${on ? 'var(--md-sys-color-primary-container)' : 'transparent'};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-dasharray:${on ? '' : '3 2'}`} />\n <text x=${x} y=${y + 4} text-anchor=\"middle\" font-size=\"11\" style=${`fill:${on ? 'var(--md-sys-color-on-primary-container)' : 'var(--md-sys-color-on-surface-variant)'}`}>${i18next.t('figure.label.face-' + f)}</text>\n </g>`\n })\n /* A shape's faces beyond its six outer ones -- a door frame's opening -- are tags of their own under the box. */\n const others = this.faces.filter(f => !SEEN.some(([s]) => s === f) && !HIDDEN.some(([h]) => h === f))\n return html`${svg`<svg viewBox=\"0 0 ${PANEL_W} 126\" role=\"img\" aria-label=${this.target}>\n ${seen}\n <text x=\"110\" y=\"70\" text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-primary-container)\">${this.target}</text>\n ${hidden}\n </svg>`}\n ${others.length\n ? html`<div modes>\n ${others.map(f => html`<button ?on=${f === this.face} ?disabled=${this.locked} @click=${pick(f)}>${i18next.t('figure.label.face-' + f, { defaultValue: f })}</button>`)}\n </div>`\n : nothing}`\n }\n\n /** How: three side views; the chosen one's gap is dragged. */\n private renderModes() {\n const icon = (m: FastenMode, on: boolean) => {\n const g = on && m !== 'centre' ? Math.min(this.gap / 4, 10) : 0\n const base = svg`<rect x=\"6\" y=\"30\" width=\"52\" height=\"14\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary)\" />`\n const gapDrag = on && !this.locked ? 'ns-resize' : 'pointer'\n if (m === 'meet')\n return svg`<svg width=\"64\" height=\"48\">${base}<rect gap x=\"22\" y=${18 - g} width=\"20\" height=\"12\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n ${g ? svg`<text x=\"46\" y=${26 - g / 2} font-size=\"10\" style=\"fill:currentColor\">${this.gap}</text>` : nothing}</svg>`\n if (m === 'flush')\n return svg`<svg width=\"64\" height=\"48\">${base}<rect gap x=\"22\" y=${30 - g} width=\"20\" height=\"10\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n <line x1=\"4\" y1=\"30\" x2=\"60\" y2=\"30\" style=\"stroke:currentColor;stroke-dasharray:2 2\" /></svg>`\n return svg`<svg width=\"64\" height=\"48\">${base}<circle cx=\"32\" cy=\"30\" r=\"11\" style=\"fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor\" /><circle cx=\"32\" cy=\"30\" r=\"2\" style=\"fill:currentColor\" /></svg>`\n }\n return html`<div modes>\n ${this.modes.map(m => {\n const on = m === this.mode\n return html`<button mode=${m} ?on=${on} ?disabled=${this.locked}\n @click=${() => {\n if (on) return\n this.change({ mode: m })\n this.released()\n }}\n @pointerdown=${(ev: PointerEvent) => {\n if (!on || this.locked || !(ev.target as Element).hasAttribute?.('gap')) return\n ev.preventDefault()\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n this.gapFrom = { y: ev.clientY, gap: this.gap }\n }}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.gapFrom) return\n this.change({ gap: Math.max(0, Math.round(this.gapFrom.gap + (this.gapFrom.y - ev.clientY) * 2)) })\n }}\n @pointerup=${() => {\n if (!this.gapFrom) return\n this.gapFrom = undefined\n this.released()\n }}>\n ${icon(m, on)}<span>${i18next.t('figure.label.fasten-mode-' + m)}</span>\n </button>`\n })}\n </div>`\n }\n\n /** Where the part's centre is on each axis now: the drag's, or the form's. */\n private centreOf(view: FaceView): Record<Axis, number> {\n if (this.dragged) return this.dragged.at\n const at = { x: 0, y: 0, z: 0 }\n for (const a of view.axes) at[a] = offsetOf(this.align[a], this.alignMm[a], view.face[a], view.part[a])\n return at\n }\n\n /** What each axis is caught by now: at the centre, level with an edge, touching one from outside, or nothing. */\n private caughtOf(view: FaceView, at: Record<Axis, number>): Partial<Record<Axis, string>> {\n if (this.dragged) return this.dragged.caught\n const out: Partial<Record<Axis, string>> = {}\n for (const a of view.axes) {\n const how = this.align[a] ?? 'centre'\n if (how === 'centre') out[a] = 'centre'\n else if (how === 'min' || how === 'max') out[a] = 'inside'\n else if (view.face[a] !== undefined && Math.abs(Math.abs(at[a]) - (view.face[a]! + view.part[a]) / 2) < 0.5) out[a] = 'outside'\n }\n return out\n }\n\n private renderWhere() {\n const view = this.view\n if (!view) return nothing\n const { h, v, sign } = screenOf(view.axes)\n const W = PANEL_W,\n H = 180\n /* Room around the face for the part to go past its edges by about half itself; a plane with no size, three parts wide. */\n const span = (a: Axis) => (view.face[a] !== undefined ? view.face[a]! + view.part[a] : view.part[a] * 3)\n const k = Math.min((W - 40) / span(h), (H - 40) / span(v))\n this.scale = k\n const cx = W / 2,\n cy = H / 2\n const at = this.centreOf(view)\n const caught = this.caughtOf(view, at)\n const fw = (view.face[h] ?? 0) * k,\n fh = (view.face[v] ?? 0) * k\n const pw = view.part[h] * k,\n ph = view.part[v] * k\n const px = cx + sign[h] * at[h] * k - pw / 2,\n py = cy + sign[v] * at[v] * k - ph / 2\n const faceSized = view.face[h] !== undefined && view.face[v] !== undefined\n const fx = cx - fw / 2,\n fy = cy - fh / 2\n const ix = Math.max(fx, px),\n iy = Math.max(fy, py)\n const iw = Math.min(fx + fw, px + pw) - ix,\n ih = Math.min(fy + fh, py + ph) - iy\n const { touching, sides } = faceSized ? overhangOf(view, at) : { touching: true, sides: [] as ReturnType<typeof overhangOf>['sides'] }\n const round = this.mode === 'centre'\n const guide = (a: Axis) => {\n const c = caught[a]\n if (!c) return nothing\n const along = a === h\n const edge = c === 'centre' ? 0 : Math.sign(at[a]) * (view.face[a] ?? 0) / 2\n const pos = (along ? cx : cy) + sign[a] * edge * k\n const style = `stroke:var(--md-sys-color-primary);stroke-width:${c === 'centre' ? 1 : 2.5};stroke-dasharray:${c === 'centre' ? '4 3' : ''}`\n return along ? svg`<line x1=${pos} y1=\"4\" x2=${pos} y2=${H - 4} style=${style} />` : svg`<line x1=\"4\" y1=${pos} x2=${W - 4} y2=${pos} style=${style} />`\n }\n const dim = (a: Axis) => {\n /* Caught by the centre or an edge, the guide says where it is; a number only where nothing caught it. */\n if (caught[a]) return nothing\n const along = a === h\n const mm = Math.round(at[a])\n const label = `${mm > 0 ? '+' : ''}${mm} mm`\n const to = sign[a] * at[a] * k\n const tx = along ? cx + to / 2 : 8,\n ty = along ? H - 6 : cy + to / 2 + 4\n return svg`${along\n ? svg`<line x1=${cx} y1=${H - 16} x2=${cx + to} y2=${H - 16} style=\"stroke:var(--md-sys-color-on-surface)\" />`\n : svg`<line x1=\"20\" y1=${cy} x2=\"20\" y2=${cy + to} style=\"stroke:var(--md-sys-color-on-surface)\" />`}\n <text dim=${a} x=${tx} y=${ty} font-size=\"11\" text-anchor=${along ? 'middle' : 'start'}\n style=\"fill:var(--md-sys-color-primary);cursor:text;text-decoration:underline dotted\" @click=${() => !this.locked && (this.typing = a)}>${label}</text>`\n }\n const faceName = this.target ? `${this.target} ${i18next.t('figure.label.face-' + this.face)}` : this.planeWord\n const sizeWords = faceSized ? ` ${Math.round(view.face[h]!)} × ${Math.round(view.face[v]!)}` : ''\n return html`<div where tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.keys(ev, view)}>\n ${svg`<svg viewBox=\"0 0 ${W} ${H}\" role=\"img\" aria-label=${faceName}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, view, cx, cy)}\n @pointerup=${() => this.drop()} @pointercancel=${() => this.drop()}>\n ${faceSized\n ? svg`<rect x=${fx} y=${fy} width=${fw} height=${fh} rx=\"2\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:1.5\" />`\n : svg`<rect x=\"4\" y=\"4\" width=${W - 8} height=${H - 8} rx=\"6\" style=\"fill:var(--md-sys-color-primary-container);fill-opacity:.5\" />`}\n <text x=${faceSized ? fx + 4 : 10} y=${faceSized ? fy + fh - 6 : 18} font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${faceName}${sizeWords}</text>\n ${guide(h)}${guide(v)}\n <g footprint style=${`cursor:${this.locked ? 'default' : 'grab'}`} @pointerdown=${(ev: PointerEvent) => this.grab(ev, at, caught)}>\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-tertiary-container)\" />\n ${faceSized && iw > 0 && ih > 0\n ? svg`<rect x=${ix} y=${iy} width=${iw} height=${ih} rx=${round ? Math.min(iw, ih) / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : !faceSized\n ? svg`<rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : nothing}\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2}\n style=${`fill:none;stroke:var(--md-sys-color-on-surface);stroke-width:1.5;stroke-dasharray:${touching ? '' : '4 3'}`} />\n <text x=${px + pw / 2} y=${py + ph / 2 + 4} text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.partName}</text>\n </g>\n ${dim(h)}${dim(v)}\n </svg>`}\n ${this.typing ? this.renderTyping(view, this.typing, at) : nothing}\n </div>\n ${this.said && !this.dragged\n ? nothing\n : !touching\n ? html`<small off role=\"status\">${i18next.t('figure.text.fasten-off-face', { face: faceName })}</small>`\n : sides.length\n ? html`<small warn role=\"status\">${i18next.t('figure.text.fasten-past-edges', {\n sides: sides.map(s => i18next.t(`figure.text.overhang-side-${s.side}`, { axis: s.axis.toUpperCase(), mm: String(s.mm) })).join(' · ')\n })}</small>`\n : nothing}`\n }\n\n private renderTyping(view: FaceView, a: Axis, at: Record<Axis, number>) {\n const along = a === screenOf(view.axes).h\n return html`<input type=\"number\" step=\"1\" aria-label=${`${a.toUpperCase()} mm`} .value=${String(Math.round(at[a]))}\n style=${along ? 'left: calc(50% - 36px); bottom: 0' : 'left: 4px; top: calc(50% - 12px)'}\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)) return\n this.change({ axis: a, how: 'mm', mm: Math.round(value) })\n this.released()\n }}\n @blur=${() => (this.typing = undefined)} />`\n }\n\n private grab(ev: PointerEvent, at: Record<Axis, number>, caught: Partial<Record<Axis, string>>) {\n if (this.locked) return\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragged = { at: { ...at }, caught: { ...caught } }\n }\n\n /** The footprint follows the pointer, caught at the centre and edges within a few pixels. */\n private drag(ev: PointerEvent, view: FaceView, cx: number, cy: number) {\n if (!this.dragged) return\n const svgEl = ev.currentTarget as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n const p = pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n const { h, v, sign } = screenOf(view.axes)\n const at = { ...this.dragged.at },\n caught: Partial<Record<Axis, string>> = {}\n for (const [a, d] of [\n [h, (sign[h] * (p.x - cx)) / this.scale],\n [v, (sign[v] * (p.y - cy)) / this.scale]\n ] as const) {\n const got = alignmentAt(d, view.face[a], view.part[a], view.edges[a], 8 / this.scale)\n at[a] = offsetOf(got.how, got.mm, view.face[a], view.part[a])\n if (got.caught) caught[a] = got.caught\n }\n this.dragged = { at, caught }\n }\n\n private drop() {\n const d = this.dragged\n if (!d || !this.view) return\n this.dragged = undefined\n for (const a of this.view.axes) {\n const got = alignmentAt(d.at[a], this.view.face[a], this.view.part[a], this.view.edges[a], 0.5)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n }\n this.released()\n }\n\n /** Arrows move the part a millimetre, ten with Shift; the centre and edges still catch it. */\n private keys(ev: KeyboardEvent, view: FaceView) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[ev.key]\n if (!step || this.locked || this.typing) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 10 : 1\n const at = this.centreOf(view)\n const { h, v, sign } = screenOf(view.axes)\n ;[h, v].forEach((a, i) => {\n if (!step[i]) return\n /* Up the screen is up the face: a Y that rises goes up with the arrow. */\n const got = alignmentAt(at[a] + sign[a] * step[i]! * by, view.face[a], view.part[a], view.edges[a], by / 2)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n })\n this.released()\n }\n}\n"]}
1
+ {"version":3,"file":"figure-fasten-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-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;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAkC,MAAM,sBAAsB,CAAA;AAYlH,MAAM,IAAI,GAAgC;IACxC,CAAC,KAAK,EAAE,kCAAkC,CAAC;IAC3C,CAAC,OAAO,EAAE,mCAAmC,CAAC;IAC9C,CAAC,OAAO,EAAE,oCAAoC,CAAC;CAChD,CAAA;AACD,sFAAsF;AACtF,mHAAmH;AACnH,MAAM,MAAM,GAAwC;IAClD,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC;IACnB,CAAC,MAAM,E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;;mDAAsB;AA/EnB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA2W/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureFace } from '@hatiolab/figure-model'\n\nimport { alignmentAt, offsetOf, overhangOf, screenOf, type FaceView, type FastenMode } from './fasten-geometry.js'\nimport type { Alignment } from './links.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** A change the drawing asks of the fastening form. */\nexport type FastenChange =\n | { targetFace: string }\n | { mode: FastenMode }\n | { axis: Axis; how: Alignment; mm?: number }\n | { gap: number }\n\nconst SEEN: Array<[FigureFace, string]> = [\n ['top', 'M60 30 L100 10 L200 10 L160 30 Z'],\n ['front', 'M60 30 L160 30 L160 100 L60 100 Z'],\n ['right', 'M160 30 L200 10 L200 80 L160 100 Z']\n]\n/** The faces the drawing cannot show on the box, as tags beside it where they are. */\n/* The box is drawn a little left of its picture's middle, and the viewBox shifts it back to the panel's centre. */\nconst HIDDEN: Array<[FigureFace, number, number]> = [\n ['bottom', 30, 114],\n ['left', 24, 62],\n ['back', 236, 14]\n]\nconst PANEL_W = 300\n\n\n/**\n * 붙이기 그림 (user 2026-10-01) — which face of what the part is fastened to, how, and where on it; each of them chosen\n * by pressing or dragging the drawing, none by a list of faces.\n *\n * The target is drawn as a box whose faces are pressed (the three it hides as tags beside it), or as the one plane the\n * figure stands by. How is three small side views -- set on it, flush with it, its centre on it (only for a part that\n * turns about a joint) -- and the chosen one's gap is dragged. Where is the face seen from above with the part's\n * footprint on it: dragged, caught at the centre and at the edges from inside and outside, a guide drawn where it is\n * caught and a dimension where it is not, which is pressed to type the number. It may go past the edges: the part that\n * does is shaded, and a part off the face altogether is said so. Nothing is decided here: every change goes to the form\n * (`fasten-change`), and a press or a drag let go says so (`fasten-release`), for the form to apply a fastening it holds.\n */\n@customElement('figure-fasten-drawing')\nexport class FigureFastenDrawing extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n gap: 8px;\n outline: none;\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 div[modes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));\n gap: 6px;\n }\n div[modes] svg {\n width: 64px;\n height: 44px;\n }\n div[modes] button {\n display: grid;\n justify-items: center;\n align-content: center;\n gap: 2px;\n padding: 2px 4px 4px;\n font: inherit;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 8px;\n cursor: pointer;\n }\n div[modes] button[on] {\n border: 1.5px solid var(--md-sys-color-primary);\n background: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n div[where] {\n position: relative;\n }\n div[where] input {\n position: absolute;\n width: 72px;\n font: inherit;\n }\n small[warn] {\n color: var(--md-sys-color-tertiary);\n }\n small[off] {\n color: var(--md-sys-color-error);\n }\n `\n\n /** The target's name, or empty for the plane the figure stands by. */\n @property() target = ''\n /** The plane's name by the figure's placement: 바닥 · 천장 · 벽 · 중심. */\n @property() planeWord = ''\n @property({ attribute: false }) faces: string[] = []\n @property() face = ''\n @property({ attribute: false }) modes: FastenMode[] = ['meet', 'flush']\n @property() mode: FastenMode = 'meet'\n @property({ attribute: false }) view?: FaceView\n @property({ attribute: false }) align: Partial<Record<Axis, Alignment>> = {}\n @property({ attribute: false }) alignMm: Partial<Record<Axis, number>> = {}\n @property({ type: Number }) gap = 0\n /** The part being fastened (not `part`: that is every element's own). */\n @property() partName = ''\n @property({ type: Boolean }) locked = false\n /** The form already says how the fastening it has lies on the face: the drawing says it only while dragging. */\n @property({ type: Boolean }) said = false\n\n /** Where the footprint is while dragging, and what it is caught by; undefined when nothing is dragged. */\n @state() private dragged?: { at: Record<Axis, number>; caught: Partial<Record<Axis, string>> }\n @state() private typing?: Axis\n private scale = 1\n private gapFrom?: { y: number; gap: number }\n\n private change(detail: FastenChange) {\n this.dispatchEvent(new CustomEvent('fasten-change', { detail, bubbles: true, composed: true }))\n }\n private released() {\n this.dispatchEvent(new CustomEvent('fasten-release', { bubbles: true, composed: true }))\n }\n\n render() {\n return html`${this.renderTarget()}${this.renderModes()}${this.renderWhere()}`\n }\n\n /** The target box, its faces pressed; or the plane. */\n private renderTarget() {\n /* The plane is one face, named in the list and on the face drawn below: nothing to pick, so no picture of it. */\n if (!this.target) return nothing\n const has = (f: string) => this.faces.includes(f)\n /* A press is a whole change, as a drag let go is: the form applies a fastening the part already has. */\n const pick = (f: string) => () => {\n if (this.locked || !has(f) || f === this.face) return\n this.change({ targetFace: f })\n this.released()\n }\n const seen = SEEN.map(([f, d]) => {\n const on = this.face === f\n return svg`<path face=${f} d=${d} @click=${pick(f)}\n style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary-container)' : 'var(--md-sys-color-surface-container)'};fill-opacity:${has(f) ? 1 : 0.4};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-width:${on ? 2 : 1}`}>\n <title>${i18next.t('figure.label.face-' + f)}</title></path>`\n })\n const hidden = HIDDEN.map(([f, x, y]) => {\n const on = this.face === f\n return svg`<g face=${f} @click=${pick(f)} style=${`cursor:${has(f) ? 'pointer' : 'default'};opacity:${has(f) ? 1 : 0.35}`}>\n <rect x=${x - 26} y=${y - 10} width=\"52\" height=\"20\" rx=\"10\"\n style=${`fill:${on ? 'var(--md-sys-color-primary-container)' : 'transparent'};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-dasharray:${on ? '' : '3 2'}`} />\n <text x=${x} y=${y + 4} text-anchor=\"middle\" font-size=\"11\" style=${`fill:${on ? 'var(--md-sys-color-on-primary-container)' : 'var(--md-sys-color-on-surface-variant)'}`}>${i18next.t('figure.label.face-' + f)}</text>\n </g>`\n })\n /* A shape's faces beyond its six outer ones -- a door frame's opening -- are tags of their own under the box. */\n const others = this.faces.filter(f => !SEEN.some(([s]) => s === f) && !HIDDEN.some(([h]) => h === f))\n return html`${svg`<svg viewBox=\"-20 0 ${PANEL_W} 126\" role=\"img\" aria-label=${this.target}>\n ${seen}\n <text x=\"110\" y=\"70\" text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.target}</text>\n ${hidden}\n </svg>`}\n ${others.length\n ? html`<div modes>\n ${others.map(f => html`<button ?on=${f === this.face} ?disabled=${this.locked} @click=${pick(f)}>${i18next.t('figure.label.face-' + f, { defaultValue: f })}</button>`)}\n </div>`\n : nothing}`\n }\n\n /** How: three side views; the chosen one's gap is dragged. */\n private renderModes() {\n /* One way only (the plane is set on): the sentence says it; a single choice is not offered as a button. */\n if (this.modes.length < 2) return nothing\n const icon = (m: FastenMode, on: boolean) => {\n const g = on && m !== 'centre' ? Math.min(this.gap / 4, 10) : 0\n const base = svg`<rect x=\"6\" y=\"30\" width=\"52\" height=\"14\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary)\" />`\n const gapDrag = on && !this.locked ? 'ns-resize' : 'pointer'\n if (m === 'meet')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${18 - g} width=\"20\" height=\"12\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n ${g ? svg`<text x=\"46\" y=${26 - g / 2} font-size=\"10\" style=\"fill:currentColor\">${this.gap}</text>` : nothing}</svg>`\n if (m === 'flush')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${30 - g} width=\"20\" height=\"10\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n <line x1=\"4\" y1=\"30\" x2=\"60\" y2=\"30\" style=\"stroke:currentColor;stroke-dasharray:2 2\" /></svg>`\n return svg`<svg viewBox=\"0 0 64 48\">${base}<circle cx=\"32\" cy=\"30\" r=\"11\" style=\"fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor\" /><circle cx=\"32\" cy=\"30\" r=\"2\" style=\"fill:currentColor\" /></svg>`\n }\n return html`<div modes>\n ${this.modes.map(m => {\n const on = m === this.mode\n return html`<button mode=${m} ?on=${on} ?disabled=${this.locked}\n @click=${() => {\n if (on) return\n this.change({ mode: m })\n this.released()\n }}\n @pointerdown=${(ev: PointerEvent) => {\n if (!on || this.locked || !(ev.target as Element).hasAttribute?.('gap')) return\n ev.preventDefault()\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n this.gapFrom = { y: ev.clientY, gap: this.gap }\n }}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.gapFrom) return\n this.change({ gap: Math.max(0, Math.round(this.gapFrom.gap + (this.gapFrom.y - ev.clientY) * 2)) })\n }}\n @pointerup=${() => {\n if (!this.gapFrom) return\n this.gapFrom = undefined\n this.released()\n }}>\n ${icon(m, on)}<span>${i18next.t('figure.label.fasten-mode-' + m)}</span>\n </button>`\n })}\n </div>`\n }\n\n /** Where the part's centre is on each axis now: the drag's, or the form's. */\n private centreOf(view: FaceView): Record<Axis, number> {\n if (this.dragged) return this.dragged.at\n const at = { x: 0, y: 0, z: 0 }\n for (const a of view.axes) at[a] = offsetOf(this.align[a], this.alignMm[a], view.face[a], view.part[a])\n return at\n }\n\n /** What each axis is caught by now: at the centre, level with an edge, touching one from outside, or nothing. */\n private caughtOf(view: FaceView, at: Record<Axis, number>): Partial<Record<Axis, string>> {\n if (this.dragged) return this.dragged.caught\n const out: Partial<Record<Axis, string>> = {}\n for (const a of view.axes) {\n const how = this.align[a] ?? 'centre'\n if (how === 'centre') out[a] = 'centre'\n else if (how === 'min' || how === 'max') out[a] = 'inside'\n else if (view.face[a] !== undefined && Math.abs(Math.abs(at[a]) - (view.face[a]! + view.part[a]) / 2) < 0.5) out[a] = 'outside'\n }\n return out\n }\n\n private renderWhere() {\n const view = this.view\n if (!view) return nothing\n const { h, v, sign } = screenOf(view.axes)\n const W = PANEL_W,\n H = 180\n /* Room around the face for the part to go past its edges by about half itself; a plane with no size, three parts wide. */\n const span = (a: Axis) => (view.face[a] !== undefined ? view.face[a]! + view.part[a] : view.part[a] * 3)\n const k = Math.min((W - 40) / span(h), (H - 40) / span(v))\n this.scale = k\n const cx = W / 2,\n cy = H / 2\n const at = this.centreOf(view)\n const caught = this.caughtOf(view, at)\n const fw = (view.face[h] ?? 0) * k,\n fh = (view.face[v] ?? 0) * k\n const pw = view.part[h] * k,\n ph = view.part[v] * k\n const px = cx + sign[h] * at[h] * k - pw / 2,\n py = cy + sign[v] * at[v] * k - ph / 2\n const faceSized = view.face[h] !== undefined && view.face[v] !== undefined\n const fx = cx - fw / 2,\n fy = cy - fh / 2\n const ix = Math.max(fx, px),\n iy = Math.max(fy, py)\n const iw = Math.min(fx + fw, px + pw) - ix,\n ih = Math.min(fy + fh, py + ph) - iy\n const { touching, sides } = faceSized ? overhangOf(view, at) : { touching: true, sides: [] as ReturnType<typeof overhangOf>['sides'] }\n const round = this.mode === 'centre'\n const guide = (a: Axis) => {\n const c = caught[a]\n if (!c) return nothing\n const along = a === h\n const edge = c === 'centre' ? 0 : Math.sign(at[a]) * (view.face[a] ?? 0) / 2\n const pos = (along ? cx : cy) + sign[a] * edge * k\n const style = `stroke:var(--md-sys-color-primary);stroke-width:${c === 'centre' ? 1 : 2.5};stroke-dasharray:${c === 'centre' ? '4 3' : ''}`\n return along ? svg`<line x1=${pos} y1=\"4\" x2=${pos} y2=${H - 4} style=${style} />` : svg`<line x1=\"4\" y1=${pos} x2=${W - 4} y2=${pos} style=${style} />`\n }\n const dim = (a: Axis) => {\n /* Caught by the centre or an edge, the guide says where it is; a number only where nothing caught it. */\n if (caught[a]) return nothing\n const along = a === h\n const mm = Math.round(at[a])\n const label = `${mm > 0 ? '+' : ''}${mm} mm`\n const to = sign[a] * at[a] * k\n const tx = along ? cx + to / 2 : 8,\n ty = along ? H - 6 : cy + to / 2 + 4\n return svg`${along\n ? svg`<line x1=${cx} y1=${H - 16} x2=${cx + to} y2=${H - 16} style=\"stroke:var(--md-sys-color-on-surface)\" />`\n : svg`<line x1=\"20\" y1=${cy} x2=\"20\" y2=${cy + to} style=\"stroke:var(--md-sys-color-on-surface)\" />`}\n <text dim=${a} x=${tx} y=${ty} font-size=\"11\" text-anchor=${along ? 'middle' : 'start'}\n style=\"fill:var(--md-sys-color-primary);cursor:text;text-decoration:underline dotted\" @click=${() => !this.locked && (this.typing = a)}>${label}</text>`\n }\n const faceName = this.target ? `${this.target} ${i18next.t('figure.label.face-' + this.face)}` : this.planeWord\n const sizeWords = faceSized ? ` ${Math.round(view.face[h]!)} × ${Math.round(view.face[v]!)}` : ''\n return html`<div where tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.keys(ev, view)}>\n ${svg`<svg viewBox=\"0 0 ${W} ${H}\" role=\"img\" aria-label=${faceName}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, view, cx, cy)}\n @pointerup=${() => this.drop()} @pointercancel=${() => this.drop()}>\n ${faceSized\n ? svg`<rect x=${fx} y=${fy} width=${fw} height=${fh} rx=\"4\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`\n : svg`<rect x=\"1\" y=\"1\" width=${W - 2} height=${H - 2} rx=\"8\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`}\n <text x=${faceSized ? fx + 4 : 10} y=${faceSized ? fy + fh - 6 : 18} font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${faceName}${sizeWords}</text>\n ${guide(h)}${guide(v)}\n <g footprint style=${`cursor:${this.locked ? 'default' : 'grab'}`} @pointerdown=${(ev: PointerEvent) => this.grab(ev, at, caught)}>\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-tertiary-container)\" />\n ${faceSized && iw > 0 && ih > 0\n ? svg`<rect x=${ix} y=${iy} width=${iw} height=${ih} rx=${round ? Math.min(iw, ih) / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : !faceSized\n ? svg`<rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : nothing}\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2}\n style=${`fill:none;stroke:var(--md-sys-color-on-surface);stroke-width:1.5;stroke-dasharray:${touching ? '' : '4 3'}`} />\n <text x=${px + pw / 2} y=${py + ph / 2 + 4} text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.partName}</text>\n </g>\n ${dim(h)}${dim(v)}\n </svg>`}\n ${this.typing ? this.renderTyping(view, this.typing, at) : nothing}\n </div>\n ${this.said && !this.dragged\n ? nothing\n : !touching\n ? html`<small off role=\"status\">${i18next.t('figure.text.fasten-off-face', { face: faceName })}</small>`\n : sides.length\n ? html`<small warn role=\"status\">${i18next.t('figure.text.fasten-past-edges', {\n sides: sides.map(s => i18next.t(`figure.text.overhang-side-${s.side}`, { axis: s.axis.toUpperCase(), mm: String(s.mm) })).join(' · ')\n })}</small>`\n : nothing}`\n }\n\n private renderTyping(view: FaceView, a: Axis, at: Record<Axis, number>) {\n const along = a === screenOf(view.axes).h\n return html`<input type=\"number\" step=\"1\" aria-label=${`${a.toUpperCase()} mm`} .value=${String(Math.round(at[a]))}\n style=${along ? 'left: calc(50% - 36px); bottom: 0' : 'left: 4px; top: calc(50% - 12px)'}\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)) return\n this.change({ axis: a, how: 'mm', mm: Math.round(value) })\n this.released()\n }}\n @blur=${() => (this.typing = undefined)} />`\n }\n\n private grab(ev: PointerEvent, at: Record<Axis, number>, caught: Partial<Record<Axis, string>>) {\n if (this.locked) return\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragged = { at: { ...at }, caught: { ...caught } }\n }\n\n /** The footprint follows the pointer, caught at the centre and edges within a few pixels. */\n private drag(ev: PointerEvent, view: FaceView, cx: number, cy: number) {\n if (!this.dragged) return\n const svgEl = ev.currentTarget as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n const p = pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n const { h, v, sign } = screenOf(view.axes)\n const at = { ...this.dragged.at },\n caught: Partial<Record<Axis, string>> = {}\n for (const [a, d] of [\n [h, (sign[h] * (p.x - cx)) / this.scale],\n [v, (sign[v] * (p.y - cy)) / this.scale]\n ] as const) {\n const got = alignmentAt(d, view.face[a], view.part[a], view.edges[a], 8 / this.scale)\n at[a] = offsetOf(got.how, got.mm, view.face[a], view.part[a])\n if (got.caught) caught[a] = got.caught\n }\n this.dragged = { at, caught }\n }\n\n private drop() {\n const d = this.dragged\n if (!d || !this.view) return\n this.dragged = undefined\n for (const a of this.view.axes) {\n const got = alignmentAt(d.at[a], this.view.face[a], this.view.part[a], this.view.edges[a], 0.5)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n }\n this.released()\n }\n\n /** Arrows move the part a millimetre, ten with Shift; the centre and edges still catch it. */\n private keys(ev: KeyboardEvent, view: FaceView) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[ev.key]\n if (!step || this.locked || this.typing) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 10 : 1\n const at = this.centreOf(view)\n const { h, v, sign } = screenOf(view.axes)\n ;[h, v].forEach((a, i) => {\n if (!step[i]) return\n /* Up the screen is up the face: a Y that rises goes up with the arrow. */\n const got = alignmentAt(at[a] + sign[a] * step[i]! * by, view.face[a], view.part[a], view.edges[a], by / 2)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n })\n this.released()\n }\n}\n"]}
@@ -101,17 +101,16 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
101
101
  div[resize-held] { display: grid; gap: 8px; margin: 12px 0; padding: 10px 12px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); }
102
102
  div[resize-held] p { margin: 0; display: flex; align-items: center; gap: 6px; }
103
103
  p[fasten-mode] { margin: 0; font-weight: 600; }
104
- p[fasten-mode][editing] { color: var(--md-sys-color-primary, #477b9e); }
105
104
  section[fastening][spotlit] { outline: 2px solid var(--md-sys-color-primary, #477b9e); outline-offset: 4px; border-radius: 6px; transition: outline-color 0.3s; }
106
- details { margin-top: 14px; }
107
- summary { cursor: pointer; padding: 8px 0; }
105
+ details { margin-top: 8px; }
108
106
  /* What the command would do, said beside the result drawn on the canvas. */
109
- ul[preview-words] { margin: 10px 0; padding: 8px 12px 8px 26px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); display: grid; gap: 4px; }
107
+ 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
+ p[preview-words] { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); }
110
109
  div[row-basis] { display: grid; gap: 4px; margin: 8px 0; }
111
110
  div[row-basis] label { display: flex; align-items: center; gap: 6px; }
112
111
  div[overhang] { display: grid; gap: 6px; margin: 8px 0; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline-variant, #8884); }
113
112
  div[overhang] p { margin: 0; }
114
- ul[detach-words] { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 2px; font-size: 0.8rem; opacity: 0.85; }
113
+ ul[detach-words] { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 2px; }
115
114
  span[fasten-summary] { opacity: 0.8; }
116
115
  /* The difference a following measure keeps: under its choice, on the same line as its words. */
117
116
  label[inline-plus] {
@@ -362,11 +361,11 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
362
361
  return html `<div resize-held>
363
362
  <p><md-icon>link</md-icon> ${where}</p>
364
363
  <button act open-fastening @click=${() => this.openFastening(asset)}>
365
- ${i18next.t('figure.button.open-fastening')}
364
+ <md-icon>link</md-icon>${i18next.t('figure.button.open-fastening')}
366
365
  </button>
367
366
  ${joint
368
367
  ? html `<button act detach-held ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>
369
- ${i18next.t('figure.button.detach-held')}
368
+ <md-icon>link_off</md-icon>${i18next.t('figure.button.detach-held')}
370
369
  </button>
371
370
  ${this.renderDetachWords()}`
372
371
  : nothing}
@@ -483,17 +482,12 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
483
482
  ...(f.twist ? [i18next.t('figure.text.fasten-summary-twist', { degrees: String(f.twist) })] : [])
484
483
  ];
485
484
  /*
486
- Editing the fastening it has, or fastening it anew: said, with the relation named, so the form is not taken for a
487
- blank new one while it holds the current (designer 2026-09-27). Applied unchanged, the same fastening is written
488
- again, fields and all (resize-with-placement.test).
485
+ 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
486
+ said once, by the sentence over the drawing -- the panel's head says it too; a third and a fourth line saying the
487
+ same (「현재 관계 수정」, 「붙은 곳」) went (user 2026-10-01, the panel checked for balance).
489
488
  */
490
489
  const current = asset.joints?.find(j => j.body1.part === this.partId);
491
- const editing = current
492
- ? i18next.t('figure.text.fasten-editing', {
493
- face: i18next.t(`figure.label.face-${current.body1.face}`),
494
- target: 'plane' in current.body0 ? i18next.t('figure.label.mounting-plane') : `${current.body0.part} · ${i18next.t(`figure.label.face-${current.body0.face}`)}`
495
- })
496
- : i18next.t('figure.text.fasten-new');
490
+ const editing = i18next.t('figure.text.fasten-new');
497
491
  /* A blank attachment is not a form to decipher. Ask for the thing to attach to first. */
498
492
  if (!current && !this.choosingFastening && !f.target)
499
493
  return html `
@@ -503,7 +497,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
503
497
  </button>
504
498
  `;
505
499
  return html `
506
- <p fasten-mode ?editing=${!!current}>${editing}</p>
500
+ ${current ? nothing : html `<p fasten-mode>${editing}</p>`}
507
501
  ${this.overhangNote.length ? html `<p hint overhang-note>${this.overhangNote.join(' ')}</p>` : nothing}
508
502
  ${this.overhangWords.length
509
503
  ? html `<div overhang role="status">
@@ -514,13 +508,12 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
514
508
  </div>`
515
509
  : nothing}
516
510
  ${held
517
- ? html `<div pair>
518
- <span>${i18next.t('figure.label.fastened-to')}: <b bound>${'plane' in held ? i18next.t('figure.label.mounting-plane') : held.part}</b></span>
511
+ ? html `<div fastened>
519
512
  <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>
520
513
  <md-icon>link_off</md-icon>${i18next.t('figure.button.detach')}
521
514
  </button>
522
- </div>
523
- ${this.renderDetachWords()}`
515
+ ${this.renderDetachWords()}
516
+ </div>`
524
517
  : nothing}
525
518
  <div form>
526
519
  <span>${i18next.t('figure.label.target-part')}</span>
@@ -600,6 +593,9 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
600
593
  this.command(this.fastenCandidate.action);
601
594
  }
602
595
  renderDetachWords() {
596
+ /* One thing to say is a line, not a list of one. */
597
+ if (this.detachWords.length === 1)
598
+ return html `<p hint detach-words>${this.detachWords[0]}</p>`;
603
599
  return this.detachWords.length ? html `<ul detach-words>${this.detachWords.map(line => html `<li>${line}</li>`)}</ul>` : nothing;
604
600
  }
605
601
  /**
@@ -640,6 +636,8 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
640
636
  * (the editor's) shows it and takes it away.
641
637
  */
642
638
  renderPreviewWords() {
639
+ if (this.previewWords.length === 1)
640
+ return html `<p preview-words role="status">${this.previewWords[0]}</p>`;
643
641
  return this.previewWords.length ? html `<ul preview-words role="status">${this.previewWords.map(line => html `<li>${line}</li>`)}</ul>` : nothing;
644
642
  }
645
643
  /**